@haus-storefront-react/vendure-plugin-configs 1.0.4-next.2 → 1.0.4-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/badge.js +1 -21
- package/badge.mjs +244 -2868
- package/campaign.js +1 -1
- package/campaign.mjs +1 -1
- package/compiler-runtime-oPPev21o.js +10 -0
- package/{index-BCrKAB0K.mjs → compiler-runtime-qHgugrLy.mjs} +100 -115
- package/index-BgBC_k8M.js +1 -0
- package/index-C0E-40z0.mjs +19 -0
- package/lib/configs/vendure-purchase-order-payment-plugin.d.ts +14 -0
- package/lib/configs/vendure-purchase-order-payment-plugin.types.d.ts +7 -0
- package/lib/exports/purchase-order-payment.d.ts +3 -0
- package/lib/hooks/use-add-purchase-order-payment.d.ts +13 -0
- package/lib/types.d.ts +1 -0
- package/package.json +11 -4
- package/purchase-order-payment.d.ts +2 -0
- package/purchase-order-payment.js +27 -0
- package/purchase-order-payment.mjs +633 -0
- package/useSdk-DOrZRSHz.mjs +2634 -0
- package/useSdk-YXpk8Wsi.js +21 -0
- package/index-DgRzu7XX.js +0 -10
package/CHANGELOG.md
CHANGED
package/badge.js
CHANGED
|
@@ -1,21 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ke=require("./index-CgxqXyHf.js"),S=require("./index-DgRzu7XX.js"),se=require("react"),ze=require("@tanstack/react-query");function pr(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const O=pr(se),H=new ke.VendurePluginConfig({name:"badges",enableFeatures:{showBadges:({badges:t=[],parentComponent:e})=>{const r=e?H.getSettings().availablePositions[e]:H.getSettings().defaultPositions;return{badges:ke.lodashExports.filter(t,o=>r?r.includes(o.position):!0),availablePositions:r}}},queryUpdates:{},settings:{defaultPositions:["top-left","top-right","bottom-left","bottom-right"],availablePositions:{productListItem:["top-left","top-right","bottom-left","bottom-right"],productDetail:["top-left","top-right","bottom-left","bottom-right"],imageCarousel:["top-left","top-right","bottom-left","bottom-right"]}}});H.setQueryUpdates({product:{fields:[{badges:["id","position","assetId",{asset:["id","name","preview","source"]},{collection:["id","name"]}]}]},search:{fields:[{items:[{badges:["id","position","assetId",{asset:["id","name","preview","source"]},{collection:["id","name"]}]}]}]},products:{fields:[{items:[{badges:["id","position","assetId",{asset:["id","name","preview","source"]},{collection:["id","name"]}]}]}]},briefProducts:{fields:[{items:[{badges:["id","position","assetId",{asset:["id","name","preview","source"]},{collection:["id","name"]}]}]}]}});H.setRequests({getBadges:async()=>H.getSdk().createRequest({operation:"badges",fields:["totalItems",{items:["id","createdAt","updatedAt","collectionId","position","assetId",{asset:["id","name","preview","source"]},{collection:["id","name"]}]}]},{options:{take:100}},!1).then(t=>t.data).catch(t=>({message:t.message,errorCode:t.code||"unknown"}))});function hr(t){const e=[];function r(o,s){const i=O.createContext(s),a=e.length;e.push(i);const c=l=>{const d=S.compilerRuntimeExports.c(8);let m,g,p;d[0]!==l?({scope:p,children:m,...g}=l,d[0]=l,d[1]=m,d[2]=g,d[3]=p):(m=d[1],g=d[2],p=d[3]);const y=p?.[t]?.[a]||i,h=g;let w;return d[4]!==y.Provider||d[5]!==m||d[6]!==h?(w=S.jsxRuntimeExports.jsx(y.Provider,{value:h,children:m}),d[4]=y.Provider,d[5]=m,d[6]=h,d[7]=w):w=d[7],w};c.displayName=o+"Provider";function u(l,d){const m=d?.[t]?.[a]||i,g=O.useContext(m);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${l}\` must be used within \`${o}\``)}return[c,u]}function n(){const o=e.map(s=>O.createContext(s));return function(i){const a=i?.[t]||o;return O.useMemo(()=>({[`__scope${t}`]:{...i,[t]:a}}),[i,a])}}return n.scopeName=t,[r,n]}function mr(t,e){if(e==="web")return t;const{src:r,alt:n,width:o,height:s,...i}=t,a=[typeof o=="number"?{width:o}:void 0,typeof s=="number"?{height:s}:void 0].filter(Boolean);let c;return a.length===1?c=a[0]:a.length>1&&(c=a),{...i,source:{uri:r},...c?{style:c}:{}}}function yr(t){const{src:e,alt:r,...n}=t;return e?{...n,source:{uri:e}}:n}const gr={div:"View",span:"Text",p:"Text",h1:"Text",h2:"Text",h3:"Text",h4:"Text",h5:"Text",h6:"Text",button:"Pressable",input:"TextInput",form:"View",section:"View",article:"View",nav:"View",header:"View",footer:"View",main:"View",aside:"View",ul:"View",ol:"View",li:"View",a:"Pressable",img:"Image",label:"Text",textarea:"TextInput",select:"Pressable",option:"Text"};function br(t,e){if(e==="web")return t;let r=null;try{r=require("react-native")}catch{r=null}if(!r)return console.warn(`react-native is not available at runtime; falling back to 'View' for '${t}'`),"div";const n=gr[t];if(!n)return console.warn(`No native component mapping found for '${t}', falling back to View`),r.View;if(n==="Image"){const s=se.forwardRef((i,a)=>{const c=S.compilerRuntimeExports.c(5);if(!i.src)return null;let u;c[0]!==i?(u=yr(i),c[0]=i,c[1]=u):u=c[1];let l;return c[2]!==a||c[3]!==u?(l=S.jsxRuntimeExports.jsx(r.Image,{ref:a,...u}),c[2]=a,c[3]=u,c[4]=l):l=c[4],l});return s.displayName="PlatformPrimitiveImage",s}const o=r[n];return o||(console.warn(`Native component '${n}' not found, falling back to View`),r.View)}const wr=Symbol("radix.slottable");function Ar(...t){return e=>t.forEach(r=>{typeof r=="function"?r(e):r!=null&&(r.current=e)})}function Sr(t,e){const r={...e};for(const n in e){const o=t[n],s=e[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(r[n]=o):n==="style"?r[n]=Er(o,s):n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...t,...r}}function Er(t,e){let r=null;try{r=require("react-native")}catch{r=null}const n=r?.StyleSheet?.flatten;if(typeof t=="function"&&typeof e=="function")return s=>{const i=[t(s),e(s)];return n?n(i):i};if(typeof t=="function")return s=>{const i=e?[t(s),e]:t(s);return n?n(i):i};if(typeof e=="function")return s=>{const i=t?[t,e(s)]:e(s);return n?n(i):i};const o=[t,e].filter(Boolean);return n?n(o):o}function Or(t){return O.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===wr}function vr(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}function Tr(t,e){const r=O.forwardRef((n,o)=>{const{children:s,...i}=n;if(O.isValidElement(s)){const a=vr(s),c=Sr(i,s.props);return s.type!==O.Fragment&&(c.ref=o?Ar(o,a):a),O.cloneElement(s,c)}return O.Children.count(s)>1?O.Children.only(null):null});return r.displayName=`${t}.SlotClone`,r}function Re(t,e=!1,r="div"){if(!e)return br(r,t);const n=Tr("Slot"),o=O.forwardRef((s,i)=>{const a=S.compilerRuntimeExports.c(15);let c,u;a[0]!==s?({children:c,...u}=s,a[0]=s,a[1]=c,a[2]=u):(c=a[1],u=a[2]);let l;if(a[3]!==c||a[4]!==i||a[5]!==u){l=Symbol.for("react.early_return_sentinel");e:{const m=O.Children.toArray(c),g=m.find(Or);if(g){const p=g.props.children,y=m.map(T=>T===g?O.Children.count(p)>1?O.Children.only(null):O.isValidElement(p)?p.props.children:null:T),h=O.isValidElement(p)?O.cloneElement(p,void 0,y):null;let w;a[7]!==i||a[8]!==u||a[9]!==h?(w=S.jsxRuntimeExports.jsx(n,{...u,ref:i,children:h}),a[7]=i,a[8]=u,a[9]=h,a[10]=w):w=a[10],l=w;break e}}a[3]=c,a[4]=i,a[5]=u,a[6]=l}else l=a[6];if(l!==Symbol.for("react.early_return_sentinel"))return l;let d;return a[11]!==c||a[12]!==i||a[13]!==u?(d=S.jsxRuntimeExports.jsx(n,{...u,ref:i,children:c}),a[11]=c,a[12]=i,a[13]=u,a[14]=d):d=a[14],d});return o.displayName="Slot",o}const Rr="debug",N=()=>{try{if(typeof window>"u"||typeof localStorage>"u")return!1;const t=localStorage.getItem(Rr);return t==="true"||t==="1"}catch{return!1}},xr=()=>{const t=(e,r,n=[])=>r?typeof e=="string"?[`<${r}> ${e}`,...n]:[`<${r}>`,e,...n]:Array.isArray(e)?[...e,...n]:[e,...n];return{log:(e,r,...n)=>{N()&&console.log(...t(e,r,n))},info:(e,r,...n)=>{N()&&console.info(...t(e,r,n))},warn:(e,r,...n)=>{N()&&console.warn(...t(e,r,n))},error:(e,r,...n)=>{N()&&console.error(...t(e,r,n))},debug:(e,r,...n)=>{N()&&console.debug(...t(e,r,n))},group:(e,r)=>{if(N()){const n=typeof e=="string"?e:void 0;console.group(r?n?`<${r}> ${n}`:`<${r}>`:n)}},groupCollapsed:(e,r)=>{if(N()){const n=typeof e=="string"?e:void 0;console.groupCollapsed(r?n?`<${r}> ${n}`:`<${r}>`:n)}},groupEnd:()=>{N()&&console.groupEnd()},table:(e,r,n)=>{N()&&(r&&console.log(`<${r}>`),console.table(e,n))},time:(e,r)=>{if(N()){const n=typeof e=="string"?e:void 0;console.time(r?n?`<${r}> ${n}`:`<${r}>`:n)}},timeEnd:(e,r)=>{if(N()){const n=typeof e=="string"?e:void 0;console.timeEnd(r?n?`<${r}> ${n}`:`<${r}>`:n)}}}},_r=xr();function Cr(t){return{all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map(function(o){o(r)}),(n=t.get("*"))&&n.slice().map(function(o){o(e,r)})}}}let Y;try{Y=require("@react-native-async-storage/async-storage").default}catch{Y=null}let He=null;try{const{AsyncLocalStorage:t}=require("node:async_hooks");He=new t}catch{He=null}const K=typeof window<"u"&&typeof window.localStorage<"u",z=!!Y,me={},Fe={getItem:async()=>null,setItem:async()=>{},removeItem:async()=>{}},Ie=()=>{try{return He?.getStore?.()??null}catch{return null}},Me={getItem:async t=>{const e=!K&&!z?Ie():null;return e?e.getItem(t):z?Y.getItem(t):K?new Promise(r=>{Promise.resolve().then(()=>{const n=window.localStorage.getItem(t),o=me[t];n!==o&&(me[t]=n||""),r(n)})}):Fe.getItem(t)},setItem:async(t,e)=>{const r=!K&&!z?Ie():null;return r?r.setItem(t,e):z?Y.setItem(t,e):K?new Promise((n,o)=>{Promise.resolve().then(()=>{try{window.localStorage.setItem(t,e);const s=window.localStorage.getItem(t);s===e?(me[t]=e,n()):o(new Error(`Failed to set localStorage item: expected "${e}", got "${s}"`))}catch(s){o(s)}})}):Fe.setItem(t,e)},removeItem:async t=>{const e=!K&&!z?Ie():null;return e?e.removeItem(t):z?Y.removeItem(t):K?new Promise((r,n)=>{Promise.resolve().then(()=>{try{window.localStorage.removeItem(t);const o=window.localStorage.getItem(t);o===null?(delete me[t],r()):n(new Error(`Failed to remove localStorage item: key "${t}" still exists with value "${o}"`))}catch(o){n(o)}})}):Fe.removeItem(t)}},it=50,M={get:async()=>{try{const t=await Me.getItem("eventHistory");return t?JSON.parse(t):[]}catch(t){return console.error("Error getting event history",t),[]}},set:async t=>{try{await Me.setItem("eventHistory",JSON.stringify(t.slice(-it)))}catch(e){console.error("Error setting event history",e)}},clear:async()=>{try{await Me.removeItem("eventHistory")}catch(t){console.error("Error clearing event history",t)}},push:async t=>{const e=await M.get();await M.set([{...t,timestamp:Date.now()},...e].slice(-it))},find:async t=>(await M.get()).find(r=>r.key===t.key&&r.identifier===t.identifier),filter:async(t,e)=>{const r=await M.get();return e?r.filter(e):r.filter(({key:n,identifier:o})=>(!n||t.key===n)&&(!o||t.identifier===o))}};function Pr(){const t=globalThis;return t.__HAUS_EVENT_EMITTER__||=Cr(),t.__HAUS_EVENT_EMITTER__}function Q(t){const e=Pr(),r=((...c)=>console.error(...c));M.get().then(c=>{const l=ke.lodashExports.first(c)?.timestamp;l&&l<Date.now()-1e3*60*60&&(_r.info("Clearing event history since it is older than 1 hour:","eventBus",l),M.clear())});const n=(c,u,l)=>{const d=m=>{try{if(typeof m=="object"&&m!==null){const{identifier:g,data:p}=m;(!g||g===l)&&u(p)}else u(m)}catch(g){r(g)}};return e.on(c,d),()=>{o(c,u,l)}},o=(c,u,l)=>{const d=m=>{if(typeof m=="object"&&m!==null){const{identifier:g}=m;(!g||g===l)&&e.off(c,u)}};e.off(c,d)};return{on:n,off:o,once:(c,u,l)=>{const d=m=>{try{if(typeof m=="object"&&m!==null){const{identifier:g,data:p}=m;(!g||g===l)&&u(p)}else u(m)}finally{o(c,d,l)}};e.on(c,d)},emit:(c,u,...l)=>{const d={identifier:u,data:l.length===1?l[0]:l};M.push({key:c,identifier:u,payload:d.data}),e.emit(c,d)},getEventHistory:(c,u)=>M.filter({key:c,identifier:u})}}Q();Q();Q();Q();Q();Q();Q();const Nr=globalThis.__STORE_SDK_CONTEXT__||=se.createContext(void 0);function Bt(t,e){return function(){return t.apply(e,arguments)}}const{toString:qr}=Object.prototype,{getPrototypeOf:Je}=Object,{iterator:xe,toStringTag:Ft}=Symbol,_e=(t=>e=>{const r=qr.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),D=t=>(t=t.toLowerCase(),e=>_e(e)===t),Ce=t=>e=>typeof e===t,{isArray:ee}=Array,Z=Ce("undefined");function ie(t){return t!==null&&!Z(t)&&t.constructor!==null&&!Z(t.constructor)&&x(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const It=D("ArrayBuffer");function Dr(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&It(t.buffer),e}const jr=Ce("string"),x=Ce("function"),Mt=Ce("number"),ae=t=>t!==null&&typeof t=="object",Br=t=>t===!0||t===!1,Ee=t=>{if(_e(t)!=="object")return!1;const e=Je(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Ft in t)&&!(xe in t)},Fr=t=>{if(!ae(t)||ie(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Ir=D("Date"),Mr=D("File"),Ur=D("Blob"),Lr=D("FileList"),$r=t=>ae(t)&&x(t.pipe),kr=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||x(t.append)&&((e=_e(t))==="formdata"||e==="object"&&x(t.toString)&&t.toString()==="[object FormData]"))},Hr=D("URLSearchParams"),[Vr,Qr,Wr,Kr]=["ReadableStream","Request","Response","Headers"].map(D),zr=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ce(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,o;if(typeof t!="object"&&(t=[t]),ee(t))for(n=0,o=t.length;n<o;n++)e.call(null,t[n],n,t);else{if(ie(t))return;const s=r?Object.getOwnPropertyNames(t):Object.keys(t),i=s.length;let a;for(n=0;n<i;n++)a=s[n],e.call(null,t[a],a,t)}}function Ut(t,e){if(ie(t))return null;e=e.toLowerCase();const r=Object.keys(t);let n=r.length,o;for(;n-- >0;)if(o=r[n],e===o.toLowerCase())return o;return null}const $=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Lt=t=>!Z(t)&&t!==$;function Ve(){const{caseless:t,skipUndefined:e}=Lt(this)&&this||{},r={},n=(o,s)=>{const i=t&&Ut(r,s)||s;Ee(r[i])&&Ee(o)?r[i]=Ve(r[i],o):Ee(o)?r[i]=Ve({},o):ee(o)?r[i]=o.slice():(!e||!Z(o))&&(r[i]=o)};for(let o=0,s=arguments.length;o<s;o++)arguments[o]&&ce(arguments[o],n);return r}const Jr=(t,e,r,{allOwnKeys:n}={})=>(ce(e,(o,s)=>{r&&x(o)?t[s]=Bt(o,r):t[s]=o},{allOwnKeys:n}),t),Gr=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Xr=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},Yr=(t,e,r,n)=>{let o,s,i;const a={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),s=o.length;s-- >0;)i=o[s],(!n||n(i,t,e))&&!a[i]&&(e[i]=t[i],a[i]=!0);t=r!==!1&&Je(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},Zr=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return n!==-1&&n===r},en=t=>{if(!t)return null;if(ee(t))return t;let e=t.length;if(!Mt(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},tn=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Je(Uint8Array)),rn=(t,e)=>{const n=(t&&t[xe]).call(t);let o;for(;(o=n.next())&&!o.done;){const s=o.value;e.call(t,s[0],s[1])}},nn=(t,e)=>{let r;const n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},on=D("HTMLFormElement"),sn=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),at=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),an=D("RegExp"),$t=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};ce(r,(o,s)=>{let i;(i=e(o,s,t))!==!1&&(n[s]=i||o)}),Object.defineProperties(t,n)},cn=t=>{$t(t,(e,r)=>{if(x(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=t[r];if(x(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},un=(t,e)=>{const r={},n=o=>{o.forEach(s=>{r[s]=!0})};return ee(t)?n(t):n(String(t).split(e)),r},ln=()=>{},fn=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function dn(t){return!!(t&&x(t.append)&&t[Ft]==="FormData"&&t[xe])}const pn=t=>{const e=new Array(10),r=(n,o)=>{if(ae(n)){if(e.indexOf(n)>=0)return;if(ie(n))return n;if(!("toJSON"in n)){e[o]=n;const s=ee(n)?[]:{};return ce(n,(i,a)=>{const c=r(i,o+1);!Z(c)&&(s[a]=c)}),e[o]=void 0,s}}return n};return r(t,0)},hn=D("AsyncFunction"),mn=t=>t&&(ae(t)||x(t))&&x(t.then)&&x(t.catch),kt=((t,e)=>t?setImmediate:e?((r,n)=>($.addEventListener("message",({source:o,data:s})=>{o===$&&s===r&&n.length&&n.shift()()},!1),o=>{n.push(o),$.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",x($.postMessage)),yn=typeof queueMicrotask<"u"?queueMicrotask.bind($):typeof process<"u"&&process.nextTick||kt,gn=t=>t!=null&&x(t[xe]),f={isArray:ee,isArrayBuffer:It,isBuffer:ie,isFormData:kr,isArrayBufferView:Dr,isString:jr,isNumber:Mt,isBoolean:Br,isObject:ae,isPlainObject:Ee,isEmptyObject:Fr,isReadableStream:Vr,isRequest:Qr,isResponse:Wr,isHeaders:Kr,isUndefined:Z,isDate:Ir,isFile:Mr,isBlob:Ur,isRegExp:an,isFunction:x,isStream:$r,isURLSearchParams:Hr,isTypedArray:tn,isFileList:Lr,forEach:ce,merge:Ve,extend:Jr,trim:zr,stripBOM:Gr,inherits:Xr,toFlatObject:Yr,kindOf:_e,kindOfTest:D,endsWith:Zr,toArray:en,forEachEntry:rn,matchAll:nn,isHTMLForm:on,hasOwnProperty:at,hasOwnProp:at,reduceDescriptors:$t,freezeMethods:cn,toObjectSet:un,toCamelCase:sn,noop:ln,toFiniteNumber:fn,findKey:Ut,global:$,isContextDefined:Lt,isSpecCompliantForm:dn,toJSONObject:pn,isAsyncFn:hn,isThenable:mn,setImmediate:kt,asap:yn,isIterable:gn};function b(t,e,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}f.inherits(b,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:f.toJSONObject(this.config),code:this.code,status:this.status}}});const Ht=b.prototype,Vt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Vt[t]={value:t}});Object.defineProperties(b,Vt);Object.defineProperty(Ht,"isAxiosError",{value:!0});b.from=(t,e,r,n,o,s)=>{const i=Object.create(Ht);f.toFlatObject(t,i,function(l){return l!==Error.prototype},u=>u!=="isAxiosError");const a=t&&t.message?t.message:"Error",c=e==null&&t?t.code:e;return b.call(i,a,c,r,n,o),t&&i.cause==null&&Object.defineProperty(i,"cause",{value:t,configurable:!0}),i.name=t&&t.name||"Error",s&&Object.assign(i,s),i};const bn=null;function Qe(t){return f.isPlainObject(t)||f.isArray(t)}function Qt(t){return f.endsWith(t,"[]")?t.slice(0,-2):t}function ct(t,e,r){return t?t.concat(e).map(function(o,s){return o=Qt(o),!r&&s?"["+o+"]":o}).join(r?".":""):e}function wn(t){return f.isArray(t)&&!t.some(Qe)}const An=f.toFlatObject(f,{},null,function(e){return/^is[A-Z]/.test(e)});function Pe(t,e,r){if(!f.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=f.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,h){return!f.isUndefined(h[y])});const n=r.metaTokens,o=r.visitor||l,s=r.dots,i=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&f.isSpecCompliantForm(e);if(!f.isFunction(o))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(f.isDate(p))return p.toISOString();if(f.isBoolean(p))return p.toString();if(!c&&f.isBlob(p))throw new b("Blob is not supported. Use a Buffer instead.");return f.isArrayBuffer(p)||f.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function l(p,y,h){let w=p;if(p&&!h&&typeof p=="object"){if(f.endsWith(y,"{}"))y=n?y:y.slice(0,-2),p=JSON.stringify(p);else if(f.isArray(p)&&wn(p)||(f.isFileList(p)||f.endsWith(y,"[]"))&&(w=f.toArray(p)))return y=Qt(y),w.forEach(function(E,R){!(f.isUndefined(E)||E===null)&&e.append(i===!0?ct([y],R,s):i===null?y:y+"[]",u(E))}),!1}return Qe(p)?!0:(e.append(ct(h,y,s),u(p)),!1)}const d=[],m=Object.assign(An,{defaultVisitor:l,convertValue:u,isVisitable:Qe});function g(p,y){if(!f.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+y.join("."));d.push(p),f.forEach(p,function(w,T){(!(f.isUndefined(w)||w===null)&&o.call(e,w,f.isString(T)?T.trim():T,y,m))===!0&&g(w,y?y.concat(T):[T])}),d.pop()}}if(!f.isObject(t))throw new TypeError("data must be an object");return g(t),e}function ut(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function Ge(t,e){this._pairs=[],t&&Pe(t,this,e)}const Wt=Ge.prototype;Wt.append=function(e,r){this._pairs.push([e,r])};Wt.toString=function(e){const r=e?function(n){return e.call(this,n,ut)}:ut;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Sn(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Kt(t,e,r){if(!e)return t;const n=r&&r.encode||Sn;f.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let s;if(o?s=o(e,r):s=f.isURLSearchParams(e)?e.toString():new Ge(e,r).toString(n),s){const i=t.indexOf("#");i!==-1&&(t=t.slice(0,i)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class lt{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){f.forEach(this.handlers,function(n){n!==null&&e(n)})}}const zt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},En=typeof URLSearchParams<"u"?URLSearchParams:Ge,On=typeof FormData<"u"?FormData:null,vn=typeof Blob<"u"?Blob:null,Tn={isBrowser:!0,classes:{URLSearchParams:En,FormData:On,Blob:vn},protocols:["http","https","file","blob","url","data"]},Xe=typeof window<"u"&&typeof document<"u",We=typeof navigator=="object"&&navigator||void 0,Rn=Xe&&(!We||["ReactNative","NativeScript","NS"].indexOf(We.product)<0),xn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",_n=Xe&&window.location.href||"http://localhost",Cn=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Xe,hasStandardBrowserEnv:Rn,hasStandardBrowserWebWorkerEnv:xn,navigator:We,origin:_n},Symbol.toStringTag,{value:"Module"})),v={...Cn,...Tn};function Pn(t,e){return Pe(t,new v.classes.URLSearchParams,{visitor:function(r,n,o,s){return v.isNode&&f.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...e})}function Nn(t){return f.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function qn(t){const e={},r=Object.keys(t);let n;const o=r.length;let s;for(n=0;n<o;n++)s=r[n],e[s]=t[s];return e}function Jt(t){function e(r,n,o,s){let i=r[s++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),c=s>=r.length;return i=!i&&f.isArray(o)?o.length:i,c?(f.hasOwnProp(o,i)?o[i]=[o[i],n]:o[i]=n,!a):((!o[i]||!f.isObject(o[i]))&&(o[i]=[]),e(r,n,o[i],s)&&f.isArray(o[i])&&(o[i]=qn(o[i])),!a)}if(f.isFormData(t)&&f.isFunction(t.entries)){const r={};return f.forEachEntry(t,(n,o)=>{e(Nn(n),o,r,0)}),r}return null}function Dn(t,e,r){if(f.isString(t))try{return(e||JSON.parse)(t),f.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}const ue={transitional:zt,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,s=f.isObject(e);if(s&&f.isHTMLForm(e)&&(e=new FormData(e)),f.isFormData(e))return o?JSON.stringify(Jt(e)):e;if(f.isArrayBuffer(e)||f.isBuffer(e)||f.isStream(e)||f.isFile(e)||f.isBlob(e)||f.isReadableStream(e))return e;if(f.isArrayBufferView(e))return e.buffer;if(f.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Pn(e,this.formSerializer).toString();if((a=f.isFileList(e))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Pe(a?{"files[]":e}:e,c&&new c,this.formSerializer)}}return s||o?(r.setContentType("application/json",!1),Dn(e)):e}],transformResponse:[function(e){const r=this.transitional||ue.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(f.isResponse(e)||f.isReadableStream(e))return e;if(e&&f.isString(e)&&(n&&!this.responseType||o)){const i=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(e,this.parseReviver)}catch(a){if(i)throw a.name==="SyntaxError"?b.from(a,b.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:v.classes.FormData,Blob:v.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};f.forEach(["delete","get","head","post","put","patch"],t=>{ue.headers[t]={}});const jn=f.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Bn=t=>{const e={};let r,n,o;return t&&t.split(`
|
|
2
|
-
`).forEach(function(i){o=i.indexOf(":"),r=i.substring(0,o).trim().toLowerCase(),n=i.substring(o+1).trim(),!(!r||e[r]&&jn[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e},ft=Symbol("internals");function ne(t){return t&&String(t).trim().toLowerCase()}function Oe(t){return t===!1||t==null?t:f.isArray(t)?t.map(Oe):String(t)}function Fn(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}const In=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Ue(t,e,r,n,o){if(f.isFunction(n))return n.call(this,e,r);if(o&&(e=r),!!f.isString(e)){if(f.isString(n))return e.indexOf(n)!==-1;if(f.isRegExp(n))return n.test(e)}}function Mn(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function Un(t,e){const r=f.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(o,s,i){return this[n].call(this,e,o,s,i)},configurable:!0})})}let _=class{constructor(e){e&&this.set(e)}set(e,r,n){const o=this;function s(a,c,u){const l=ne(c);if(!l)throw new Error("header name must be a non-empty string");const d=f.findKey(o,l);(!d||o[d]===void 0||u===!0||u===void 0&&o[d]!==!1)&&(o[d||c]=Oe(a))}const i=(a,c)=>f.forEach(a,(u,l)=>s(u,l,c));if(f.isPlainObject(e)||e instanceof this.constructor)i(e,r);else if(f.isString(e)&&(e=e.trim())&&!In(e))i(Bn(e),r);else if(f.isObject(e)&&f.isIterable(e)){let a={},c,u;for(const l of e){if(!f.isArray(l))throw TypeError("Object iterator must return a key-value pair");a[u=l[0]]=(c=a[u])?f.isArray(c)?[...c,l[1]]:[c,l[1]]:l[1]}i(a,r)}else e!=null&&s(r,e,n);return this}get(e,r){if(e=ne(e),e){const n=f.findKey(this,e);if(n){const o=this[n];if(!r)return o;if(r===!0)return Fn(o);if(f.isFunction(r))return r.call(this,o,n);if(f.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=ne(e),e){const n=f.findKey(this,e);return!!(n&&this[n]!==void 0&&(!r||Ue(this,this[n],n,r)))}return!1}delete(e,r){const n=this;let o=!1;function s(i){if(i=ne(i),i){const a=f.findKey(n,i);a&&(!r||Ue(n,n[a],a,r))&&(delete n[a],o=!0)}}return f.isArray(e)?e.forEach(s):s(e),o}clear(e){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const s=r[n];(!e||Ue(this,this[s],s,e,!0))&&(delete this[s],o=!0)}return o}normalize(e){const r=this,n={};return f.forEach(this,(o,s)=>{const i=f.findKey(n,s);if(i){r[i]=Oe(o),delete r[s];return}const a=e?Mn(s):String(s).trim();a!==s&&delete r[s],r[a]=Oe(o),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);return f.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=e&&f.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(`
|
|
3
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const n=new this(e);return r.forEach(o=>n.set(o)),n}static accessor(e){const n=(this[ft]=this[ft]={accessors:{}}).accessors,o=this.prototype;function s(i){const a=ne(i);n[a]||(Un(o,i),n[a]=!0)}return f.isArray(e)?e.forEach(s):s(e),this}};_.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);f.reduceDescriptors(_.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}});f.freezeMethods(_);function Le(t,e){const r=this||ue,n=e||r,o=_.from(n.headers);let s=n.data;return f.forEach(t,function(a){s=a.call(r,s,o.normalize(),e?e.status:void 0)}),o.normalize(),s}function Gt(t){return!!(t&&t.__CANCEL__)}function te(t,e,r){b.call(this,t??"canceled",b.ERR_CANCELED,e,r),this.name="CanceledError"}f.inherits(te,b,{__CANCEL__:!0});function Xt(t,e,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new b("Request failed with status code "+r.status,[b.ERR_BAD_REQUEST,b.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Ln(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function $n(t,e){t=t||10;const r=new Array(t),n=new Array(t);let o=0,s=0,i;return e=e!==void 0?e:1e3,function(c){const u=Date.now(),l=n[s];i||(i=u),r[o]=c,n[o]=u;let d=s,m=0;for(;d!==o;)m+=r[d++],d=d%t;if(o=(o+1)%t,o===s&&(s=(s+1)%t),u-i<e)return;const g=l&&u-l;return g?Math.round(m*1e3/g):void 0}}function kn(t,e){let r=0,n=1e3/e,o,s;const i=(u,l=Date.now())=>{r=l,o=null,s&&(clearTimeout(s),s=null),t(...u)};return[(...u)=>{const l=Date.now(),d=l-r;d>=n?i(u,l):(o=u,s||(s=setTimeout(()=>{s=null,i(o)},n-d)))},()=>o&&i(o)]}const Te=(t,e,r=3)=>{let n=0;const o=$n(50,250);return kn(s=>{const i=s.loaded,a=s.lengthComputable?s.total:void 0,c=i-n,u=o(c),l=i<=a;n=i;const d={loaded:i,total:a,progress:a?i/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a&&l?(a-i)/u:void 0,event:s,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(d)},r)},dt=(t,e)=>{const r=t!=null;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},pt=t=>(...e)=>f.asap(()=>t(...e)),Hn=v.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,v.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(v.origin),v.navigator&&/(msie|trident)/i.test(v.navigator.userAgent)):()=>!0,Vn=v.hasStandardBrowserEnv?{write(t,e,r,n,o,s,i){if(typeof document>"u")return;const a=[`${t}=${encodeURIComponent(e)}`];f.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),f.isString(n)&&a.push(`path=${n}`),f.isString(o)&&a.push(`domain=${o}`),s===!0&&a.push("secure"),f.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Qn(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Wn(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Yt(t,e,r){let n=!Qn(e);return t&&(n||r==!1)?Wn(t,e):e}const ht=t=>t instanceof _?{...t}:t;function V(t,e){e=e||{};const r={};function n(u,l,d,m){return f.isPlainObject(u)&&f.isPlainObject(l)?f.merge.call({caseless:m},u,l):f.isPlainObject(l)?f.merge({},l):f.isArray(l)?l.slice():l}function o(u,l,d,m){if(f.isUndefined(l)){if(!f.isUndefined(u))return n(void 0,u,d,m)}else return n(u,l,d,m)}function s(u,l){if(!f.isUndefined(l))return n(void 0,l)}function i(u,l){if(f.isUndefined(l)){if(!f.isUndefined(u))return n(void 0,u)}else return n(void 0,l)}function a(u,l,d){if(d in e)return n(u,l);if(d in t)return n(void 0,u)}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(u,l,d)=>o(ht(u),ht(l),d,!0)};return f.forEach(Object.keys({...t,...e}),function(l){const d=c[l]||o,m=d(t[l],e[l],l);f.isUndefined(m)&&d!==a||(r[l]=m)}),r}const Zt=t=>{const e=V({},t);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=e;if(e.headers=i=_.from(i),e.url=Kt(Yt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),f.isFormData(r)){if(v.hasStandardBrowserEnv||v.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(f.isFunction(r.getHeaders)){const c=r.getHeaders(),u=["content-type","content-length"];Object.entries(c).forEach(([l,d])=>{u.includes(l.toLowerCase())&&i.set(l,d)})}}if(v.hasStandardBrowserEnv&&(n&&f.isFunction(n)&&(n=n(e)),n||n!==!1&&Hn(e.url))){const c=o&&s&&Vn.read(s);c&&i.set(o,c)}return e},Kn=typeof XMLHttpRequest<"u",zn=Kn&&function(t){return new Promise(function(r,n){const o=Zt(t);let s=o.data;const i=_.from(o.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:u}=o,l,d,m,g,p;function y(){g&&g(),p&&p(),o.cancelToken&&o.cancelToken.unsubscribe(l),o.signal&&o.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout;function w(){if(!h)return;const E=_.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),P={data:!a||a==="text"||a==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:E,config:t,request:h};Xt(function(C){r(C),y()},function(C){n(C),y()},P),h=null}"onloadend"in h?h.onloadend=w:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(w)},h.onabort=function(){h&&(n(new b("Request aborted",b.ECONNABORTED,t,h)),h=null)},h.onerror=function(R){const P=R&&R.message?R.message:"Network Error",U=new b(P,b.ERR_NETWORK,t,h);U.event=R||null,n(U),h=null},h.ontimeout=function(){let R=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const P=o.transitional||zt;o.timeoutErrorMessage&&(R=o.timeoutErrorMessage),n(new b(R,P.clarifyTimeoutError?b.ETIMEDOUT:b.ECONNABORTED,t,h)),h=null},s===void 0&&i.setContentType(null),"setRequestHeader"in h&&f.forEach(i.toJSON(),function(R,P){h.setRequestHeader(P,R)}),f.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),a&&a!=="json"&&(h.responseType=o.responseType),u&&([m,p]=Te(u,!0),h.addEventListener("progress",m)),c&&h.upload&&([d,g]=Te(c),h.upload.addEventListener("progress",d),h.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(l=E=>{h&&(n(!E||E.type?new te(null,t,h):E),h.abort(),h=null)},o.cancelToken&&o.cancelToken.subscribe(l),o.signal&&(o.signal.aborted?l():o.signal.addEventListener("abort",l)));const T=Ln(o.url);if(T&&v.protocols.indexOf(T)===-1){n(new b("Unsupported protocol "+T+":",b.ERR_BAD_REQUEST,t));return}h.send(s||null)})},Jn=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let n=new AbortController,o;const s=function(u){if(!o){o=!0,a();const l=u instanceof Error?u:this.reason;n.abort(l instanceof b?l:new te(l instanceof Error?l.message:l))}};let i=e&&setTimeout(()=>{i=null,s(new b(`timeout ${e} of ms exceeded`,b.ETIMEDOUT))},e);const a=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),t=null)};t.forEach(u=>u.addEventListener("abort",s));const{signal:c}=n;return c.unsubscribe=()=>f.asap(a),c}},Gn=function*(t,e){let r=t.byteLength;if(r<e){yield t;return}let n=0,o;for(;n<r;)o=n+e,yield t.slice(n,o),n=o},Xn=async function*(t,e){for await(const r of Yn(t))yield*Gn(r,e)},Yn=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:r,value:n}=await e.read();if(r)break;yield n}}finally{await e.cancel()}},mt=(t,e,r,n)=>{const o=Xn(t,e);let s=0,i,a=c=>{i||(i=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:u,value:l}=await o.next();if(u){a(),c.close();return}let d=l.byteLength;if(r){let m=s+=d;r(m)}c.enqueue(new Uint8Array(l))}catch(u){throw a(u),u}},cancel(c){return a(c),o.return()}},{highWaterMark:2})},yt=64*1024,{isFunction:ye}=f,Zn=(({Request:t,Response:e})=>({Request:t,Response:e}))(f.global),{ReadableStream:gt,TextEncoder:bt}=f.global,wt=(t,...e)=>{try{return!!t(...e)}catch{return!1}},eo=t=>{t=f.merge.call({skipUndefined:!0},Zn,t);const{fetch:e,Request:r,Response:n}=t,o=e?ye(e):typeof fetch=="function",s=ye(r),i=ye(n);if(!o)return!1;const a=o&&ye(gt),c=o&&(typeof bt=="function"?(p=>y=>p.encode(y))(new bt):async p=>new Uint8Array(await new r(p).arrayBuffer())),u=s&&a&&wt(()=>{let p=!1;const y=new r(v.origin,{body:new gt,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!y}),l=i&&a&&wt(()=>f.isReadableStream(new n("").body)),d={stream:l&&(p=>p.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!d[p]&&(d[p]=(y,h)=>{let w=y&&y[p];if(w)return w.call(y);throw new b(`Response type '${p}' is not supported`,b.ERR_NOT_SUPPORT,h)})});const m=async p=>{if(p==null)return 0;if(f.isBlob(p))return p.size;if(f.isSpecCompliantForm(p))return(await new r(v.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(f.isArrayBufferView(p)||f.isArrayBuffer(p))return p.byteLength;if(f.isURLSearchParams(p)&&(p=p+""),f.isString(p))return(await c(p)).byteLength},g=async(p,y)=>{const h=f.toFiniteNumber(p.getContentLength());return h??m(y)};return async p=>{let{url:y,method:h,data:w,signal:T,cancelToken:E,timeout:R,onDownloadProgress:P,onUploadProgress:U,responseType:C,headers:je,withCredentials:de="same-origin",fetchOptions:et}=Zt(p),tt=e||fetch;C=C?(C+"").toLowerCase():"text";let pe=Jn([T,E&&E.toAbortSignal()],R),re=null;const L=pe&&pe.unsubscribe&&(()=>{pe.unsubscribe()});let rt;try{if(U&&u&&h!=="get"&&h!=="head"&&(rt=await g(je,w))!==0){let I=new r(y,{method:"POST",body:w,duplex:"half"}),W;if(f.isFormData(w)&&(W=I.headers.get("content-type"))&&je.setContentType(W),I.body){const[Be,he]=dt(rt,Te(pt(U)));w=mt(I.body,yt,Be,he)}}f.isString(de)||(de=de?"include":"omit");const j=s&&"credentials"in r.prototype,nt={...et,signal:pe,method:h.toUpperCase(),headers:je.normalize().toJSON(),body:w,duplex:"half",credentials:j?de:void 0};re=s&&new r(y,nt);let F=await(s?tt(re,et):tt(y,nt));const ot=l&&(C==="stream"||C==="response");if(l&&(P||ot&&L)){const I={};["status","statusText","headers"].forEach(st=>{I[st]=F[st]});const W=f.toFiniteNumber(F.headers.get("content-length")),[Be,he]=P&&dt(W,Te(pt(P),!0))||[];F=new n(mt(F.body,yt,Be,()=>{he&&he(),L&&L()}),I)}C=C||"text";let dr=await d[f.findKey(d,C)||"text"](F,p);return!ot&&L&&L(),await new Promise((I,W)=>{Xt(I,W,{data:dr,headers:_.from(F.headers),status:F.status,statusText:F.statusText,config:p,request:re})})}catch(j){throw L&&L(),j&&j.name==="TypeError"&&/Load failed|fetch/i.test(j.message)?Object.assign(new b("Network Error",b.ERR_NETWORK,p,re),{cause:j.cause||j}):b.from(j,j&&j.code,p,re)}}},to=new Map,er=t=>{let e=t&&t.env||{};const{fetch:r,Request:n,Response:o}=e,s=[n,o,r];let i=s.length,a=i,c,u,l=to;for(;a--;)c=s[a],u=l.get(c),u===void 0&&l.set(c,u=a?new Map:eo(e)),l=u;return u};er();const Ye={http:bn,xhr:zn,fetch:{get:er}};f.forEach(Ye,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const At=t=>`- ${t}`,ro=t=>f.isFunction(t)||t===null||t===!1;function no(t,e){t=f.isArray(t)?t:[t];const{length:r}=t;let n,o;const s={};for(let i=0;i<r;i++){n=t[i];let a;if(o=n,!ro(n)&&(o=Ye[(a=String(n)).toLowerCase()],o===void 0))throw new b(`Unknown adapter '${a}'`);if(o&&(f.isFunction(o)||(o=o.get(e))))break;s[a||"#"+i]=o}if(!o){const i=Object.entries(s).map(([c,u])=>`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=r?i.length>1?`since :
|
|
4
|
-
`+i.map(At).join(`
|
|
5
|
-
`):" "+At(i[0]):"as no adapter specified";throw new b("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const tr={getAdapter:no,adapters:Ye};function $e(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new te(null,t)}function St(t){return $e(t),t.headers=_.from(t.headers),t.data=Le.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),tr.getAdapter(t.adapter||ue.adapter,t)(t).then(function(n){return $e(t),n.data=Le.call(t,t.transformResponse,n),n.headers=_.from(n.headers),n},function(n){return Gt(n)||($e(t),n&&n.response&&(n.response.data=Le.call(t,t.transformResponse,n.response),n.response.headers=_.from(n.response.headers))),Promise.reject(n)})}const rr="1.13.2",Ne={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Ne[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const Et={};Ne.transitional=function(e,r,n){function o(s,i){return"[Axios v"+rr+"] Transitional option '"+s+"'"+i+(n?". "+n:"")}return(s,i,a)=>{if(e===!1)throw new b(o(i," has been removed"+(r?" in "+r:"")),b.ERR_DEPRECATED);return r&&!Et[i]&&(Et[i]=!0,console.warn(o(i," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(s,i,a):!0}};Ne.spelling=function(e){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function oo(t,e,r){if(typeof t!="object")throw new b("options must be an object",b.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let o=n.length;for(;o-- >0;){const s=n[o],i=e[s];if(i){const a=t[s],c=a===void 0||i(a,s,t);if(c!==!0)throw new b("option "+s+" must be "+c,b.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new b("Unknown option "+s,b.ERR_BAD_OPTION)}}const ve={assertOptions:oo,validators:Ne},B=ve.validators;let k=class{constructor(e){this.defaults=e||{},this.interceptors={request:new lt,response:new lt}}async request(e,r){try{return await this._request(e,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
6
|
-
`+s):n.stack=s}catch{}}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=V(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:s}=r;n!==void 0&&ve.assertOptions(n,{silentJSONParsing:B.transitional(B.boolean),forcedJSONParsing:B.transitional(B.boolean),clarifyTimeoutError:B.transitional(B.boolean)},!1),o!=null&&(f.isFunction(o)?r.paramsSerializer={serialize:o}:ve.assertOptions(o,{encode:B.function,serialize:B.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),ve.assertOptions(r,{baseUrl:B.spelling("baseURL"),withXsrfToken:B.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=s&&f.merge(s.common,s[r.method]);s&&f.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),r.headers=_.concat(i,s);const a=[];let c=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(r)===!1||(c=c&&y.synchronous,a.unshift(y.fulfilled,y.rejected))});const u=[];this.interceptors.response.forEach(function(y){u.push(y.fulfilled,y.rejected)});let l,d=0,m;if(!c){const p=[St.bind(this),void 0];for(p.unshift(...a),p.push(...u),m=p.length,l=Promise.resolve(r);d<m;)l=l.then(p[d++],p[d++]);return l}m=a.length;let g=r;for(;d<m;){const p=a[d++],y=a[d++];try{g=p(g)}catch(h){y.call(this,h);break}}try{l=St.call(this,g)}catch(p){return Promise.reject(p)}for(d=0,m=u.length;d<m;)l=l.then(u[d++],u[d++]);return l}getUri(e){e=V(this.defaults,e);const r=Yt(e.baseURL,e.url,e.allowAbsoluteUrls);return Kt(r,e.params,e.paramsSerializer)}};f.forEach(["delete","get","head","options"],function(e){k.prototype[e]=function(r,n){return this.request(V(n||{},{method:e,url:r,data:(n||{}).data}))}});f.forEach(["post","put","patch"],function(e){function r(n){return function(s,i,a){return this.request(V(a||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}k.prototype[e]=r(),k.prototype[e+"Form"]=r(!0)});let so=class nr{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});const n=this;this.promise.then(o=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](o);n._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(a=>{n.subscribe(a),s=a}).then(o);return i.cancel=function(){n.unsubscribe(s)},i},e(function(s,i,a){n.reason||(n.reason=new te(s,i,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=n=>{e.abort(n)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new nr(function(o){e=o}),cancel:e}}};function io(t){return function(r){return t.apply(null,r)}}function ao(t){return f.isObject(t)&&t.isAxiosError===!0}const Ke={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ke).forEach(([t,e])=>{Ke[e]=t});function or(t){const e=new k(t),r=Bt(k.prototype.request,e);return f.extend(r,k.prototype,e,{allOwnKeys:!0}),f.extend(r,e,null,{allOwnKeys:!0}),r.create=function(o){return or(V(t,o))},r}const A=or(ue);A.Axios=k;A.CanceledError=te;A.CancelToken=so;A.isCancel=Gt;A.VERSION=rr;A.toFormData=Pe;A.AxiosError=b;A.Cancel=A.CanceledError;A.all=function(e){return Promise.all(e)};A.spread=io;A.isAxiosError=ao;A.mergeConfig=V;A.AxiosHeaders=_;A.formToJSON=t=>Jt(f.isHTMLForm(t)?new FormData(t):t);A.getAdapter=tr.getAdapter;A.HttpStatusCode=Ke;A.default=A;const{Axios:Co,AxiosError:Po,CanceledError:No,isCancel:qo,CancelToken:Do,VERSION:jo,all:Bo,Cancel:Fo,isAxiosError:Io,spread:Mo,toFormData:Uo,AxiosHeaders:Lo,HttpStatusCode:$o,formToJSON:ko,getAdapter:Ho,mergeConfig:Vo}=A,Ot=typeof window<"u";class co{constructor(e={}){this.requestStrategy=async(r,n)=>{await n(r)},this.responseStrategy=async(r,n)=>{await n(r)},this.defaultBaseUrl=e.defaultBaseUrl,this.useGlobalSingletons=e.useGlobalSingletons??!1,this.globalQueryClientKey=e.globalQueryClientKey||"__STORE_QUERY_CLIENT__",this.globalAxiosKey=e.globalAxiosKey||"__STORE_API_CLIENT__",this.createQueryClientImpl=e.createQueryClient||(()=>new ze.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!0,refetchOnMount:!1,retry:3,staleTime:1e3*60*5}}})),this.createAxiosImpl=e.createAxios||(r=>{const n=A.create({baseURL:r||this.defaultBaseUrl,withCredentials:!0});return this.configureAxios(n)})}getQueryClient(e){if(Ot){if(e?.client)return e.client;if(this.useGlobalSingletons){const r=globalThis,n=r[this.globalQueryClientKey];if(n)return n;const o=this.createQueryClientImpl();return r[this.globalQueryClientKey]=o,o}return this.queryClientSingleton||(this.queryClientSingleton=this.createQueryClientImpl()),this.queryClientSingleton}return this.createQueryClientImpl()}getAxiosInstance(){if(Ot){if(this.useGlobalSingletons){const e=globalThis,r=e[this.globalAxiosKey];if(r)return r;const n=this.configureAxios(this.createAxiosImpl());return e[this.globalAxiosKey]=n,n}return this.axiosSingleton||(this.axiosSingleton=this.configureAxios(this.createAxiosImpl())),this.axiosSingleton}return this.configureAxios(this.createAxiosImpl())}setDefaultApiBaseUrl(e){this.defaultBaseUrl=e}async setApiUrl(e){const r=this.getAxiosInstance();r.defaults.baseURL=e}setRequestInterceptorStrategy(e){this.requestStrategy=e,this.axiosSingleton&&(this.axiosSingleton=this.configureAxios(this.axiosSingleton))}setResponseInterceptorStrategy(e){this.responseStrategy=e,this.axiosSingleton&&(this.axiosSingleton=this.configureAxios(this.axiosSingleton))}getAxiosProxy(){return new Proxy({},{get:(e,r)=>{const n=this.getAxiosInstance(),o=Reflect.get(n,r);return typeof o=="function"?o.bind(n):o},set:(e,r,n)=>Reflect.set(this.getAxiosInstance(),r,n)})}getQueryClientProxy(){return new Proxy({},{get:(e,r)=>{const n=this.getQueryClient(),o=Reflect.get(n,r);return typeof o=="function"?o.bind(n):o},set:(e,r,n)=>Reflect.set(this.getQueryClient(),r,n)})}configureAxios(e){return e.interceptors.request.clear(),e.interceptors.response.clear(),e.interceptors.request.use(async r=>{const n=async o=>{};return await this.requestStrategy(r,n),r}),e.interceptors.response.use(async r=>{const n=async o=>{};return await this.responseStrategy(r,n),r}),e}}const vt="__HAUS_NAMED_HTTP_CLIENTS__",uo=typeof window<"u",sr="default";function Ze(){if(uo){const e=globalThis,r=e[vt];if(r)return r;const n={};return e[vt]=n,n}const t=Ze;return t._ssr||(t._ssr={}),t._ssr}function ir(t={}){return new co({createQueryClient:t.createQueryClient||(()=>new ze.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!0,refetchOnMount:!1,retry:3,staleTime:1e3*60*5}}})),createAxios:t.createAxios||(e=>A.create({baseURL:e??t.defaultBaseUrl,withCredentials:!0})),defaultBaseUrl:t.defaultBaseUrl,useGlobalSingletons:t.useGlobalSingletons,globalQueryClientKey:t.globalQueryClientKey,globalAxiosKey:t.globalAxiosKey})}function lo(t,e={},r={}){const n=Ze();if(n[t]&&!r.overwrite)return n[t];const o=ir(e);return n[t]=o,o}function fo(t,e={}){const r=Ze();return r[t]||(r[t]=ir(e)),r[t]}lo(sr,{useGlobalSingletons:!0,globalQueryClientKey:"__STORE_QUERY_CLIENT__",globalAxiosKey:"__STORE_API_CLIENT__"},{overwrite:!1});const ar=fo(sr,{createQueryClient:()=>new ze.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!0,refetchOnMount:!1,retry:3,staleTime:1e3*60*5}}}),createAxios:t=>A.create({baseURL:t,withCredentials:!0})});ar.getAxiosProxy();ar.getQueryClientProxy();var q={},ge={},be={},we={},Tt;function le(){if(Tt)return we;Tt=1,Object.defineProperty(we,"__esModule",{value:!0});var t;return(function(e){e.Mutation="mutation",e.Query="query",e.Subscription="subscription"})(t||(t={})),we.default=t,we}var J={},oe={},Rt;function po(){if(Rt)return oe;Rt=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.isNestedField=void 0;function t(e){return typeof e=="object"&&e.hasOwnProperty("operation")&&e.hasOwnProperty("variables")&&e.hasOwnProperty("fields")||typeof e=="object"&&e.hasOwnProperty("operation")&&e.hasOwnProperty("fragment")&&e.hasOwnProperty("fields")}return oe.isNestedField=t,oe}var xt;function fe(){if(xt)return J;xt=1;var t=J&&J.__assign||function(){return t=Object.assign||function(n){for(var o,s=1,i=arguments.length;s<i;s++){o=arguments[s];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(n[a]=o[a])}return n},t.apply(this,arguments)};Object.defineProperty(J,"__esModule",{value:!0});var e=po(),r=(function(){function n(){}return n.resolveVariables=function(o){for(var s={},i=0,a=o;i<a.length;i++){var c=a[i],u=c.variables,l=c.fields;s=t(t(t({},s),u),l&&n.getNestedVariables(l)||{})}return s},n.queryDataNameAndArgumentMap=function(o){return o&&Object.keys(o).length?"(".concat(Object.entries(o).reduce(function(s,i,a){var c=i[0],u=i[1];return"".concat(s).concat(a!==0?", ":"").concat(u&&u.name?u.name:c,": $").concat(c)},""),")"):""},n.queryFieldsMap=function(o){var s=this;return o?o.map(function(i){if((0,e.isNestedField)(i))return n.queryNestedFieldMap(i);if(typeof i=="object"){var a="";return Object.entries(i).forEach(function(c,u,l){var d=c[0],m=c[1];a+="".concat(d," ").concat(m.length>0?"{ "+s.queryFieldsMap(m)+" }":""),u<l.length-1&&(a+=", ")}),a}else return"".concat(i)}).join(", "):""},n.operationOrAlias=function(o){return typeof o=="string"?o:"".concat(o.alias,": ").concat(o.name)},n.isFragment=function(o){var s;return(s=o?.fragment===!0)!==null&&s!==void 0?s:!1},n.operationOrFragment=function(o){return n.isFragment(o)?o.operation:n.operationOrAlias(o.operation)},n.getFragment=function(o){return n.isFragment(o)?"... on ":""},n.queryNestedFieldMap=function(o){return"".concat(n.getFragment(o)).concat(n.operationOrFragment(o)," ").concat(this.isFragment(o)?"":this.queryDataNameAndArgumentMap(o.variables)," ").concat(o.fields.length>0?"{ "+this.queryFieldsMap(o.fields)+" }":"")},n.queryVariablesMap=function(o,s){var i={},a=function(c){c&&Object.keys(c).map(function(u){i[u]=typeof c[u]=="object"?c[u].value:c[u]})};return a(o),s&&typeof s=="object"&&a(n.getNestedVariables(s)),i},n.getNestedVariables=function(o){var s={};function i(a){return a?.forEach(function(c){if((0,e.isNestedField)(c))s=t(t(t({},c.variables),s),c.fields&&i(c.fields));else if(typeof c=="object")for(var u=0,l=Object.entries(c);u<l.length;u++){var d=l[u],m=d[1];i(m)}}),s}return i(o),s},n.queryDataType=function(o){var s="String",i=typeof o=="object"?o.value:o;if(o?.type!=null)s=o.type;else{var a=Array.isArray(i)?i[0]:i;switch(typeof a){case"object":s="Object";break;case"boolean":s="Boolean";break;case"number":s=a%1===0?"Int":"Float";break}}return typeof o=="object"&&(o.list===!0?s="[".concat(s,"]"):Array.isArray(o.list)&&(s="[".concat(s).concat(o.list[0]?"!":"","]")),o.required&&(s+="!")),s},n})();return J.default=r,J}var _t;function ho(){if(_t)return be;_t=1,Object.defineProperty(be,"__esModule",{value:!0});var t=le(),e=fe(),r=(function(){function n(o){Array.isArray(o)?this.variables=e.default.resolveVariables(o):(this.variables=o.variables,this.fields=o.fields,this.operation=o.operation)}return n.prototype.mutationBuilder=function(){return this.operationWrapperTemplate(this.variables,this.operationTemplate(this.operation))},n.prototype.mutationsBuilder=function(o){var s=this,i=o.map(function(a){return s.operation=a.operation,s.variables=a.variables,s.fields=a.fields,s.operationTemplate(a.operation)});return this.operationWrapperTemplate(e.default.resolveVariables(o),i.join(`
|
|
7
|
-
`))},n.prototype.queryDataNameAndArgumentMap=function(){return this.variables&&Object.keys(this.variables).length?"(".concat(Object.keys(this.variables).reduce(function(o,s,i){return"".concat(o).concat(i!==0?", ":"").concat(s,": $").concat(s)},""),")"):""},n.prototype.queryDataArgumentAndTypeMap=function(o){return Object.keys(o).length?"(".concat(Object.keys(o).reduce(function(s,i,a){return"".concat(s).concat(a!==0?", ":"","$").concat(i,": ").concat(e.default.queryDataType(o[i]))},""),")"):""},n.prototype.operationWrapperTemplate=function(o,s){var i=typeof this.operation=="string"?this.operation:this.operation.name;return{query:"".concat(t.default.Mutation," ").concat(i.charAt(0).toUpperCase()+i.slice(1)," ").concat(this.queryDataArgumentAndTypeMap(o),` {
|
|
8
|
-
`).concat(s,`
|
|
9
|
-
}`),variables:e.default.queryVariablesMap(o)}},n.prototype.operationTemplate=function(o){var s=typeof o=="string"?o:"".concat(o.alias,": ").concat(o.name);return"".concat(s," ").concat(this.queryDataNameAndArgumentMap(),` {
|
|
10
|
-
`).concat(this.queryFieldsMap(this.fields),`
|
|
11
|
-
}`)},n.prototype.queryFieldsMap=function(o){var s=this;return Array.isArray(o)?o.map(function(i){return typeof i=="object"?"".concat(Object.keys(i)[0]," { ").concat(s.queryFieldsMap(Object.values(i)[0])," }"):"".concat(i)}).join(", "):""},n})();return be.default=r,be}var Ae={},Ct;function mo(){if(Ct)return Ae;Ct=1,Object.defineProperty(Ae,"__esModule",{value:!0});var t=le(),e=fe(),r=(function(){function n(o){this.queryDataType=function(s){var i="String",a=typeof s=="object"?s.value:s;if(s.type!==void 0)i=s.type;else switch(typeof a){case"object":i="Object";break;case"boolean":i="Boolean";break;case"number":i=a%1===0?"Int":"Float";break}return typeof s=="object"&&s.required&&(i+="!"),i},Array.isArray(o)?this.variables=e.default.resolveVariables(o):(this.variables=o.variables,this.fields=o.fields||[],this.operation=o.operation)}return n.prototype.queryBuilder=function(){return this.operationWrapperTemplate(this.operationTemplate())},n.prototype.queriesBuilder=function(o){var s=this,i=function(){var a=[];return o.forEach(function(c){c&&(s.operation=c.operation,s.fields=c.fields,s.variables=c.variables,a.push(s.operationTemplate()))}),a.join(" ")};return this.operationWrapperTemplate(i())},n.prototype.queryDataNameAndArgumentMap=function(){return this.variables&&Object.keys(this.variables).length?"(".concat(Object.keys(this.variables).reduce(function(o,s,i){return"".concat(o).concat(i!==0?", ":"").concat(s,": $").concat(s)},""),")"):""},n.prototype.queryDataArgumentAndTypeMap=function(){var o=this;return this.variables&&Object.keys(this.variables).length?"(".concat(Object.keys(this.variables).reduce(function(s,i,a){return"".concat(s).concat(a!==0?", ":"","$").concat(i,": ").concat(o.queryDataType(o.variables[i]))},""),")"):""},n.prototype.operationWrapperTemplate=function(o){var s=typeof this.operation=="string"?this.operation:this.operation.name;return{query:"".concat(t.default.Query," ").concat(s.charAt(0).toUpperCase()).concat(s.slice(1)," ").concat(this.queryDataArgumentAndTypeMap()," { ").concat(o," }"),variables:e.default.queryVariablesMap(this.variables)}},n.prototype.operationTemplate=function(){var o=typeof this.operation=="string"?this.operation:"".concat(this.operation.alias,": ").concat(this.operation.name);return"".concat(o," ").concat(this.queryDataNameAndArgumentMap()," { nodes { ").concat(e.default.queryFieldsMap(this.fields)," } }")},n})();return Ae.default=r,Ae}var Pt;function yo(){if(Pt)return ge;Pt=1,Object.defineProperty(ge,"__esModule",{value:!0});var t=ho(),e=mo();return ge.default={DefaultAppSyncQueryAdapter:e.default,DefaultAppSyncMutationAdapter:t.default},ge}var G={},Nt;function go(){if(Nt)return G;Nt=1;var t=G&&G.__assign||function(){return t=Object.assign||function(o){for(var s,i=1,a=arguments.length;i<a;i++){s=arguments[i];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(o[c]=s[c])}return o},t.apply(this,arguments)};Object.defineProperty(G,"__esModule",{value:!0});var e=le(),r=fe(),n=(function(){function o(s,i){var a=this;Array.isArray(s)?this.variables=r.default.resolveVariables(s):(this.variables=s.variables,this.fields=s.fields,this.operation=s.operation),this.config={operationName:""},i&&Object.entries(i).forEach(function(c){var u=c[0],l=c[1];a.config[u]=l})}return o.prototype.mutationBuilder=function(){return this.operationWrapperTemplate(e.default.Mutation,this.variables,this.operationTemplate(this.operation))},o.prototype.mutationsBuilder=function(s){var i=this,a=s.map(function(c){return i.operation=c.operation,i.variables=c.variables,i.fields=c.fields,i.operationTemplate(c.operation)});return this.operationWrapperTemplate(e.default.Mutation,r.default.resolveVariables(s),a.join(`
|
|
12
|
-
`))},o.prototype.queryDataArgumentAndTypeMap=function(s){return this.fields&&typeof this.fields=="object"&&(s=t(t({},r.default.getNestedVariables(this.fields)),s)),s&&Object.keys(s).length>0?"(".concat(Object.keys(s).reduce(function(i,a,c){return"".concat(i).concat(c!==0?", ":"","$").concat(a,": ").concat(r.default.queryDataType(s[a]))},""),")"):""},o.prototype.operationWrapperTemplate=function(s,i,a){var c="".concat(s," ").concat(this.queryDataArgumentAndTypeMap(i),` {
|
|
13
|
-
`).concat(a,`
|
|
14
|
-
}`);return this.config.operationName&&(c=c.replace("mutation","mutation ".concat(this.config.operationName))),{query:c,variables:r.default.queryVariablesMap(i,this.fields)}},o.prototype.operationTemplate=function(s){var i=typeof s=="string"?s:"".concat(s.alias,": ").concat(s.name);return"".concat(i," ").concat(r.default.queryDataNameAndArgumentMap(this.variables)," ").concat(this.fields&&this.fields.length>0?`{
|
|
15
|
-
`.concat(r.default.queryFieldsMap(this.fields),`
|
|
16
|
-
}`):"")},o})();return G.default=n,G}var X={},qt;function bo(){if(qt)return X;qt=1;var t=X&&X.__assign||function(){return t=Object.assign||function(o){for(var s,i=1,a=arguments.length;i<a;i++){s=arguments[i];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(o[c]=s[c])}return o},t.apply(this,arguments)};Object.defineProperty(X,"__esModule",{value:!0});var e=le(),r=fe(),n=(function(){function o(s,i){var a=this;this.config={operationName:""},i&&Object.entries(i).forEach(function(c){var u=c[0],l=c[1];a.config[u]=l}),Array.isArray(s)?this.variables=r.default.resolveVariables(s):(this.variables=s.variables,this.fields=s.fields||[],this.operation=s.operation)}return o.prototype.queryBuilder=function(){return this.operationWrapperTemplate(this.operationTemplate(this.variables))},o.prototype.queriesBuilder=function(s){var i=this,a=function(){var c=[];return s.forEach(function(u){u&&(i.operation=u.operation,i.fields=u.fields,c.push(i.operationTemplate(u.variables)))}),c.join(" ")};return this.operationWrapperTemplate(a())},o.prototype.queryDataArgumentAndTypeMap=function(){var s=this.variables;return this.fields&&typeof this.fields=="object"&&(s=t(t({},r.default.getNestedVariables(this.fields)),s)),s&&Object.keys(s).length>0?"(".concat(Object.keys(s).reduce(function(i,a,c){return"".concat(i).concat(c!==0?", ":"","$").concat(a,": ").concat(r.default.queryDataType(s[a]))},""),")"):""},o.prototype.operationWrapperTemplate=function(s){var i="".concat(e.default.Query," ").concat(this.queryDataArgumentAndTypeMap()," { ").concat(s," }");return i=i.replace("query","query".concat(this.config.operationName!==""?" "+this.config.operationName:"")),{query:i,variables:r.default.queryVariablesMap(this.variables,this.fields)}},o.prototype.operationTemplate=function(s){var i=typeof this.operation=="string"?this.operation:"".concat(this.operation.alias,": ").concat(this.operation.name);return"".concat(i," ").concat(s?r.default.queryDataNameAndArgumentMap(s):""," ").concat(this.fields&&this.fields.length>0?"{ "+r.default.queryFieldsMap(this.fields)+" }":"")},o})();return X.default=n,X}var Se={},Dt;function wo(){if(Dt)return Se;Dt=1,Object.defineProperty(Se,"__esModule",{value:!0});var t=le(),e=fe(),r=(function(){function n(o){Array.isArray(o)?this.variables=e.default.resolveVariables(o):(this.variables=o.variables,this.fields=o.fields,this.operation=o.operation)}return n.prototype.subscriptionBuilder=function(){return this.operationWrapperTemplate(t.default.Subscription,this.variables,this.operationTemplate(this.operation))},n.prototype.subscriptionsBuilder=function(o){var s=this,i=o.map(function(a){return s.operation=a.operation,s.variables=a.variables,s.fields=a.fields,s.operationTemplate(a.operation)});return this.operationWrapperTemplate(t.default.Subscription,e.default.resolveVariables(o),i.join(`
|
|
17
|
-
`))},n.prototype.queryDataNameAndArgumentMap=function(){return this.variables&&Object.keys(this.variables).length?"(".concat(Object.keys(this.variables).reduce(function(o,s,i){return"".concat(o).concat(i!==0?", ":"").concat(s,": $").concat(s)},""),")"):""},n.prototype.queryDataArgumentAndTypeMap=function(o){return Object.keys(o).length?"(".concat(Object.keys(o).reduce(function(s,i,a){return"".concat(s).concat(a!==0?", ":"","$").concat(i,": ").concat(e.default.queryDataType(o[i]))},""),")"):""},n.prototype.operationWrapperTemplate=function(o,s,i){return{query:"".concat(o," ").concat(this.queryDataArgumentAndTypeMap(s),` {
|
|
18
|
-
`).concat(i,`
|
|
19
|
-
}`),variables:e.default.queryVariablesMap(s)}},n.prototype.operationTemplate=function(o){var s=typeof this.operation=="string"?this.operation:"".concat(this.operation.alias,": ").concat(this.operation.name);return"".concat(s," ").concat(this.queryDataNameAndArgumentMap(),` {
|
|
20
|
-
`).concat(this.queryFieldsMap(this.fields),`
|
|
21
|
-
}`)},n.prototype.queryFieldsMap=function(o){var s=this;return o?o.map(function(i){return typeof i=="object"?"".concat(Object.keys(i)[0]," { ").concat(s.queryFieldsMap(Object.values(i)[0])," }"):"".concat(i)}).join(", "):""},n})();return Se.default=r,Se}var jt;function Ao(){if(jt)return q;jt=1,Object.defineProperty(q,"__esModule",{value:!0}),q.adapters=q.query=q.mutation=q.subscription=void 0;var t=yo();q.adapters=t.default;var e=go(),r=bo(),n=wo();function o(a,c,u){var l;if(Array.isArray(a)){if(c){var d=new c(a,u);return d.queriesBuilder(a)}return l=new r.default(a,u),l.queriesBuilder(a)}if(c){var d=new c(a,u);return d.queryBuilder()}return l=new r.default(a,u),l.queryBuilder()}q.query=o;function s(a,c,u){var l,d;return Array.isArray(a)?c?(l=new c(a,u),l.mutationsBuilder(a)):(d=new e.default(a,u),d.mutationsBuilder(a)):c?(l=new c(a,u),l.mutationBuilder()):(d=new e.default(a,u),d.mutationBuilder())}q.mutation=s;function i(a,c){var u,l;return Array.isArray(a)?c?(u=new c(a),u.subscriptionsBuilder(a)):(l=new n.default(a),l.subscriptionsBuilder(a)):c?(u=new c(a),u.subscriptionBuilder()):(l=new n.default(a),l.subscriptionBuilder())}return q.subscription=i,q}Ao();const So=()=>{const e=se.useContext(Nr)?.sdk;return e||console.error("You must wrap your component in a <DataProvider>"),e?.sdkType==="dummy"||e?.sdkType==="vendure",e},qe=()=>{const t=S.compilerRuntimeExports.c(2),{getPlatform:e}=So();let r;return t[0]!==e?(r=e(),t[0]=e,t[1]=r):r=t[1],r},De="ProductBadge",[Eo]=hr(De),[Oo,vo]=Eo(De),cr=t=>{const e=S.compilerRuntimeExports.c(13);let r,n,o,s,i;e[0]!==t?({children:n,product:o,__scopeProductBadge:r,style:i,...s}=t,e[0]=t,e[1]=r,e[2]=n,e[3]=o,e[4]=s,e[5]=i):(r=e[1],n=e[2],o=e[3],s=e[4],i=e[5]);const a=se.useRef(null),c=qe();let u;e[6]!==c?(u=Re(c),e[6]=c,e[7]=u):u=e[7];const l=u;if(!H.getEnabled())return null;const{badges:d}=o;if(!d)return null;const m=d.reduce(Ro,{}),g=Object.keys(m),p={groupedBadges:m,badges:d,badgesRef:a,positions:g},y=S.renderChildren(n,p);let h;return e[8]!==l||e[9]!==s||e[10]!==i||e[11]!==y?(h=S.jsxRuntimeExports.jsx(l,{...s,style:i,children:y}),e[8]=l,e[9]=s,e[10]=i,e[11]=y,e[12]=h):h=e[12],S.jsxRuntimeExports.jsx(Oo,{scope:r,...p,children:h})};cr.displayName=De;const ur=t=>{const e=S.compilerRuntimeExports.c(18);let r,n,o,s,i;e[0]!==t?({children:o,position:s,asChild:n,__scopeProductBadge:r,...i}=t,e[0]=t,e[1]=r,e[2]=n,e[3]=o,e[4]=s,e[5]=i):(r=e[1],n=e[2],o=e[3],s=e[4],i=e[5]);const a=qe();let c;e[6]!==n||e[7]!==a?(c=Re(a,n,"div"),e[6]=n,e[7]=a,e[8]=c):c=e[8];const u=c,{groupedBadges:l}=vo(De,r),d=l[s];let m;e[9]!==d||e[10]!==o||e[11]!==s?(m=S.renderChildren(o,{badges:d,position:s}),e[9]=d,e[10]=o,e[11]=s,e[12]=m):m=e[12];let g;return e[13]!==u||e[14]!==s||e[15]!==i||e[16]!==m?(g=S.jsxRuntimeExports.jsx(u,{...i,"data-position":s,children:m}),e[13]=u,e[14]=s,e[15]=i,e[16]=m,e[17]=g):g=e[17],g},lr=t=>{const e=S.compilerRuntimeExports.c(13);let r,n,o,s;e[0]!==t?({children:o,asChild:r,badge:n,...s}=t,e[0]=t,e[1]=r,e[2]=n,e[3]=o,e[4]=s):(r=e[1],n=e[2],o=e[3],s=e[4]);const i=qe();let a;e[5]!==r||e[6]!==i?(a=Re(i,r,"div"),e[5]=r,e[6]=i,e[7]=a):a=e[7];const c=a,u=n?.id;let l;return e[8]!==c||e[9]!==o||e[10]!==s||e[11]!==u?(l=S.jsxRuntimeExports.jsx(c,{...s,"data-badge-id":u,children:o}),e[8]=c,e[9]=o,e[10]=s,e[11]=u,e[12]=l):l=e[12],l},fr=t=>{const e=S.compilerRuntimeExports.c(8),{badge:r,asChild:n,...o}=t,s=qe();let i;e[0]!==n||e[1]!==s?(i=Re(s,n,"img"),e[0]=n,e[1]=s,e[2]=i):i=e[2];const a=i,c=mr(o,s),u=r.asset?.preview;let l;return e[3]!==a||e[4]!==r.collection.name||e[5]!==u||e[6]!==c?(l=S.jsxRuntimeExports.jsx(a,{src:u,alt:r.collection.name,"data-badge-name":r.collection.name,...c}),e[3]=a,e[4]=r.collection.name,e[5]=u,e[6]=c,e[7]=l):l=e[7],l};ur.displayName="ProductBadgeGroup";lr.displayName="ProductBadgeItem";fr.displayName="ProductBadgeImage";const To={Root:cr,Group:ur,Item:lr,Image:fr};function Ro(t,e){return t[e.position]||(t[e.position]=[]),t[e.position].push(e),t}exports.ProductBadge=To;exports.VendureBadgePlugin=H;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("./index-CgxqXyHf.js"),g=require("./compiler-runtime-oPPev21o.js"),C=require("react"),I=require("./index-BgBC_k8M.js"),T=require("./useSdk-YXpk8Wsi.js");require("@tanstack/react-query");function $(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const m=$(C),P=new j.VendurePluginConfig({name:"badges",enableFeatures:{showBadges:({badges:t=[],parentComponent:e})=>{const n=e?P.getSettings().availablePositions[e]:P.getSettings().defaultPositions;return{badges:j.lodashExports.filter(t,c=>n?n.includes(c.position):!0),availablePositions:n}}},queryUpdates:{},settings:{defaultPositions:["top-left","top-right","bottom-left","bottom-right"],availablePositions:{productListItem:["top-left","top-right","bottom-left","bottom-right"],productDetail:["top-left","top-right","bottom-left","bottom-right"],imageCarousel:["top-left","top-right","bottom-left","bottom-right"]}}});P.setQueryUpdates({product:{fields:[{badges:["id","position","assetId",{asset:["id","name","preview","source"]},{collection:["id","name"]}]}]},search:{fields:[{items:[{badges:["id","position","assetId",{asset:["id","name","preview","source"]},{collection:["id","name"]}]}]}]},products:{fields:[{items:[{badges:["id","position","assetId",{asset:["id","name","preview","source"]},{collection:["id","name"]}]}]}]},briefProducts:{fields:[{items:[{badges:["id","position","assetId",{asset:["id","name","preview","source"]},{collection:["id","name"]}]}]}]}});P.setRequests({getBadges:async()=>P.getSdk().createRequest({operation:"badges",fields:["totalItems",{items:["id","createdAt","updatedAt","collectionId","position","assetId",{asset:["id","name","preview","source"]},{collection:["id","name"]}]}]},{options:{take:100}},!1).then(t=>t.data).catch(t=>({message:t.message,errorCode:t.code||"unknown"}))});function N(t){const e=[];function n(c,o){const s=m.createContext(o),r=e.length;e.push(s);const l=u=>{const d=g.compilerRuntimeExports.c(8);let f,p,x;d[0]!==u?({scope:x,children:f,...p}=u,d[0]=u,d[1]=f,d[2]=p,d[3]=x):(f=d[1],p=d[2],x=d[3]);const y=x?.[t]?.[r]||s,b=p;let h;return d[4]!==y.Provider||d[5]!==f||d[6]!==b?(h=g.jsxRuntimeExports.jsx(y.Provider,{value:b,children:f}),d[4]=y.Provider,d[5]=f,d[6]=b,d[7]=h):h=d[7],h};l.displayName=c+"Provider";function a(u,d){const f=d?.[t]?.[r]||s,p=m.useContext(f);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${c}\``)}return[l,a]}function i(){const c=e.map(o=>m.createContext(o));return function(s){const r=s?.[t]||c;return m.useMemo(()=>({[`__scope${t}`]:{...s,[t]:r}}),[s,r])}}return i.scopeName=t,[n,i]}function O(t,e){if(e==="web")return t;const{src:n,alt:i,width:c,height:o,...s}=t,r=[typeof c=="number"?{width:c}:void 0,typeof o=="number"?{height:o}:void 0].filter(Boolean);let l;return r.length===1?l=r[0]:r.length>1&&(l=r),{...s,source:{uri:n},...l?{style:l}:{}}}function k(t){const{src:e,alt:n,...i}=t;return e?{...i,source:{uri:e}}:i}const q={div:"View",span:"Text",p:"Text",h1:"Text",h2:"Text",h3:"Text",h4:"Text",h5:"Text",h6:"Text",button:"Pressable",input:"TextInput",form:"View",section:"View",article:"View",nav:"View",header:"View",footer:"View",main:"View",aside:"View",ul:"View",ol:"View",li:"View",a:"Pressable",img:"Image",label:"Text",textarea:"TextInput",select:"Pressable",option:"Text"};function A(t,e){if(e==="web")return t;let n=null;try{n=require("react-native")}catch{n=null}if(!n)return console.warn(`react-native is not available at runtime; falling back to 'View' for '${t}'`),"div";const i=q[t];if(!i)return console.warn(`No native component mapping found for '${t}', falling back to View`),n.View;if(i==="Image"){const o=C.forwardRef((s,r)=>{const l=g.compilerRuntimeExports.c(5);if(!s.src)return null;let a;l[0]!==s?(a=k(s),l[0]=s,l[1]=a):a=l[1];let u;return l[2]!==r||l[3]!==a?(u=g.jsxRuntimeExports.jsx(n.Image,{ref:r,...a}),l[2]=r,l[3]=a,l[4]=u):u=l[4],u});return o.displayName="PlatformPrimitiveImage",o}const c=n[i];return c||(console.warn(`Native component '${i}' not found, falling back to View`),n.View)}const D=Symbol("radix.slottable");function F(...t){return e=>t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}function M(t,e){const n={...e};for(const i in e){const c=t[i],o=e[i];/^on[A-Z]/.test(i)?c&&o?n[i]=(...r)=>{const l=o(...r);return c(...r),l}:c&&(n[i]=c):i==="style"?n[i]=W(c,o):i==="className"&&(n[i]=[c,o].filter(Boolean).join(" "))}return{...t,...n}}function W(t,e){let n=null;try{n=require("react-native")}catch{n=null}const i=n?.StyleSheet?.flatten;if(typeof t=="function"&&typeof e=="function")return o=>{const s=[t(o),e(o)];return i?i(s):s};if(typeof t=="function")return o=>{const s=e?[t(o),e]:t(o);return i?i(s):s};if(typeof e=="function")return o=>{const s=t?[t,e(o)]:e(o);return i?i(s):s};const c=[t,e].filter(Boolean);return i?i(c):c}function G(t){return m.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===D}function L(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function U(t,e){const n=m.forwardRef((i,c)=>{const{children:o,...s}=i;if(m.isValidElement(o)){const r=L(o),l=M(s,o.props);return o.type!==m.Fragment&&(l.ref=c?F(c,r):r),m.cloneElement(o,l)}return m.Children.count(o)>1?m.Children.only(null):null});return n.displayName=`${t}.SlotClone`,n}function v(t,e=!1,n="div"){if(!e)return A(n,t);const i=U("Slot"),c=m.forwardRef((o,s)=>{const r=g.compilerRuntimeExports.c(15);let l,a;r[0]!==o?({children:l,...a}=o,r[0]=o,r[1]=l,r[2]=a):(l=r[1],a=r[2]);let u;if(r[3]!==l||r[4]!==s||r[5]!==a){u=Symbol.for("react.early_return_sentinel");e:{const f=m.Children.toArray(l),p=f.find(G);if(p){const x=p.props.children,y=f.map(R=>R===p?m.Children.count(x)>1?m.Children.only(null):m.isValidElement(x)?x.props.children:null:R),b=m.isValidElement(x)?m.cloneElement(x,void 0,y):null;let h;r[7]!==s||r[8]!==a||r[9]!==b?(h=g.jsxRuntimeExports.jsx(i,{...a,ref:s,children:b}),r[7]=s,r[8]=a,r[9]=b,r[10]=h):h=r[10],u=h;break e}}r[3]=l,r[4]=s,r[5]=a,r[6]=u}else u=r[6];if(u!==Symbol.for("react.early_return_sentinel"))return u;let d;return r[11]!==l||r[12]!==s||r[13]!==a?(d=g.jsxRuntimeExports.jsx(i,{...a,ref:s,children:l}),r[11]=l,r[12]=s,r[13]=a,r[14]=d):d=r[14],d});return c.displayName="Slot",c}const E=()=>{const t=g.compilerRuntimeExports.c(2),{getPlatform:e}=T.useSdk();let n;return t[0]!==e?(n=e(),t[0]=e,t[1]=n):n=t[1],n},w="ProductBadge",[H]=N(w),[z,K]=H(w),B=t=>{const e=g.compilerRuntimeExports.c(13);let n,i,c,o,s;e[0]!==t?({children:i,product:c,__scopeProductBadge:n,style:s,...o}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=c,e[4]=o,e[5]=s):(n=e[1],i=e[2],c=e[3],o=e[4],s=e[5]);const r=C.useRef(null),l=E();let a;e[6]!==l?(a=v(l),e[6]=l,e[7]=a):a=e[7];const u=a;if(!P.getEnabled())return null;const{badges:d}=c;if(!d)return null;const f=d.reduce(Z,{}),p=Object.keys(f),x={groupedBadges:f,badges:d,badgesRef:r,positions:p},y=I.renderChildren(i,x);let b;return e[8]!==u||e[9]!==o||e[10]!==s||e[11]!==y?(b=g.jsxRuntimeExports.jsx(u,{...o,style:s,children:y}),e[8]=u,e[9]=o,e[10]=s,e[11]=y,e[12]=b):b=e[12],g.jsxRuntimeExports.jsx(z,{scope:n,...x,children:b})};B.displayName=w;const S=t=>{const e=g.compilerRuntimeExports.c(18);let n,i,c,o,s;e[0]!==t?({children:c,position:o,asChild:i,__scopeProductBadge:n,...s}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=c,e[4]=o,e[5]=s):(n=e[1],i=e[2],c=e[3],o=e[4],s=e[5]);const r=E();let l;e[6]!==i||e[7]!==r?(l=v(r,i,"div"),e[6]=i,e[7]=r,e[8]=l):l=e[8];const a=l,{groupedBadges:u}=K(w,n),d=u[o];let f;e[9]!==d||e[10]!==c||e[11]!==o?(f=I.renderChildren(c,{badges:d,position:o}),e[9]=d,e[10]=c,e[11]=o,e[12]=f):f=e[12];let p;return e[13]!==a||e[14]!==o||e[15]!==s||e[16]!==f?(p=g.jsxRuntimeExports.jsx(a,{...s,"data-position":o,children:f}),e[13]=a,e[14]=o,e[15]=s,e[16]=f,e[17]=p):p=e[17],p},_=t=>{const e=g.compilerRuntimeExports.c(13);let n,i,c,o;e[0]!==t?({children:c,asChild:n,badge:i,...o}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=c,e[4]=o):(n=e[1],i=e[2],c=e[3],o=e[4]);const s=E();let r;e[5]!==n||e[6]!==s?(r=v(s,n,"div"),e[5]=n,e[6]=s,e[7]=r):r=e[7];const l=r,a=i?.id;let u;return e[8]!==l||e[9]!==c||e[10]!==o||e[11]!==a?(u=g.jsxRuntimeExports.jsx(l,{...o,"data-badge-id":a,children:c}),e[8]=l,e[9]=c,e[10]=o,e[11]=a,e[12]=u):u=e[12],u},V=t=>{const e=g.compilerRuntimeExports.c(8),{badge:n,asChild:i,...c}=t,o=E();let s;e[0]!==i||e[1]!==o?(s=v(o,i,"img"),e[0]=i,e[1]=o,e[2]=s):s=e[2];const r=s,l=O(c,o),a=n.asset?.preview;let u;return e[3]!==r||e[4]!==n.collection.name||e[5]!==a||e[6]!==l?(u=g.jsxRuntimeExports.jsx(r,{src:a,alt:n.collection.name,"data-badge-name":n.collection.name,...l}),e[3]=r,e[4]=n.collection.name,e[5]=a,e[6]=l,e[7]=u):u=e[7],u};S.displayName="ProductBadgeGroup";_.displayName="ProductBadgeItem";V.displayName="ProductBadgeImage";const Q={Root:B,Group:S,Item:_,Image:V};function Z(t,e){return t[e.position]||(t[e.position]=[]),t[e.position].push(e),t}exports.ProductBadge=Q;exports.VendureBadgePlugin=P;
|