1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2918],{28022:function(){},99964:function(){},89838:function(){},30070:function(){},48740:function(e,i,n){"use strict";n(34784),n(50941),n(54162).default.typesense.collectionName,n(65249)},54162:function(e,i,n){"use strict";n.r(i);var t=n(20357);let l={vendure:{adminToken:t.env.VENDURE_LIVE_ADMIN_TOKEN,storeFrontUrl:"https://ecommerce-api.tristatelvs.com"},stripe:{publishableKey:"pk_live_51R19uyI2giWM33igy5aBQ18n9LF9aFTJ2O2kRyZ8WmclZO3OvkVfcBQszP753IYx25BtzAsplkzTBFqY2gyeE67U00TTPYhLST",apiBaseUrl:"https://api.stripe.com/v1/",isTest:"true"===t.env.NEXT_PUBLIC_STRIPE_IS_TEST},aws:{accessId:t.env.TRISTATE_AWS_ACCESS_ID,accessKey:t.env.TRISTATE_AWS_ACCESS_KEY,region:t.env.TRISTATE_AWS_REGION},easyPost:{apiKey:t.env.EASY_POST_API_KEY,apiUrl:t.env.EASY_POST_API_URL},strapi:{apiToken:t.env.STRAPI_API_TOKEN,apiUrl:"https://cms.tristatelvs.com/api"},typesense:{host:t.env.TYPESENSE_HOST,apiKey:t.env.TYPESENSE_API_KEY,collectionName:t.env.TYPESENSE_COLLECTION_NAME,previewCollectionName:t.env.TYPESENSE_PREVIEW_COLLECTION_NAME||"".concat(t.env.TYPESENSE_COLLECTION_NAME,"_pim_preview")},openai:{apiKey:t.env.OPENAI_API_KEY},jwt:{secret:t.env.JWT_SECRET},previewLink:{secret:t.env.PIM_PREVIEW_SECRET},maintenance:{mode:"true"===t.env.MAINTENANCE_MODE,bypassKey:t.env.MAINTENANCE_BYPASS_KEY},store:{url:"https://www.tristatelvs.com",siteUrl:t.env.NEXT_PUBLIC_SITE_URL,mode:"production",isProduction:!0},builder:{apiKey:"c36310f572534661a27d067c4aeeee86"},googleMaps:{apiKey:"AIzaSyDO-K_cPTTVYqokHxmatFpIw78D3-abegc"},turnstile:{siteKey:"0x4AAAAAAEszRUxo1A32JUgA"},googleTagManager:{id:"GTM-N6DSQ45J"},cronitor:{clientKey:"94fe2c3ef6b503534a3f39ebd2e5b491"},quickbooks:{enabled:"true"===t.env.NEXT_PUBLIC_QUICKBOOKS_ENABLED},bigCommerce:{token:"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJjaWQiOlsxXSwiY29ycyI6WyJodHRwczovL3RyaXN0YXRlbHZzLmNvbSIsImh0dHBzOi8vd3d3LnRyaXN0YXRlbHZzLmNvbSJdLCJlYXQiOjE3NzM2MzM0NzEsImlhdCI6MTc0MjA5OTA5NywiaXNzIjoiQkMiLCJzaWQiOjEwMDMwNDI2MjUsInN1YiI6Im91eXY3anZtcGpzb21vcmNtMTd1OHo4YXE1YnowcGgiLCJzdWJfdHlwZSI6MiwidG9rZW5fdHlwZSI6MX0.V0GDlBVo4xt8EZ_Dqa1eLFZDE9qnpfdU1EQdMbLoAqv_s4DdRk-sNiOfTp5tQDK0_eBN8sdtIfnET1fUyq80eA",cartToken:"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJjaWQiOlsxNTI5NDgzXSwiY29ycyI6WyJodHRwczovL3RyaXN0YXRlbHZzLmNvbSIsImh0dHBzOi8vd3d3LnRyaXN0YXRlbHZzLmNvbSJdLCJlYXQiOjE3NzM2MzM0NzEsImlhdCI6MTc0MjA5OTA3NCwiaXNzIjoiQkMiLCJzaWQiOjEwMDMwNDI2MjUsInN1YiI6Im91eXY3anZtcGpzb21vcmNtMTd1OHo4YXE1YnowcGgiLCJzdWJfdHlwZSI6MiwidG9rZW5fdHlwZSI6MX0.C48_zy60xkBWwY26lhN5DQHqMHqGNQXka_CdScVoFzK6Ptl0ol8_UMWX2ty4UEeJuYJHSBLgaJw-ukgCZAILoQ",apiUrl:"https://checkout3.tristatelvs.com/graphql",cartApiUrl:"https://store-bvhntdtzo9-1529483.mybigcommerce.com/graphql",graphqlUrl:t.env.NEXT_PUBLIC_GRAPHQL},ubiquiti:{priceEmail:"[email protected]"}};i.default=l},65249:function(e,i,n){"use strict";n(71825),n(20357),Object.freeze({version:1,updatedAt:null,updatedBy:"compiled defaults",main:Object.freeze({queryByWeights:"10,10,9,9,3,1",infix:"fallback,always,fallback,always,off,off",numTypos:"0,0,0,0,0,0",dropTokensThreshold:1,splitJoinTokens:"always",prioritizeExactMatch:!0,prioritizeTokenPosition:!0,sortByRelevance:"manualSortRank:asc,_text_match:desc,popularity:desc"}),vector:Object.freeze({k:20,distanceThreshold:.55,alpha:.1}),boost:Object.freeze({enabled:!0,perPage:5}),staple:Object.freeze({exactFront:!0,prefixSecond:!0,infixTail:!0})})},22816:function(e,i,n){"use strict";n.d(i,{j:function(){return t}});let t=Object.freeze({LOGIN:"/auth/login",HOME:"/",MY_ACCOUNT:"/my-account",QUOTES:"/quotes",ORDERS:"/orders",INVOICES:"/invoices",RETURNS:"/return-policy",DROPSHIP_POLICY:"/dropship-policy",CHECKOUT:"/checkout",CART:"/cart",SIGNUP:"/auth/signup",APPLICATION:"/application"})},80700:function(e,i,n){"use strict";n.d(i,{LZ:function(){return _},_R:function(){return A},Ls:function(){return h},G3:function(){return x},lp:function(){return J},m1:function(){return m},rf:function(){return c},AP:function(){return D},p6:function(){return u},l$:function(){return L},wd:function(){return g},VY:function(){return v},t3:function(){return S},Cy:function(){return j},aB:function(){return y},rc:function(){return I},Jz:function(){return Y},Fx:function(){return b},qp:function(){return O},Ku:function(){return M},AN:function(){return s},Vz:function(){return N},uc:function(){return R},ZV:function(){return E},Kx:function(){return P},IP:function(){return z},C5:function(){return w},_c:function(){return d},fB:function(){return f},pI:function(){return T},H:function(){return C},$Q:function(){return W},Vb:function(){return p}});var t=n(22816);n(19212);var l=n(62737),o=n.n(l),r=n(51470),a=n.n(r);n(48740),o().extend(a());let u=e=>{if(!e)return"__";let i=o()(e);return i.isValid()?i.format("MM/DD/YYYY"):"__"},d=e=>e?(Array.isArray(e)?e:[e]).map(e=>{var i,n,t;return{returnNumber:e.returnNumber||"",id:e.id||"",returnDate:e.createdAt,pdfUrl:null==e?void 0:e.pdfUrl,returnStatus:e.returnStatus?e.returnStatus.charAt(0).toUpperCase()+e.returnStatus.slice(1):"Requested",totalItems:(null===(i=e.returnLines)||void 0===i?void 0:i.length)||0,returnTotal:e.refundTotal/100||0,paymentDetails:e.order,returnMethod:null==e?void 0:e.returnMethod,paymentMethod:e.payment,shippingLabel:e.shippingLabels,items:(null===(n=e.returnLines)||void 0===n?void 0:n.map(e=>{var i,n,t;return{id:e.id||"",name:(null===(i=e.productVariant)||void 0===i?void 0:i.name)||"Na",image:null===(t=e.productVariant)||void 0===t?void 0:null===(n=t.featuredAsset)||void 0===n?void 0:n.preview,quantity:e.quantityReturned||1,price:e.refundAmount/100||0,returnStatus:e.inspectionStatus}}))||[],refundBreakdown:{shippingCharge:"Free",restockingFee:"Free",itemRefund:null===(t=e.returnLines)||void 0===t?void 0:t.reduce((e,i)=>e+(i.refundAmount/100||0),0),discountAdjustment:0}}}):[],s=(e,i)=>{let n=new Date(e);return new Date(n.setDate(n.getDate()-i))},c=async e=>{let i=await fetch("/api/content",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}),{data:n,error:t}=await i.json();if(t)throw Error("string"==typeof t?t:JSON.stringify(t));return n},v=async e=>{try{var i,n,t;let l="brands?filters[code][$eq]=".concat(null==e?void 0:null===(n=e.brand)||void 0===n?void 0:null===(i=n.code)||void 0===i?void 0:i.toLowerCase(),"&filters[publishedAt][$notNull]=true&filters[has_categories][$eq]=true&fields[0]=code&fields[1]=slug"),o=await c(l),r=null==o?void 0:null===(t=o.data)||void 0===t?void 0:t[0];return"/brands/".concat((null==r?void 0:r.slug)||(null==r?void 0:r.code))}catch(e){console.error("Error searching brands:",e)}},m=(e,i)=>{if(!i||!i.length)return;let n=Object.keys(i[0]),t=new Blob([[n.join(","),...i.map(e=>n.map(i=>{var n;return'"'.concat(null===(n=e[i])||void 0===n?void 0:n.toString().replace(/"/g,'""'),'"')}).join(","))].join("\n")],{type:"text/csv;charset=utf-8;"}),l=URL.createObjectURL(t),o=document.createElement("a");o.setAttribute("href",l),o.setAttribute("download",e),o.style.visibility="hidden",document.body.appendChild(o),o.click(),document.body.removeChild(o)};function p(e,i,n){"function"==typeof n&&n(!0);let t=new URL(window.location.href);
1Object.entries(i).forEach(e=>{let[i,n]=e;null==n||""===n?t.searchParams.delete(i):t.searchParams.set(i,n.toString())}),e.replace("".concat(t.pathname,"?").concat(t.searchParams.toString()),{scroll:!1}),"function"==typeof n&&n(!0)}let f=e=>e?e.endsWith("s")?e:"".concat(e,"s"):"";function h(e){return null==e?e:e.split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}let y=()=>new URLSearchParams(window.location.search),g=(e,i)=>{let n=i?"?"+i.toString():"",l=["/forgot-password","/auth/login","/auth/signup"].some(i=>null==e?void 0:e.startsWith(i))||(null==e?void 0:e.startsWith("/password-reset"));return e===t.j.LOGIN||l?"".concat(t.j.LOGIN).concat(n):"".concat(t.j.LOGIN,"?redirectTo=").concat(e).concat(n)};function _(e,i){let n=new Date(e),t=new Date(i);return n.setHours(0,0,0,0),t.setHours(0,0,0,0),n.getTime()===t.getTime()}function b(e){var i,n,t,l,o;return[...new Set([null==e?void 0:e.streetLine1,null!==(i=null==e?void 0:e.apartment)&&void 0!==i?i:"",null!==(n=null==e?void 0:e.city)&&void 0!==n?n:"",null!==(t=null==e?void 0:e.province)&&void 0!==t?t:"",null!==(l=null==e?void 0:e.postalCode)&&void 0!==l?l:"",null!==(o=null==e?void 0:e.countryCode)&&void 0!==o?o:""].filter(e=>(null==e?void 0:e.trim())!=="").join(", ").split(/[\s,]+/))].join(" ").replace(/, /g,", ").trim()}let E=e=>{var i,n,t;return{"&::-webkit-scrollbar":{width:"3px",height:"3px"},"&::-webkit-scrollbar-track":{background:null==e?void 0:null===(i=e.palette)||void 0===i?void 0:i.borderColor.light,borderRadius:"100px 100px 0px 100px"},"&::-webkit-scrollbar-thumb":{background:null==e?void 0:null===(n=e.palette)||void 0===n?void 0:n.primary.main,borderRadius:"100px"},"&::-webkit-scrollbar-corner":{background:null==e?void 0:null===(t=e.palette)||void 0===t?void 0:t.borderColor.light}}};function A(e){return e?e.reduce((e,i)=>e+i.linePrice,0):0}function N(e,i){var n;let t=null==e?void 0:null===(n=e.inventory)||void 0===n?void 0:n.find(e=>e.location===i);return t?null==t?void 0:t.quantity:0}let T=async(e,i)=>{try{let n={keyword:e};i&&Array.isArray(i)&&i.length>0&&(n.results=i);let t=await fetch("/api/save-search-query",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});t.ok||console.error("Failed to save search query:",await t.text())}catch(e){console.error("Error saving search query:",e)}},C=async e=>{try{let i=await fetch("/api/add-filters-collection",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:null==e?void 0:e.id,name:null==e?void 0:e.name,parentname:null==e?void 0:e.type})});i.ok||console.error("Failed to send click:",await i.text())}catch(e){console.error("Error sending click:",e)}};function S(e){switch(null==e?void 0:e.toLowerCase()){case"visa":return"/stripeCards/visa.svg";case"mastercard":return"/stripeCards/master.svg";case"amex":return"/stripeCards/amex.svg";case"discover":return"/stripeCards/discover.svg";case"diners":return"/stripeCards/dinnersClub.svg";case"jcb":return"/stripeCards/jcb.svg";case"unionpay":return"/stripeCards/unionPay.svg";default:return"/stripeCards/card.svg"}}let x=e=>{if(null==e||!e.card)return!0;{let{exp_month:i,exp_year:n}=null==e?void 0:e.card,t=new Date,l=t.getMonth()+1,o=t.getFullYear();return n<o||n===o&&i<l}},w=()=>!0,I=e=>{let i=o()(e),n=o()(),t=i.isAfter(n),l=t?n:i,r=t?i:n,a=r.diff(l,"year"),u=r.diff(l.add(a,"year"),"month"),d=r.diff(l.add(a,"year").add(u,"month"),"day"),s=[];return a>0&&s.push("".concat(a," year").concat(a>1?"s":"")),u>0&&s.push("".concat(u," month").concat(u>1?"s":"")),d>0&&s.push("".concat(d," day").concat(d>1?"s":"")),s.length>0?s.join(", "):"0 days"},L=e=>{var i,n,t,l,o,r,a,d,s,c,v,m,p,f,h,y,g,_,b,E,A,N,T,C,S,x,w,I,L,O,P,k,R,M,j,z,D,Y,U,J,W,q,H,F,V,B,X,K,Q,Z,G,$,ee,ei;if(!e)return null;let en=null!==(R=null===(i=e.lines)||void 0===i?void 0:i.map(e=>{var i,n,t,l,o,r,a,u,d,s,c,v,m,p,f,h,y,g,_,b;return{stockNum:null!==(p=null===(i=e.productVariant)||void 0===i?void 0:i.sku)&&void 0!==p?p:"__",mfgNum:(null===(t=e.productVariant)||void 0===t?void 0:null===(n=t.customFields)||void 0===n?void 0:n.manufacturerSku)||(null===(l=e.productVariant)||void 0===l?void 0:l.sku)||"__",description:null!==(f=null===(o=e.productVariant)||void 0===o?void 0:o.name)&&void 0!==f?f:"__",qty:e.quantity-(null==e?void 0:null===(r=e.customFields)||void 0===r?void 0:r.returnQuantity),price:e.unitPrice/100,priceWithTax:e.unitPriceWithTax/100,netPrice:(null==e?void 0:e.unitPrice)/100,itemTax:(null==e?void 0:e.lineTax)/100,extendedPrice:e.linePriceWithTax/100,lineId:null==e?void 0:e.id,variantId:null==e?void 0:null===(a=e.productVariant)||void 0===a?void 0:a.id,isReturnAble:null==e?void 0:null===(d=e.productVariant)||void 0===d?void 0:null===(u=d.customFields)||void 0===u?void 0:u.isReturnable,returnQuantity:null==e?void 0:null===(s=e.customFields)||void 0===s?void 0:s.returnQuantity,image:(null==e?void 0:null===(c=e.featuredAsset)||void 0===c?void 0:c.preview)||null,fulfillmentStatus:null!==(_=null==e?void 0:null===(v=e.customFields)||void 0===v?void 0:v.itemStatus)&&void 0!==_?_:void 0,etaDate:null!==(b=null==e?void 0:null===(m=e.customFields)||void 0===m?void 0:m.itemStatusEtaAt)&&void 0!==b?b:void 0}}))&&void 0!==R?R:[],et=null===(l=e.payments)||void 0===l?void 0:null===(t=l.find(e=>{var i;return null===(i=e.metadata)||void 0===i?void 0:i.email}))||void 0===t?void 0:null===(n=t.metadata)||void 0===n?void 0:n.email;return{orderDetails:{buyerName:[null===(o=e.customer)||void 0===o?void 0:o.firstName,null===(r=e.customer)||void 0===r?void 0:r.lastName].filter(
1Boolean).join(" ")||"",buyerEmail:(null===(a=e.customer)||void 0===a?void 0:a.emailAddress)||et||"__",buyerPhone:(null==e?void 0:null===(d=e.shippingAddress)||void 0===d?void 0:d.phoneNumber)||(null===(s=e.customer)||void 0===s?void 0:s.phoneNumber)||"__",orderStatus:null!==(M=e.state)&&void 0!==M?M:"__",orderDate:u(e.orderPlacedAt),poNum:null!==(j=null===(c=e.customFields)||void 0===c?void 0:c.poNumber)&&void 0!==j?j:"__",freightTotal:e.shippingWithTax/100,miscellaneousTotal:0,merchandiseTotal:e.subTotalWithTax/100,orderTotal:e.totalWithTax/100,taxTotal:(e.totalWithTax-e.total)/100,tax:(null==e?void 0:e.total)/(null==e?void 0:e.totalWithTax),fulfillments:null==e?void 0:e.fulfillments,shippingLines:null==e?void 0:e.shippingLines,orderType:null==e?void 0:null===(m=e.customFields)||void 0===m?void 0:null===(v=m.deliveryMethod)||void 0===v?void 0:v.type},products:en,shipAddress:{fullName:null!==(U=null===(p=e.shippingAddress)||void 0===p?void 0:p.fullName)&&void 0!==U?U:"__",shipNumber:null!==(J=null===(f=e.shippingAddress)||void 0===f?void 0:f.phoneNumber)&&void 0!==J?J:"__",shipCompanyName:null!==(W=null===(h=e.shippingAddress)||void 0===h?void 0:h.company)&&void 0!==W?W:"__",shipAddress1:null!==(q=null===(y=e.shippingAddress)||void 0===y?void 0:y.streetLine1)&&void 0!==q?q:"__",shipApartment:(null===(_=e.shippingAddress)||void 0===_?void 0:null===(g=_.customFields)||void 0===g?void 0:g.apartment)||"",shipCity:null!==(H=null===(b=e.shippingAddress)||void 0===b?void 0:b.city)&&void 0!==H?H:"__",shipState:null!==(F=null===(E=e.shippingAddress)||void 0===E?void 0:E.province)&&void 0!==F?F:"__",shipPostCode:null!==(V=null===(A=e.shippingAddress)||void 0===A?void 0:A.postalCode)&&void 0!==V?V:"__"},billAddress:{fullName:null!==(B=null===(N=e.billingAddress)||void 0===N?void 0:N.fullName)&&void 0!==B?B:"__",billCompanyName:null!==(X=null===(T=e.billingAddress)||void 0===T?void 0:T.company)&&void 0!==X?X:"__",billAddress1:null!==(K=null===(C=e.billingAddress)||void 0===C?void 0:C.streetLine1)&&void 0!==K?K:"__",billApartment:(null===(x=e.billingAddress)||void 0===x?void 0:null===(S=x.customFields)||void 0===S?void 0:S.apartment)||"",billCity:null!==(Q=null===(w=e.billingAddress)||void 0===w?void 0:w.city)&&void 0!==Q?Q:"__",billState:null!==(Z=null===(I=e.billingAddress)||void 0===I?void 0:I.province)&&void 0!==Z?Z:"__",billPostCode:null!==(G=null===(L=e.billingAddress)||void 0===L?void 0:L.postalCode)&&void 0!==G?G:"__"},customFields:{warehouse:null!==($=null===(O=e.customFields)||void 0===O?void 0:O.warehouse)&&void 0!==$?$:null,pickupType:null!==(ee=null===(P=e.customFields)||void 0===P?void 0:P.pickupType)&&void 0!==ee?ee:null,deliveryMethod:null!==(ei=null===(k=e.customFields)||void 0===k?void 0:k.deliveryMethod)&&void 0!==ei?ei:null}}},O=(e,i)=>e&&e.message?e.message.filter(e=>!i||e.type===i).map(e=>e.content.filter(e=>e.isVisible).map(e=>e.text)).flat():[],P=e=>e?Array.isArray(e)?e.reduce((e,i)=>e+(Number(null==i?void 0:i.quantity)||0),0):"object"==typeof e?Object.values(e).reduce((e,i)=>e+(i||0),0):0:0,k=[{max:500,ranges:[{min:0,max:5},{min:5,max:25},{min:25,max:100},{min:100,max:500}]},{max:1e3,ranges:[{min:0,max:25},{min:25,max:75},{min:75,max:150},{min:150,max:500},{min:500,max:0}]},{max:2500,ranges:[{min:0,max:50},{min:50,max:150},{min:150,max:300},{min:300,max:700},{min:700,max:1500},{min:1500,max:0}]},{max:5e3,ranges:[{min:0,max:100},{min:100,max:300},{min:300,max:750},{min:750,max:1200},{min:1200,max:2e3},{min:2e3,max:3500},{min:3500,max:0}]},{max:1e4,ranges:[{min:0,max:100},{min:100,max:300},{min:300,max:750},{min:750,max:1200},{min:1200,max:2e3},{min:2e3,max:3500},{min:3500,max:5e3},{min:5e3,max:0}]}];function R(e){let i={RELEVANCE:{id:"RELEVANCE",label:"Relevance",value:null,column:"name"},"A-Z":{id:"A-Z",label:"A to Z",value:"ASC",column:"name"},"Z-A":{id:"Z-A",label:"Z to A",value:"DESC",column:"name"},"PH-L":{id:"PH-L",label:"Price High to Low",value:"DESC",column:"price"},"PL-H":{id:"PL-H",label:"Price Low to High",value:"ASC",column:"price"},NEWEST:{id:"NEWEST",label:"Newest",value:"DESC",column:"createdAt"}};return i[e]||i.RELEVANCE}function M(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=k.find(i=>e<=i.max)||k[k.length-1],t=[];for(let l=0;l<n.ranges.length;l++){let o=n.ranges[l];if(!o.max||!(o.max<=i)){if(o.max&&o.max<=e)t.push({min:o.min,max:o.max});else if(o.max&&o.min<e&&o.max>e)return t.push({min:o.min,max:e}),t;else if(o.max&&e<o.min){let i=n.ranges[l-1];return i?t.push({min:i.max,max:e}):t.push({min:0,max:e}),t}else if(0===o.max&&e>=o.min)return t.push({min:o.min,plus:!0}),t}}let l=n.ranges.find(e=>0===e.max),o=t[t.length-1];return(null==o?void 0:o.plus)||!l||t.push({min:l.min,plus:!0}),t}let j=e=>{let{orderCode:i,paymentIntentId:n,clientSecret:t,paymentMethodId:l,isSuccessPage:o=!0}=e,r=new URLSearchParams;return(n&&r.set("payment_intent",n),l&&r.set("paymentMethodId",l),o)?(t&&r.set("payment_intent_client_secret",t),"/checkout/success/".concat(i,"?").concat(r.toString())):(r.set("success","true"),"/checkout?orderCode=".concat(i,"&").concat(r.toString()))},z=e=>null==e?void 0:e.some(e=>{var i,n;return(null==e?void 0:null===(i=e.slug)||void 0===i?void 0:i.toLowerCase())==="sale"||(null==e?void 0:null===(n=e.name)||void 0===n?void 0:n.toLowerCase())==="sale"});function D(e,i){var n,t;if(!(null==e?void 0:e.length)||!(null==i?void 0:i.length))return[];let l=null!==(t=null==i?void 0:null===(n=i.find(e=>"brand.id"===e.field_name))||void 0===n?void 0:n.counts)&&void 0!==t?t:[];if(!l.length)return[];let o=new Set(l.map(e=>{var i,n;return null===(n=e.parent)||void 0===n?void 0:null===(i=n.code)||void 0===i?void 0:i.toLowerCase()}
1).filter(Boolean));return e.filter(e=>o.has(e.code.toLowerCase()))}let Y=async e=>{let i=await fetch("/api/get-facet-by-query?query=".concat(encodeURIComponent(e)),{method:"GET"});return(await i.json()).results||{}},U=["Created","Pending","Cancelled"];function J(e){let i={},n=0,t=0;return null==e||e.filter(e=>!U.includes(null==e?void 0:e.state)).forEach(e=>{var l;let o="Delivered"===e.state;null===(l=e.lines)||void 0===l||l.forEach(e=>{var l,r,a;let u=null!==(r=null==e?void 0:null===(l=e.orderLine)||void 0===l?void 0:l.id)&&void 0!==r?r:null==e?void 0:e.orderLineId,d=Number(null==e?void 0:e.quantity)||0;if(!u||d<=0)return;let s=null!==(a=i[u])&&void 0!==a?a:i[u]={shipped:0,delivered:0};s.shipped+=d,n+=d,o&&(s.delivered+=d,t+=d)})}),{byLineId:i,shippedTotal:n,deliveredTotal:t}}function W(e){var i;let n=function(e){let i={},n=new Date;return null==e||e.filter(e=>"Delivered"===e.state&&n-new Date((null==e?void 0:e.updatedAt)||(null==e?void 0:e.createdAt))<=2592e6).forEach(e=>{var n;null===(n=e.lines)||void 0===n||n.forEach(e=>{var n,t;let l=null===(t=e.orderLine)||void 0===t?void 0:null===(n=t.productVariant)||void 0===n?void 0:n.sku,o=e.quantity||0;l&&(i[l]=(i[l]||0)+o)})}),i}(null==e?void 0:null===(i=e.orderDetails)||void 0===i?void 0:i.fulfillments);return e.products.filter(e=>(null==e?void 0:e.isReturnAble)&&n[null==e?void 0:e.stockNum]).map(e=>{let i=n[e.stockNum]||0,t=e.returnQuantity||0;return{...e,qty:i-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.