1import{d as t}from"./vendor.MggefUiv.min.js";const e={},o={},n=async(t,e)=>{try{const o=t.headers.get("content-type");return o&&(o.includes("application/json")||o.includes("application/graphql")||o.includes("text/javascript"))||(null==e?void 0:e.forceJSON)?await t.json():await t.text()}catch(o){return await t.text()}},s=t=>{const e={};for(const[o,n]of t)e[o]?Array.isArray(e[o])?e[o].push(n):e[o]=[e[o],n]:e[o]=n;return e},i=async(t,e,o,s,i)=>{var r,a,l,c;try{const c={...t.headers,...(null==s?void 0:s.headers)||{}},h=(null==i?void 0:i.params)?(t=>{const e=new URLSearchParams;for(const o in t){const n=t[o];if(Array.isArray(n))for(const t of n)e.append(o,t);else e.set(o,n)}return e})(i.params):null;null==(r=null==t?void 0:t.onRequestStart)||r.call(t);const u={...c,...(null==s?void 0:s.headers)||{}};(null==i?void 0:i.removeContentType)&&delete u["Content-Type"];const d=(null==s?void 0:s.method)||t.defaultMethod||"GET",y=(null==i?void 0:i.withCache)&&"GET"===d,p=`${t.baseUrl}${o}${h?"?"+h.toString():""}`;if(y){const t=e.get(p);if(t)return t}const f=await fetch(p,{signal:t.signal,method:d,...s,headers:u,...(null==s?void 0:s.body)&&(null==i?void 0:i.rawBody)&&{body:s.body},...(null==s?void 0:s.body)&&!(null==i?void 0:i.rawBody)&&{body:JSON.stringify(s.body)}});if(!f.ok||f.status>=400)throw await n(f,i);if(null==(l=null==(a=null==s?void 0:s.headers)?void 0:a["Content-Type"])?void 0:l.includes("text/")){const t=await f.text();return y&&e.set(p,t),t}const w=await n(f,i);return y&&e.set(p,w),w}catch(h){throw h}finally{null==(c=null==t?void 0:t.onRequestEnd)||c.call(t)}},r=(n,s)=>{const r=new h(s);return n.withQueue&&n.queueKey&&(e[n.queueKey]||(e[n.queueKey]=[])),(s,a,l)=>{if(n.withQueue&&n.queueKey){const c=t();return e[n.queueKey].push({requestArguments:{endpoint:s,init:a,options:l},deferred:c}),(async(t,n,s)=>{if(o[s])return;o[s]=!0;const r=e[s];for(;r.length>0;){const{requestArguments:e,deferred:o}=r.shift();try{const s=await i(t,n,e.endpoint,e.init,e.options);o.resolve(s)}catch(a){o.reject(a)}}o[s]=!1})(n,r,n.queueKey),c.promise}return i(n,r,s,a,l)}},a=t=>class extends t{constructor(){super(...arguments),this.$api=new l(this)}};class l{constructor(t){this.abortController=new AbortController,this.fetchClient=r({baseUrl:"",signal:this.abortController.signal}),this.storefrontClient=r({baseUrl:`${"/"===window.Shopify.routes.root?"":window.Shopify.routes.root}/api/2024-07/graphql.json`,headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":`${window.__STOREFRONT_ACCESS_TOKEN__}`},defaultMethod:"POST",signal:this.abortController.signal}),this.shopifyClient=r({baseUrl:`${window.Shopify.routes.root}`,headers:{"Content-Type":"application/json"},signal:this.abortController.signal}),(this.host=t).addController(this)}hostDisconnected(){this.abortController.abort()}get client(){return{fetchClient:this.fetchClient,storefront:t=>this.storefrontClient("",t),shopify:this.shopifyClient}}}const c=new Map;class h{constructor(t){if(this.cache=new Map,this.get=t=>this.cache.get(t),this.set=(t,e)=>this.cache.set(t,e),this.clear=()=>this.cache.clear(),this.cacheKey=t,this.cacheKey&&(c.has(this.cacheKey)||c.set(this.cacheKey,this)),this.cacheKey&&c.has(this.cacheKey)){const t=c.get(this.cacheKey);t&&(this.cache=t.cache)}}}export{a as W,r as c,s as f};
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.