@assembled-brands/frontend 0.3.21 → 0.3.23

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.
@@ -1,6 +1,6 @@
1
- var hr=Object.defineProperty;var gr=(e,t)=>{for(var r in t)hr(e,r,{get:t[r],enumerable:!0})};function te(e,t){return function(){return e.apply(t,arguments)}}var{toString:yr}=Object.prototype,{getPrototypeOf:Fe}=Object,{iterator:ye,toStringTag:dt}=Symbol,xe=(e=>t=>{let r=yr.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),_=e=>(e=e.toLowerCase(),t=>xe(t)===e),be=e=>t=>typeof t===e,{isArray:J}=Array,V=be("undefined");function re(e){return e!==null&&!V(e)&&e.constructor!==null&&!V(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var ft=_("ArrayBuffer");function xr(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ft(e.buffer),t}var br=be("string"),O=be("function"),mt=be("number"),oe=e=>e!==null&&typeof e=="object",Er=e=>e===!0||e===!1,ge=e=>{if(xe(e)!=="object")return!1;let t=Fe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(dt in e)&&!(ye in e)},Rr=e=>{if(!oe(e)||re(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Ar=_("Date"),vr=_("File"),wr=_("Blob"),Sr=_("FileList"),Tr=e=>oe(e)&&O(e.pipe),Cr=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||O(e.append)&&((t=xe(e))==="formdata"||t==="object"&&O(e.toString)&&e.toString()==="[object FormData]"))},Or=_("URLSearchParams"),[Lr,Dr,Pr,_r]=["ReadableStream","Request","Response","Headers"].map(_),Ur=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ne(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let o,n;if(typeof e!="object"&&(e=[e]),J(e))for(o=0,n=e.length;o<n;o++)t.call(null,e[o],o,e);else{if(re(e))return;let s=r?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length,c;for(o=0;o<i;o++)c=s[o],t.call(null,e[c],c,e)}}function ht(e,t){if(re(e))return null;t=t.toLowerCase();let r=Object.keys(e),o=r.length,n;for(;o-- >0;)if(n=r[o],t===n.toLowerCase())return n;return null}var z=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,gt=e=>!V(e)&&e!==z;function Ue(){let{caseless:e,skipUndefined:t}=gt(this)&&this||{},r={},o=(n,s)=>{let i=e&&ht(r,s)||s;ge(r[i])&&ge(n)?r[i]=Ue(r[i],n):ge(n)?r[i]=Ue({},n):J(n)?r[i]=n.slice():(!t||!V(n))&&(r[i]=n)};for(let n=0,s=arguments.length;n<s;n++)arguments[n]&&ne(arguments[n],o);return r}var Fr=(e,t,r,{allOwnKeys:o}={})=>(ne(t,(n,s)=>{r&&O(n)?e[s]=te(n,r):e[s]=n},{allOwnKeys:o}),e),Br=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Nr=(e,t,r,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},kr=(e,t,r,o)=>{let n,s,i,c={};if(t=t||{},e==null)return t;do{for(n=Object.getOwnPropertyNames(e),s=n.length;s-- >0;)i=n[s],(!o||o(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=r!==!1&&Fe(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Mr=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let o=e.indexOf(t,r);return o!==-1&&o===r},Ir=e=>{if(!e)return null;if(J(e))return e;let t=e.length;if(!mt(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Hr=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Fe(Uint8Array)),Wr=(e,t)=>{let o=(e&&e[ye]).call(e),n;for(;(n=o.next())&&!n.done;){let s=n.value;t.call(e,s[0],s[1])}},qr=(e,t)=>{let r,o=[];for(;(r=e.exec(t))!==null;)o.push(r);return o},jr=_("HTMLFormElement"),zr=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,o,n){return o.toUpperCase()+n}),pt=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),$r=_("RegExp"),yt=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),o={};ne(r,(n,s)=>{let i;(i=t(n,s,e))!==!1&&(o[s]=i||n)}),Object.defineProperties(e,o)},Gr=e=>{yt(e,(t,r)=>{if(O(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let o=e[r];if(O(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Vr=(e,t)=>{let r={},o=n=>{n.forEach(s=>{r[s]=!0})};return J(e)?o(e):o(String(e).split(t)),r},Jr=()=>{},Kr=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Xr(e){return!!(e&&O(e.append)&&e[dt]==="FormData"&&e[ye])}var Qr=e=>{let t=new Array(10),r=(o,n)=>{if(oe(o)){if(t.indexOf(o)>=0)return;if(re(o))return o;if(!("toJSON"in o)){t[n]=o;let s=J(o)?[]:{};return ne(o,(i,c)=>{let d=r(i,n+1);!V(d)&&(s[c]=d)}),t[n]=void 0,s}}return o};return r(e,0)},Yr=_("AsyncFunction"),Zr=e=>e&&(oe(e)||O(e))&&O(e.then)&&O(e.catch),xt=((e,t)=>e?setImmediate:t?((r,o)=>(z.addEventListener("message",({source:n,data:s})=>{n===z&&s===r&&o.length&&o.shift()()},!1),n=>{o.push(n),z.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",O(z.postMessage)),eo=typeof queueMicrotask<"u"?queueMicrotask.bind(z):typeof process<"u"&&process.nextTick||xt,to=e=>e!=null&&O(e[ye]),a={isArray:J,isArrayBuffer:ft,isBuffer:re,isFormData:Cr,isArrayBufferView:xr,isString:br,isNumber:mt,isBoolean:Er,isObject:oe,isPlainObject:ge,isEmptyObject:Rr,isReadableStream:Lr,isRequest:Dr,isResponse:Pr,isHeaders:_r,isUndefined:V,isDate:Ar,isFile:vr,isBlob:wr,isRegExp:$r,isFunction:O,isStream:Tr,isURLSearchParams:Or,isTypedArray:Hr,isFileList:Sr,forEach:ne,merge:Ue,extend:Fr,trim:Ur,stripBOM:Br,inherits:Nr,toFlatObject:kr,kindOf:xe,kindOfTest:_,endsWith:Mr,toArray:Ir,forEachEntry:Wr,matchAll:qr,isHTMLForm:jr,hasOwnProperty:pt,hasOwnProp:pt,reduceDescriptors:yt,freezeMethods:Gr,toObjectSet:Vr,toCamelCase:zr,noop:Jr,toFiniteNumber:Kr,findKey:ht,global:z,isContextDefined:gt,isSpecCompliantForm:Xr,toJSONObject:Qr,isAsyncFn:Yr,isThenable:Zr,setImmediate:xt,asap:eo,isIterable:to};function K(e,t,r,o,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),o&&(this.request=o),n&&(this.response=n,this.status=n.status?n.status:null)}a.inherits(K,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:a.toJSONObject(this.config),code:this.code,status:this.status}}});var bt=K.prototype,Et={};["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(e=>{Et[e]={value:e}});Object.defineProperties(K,Et);Object.defineProperty(bt,"isAxiosError",{value:!0});K.from=(e,t,r,o,n,s)=>{let i=Object.create(bt);a.toFlatObject(e,i,function(u){return u!==Error.prototype},p=>p!=="isAxiosError");let c=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return K.call(i,c,d,r,o,n),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",s&&Object.assign(i,s),i};var g=K;var Ee=null;function Be(e){return a.isPlainObject(e)||a.isArray(e)}function At(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Rt(e,t,r){return e?e.concat(t).map(function(n,s){return n=At(n),!r&&s?"["+n+"]":n}).join(r?".":""):t}function ro(e){return a.isArray(e)&&!e.some(Be)}var oo=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function no(e,t,r){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new(Ee||FormData),r=a.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,f){return!a.isUndefined(f[m])});let o=r.metaTokens,n=r.visitor||u,s=r.dots,i=r.indexes,d=(r.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(n))throw new TypeError("visitor must be a function");function p(l){if(l===null)return"";if(a.isDate(l))return l.toISOString();if(a.isBoolean(l))return l.toString();if(!d&&a.isBlob(l))throw new g("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(l)||a.isTypedArray(l)?d&&typeof Blob=="function"?new Blob([l]):Buffer.from(l):l}function u(l,m,f){let x=l;if(l&&!f&&typeof l=="object"){if(a.endsWith(m,"{}"))m=o?m:m.slice(0,-2),l=JSON.stringify(l);else if(a.isArray(l)&&ro(l)||(a.isFileList(l)||a.endsWith(m,"[]"))&&(x=a.toArray(l)))return m=At(m),x.forEach(function(b,T){!(a.isUndefined(b)||b===null)&&t.append(i===!0?Rt([m],T,s):i===null?m:m+"[]",p(b))}),!1}return Be(l)?!0:(t.append(Rt(f,m,s),p(l)),!1)}let h=[],y=Object.assign(oo,{defaultVisitor:u,convertValue:p,isVisitable:Be});function S(l,m){if(!a.isUndefined(l)){if(h.indexOf(l)!==-1)throw Error("Circular reference detected in "+m.join("."));h.push(l),a.forEach(l,function(x,E){(!(a.isUndefined(x)||x===null)&&n.call(t,x,a.isString(E)?E.trim():E,m,y))===!0&&S(x,m?m.concat(E):[E])}),h.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return S(e),t}var q=no;function vt(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(o){return t[o]})}function wt(e,t){this._pairs=[],e&&q(e,this,t)}var St=wt.prototype;St.append=function(t,r){this._pairs.push([t,r])};St.toString=function(t){let r=t?function(o){return t.call(this,o,vt)}:vt;return this._pairs.map(function(n){return r(n[0])+"="+r(n[1])},"").join("&")};var Re=wt;function so(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function se(e,t,r){if(!t)return e;let o=r&&r.encode||so;a.isFunction(r)&&(r={serialize:r});let n=r&&r.serialize,s;if(n?s=n(t,r):s=a.isURLSearchParams(t)?t.toString():new Re(t,r).toString(o),s){let i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}var Ne=class{constructor(){this.handlers=[]}use(t,r,o){return this.handlers.push({fulfilled:t,rejected:r,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(o){o!==null&&t(o)})}},ke=Ne;var Ae={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Tt=typeof URLSearchParams<"u"?URLSearchParams:Re;var Ct=typeof FormData<"u"?FormData:null;var Ot=typeof Blob<"u"?Blob:null;var Lt={isBrowser:!0,classes:{URLSearchParams:Tt,FormData:Ct,Blob:Ot},protocols:["http","https","file","blob","url","data"]};var He={};gr(He,{hasBrowserEnv:()=>Ie,hasStandardBrowserEnv:()=>io,hasStandardBrowserWebWorkerEnv:()=>ao,navigator:()=>Me,origin:()=>co});var Ie=typeof window<"u"&&typeof document<"u",Me=typeof navigator=="object"&&navigator||void 0,io=Ie&&(!Me||["ReactNative","NativeScript","NS"].indexOf(Me.product)<0),ao=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",co=Ie&&window.location.href||"http://localhost";var R={...He,...Lt};function We(e,t){return q(e,new R.classes.URLSearchParams,{visitor:function(r,o,n,s){return R.isNode&&a.isBuffer(r)?(this.append(o,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function lo(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function uo(e){let t={},r=Object.keys(e),o,n=r.length,s;for(o=0;o<n;o++)s=r[o],t[s]=e[s];return t}function po(e){function t(r,o,n,s){let i=r[s++];if(i==="__proto__")return!0;let c=Number.isFinite(+i),d=s>=r.length;return i=!i&&a.isArray(n)?n.length:i,d?(a.hasOwnProp(n,i)?n[i]=[n[i],o]:n[i]=o,!c):((!n[i]||!a.isObject(n[i]))&&(n[i]=[]),t(r,o,n[i],s)&&a.isArray(n[i])&&(n[i]=uo(n[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){let r={};return a.forEachEntry(e,(o,n)=>{t(lo(o),n,r,0)}),r}return null}var ve=po;function fo(e,t,r){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(o){if(o.name!=="SyntaxError")throw o}return(r||JSON.stringify)(e)}var qe={transitional:Ae,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let o=r.getContentType()||"",n=o.indexOf("application/json")>-1,s=a.isObject(t);if(s&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return n?JSON.stringify(ve(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(s){if(o.indexOf("application/x-www-form-urlencoded")>-1)return We(t,this.formSerializer).toString();if((c=a.isFileList(t))||o.indexOf("multipart/form-data")>-1){let d=this.env&&this.env.FormData;return q(c?{"files[]":t}:t,d&&new d,this.formSerializer)}}return s||n?(r.setContentType("application/json",!1),fo(t)):t}],transformResponse:[function(t){let r=this.transitional||qe.transitional,o=r&&r.forcedJSONParsing,n=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(o&&!this.responseType||n)){let i=!(r&&r.silentJSONParsing)&&n;try{return JSON.parse(t,this.parseReviver)}catch(c){if(i)throw c.name==="SyntaxError"?g.from(c,g.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:R.classes.FormData,Blob:R.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{qe.headers[e]={}});var X=qe;var mo=a.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"]),Dt=e=>{let t={},r,o,n;return e&&e.split(`
2
- `).forEach(function(i){n=i.indexOf(":"),r=i.substring(0,n).trim().toLowerCase(),o=i.substring(n+1).trim(),!(!r||t[r]&&mo[r])&&(r==="set-cookie"?t[r]?t[r].push(o):t[r]=[o]:t[r]=t[r]?t[r]+", "+o:o)}),t};var Pt=Symbol("internals");function ie(e){return e&&String(e).trim().toLowerCase()}function we(e){return e===!1||e==null?e:a.isArray(e)?e.map(we):String(e)}function ho(e){let t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,o;for(;o=r.exec(e);)t[o[1]]=o[2];return t}var go=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function je(e,t,r,o,n){if(a.isFunction(o))return o.call(this,t,r);if(n&&(t=r),!!a.isString(t)){if(a.isString(o))return t.indexOf(o)!==-1;if(a.isRegExp(o))return o.test(t)}}function yo(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,o)=>r.toUpperCase()+o)}function xo(e,t){let r=a.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+r,{value:function(n,s,i){return this[o].call(this,t,n,s,i)},configurable:!0})})}var Q=class{constructor(t){t&&this.set(t)}set(t,r,o){let n=this;function s(c,d,p){let u=ie(d);if(!u)throw new Error("header name must be a non-empty string");let h=a.findKey(n,u);(!h||n[h]===void 0||p===!0||p===void 0&&n[h]!==!1)&&(n[h||d]=we(c))}let i=(c,d)=>a.forEach(c,(p,u)=>s(p,u,d));if(a.isPlainObject(t)||t instanceof this.constructor)i(t,r);else if(a.isString(t)&&(t=t.trim())&&!go(t))i(Dt(t),r);else if(a.isObject(t)&&a.isIterable(t)){let c={},d,p;for(let u of t){if(!a.isArray(u))throw TypeError("Object iterator must return a key-value pair");c[p=u[0]]=(d=c[p])?a.isArray(d)?[...d,u[1]]:[d,u[1]]:u[1]}i(c,r)}else t!=null&&s(r,t,o);return this}get(t,r){if(t=ie(t),t){let o=a.findKey(this,t);if(o){let n=this[o];if(!r)return n;if(r===!0)return ho(n);if(a.isFunction(r))return r.call(this,n,o);if(a.isRegExp(r))return r.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=ie(t),t){let o=a.findKey(this,t);return!!(o&&this[o]!==void 0&&(!r||je(this,this[o],o,r)))}return!1}delete(t,r){let o=this,n=!1;function s(i){if(i=ie(i),i){let c=a.findKey(o,i);c&&(!r||je(o,o[c],c,r))&&(delete o[c],n=!0)}}return a.isArray(t)?t.forEach(s):s(t),n}clear(t){let r=Object.keys(this),o=r.length,n=!1;for(;o--;){let s=r[o];(!t||je(this,this[s],s,t,!0))&&(delete this[s],n=!0)}return n}normalize(t){let r=this,o={};return a.forEach(this,(n,s)=>{let i=a.findKey(o,s);if(i){r[i]=we(n),delete r[s];return}let c=t?yo(s):String(s).trim();c!==s&&delete r[s],r[c]=we(n),o[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let r=Object.create(null);return a.forEach(this,(o,n)=>{o!=null&&o!==!1&&(r[n]=t&&a.isArray(o)?o.join(", "):o)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
3
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){let o=new this(t);return r.forEach(n=>o.set(n)),o}static accessor(t){let o=(this[Pt]=this[Pt]={accessors:{}}).accessors,n=this.prototype;function s(i){let c=ie(i);o[c]||(xo(n,i),o[c]=!0)}return a.isArray(t)?t.forEach(s):s(t),this}};Q.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(Q.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(o){this[r]=o}}});a.freezeMethods(Q);var w=Q;function ae(e,t){let r=this||X,o=t||r,n=w.from(o.headers),s=o.data;return a.forEach(e,function(c){s=c.call(r,s,n.normalize(),t?t.status:void 0)}),n.normalize(),s}function ce(e){return!!(e&&e.__CANCEL__)}function _t(e,t,r){g.call(this,e??"canceled",g.ERR_CANCELED,t,r),this.name="CanceledError"}a.inherits(_t,g,{__CANCEL__:!0});var N=_t;function le(e,t,r){let o=r.config.validateStatus;!r.status||!o||o(r.status)?e(r):t(new g("Request failed with status code "+r.status,[g.ERR_BAD_REQUEST,g.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function ze(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function bo(e,t){e=e||10;let r=new Array(e),o=new Array(e),n=0,s=0,i;return t=t!==void 0?t:1e3,function(d){let p=Date.now(),u=o[s];i||(i=p),r[n]=d,o[n]=p;let h=s,y=0;for(;h!==n;)y+=r[h++],h=h%e;if(n=(n+1)%e,n===s&&(s=(s+1)%e),p-i<t)return;let S=u&&p-u;return S?Math.round(y*1e3/S):void 0}}var Ut=bo;function Eo(e,t){let r=0,o=1e3/t,n,s,i=(p,u=Date.now())=>{r=u,n=null,s&&(clearTimeout(s),s=null),e(...p)};return[(...p)=>{let u=Date.now(),h=u-r;h>=o?i(p,u):(n=p,s||(s=setTimeout(()=>{s=null,i(n)},o-h)))},()=>n&&i(n)]}var Ft=Eo;var Y=(e,t,r=3)=>{let o=0,n=Ut(50,250);return Ft(s=>{let i=s.loaded,c=s.lengthComputable?s.total:void 0,d=i-o,p=n(d),u=i<=c;o=i;let h={loaded:i,total:c,progress:c?i/c:void 0,bytes:d,rate:p||void 0,estimated:p&&c&&u?(c-i)/p:void 0,event:s,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(h)},r)},$e=(e,t)=>{let r=e!=null;return[o=>t[0]({lengthComputable:r,total:e,loaded:o}),t[1]]},Ge=e=>(...t)=>a.asap(()=>e(...t));var Bt=R.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,R.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(R.origin),R.navigator&&/(msie|trident)/i.test(R.navigator.userAgent)):()=>!0;var Nt=R.hasStandardBrowserEnv?{write(e,t,r,o,n,s,i){if(typeof document>"u")return;let c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(r)&&c.push(`expires=${new Date(r).toUTCString()}`),a.isString(o)&&c.push(`path=${o}`),a.isString(n)&&c.push(`domain=${n}`),s===!0&&c.push("secure"),a.isString(i)&&c.push(`SameSite=${i}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;let t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Ve(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Je(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ue(e,t,r){let o=!Ve(t);return e&&(o||r==!1)?Je(e,t):t}var kt=e=>e instanceof w?{...e}:e;function U(e,t){t=t||{};let r={};function o(p,u,h,y){return a.isPlainObject(p)&&a.isPlainObject(u)?a.merge.call({caseless:y},p,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function n(p,u,h,y){if(a.isUndefined(u)){if(!a.isUndefined(p))return o(void 0,p,h,y)}else return o(p,u,h,y)}function s(p,u){if(!a.isUndefined(u))return o(void 0,u)}function i(p,u){if(a.isUndefined(u)){if(!a.isUndefined(p))return o(void 0,p)}else return o(void 0,u)}function c(p,u,h){if(h in t)return o(p,u);if(h in e)return o(void 0,p)}let d={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:c,headers:(p,u,h)=>n(kt(p),kt(u),h,!0)};return a.forEach(Object.keys({...e,...t}),function(u){let h=d[u]||n,y=h(e[u],t[u],u);a.isUndefined(y)&&h!==c||(r[u]=y)}),r}var Se=e=>{let t=U({},e),{data:r,withXSRFToken:o,xsrfHeaderName:n,xsrfCookieName:s,headers:i,auth:c}=t;if(t.headers=i=w.from(i),t.url=se(ue(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(r)){if(R.hasStandardBrowserEnv||R.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(a.isFunction(r.getHeaders)){let d=r.getHeaders(),p=["content-type","content-length"];Object.entries(d).forEach(([u,h])=>{p.includes(u.toLowerCase())&&i.set(u,h)})}}if(R.hasStandardBrowserEnv&&(o&&a.isFunction(o)&&(o=o(t)),o||o!==!1&&Bt(t.url))){let d=n&&s&&Nt.read(s);d&&i.set(n,d)}return t};var Ro=typeof XMLHttpRequest<"u",Mt=Ro&&function(e){return new Promise(function(r,o){let n=Se(e),s=n.data,i=w.from(n.headers).normalize(),{responseType:c,onUploadProgress:d,onDownloadProgress:p}=n,u,h,y,S,l;function m(){S&&S(),l&&l(),n.cancelToken&&n.cancelToken.unsubscribe(u),n.signal&&n.signal.removeEventListener("abort",u)}let f=new XMLHttpRequest;f.open(n.method.toUpperCase(),n.url,!0),f.timeout=n.timeout;function x(){if(!f)return;let b=w.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),L={data:!c||c==="text"||c==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:b,config:e,request:f};le(function(C){r(C),m()},function(C){o(C),m()},L),f=null}"onloadend"in f?f.onloadend=x:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(x)},f.onabort=function(){f&&(o(new g("Request aborted",g.ECONNABORTED,e,f)),f=null)},f.onerror=function(T){let L=T&&T.message?T.message:"Network Error",I=new g(L,g.ERR_NETWORK,e,f);I.event=T||null,o(I),f=null},f.ontimeout=function(){let T=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded",L=n.transitional||Ae;n.timeoutErrorMessage&&(T=n.timeoutErrorMessage),o(new g(T,L.clarifyTimeoutError?g.ETIMEDOUT:g.ECONNABORTED,e,f)),f=null},s===void 0&&i.setContentType(null),"setRequestHeader"in f&&a.forEach(i.toJSON(),function(T,L){f.setRequestHeader(L,T)}),a.isUndefined(n.withCredentials)||(f.withCredentials=!!n.withCredentials),c&&c!=="json"&&(f.responseType=n.responseType),p&&([y,l]=Y(p,!0),f.addEventListener("progress",y)),d&&f.upload&&([h,S]=Y(d),f.upload.addEventListener("progress",h),f.upload.addEventListener("loadend",S)),(n.cancelToken||n.signal)&&(u=b=>{f&&(o(!b||b.type?new N(null,e,f):b),f.abort(),f=null)},n.cancelToken&&n.cancelToken.subscribe(u),n.signal&&(n.signal.aborted?u():n.signal.addEventListener("abort",u)));let E=ze(n.url);if(E&&R.protocols.indexOf(E)===-1){o(new g("Unsupported protocol "+E+":",g.ERR_BAD_REQUEST,e));return}f.send(s||null)})};var Ao=(e,t)=>{let{length:r}=e=e?e.filter(Boolean):[];if(t||r){let o=new AbortController,n,s=function(p){if(!n){n=!0,c();let u=p instanceof Error?p:this.reason;o.abort(u instanceof g?u:new N(u instanceof Error?u.message:u))}},i=t&&setTimeout(()=>{i=null,s(new g(`timeout ${t} of ms exceeded`,g.ETIMEDOUT))},t),c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(p=>{p.unsubscribe?p.unsubscribe(s):p.removeEventListener("abort",s)}),e=null)};e.forEach(p=>p.addEventListener("abort",s));let{signal:d}=o;return d.unsubscribe=()=>a.asap(c),d}},It=Ao;var vo=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let o=0,n;for(;o<r;)n=o+t,yield e.slice(o,n),o=n},wo=async function*(e,t){for await(let r of So(e))yield*vo(r,t)},So=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:r,value:o}=await t.read();if(r)break;yield o}}finally{await t.cancel()}},Ke=(e,t,r,o)=>{let n=wo(e,t),s=0,i,c=d=>{i||(i=!0,o&&o(d))};return new ReadableStream({async pull(d){try{let{done:p,value:u}=await n.next();if(p){c(),d.close();return}let h=u.byteLength;if(r){let y=s+=h;r(y)}d.enqueue(new Uint8Array(u))}catch(p){throw c(p),p}},cancel(d){return c(d),n.return()}},{highWaterMark:2})};var Ht=64*1024,{isFunction:Te}=a,To=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:Wt,TextEncoder:qt}=a.global,jt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Co=e=>{e=a.merge.call({skipUndefined:!0},To,e);let{fetch:t,Request:r,Response:o}=e,n=t?Te(t):typeof fetch=="function",s=Te(r),i=Te(o);if(!n)return!1;let c=n&&Te(Wt),d=n&&(typeof qt=="function"?(l=>m=>l.encode(m))(new qt):async l=>new Uint8Array(await new r(l).arrayBuffer())),p=s&&c&&jt(()=>{let l=!1,m=new r(R.origin,{body:new Wt,method:"POST",get duplex(){return l=!0,"half"}}).headers.has("Content-Type");return l&&!m}),u=i&&c&&jt(()=>a.isReadableStream(new o("").body)),h={stream:u&&(l=>l.body)};n&&["text","arrayBuffer","blob","formData","stream"].forEach(l=>{!h[l]&&(h[l]=(m,f)=>{let x=m&&m[l];if(x)return x.call(m);throw new g(`Response type '${l}' is not supported`,g.ERR_NOT_SUPPORT,f)})});let y=async l=>{if(l==null)return 0;if(a.isBlob(l))return l.size;if(a.isSpecCompliantForm(l))return(await new r(R.origin,{method:"POST",body:l}).arrayBuffer()).byteLength;if(a.isArrayBufferView(l)||a.isArrayBuffer(l))return l.byteLength;if(a.isURLSearchParams(l)&&(l=l+""),a.isString(l))return(await d(l)).byteLength},S=async(l,m)=>{let f=a.toFiniteNumber(l.getContentLength());return f??y(m)};return async l=>{let{url:m,method:f,data:x,signal:E,cancelToken:b,timeout:T,onDownloadProgress:L,onUploadProgress:I,responseType:C,headers:D,withCredentials:F="same-origin",fetchOptions:fe}=Se(l),it=t||fetch;C=C?(C+"").toLowerCase():"text";let me=It([E,b&&b.toAbortSignal()],T),ee=null,j=me&&me.unsubscribe&&(()=>{me.unsubscribe()}),at;try{if(I&&p&&f!=="get"&&f!=="head"&&(at=await S(D,x))!==0){let W=new r(m,{method:"POST",body:x,duplex:"half"}),G;if(a.isFormData(x)&&(G=W.headers.get("content-type"))&&D.setContentType(G),W.body){let[_e,he]=$e(at,Y(Ge(I)));x=Ke(W.body,Ht,_e,he)}}a.isString(F)||(F=F?"include":"omit");let B=s&&"credentials"in r.prototype,ct={...fe,signal:me,method:f.toUpperCase(),headers:D.normalize().toJSON(),body:x,duplex:"half",credentials:B?F:void 0};ee=s&&new r(m,ct);let H=await(s?it(ee,fe):it(m,ct)),lt=u&&(C==="stream"||C==="response");if(u&&(L||lt&&j)){let W={};["status","statusText","headers"].forEach(ut=>{W[ut]=H[ut]});let G=a.toFiniteNumber(H.headers.get("content-length")),[_e,he]=L&&$e(G,Y(Ge(L),!0))||[];H=new o(Ke(H.body,Ht,_e,()=>{he&&he(),j&&j()}),W)}C=C||"text";let mr=await h[a.findKey(h,C)||"text"](H,l);return!lt&&j&&j(),await new Promise((W,G)=>{le(W,G,{data:mr,headers:w.from(H.headers),status:H.status,statusText:H.statusText,config:l,request:ee})})}catch(B){throw j&&j(),B&&B.name==="TypeError"&&/Load failed|fetch/i.test(B.message)?Object.assign(new g("Network Error",g.ERR_NETWORK,l,ee),{cause:B.cause||B}):g.from(B,B&&B.code,l,ee)}}},Oo=new Map,Xe=e=>{let t=e&&e.env||{},{fetch:r,Request:o,Response:n}=t,s=[o,n,r],i=s.length,c=i,d,p,u=Oo;for(;c--;)d=s[c],p=u.get(d),p===void 0&&u.set(d,p=c?new Map:Co(t)),u=p;return p},Ks=Xe();var Qe={http:Ee,xhr:Mt,fetch:{get:Xe}};a.forEach(Qe,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var zt=e=>`- ${e}`,Do=e=>a.isFunction(e)||e===null||e===!1;function Po(e,t){e=a.isArray(e)?e:[e];let{length:r}=e,o,n,s={};for(let i=0;i<r;i++){o=e[i];let c;if(n=o,!Do(o)&&(n=Qe[(c=String(o)).toLowerCase()],n===void 0))throw new g(`Unknown adapter '${c}'`);if(n&&(a.isFunction(n)||(n=n.get(t))))break;s[c||"#"+i]=n}if(!n){let i=Object.entries(s).map(([d,p])=>`adapter ${d} `+(p===!1?"is not supported by the environment":"is not available in the build")),c=r?i.length>1?`since :
4
- `+i.map(zt).join(`
5
- `):" "+zt(i[0]):"as no adapter specified";throw new g("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return n}var Ce={getAdapter:Po,adapters:Qe};function Ye(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new N(null,e)}function Oe(e){return Ye(e),e.headers=w.from(e.headers),e.data=ae.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ce.getAdapter(e.adapter||X.adapter,e)(e).then(function(o){return Ye(e),o.data=ae.call(e,e.transformResponse,o),o.headers=w.from(o.headers),o},function(o){return ce(o)||(Ye(e),o&&o.response&&(o.response.data=ae.call(e,e.transformResponse,o.response),o.response.headers=w.from(o.response.headers))),Promise.reject(o)})}var Le="1.13.2";var De={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{De[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});var $t={};De.transitional=function(t,r,o){function n(s,i){return"[Axios v"+Le+"] Transitional option '"+s+"'"+i+(o?". "+o:"")}return(s,i,c)=>{if(t===!1)throw new g(n(i," has been removed"+(r?" in "+r:"")),g.ERR_DEPRECATED);return r&&!$t[i]&&($t[i]=!0,console.warn(n(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,i,c):!0}};De.spelling=function(t){return(r,o)=>(console.warn(`${o} is likely a misspelling of ${t}`),!0)};function _o(e,t,r){if(typeof e!="object")throw new g("options must be an object",g.ERR_BAD_OPTION_VALUE);let o=Object.keys(e),n=o.length;for(;n-- >0;){let s=o[n],i=t[s];if(i){let c=e[s],d=c===void 0||i(c,s,e);if(d!==!0)throw new g("option "+s+" must be "+d,g.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new g("Unknown option "+s,g.ERR_BAD_OPTION)}}var pe={assertOptions:_o,validators:De};var k=pe.validators,Z=class{constructor(t){this.defaults=t||{},this.interceptors={request:new ke,response:new ke}}async request(t,r){try{return await this._request(t,r)}catch(o){if(o instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;let s=n.stack?n.stack.replace(/^.+\n/,""):"";try{o.stack?s&&!String(o.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(o.stack+=`
6
- `+s):o.stack=s}catch{}}throw o}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=U(this.defaults,r);let{transitional:o,paramsSerializer:n,headers:s}=r;o!==void 0&&pe.assertOptions(o,{silentJSONParsing:k.transitional(k.boolean),forcedJSONParsing:k.transitional(k.boolean),clarifyTimeoutError:k.transitional(k.boolean)},!1),n!=null&&(a.isFunction(n)?r.paramsSerializer={serialize:n}:pe.assertOptions(n,{encode:k.function,serialize:k.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),pe.assertOptions(r,{baseUrl:k.spelling("baseURL"),withXsrfToken:k.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=s&&a.merge(s.common,s[r.method]);s&&a.forEach(["delete","get","head","post","put","patch","common"],l=>{delete s[l]}),r.headers=w.concat(i,s);let c=[],d=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(r)===!1||(d=d&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});let p=[];this.interceptors.response.forEach(function(m){p.push(m.fulfilled,m.rejected)});let u,h=0,y;if(!d){let l=[Oe.bind(this),void 0];for(l.unshift(...c),l.push(...p),y=l.length,u=Promise.resolve(r);h<y;)u=u.then(l[h++],l[h++]);return u}y=c.length;let S=r;for(;h<y;){let l=c[h++],m=c[h++];try{S=l(S)}catch(f){m.call(this,f);break}}try{u=Oe.call(this,S)}catch(l){return Promise.reject(l)}for(h=0,y=p.length;h<y;)u=u.then(p[h++],p[h++]);return u}getUri(t){t=U(this.defaults,t);let r=ue(t.baseURL,t.url,t.allowAbsoluteUrls);return se(r,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){Z.prototype[t]=function(r,o){return this.request(U(o||{},{method:t,url:r,data:(o||{}).data}))}});a.forEach(["post","put","patch"],function(t){function r(o){return function(s,i,c){return this.request(U(c||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}Z.prototype[t]=r(),Z.prototype[t+"Form"]=r(!0)});var de=Z;var Ze=class e{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});let o=this;this.promise.then(n=>{if(!o._listeners)return;let s=o._listeners.length;for(;s-- >0;)o._listeners[s](n);o._listeners=null}),this.promise.then=n=>{let s,i=new Promise(c=>{o.subscribe(c),s=c}).then(n);return i.cancel=function(){o.unsubscribe(s)},i},t(function(s,i,c){o.reason||(o.reason=new N(s,i,c),r(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){let t=new AbortController,r=o=>{t.abort(o)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new e(function(n){t=n}),cancel:t}}},Gt=Ze;function et(e){return function(r){return e.apply(null,r)}}function tt(e){return a.isObject(e)&&e.isAxiosError===!0}var rt={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(rt).forEach(([e,t])=>{rt[t]=e});var Vt=rt;function Jt(e){let t=new de(e),r=te(de.prototype.request,t);return a.extend(r,de.prototype,t,{allOwnKeys:!0}),a.extend(r,t,null,{allOwnKeys:!0}),r.create=function(n){return Jt(U(e,n))},r}var A=Jt(X);A.Axios=de;A.CanceledError=N;A.CancelToken=Gt;A.isCancel=ce;A.VERSION=Le;A.toFormData=q;A.AxiosError=g;A.Cancel=A.CanceledError;A.all=function(t){return Promise.all(t)};A.spread=et;A.isAxiosError=tt;A.mergeConfig=U;A.AxiosHeaders=w;A.formToJSON=e=>ve(a.isHTMLForm(e)?new FormData(e):e);A.getAdapter=Ce.getAdapter;A.HttpStatusCode=Vt;A.default=A;var Pe=A;var{Axios:Gi,AxiosError:Vi,CanceledError:Ji,isCancel:Ki,CancelToken:Xi,VERSION:Qi,all:Yi,Cancel:Zi,isAxiosError:ea,spread:ta,toFormData:ra,AxiosHeaders:oa,HttpStatusCode:na,formToJSON:sa,getAdapter:ia,mergeConfig:aa}=Pe;var Uo=localStorage.getItem("api-mode"),Fo="http://127.0.0.1:8787",Bo="https://assembled-brands-dev.crystal-e8a.workers.dev",M={apiBaseUrl:Uo==="local"?Fo:Bo,apiVersion:"/api/v1",accessTokenPersistStrategy:"cookie",TOKEN_NAME_IN_STORAGE:"accessToken",TOKEN_TYPE:"Bearer",REQUEST_HEADER_AUTH_KEY:"Authorization"},$=e=>{if(!e){console.error("navigateToPath: path is empty or undefined");return}let t=e.replace(/^\/+/,""),r=t;r=`dev/${t}`;let o=`${window.location.origin}/${r}`;window.location.assign(o)};var No=(e,t,r)=>{let o=new Date;o.setTime(o.getTime()+r*24*60*60*1e3);let n="expires="+o.toUTCString();document.cookie=`${e}=${encodeURIComponent(t)}; ${n}; path=/`},ot=e=>{let t=document.cookie.split("; ");for(let r of t){let[o,n]=r.split("=");if(o===e)return decodeURIComponent(n)}return null},nt=e=>{No(e,"",-1)},Kt=()=>{let e=ot("accessToken");return e||$("/login?error=unauthorized"),e},Xt=()=>{nt("accessToken"),localStorage.removeItem("x-team-id"),$("/login?error=logged-out")},ko=()=>{let e=localStorage.getItem("user"),t=e&&JSON.parse(e);return t&&t?.role},Qt=()=>ko()==="admin";var Mo=e=>{let t=M.accessTokenPersistStrategy;if(t==="localStorage"||t==="sessionStorage"||t==="cookie"){let o="";t==="localStorage"&&(o=localStorage.getItem(M.TOKEN_NAME_IN_STORAGE)||""),t==="sessionStorage"&&(o=sessionStorage.getItem(M.TOKEN_NAME_IN_STORAGE)||""),t==="cookie"&&(o=ot(M.TOKEN_NAME_IN_STORAGE)||""),o&&(e.headers[M.REQUEST_HEADER_AUTH_KEY]=`${M.TOKEN_TYPE} ${o}`)}let r=localStorage.getItem("x-team-id");return r&&(e.headers["X-Team-Id"]=r),e},Yt=Mo;var Io=[401,419,440],Ho=e=>{let{response:t}=e;if(window.location.pathname.includes("/login"))return Promise.reject(e);t&&Io.includes(t.status)&&(nt("accessToken"),$("/login?error=unauthorized"))},Zt=Ho;var st=Pe.create({timeout:6e4,baseURL:M.apiBaseUrl+M.apiVersion});st.interceptors.request.use(e=>Yt(e),e=>Promise.reject(e));st.interceptors.response.use(e=>e,e=>(Zt(e),Promise.reject(e)));var er=st;var Wo={fetchDataWithAxios(e){return new Promise((t,r)=>{er(e).then(o=>{t(o.data)}).catch(o=>{let n="An unknown error occurred";if(o.response&&o.response.data){let s=o.response.data;typeof s.message=="string"?n=s.message:typeof s.error=="string"?n=s.error:n=JSON.stringify(s)}else o.message&&(n=o.message);r({...o,message:n})})})}},P=Wo;var tr=e=>P.fetchDataWithAxios({url:"/asset",method:"post",data:e});var rr=e=>P.fetchDataWithAxios({url:"/financial-wizard/document",method:"post",data:e}),or=e=>P.fetchDataWithAxios({url:"/financial-wizard/progress",method:"get",params:e?{user_id:e}:void 0});var nr=()=>P.fetchDataWithAxios({url:"/financial-wizard/applications",method:"get"});async function sr(){return P.fetchDataWithAxios({url:"/user/me",method:"get"})}var ir=()=>P.fetchDataWithAxios({url:"/onboarding-wizard/progress",method:"get"});var ar=()=>P.fetchDataWithAxios({url:"/team/my-teams",method:"get"});var v=(e,t=document)=>t.querySelector(e),cr=(e,t=document)=>{let r=t.querySelectorAll(e);return[...Array.from(r)]};var qo=async e=>{let[t,r,o,n]=await Promise.all([or(e),sr(),ar(),ir()]);return{financialProgress:t,user:r,teams:o,onboardingProgress:n}},lr=async e=>{try{let{financialProgress:t,user:r,teams:o,onboardingProgress:n}=await qo(e),s=t?.percentage||0,i=v('[dev-target="progress-percentage-fill"]'),c=cr('[dev-target="progress-percentage-label"]'),d=v('[dev-target="user-name"]'),p=v('[dev-target="user-email"]'),u=v('[dev-target="logout"]');if(!i||!c||!u||!d||!p){console.error('Ensure [dev-target="progress-percentage-fill"], [dev-target="progress-percentage-label"], [dev-target="user-name"], [dev-target="user-email"], and [dev-target="logout"] are present.');return}return i.style.width=`${s}%`,c[0].textContent=`Progress ${s}%`,c[1].textContent=`${s}%`,u.addEventListener("click",()=>{Xt()}),d.innerText=t.business?.legal_name||(r.first_name||"Full")+" "+(r.last_name||"Name"),p.innerText=t.business?.email||r.email||"hello@company.com",{financialProgress:t,user:r,teams:o,onboardingProgress:n}}catch(t){console.error("Failed to load financial wizard progress:",t)}},ur=()=>{if(!v('[dev-target="sidebar-menu"]')){console.error('Ensure [dev-target="sidebar-menu"] is present.');return}let t=window.location.pathname,o={"/dev/finance-company-profile":{nav_attr:"nav-company-profile-link",nav_class:"is-active"},"/finance-company-profile":{nav_attr:"nav-company-profile-link",nav_class:"is-active"},"/dev/finance-financial-overview":{nav_attr:"nav-financial-overview-link",nav_class:"is-active"},"/finance-financial-overview":{nav_attr:"nav-financial-overview-link",nav_class:"is-active"},"/dev/finance-docs-financial-reports":{nav_attr:"nav-financial-reports-link",nav_class:"is-active-financial"},"/finance-docs-financial-reports":{nav_attr:"nav-financial-reports-link",nav_class:"is-active-financial"},"/dev/finance-docs-accounts-and-inventory":{nav_attr:"nav-accounts-inventory-link",nav_class:"is-active-financial"},"/finance-docs-accounts-and-inventory":{nav_attr:"nav-accounts-inventory-link",nav_class:"is-active-financial"},"/dev/finance-docs-ecommerce-performance":{nav_attr:"nav-eccomerce-performance-link",nav_class:"is-active-financial"},"/finance-docs-ecommerce-performance":{nav_attr:"nav-eccomerce-performance-link",nav_class:"is-active-financial"},"/dev/finance-docs-team-and-ownership":{nav_attr:"nav-team-ownership-link",nav_class:"is-active-financial"},"/finance-docs-team-and-ownership":{nav_attr:"nav-team-ownership-link",nav_class:"is-active-financial"},"/invite-team-members":{nav_attr:"nav-team-member-link",nav_class:"is-active-financial"},"/dev/invite-team-members":{nav_attr:"nav-team-member-link",nav_class:"is-active-financial"}}[t],n=document.querySelectorAll('[dev-attr="nav"]');if(o){n.forEach(i=>{i.classList.remove("is-active"),i.classList.remove("is-active-financial")});let s=v(`[dev-target="${o.nav_attr}"]`);s&&s.classList.add(o.nav_class)}else n.forEach(s=>{s.classList.remove("is-active"),s.classList.remove("is-active-financial")})},pr=async e=>{if(Qt()){let r=v('[dev-target="admin-select-wrapper"]'),o=v('[dev-target="admin-select"]');if(r?.classList.remove("hide"),!r||!o){console.error('Ensure [dev-target="admin-select"] and [dev-target="admin-select-wrapper"] is present.');return}let n=await nr();o.innerHTML="",n.forEach(s=>{let i=s.first_name||""+s.last_name||"",c=document.createElement("option");c.value=s.id.toString(),c.textContent=`${i||s.email}`,o.appendChild(c)}),o.addEventListener("change",async s=>{let i=s.target,{value:c}=i;e&&await e(c)})}},dr=e=>new Promise((t,r)=>{let o=new FileReader;o.onload=()=>{let s=o.result.split(",");t(s.length>1?s[1]:s[0])},o.onerror=()=>r(new Error("Failed to read file as base64")),o.readAsDataURL(e)}),fr=()=>{let e=v('[dev-target="sidebar-menu"]'),t=e?.querySelector(".sidebar"),r=v('[dev-target="collapsible-trigger"]');if(!e||!t||!r){console.error('Ensure [dev-target="sidebar-menu"] and [dev-target="collapsible-trigger"] and [dev-target="sidebar-inner"] are present.');return}let o=!1,n=()=>{o=!o;let s=document.querySelectorAll('[sidebar="collapsible-content"], [dev-target="collapsible-content"]'),i=v('[dev-target="sidebar-logo-text-wrapper"]'),c=e.querySelector('[dev-target="sidebar-bottom-collapsed"]'),d=e.querySelector('[dev-target="sidenav-close"]'),p=e.querySelector('[dev-target="sidebar-bottom"]'),u=e.querySelector(".user-profile_wrapper"),h=u?.querySelector(".flex-horizontal_auth.gap-15");o?(e.classList.add("collapsed"),t?.classList.add("mobile"),i?.classList.add("hide"),u?.classList.add("image-overlay"),h?.classList.add("overlay"),p?.classList.add("hide"),c?.classList.remove("hide"),d?.classList.add("is-collapsed"),s.forEach(y=>{y.style.opacity="0",y.style.transition="opacity 0.2s ease",setTimeout(()=>{y.classList.add("hide")},200)}),e.style.width="80px",e.style.width="auto"):(e.classList.remove("collapsed"),t?.classList.remove("mobile"),i?.classList.remove("hide"),u?.classList.remove("image-overlay"),h?.classList.remove("overlay"),p?.classList.remove("hide"),c?.classList.add("hide"),d?.classList.remove("is-collapsed"),s.forEach(y=>{y.classList.remove("hide"),setTimeout(()=>{y.style.opacity="1"},10)}))};r.addEventListener("click",n),e.style.transition="width 0.3s ease"};var jo=async()=>{ur(),Kt(),fr();let e=["application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],t=document.querySelector('[dev-target="ecommerce-performance-form"]');if(!t){console.error('E-Commerce Performance form not found. Element: [dev-target="ecommerce-performance-form"] not found');return}let r=v('[dev-target="shopify-repeat-upload-box"]',t),o=v('[dev-target="shopify-repeat-input"]',t),n=v('[dev-target="shopify-repeat-helper"]',t),s=v('[dev-target="shopify-monthly-upload-box"]',t),i=v('[dev-target="shopify-monthly-input"]',t),c=v('[dev-target="shopify-monthly-helper"]',t),d=v('[dev-target="submit-button"]',t);if(!r||!o||!n){console.error('Ensure [dev-target="shopify-repeat-upload-box"] and [dev-target="shopify-repeat-input"] and [dev-target="shopify-repeat-helper"] are present.');return}if(!s||!i||!c){console.error('Ensure [dev-target="shopify-monthly-upload-box"] and [dev-target="shopify-monthly-input"] and [dev-target="shopify-monthly-helper"] are present.');return}if(!d){console.error('Ensure [dev-target="submit-button"] is present.');return}let p=l=>{if(l?.ecommerce_performance){let m=l.ecommerce_performance.find(x=>x.document_type==="shopify_repeat_customers");m?n.textContent=m.asset_name||"Supported formats: sheets. xcel":n.textContent="Supported formats: sheets. xcel";let f=l.ecommerce_performance.find(x=>x.document_type==="shopify_monthly_sales");f?c.textContent=f.asset_name||"Supported formats: sheets. xcel":c.textContent="Supported formats: sheets. xcel"}else n.textContent="Supported formats: sheets. xcel",c.textContent="Supported formats: sheets. xcel"},u,h=async l=>{u=(await lr(l))?.financialProgress,p(u)};await h(),pr(h);let y=(l,m)=>{if(l.files&&l.files.length>0){let f=l.files[0];if(!e.includes(f.type)){l.value="",m.textContent="Invalid file type. Please upload Excel (.xls or .xlsx) files only",m.classList.add("is-error");return}m.textContent=f.name,m.classList.remove("is-error")}else m.textContent="",m.classList.remove("is-error")};r&&o&&n&&(r.addEventListener("click",()=>o.click()),r.addEventListener("dragover",l=>{l.preventDefault(),r.classList.add("drag")}),r.addEventListener("dragleave",()=>{r.classList.remove("drag")}),r.addEventListener("drop",l=>{l.preventDefault(),r.classList.remove("drag"),l.dataTransfer&&l.dataTransfer.files.length>0&&(o.files=l.dataTransfer.files,y(o,n),o.dispatchEvent(new Event("change",{bubbles:!0})))}),o.addEventListener("change",()=>{y(o,n)})),s&&i&&c&&(s.addEventListener("click",()=>i.click()),s.addEventListener("dragover",l=>{l.preventDefault(),s.classList.add("drag")}),s.addEventListener("dragleave",()=>{s.classList.remove("drag")}),s.addEventListener("drop",l=>{l.preventDefault(),s.classList.remove("drag"),l.dataTransfer&&l.dataTransfer.files.length>0&&(i.files=l.dataTransfer.files,y(i,c),i.dispatchEvent(new Event("change",{bubbles:!0})))}),i.addEventListener("change",()=>{y(i,c)}));let S=async(l,m)=>{if(!e.includes(l.type))throw new Error("Invalid file type. Please upload Excel (.xls or .xlsx) files only");let f={fileName:l.name,contentType:l.type,assetType:"document",fileSize:l.size,duration:0},x=await tr(f),E=x.asset.id,{presignedUrl:b}=x;if(!b)throw new Error("Presigned URL not received from server");await new Promise((I,C)=>{let D=new XMLHttpRequest;D.upload.addEventListener("progress",F=>{if(F.lengthComputable){let fe=Math.round(F.loaded/F.total*100);console.log(`Upload progress: ${fe}%`)}}),D.addEventListener("load",()=>{D.status>=200&&D.status<300?I():C(new Error("Failed to upload file to S3"))}),D.addEventListener("error",F=>{console.error(F),C(new Error("Network error during upload"))}),D.open("PUT",b),D.setRequestHeader("Content-Type",l.type),D.send(l)});let T=await dr(l),L={page:"ecommerce-performance",document_type:m,asset_id:E,file_data:T,file_name:l.name,file_mime_type:l.type};await rr(L)};t.addEventListener("submit",async l=>{l.preventDefault(),l.stopPropagation();let m=()=>{r?.classList.remove("is-error"),s?.classList.remove("is-error"),n?.classList.remove("is-error"),c?.classList.remove("is-error"),d.classList.remove("is-error"),d.value="UPLOAD DOCUMENTS"};o?.addEventListener("change",m,{once:!0}),i?.addEventListener("change",m,{once:!0});let f=[];if(o?.files&&o.files[0]){let E=o.files[0];e.includes(E.type)?f.push({file:E,documentType:"shopify_repeat_customers"}):n?.classList.add("is-error")}if(i?.files&&i.files[0]){let E=i.files[0];e.includes(E.type)?f.push({file:E,documentType:"shopify_monthly_sales"}):c?.classList.add("is-error")}if(o?.files&&o.files[0]&&!e.includes(o.files[0].type)||i?.files&&i.files[0]&&!e.includes(i.files[0].type)){d.classList.add("is-error"),d.value="Please upload only Excel (.xls or .xlsx) files";return}if(f.length===0){d.classList.add("is-error"),d.value="Please select at least one file to upload";return}try{d.disabled=!0,d.value="Uploading...",await Promise.all(f.map(({file:E,documentType:b})=>S(E,b))),d.classList.add("is-success"),d.value="Documents uploaded successfully!",o&&(o.value=""),i&&(i.value=""),n&&(n.textContent="",n.classList.remove("is-error")),c&&(c.textContent="",c.classList.remove("is-error")),setTimeout(()=>{d.classList.remove("is-success"),d.value="UPLOAD DOCUMENTS",d.disabled=!1,$("/finance-docs-team-and-ownership")},900)}catch(E){let{message:b}=E;console.error(b),d.classList.add("is-error"),d.value=b||"There was a problem uploading the documents",d.disabled=!1}})};window.Webflow||(window.Webflow=[]);window.Webflow.push(()=>{try{jo()}catch(e){console.error(e)}});
1
+ var gr=Object.defineProperty;var yr=(e,t)=>{for(var r in t)gr(e,r,{get:t[r],enumerable:!0})};function te(e,t){return function(){return e.apply(t,arguments)}}var{toString:br}=Object.prototype,{getPrototypeOf:Fe}=Object,{iterator:ye,toStringTag:dt}=Symbol,be=(e=>t=>{let r=br.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),D=e=>(e=e.toLowerCase(),t=>be(t)===e),xe=e=>t=>typeof t===e,{isArray:J}=Array,V=xe("undefined");function re(e){return e!==null&&!V(e)&&e.constructor!==null&&!V(e.constructor)&&C(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var ft=D("ArrayBuffer");function xr(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ft(e.buffer),t}var Er=xe("string"),C=xe("function"),mt=xe("number"),oe=e=>e!==null&&typeof e=="object",vr=e=>e===!0||e===!1,ge=e=>{if(be(e)!=="object")return!1;let t=Fe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(dt in e)&&!(ye in e)},Rr=e=>{if(!oe(e)||re(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},wr=D("Date"),Ar=D("File"),Sr=D("Blob"),Tr=D("FileList"),Lr=e=>oe(e)&&C(e.pipe),Cr=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||C(e.append)&&((t=be(e))==="formdata"||t==="object"&&C(e.toString)&&e.toString()==="[object FormData]"))},Or=D("URLSearchParams"),[_r,Pr,Dr,Ur]=["ReadableStream","Request","Response","Headers"].map(D),Fr=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ne(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let o,n;if(typeof e!="object"&&(e=[e]),J(e))for(o=0,n=e.length;o<n;o++)t.call(null,e[o],o,e);else{if(re(e))return;let i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length,c;for(o=0;o<s;o++)c=i[o],t.call(null,e[c],c,e)}}function ht(e,t){if(re(e))return null;t=t.toLowerCase();let r=Object.keys(e),o=r.length,n;for(;o-- >0;)if(n=r[o],t===n.toLowerCase())return n;return null}var z=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,gt=e=>!V(e)&&e!==z;function Ue(){let{caseless:e,skipUndefined:t}=gt(this)&&this||{},r={},o=(n,i)=>{let s=e&&ht(r,i)||i;ge(r[s])&&ge(n)?r[s]=Ue(r[s],n):ge(n)?r[s]=Ue({},n):J(n)?r[s]=n.slice():(!t||!V(n))&&(r[s]=n)};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&ne(arguments[n],o);return r}var Br=(e,t,r,{allOwnKeys:o}={})=>(ne(t,(n,i)=>{r&&C(n)?e[i]=te(n,r):e[i]=n},{allOwnKeys:o}),e),Mr=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),kr=(e,t,r,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},Nr=(e,t,r,o)=>{let n,i,s,c={};if(t=t||{},e==null)return t;do{for(n=Object.getOwnPropertyNames(e),i=n.length;i-- >0;)s=n[i],(!o||o(s,e,t))&&!c[s]&&(t[s]=e[s],c[s]=!0);e=r!==!1&&Fe(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Ir=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let o=e.indexOf(t,r);return o!==-1&&o===r},Hr=e=>{if(!e)return null;if(J(e))return e;let t=e.length;if(!mt(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Wr=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Fe(Uint8Array)),qr=(e,t)=>{let o=(e&&e[ye]).call(e),n;for(;(n=o.next())&&!n.done;){let i=n.value;t.call(e,i[0],i[1])}},jr=(e,t)=>{let r,o=[];for(;(r=e.exec(t))!==null;)o.push(r);return o},zr=D("HTMLFormElement"),$r=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,o,n){return o.toUpperCase()+n}),pt=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Gr=D("RegExp"),yt=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),o={};ne(r,(n,i)=>{let s;(s=t(n,i,e))!==!1&&(o[i]=s||n)}),Object.defineProperties(e,o)},Vr=e=>{yt(e,(t,r)=>{if(C(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let o=e[r];if(C(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Jr=(e,t)=>{let r={},o=n=>{n.forEach(i=>{r[i]=!0})};return J(e)?o(e):o(String(e).split(t)),r},Kr=()=>{},Xr=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Qr(e){return!!(e&&C(e.append)&&e[dt]==="FormData"&&e[ye])}var Yr=e=>{let t=new Array(10),r=(o,n)=>{if(oe(o)){if(t.indexOf(o)>=0)return;if(re(o))return o;if(!("toJSON"in o)){t[n]=o;let i=J(o)?[]:{};return ne(o,(s,c)=>{let u=r(s,n+1);!V(u)&&(i[c]=u)}),t[n]=void 0,i}}return o};return r(e,0)},Zr=D("AsyncFunction"),eo=e=>e&&(oe(e)||C(e))&&C(e.then)&&C(e.catch),bt=((e,t)=>e?setImmediate:t?((r,o)=>(z.addEventListener("message",({source:n,data:i})=>{n===z&&i===r&&o.length&&o.shift()()},!1),n=>{o.push(n),z.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",C(z.postMessage)),to=typeof queueMicrotask<"u"?queueMicrotask.bind(z):typeof process<"u"&&process.nextTick||bt,ro=e=>e!=null&&C(e[ye]),a={isArray:J,isArrayBuffer:ft,isBuffer:re,isFormData:Cr,isArrayBufferView:xr,isString:Er,isNumber:mt,isBoolean:vr,isObject:oe,isPlainObject:ge,isEmptyObject:Rr,isReadableStream:_r,isRequest:Pr,isResponse:Dr,isHeaders:Ur,isUndefined:V,isDate:wr,isFile:Ar,isBlob:Sr,isRegExp:Gr,isFunction:C,isStream:Lr,isURLSearchParams:Or,isTypedArray:Wr,isFileList:Tr,forEach:ne,merge:Ue,extend:Br,trim:Fr,stripBOM:Mr,inherits:kr,toFlatObject:Nr,kindOf:be,kindOfTest:D,endsWith:Ir,toArray:Hr,forEachEntry:qr,matchAll:jr,isHTMLForm:zr,hasOwnProperty:pt,hasOwnProp:pt,reduceDescriptors:yt,freezeMethods:Vr,toObjectSet:Jr,toCamelCase:$r,noop:Kr,toFiniteNumber:Xr,findKey:ht,global:z,isContextDefined:gt,isSpecCompliantForm:Qr,toJSONObject:Yr,isAsyncFn:Zr,isThenable:eo,setImmediate:bt,asap:to,isIterable:ro};function K(e,t,r,o,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),o&&(this.request=o),n&&(this.response=n,this.status=n.status?n.status:null)}a.inherits(K,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:a.toJSONObject(this.config),code:this.code,status:this.status}}});var xt=K.prototype,Et={};["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(e=>{Et[e]={value:e}});Object.defineProperties(K,Et);Object.defineProperty(xt,"isAxiosError",{value:!0});K.from=(e,t,r,o,n,i)=>{let s=Object.create(xt);a.toFlatObject(e,s,function(p){return p!==Error.prototype},d=>d!=="isAxiosError");let c=e&&e.message?e.message:"Error",u=t==null&&e?e.code:t;return K.call(s,c,u,r,o,n),e&&s.cause==null&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};var g=K;var Ee=null;function Be(e){return a.isPlainObject(e)||a.isArray(e)}function Rt(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function vt(e,t,r){return e?e.concat(t).map(function(n,i){return n=Rt(n),!r&&i?"["+n+"]":n}).join(r?".":""):t}function oo(e){return a.isArray(e)&&!e.some(Be)}var no=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function so(e,t,r){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new(Ee||FormData),r=a.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,f){return!a.isUndefined(f[m])});let o=r.metaTokens,n=r.visitor||p,i=r.dots,s=r.indexes,u=(r.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(n))throw new TypeError("visitor must be a function");function d(l){if(l===null)return"";if(a.isDate(l))return l.toISOString();if(a.isBoolean(l))return l.toString();if(!u&&a.isBlob(l))throw new g("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(l)||a.isTypedArray(l)?u&&typeof Blob=="function"?new Blob([l]):Buffer.from(l):l}function p(l,m,f){let x=l;if(l&&!f&&typeof l=="object"){if(a.endsWith(m,"{}"))m=o?m:m.slice(0,-2),l=JSON.stringify(l);else if(a.isArray(l)&&oo(l)||(a.isFileList(l)||a.endsWith(m,"[]"))&&(x=a.toArray(l)))return m=Rt(m),x.forEach(function(E,T){!(a.isUndefined(E)||E===null)&&t.append(s===!0?vt([m],T,i):s===null?m:m+"[]",d(E))}),!1}return Be(l)?!0:(t.append(vt(f,m,i),d(l)),!1)}let h=[],y=Object.assign(no,{defaultVisitor:p,convertValue:d,isVisitable:Be});function S(l,m){if(!a.isUndefined(l)){if(h.indexOf(l)!==-1)throw Error("Circular reference detected in "+m.join("."));h.push(l),a.forEach(l,function(x,v){(!(a.isUndefined(x)||x===null)&&n.call(t,x,a.isString(v)?v.trim():v,m,y))===!0&&S(x,m?m.concat(v):[v])}),h.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return S(e),t}var q=so;function wt(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(o){return t[o]})}function At(e,t){this._pairs=[],e&&q(e,this,t)}var St=At.prototype;St.append=function(t,r){this._pairs.push([t,r])};St.toString=function(t){let r=t?function(o){return t.call(this,o,wt)}:wt;return this._pairs.map(function(n){return r(n[0])+"="+r(n[1])},"").join("&")};var ve=At;function io(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function se(e,t,r){if(!t)return e;let o=r&&r.encode||io;a.isFunction(r)&&(r={serialize:r});let n=r&&r.serialize,i;if(n?i=n(t,r):i=a.isURLSearchParams(t)?t.toString():new ve(t,r).toString(o),i){let s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}var Me=class{constructor(){this.handlers=[]}use(t,r,o){return this.handlers.push({fulfilled:t,rejected:r,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(o){o!==null&&t(o)})}},ke=Me;var Re={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Tt=typeof URLSearchParams<"u"?URLSearchParams:ve;var Lt=typeof FormData<"u"?FormData:null;var Ct=typeof Blob<"u"?Blob:null;var Ot={isBrowser:!0,classes:{URLSearchParams:Tt,FormData:Lt,Blob:Ct},protocols:["http","https","file","blob","url","data"]};var He={};yr(He,{hasBrowserEnv:()=>Ie,hasStandardBrowserEnv:()=>ao,hasStandardBrowserWebWorkerEnv:()=>co,navigator:()=>Ne,origin:()=>lo});var Ie=typeof window<"u"&&typeof document<"u",Ne=typeof navigator=="object"&&navigator||void 0,ao=Ie&&(!Ne||["ReactNative","NativeScript","NS"].indexOf(Ne.product)<0),co=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",lo=Ie&&window.location.href||"http://localhost";var R={...He,...Ot};function We(e,t){return q(e,new R.classes.URLSearchParams,{visitor:function(r,o,n,i){return R.isNode&&a.isBuffer(r)?(this.append(o,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function uo(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function po(e){let t={},r=Object.keys(e),o,n=r.length,i;for(o=0;o<n;o++)i=r[o],t[i]=e[i];return t}function fo(e){function t(r,o,n,i){let s=r[i++];if(s==="__proto__")return!0;let c=Number.isFinite(+s),u=i>=r.length;return s=!s&&a.isArray(n)?n.length:s,u?(a.hasOwnProp(n,s)?n[s]=[n[s],o]:n[s]=o,!c):((!n[s]||!a.isObject(n[s]))&&(n[s]=[]),t(r,o,n[s],i)&&a.isArray(n[s])&&(n[s]=po(n[s])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){let r={};return a.forEachEntry(e,(o,n)=>{t(uo(o),n,r,0)}),r}return null}var we=fo;function mo(e,t,r){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(o){if(o.name!=="SyntaxError")throw o}return(r||JSON.stringify)(e)}var qe={transitional:Re,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let o=r.getContentType()||"",n=o.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return n?JSON.stringify(we(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(o.indexOf("application/x-www-form-urlencoded")>-1)return We(t,this.formSerializer).toString();if((c=a.isFileList(t))||o.indexOf("multipart/form-data")>-1){let u=this.env&&this.env.FormData;return q(c?{"files[]":t}:t,u&&new u,this.formSerializer)}}return i||n?(r.setContentType("application/json",!1),mo(t)):t}],transformResponse:[function(t){let r=this.transitional||qe.transitional,o=r&&r.forcedJSONParsing,n=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(o&&!this.responseType||n)){let s=!(r&&r.silentJSONParsing)&&n;try{return JSON.parse(t,this.parseReviver)}catch(c){if(s)throw c.name==="SyntaxError"?g.from(c,g.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:R.classes.FormData,Blob:R.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{qe.headers[e]={}});var X=qe;var ho=a.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"]),_t=e=>{let t={},r,o,n;return e&&e.split(`
2
+ `).forEach(function(s){n=s.indexOf(":"),r=s.substring(0,n).trim().toLowerCase(),o=s.substring(n+1).trim(),!(!r||t[r]&&ho[r])&&(r==="set-cookie"?t[r]?t[r].push(o):t[r]=[o]:t[r]=t[r]?t[r]+", "+o:o)}),t};var Pt=Symbol("internals");function ie(e){return e&&String(e).trim().toLowerCase()}function Ae(e){return e===!1||e==null?e:a.isArray(e)?e.map(Ae):String(e)}function go(e){let t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,o;for(;o=r.exec(e);)t[o[1]]=o[2];return t}var yo=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function je(e,t,r,o,n){if(a.isFunction(o))return o.call(this,t,r);if(n&&(t=r),!!a.isString(t)){if(a.isString(o))return t.indexOf(o)!==-1;if(a.isRegExp(o))return o.test(t)}}function bo(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,o)=>r.toUpperCase()+o)}function xo(e,t){let r=a.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+r,{value:function(n,i,s){return this[o].call(this,t,n,i,s)},configurable:!0})})}var Q=class{constructor(t){t&&this.set(t)}set(t,r,o){let n=this;function i(c,u,d){let p=ie(u);if(!p)throw new Error("header name must be a non-empty string");let h=a.findKey(n,p);(!h||n[h]===void 0||d===!0||d===void 0&&n[h]!==!1)&&(n[h||u]=Ae(c))}let s=(c,u)=>a.forEach(c,(d,p)=>i(d,p,u));if(a.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(a.isString(t)&&(t=t.trim())&&!yo(t))s(_t(t),r);else if(a.isObject(t)&&a.isIterable(t)){let c={},u,d;for(let p of t){if(!a.isArray(p))throw TypeError("Object iterator must return a key-value pair");c[d=p[0]]=(u=c[d])?a.isArray(u)?[...u,p[1]]:[u,p[1]]:p[1]}s(c,r)}else t!=null&&i(r,t,o);return this}get(t,r){if(t=ie(t),t){let o=a.findKey(this,t);if(o){let n=this[o];if(!r)return n;if(r===!0)return go(n);if(a.isFunction(r))return r.call(this,n,o);if(a.isRegExp(r))return r.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=ie(t),t){let o=a.findKey(this,t);return!!(o&&this[o]!==void 0&&(!r||je(this,this[o],o,r)))}return!1}delete(t,r){let o=this,n=!1;function i(s){if(s=ie(s),s){let c=a.findKey(o,s);c&&(!r||je(o,o[c],c,r))&&(delete o[c],n=!0)}}return a.isArray(t)?t.forEach(i):i(t),n}clear(t){let r=Object.keys(this),o=r.length,n=!1;for(;o--;){let i=r[o];(!t||je(this,this[i],i,t,!0))&&(delete this[i],n=!0)}return n}normalize(t){let r=this,o={};return a.forEach(this,(n,i)=>{let s=a.findKey(o,i);if(s){r[s]=Ae(n),delete r[i];return}let c=t?bo(i):String(i).trim();c!==i&&delete r[i],r[c]=Ae(n),o[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let r=Object.create(null);return a.forEach(this,(o,n)=>{o!=null&&o!==!1&&(r[n]=t&&a.isArray(o)?o.join(", "):o)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
3
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){let o=new this(t);return r.forEach(n=>o.set(n)),o}static accessor(t){let o=(this[Pt]=this[Pt]={accessors:{}}).accessors,n=this.prototype;function i(s){let c=ie(s);o[c]||(xo(n,s),o[c]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}};Q.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(Q.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(o){this[r]=o}}});a.freezeMethods(Q);var A=Q;function ae(e,t){let r=this||X,o=t||r,n=A.from(o.headers),i=o.data;return a.forEach(e,function(c){i=c.call(r,i,n.normalize(),t?t.status:void 0)}),n.normalize(),i}function ce(e){return!!(e&&e.__CANCEL__)}function Dt(e,t,r){g.call(this,e??"canceled",g.ERR_CANCELED,t,r),this.name="CanceledError"}a.inherits(Dt,g,{__CANCEL__:!0});var M=Dt;function le(e,t,r){let o=r.config.validateStatus;!r.status||!o||o(r.status)?e(r):t(new g("Request failed with status code "+r.status,[g.ERR_BAD_REQUEST,g.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function ze(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Eo(e,t){e=e||10;let r=new Array(e),o=new Array(e),n=0,i=0,s;return t=t!==void 0?t:1e3,function(u){let d=Date.now(),p=o[i];s||(s=d),r[n]=u,o[n]=d;let h=i,y=0;for(;h!==n;)y+=r[h++],h=h%e;if(n=(n+1)%e,n===i&&(i=(i+1)%e),d-s<t)return;let S=p&&d-p;return S?Math.round(y*1e3/S):void 0}}var Ut=Eo;function vo(e,t){let r=0,o=1e3/t,n,i,s=(d,p=Date.now())=>{r=p,n=null,i&&(clearTimeout(i),i=null),e(...d)};return[(...d)=>{let p=Date.now(),h=p-r;h>=o?s(d,p):(n=d,i||(i=setTimeout(()=>{i=null,s(n)},o-h)))},()=>n&&s(n)]}var Ft=vo;var Y=(e,t,r=3)=>{let o=0,n=Ut(50,250);return Ft(i=>{let s=i.loaded,c=i.lengthComputable?i.total:void 0,u=s-o,d=n(u),p=s<=c;o=s;let h={loaded:s,total:c,progress:c?s/c:void 0,bytes:u,rate:d||void 0,estimated:d&&c&&p?(c-s)/d:void 0,event:i,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(h)},r)},$e=(e,t)=>{let r=e!=null;return[o=>t[0]({lengthComputable:r,total:e,loaded:o}),t[1]]},Ge=e=>(...t)=>a.asap(()=>e(...t));var Bt=R.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,R.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(R.origin),R.navigator&&/(msie|trident)/i.test(R.navigator.userAgent)):()=>!0;var Mt=R.hasStandardBrowserEnv?{write(e,t,r,o,n,i,s){if(typeof document>"u")return;let c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(r)&&c.push(`expires=${new Date(r).toUTCString()}`),a.isString(o)&&c.push(`path=${o}`),a.isString(n)&&c.push(`domain=${n}`),i===!0&&c.push("secure"),a.isString(s)&&c.push(`SameSite=${s}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;let t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Ve(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Je(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ue(e,t,r){let o=!Ve(t);return e&&(o||r==!1)?Je(e,t):t}var kt=e=>e instanceof A?{...e}:e;function U(e,t){t=t||{};let r={};function o(d,p,h,y){return a.isPlainObject(d)&&a.isPlainObject(p)?a.merge.call({caseless:y},d,p):a.isPlainObject(p)?a.merge({},p):a.isArray(p)?p.slice():p}function n(d,p,h,y){if(a.isUndefined(p)){if(!a.isUndefined(d))return o(void 0,d,h,y)}else return o(d,p,h,y)}function i(d,p){if(!a.isUndefined(p))return o(void 0,p)}function s(d,p){if(a.isUndefined(p)){if(!a.isUndefined(d))return o(void 0,d)}else return o(void 0,p)}function c(d,p,h){if(h in t)return o(d,p);if(h in e)return o(void 0,d)}let u={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:c,headers:(d,p,h)=>n(kt(d),kt(p),h,!0)};return a.forEach(Object.keys({...e,...t}),function(p){let h=u[p]||n,y=h(e[p],t[p],p);a.isUndefined(y)&&h!==c||(r[p]=y)}),r}var Se=e=>{let t=U({},e),{data:r,withXSRFToken:o,xsrfHeaderName:n,xsrfCookieName:i,headers:s,auth:c}=t;if(t.headers=s=A.from(s),t.url=se(ue(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(r)){if(R.hasStandardBrowserEnv||R.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(a.isFunction(r.getHeaders)){let u=r.getHeaders(),d=["content-type","content-length"];Object.entries(u).forEach(([p,h])=>{d.includes(p.toLowerCase())&&s.set(p,h)})}}if(R.hasStandardBrowserEnv&&(o&&a.isFunction(o)&&(o=o(t)),o||o!==!1&&Bt(t.url))){let u=n&&i&&Mt.read(i);u&&s.set(n,u)}return t};var Ro=typeof XMLHttpRequest<"u",Nt=Ro&&function(e){return new Promise(function(r,o){let n=Se(e),i=n.data,s=A.from(n.headers).normalize(),{responseType:c,onUploadProgress:u,onDownloadProgress:d}=n,p,h,y,S,l;function m(){S&&S(),l&&l(),n.cancelToken&&n.cancelToken.unsubscribe(p),n.signal&&n.signal.removeEventListener("abort",p)}let f=new XMLHttpRequest;f.open(n.method.toUpperCase(),n.url,!0),f.timeout=n.timeout;function x(){if(!f)return;let E=A.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),O={data:!c||c==="text"||c==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:E,config:e,request:f};le(function(L){r(L),m()},function(L){o(L),m()},O),f=null}"onloadend"in f?f.onloadend=x:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(x)},f.onabort=function(){f&&(o(new g("Request aborted",g.ECONNABORTED,e,f)),f=null)},f.onerror=function(T){let O=T&&T.message?T.message:"Network Error",I=new g(O,g.ERR_NETWORK,e,f);I.event=T||null,o(I),f=null},f.ontimeout=function(){let T=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded",O=n.transitional||Re;n.timeoutErrorMessage&&(T=n.timeoutErrorMessage),o(new g(T,O.clarifyTimeoutError?g.ETIMEDOUT:g.ECONNABORTED,e,f)),f=null},i===void 0&&s.setContentType(null),"setRequestHeader"in f&&a.forEach(s.toJSON(),function(T,O){f.setRequestHeader(O,T)}),a.isUndefined(n.withCredentials)||(f.withCredentials=!!n.withCredentials),c&&c!=="json"&&(f.responseType=n.responseType),d&&([y,l]=Y(d,!0),f.addEventListener("progress",y)),u&&f.upload&&([h,S]=Y(u),f.upload.addEventListener("progress",h),f.upload.addEventListener("loadend",S)),(n.cancelToken||n.signal)&&(p=E=>{f&&(o(!E||E.type?new M(null,e,f):E),f.abort(),f=null)},n.cancelToken&&n.cancelToken.subscribe(p),n.signal&&(n.signal.aborted?p():n.signal.addEventListener("abort",p)));let v=ze(n.url);if(v&&R.protocols.indexOf(v)===-1){o(new g("Unsupported protocol "+v+":",g.ERR_BAD_REQUEST,e));return}f.send(i||null)})};var wo=(e,t)=>{let{length:r}=e=e?e.filter(Boolean):[];if(t||r){let o=new AbortController,n,i=function(d){if(!n){n=!0,c();let p=d instanceof Error?d:this.reason;o.abort(p instanceof g?p:new M(p instanceof Error?p.message:p))}},s=t&&setTimeout(()=>{s=null,i(new g(`timeout ${t} of ms exceeded`,g.ETIMEDOUT))},t),c=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),e=null)};e.forEach(d=>d.addEventListener("abort",i));let{signal:u}=o;return u.unsubscribe=()=>a.asap(c),u}},It=wo;var Ao=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let o=0,n;for(;o<r;)n=o+t,yield e.slice(o,n),o=n},So=async function*(e,t){for await(let r of To(e))yield*Ao(r,t)},To=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:r,value:o}=await t.read();if(r)break;yield o}}finally{await t.cancel()}},Ke=(e,t,r,o)=>{let n=So(e,t),i=0,s,c=u=>{s||(s=!0,o&&o(u))};return new ReadableStream({async pull(u){try{let{done:d,value:p}=await n.next();if(d){c(),u.close();return}let h=p.byteLength;if(r){let y=i+=h;r(y)}u.enqueue(new Uint8Array(p))}catch(d){throw c(d),d}},cancel(u){return c(u),n.return()}},{highWaterMark:2})};var Ht=64*1024,{isFunction:Te}=a,Lo=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:Wt,TextEncoder:qt}=a.global,jt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Co=e=>{e=a.merge.call({skipUndefined:!0},Lo,e);let{fetch:t,Request:r,Response:o}=e,n=t?Te(t):typeof fetch=="function",i=Te(r),s=Te(o);if(!n)return!1;let c=n&&Te(Wt),u=n&&(typeof qt=="function"?(l=>m=>l.encode(m))(new qt):async l=>new Uint8Array(await new r(l).arrayBuffer())),d=i&&c&&jt(()=>{let l=!1,m=new r(R.origin,{body:new Wt,method:"POST",get duplex(){return l=!0,"half"}}).headers.has("Content-Type");return l&&!m}),p=s&&c&&jt(()=>a.isReadableStream(new o("").body)),h={stream:p&&(l=>l.body)};n&&["text","arrayBuffer","blob","formData","stream"].forEach(l=>{!h[l]&&(h[l]=(m,f)=>{let x=m&&m[l];if(x)return x.call(m);throw new g(`Response type '${l}' is not supported`,g.ERR_NOT_SUPPORT,f)})});let y=async l=>{if(l==null)return 0;if(a.isBlob(l))return l.size;if(a.isSpecCompliantForm(l))return(await new r(R.origin,{method:"POST",body:l}).arrayBuffer()).byteLength;if(a.isArrayBufferView(l)||a.isArrayBuffer(l))return l.byteLength;if(a.isURLSearchParams(l)&&(l=l+""),a.isString(l))return(await u(l)).byteLength},S=async(l,m)=>{let f=a.toFiniteNumber(l.getContentLength());return f??y(m)};return async l=>{let{url:m,method:f,data:x,signal:v,cancelToken:E,timeout:T,onDownloadProgress:O,onUploadProgress:I,responseType:L,headers:_,withCredentials:F="same-origin",fetchOptions:fe}=Se(l),it=t||fetch;L=L?(L+"").toLowerCase():"text";let me=It([v,E&&E.toAbortSignal()],T),ee=null,j=me&&me.unsubscribe&&(()=>{me.unsubscribe()}),at;try{if(I&&d&&f!=="get"&&f!=="head"&&(at=await S(_,x))!==0){let W=new r(m,{method:"POST",body:x,duplex:"half"}),G;if(a.isFormData(x)&&(G=W.headers.get("content-type"))&&_.setContentType(G),W.body){let[De,he]=$e(at,Y(Ge(I)));x=Ke(W.body,Ht,De,he)}}a.isString(F)||(F=F?"include":"omit");let B=i&&"credentials"in r.prototype,ct={...fe,signal:me,method:f.toUpperCase(),headers:_.normalize().toJSON(),body:x,duplex:"half",credentials:B?F:void 0};ee=i&&new r(m,ct);let H=await(i?it(ee,fe):it(m,ct)),lt=p&&(L==="stream"||L==="response");if(p&&(O||lt&&j)){let W={};["status","statusText","headers"].forEach(ut=>{W[ut]=H[ut]});let G=a.toFiniteNumber(H.headers.get("content-length")),[De,he]=O&&$e(G,Y(Ge(O),!0))||[];H=new o(Ke(H.body,Ht,De,()=>{he&&he(),j&&j()}),W)}L=L||"text";let hr=await h[a.findKey(h,L)||"text"](H,l);return!lt&&j&&j(),await new Promise((W,G)=>{le(W,G,{data:hr,headers:A.from(H.headers),status:H.status,statusText:H.statusText,config:l,request:ee})})}catch(B){throw j&&j(),B&&B.name==="TypeError"&&/Load failed|fetch/i.test(B.message)?Object.assign(new g("Network Error",g.ERR_NETWORK,l,ee),{cause:B.cause||B}):g.from(B,B&&B.code,l,ee)}}},Oo=new Map,Xe=e=>{let t=e&&e.env||{},{fetch:r,Request:o,Response:n}=t,i=[o,n,r],s=i.length,c=s,u,d,p=Oo;for(;c--;)u=i[c],d=p.get(u),d===void 0&&p.set(u,d=c?new Map:Co(t)),p=d;return d},Qs=Xe();var Qe={http:Ee,xhr:Nt,fetch:{get:Xe}};a.forEach(Qe,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var zt=e=>`- ${e}`,Po=e=>a.isFunction(e)||e===null||e===!1;function Do(e,t){e=a.isArray(e)?e:[e];let{length:r}=e,o,n,i={};for(let s=0;s<r;s++){o=e[s];let c;if(n=o,!Po(o)&&(n=Qe[(c=String(o)).toLowerCase()],n===void 0))throw new g(`Unknown adapter '${c}'`);if(n&&(a.isFunction(n)||(n=n.get(t))))break;i[c||"#"+s]=n}if(!n){let s=Object.entries(i).map(([u,d])=>`adapter ${u} `+(d===!1?"is not supported by the environment":"is not available in the build")),c=r?s.length>1?`since :
4
+ `+s.map(zt).join(`
5
+ `):" "+zt(s[0]):"as no adapter specified";throw new g("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return n}var Le={getAdapter:Do,adapters:Qe};function Ye(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new M(null,e)}function Ce(e){return Ye(e),e.headers=A.from(e.headers),e.data=ae.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Le.getAdapter(e.adapter||X.adapter,e)(e).then(function(o){return Ye(e),o.data=ae.call(e,e.transformResponse,o),o.headers=A.from(o.headers),o},function(o){return ce(o)||(Ye(e),o&&o.response&&(o.response.data=ae.call(e,e.transformResponse,o.response),o.response.headers=A.from(o.response.headers))),Promise.reject(o)})}var Oe="1.13.2";var _e={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{_e[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});var $t={};_e.transitional=function(t,r,o){function n(i,s){return"[Axios v"+Oe+"] Transitional option '"+i+"'"+s+(o?". "+o:"")}return(i,s,c)=>{if(t===!1)throw new g(n(s," has been removed"+(r?" in "+r:"")),g.ERR_DEPRECATED);return r&&!$t[s]&&($t[s]=!0,console.warn(n(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,s,c):!0}};_e.spelling=function(t){return(r,o)=>(console.warn(`${o} is likely a misspelling of ${t}`),!0)};function Uo(e,t,r){if(typeof e!="object")throw new g("options must be an object",g.ERR_BAD_OPTION_VALUE);let o=Object.keys(e),n=o.length;for(;n-- >0;){let i=o[n],s=t[i];if(s){let c=e[i],u=c===void 0||s(c,i,e);if(u!==!0)throw new g("option "+i+" must be "+u,g.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new g("Unknown option "+i,g.ERR_BAD_OPTION)}}var pe={assertOptions:Uo,validators:_e};var k=pe.validators,Z=class{constructor(t){this.defaults=t||{},this.interceptors={request:new ke,response:new ke}}async request(t,r){try{return await this._request(t,r)}catch(o){if(o instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;let i=n.stack?n.stack.replace(/^.+\n/,""):"";try{o.stack?i&&!String(o.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(o.stack+=`
6
+ `+i):o.stack=i}catch{}}throw o}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=U(this.defaults,r);let{transitional:o,paramsSerializer:n,headers:i}=r;o!==void 0&&pe.assertOptions(o,{silentJSONParsing:k.transitional(k.boolean),forcedJSONParsing:k.transitional(k.boolean),clarifyTimeoutError:k.transitional(k.boolean)},!1),n!=null&&(a.isFunction(n)?r.paramsSerializer={serialize:n}:pe.assertOptions(n,{encode:k.function,serialize:k.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),pe.assertOptions(r,{baseUrl:k.spelling("baseURL"),withXsrfToken:k.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&a.merge(i.common,i[r.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],l=>{delete i[l]}),r.headers=A.concat(s,i);let c=[],u=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(r)===!1||(u=u&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});let d=[];this.interceptors.response.forEach(function(m){d.push(m.fulfilled,m.rejected)});let p,h=0,y;if(!u){let l=[Ce.bind(this),void 0];for(l.unshift(...c),l.push(...d),y=l.length,p=Promise.resolve(r);h<y;)p=p.then(l[h++],l[h++]);return p}y=c.length;let S=r;for(;h<y;){let l=c[h++],m=c[h++];try{S=l(S)}catch(f){m.call(this,f);break}}try{p=Ce.call(this,S)}catch(l){return Promise.reject(l)}for(h=0,y=d.length;h<y;)p=p.then(d[h++],d[h++]);return p}getUri(t){t=U(this.defaults,t);let r=ue(t.baseURL,t.url,t.allowAbsoluteUrls);return se(r,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){Z.prototype[t]=function(r,o){return this.request(U(o||{},{method:t,url:r,data:(o||{}).data}))}});a.forEach(["post","put","patch"],function(t){function r(o){return function(i,s,c){return this.request(U(c||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}Z.prototype[t]=r(),Z.prototype[t+"Form"]=r(!0)});var de=Z;var Ze=class e{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});let o=this;this.promise.then(n=>{if(!o._listeners)return;let i=o._listeners.length;for(;i-- >0;)o._listeners[i](n);o._listeners=null}),this.promise.then=n=>{let i,s=new Promise(c=>{o.subscribe(c),i=c}).then(n);return s.cancel=function(){o.unsubscribe(i)},s},t(function(i,s,c){o.reason||(o.reason=new M(i,s,c),r(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){let t=new AbortController,r=o=>{t.abort(o)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new e(function(n){t=n}),cancel:t}}},Gt=Ze;function et(e){return function(r){return e.apply(null,r)}}function tt(e){return a.isObject(e)&&e.isAxiosError===!0}var rt={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(rt).forEach(([e,t])=>{rt[t]=e});var Vt=rt;function Jt(e){let t=new de(e),r=te(de.prototype.request,t);return a.extend(r,de.prototype,t,{allOwnKeys:!0}),a.extend(r,t,null,{allOwnKeys:!0}),r.create=function(n){return Jt(U(e,n))},r}var w=Jt(X);w.Axios=de;w.CanceledError=M;w.CancelToken=Gt;w.isCancel=ce;w.VERSION=Oe;w.toFormData=q;w.AxiosError=g;w.Cancel=w.CanceledError;w.all=function(t){return Promise.all(t)};w.spread=et;w.isAxiosError=tt;w.mergeConfig=U;w.AxiosHeaders=A;w.formToJSON=e=>we(a.isHTMLForm(e)?new FormData(e):e);w.getAdapter=Le.getAdapter;w.HttpStatusCode=Vt;w.default=w;var Pe=w;var{Axios:Ji,AxiosError:Ki,CanceledError:Xi,isCancel:Qi,CancelToken:Yi,VERSION:Zi,all:ea,Cancel:ta,isAxiosError:ra,spread:oa,toFormData:na,AxiosHeaders:sa,HttpStatusCode:ia,formToJSON:aa,getAdapter:ca,mergeConfig:la}=Pe;var Fo=localStorage.getItem("api-mode"),Bo="http://127.0.0.1:8787",Mo="https://assembled-brands-dev.crystal-e8a.workers.dev",N={apiBaseUrl:Fo==="local"?Bo:Mo,apiVersion:"/api/v1",accessTokenPersistStrategy:"cookie",TOKEN_NAME_IN_STORAGE:"accessToken",TOKEN_TYPE:"Bearer",REQUEST_HEADER_AUTH_KEY:"Authorization"},$=e=>{if(!e){console.error("navigateToPath: path is empty or undefined");return}let t=e.replace(/^\/+/,""),r=t;r=`dev/${t}`;let o=`${window.location.origin}/${r}`;window.location.assign(o)};var ko=(e,t,r)=>{let o=new Date;o.setTime(o.getTime()+r*24*60*60*1e3);let n="expires="+o.toUTCString();document.cookie=`${e}=${encodeURIComponent(t)}; ${n}; path=/`},ot=e=>{let t=document.cookie.split("; ");for(let r of t){let[o,n]=r.split("=");if(o===e)return decodeURIComponent(n)}return null},nt=e=>{ko(e,"",-1)},Kt=()=>{let e=ot("accessToken");return e||$("/login?error=unauthorized"),e},Xt=()=>{nt("accessToken"),localStorage.removeItem("x-team-id"),$("/login?error=logged-out")},No=()=>{let e=localStorage.getItem("user"),t=e&&JSON.parse(e);return t&&t?.role},Qt=()=>No()==="admin";var Io=e=>{let t=N.accessTokenPersistStrategy;if(t==="localStorage"||t==="sessionStorage"||t==="cookie"){let o="";t==="localStorage"&&(o=localStorage.getItem(N.TOKEN_NAME_IN_STORAGE)||""),t==="sessionStorage"&&(o=sessionStorage.getItem(N.TOKEN_NAME_IN_STORAGE)||""),t==="cookie"&&(o=ot(N.TOKEN_NAME_IN_STORAGE)||""),o&&(e.headers[N.REQUEST_HEADER_AUTH_KEY]=`${N.TOKEN_TYPE} ${o}`)}let r=localStorage.getItem("x-team-id");return r&&(e.headers["X-Team-Id"]=r),e},Yt=Io;var Ho=[401,419,440],Wo=e=>{let{response:t}=e;if(window.location.pathname.includes("/login"))return Promise.reject(e);t&&Ho.includes(t.status)&&(nt("accessToken"),$("/login?error=unauthorized"))},Zt=Wo;var st=Pe.create({timeout:6e4,baseURL:N.apiBaseUrl+N.apiVersion});st.interceptors.request.use(e=>Yt(e),e=>Promise.reject(e));st.interceptors.response.use(e=>e,e=>(Zt(e),Promise.reject(e)));var er=st;var qo={fetchDataWithAxios(e){return new Promise((t,r)=>{er(e).then(o=>{t(o.data)}).catch(o=>{let n="An unknown error occurred";if(o.response&&o.response.data){let i=o.response.data;typeof i.message=="string"?n=i.message:typeof i.error=="string"?n=i.error:n=JSON.stringify(i)}else o.message&&(n=o.message);r({...o,message:n})})})}},P=qo;var tr=e=>P.fetchDataWithAxios({url:"/asset",method:"post",data:e});var rr=e=>P.fetchDataWithAxios({url:"/financial-wizard/document",method:"post",data:e}),or=e=>P.fetchDataWithAxios({url:"/financial-wizard/progress",method:"get",params:e?{user_id:e}:void 0});var nr=()=>P.fetchDataWithAxios({url:"/financial-wizard/applications",method:"get"});async function sr(){return P.fetchDataWithAxios({url:"/user/me",method:"get"})}var ir=()=>P.fetchDataWithAxios({url:"/onboarding-wizard/progress",method:"get"});var ar=()=>P.fetchDataWithAxios({url:"/team/my-teams",method:"get"});var b=(e,t=document)=>t.querySelector(e),cr=(e,t=document)=>{let r=t.querySelectorAll(e);return[...Array.from(r)]};var jo={"/dev/finance-company-profile":{nav_attr:"nav-company-profile-link",nav_class:"is-active"},"/finance-company-profile":{nav_attr:"nav-company-profile-link",nav_class:"is-active"},"/dev/finance-financial-overview":{nav_attr:"nav-financial-overview-link",nav_class:"is-active"},"/finance-financial-overview":{nav_attr:"nav-financial-overview-link",nav_class:"is-active"},"/dev/finance-docs-financial-reports":{nav_attr:"nav-financial-reports-link",nav_class:"is-active-financial"},"/finance-docs-financial-reports":{nav_attr:"nav-financial-reports-link",nav_class:"is-active-financial"},"/dev/finance-docs-accounts-and-inventory":{nav_attr:"nav-accounts-inventory-link",nav_class:"is-active-financial"},"/finance-docs-accounts-and-inventory":{nav_attr:"nav-accounts-inventory-link",nav_class:"is-active-financial"},"/dev/finance-docs-ecommerce-performance":{nav_attr:"nav-eccomerce-performance-link",nav_class:"is-active-financial"},"/finance-docs-ecommerce-performance":{nav_attr:"nav-eccomerce-performance-link",nav_class:"is-active-financial"},"/dev/finance-docs-team-and-ownership":{nav_attr:"nav-team-ownership-link",nav_class:"is-active-financial"},"/finance-docs-team-and-ownership":{nav_attr:"nav-team-ownership-link",nav_class:"is-active-financial"},"/invite-team-members":{nav_attr:"nav-team-member-link",nav_class:"is-active-financial"},"/dev/invite-team-members":{nav_attr:"nav-team-member-link",nav_class:"is-active-financial"}};var zo=async e=>{let[t,r,o,n]=await Promise.all([or(e),sr(),ar(),ir()]);return{financialProgress:t,user:r,teams:o,onboardingProgress:n}},lr=async e=>{try{let{financialProgress:t,user:r,teams:o,onboardingProgress:n}=await zo(e),i=t?.percentage||0,s=b('[dev-target="progress-percentage-fill"]'),c=cr('[dev-target="progress-percentage-label"]'),u=b('[dev-target="user-name"]'),d=b('[dev-target="user-email"]'),p=b('[dev-target="logout"]');if(!s||!c||!p||!u||!d){console.error('Ensure [dev-target="progress-percentage-fill"], [dev-target="progress-percentage-label"], [dev-target="user-name"], [dev-target="user-email"], and [dev-target="logout"] are present.');return}return s.style.width=`${i}%`,c[0].textContent=`Progress ${i}%`,c[1].textContent=`${i}%`,p.addEventListener("click",()=>{Xt()}),u.innerText=t.business?.legal_name||(r.first_name||"Full")+" "+(r.last_name||"Name"),d.innerText=t.business?.email||r.email||"hello@company.com",{financialProgress:t,user:r,teams:o,onboardingProgress:n}}catch(t){console.error("Failed to load financial wizard progress:",t)}},ur=()=>{if(!b('[dev-target="sidebar-menu"]')){console.error('Ensure [dev-target="sidebar-menu"] is present.');return}let t=window.location.pathname,r=jo[t],o=document.querySelectorAll('[dev-attr="nav"]');if(r){o.forEach(i=>{i.classList.remove("is-active"),i.classList.remove("is-active-financial")});let n=b(`[dev-target="${r.nav_attr}"]`);n&&n.classList.add(r.nav_class)}else o.forEach(n=>{n.classList.remove("is-active"),n.classList.remove("is-active-financial")})},pr=()=>{let e=b('[dev-target="modal-wrapper"]'),t=b('[dev-target="modal-image"]'),r=b('[dev-target="close-button"]'),o=b('[dev-target="modal-title"]');if(!r){console.error('Ensure [dev-target="close-button"] is present.');return}if(!o){console.error('Ensure [dev-target="modal-title"] is present.');return}if(!e){console.error('Ensure [dev-target="modal-wrapper"] is present.');return}if(!t){console.error('Ensure [dev-target="modal-image"] is present.');return}let{pathname:n}=window.location;r.addEventListener("click",()=>{e.classList.add("hide")});let i={"monthly-balance-sheet":{title:"Monthly Balance Sheets ** Last 2 years of monthly balance sheets",imageUrl:"https://cdn.prod.website-files.com/66624bc26087f29222853df8/6975e8a978e87571b90a51a0_image%204.png"},"monthly-income-statement":{title:"Monthly Income Statements ** Last 2 years of monthly income statements",imageUrl:"https://cdn.prod.website-files.com/66624bc26087f29222853df8/6975e8a978e87571b90a51a0_image%204.png"},"monthly-income-forecast":{title:"Monthly Income Forecast ** 12-month income forecast projection",imageUrl:"https://cdn.prod.website-files.com/66624bc26087f29222853df8/6975e8a978e87571b90a51a0_image%204.png"},"monthly-inventory-reports":{title:"Monthly Inventory Reports ** Please provide inventory reports for at least the last 24 months, or longer if possible",imageUrl:"https://cdn.prod.website-files.com/66624bc26087f29222853df8/6975e8a978e87571b90a51a0_image%204.png"},"ar-aging-reports":{title:"Accounts Receivable Aging Reports ** Please provide AR aging reports for the last 24 months, or longer if available",imageUrl:"https://cdn.prod.website-files.com/66624bc26087f29222853df8/6975e8a978e87571b90a51a0_image%204.png"},"ap-aging-reports":{title:"Accounts Payable Aging Report ** Please provide the accounts payable aging report for the next 24 months, or longer if possible",imageUrl:"https://cdn.prod.website-files.com/66624bc26087f29222853df8/6975e8a978e87571b90a51a0_image%204.png"},"repeat-customer-reports":{title:"Shopify Repeat Customer Reports ** Please provide reports on repeat customers for at least the last 24 months, or longer if possible",imageUrl:"https://cdn.prod.website-files.com/66624bc26087f29222853df8/6975e8a978e87571b90a51a0_image%204.png"},"monthly-sales-reports":{title:"Shopify Monthly Sales Reports ** Please provide monthly sales reports from Shopify for the last 24 months, or longer if available",imageUrl:"https://cdn.prod.website-files.com/66624bc26087f29222853df8/6975e8a978e87571b90a51a0_image%204.png"},"management-bios":{title:"Management Bios ** Please upload the management bios for our team",imageUrl:"https://cdn.prod.website-files.com/66624bc26087f29222853df8/6975e8a978e87571b90a51a0_image%204.png"},"investor-deck":{title:"Investor Deck ** Please provide the most recent investor deck",imageUrl:"https://cdn.prod.website-files.com/66624bc26087f29222853df8/6975e8a978e87571b90a51a0_image%204.png"},"cap-table":{title:"Capitalization Table ** Please provide the most recent capitalization table",imageUrl:"https://cdn.prod.website-files.com/66624bc26087f29222853df8/6975e8a978e87571b90a51a0_image%204.png"}},s=c=>{let u=i[c];e.classList.toggle("hide"),t.src=u.imageUrl,o.textContent=u.title};if(n.includes("/dev/finance-docs-financial-reports")||n.includes("/finance-docs-financial-reports")){let c=b('[dev-target="monthly-balance-sheet"]'),u=b('[dev-target="monthly-income-statement"]'),d=b('[dev-target="monthly-income-forecast"]');c?.addEventListener("click",()=>s("monthly-balance-sheet")),u?.addEventListener("click",()=>s("monthly-income-statement")),d?.addEventListener("click",()=>s("monthly-income-forecast"))}if(n.includes("/dev/finance-docs-accounts-and-inventory")||n.includes("/finance-docs-accounts-and-inventory")){let c=b('[dev-target="monthly-inventory-reports"]'),u=b('[dev-target="ar-aging-reports"]'),d=b('[dev-target="ap-aging-reports"]');c?.addEventListener("click",()=>s("monthly-inventory-reports")),u?.addEventListener("click",()=>s("ar-aging-reports")),d?.addEventListener("click",()=>s("ap-aging-reports"))}if(n.includes("/dev/finance-docs-ecommerce-performance")||n.includes("/finance-docs-ecommerce-performance")){let c=b('[dev-target="repeat-customer-reports"]'),u=b('[dev-target="monthly-sales-reports"]');c?.addEventListener("click",()=>s("repeat-customer-reports")),u?.addEventListener("click",()=>s("monthly-sales-reports"))}if(n.includes("/dev/finance-docs-team-and-ownership")||n.includes("/finance-docs-team-and-ownership")){let c=b('[dev-target="management-bios"]'),u=b('[dev-target="investor-deck"]'),d=b('[dev-target="cap-table"]');c?.addEventListener("click",()=>s("management-bios")),u?.addEventListener("click",()=>s("investor-deck")),d?.addEventListener("click",()=>s("cap-table"))}},dr=async e=>{if(Qt()){let r=b('[dev-target="admin-select-wrapper"]'),o=b('[dev-target="admin-select"]');if(r?.classList.remove("hide"),!r||!o){console.error('Ensure [dev-target="admin-select"] and [dev-target="admin-select-wrapper"] is present.');return}let n=await nr();o.innerHTML="",n.forEach(i=>{let s=i.first_name||""+i.last_name||"",c=document.createElement("option");c.value=i.id.toString(),c.textContent=`${s||i.email}`,o.appendChild(c)}),o.addEventListener("change",async i=>{let s=i.target,{value:c}=s;e&&await e(c)})}},fr=e=>new Promise((t,r)=>{let o=new FileReader;o.onload=()=>{let i=o.result.split(",");t(i.length>1?i[1]:i[0])},o.onerror=()=>r(new Error("Failed to read file as base64")),o.readAsDataURL(e)}),mr=()=>{let e=b('[dev-target="sidebar-menu"]'),t=e?.querySelector(".sidebar"),r=b('[dev-target="collapsible-trigger"]');if(!e||!t||!r){console.error('Ensure [dev-target="sidebar-menu"] and [dev-target="collapsible-trigger"] and [dev-target="sidebar-inner"] are present.');return}let o=!1,n=()=>{o=!o;let i=document.querySelectorAll('[sidebar="collapsible-content"], [dev-target="collapsible-content"]'),s=b('[dev-target="sidebar-logo-text-wrapper"]'),c=e.querySelector('[dev-target="sidebar-bottom-collapsed"]'),u=e.querySelector('[dev-target="sidenav-close"]'),d=e.querySelector('[dev-target="sidebar-bottom"]'),p=e.querySelector(".user-profile_wrapper"),h=p?.querySelector(".flex-horizontal_auth.gap-15");o?(e.classList.add("collapsed"),t?.classList.add("mobile"),s?.classList.add("hide"),p?.classList.add("image-overlay"),h?.classList.add("overlay"),d?.classList.add("hide"),c?.classList.remove("hide"),u?.classList.add("is-collapsed"),i.forEach(y=>{y.style.opacity="0",y.style.transition="opacity 0.2s ease",setTimeout(()=>{y.classList.add("hide")},200)}),e.style.width="80px",e.style.width="auto"):(e.classList.remove("collapsed"),t?.classList.remove("mobile"),s?.classList.remove("hide"),p?.classList.remove("image-overlay"),h?.classList.remove("overlay"),d?.classList.remove("hide"),c?.classList.add("hide"),u?.classList.remove("is-collapsed"),i.forEach(y=>{y.classList.remove("hide"),setTimeout(()=>{y.style.opacity="1"},10)}))};r.addEventListener("click",n),e.style.transition="width 0.3s ease"};var $o=async()=>{ur(),Kt(),mr(),pr();let e=["application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],t=document.querySelector('[dev-target="ecommerce-performance-form"]');if(!t){console.error('E-Commerce Performance form not found. Element: [dev-target="ecommerce-performance-form"] not found');return}let r=b('[dev-target="shopify-repeat-upload-box"]',t),o=b('[dev-target="shopify-repeat-input"]',t),n=b('[dev-target="shopify-repeat-helper"]',t),i=b('[dev-target="shopify-monthly-upload-box"]',t),s=b('[dev-target="shopify-monthly-input"]',t),c=b('[dev-target="shopify-monthly-helper"]',t),u=b('[dev-target="submit-button"]',t);if(!r||!o||!n){console.error('Ensure [dev-target="shopify-repeat-upload-box"] and [dev-target="shopify-repeat-input"] and [dev-target="shopify-repeat-helper"] are present.');return}if(!i||!s||!c){console.error('Ensure [dev-target="shopify-monthly-upload-box"] and [dev-target="shopify-monthly-input"] and [dev-target="shopify-monthly-helper"] are present.');return}if(!u){console.error('Ensure [dev-target="submit-button"] is present.');return}let d=l=>{if(l?.ecommerce_performance){let m=l.ecommerce_performance.find(x=>x.document_type==="shopify_repeat_customers");m?n.textContent=m.asset_name||"Supported formats: sheets. xcel":n.textContent="Supported formats: sheets. xcel";let f=l.ecommerce_performance.find(x=>x.document_type==="shopify_monthly_sales");f?c.textContent=f.asset_name||"Supported formats: sheets. xcel":c.textContent="Supported formats: sheets. xcel"}else n.textContent="Supported formats: sheets. xcel",c.textContent="Supported formats: sheets. xcel"},p,h=async l=>{p=(await lr(l))?.financialProgress,d(p)};await h(),dr(h);let y=(l,m)=>{if(l.files&&l.files.length>0){let f=l.files[0];if(!e.includes(f.type)){l.value="",m.textContent="Invalid file type. Please upload Excel (.xls or .xlsx) files only",m.classList.add("is-error");return}m.textContent=f.name,m.classList.remove("is-error")}else m.textContent="",m.classList.remove("is-error")};r&&o&&n&&(r.addEventListener("click",()=>o.click()),r.addEventListener("dragover",l=>{l.preventDefault(),r.classList.add("drag")}),r.addEventListener("dragleave",()=>{r.classList.remove("drag")}),r.addEventListener("drop",l=>{l.preventDefault(),r.classList.remove("drag"),l.dataTransfer&&l.dataTransfer.files.length>0&&(o.files=l.dataTransfer.files,y(o,n),o.dispatchEvent(new Event("change",{bubbles:!0})))}),o.addEventListener("change",()=>{y(o,n)})),i&&s&&c&&(i.addEventListener("click",()=>s.click()),i.addEventListener("dragover",l=>{l.preventDefault(),i.classList.add("drag")}),i.addEventListener("dragleave",()=>{i.classList.remove("drag")}),i.addEventListener("drop",l=>{l.preventDefault(),i.classList.remove("drag"),l.dataTransfer&&l.dataTransfer.files.length>0&&(s.files=l.dataTransfer.files,y(s,c),s.dispatchEvent(new Event("change",{bubbles:!0})))}),s.addEventListener("change",()=>{y(s,c)}));let S=async(l,m)=>{if(!e.includes(l.type))throw new Error("Invalid file type. Please upload Excel (.xls or .xlsx) files only");let f={fileName:l.name,contentType:l.type,assetType:"document",fileSize:l.size,duration:0},x=await tr(f),v=x.asset.id,{presignedUrl:E}=x;if(!E)throw new Error("Presigned URL not received from server");await new Promise((I,L)=>{let _=new XMLHttpRequest;_.upload.addEventListener("progress",F=>{if(F.lengthComputable){let fe=Math.round(F.loaded/F.total*100);console.log(`Upload progress: ${fe}%`)}}),_.addEventListener("load",()=>{_.status>=200&&_.status<300?I():L(new Error("Failed to upload file to S3"))}),_.addEventListener("error",F=>{console.error(F),L(new Error("Network error during upload"))}),_.open("PUT",E),_.setRequestHeader("Content-Type",l.type),_.send(l)});let T=await fr(l),O={page:"ecommerce-performance",document_type:m,asset_id:v,file_data:T,file_name:l.name,file_mime_type:l.type};await rr(O)};t.addEventListener("submit",async l=>{l.preventDefault(),l.stopPropagation();let m=()=>{r?.classList.remove("is-error"),i?.classList.remove("is-error"),n?.classList.remove("is-error"),c?.classList.remove("is-error"),u.classList.remove("is-error"),u.value="UPLOAD DOCUMENTS"};o?.addEventListener("change",m,{once:!0}),s?.addEventListener("change",m,{once:!0});let f=[];if(o?.files&&o.files[0]){let v=o.files[0];e.includes(v.type)?f.push({file:v,documentType:"shopify_repeat_customers"}):n?.classList.add("is-error")}if(s?.files&&s.files[0]){let v=s.files[0];e.includes(v.type)?f.push({file:v,documentType:"shopify_monthly_sales"}):c?.classList.add("is-error")}if(o?.files&&o.files[0]&&!e.includes(o.files[0].type)||s?.files&&s.files[0]&&!e.includes(s.files[0].type)){u.classList.add("is-error"),u.value="Please upload only Excel (.xls or .xlsx) files";return}if(f.length===0){u.classList.add("is-error"),u.value="Please select at least one file to upload";return}try{u.disabled=!0,u.value="Uploading...",await Promise.all(f.map(({file:v,documentType:E})=>S(v,E))),u.classList.add("is-success"),u.value="Documents uploaded successfully!",o&&(o.value=""),s&&(s.value=""),n&&(n.textContent="",n.classList.remove("is-error")),c&&(c.textContent="",c.classList.remove("is-error")),setTimeout(()=>{u.classList.remove("is-success"),u.value="UPLOAD DOCUMENTS",u.disabled=!1,$("/finance-docs-team-and-ownership")},900)}catch(v){let{message:E}=v;console.error(E),u.classList.add("is-error"),u.value=E||"There was a problem uploading the documents",u.disabled=!1}})};window.Webflow||(window.Webflow=[]);window.Webflow.push(()=>{try{$o()}catch(e){console.error(e)}});