1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8890],{26744:(e,t,s)=>{s.d(t,{A:()=>r});var a=s(24286),l=s(86808);let r=function(e){return(0,l.A)((0,a.A)(e).toLowerCase())}},38890:(e,t,s)=>{s.r(t),s.d(t,{default:()=>F});var a=s(95155),l=s(93764),r=s(9969),c=s(69730),i=s.n(c),n=s(96035),d=s(26744),o=s(12115),u=s(87077),m=s(26769),x=s(56894),f=s(79756),b=s(99764),p=s(16020),h=s(49820),g=s(94752),v=s(82143),j=s.n(v),y=s(74276);let S=({selected:e,results:t,selectedItem:s,setSelectedItem:l,handleSearchClear:c})=>{let n=(0,y.yn)();(0,o.useEffect)(()=>{let a=t.find(t=>t.item.id===e);if(!(t.length>0)||a||s)a&&(a.item.name!==s?.name&&s?.id===e&&a.item.id!==s?.id||!s)&&l("product"===a.item.type||"sku"===a.item.type||"om"===a.item.type?(0,p.A)(a.item,"type"):a.item);else{let e=t[0].item,s="product"===e.type||"sku"===e.type||"om"===e.type?(0,p.A)(e,"type"):e;n("selected",e.id),l(s)}},[t,e,l,n,s]);let d=(0,o.useCallback)(e=>{let t="product"===e.type||"sku"===e.type||"om"===e.type?(0,p.A)(e,"type"):e;n("selected",e.id),l(t)},[n,l]),u=(0,o.useMemo)(()=>(0,h.A)(t,e=>{let t=e.item.type;return(0,a.jsxs)("div",{className:i()("mb-050 p-050 cursor-pointer",{"bg-cta-background text-cta-active":s?.id===e.item.id&&s?.name===e.item.name}),onClick:()=>d(e.item),children:[(0,a.jsxs)("div",{className:"flex gap-100 items-center",children:[(0,a.jsx)("span",{className:"text-label-small",children:e.item.name}),(0,a.jsx)("span",{className:i()("rounded-2 px-050 text-label-tiny",j()[`label-${t}`],["sku","om"].includes(t)?"uppercase":"capitalize"),children:t})]}),e.breadcrumb.length>0&&(0,a.jsx)("div",{className:"text-label-tiny text-neutral-600",children:e.breadcrumb.map((t,s)=>(0,a.jsxs)(o.Fragment,{children:[t," ",s<e.breadcrumb.length-1&&(0,a.jsx)(r.g,{size:"lg",icon:b.dm})," "]},(0,g.A)(t)))})]},(0,g.A)(e.item.id))}),[t,s,d]);return(0,a.jsxs)(a.Fragment,{children:[u,(0,a.jsx)("hr",{}),(0,a.jsxs)("div",{className:"flex gap-050 text-label-small text-cta items-center cursor-pointer",onClick:c,children:[(0,a.jsx)(r.g,{size:"lg",icon:b.Ce}),"Back"]})]})};var A=s(36958),N=s(82858),k=s(50424),E=s(24402),w=s(84456),C=s(36924),L=s(35208);let I=({env:e,locale:t,query:s,items:l,source:r,setResults:c,replaceQueryParam:i,setSelectedItem:n,setIsSearchLoading:d,handleSearchClear:u})=>{let[m,x]=(0,o.useState)(s),[f,b]=(0,o.useState)(e),[p,h]=(0,o.useState)(t),{data:g,isLoading:v,refetch:j}=(0,E.E9)(m,f,p,r),{data:y,isLoading:S,refetch:I}=(0,E.Ws)(m,f,p,r),[T,M]=(0,o.useState)(null);(0,o.useEffect)(()=>{let a=(0,A.A)(()=>{x(s),b(e),h(t)},k.cP);return a(),()=>{a.cancel()}},[s,e,t,j,I]),(0,o.useEffect)(()=>{f&&p&&m&&(0,w.eQ)(m)&&(j(),I())},[f,p,m,I,j,r]),(0,o.useEffect)(()=>{d(v||S)},[v,S,d]);let Q=(0,o.useMemo)(()=>{let e=[...g?g.map(e=>({item:e,breadcrumb:(0,w.Y4)(l,e.parentId)})):[],...y?y.map(e=>({item:e,breadcrumb:(0,w.Y4)(l,e.parentId)})):[],...T||[]];return 0===e.length?null:(0,w.mh)(e)},[g,y,T,l]),P=(0,o.useMemo)(()=>(0,A.A)(e=>{if(d(!0),!e.trim()){d(!1),M(null);return}let t=(0,w.Ds)(l,e);d(!1),M(t),n(void 0)},k.cP),[l,d,n]),z=(0,o.useCallback)(e=>{i("search",e||void 0),e.trim()?P(e):(P.cancel(),u())},[P,u,i]),F=(0,o.useCallback)(()=>{P.cancel(),u()},[P,u]);return(0,o.useEffect)(()=>(s?P(s):M(null),()=>{P.cancel()}),[s,P]),(0,o.useEffect)(()=>{c(Q)},[Q,c]),(0,a.jsx)(C.A,{label:"Search is case-sensitive",children:(0,a.jsx)(N.A,{size:L.x0Q.SMALL,value:s,isLoading:!1,placeholder:"Find id, name or article no.",onChange:z,onClear:F})})};var T=s(62921);let M=({source:e,setSource:t,replaceQueryParam:s})=>(0,a.jsx)(C.A,{label:"Not supported for searches by ID",children:(0,a.jsxs)(T.A,{size:L.x0Q.SMALL,value:e,onChange:e=>{let a=e.target.value.trim();t(a),s("source",a)},children:[(0,a.jsx)("option",{value:"visible",children:"Currently visible"}),(0,a.jsx)("option",{value:"visibleAndFuture",children:"Current and Future"}),(0,a.jsx)("option",{value:"all",children:"Current and Discontinued"})]})});var Q=s(5354),P=s(69660),z=s(99779);let F=()=>{let{queryParams:e,replaceMultipleQueryParams:t}=(0,P.A)(),s=(0,y.yn)(),c=(0,w.bl)(e,"search",""),b=(0,w.bl)(e,"selected"),p=(0,w.bl)(e,"tab"),h=(0,w.bl)(e,"prodTab"),g=(0,w.bl)(e,"skuTab"),v=(0,w.bl)(e,"env",""),j=(0,w.bl)(e,"lang",""),A=(0,w.bl)(e,"source",""),N=(0,o.useRef)(b),k=window.localStorage.getItem("selectedEnv"),[C,L]=(0,o.useState)((0,w.fe)(v||k,"env")),T=(0,w.hS)(C),[F,_]=(0,o.useState)(j),[D,R]=(0,o.useState)((0,w.fe)(A,"source")),[Y,U]=(0,o.useState)(),[B,X]=(0,o.useState)(!1),[$,q]=(0,o.useState)(T),G=window.localStorage.getItem(C),{data:H,isLoading:J,isError:K,error:O,refetch:W}=(0,E.rS)(C,$),{data:Z,isLoading:V,isError:ee,error:et,refetch:es}=(0,E.vm)(C,F),{data:ea,isLoading:el,isError:er,error:ec,refetch:ei}=(0,E.lo)(C,F),{data:en,isLoading:ed,isError:eo,error:eu,refetch:em}=(0,E.B3)(C),{data:ex,isLoading:ef,isError:eb,error:ep,refetch:eh}=(0,E.w$)(C,F,D),eg="browser"===p,ev="statistics"===p,ej="settings"===p,ey="certifications"===p,eS=[{key:"browser",isSelected:eg},{key:"certifications",isSelected:ey},{key:"statistics",isSelected:ev},{key:"settings",isSelected:ej}],eA=ef||ed||el||J||V,eN=(0,n.A)([ep?.message,O?.message,eu?.message,ec?.message,et?.message]).join(","),[ek,eE]=(0,o.useState)([]),[ew,eC]=(0,o.useState)(),[eL,eI]=(0,o.useState)(),[eT,eM]=(0,o.useState)(!1),[eQ,eP]=(0,o.useState)(!1),[ez,eF]=(0,o.useState)(!1);(0,o.useEffect)(()=>{N.current=b},[b]),(0,o.useEffect)(()=>
1{if(v&&C!==v){let e=(0,w.fe)(v,"env");L(e),s("env",e)}if(A&&A!==D){let e=(0,w.fe)(A,"source");R(e),s("source",e)}p&&p!==(0,w.fe)(p,"tab")&&s("tab",(0,w.fe)(p,"tab")),h&&h!==(0,w.fe)(h,"prodTab")&&s("prodTab",(0,w.fe)(h,"prodTab")),g&&g!==(0,w.fe)(g,"skuTab")&&s("skuTab",(0,w.fe)(g,"skuTab"))},[]),(0,o.useEffect)(()=>{(C&&C!==v||!Y)&&(eF(!1),W()),!B&&(C&&F&&D&&eg&&eh(),C&&ev&&!$&&em(),C&&F&&ej&&!$&&ei(),C&&F&&ey&&!$&&es())},[C,v,F,D,Y,B,$,eg,ev,ej,ey,eh,W,em,ei,es]),(0,o.useEffect)(()=>{ev?eI(en):ej?eI(ea):ey&&eI(Z)},[en,ea,Z,ev,ej,ey]),(0,o.useEffect)(()=>{eg?X(eb||K):ev?X(eo):ej?X(er):ey&&X(ee),(eb||eo||er||ee)&&eI(void 0)},[er,eo,eb,ee,K,eg,ev,ej,ey]),(0,o.useEffect)(()=>{!eA&&H&&(U($?H:(0,w.UO)(H.shops)),eF(!0))},[eA,$,H]),(0,o.useEffect)(()=>{if(!eA&&ex){let{tree:e,activeItem:t}=(0,w.mG)([...ex.categories.items,...ex.products.items],N.current);eE(e),t&&eI(t)}},[eA,ex]),(0,o.useEffect)(()=>{k&&k===C||((0,w.Xb)("selectedEnv",C),L(C))},[C,k,L]),(0,o.useEffect)(()=>{v&&C===v||s("env",(0,w.fe)(C!==v&&v?C:v,"env")),j&&F!==G||s("lang",F),p||s("tab",(0,w.fe)(p,"tab")),A||s("source",(0,w.fe)(A,"source"))},[C,v,j,F,A,p,s,G]),(0,o.useEffect)(()=>{if(Y&&(!G||G!==F)){let e=(0,w.fe)(F||G,"lang",Y);(0,w.Xb)((0,w.fe)(C,"env"),e),_(e),s("lang",e)}},[F,G,Y,_,s,C]),(0,o.useEffect)(()=>{ez&&eQ&&G&&Y&&(_((0,w.fe)(G,"lang",Y)),eP(!1))},[eQ,ez,G,Y]);let e_=(0,o.useCallback)(()=>{let s={};Array.from(e.keys()).forEach(e=>{["search","selected","prodTab","skuTab"].includes(e)&&(s[e]=void 0)}),t({tab:"browser",...s}),eI(void 0),eC(null)},[e,t,eI,eC]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-100",children:[(0,a.jsx)("p",{className:"mb-0 text-style-heading-h2",children:"Shop API"}),(0,a.jsx)("div",{className:"space-x-100 text-sm mb-050",children:eS.map(({key:e,isSelected:l})=>(0,a.jsx)("button",{type:"button",className:i()("select-btn select-btn-small",{"select-btn-selected":l}),onClick:()=>{"browser"===e?(s("tab",e),eI(void 0),eC(null)):t({tab:e,search:void 0,selected:void 0,prodTab:void 0})},children:(0,d.A)(e)},e))})]}),(0,a.jsxs)("div",{className:"flex gap-100 items-center text-label-small mb-200",children:[(0,a.jsx)(m.A,{env:C,setEnv:L,setLocales:U,setIsMockAPI:q,setReadLocaleFromStorage:eP,replaceQueryParam:s}),J?(0,a.jsx)(z.A,{size:z.K.SMALL}):!ev&&(0,a.jsx)(f.A,{env:C,locale:F,locales:Y,setLocale:_,replaceQueryParam:s}),eg&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(M,{source:D,setSource:R,replaceQueryParam:s}),(0,a.jsx)(I,{env:C,locale:F,items:ek,source:D,query:c,setResults:eC,setSelectedItem:eI,replaceQueryParam:s,setIsSearchLoading:eM,handleSearchClear:e_})]})]}),B&&eN&&(0,a.jsxs)("div",{className:i()("rounded-2 p-200 bg-danger-600 text-white","flex gap-100 justify-between items-center mb-200"),children:[(0,a.jsxs)("div",{className:"flex gap-100 items-center",children:[(0,a.jsx)(r.g,{size:"sm",icon:l.JA}),(0,a.jsx)("span",{className:"text-sm font-bolder",dangerouslySetInnerHTML:{__html:(0,w.sZ)(eN)}})]}),(0,a.jsx)(r.g,{className:"cursor-pointer",size:"sm",icon:l.yY,onClick:()=>X(!1)})]}),eg&&!eA&&!B&&!ew&&(0,a.jsxs)("div",{className:"text-label-tiny flex gap-200 mb-200 w-full",children:[(0,a.jsxs)("span",{children:["Categories/Product-Ranges: "," ",(0,a.jsx)("span",{className:"font-bold",children:ex?.categories.meta.items})]}),(0,a.jsxs)("span",{children:["Products: "," ",(0,a.jsx)("span",{className:"font-bold",children:ex?.products.meta.items})]})]}),eA?(0,a.jsx)(x.A,{}):(0,a.jsxs)("div",{className:"flex justify-between gap-400 pb-200",children:[eg&&!B&&(0,a.jsx)("div",{className:"sticky top-500 self-start w-1/3 4xl:w-1/4",children:eT?(0,a.jsx)(x.A,{}):ew?(0,a.jsx)(S,{results:ew,selected:b,selectedItem:eL,setSelectedItem:eI,handleSearchClear:e_}):(0,a.jsx)(Q.A,{items:ek,expandId:b,selectedItem:eL,setSelectedItem:eI})}),(0,a.jsx)("div",{className:i()("bg-neutral-50 p-200 rounded-8 text-label-tiny",{"w-2/3 4xl:w-3/4":eg&&!B,"w-full":!eg||B}),children:(0,a.jsx)(u.A,{env:C,locale:F,source:D,skuTabActive:g,prodTabActive:h,selectedItem:eL})})]})]})}},82858:(e,t,s)=>{s.d(t,{A:()=>u});var a=s(95155),l=s(93764),r=s(9969),c=s(69730),i=s.n(c),n=s(12115),d=s(35208);
1let o=(0,n.forwardRef)(({size:e=d.x0Q.MEDIUM,value:t,label:s,isLoading:c=!1,onChange:n,onClear:o,placeholder:u="Search..."},m)=>{let x=e===d.x0Q.MEDIUM,f=e===d.x0Q.SMALL,b=e===d.x0Q.TINY;return(0,a.jsxs)("div",{className:"flex flex-col gap-050",children:[s&&(0,a.jsx)("span",{className:"text-style-label-small",children:s}),(0,a.jsxs)("div",{className:"relative flex items-center gap-050",children:[(0,a.jsx)("div",{className:"absolute left-050 ml-100",children:(0,a.jsx)(r.g,{className:i()("cursor-pointer text-neutral-400 focus:text-cta-hover",{"text-fixed-md":x,"text-fixed-sm":f,"text-fixed-xs":b}),icon:l.Mj})}),(0,a.jsx)("input",{ref:m,className:i()("px-400 form-input",{"form-input-small":f,"form-input-tiny":b}),type:"text",value:t,disabled:c,onChange:e=>{n(e.target.value)},placeholder:u}),t&&(0,a.jsx)("div",{className:"absolute right-050 mr-100",children:(0,a.jsx)(r.g,{className:i()("cursor-pointer text-neutral-600 hover:text-base",{"text-fixed-md":x,"text-fixed-sm":f,"text-fixed-xs":b}),icon:l.bn,onClick:o})})]})]})});o.displayName="SearchInput";let u=o},94752:(e,t,s)=>{s.d(t,{A:()=>r});var a=s(24286),l=0;let r=function(e){var t=++l;return(0,a.A)(e)+t}}}]);
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.