PageSourceSearch

https://www.shopback.co.th/__sbcdn/_next/static/chunks/42056.6fbde11b7f4ab682.js

js shopback.co.th collected 2026-10-02 16:44:17 UTC 6,031 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[42056],{242056:(e,t,n)=>{n.r(t),n.d(t,{default:()=>s.A});var s=n(410018)},410018:(e,t,n)=>{n.d(t,{A:()=>x});var s=n(695155),i=n(934515),a=n(579856),o=n(202543),r=n(981980),l=n(700914),d=n(234237),c=n(793016),h=n(363555),u=n(212115),p=n(814106),b=n(716760),m=n(554503),f=n(654354),g=n(761722);let w=(0,r.I4)(l.A,{base:{width:"sbds-dimension-size-14",height:"sbds-dimension-size-14",borderRadius:"sbds-dimension-border-radius-full",bg:"sbds-interaction-color-secondary",flex:"0 0 auto",display:"flex",alignItems:"center",justifyContent:"center"}}),x=()=>{let{top:e}=(0,c.U)(),{uhsSpacingOptimizationEnabled:t,searchPLCEnabled:n,setTopHeight:l,alwaysShowSearchInputEnabled:x,searchKeywords:_,searchPLCTooltipEnabled:v,headerV2Enabled:y,searchSBIEntryEnabled:k,searchSchema:j}=(0,d.O)(),z=null!=j?j:f.xhU,A=(0,u.useRef)(null),[S,C]=(0,u.useState)(!1),[E,I]=(0,u.useState)(0),N=(0,u.useRef)(null),[P,B]=(0,u.useState)(v),R=S||!!x||!!y,L=(0,o.t)("webview"),{data:T,isPending:M}=(0,h.X)({queryKey:["webview/api/content/monetization?type=searchBoxText"],throwOnError:!1}),{contents:O,timer:Y=3}=T||{},J=null==O?void 0:O[E],U=(0,u.useCallback)(()=>{C(window.scrollY>=30)},[]),V=(0,u.useMemo)(()=>(null==_?void 0:_.length)||(null==O?void 0:O.length)?[..._||[],...(null==O?void 0:O.map(e=>e.keyword))||[]]:[L("Search for stores")],[O,M,L]);(0,u.useEffect)(()=>{if(!(V.length<=1))return N.current&&clearInterval(N.current),N.current=setInterval(()=>{I(e=>e+1>=V.length?0:e+1)},1e3*Y),()=>{N.current&&clearInterval(N.current)}},[V]),(0,u.useEffect)(()=>{var e;window.addEventListener("scroll",U);let t=null==(e=A.current)?void 0:e.getBoundingClientRect().height;return t&&l(Math.floor(t)),()=>{window.removeEventListener("scroll",U)}},[U]);let q=()=>{B(!1)};return(0,u.useEffect)(()=>{P&&m.A.write(f.nLJ,"true")},[]),(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(r.az,{ref:A,"data-testid":"uhs-header-search-bar",pos:"fixed",zIndex:"dropdown",top:0,left:0,width:"100%",transition:"background-color 0.1s ease-in-out",style:{paddingTop:e},...S&&{bg:"sbds-color-white"},pointerEvents:S?"auto":"none",children:(0,s.jsxs)(r.so,{gap:y?"sbds-dimension-space-size-s":"sbds-dimension-space-size-m",px:"sbds-dimension-space-size-m",py:t?"sbds-dimension-space-size-xs":"sbds-dimension-space-size-s",justify:"flex-end",pointerEvents:"auto",maxW:"breakpoint-md",mx:"auto",children:[y&&(0,s.jsx)(w,{"aria-label":"Shopping Assistant",onClick:()=>{(0,a.PN)({ui_element_name:"top_bar",feature_name:"shopping_assistant"})},title:"Shopping Assistant",href:"shopback://shopwhiz","data-testid":"ask-ai-button",children:(0,s.jsx)(g.A,{src:"https://cloud.shopback.com/image/upload/web/webview/uhs/navigation/shopping-assistant.webp",alt:"Shopping Assistant",width:"100%",height:"100%",noBackground:!0})}),(0,s.jsx)(p.A,{url:z,contentTexts:V,onClick:()=>{(0,a.PN)((null==J?void 0:J.tracking_data)||{ui_element_name:"search_bar",offer_name:V[E]})},contentIdx:E,open:R,trackingData:null==J?void 0:J.tracking_data}),!R&&(0,s.jsx)(w,{href:z,onClick:()=>{(0,a.PN)({ui_element_name:"search_bar"})},"aria-label":"Search",title:"Search icon","data-testid":"uhs-search-icon",children:(0,s.jsx)(i.eSy,{tone:"primary"})}
1),k&&(0,s.jsx)(w,{href:"shopback://web?naviBtnVisibility=hidden&url=".concat(window.location.origin,"/webview/shop-by-image"),onClick:()=>{(0,a.PN)({ui_element_type:"top_bar",ui_element_name:"shop_by_image"})},"aria-label":"Shop by Image",title:"Shop by Image icon","data-testid":"shop-by-image-button",children:(0,s.jsx)(i.NSO,{w:"100%",h:"100%"})}),n&&(0,s.jsx)(b.A,{open:P,placement:"bottom",screenMargin:12,information:L("Earn via paste links"),onClose:q,timeout:5e3,children:(0,s.jsx)(r.az,{children:(0,s.jsx)(w,{href:"shopback://searchplc",onClick:()=>{(0,a.PN)({ui_element_name:"top_bar",feature_name:"searchplc"}),q()},"aria-label":"PLC",title:"PLC icon","data-testid":"paste-link-button",children:(0,s.jsx)(i.N_E,{tone:"primary"})})})})]})})})}},814106:(e,t,n)=>{n.d(t,{A:()=>p});var s=n(695155),i=n(934515),a=n(761722),o=n(579856),r=n(981980),l=n(700914),d=n(508296),c=n(234237),h=n(212115);let u=e=>{let{text:t}=e;return(0,s.jsx)(d.A,{tone:"placeholder",truncate:1,width:"100%",children:t})},p=e=>{let{url:t,contentTexts:n,contentIdx:d,open:p,trackingData:b,...m}=e,f=(0,h.useRef)(null),{shopByImageOnSearchEnabled:g,shopByImageBackButtonEnabled:w}=(0,c.O)(),x=n.length;(0,h.useEffect)(()=>{if(!f.current||x<2)return;let e=f.current;d?(e.style.transition="transform ".concat(500,"ms ease-in-out"),e.style.transform="translateY(-".concat(2.5*d,"rem)")):(e.style.transform="translateY(-".concat(2.5*x,"rem)"),setTimeout(()=>{e.style.transition="none",e.style.transform="translateY(0px)"},500))},[d,x]);let _=(0,h.useMemo)(()=>x<2?n:[...n,n[0]],[n,x]),v=(0,o.wm)(b,"App.Impression");return(0,s.jsxs)(l.A,{href:t,display:"flex",px:"sbds-dimension-space-size-m",bg:"sbds-background-color-secondary",borderRadius:"sbds-dimension-border-radius-full",gap:"sbds-dimension-space-size-s",alignItems:"center",overflow:"hidden",h:"sbds-dimension-size-14",flex:1,visibility:p?"visible":"hidden","data-testid":"uhs-search-bar",...m,children:[(0,s.jsx)(i.eSy,{size:"sm",tone:"placeholder",flex:"0 0 auto"}),(0,s.jsx)(r.az,{position:"relative",flex:1,overflow:"hidden",ref:f,alignSelf:"flex-start",children:_.map((e,t)=>(0,s.jsxs)(r.BJ,{position:"relative",h:"sbds-dimension-size-14",justify:"center",children:[t===d&&b&&(0,s.jsx)(r.az,{position:"absolute",w:1,h:1,...v}),(0,s.jsx)(u,{text:e})]},t))}),g&&(0,s.jsx)(l.A,{onClick:()=>{(0,o.PN)({ui_element_type:"top_bar",ui_element_name:"shop_by_image"});let e="".concat(window.location.origin,"/webview/shop-by-image");window.location.href="shopback://web?naviBtnVisibility=".concat(w?"hidden":"show","&url=").concat(e)},children:(0,s.jsx)(a.A,{src:"https://cloud.shopback.com/image/upload/web/webview/uhs/navigation/image-search-icon.png",alt:"Shop by Image",width:"sbds-dimension-size-14",height:"sbds-dimension-size-14",noBackground:!0})})]})}}}]);

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.