Files
004_comission/_utils/_comment_backup/louis coding's Reviews on Carousell Hong Kong_files/20d21d61cb676f33.min.js.download
louiscklaw 6c60a73f30 update,
2025-01-31 19:15:17 +08:00

6 lines
8.3 KiB
Plaintext

"use strict";
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="455cb941-f07a-5684-b003-38b395b0fb81")}catch(e){}}();
(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[7],{1487:(e,t,s)=>{s.d(t,{Z:()=>S});var n=s(0),o=s(74),r=s(10),i=s(2421),a=s(398),l=s(40),c=s(405),u=s(731),d=s(407),h=s(72),p=s(397),m=s(21),g=s(15),f=s(53),_=s(403),v=s(404),b=s(412),C=s(107),D=s(17),x=s(18),w=s(729),j=s(113),y=s(73),N=s(411),k=s(867),L="D_apJ",Z="D_apH",T=s(1);const S=function(e){const{isOpen:t,onClose:s}=e,S=(0,r.v9)(m.l$),A=(0,r.v9)(f.ID),O=(0,r.v9)(y.Z2),R=(0,r.v9)(y.hW),E=(0,r.v9)(g.Xt),[B,I]=(0,n.useState)(""),[P,H]=(0,n.useState)("notSearching"),[F,M]=(0,n.useState)({}),[z,W]=(0,n.useState)(null),[K,q]=(0,n.useState)(!1);(0,n.useEffect)((()=>{if(q(!0),!t){const e=setTimeout((()=>{q(!1)}),200);return()=>{clearTimeout(e)}}}),[t]);const U=(0,C.c0)(t||K,"CategoriesSidebar",C.Fx.Sidebar);(0,b.Z)(t,void 0,C.Fx.Sidebar);const V=e=>{const t=e.currentTarget.attributes.getNamedItem("data-category-id");if(t?.nodeValue){const e=parseInt(t.nodeValue,10);W(e===z?null:e)}},$=e=>{const t=(0,D.u0)((0,D.bv)(E?.pathname??""));return(0,N.oA)((0,D.mq)({collection:e,defaultPath:(0,D.vd)([e])}),{source:"featured_categories_sidebar",...t?{source_cc_id:t}:{}},A)};return U?(0,o.createPortal)((0,T.jsx)(i.Z,{classNames:{enter:"D_apB",enterActive:"D_apC",exitActive:"D_apE"},in:t,mountOnEnter:!0,timeout:200,unmountOnExit:!0,children:(0,T.jsx)("div",{className:"D_ap_",onClick:s,children:(0,T.jsxs)("div",{className:"D_apA",onClick:e=>{e.stopPropagation()},children:[(0,T.jsxs)("div",{className:"D_apF",children:[(0,T.jsx)(h.Z,{size:"l",weight:"semibold",children:(0,T.jsx)(p.Z,{id:(0,x.ZP)("All Categories")})}),(0,T.jsx)(a.Z,{onClick:s,type:"icon",children:(0,T.jsx)(_.Z,{ariaLabel:S(x.ZP`Close`),name:v.T.close})})]}),(0,T.jsxs)("div",{className:"D_apG",children:[(0,T.jsx)(u.Z,{iconLeftURL:k,onChange:e=>{const t=e.currentTarget.value;if(W(null),I(t),t){let e=0;const s={};Object.values(O).forEach((n=>{n.name.toLowerCase().includes(t.toLowerCase())&&(s[n.id]=!0,e+=1)})),M(s),H(e>0?"hasResults":"noResults")}else M({}),H("notSearching")},placeholder:S((0,x.ZP)("Search categories...")),value:B}),(0,T.jsx)("div",{className:Z}),"noResults"===P?(0,T.jsx)(h.Z,{children:(0,T.jsx)(p.Z,{id:(0,x.ZP)("No results")})}):R.filter((e=>e!==j.K2)).map((e=>{const t=O[e];if(!t)return null;if(!(e=>{if(!B)return!0;const t=F[e.id],s=e.subcategories.find((e=>F[e]));return t||s})(t))return null;const o=(e=>(0,T.jsxs)("div",{className:"D_apI",children:[(0,T.jsxs)(d.Z,{className:"D_apK",onClick:s,to:$(e),children:[e.image_urls.homescreen?(0,T.jsx)(c.Z,{alt:"",ariaHidden:!0,className:L,cssHeight:l.spacing32,cssWidth:l.spacing32,src:e.image_urls.homescreen}):(0,T.jsx)("div",{className:L}),(0,T.jsx)(h.Z,{children:e.name})]}),!B&&e.subcategories.length>0&&(0,T.jsx)("div",{className:"D_apL","data-category-id":e.id,onClick:V,children:(0,T.jsx)(w.Z,{direction:e.id===z?"up":"down",useTransition:!0})})]},e.id))(t),r=(e=>{const t=e.subcategories.filter((t=>((e,t)=>t===z||B&&F[e])(t,e.id))).map((e=>{const t=O[e];return(0,T.jsx)(d.Z,{className:"D_apM",onClick:s,to:$(t),children:t.name},e)}));return(0,T.jsxs)(T.Fragment,{children:[t,t.length?(0,T.jsx)("div",{className:Z}):null]})})(t);return(0,T.jsxs)(n.Fragment,{children:[o,r]},t.cc_id)}))]})]})})}),U):null}},1311:(e,t,s)=>{s.d(t,{Z:()=>D});var n=s(9),o=s.n(n),r=s(0),i=s(100),a=s(72),l=s(403),c=s(404),u=s(1);const d=e=>{const{listItems:t,showIconChevron:s}=e;return(0,u.jsx)("ul",{className:"D_byB",children:t.map(((e,t)=>(0,u.jsxs)("li",{className:"D_byC",onClick:()=>e.onItemClick?.(t),children:[(0,u.jsx)(a.Z,{className:"D_byE",responsive:!0,children:e.title}),s?(0,u.jsx)(l.Z,{className:"D_byF",name:c.T.chevron_right}):null]},`list-${t}`)))})};var h=s(174);const p=e=>{const{title:t,bodyContent:s,buttonText:n,onButtonClick:r}=e;return(0,u.jsxs)("div",{className:"D_byy",children:[(0,u.jsxs)("div",{className:o()({D_byz:n}),children:[t?(0,u.jsx)(a.Z,{responsive:!0,weight:"semibold",children:t}):null,(0,u.jsx)("div",{className:o()({D_by_:t}),children:s})]}),n?(0,u.jsx)("div",{className:"D_byA",children:(0,u.jsx)(h.Z,{ariaLabel:n,onClick:r,size:"m",textContent:n,type:"text",variant:"primary"})}):null]})};var m="D_bai",g="D_baq",f="D_bau",_="D_baj";const v={customStyles:{},keepOpenOnTargetClick:!1,useTargetWidth:!1},b=(e,t)=>{const{variant:s,className:n,customStyles:a=v.customStyles,keepOpenOnTargetClick:l=v.keepOpenOnTargetClick,onHide:c,onMouseLeave:h,onMouseOver:b,show:C,useTargetWidth:D=v.useTargetWidth,container:x,target:w,showArrow:j,id:y}=e,[N,k]=(0,r.useState)(0),[L,Z]=(0,r.useState)(0),[T,S]=(0,r.useState)(void 0),A=(0,r.useRef)(null);r.useImperativeHandle(t,(()=>A.current));const O=(0,r.useRef)(null),[R,E]=(0,r.useState)(C),B=(0,r.useCallback)((()=>{const t=A.current;if(x&&w&&t){const s=(({popover:e,target:t,container:s,verticalAlign:n="bottom",showArrow:o,arrowPosition:r})=>{const i=t.getBoundingClientRect(),a=s.getBoundingClientRect(),{height:l,width:c}=e.getBoundingClientRect(),u={height:i.height,left:i.left-a.left,top:i.top-a.top,width:i.width},d=(()=>{const e=o?12:0;if(!o)return{left:u.left,top:"top"===n?u.top-l:u.top+u.height};switch(r){case"bottomCenter":return{left:u.left+(u.width-c)/2,top:u.top-l-e};case"bottomLeft":return{left:u.left,top:u.top-l-e};case"bottomRight":return{left:u.left+u.width-c,top:u.top-l-e};case"topCenter":return{left:u.left+(u.width-c)/2,top:u.top+u.height+e};case"topLeft":return{left:u.left,top:u.top+u.height+e};case"topRight":return{left:u.left+u.width-c,top:u.top+u.height+e};case"leftCenter":return{left:u.left+u.width+e,top:(u.height-l)/2};case"leftTop":return{left:u.left+u.width+e,top:u.top};case"leftBottom":return{left:u.left+u.width+e,top:u.height-l};case"rightTop":return{left:-c-e,top:u.top};case"rightCenter":return{left:-c-e,top:(u.height-l)/2};case"rightBottom":return{left:-c-e,top:u.height-l};default:return{left:u.left,top:"top"===n?u.top-l:u.top+u.height}}})();return{positionLeft:d.left,positionTop:d.top,width:u.width}})({...j?{arrowPosition:e.arrowPosition}:{verticalAlign:e.verticalAlign},container:x,popover:t,showArrow:j,target:w});k(s.positionLeft),Z(s.positionTop),S(s.width)}else k(0),Z(0),S(0)}),[x,w,j,e]),I=(0,r.useCallback)((e=>{const{target:t}=e,s=w?.contains(t),n=A.current?.contains(t);!c||l&&s||n||c(e)}),[l,c,w]),P=(0,i.y1)((()=>{null!==A.current&&B()}),100);if((0,r.useEffect)((()=>(R!==C&&(O.current=setTimeout((()=>E(C)))),()=>{O.current&&clearTimeout(O.current)})),[R,C]),(0,i.LI)((()=>(R&&(B(),document.addEventListener("click",I),window.addEventListener("resize",P)),()=>{document.removeEventListener("click",I),window.removeEventListener("resize",P)})),[I,R,B]),!R)return null;const H=o()("D_bag",n,(()=>{if(e.showArrow&&e.showArrow)switch(e.arrowPosition){case"bottomCenter":return o()(m,"D_bao");case"bottomLeft":return o()(m,"D_bam");case"bottomRight":return o()(m,"D_ban");case"topCenter":return o()(_,"D_bap");case"topLeft":return o()(_,"D_bak");case"topRight":return o()(_,"D_bal");case"leftCenter":return o()(g,"D_bas");case"leftTop":return o()(g,"D_bar");case"leftBottom":return o()(g,"D_bat");case"rightTop":return o()(f,"D_bav");case"rightCenter":return o()(f,"D_baw");case"rightBottom":return o()(f,"D_bax")}})(),{D_bah:"list"!==s});return(0,u.jsx)("div",{className:H,id:y,onMouseLeave:h,onMouseOver:b,ref:A,style:{left:N,position:"absolute",top:L,width:D?T:void 0,...a},children:(()=>{switch(s){case"list":return(0,u.jsx)(d,{listItems:e.listItems,showIconChevron:e.showIconChevron,variant:s});case"tooltip":{let t={title:""};return e.title&&e.bodyContent?t={bodyContent:e.bodyContent,title:e.title}:e.title?t={title:e.title}:e.bodyContent&&(t={bodyContent:e.bodyContent}),(0,u.jsx)(p,{...t,buttonText:e.buttonText,onButtonClick:e.onButtonClick,variant:s})}default:return e.children}})()})},C=(0,r.forwardRef)(b);C.displayName="Popover";const D=C},1020:(e,t,s)=>{s.d(t,{q:()=>n});const n=e=>e.isNotDisplayed()?{name:"google_one_tap_not_displayed",properties:{reason:e.getNotDisplayedReason()},type:"screen"}:e.isSkippedMoment()?{name:"google_one_tap_skipped",properties:{reason:e.getSkippedReason()},type:"screen"}:null}}]);
//# sourceMappingURL=https://mdev.llesuorac.com/01857052a1fbff6c7926249973b6164fd2b19d8b/20d21d61cb676f33.min.js.map
//# debugId=455cb941-f07a-5684-b003-38b395b0fb81