PageSourceSearch

https://www.primary.com/cdn/shop/t/42/assets/ProductSearch.chunk.669854d2cba31029c9e6.min.js

js primary.com collected 2026-09-24 09:10:35 UTC 5,763 bytes, 2 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="45cfe497-064b-4b50-9d84-e2a703414da7",e._sentryDebugIdIdentifier="sentry-dbid-45cfe497-064b-4b50-9d84-e2a703414da7")}catch(e){}}(),(self.webpackChunkpk_shopify_theme=self.webpackChunkpk_shopify_theme||[]).push([[912],{57049:(e,t,i)=>{i.r(t),i.d(t,{default:()=>A});var r=i(74848),a=i(63812),n=i(45660),s=i(96540),d=i(63405),c=i(32485),l=i.n(c),o=i(99683),p=i(76552),u=i(34843),m=i(42097);const _=()=>{const[e,t]=(0,u.fp)(m.u),{query:i,nbHits:a,hits:n,readyToRender:c,hasResults:_,hasNoResults:f,anchor:h,pluralKey:g,badQuery:w}=(0,p.c)({performedState:e,setPerformed:t}),{trackProductSearchSubmitted:y}=(0,o.J)();(0,s.useEffect)((()=>{_&&y({query:i,productIds:[...new Set(n.map((e=>Number(e.id))))]})}),[_,n,i,y]);const b=c&&!_&&!i,x=f,j=_,P=c&&!_,v=d.ju.$P.Q0.replace("{{ terms }}",i),k=d.ju.$P.R_[g],I=d.ju.$P._f[g].replace("{{ terms }}",i).replace("{{ count }}",`${a}`),q=l()({"pw-grid__col--12 pw-text-md-center pw-header-2 pw-m-b-4":b,"pw-d-none":!b}),D=l()({"pw-grid__col--12":x,"pw-d-none":!x}),N=l()({"pw-d-inline-block pw-grid__col--12 pw-grid__col--md--6 pw-header-3 pw-m-b-3 pw-m-b-md-0":j,"pw-d-none":!j}),T=l()({"pw-grid__col--md--1 pw-grid__col--lg--3":P,"pw-d-none":!P}),H=l()("noresult pw-m-t-4 pw-m-b-2 pw-text-md-center pw-body-medium",{"pw-d-none":w});return c&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h1",{id:_?"search-results":"search-failed",className:q,children:d.ju.$P.DD}),(0,r.jsxs)("div",{className:D,children:[(0,r.jsx)("h1",{className:l()("pw-text-md-center pw-header-3",{"pw-d-none":w}),children:v}),(0,r.jsx)("p",{className:H,children:d.ju.$P.fm})]}),(0,r.jsxs)("h1",{ref:h,className:N,children:[(0,r.jsxs)("span",{className:"pw-screenreader-only",children:[k,":"]}),I]}),(0,r.jsx)("div",{className:T})]})};var f=i(18977),h=i(56439),g=i(45537),w=i(28651),y=i(96960),b=i(52035),x=i(84929),j=i(68989);function P(e,t){const i=void 0!==t?t:{};if(!e||"string"!=typeof e)return i;try{const t=e.trim();if(!t)return i;const r=JSON.parse(t);return null!=r?r:i}catch{return i}}const v=e=>{const t={alt:"",aspect_ratio:1,height:2500,width:2500,src:e.image};return{...t,alt:"",id:e.id,preview_image:t,media_type:"image"}};var k=i(47131),I=i(94701),q=i(31644),D=i(18291),N=i(50225);const T=f.Xc((({hit:e,index:t,queryID:i})=>{const[a,n]=(0,s.useState)((e=>{const t=e.meta,i=P(t?.algoliaProductTags?.availableColors,[]),r=e.named_tags_names.reduce(((t,i)=>[...t,...Array(e.named_tags[i]).flat().map((e=>`${i}:${e}`))]),[]),a=i.map((t=>((e,t)=>{const i=e.meta,r=P(i?.algoliaProductTags?.variantImages,[]),a=[r].flat().find((e=>e?.startsWith(`${t},`)))?.split(",")[1],n=[P(i?.algoliaProductTags?.availableColors,[])].flat().includes(t??e.option1);return{id:Number(e.objectID),title:e.title,option1:t||e.option1,option2:e.option2,option3:j.A.Listed,sku:e.sku,requires_shipping:e.requires_shipping,available:n,options:Object.values(e.options),price:100*e.price,compare_at_price:100*e.compare_at_price,featured_media:{alt:null,id:0,preview_image:{alt:"",aspect_ratio:1,height:2500,width:2500,src:a||e.image}}}})(e,t))),n=[v(e)];return{id:e.id,title:e.title,handle:e.handle,description:e.body_html_safe,type:e.product_type,tags:r,price:100*e.price,price_min:100*e.variants_min_price,price_max:100*e.variants_max_price,compare_at_price:100*e.compare_at_price,compare_at_price_min:100*e.variants_compare_at_price_min,compare_at_price_max:100*e.variants_compare_at_price_max,variants:a,images:[e.product_image,e.image].filter(Boolean),featured_image:e.product_image||e.image,options:Object.values(e.options),media:n,unifiedProductType:t?.unifiedProduct?.productType,unifiedCollectionHandle:t?.unifiedProduct?.collectionHandle,unifiedProductHandle:t?.unifiedProduct?.unifiedHandle}})(e)),[d,c]=(0,u.fp)((0,D.KQ)(a.handle));(0,s.useEffect)((()=>{(async()=>{const e=await(0,q.kJ)(a);n(e)})()}),[a.handle]),(0,I.A)((()=>{a?.unifiedProductType&&a?.unifiedCollectionHandle&&a?.unifiedProductHandle&&c({unifiedProductType:a.unifiedProductType,unifiedCollectionHandle:(0,k.z)(a,{useParentIfPresent:!1}),unifiedProductHandle:a.unifiedProductHandle})}));const l=(0,u.md)((0,x.Rq)(d?.unifiedProductType===N.U.Unified?(0,D.rt)(a.handle):(0,b.eU)(null)));return(0,s.useEffect)((()=>{"hasData"===l.state&&l.data&&n(l.data)}),[l]),(0,r.jsx)(y.A,{product:a,enableLifestylePhotos:!1,refTag:"search_results",lazyLoad:!1,queryID:i,index:t,isSearchResult:!0,headingLevel:2})}),{}),H=f.Xc((function(e){const{hits:t}=(0,h.u)(e),[i,a]=(0,w.ok)();(0,s.useEffect)((()=>{!i.get("queryID")&&t[0]?.__queryID&&(i.set("queryID",t[0]?.__queryID),a(i))}),[t,i,a]);const n=t.length>0?t[0]?.__queryID:"";return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("ul",{className:"pw-block-grid pw-block-grid--gutters-small pw-block-grid--2 pw-block-grid--sm--3 pw-block-grid--lg--4 pw-list--unstyled",children:t.map(((e,t)=>(0,r.jsx)("li",{children:(0,r.jsx)(T,{hit:e,index:t+1,queryID:n})},e.id)))}),(0,r.jsx)("div",{className:l()("pw-p-t-0","pw-p-t-lg-7","pw-p-b-8",{"pw-d-none":!t.length}),children:(0,r.jsx)(g.A,{})})]})}),{});var $=i(12132),C=i(33355),S=i(21729);const A=()=>{const[e]=(0,w.ok)(),t=(0,$.q)(e.get("query"));return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(a.G,{indexName:C.mo,searchClient:S.zZ,children:[(0,r.jsxs)("div",{className:"pw-grid pw-grid--gutters-large pw-flex-justify-space-between pw-flex-align-center pw-m-b-5",children:[(0,r.jsx)(_,{}),(0,r.jsx)(n.Z,{query:t,filters:C.fY,hitsPerPage:60,clickAnalytics:!0})]}),(0,r.jsx)(H,{})]})})}}}]);
2//# sourceMappingURL=ProductSearch.chunk.669854d2cba31029c9e6.min.js.map

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.