PageSourceSearch

https://www.shopback.sg/__sbcdn/_next/static/chunks/22196.227b931c7fe368dc.js

js shopback.sg collected 2026-10-01 10:32:37 UTC 6,251 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[22196],{273291:(e,r,t)=>{t.d(r,{A:()=>o});var n=t(695155),s=t(360895),i=t(981980),a=t(508296),l=t(212115);let o=e=>{var r;let{tabs:t,onClick:o,activeTab:d,children:c,variant:u="fixed",tabListProps:b,...f}=e,p=null==(r=t.find(e=>{let{value:r}=e;return r===d}))?void 0:r.children,h=(0,l.useMemo)(()=>t.findIndex(e=>{let{value:r}=e;return r===d}),[t,d]),m=(0,l.useRef)([]),v=(0,l.useRef)(null),[x,g]=(0,l.useState)({width:0,left:0}),w=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{let e=()=>{let e=m.current[h];if(!e)return;let r=window.getComputedStyle(e),t=parseFloat(r.paddingLeft)||0,n=parseFloat(r.paddingRight)||0;g({width:e.offsetWidth-t-n,left:e.offsetLeft+t})};requestAnimationFrame(e);let r=v.current;if(!r)return;let t=new ResizeObserver(()=>requestAnimationFrame(e));return t.observe(r),()=>t.disconnect()},[h,t]),(0,n.jsxs)(i.az,{w:"100%",...f,children:[(0,n.jsxs)(i.so,{ref:v,w:"100%",pos:"relative","data-testid":"tabs",role:"tablist",overflowX:"scrollable"===u?"auto":"visible",..."scrollable"===u&&{css:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},...b,children:[t.map((e,r)=>{let{value:s,title:l,subtitle:c,badge:b}=e,f=s===d,p="tab-".concat(s),h="tabpanel-".concat(s);return(0,n.jsxs)(i.BJ,{ref:e=>{m.current[r]=e},gap:"sbds-dimension-space-size-xs",py:"sbds-dimension-space-size-m",minH:"sbds-dimension-size-15",px:"sbds-dimension-size-3",align:"center",justify:"center",pos:"relative",flex:"fixed"===u?1:void 0,flexShrink:"scrollable"===u?0:void 0,minW:"scrollable"===u?"fit-content":0,cursor:"pointer",transition:"all 0.2s ease-in-out",WebkitTapHighlightColor:"transparent",_hover:{md:{background:"sbds-color-cool-gray-15"}},_active:{background:"sbds-color-cool-gray-15"},onClick:()=>{w.current=!0,o(s)},onKeyDown:e=>((e,r)=>{let n=t.length,s=null;if(["ArrowLeft","ArrowRight","Home","End","Enter"," "].includes(e.key)){switch(e.preventDefault(),e.key){case"ArrowLeft":s=0===r?n-1:r-1;break;case"ArrowRight":s=r===n-1?0:r+1;break;case"Home":s=0;break;case"End":s=n-1;break;case"Enter":case" ":w.current=!0,o(t[r].value);return}if(null!==s){var i;null==(i=m.current[s])||i.focus()}}})(e,r),"data-testid":p,role:"tab","aria-selected":f,"aria-controls":h,id:p,tabIndex:f?0:-1,children:[(0,n.jsxs)(i.az,{pos:"relative",maxW:"fixed"===u?"100%":void 0,display:"inline-block",children:[(0,n.jsx)(a.A,{tone:f?"primary":"inactive",weight:f?"bold":"normal",px:"sbds-dimension-size-2",truncate:"fixed"===u?1:void 0,whiteSpace:"scrollable"===u?"nowrap":void 0,children:l}),b&&(0,n.jsx)(i.az,{pos:"absolute",w:6,h:6,right:-3,top:-3,bg:"sbds-interaction-color-danger",borderRadius:"50%",pointerEvents:"none"})]}),c&&(0,n.jsx)(i.az,{maxW:"fixed"===u?"100%":void 0,display:"inline-block",children:(0,n.jsx)(a.A,{variant:"caption-1",tone:f?"primary":"inactive",truncate:"fixed"===u?1:void 0,whiteSpace:"scrollable"===u?"nowrap":void 0,children:c})})]},s)}),(0,n.jsx)(i.BJ,{pos:"absolute",bottom:0,h:"sbds-dimension-size-1",borderRadius:"sbds-dimension-border-radius-xs",bg:"sbds-interaction-color-default",style:{width:x.width>0?x.width:"fixed"===u?"calc(".concat(100/t.length,"% - ").concat((0,s.S)("sizes.sbds-dimension-size-3")," * 2)"):0,transform:x.width>0?"translateX(".concat(x.left,"px)"):void 0,left:0===x.width&&"fixed"===u?"calc(".concat(100*h/t.length,"% + ").concat((0,s.S)("sizes.sbds-dimension-size-3"),")"):void 0,opacity:+(0!==x.width||"fixed"===u),transition:w.current?"transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1)":"none"},pointerEvents:"none"})]}),p&&d&&(0,n.jsx)(i.az,{role:"tabpanel",id:"tabpanel-".concat(d),"aria-labelledby":"tab-".concat(d),tabIndex:0,children:p}),c]})}},354141:(e,r,t)=>{t.d(r,{A:()=>n.A});var n=t(273291)},701595:(e,r,t)=>{t.d(r,{A:()=>g});var n=t(695155),s=t(371110),i=t(174595),a=t(202543),l=t(981980),o=t(594620),d=t(234237),c=t(857130),u=t(363555),b=t(212115),f=t(888750),p=t(878909),h=t(354141),m=t(208998),v=t(178204),x=t(549807);let g=e=>{let{data:r,layoutTrackingData:t}=e,{user:g}=(0,d.O)(),[w,y]=(0,b.useState)(null),[A,k]=(0,b.useState)("inProgress"),z=(0,b.useRef)(null),j=(0,b.useRef)(null),C=(0,a.A)(["webview","campaign-layout"]),{detail:R}=r,{numberOfRows:E=4,referralGenericMessage:_}=null!=R?R:{},{isFetching:S,isError:I,data:W}=(0,u.X)({queryKey:["webview/api/raf/get-progress"],throwOnError:!1,enabled:!!R}),{mutateAsync:F,isPending:L}=(0,c.s)({mutationFn:async()=>{try{if(z.current)return z.current;if(!(null==g?void 0:g.id))return null;let e=await (0,i.Z)("/webview/api/raf/get-referral-data");if(!(null==e?void 0:e.code))return null;let n=t.screen_name,{url:s}=await (0,o.QL)({channel:"app_share",feature:m.ND.NATIVE,campaign:n,referralCode:e.code,tags:["app_raf_share_powerscreen"],data:r.detail,accountId:g.id});if(!s)return null;let a=(0,o.Ag)(_,e.code,s);return z.current=a,a}catch(e){return null}},throwOnError:!1}),{inProgress:P,completed:H}=null!=W?W:{},N=(0,b.useMemo)(()=>{var e,r;return 55+69*E-34.5*(Math.max((null==P||null==(e=P.friends)?void 0:e.length)||0,(null==H||null==(r=H.friends)?void 0:r.length)||0)>E)},[W,E]),M=(0,b.useMemo)(()=>[{title:C("In Progress"),value:"inProgress"},{title:C("Completed"),value:"completed"}],[C]),O=(0,b.useCallback)(e=>{var r;k(null==(r=M[e])?void 0:r.value)},[]);return!I&&R&&(S||W)?S?(0,n.jsx)(p.A,{}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(l.az,{"data-testid":"raf-progress",mx:"sbds-dimension-space-size-m",borderRadius:"sbds-dimension-border-radius-l",border:"solid 1px {colors.sbds-border-color-subtle}",overflow:"hidden",children:[(0,n.jsx)(h.A,{tabs:M,onClick:e=>{var r,t;k(e),null==(r=j.current)||r.scrollTo(null!=(t=M.findIndex(r=>r.value===e))?t:0)},activeTab:A,mb:-1,borderBottom:"solid 1px {colors.sbds-border-color-subtle}",px:"sbds-dimension-space-size-xs"}),(0,n.jsx)(f.A,{ref:j,fullWidth:!0,onChange:O,noLoop:!0,children:M.map(e=>{let{value:r}=e;return(0,n.jsx)(x.A,{tabName:r,data:"inProgress"===r?P:H,contentHeight:N,onClickProgress:y,createReferralContent:F,isCreatingReferralContent:L},r)})})]}),(0,n.jsx)(s.default,{open:!!w,onClose:()=>y(null),bottomSpacing:!0,children:w&&(0,n.jsx)(v.A,{data:w})})]}):null}},722196:(e,r,t)=>{t.r(r),t.d(r,{default:()=>n.A});var n=t(701595)}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.