kryptos-connect-dynamic-sdk 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,12 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(npm run build:cdn:*)",
5
+ "Bash(while read file)",
6
+ "Bash(do if ! grep -q \"^import React\" \"$file\")",
7
+ "Bash(then echo \"$file\")",
8
+ "Bash(fi)",
9
+ "Bash(done)"
10
+ ]
11
+ }
12
+ }
@@ -1,14 +1,6 @@
1
- (function(I,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],b):(I=typeof globalThis<"u"?globalThis:I||self,b(I.__KRYPTOS_SDK__={},I.React))})(this,function(I,b){"use strict";var ve={exports:{}},ne={};/**
2
- * @license React
3
- * react-jsx-runtime.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var vt=b,Bt=Symbol.for("react.element"),Ft=Symbol.for("react.fragment"),Dt=Object.prototype.hasOwnProperty,Mt=vt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,$t={key:!0,ref:!0,__self:!0,__source:!0};function Be(e,t,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)Dt.call(t,r)&&!$t.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:Bt,type:e,key:i,ref:o,props:s,_owner:Mt.current}}ne.Fragment=Ft,ne.jsx=Be,ne.jsxs=Be,ve.exports=ne;var f=ve.exports;const Fe=b.createContext(void 0);function Ht({config:e,children:t}){const r=`kryptos-theme-${e.theme||"light"}`,[s,i]=b.useState(!1),[o,c]=b.useState(!1),[p,l]=b.useState(""),[u,y]=b.useState(null),[g,E]=b.useState(""),[d,h]=b.useState(null),[m,x]=b.useState(null);return f.jsx(Fe.Provider,{value:{...e,isInitialized:s,setIsInitialized:i,linkToken:p,setLinkToken:l,user:u,setUser:y,email:g,setEmail:E,userConsent:d,setUserConsent:h,clientInfo:m,isAuthorized:o,setIsAuthorized:c},children:f.jsx("div",{className:`kryptos-sdk-container ${r}`,children:t})})}function B(){const e=b.useContext(Fe);if(!e)throw new Error("useKryptosContext must be used within KryptosConnectProvider");return e}function De(e,t){return function(){return e.apply(t,arguments)}}const{toString:Kt}=Object.prototype,{getPrototypeOf:we}=Object,{iterator:re,toStringTag:Me}=Symbol,se=(e=>t=>{const n=Kt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),P=e=>(e=e.toLowerCase(),t=>se(t)===e),oe=e=>t=>typeof t===e,{isArray:V}=Array,W=oe("undefined");function X(e){return e!==null&&!W(e)&&e.constructor!==null&&!W(e.constructor)&&N(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $e=P("ArrayBuffer");function qt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&$e(e.buffer),t}const zt=oe("string"),N=oe("function"),He=oe("number"),G=e=>e!==null&&typeof e=="object",Vt=e=>e===!0||e===!1,ie=e=>{if(se(e)!=="object")return!1;const t=we(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Me in e)&&!(re in e)},Wt=e=>{if(!G(e)||X(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Jt=P("Date"),Xt=P("File"),Gt=P("Blob"),Zt=P("FileList"),Qt=e=>G(e)&&N(e.pipe),Yt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||N(e.append)&&((t=se(e))==="formdata"||t==="object"&&N(e.toString)&&e.toString()==="[object FormData]"))},en=P("URLSearchParams"),[tn,nn,rn,sn]=["ReadableStream","Request","Response","Headers"].map(P),on=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Z(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),V(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(X(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let c;for(r=0;r<o;r++)c=i[r],t.call(null,e[c],c,e)}}function Ke(e,t){if(X(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const H=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,qe=e=>!W(e)&&e!==H;function ge(){const{caseless:e,skipUndefined:t}=qe(this)&&this||{},n={},r=(s,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;const o=e&&Ke(n,i)||i;ie(n[o])&&ie(s)?n[o]=ge(n[o],s):ie(s)?n[o]=ge({},s):V(s)?n[o]=s.slice():(!t||!W(s))&&(n[o]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Z(arguments[s],r);return n}const an=(e,t,n,{allOwnKeys:r}={})=>(Z(t,(s,i)=>{n&&N(s)?Object.defineProperty(e,i,{value:De(s,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),cn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ln=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},un=(e,t,n,r)=>{let s,i,o;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!r||r(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=n!==!1&&we(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},dn=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},fn=e=>{if(!e)return null;if(V(e))return e;let t=e.length;if(!He(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},pn=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&we(Uint8Array)),hn=(e,t)=>{const r=(e&&e[re]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},mn=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},yn=P("HTMLFormElement"),wn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),ze=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),gn=P("RegExp"),Ve=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Z(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},bn=e=>{Ve(e,(t,n)=>{if(N(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(N(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},En=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return V(e)?r(e):r(String(e).split(t)),n},xn=()=>{},Sn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Cn(e){return!!(e&&N(e.append)&&e[Me]==="FormData"&&e[re])}const On=e=>{const t=new Array(10),n=(r,s)=>{if(G(r)){if(t.indexOf(r)>=0)return;if(X(r))return r;if(!("toJSON"in r)){t[s]=r;const i=V(r)?[]:{};return Z(r,(o,c)=>{const p=n(o,s+1);!W(p)&&(i[c]=p)}),t[s]=void 0,i}}return r};return n(e,0)},Rn=P("AsyncFunction"),Tn=e=>e&&(G(e)||N(e))&&N(e.then)&&N(e.catch),We=((e,t)=>e?setImmediate:t?((n,r)=>(H.addEventListener("message",({source:s,data:i})=>{s===H&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),H.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",N(H.postMessage)),Nn=typeof queueMicrotask<"u"?queueMicrotask.bind(H):typeof process<"u"&&process.nextTick||We,a={isArray:V,isArrayBuffer:$e,isBuffer:X,isFormData:Yt,isArrayBufferView:qt,isString:zt,isNumber:He,isBoolean:Vt,isObject:G,isPlainObject:ie,isEmptyObject:Wt,isReadableStream:tn,isRequest:nn,isResponse:rn,isHeaders:sn,isUndefined:W,isDate:Jt,isFile:Xt,isBlob:Gt,isRegExp:gn,isFunction:N,isStream:Qt,isURLSearchParams:en,isTypedArray:pn,isFileList:Zt,forEach:Z,merge:ge,extend:an,trim:on,stripBOM:cn,inherits:ln,toFlatObject:un,kindOf:se,kindOfTest:P,endsWith:dn,toArray:fn,forEachEntry:hn,matchAll:mn,isHTMLForm:yn,hasOwnProperty:ze,hasOwnProp:ze,reduceDescriptors:Ve,freezeMethods:bn,toObjectSet:En,toCamelCase:wn,noop:xn,toFiniteNumber:Sn,findKey:Ke,global:H,isContextDefined:qe,isSpecCompliantForm:Cn,toJSONObject:On,isAsyncFn:Rn,isThenable:Tn,setImmediate:We,asap:Nn,isIterable:e=>e!=null&&N(e[re])};let w=class It extends Error{static from(t,n,r,s,i,o){const c=new It(t.message,n||t.code,r,s,i);return c.cause=t,c.name=t.name,o&&Object.assign(c,o),c}constructor(t,n,r,s,i){super(t),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),s&&(this.request=s),i&&(this.response=i,this.status=i.status)}toJSON(){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}}};w.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",w.ERR_BAD_OPTION="ERR_BAD_OPTION",w.ECONNABORTED="ECONNABORTED",w.ETIMEDOUT="ETIMEDOUT",w.ERR_NETWORK="ERR_NETWORK",w.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",w.ERR_DEPRECATED="ERR_DEPRECATED",w.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",w.ERR_BAD_REQUEST="ERR_BAD_REQUEST",w.ERR_CANCELED="ERR_CANCELED",w.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",w.ERR_INVALID_URL="ERR_INVALID_URL";const An=null;function be(e){return a.isPlainObject(e)||a.isArray(e)}function Je(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Xe(e,t,n){return e?e.concat(t).map(function(s,i){return s=Je(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function kn(e){return a.isArray(e)&&!e.some(be)}const jn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function ae(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,m){return!a.isUndefined(m[h])});const r=n.metaTokens,s=n.visitor||u,i=n.dots,o=n.indexes,p=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function l(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(a.isBoolean(d))return d.toString();if(!p&&a.isBlob(d))throw new w("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?p&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function u(d,h,m){let x=d;if(d&&!m&&typeof d=="object"){if(a.endsWith(h,"{}"))h=r?h:h.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&kn(d)||(a.isFileList(d)||a.endsWith(h,"[]"))&&(x=a.toArray(d)))return h=Je(h),x.forEach(function(C,O){!(a.isUndefined(C)||C===null)&&t.append(o===!0?Xe([h],O,i):o===null?h:h+"[]",l(C))}),!1}return be(d)?!0:(t.append(Xe(m,h,i),l(d)),!1)}const y=[],g=Object.assign(jn,{defaultVisitor:u,convertValue:l,isVisitable:be});function E(d,h){if(!a.isUndefined(d)){if(y.indexOf(d)!==-1)throw Error("Circular reference detected in "+h.join("."));y.push(d),a.forEach(d,function(x,T){(!(a.isUndefined(x)||x===null)&&s.call(t,x,a.isString(T)?T.trim():T,h,g))===!0&&E(x,h?h.concat(T):[T])}),y.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return E(e),t}function Ge(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Ee(e,t){this._pairs=[],e&&ae(e,this,t)}const Ze=Ee.prototype;Ze.append=function(t,n){this._pairs.push([t,n])},Ze.toString=function(t){const n=t?function(r){return t.call(this,r,Ge)}:Ge;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function _n(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Qe(e,t,n){if(!t)return e;const r=n&&n.encode||_n,s=a.isFunction(n)?{serialize:n}:n,i=s&&s.serialize;let o;if(i?o=i(t,s):o=a.isURLSearchParams(t)?t.toString():new Ee(t,s).toString(r),o){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Ye{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.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(r){r!==null&&t(r)})}}const xe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Ln={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Ee,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Se=typeof window<"u"&&typeof document<"u",Ce=typeof navigator=="object"&&navigator||void 0,Un=Se&&(!Ce||["ReactNative","NativeScript","NS"].indexOf(Ce.product)<0),In=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Pn=Se&&window.location.href||"http://localhost",R={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Se,hasStandardBrowserEnv:Un,hasStandardBrowserWebWorkerEnv:In,navigator:Ce,origin:Pn},Symbol.toStringTag,{value:"Module"})),...Ln};function vn(e,t){return ae(e,new R.classes.URLSearchParams,{visitor:function(n,r,s,i){return R.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function Bn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Fn(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function et(e){function t(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;const c=Number.isFinite(+o),p=i>=n.length;return o=!o&&a.isArray(s)?s.length:o,p?(a.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!c):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&a.isArray(s[o])&&(s[o]=Fn(s[o])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(Bn(r),s,n,0)}),n}return null}function Dn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Q={transitional:xe,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(et(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 n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return vn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const p=this.env&&this.env.FormData;return ae(c?{"files[]":t}:t,p&&new p,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),Dn(t)):t}],transformResponse:[function(t){const n=this.transitional||Q.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(o)throw c.name==="SyntaxError"?w.from(c,w.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=>{Q.headers[e]={}});const Mn=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"]),$n=e=>{const t={};let n,r,s;return e&&e.split(`
10
- `).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&Mn[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},tt=Symbol("internals");function Y(e){return e&&String(e).trim().toLowerCase()}function ce(e){return e===!1||e==null?e:a.isArray(e)?e.map(ce):String(e)}function Hn(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Kn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Oe(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function qn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function zn(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,o){return this[r].call(this,t,s,i,o)},configurable:!0})})}let A=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(c,p,l){const u=Y(p);if(!u)throw new Error("header name must be a non-empty string");const y=a.findKey(s,u);(!y||s[y]===void 0||l===!0||l===void 0&&s[y]!==!1)&&(s[y||p]=ce(c))}const o=(c,p)=>a.forEach(c,(l,u)=>i(l,u,p));if(a.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(a.isString(t)&&(t=t.trim())&&!Kn(t))o($n(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},p,l;for(const u of t){if(!a.isArray(u))throw TypeError("Object iterator must return a key-value pair");c[l=u[0]]=(p=c[l])?a.isArray(p)?[...p,u[1]]:[p,u[1]]:u[1]}o(c,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=Y(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Hn(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Y(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Oe(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(o){if(o=Y(o),o){const c=a.findKey(r,o);c&&(!n||Oe(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||Oe(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,i)=>{const o=a.findKey(r,i);if(o){n[o]=ce(s),delete n[i];return}const c=t?qn(i):String(i).trim();c!==i&&delete n[i],n[c]=ce(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
11
- `)}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,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[tt]=this[tt]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=Y(o);r[c]||(zn(s,o),r[c]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}};A.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(A.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),a.freezeMethods(A);function Re(e,t){const n=this||Q,r=t||n,s=A.from(r.headers);let i=r.data;return a.forEach(e,function(c){i=c.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function nt(e){return!!(e&&e.__CANCEL__)}let ee=class extends w{constructor(t,n,r){super(t??"canceled",w.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function rt(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new w("Request failed with status code "+n.status,[w.ERR_BAD_REQUEST,w.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Vn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Wn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(p){const l=Date.now(),u=r[i];o||(o=l),n[s]=p,r[s]=l;let y=i,g=0;for(;y!==s;)g+=n[y++],y=y%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),l-o<t)return;const E=u&&l-u;return E?Math.round(g*1e3/E):void 0}}function Jn(e,t){let n=0,r=1e3/t,s,i;const o=(l,u=Date.now())=>{n=u,s=null,i&&(clearTimeout(i),i=null),e(...l)};return[(...l)=>{const u=Date.now(),y=u-n;y>=r?o(l,u):(s=l,i||(i=setTimeout(()=>{i=null,o(s)},r-y)))},()=>s&&o(s)]}const le=(e,t,n=3)=>{let r=0;const s=Wn(50,250);return Jn(i=>{const o=i.loaded,c=i.lengthComputable?i.total:void 0,p=o-r,l=s(p),u=o<=c;r=o;const y={loaded:o,total:c,progress:c?o/c:void 0,bytes:p,rate:l||void 0,estimated:l&&c&&u?(c-o)/l:void 0,event:i,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(y)},n)},st=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ot=e=>(...t)=>a.asap(()=>e(...t)),Xn=R.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,R.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(R.origin),R.navigator&&/(msie|trident)/i.test(R.navigator.userAgent)):()=>!0,Gn=R.hasStandardBrowserEnv?{write(e,t,n,r,s,i,o){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),a.isString(r)&&c.push(`path=${r}`),a.isString(s)&&c.push(`domain=${s}`),i===!0&&c.push("secure"),a.isString(o)&&c.push(`SameSite=${o}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const 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 Zn(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Qn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function it(e,t,n){let r=!Zn(t);return e&&(r||n==!1)?Qn(e,t):t}const at=e=>e instanceof A?{...e}:e;function K(e,t){t=t||{};const n={};function r(l,u,y,g){return a.isPlainObject(l)&&a.isPlainObject(u)?a.merge.call({caseless:g},l,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function s(l,u,y,g){if(a.isUndefined(u)){if(!a.isUndefined(l))return r(void 0,l,y,g)}else return r(l,u,y,g)}function i(l,u){if(!a.isUndefined(u))return r(void 0,u)}function o(l,u){if(a.isUndefined(u)){if(!a.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function c(l,u,y){if(y in t)return r(l,u);if(y in e)return r(void 0,l)}const p={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(l,u,y)=>s(at(l),at(u),y,!0)};return a.forEach(Object.keys({...e,...t}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const y=a.hasOwnProp(p,u)?p[u]:s,g=y(e[u],t[u],u);a.isUndefined(g)&&y!==c||(n[u]=g)}),n}const ct=e=>{const t=K({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:c}=t;if(t.headers=o=A.from(o),t.url=Qe(it(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(n)){if(R.hasStandardBrowserEnv||R.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const p=n.getHeaders(),l=["content-type","content-length"];Object.entries(p).forEach(([u,y])=>{l.includes(u.toLowerCase())&&o.set(u,y)})}}if(R.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&Xn(t.url))){const p=s&&i&&Gn.read(i);p&&o.set(s,p)}return t},Yn=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=ct(e);let i=s.data;const o=A.from(s.headers).normalize();let{responseType:c,onUploadProgress:p,onDownloadProgress:l}=s,u,y,g,E,d;function h(){E&&E(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let m=new XMLHttpRequest;m.open(s.method.toUpperCase(),s.url,!0),m.timeout=s.timeout;function x(){if(!m)return;const C=A.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),L={data:!c||c==="text"||c==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:C,config:e,request:m};rt(function(k){n(k),h()},function(k){r(k),h()},L),m=null}"onloadend"in m?m.onloadend=x:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(x)},m.onabort=function(){m&&(r(new w("Request aborted",w.ECONNABORTED,e,m)),m=null)},m.onerror=function(O){const L=O&&O.message?O.message:"Network Error",v=new w(L,w.ERR_NETWORK,e,m);v.event=O||null,r(v),m=null},m.ontimeout=function(){let O=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const L=s.transitional||xe;s.timeoutErrorMessage&&(O=s.timeoutErrorMessage),r(new w(O,L.clarifyTimeoutError?w.ETIMEDOUT:w.ECONNABORTED,e,m)),m=null},i===void 0&&o.setContentType(null),"setRequestHeader"in m&&a.forEach(o.toJSON(),function(O,L){m.setRequestHeader(L,O)}),a.isUndefined(s.withCredentials)||(m.withCredentials=!!s.withCredentials),c&&c!=="json"&&(m.responseType=s.responseType),l&&([g,d]=le(l,!0),m.addEventListener("progress",g)),p&&m.upload&&([y,E]=le(p),m.upload.addEventListener("progress",y),m.upload.addEventListener("loadend",E)),(s.cancelToken||s.signal)&&(u=C=>{m&&(r(!C||C.type?new ee(null,e,m):C),m.abort(),m=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const T=Vn(s.url);if(T&&R.protocols.indexOf(T)===-1){r(new w("Unsupported protocol "+T+":",w.ERR_BAD_REQUEST,e));return}m.send(i||null)})},er=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(l){if(!s){s=!0,c();const u=l instanceof Error?l:this.reason;r.abort(u instanceof w?u:new ee(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,i(new w(`timeout of ${t}ms exceeded`,w.ETIMEDOUT))},t);const c=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),e=null)};e.forEach(l=>l.addEventListener("abort",i));const{signal:p}=r;return p.unsubscribe=()=>a.asap(c),p}},tr=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},nr=async function*(e,t){for await(const n of rr(e))yield*tr(n,t)},rr=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},lt=(e,t,n,r)=>{const s=nr(e,t);let i=0,o,c=p=>{o||(o=!0,r&&r(p))};return new ReadableStream({async pull(p){try{const{done:l,value:u}=await s.next();if(l){c(),p.close();return}let y=u.byteLength;if(n){let g=i+=y;n(g)}p.enqueue(new Uint8Array(u))}catch(l){throw c(l),l}},cancel(p){return c(p),s.return()}},{highWaterMark:2})},ut=64*1024,{isFunction:ue}=a,sr=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:dt,TextEncoder:ft}=a.global,pt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},or=e=>{e=a.merge.call({skipUndefined:!0},sr,e);const{fetch:t,Request:n,Response:r}=e,s=t?ue(t):typeof fetch=="function",i=ue(n),o=ue(r);if(!s)return!1;const c=s&&ue(dt),p=s&&(typeof ft=="function"?(d=>h=>d.encode(h))(new ft):async d=>new Uint8Array(await new n(d).arrayBuffer())),l=i&&c&&pt(()=>{let d=!1;const h=new n(R.origin,{body:new dt,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!h}),u=o&&c&&pt(()=>a.isReadableStream(new r("").body)),y={stream:u&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!y[d]&&(y[d]=(h,m)=>{let x=h&&h[d];if(x)return x.call(h);throw new w(`Response type '${d}' is not supported`,w.ERR_NOT_SUPPORT,m)})});const g=async d=>{if(d==null)return 0;if(a.isBlob(d))return d.size;if(a.isSpecCompliantForm(d))return(await new n(R.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(a.isArrayBufferView(d)||a.isArrayBuffer(d))return d.byteLength;if(a.isURLSearchParams(d)&&(d=d+""),a.isString(d))return(await p(d)).byteLength},E=async(d,h)=>{const m=a.toFiniteNumber(d.getContentLength());return m??g(h)};return async d=>{let{url:h,method:m,data:x,signal:T,cancelToken:C,timeout:O,onDownloadProgress:L,onUploadProgress:v,responseType:k,headers:Ie,withCredentials:he="same-origin",fetchOptions:At}=ct(d),kt=t||fetch;k=k?(k+"").toLowerCase():"text";let me=er([T,C&&C.toAbortSignal()],O),te=null;const z=me&&me.unsubscribe&&(()=>{me.unsubscribe()});let jt;try{if(v&&l&&m!=="get"&&m!=="head"&&(jt=await E(Ie,x))!==0){let $=new n(h,{method:"POST",body:x,duplex:"half"}),J;if(a.isFormData(x)&&(J=$.headers.get("content-type"))&&Ie.setContentType(J),$.body){const[Pe,ye]=st(jt,le(ot(v)));x=lt($.body,ut,Pe,ye)}}a.isString(he)||(he=he?"include":"omit");const j=i&&"credentials"in n.prototype,_t={...At,signal:me,method:m.toUpperCase(),headers:Ie.normalize().toJSON(),body:x,duplex:"half",credentials:j?he:void 0};te=i&&new n(h,_t);let M=await(i?kt(te,At):kt(h,_t));const Lt=u&&(k==="stream"||k==="response");if(u&&(L||Lt&&z)){const $={};["status","statusText","headers"].forEach(Ut=>{$[Ut]=M[Ut]});const J=a.toFiniteNumber(M.headers.get("content-length")),[Pe,ye]=L&&st(J,le(ot(L),!0))||[];M=new r(lt(M.body,ut,Pe,()=>{ye&&ye(),z&&z()}),$)}k=k||"text";let $r=await y[a.findKey(y,k)||"text"](M,d);return!Lt&&z&&z(),await new Promise(($,J)=>{rt($,J,{data:$r,headers:A.from(M.headers),status:M.status,statusText:M.statusText,config:d,request:te})})}catch(j){throw z&&z(),j&&j.name==="TypeError"&&/Load failed|fetch/i.test(j.message)?Object.assign(new w("Network Error",w.ERR_NETWORK,d,te,j&&j.response),{cause:j.cause||j}):w.from(j,j&&j.code,d,te,j&&j.response)}}},ir=new Map,ht=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,i=[r,s,n];let o=i.length,c=o,p,l,u=ir;for(;c--;)p=i[c],l=u.get(p),l===void 0&&u.set(p,l=c?new Map:or(t)),u=l;return l};ht();const Te={http:An,xhr:Yn,fetch:{get:ht}};a.forEach(Te,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const mt=e=>`- ${e}`,ar=e=>a.isFunction(e)||e===null||e===!1;function cr(e,t){e=a.isArray(e)?e:[e];const{length:n}=e;let r,s;const i={};for(let o=0;o<n;o++){r=e[o];let c;if(s=r,!ar(r)&&(s=Te[(c=String(r)).toLowerCase()],s===void 0))throw new w(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(t))))break;i[c||"#"+o]=s}if(!s){const o=Object.entries(i).map(([p,l])=>`adapter ${p} `+(l===!1?"is not supported by the environment":"is not available in the build"));let c=n?o.length>1?`since :
12
- `+o.map(mt).join(`
13
- `):" "+mt(o[0]):"as no adapter specified";throw new w("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const yt={getAdapter:cr,adapters:Te};function Ne(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ee(null,e)}function wt(e){return Ne(e),e.headers=A.from(e.headers),e.data=Re.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),yt.getAdapter(e.adapter||Q.adapter,e)(e).then(function(r){return Ne(e),r.data=Re.call(e,e.transformResponse,r),r.headers=A.from(r.headers),r},function(r){return nt(r)||(Ne(e),r&&r.response&&(r.response.data=Re.call(e,e.transformResponse,r.response),r.response.headers=A.from(r.response.headers))),Promise.reject(r)})}const gt="1.13.5",de={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{de[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const bt={};de.transitional=function(t,n,r){function s(i,o){return"[Axios v"+gt+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,c)=>{if(t===!1)throw new w(s(o," has been removed"+(n?" in "+n:"")),w.ERR_DEPRECATED);return n&&!bt[o]&&(bt[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,c):!0}},de.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function lr(e,t,n){if(typeof e!="object")throw new w("options must be an object",w.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],o=t[i];if(o){const c=e[i],p=c===void 0||o(c,i,e);if(p!==!0)throw new w("option "+i+" must be "+p,w.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new w("Unknown option "+i,w.ERR_BAD_OPTION)}}const fe={assertOptions:lr,validators:de},U=fe.validators;let q=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ye,response:new Ye}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
14
- `+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=K(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&fe.assertOptions(r,{silentJSONParsing:U.transitional(U.boolean),forcedJSONParsing:U.transitional(U.boolean),clarifyTimeoutError:U.transitional(U.boolean),legacyInterceptorReqResOrdering:U.transitional(U.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:fe.assertOptions(s,{encode:U.function,serialize:U.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),fe.assertOptions(n,{baseUrl:U.spelling("baseURL"),withXsrfToken:U.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[n.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),n.headers=A.concat(o,i);const c=[];let p=!0;this.interceptors.request.forEach(function(h){if(typeof h.runWhen=="function"&&h.runWhen(n)===!1)return;p=p&&h.synchronous;const m=n.transitional||xe;m&&m.legacyInterceptorReqResOrdering?c.unshift(h.fulfilled,h.rejected):c.push(h.fulfilled,h.rejected)});const l=[];this.interceptors.response.forEach(function(h){l.push(h.fulfilled,h.rejected)});let u,y=0,g;if(!p){const d=[wt.bind(this),void 0];for(d.unshift(...c),d.push(...l),g=d.length,u=Promise.resolve(n);y<g;)u=u.then(d[y++],d[y++]);return u}g=c.length;let E=n;for(;y<g;){const d=c[y++],h=c[y++];try{E=d(E)}catch(m){h.call(this,m);break}}try{u=wt.call(this,E)}catch(d){return Promise.reject(d)}for(y=0,g=l.length;y<g;)u=u.then(l[y++],l[y++]);return u}getUri(t){t=K(this.defaults,t);const n=it(t.baseURL,t.url,t.allowAbsoluteUrls);return Qe(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){q.prototype[t]=function(n,r){return this.request(K(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,c){return this.request(K(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}q.prototype[t]=n(),q.prototype[t+"Form"]=n(!0)});let ur=class Pt{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(c=>{r.subscribe(c),i=c}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,c){r.reason||(r.reason=new ee(i,o,c),n(r.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;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Pt(function(s){t=s}),cancel:t}}};function dr(e){return function(n){return e.apply(null,n)}}function fr(e){return a.isObject(e)&&e.isAxiosError===!0}const Ae={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(Ae).forEach(([e,t])=>{Ae[t]=e});function Et(e){const t=new q(e),n=De(q.prototype.request,t);return a.extend(n,q.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Et(K(e,s))},n}const S=Et(Q);S.Axios=q,S.CanceledError=ee,S.CancelToken=ur,S.isCancel=nt,S.VERSION=gt,S.toFormData=ae,S.AxiosError=w,S.Cancel=S.CanceledError,S.all=function(t){return Promise.all(t)},S.spread=dr,S.isAxiosError=fr,S.mergeConfig=K,S.AxiosHeaders=A,S.formToJSON=e=>et(a.isHTMLForm(e)?new FormData(e):e),S.getAdapter=yt.getAdapter,S.HttpStatusCode=Ae,S.default=S;const{Axios:Jr,AxiosError:Xr,CanceledError:Gr,isCancel:Zr,CancelToken:Qr,VERSION:Yr,all:es,Cancel:ts,isAxiosError:ns,spread:rs,toFormData:ss,AxiosHeaders:os,HttpStatusCode:is,formToJSON:as,getAdapter:cs,mergeConfig:ls}=S,xt="https://connect-api.kryptos.io/";let St=xt;function pr(e){St=e||xt}const _=S.create({headers:{"Content-Type":"application/json"}});_.interceptors.request.use(e=>(e.baseURL=St,e));const hr="openid profile offline_access email portfolios:read transactions:read integrations:read tax:read accounting:read reports:read workspace:read users:read";async function mr(e,t,n){return(await _.post("/v1/sendEmailOTP",{email:t,purpose:"login",clientId:n},{headers:{"X-LINK-TOKEN":e}})).data}async function yr(e,t,n,r){return(await _.post("/v1/loginUserUsingOTP",{email:t,code:n,clientId:r,purpose:"login"},{headers:{"X-LINK-TOKEN":e}})).data}async function wr(e,t){var r;return(r=(await _.post("/link-token/login",{clientId:t},{headers:{"X-LINK-TOKEN":e}})).data)==null?void 0:r.data}async function gr(e,t){var r;return(r=(await _.post("/integrations/keys",{keys:[...t]},{headers:{"X-LINK-TOKEN":e}})).data)==null?void 0:r.data}async function br(e){var n;return(n=(await _.post("/consent",{granted_scopes:hr},{headers:{"X-LINK-TOKEN":e}})).data)==null?void 0:n.data}async function Er(e,t){var r;return(r=(await _.post("/integrations/credentials/test",t,{headers:{"X-LINK-TOKEN":e}})).data)==null?void 0:r.data}async function xr(e,t){var r;return(r=(await _.get(`/integrations/providers${t?`?id=${t}`:""}`,{headers:{"X-LINK-TOKEN":e}})).data)==null?void 0:r.data}async function Sr(e,t){var r;return(r=(await _.get("/integrations/providers",{params:{searchTerm:t},headers:{"X-LINK-TOKEN":e}})).data)==null?void 0:r.data}async function Cr(e){var n;return(n=(await _.get("/integrations",{headers:{"X-LINK-TOKEN":e}})).data)==null?void 0:n.data}async function Or(e,t){var r,s;return((s=(r=(await _.get("/integrations/user-used-chain",{headers:{"X-LINK-TOKEN":e},params:{id:t}})).data)==null?void 0:r.data)==null?void 0:s.chains)||[]}async function Rr(e){var n;return(n=(await _.get("/client",{headers:{"X-LINK-TOKEN":e}})).data)==null?void 0:n.data}async function Tr(e){var n;return(n=(await _.get("/link-token/session",{headers:{"X-LINK-TOKEN":e}})).data)==null?void 0:n.data}const Ct="https://connect-api.kryptos.io/";function ke(){const{linkToken:e,clientId:t,baseUrl:n=Ct}=B();b.useEffect(()=>{pr(n??Ct)},[n]);const r=b.useCallback(h=>mr(e,h,t),[e,t]),s=b.useCallback((h,m)=>yr(e,h,m,t),[e,t]),i=b.useCallback(()=>wr(e,t),[e,t]),o=b.useCallback(h=>gr(e,h),[e]),c=b.useCallback(()=>br(e),[e]),p=b.useCallback(h=>Er(e,h),[e]),l=b.useCallback(h=>xr(e,h),[e]),u=b.useCallback(h=>Sr(e,h),[e]),y=b.useCallback(()=>Cr(e),[e]),g=b.useCallback(h=>Or(e,h),[e]),E=b.useCallback(()=>Rr(e),[e]),d=b.useCallback(()=>Tr(e),[e]);return{sendEmailOtp:r,loginWithOtp:s,createAnonymousUser:i,addUserIntegration:o,giveUserConsent:c,testCredentials:p,getSupportedProviders:l,searchProviders:u,getUserIntegrations:y,getUserUsedChains:g,getClientInfo:E,getUserInfo:d,linkToken:e,clientId:t}}function F(...e){return e.filter(Boolean).join(" ")}const pe=b.forwardRef(({variant:e="primary",size:t="md",className:n,children:r,...s},i)=>{const o=F("kc-button",`kc-button--${e}`,`kc-button--${t}`,n);return f.jsx("button",{ref:i,className:o,...s,children:r})});pe.displayName="Button";var D=(e=>(e.INIT="INIT",e.AUTH="AUTH",e.OTP="OTP",e.INTEGRATION="INTEGRATION",e.PERMISSIONS="PERMISSIONS",e.STATUS="STATUS",e.END="END",e))(D||{});const Nr=({...e})=>f.jsx("svg",{fill:"currentColor",width:"24px",height:"24px",viewBox:"0 0 0.72 0.72",xmlns:"http://www.w3.org/2000/svg",...e,children:f.jsx("path",{d:"M0.658 0.348C0.597 0.207 0.483 0.12 0.36 0.12s-0.237 0.087 -0.298 0.228a0.03 0.03 0 0 0 0 0.024C0.123 0.513 0.237 0.6 0.36 0.6s0.237 -0.087 0.298 -0.228a0.03 0.03 0 0 0 0 -0.024M0.36 0.54c-0.095 0 -0.185 -0.069 -0.237 -0.18C0.175 0.249 0.265 0.18 0.36 0.18s0.185 0.069 0.237 0.18c-0.052 0.111 -0.142 0.18 -0.237 0.18m0 -0.3a0.12 0.12 0 1 0 0.12 0.12 0.12 0.12 0 0 0 -0.12 -0.12m0 0.18a0.06 0.06 0 1 1 0.06 -0.06 0.06 0.06 0 0 1 -0.06 0.06"})}),Ar=({...e})=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[f.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),f.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]}),kr=({className:e="",...t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`kc-animate-spin ${e}`,...t,children:f.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),jr=({...e})=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[f.jsx("path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}),f.jsx("path",{d:"m9 12 2 2 4-4"})]}),Ot=b.forwardRef(({variant:e="default",className:t,children:n,...r},s)=>f.jsx("div",{ref:s,role:"alert",className:F("kc-alert",`kc-alert--${e}`,t),...r,children:n}));Ot.displayName="Alert";const _r=b.forwardRef(({className:e,children:t,...n},r)=>f.jsx("div",{ref:r,className:F("kc-alert-title",e),...n,children:t}));_r.displayName="AlertTitle";const Rt=b.forwardRef(({className:e,children:t,...n},r)=>f.jsx("div",{ref:r,className:F("kc-alert-description",e),...n,children:t}));Rt.displayName="AlertDescription";const Lr=()=>{const{config:e}=B();return f.jsx("div",{className:"kc-sandbox-mode",children:"Sandbox Mode"})},Tt=({isDarkTheme:e,width:t="36",height:n="36"})=>f.jsxs("svg",{width:t,height:n,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("path",{d:"M0 4.11429C0 1.84203 1.84203 0 4.11429 0H31.8857C34.158 0 36 1.84203 36 4.11429V31.8857C36 34.158 34.158 36 31.8857 36H4.11429C1.84203 36 0 34.158 0 31.8857V4.11429Z",fill:e?"white":"#00C693"}),f.jsx("path",{d:"M12.3916 28.2857H8.43388C8.03646 28.2857 7.71429 27.9886 7.71429 27.6221V22.92C7.71429 22.744 7.7901 22.5752 7.92505 22.4508L9.66229 20.8487C9.79724 20.7243 9.98027 20.6544 10.1711 20.6544H12.3916C12.789 20.6544 13.1112 20.9515 13.1112 21.318V27.6221C13.1112 27.9886 12.789 28.2857 12.3916 28.2857Z",fill:e?"#00C693":"white"}),f.jsx("path",{d:"M27.5647 28.2857H22.0443C21.8535 28.2857 21.6704 28.2158 21.5355 28.0914L13.9798 21.1236C13.6988 20.8645 13.6988 20.4443 13.9798 20.1851L15.7788 18.5262C15.9137 18.4017 16.0968 18.3318 16.2876 18.3318H18.21C18.4009 18.3318 18.5839 18.4017 18.7189 18.5262L28.0735 27.1529C28.5268 27.5709 28.2058 28.2857 27.5647 28.2857Z",fill:e?"#00C693":"white"}),f.jsx("path",{d:"M27.5647 7.71429H22.0443C21.8535 7.71429 21.6704 7.7842 21.5355 7.90865L13.9798 14.8764C13.6988 15.1355 13.6988 15.5557 13.9798 15.8149L15.7788 17.4738C15.9137 17.5983 16.0968 17.6682 16.2876 17.6682H18.21C18.4009 17.6682 18.5839 17.5983 18.7189 17.4738L28.0735 8.84711C28.5268 8.42907 28.2058 7.71429 27.5647 7.71429Z",fill:e?"#00C693":"white"}),f.jsx("path",{d:"M12.3916 7.71429H8.43388C8.03646 7.71429 7.71429 8.01139 7.71429 8.37788V13.08C7.71429 13.256 7.7901 13.4248 7.92505 13.5492L9.66229 15.1513C9.79724 15.2757 9.98027 15.3456 10.1711 15.3456H12.3916C12.789 15.3456 13.1112 15.0485 13.1112 14.682V8.37788C13.1112 8.01139 12.789 7.71429 12.3916 7.71429Z",fill:e?"#00C693":"white"})]}),Ur=()=>f.jsxs("div",{className:"kc-powered-by",children:["Powered by"," ",f.jsx("span",{className:"kc-powered-by-logo",onClick:()=>window.open("https://kryptos.io","_blank"),children:f.jsx(Tt,{height:"16",width:"16"})})]}),Nt=()=>f.jsxs("div",{className:"kc-footer",children:[f.jsx(Ur,{}),f.jsx(Lr,{})]}),je=({isOpen:e,onClose:t,children:n,size:r="md",closeOnOverlayClick:s=!0,closeOnEsc:i=!0,disableClose:o=!0,className:c})=>{const p=b.useCallback(l=>{!o&&s&&l.target===l.currentTarget&&t()},[o,s,t]);return b.useEffect(()=>{const l=u=>{!o&&i&&u.key==="Escape"&&t()};return e&&(document.addEventListener("keydown",l),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",l),document.body.style.overflow="unset"}},[e,o,i,t]),e?f.jsx("div",{className:"kc-modal-overlay",onClick:p,children:f.jsx("div",{className:F("kc-modal-container",`kc-modal-container--${r}`,c),children:n})}):null};je.displayName="Modal";const _e=({children:e,onClose:t,showCloseButton:n=!0,className:r})=>f.jsxs("div",{className:F("kc-modal-header",r),children:[f.jsx("div",{className:"kc-modal-title",children:e}),n&&t&&f.jsx("button",{className:"kc-modal-close",onClick:t,"aria-label":"Close modal",children:f.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:f.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]});_e.displayName="ModalHeader";const Le=({children:e,className:t})=>f.jsx("div",{className:F("kc-modal-body",t),children:e});Le.displayName="ModalBody";const Ue=({children:e,className:t})=>f.jsx("div",{className:F("kc-modal-footer",t),children:e});Ue.displayName="ModalFooter";const Ir=({...e})=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[f.jsx("path",{d:"m19 5 3-3"}),f.jsx("path",{d:"m2 22 3-3"}),f.jsx("path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z"}),f.jsx("path",{d:"M7.5 13.5 10 11"}),f.jsx("path",{d:"M10.5 16.5 13 14"}),f.jsx("path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z"})]}),Pr=()=>f.jsx("div",{className:"kc-connect-logo-fixed",children:f.jsx(Tt,{})}),vr=()=>{const{appName:e,appLogo:t}=B(),n=s=>{try{return new URL(s),!0}catch{return!1}},r=()=>b.isValidElement(t)?t:typeof t=="string"&&n(t)?f.jsx("img",{src:t,alt:"app-logo",width:24,height:24}):e?e.charAt(0).toUpperCase():"?";return f.jsxs("div",{className:"kc-connect-logo-container",children:[f.jsx(Pr,{}),f.jsx(Ir,{}),f.jsx("div",{className:"kc-connect-logo-dynamic",children:r()})]})},Br=({open:e,onGuestSuccess:t,onClose:n})=>{const{appName:r,setUser:s}=B(),{createAnonymousUser:i}=ke(),[o,c]=b.useState(!1),[p,l]=b.useState(""),u=()=>{n(),l("")},y=async()=>{var g,E;try{c(!0),l("");const d=await i();s(d),t()}catch(d){console.error(d),l(((E=(g=d==null?void 0:d.response)==null?void 0:g.data)==null?void 0:E.message)||"Failed to continue as guest")}finally{c(!1)}};return f.jsxs(je,{isOpen:e,onClose:u,children:[f.jsxs(_e,{onClose:u,children:[null," "]}),f.jsx(Le,{children:f.jsxs("div",{className:"kc-auth",children:[f.jsxs("div",{className:"kc-auth-title",children:["Link your accounts to"," ",f.jsx("span",{className:"kc-auth-title-app-name",children:r})," using Kryptos"]}),f.jsx(vr,{}),[{icon:f.jsx(Ar,{}),title:"Simple and secure",text:"Link your accounts in just a few clicks"},{icon:f.jsx(jr,{}),title:"Control what you share",text:"We never share your data without your permission"},{icon:f.jsx(Nr,{}),title:"View Only Access",text:"Kryptos retrieves view-only data and cannot perform any transactions on your behalf."}].map(g=>f.jsxs("div",{className:"kc-auth-info-section",children:[f.jsx("span",{className:"kc-auth-info-icon",children:g.icon}),f.jsxs("div",{className:"kc-auth-info-content",children:[f.jsx("div",{className:"kc-auth-info-title",children:g.title}),f.jsx("div",{className:"kc-auth-info-description",children:g.text})]})]},g.title)),p&&f.jsx(Ot,{variant:"destructive",children:f.jsx(Rt,{children:p})}),f.jsxs("div",{className:"kc-auth-footer",children:["By continuing, you agree to Kryptos"," ",f.jsx("a",{target:"_blank",rel:"noreferrer",href:"https://kryptos.io/privacy-policy",children:"Privacy Policy"})," ","and"," ",f.jsx("a",{target:"_blank",rel:"noreferrer",href:"https://kryptos.io/terms-of-services",children:"Terms of Service"})]}),f.jsx(pe,{onClick:y,variant:"primary",disabled:o,style:{width:"100%"},children:o?f.jsx(kr,{className:"size-4"}):"Continue"})]})}),f.jsx(Ue,{children:f.jsx(Nt,{})})]})},Fr=({open:e,onSuccess:t,onClose:n,generateLinkToken:r})=>{const{setIsInitialized:s,isInitialized:i,setLinkToken:o,setIsAuthorized:c,setUser:p}=B(),{getUserInfo:l}=ke();return b.useEffect(()=>{(async()=>{const y=await r();if(o(y.link_token),s(!0),c(!!(y!=null&&y.isAuthorized)),y.isAuthorized){const g=await l();p(g)}t(y.isAuthorized?{isAuthorized:!0}:null)})()},[]),f.jsxs(je,{isOpen:e,onClose:n,size:"sm",children:[f.jsx(_e,{onClose:n,children:"Kryptos Connect"}),f.jsx(Le,{children:f.jsxs("div",{className:"kc-init-container",children:[f.jsx("div",{className:"kc-init-spinner"}),f.jsx("p",{className:"kc-init-message",children:i?"Initialized!":"Initializing..."})]})}),f.jsx(Ue,{children:f.jsx(Nt,{})})]})},Dr=({open:e,onClose:t,onConnectSuccess:n,onConnectError:r,generateLinkToken:s,integrationName:i,currentStep:o,setCurrentStep:c})=>{const{theme:p}=B();return e?f.jsxs("div",{className:"kc-connect-flow","data-kc-theme":p,children:[o===D.INIT&&f.jsx(Fr,{open:e,generateLinkToken:s,onSuccess:l=>{l!=null&&l.isAuthorized?c(D.INTEGRATION):c(D.AUTH)},onClose:()=>t()}),o===D.AUTH&&f.jsx(Br,{open:e,onGuestSuccess:()=>c(D.INTEGRATION),onClose:()=>t()})]}):null};function Mr({generateLinkToken:e,onConnectSuccess:t,onConnectError:n,children:r,className:s,disabled:i=!1,size:o="md",integrationName:c,...p}){const{setIsInitialized:l,setIsAuthorized:u,setLinkToken:y,setUser:g,setEmail:E,setUserConsent:d}=B(),[h,m]=b.useState(!1),[x,T]=b.useState(!1),[C,O]=b.useState(D.INIT),L=async()=>{if(!i)try{m(!0),T(!0)}catch(k){console.error("Kryptos Connect Modal error:",k)}},v=()=>{T(!1),m(!1),l(!1),O(D.INIT),d(null),g(null),E(""),y("")};return f.jsxs(f.Fragment,{children:[f.jsx(pe,{onClick:L,disabled:i||h,size:o,className:s,"aria-busy":h,...p,children:h?"Connecting...":r??(c?`Connect ${c} Account`:"Connect with Kryptos")}),f.jsx(Dr,{open:x,onClose:v,onConnectSuccess:t,onConnectError:n,generateLinkToken:e,integrationName:c,currentStep:C,setCurrentStep:O})]})}I.Button=pe,I.KryptosConnectButton=Mr,I.KryptosConnectProvider=Ht,I.useKryptosApi=ke,I.useKryptosContext=B,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})});
1
+ (function(P,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],f):(P=typeof globalThis<"u"?globalThis:P||self,f(P.__KRYPTOS_SDK__={},P.ReactJSXRuntime,P.React))})(this,function(P,f,b){"use strict";const Be=b.createContext(void 0);function Pt({config:e,children:t}){const r=`kryptos-theme-${e.theme||"light"}`,[s,i]=b.useState(!1),[o,c]=b.useState(!1),[h,l]=b.useState(""),[u,y]=b.useState(null),[g,E]=b.useState(""),[d,p]=b.useState(null),[m,S]=b.useState(null);return f.jsx(Be.Provider,{value:{...e,isInitialized:s,setIsInitialized:i,linkToken:h,setLinkToken:l,user:u,setUser:y,email:g,setEmail:E,userConsent:d,setUserConsent:p,clientInfo:m,isAuthorized:o,setIsAuthorized:c},children:f.jsx("div",{className:`kryptos-sdk-container ${r}`,children:t})})}function v(){const e=b.useContext(Be);if(!e)throw new Error("useKryptosContext must be used within KryptosConnectProvider");return e}function Fe(e,t){return function(){return e.apply(t,arguments)}}const{toString:Rt}=Object.prototype,{getPrototypeOf:ye}=Object,{iterator:ne,toStringTag:ve}=Symbol,re=(e=>t=>{const n=Rt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),B=e=>(e=e.toLowerCase(),t=>re(t)===e),se=e=>t=>typeof t===e,{isArray:V}=Array,W=se("undefined");function X(e){return e!==null&&!W(e)&&e.constructor!==null&&!W(e.constructor)&&k(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const De=B("ArrayBuffer");function Bt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&De(e.buffer),t}const Ft=se("string"),k=se("function"),Me=se("number"),G=e=>e!==null&&typeof e=="object",vt=e=>e===!0||e===!1,oe=e=>{if(re(e)!=="object")return!1;const t=ye(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(ve in e)&&!(ne in e)},Dt=e=>{if(!G(e)||X(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Mt=B("Date"),jt=B("File"),Ht=B("Blob"),Kt=B("FileList"),$t=e=>G(e)&&k(e.pipe),qt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||k(e.append)&&((t=re(e))==="formdata"||t==="object"&&k(e.toString)&&e.toString()==="[object FormData]"))},zt=B("URLSearchParams"),[Vt,Wt,Jt,Xt]=["ReadableStream","Request","Response","Headers"].map(B),Gt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Z(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),V(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(X(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let c;for(r=0;r<o;r++)c=i[r],t.call(null,e[c],c,e)}}function je(e,t){if(X(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const K=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,He=e=>!W(e)&&e!==K;function we(){const{caseless:e,skipUndefined:t}=He(this)&&this||{},n={},r=(s,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;const o=e&&je(n,i)||i;oe(n[o])&&oe(s)?n[o]=we(n[o],s):oe(s)?n[o]=we({},s):V(s)?n[o]=s.slice():(!t||!W(s))&&(n[o]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Z(arguments[s],r);return n}const Zt=(e,t,n,{allOwnKeys:r}={})=>(Z(t,(s,i)=>{n&&k(s)?Object.defineProperty(e,i,{value:Fe(s,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),Qt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Yt=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},en=(e,t,n,r)=>{let s,i,o;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!r||r(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=n!==!1&&ye(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},tn=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},nn=e=>{if(!e)return null;if(V(e))return e;let t=e.length;if(!Me(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},rn=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ye(Uint8Array)),sn=(e,t)=>{const r=(e&&e[ne]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},on=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},an=B("HTMLFormElement"),cn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Ke=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),ln=B("RegExp"),$e=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Z(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},un=e=>{$e(e,(t,n)=>{if(k(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(k(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},dn=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return V(e)?r(e):r(String(e).split(t)),n},fn=()=>{},hn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function pn(e){return!!(e&&k(e.append)&&e[ve]==="FormData"&&e[ne])}const mn=e=>{const t=new Array(10),n=(r,s)=>{if(G(r)){if(t.indexOf(r)>=0)return;if(X(r))return r;if(!("toJSON"in r)){t[s]=r;const i=V(r)?[]:{};return Z(r,(o,c)=>{const h=n(o,s+1);!W(h)&&(i[c]=h)}),t[s]=void 0,i}}return r};return n(e,0)},yn=B("AsyncFunction"),wn=e=>e&&(G(e)||k(e))&&k(e.then)&&k(e.catch),qe=((e,t)=>e?setImmediate:t?((n,r)=>(K.addEventListener("message",({source:s,data:i})=>{s===K&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),K.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",k(K.postMessage)),gn=typeof queueMicrotask<"u"?queueMicrotask.bind(K):typeof process<"u"&&process.nextTick||qe,a={isArray:V,isArrayBuffer:De,isBuffer:X,isFormData:qt,isArrayBufferView:Bt,isString:Ft,isNumber:Me,isBoolean:vt,isObject:G,isPlainObject:oe,isEmptyObject:Dt,isReadableStream:Vt,isRequest:Wt,isResponse:Jt,isHeaders:Xt,isUndefined:W,isDate:Mt,isFile:jt,isBlob:Ht,isRegExp:ln,isFunction:k,isStream:$t,isURLSearchParams:zt,isTypedArray:rn,isFileList:Kt,forEach:Z,merge:we,extend:Zt,trim:Gt,stripBOM:Qt,inherits:Yt,toFlatObject:en,kindOf:re,kindOfTest:B,endsWith:tn,toArray:nn,forEachEntry:sn,matchAll:on,isHTMLForm:an,hasOwnProperty:Ke,hasOwnProp:Ke,reduceDescriptors:$e,freezeMethods:un,toObjectSet:dn,toCamelCase:cn,noop:fn,toFiniteNumber:hn,findKey:je,global:K,isContextDefined:He,isSpecCompliantForm:pn,toJSONObject:mn,isAsyncFn:yn,isThenable:wn,setImmediate:qe,asap:gn,isIterable:e=>e!=null&&k(e[ne])};let w=class _t extends Error{static from(t,n,r,s,i,o){const c=new _t(t.message,n||t.code,r,s,i);return c.cause=t,c.name=t.name,o&&Object.assign(c,o),c}constructor(t,n,r,s,i){super(t),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),s&&(this.request=s),i&&(this.response=i,this.status=i.status)}toJSON(){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}}};w.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",w.ERR_BAD_OPTION="ERR_BAD_OPTION",w.ECONNABORTED="ECONNABORTED",w.ETIMEDOUT="ETIMEDOUT",w.ERR_NETWORK="ERR_NETWORK",w.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",w.ERR_DEPRECATED="ERR_DEPRECATED",w.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",w.ERR_BAD_REQUEST="ERR_BAD_REQUEST",w.ERR_CANCELED="ERR_CANCELED",w.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",w.ERR_INVALID_URL="ERR_INVALID_URL";const bn=null;function ge(e){return a.isPlainObject(e)||a.isArray(e)}function ze(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Ve(e,t,n){return e?e.concat(t).map(function(s,i){return s=ze(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function En(e){return a.isArray(e)&&!e.some(ge)}const Sn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function ie(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(p,m){return!a.isUndefined(m[p])});const r=n.metaTokens,s=n.visitor||u,i=n.dots,o=n.indexes,h=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function l(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(a.isBoolean(d))return d.toString();if(!h&&a.isBlob(d))throw new w("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?h&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function u(d,p,m){let S=d;if(d&&!m&&typeof d=="object"){if(a.endsWith(p,"{}"))p=r?p:p.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&En(d)||(a.isFileList(d)||a.endsWith(p,"[]"))&&(S=a.toArray(d)))return p=ze(p),S.forEach(function(O,T){!(a.isUndefined(O)||O===null)&&t.append(o===!0?Ve([p],T,i):o===null?p:p+"[]",l(O))}),!1}return ge(d)?!0:(t.append(Ve(m,p,i),l(d)),!1)}const y=[],g=Object.assign(Sn,{defaultVisitor:u,convertValue:l,isVisitable:ge});function E(d,p){if(!a.isUndefined(d)){if(y.indexOf(d)!==-1)throw Error("Circular reference detected in "+p.join("."));y.push(d),a.forEach(d,function(S,A){(!(a.isUndefined(S)||S===null)&&s.call(t,S,a.isString(A)?A.trim():A,p,g))===!0&&E(S,p?p.concat(A):[A])}),y.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return E(e),t}function We(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function be(e,t){this._pairs=[],e&&ie(e,this,t)}const Je=be.prototype;Je.append=function(t,n){this._pairs.push([t,n])},Je.toString=function(t){const n=t?function(r){return t.call(this,r,We)}:We;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Cn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Xe(e,t,n){if(!t)return e;const r=n&&n.encode||Cn,s=a.isFunction(n)?{serialize:n}:n,i=s&&s.serialize;let o;if(i?o=i(t,s):o=a.isURLSearchParams(t)?t.toString():new be(t,s).toString(r),o){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Ge{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.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(r){r!==null&&t(r)})}}const Ee={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},On={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:be,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Se=typeof window<"u"&&typeof document<"u",Ce=typeof navigator=="object"&&navigator||void 0,Tn=Se&&(!Ce||["ReactNative","NativeScript","NS"].indexOf(Ce.product)<0),Nn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",An=Se&&window.location.href||"http://localhost",N={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Se,hasStandardBrowserEnv:Tn,hasStandardBrowserWebWorkerEnv:Nn,navigator:Ce,origin:An},Symbol.toStringTag,{value:"Module"})),...On};function kn(e,t){return ie(e,new N.classes.URLSearchParams,{visitor:function(n,r,s,i){return N.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function xn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Ln(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function Ze(e){function t(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;const c=Number.isFinite(+o),h=i>=n.length;return o=!o&&a.isArray(s)?s.length:o,h?(a.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!c):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&a.isArray(s[o])&&(s[o]=Ln(s[o])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(xn(r),s,n,0)}),n}return null}function Un(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Q={transitional:Ee,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(Ze(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 n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return kn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return ie(c?{"files[]":t}:t,h&&new h,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),Un(t)):t}],transformResponse:[function(t){const n=this.transitional||Q.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(o)throw c.name==="SyntaxError"?w.from(c,w.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:N.classes.FormData,Blob:N.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=>{Q.headers[e]={}});const _n=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"]),In=e=>{const t={};let n,r,s;return e&&e.split(`
2
+ `).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&_n[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Qe=Symbol("internals");function Y(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 Pn(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Rn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Oe(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function Bn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Fn(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,o){return this[r].call(this,t,s,i,o)},configurable:!0})})}let x=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(c,h,l){const u=Y(h);if(!u)throw new Error("header name must be a non-empty string");const y=a.findKey(s,u);(!y||s[y]===void 0||l===!0||l===void 0&&s[y]!==!1)&&(s[y||h]=ae(c))}const o=(c,h)=>a.forEach(c,(l,u)=>i(l,u,h));if(a.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(a.isString(t)&&(t=t.trim())&&!Rn(t))o(In(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},h,l;for(const u of t){if(!a.isArray(u))throw TypeError("Object iterator must return a key-value pair");c[l=u[0]]=(h=c[l])?a.isArray(h)?[...h,u[1]]:[h,u[1]]:u[1]}o(c,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=Y(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Pn(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Y(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Oe(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(o){if(o=Y(o),o){const c=a.findKey(r,o);c&&(!n||Oe(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||Oe(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,i)=>{const o=a.findKey(r,i);if(o){n[o]=ae(s),delete n[i];return}const c=t?Bn(i):String(i).trim();c!==i&&delete n[i],n[c]=ae(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).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,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Qe]=this[Qe]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=Y(o);r[c]||(Fn(s,o),r[c]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}};x.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(x.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),a.freezeMethods(x);function Te(e,t){const n=this||Q,r=t||n,s=x.from(r.headers);let i=r.data;return a.forEach(e,function(c){i=c.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function Ye(e){return!!(e&&e.__CANCEL__)}let ee=class extends w{constructor(t,n,r){super(t??"canceled",w.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function et(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new w("Request failed with status code "+n.status,[w.ERR_BAD_REQUEST,w.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function vn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Dn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(h){const l=Date.now(),u=r[i];o||(o=l),n[s]=h,r[s]=l;let y=i,g=0;for(;y!==s;)g+=n[y++],y=y%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),l-o<t)return;const E=u&&l-u;return E?Math.round(g*1e3/E):void 0}}function Mn(e,t){let n=0,r=1e3/t,s,i;const o=(l,u=Date.now())=>{n=u,s=null,i&&(clearTimeout(i),i=null),e(...l)};return[(...l)=>{const u=Date.now(),y=u-n;y>=r?o(l,u):(s=l,i||(i=setTimeout(()=>{i=null,o(s)},r-y)))},()=>s&&o(s)]}const ce=(e,t,n=3)=>{let r=0;const s=Dn(50,250);return Mn(i=>{const o=i.loaded,c=i.lengthComputable?i.total:void 0,h=o-r,l=s(h),u=o<=c;r=o;const y={loaded:o,total:c,progress:c?o/c:void 0,bytes:h,rate:l||void 0,estimated:l&&c&&u?(c-o)/l:void 0,event:i,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(y)},n)},tt=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},nt=e=>(...t)=>a.asap(()=>e(...t)),jn=N.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,N.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(N.origin),N.navigator&&/(msie|trident)/i.test(N.navigator.userAgent)):()=>!0,Hn=N.hasStandardBrowserEnv?{write(e,t,n,r,s,i,o){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),a.isString(r)&&c.push(`path=${r}`),a.isString(s)&&c.push(`domain=${s}`),i===!0&&c.push("secure"),a.isString(o)&&c.push(`SameSite=${o}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const 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 Kn(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function $n(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function rt(e,t,n){let r=!Kn(t);return e&&(r||n==!1)?$n(e,t):t}const st=e=>e instanceof x?{...e}:e;function $(e,t){t=t||{};const n={};function r(l,u,y,g){return a.isPlainObject(l)&&a.isPlainObject(u)?a.merge.call({caseless:g},l,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function s(l,u,y,g){if(a.isUndefined(u)){if(!a.isUndefined(l))return r(void 0,l,y,g)}else return r(l,u,y,g)}function i(l,u){if(!a.isUndefined(u))return r(void 0,u)}function o(l,u){if(a.isUndefined(u)){if(!a.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function c(l,u,y){if(y in t)return r(l,u);if(y in e)return r(void 0,l)}const h={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(l,u,y)=>s(st(l),st(u),y,!0)};return a.forEach(Object.keys({...e,...t}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const y=a.hasOwnProp(h,u)?h[u]:s,g=y(e[u],t[u],u);a.isUndefined(g)&&y!==c||(n[u]=g)}),n}const ot=e=>{const t=$({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:c}=t;if(t.headers=o=x.from(o),t.url=Xe(rt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(n)){if(N.hasStandardBrowserEnv||N.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const h=n.getHeaders(),l=["content-type","content-length"];Object.entries(h).forEach(([u,y])=>{l.includes(u.toLowerCase())&&o.set(u,y)})}}if(N.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&jn(t.url))){const h=s&&i&&Hn.read(i);h&&o.set(s,h)}return t},qn=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=ot(e);let i=s.data;const o=x.from(s.headers).normalize();let{responseType:c,onUploadProgress:h,onDownloadProgress:l}=s,u,y,g,E,d;function p(){E&&E(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let m=new XMLHttpRequest;m.open(s.method.toUpperCase(),s.url,!0),m.timeout=s.timeout;function S(){if(!m)return;const O=x.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),I={data:!c||c==="text"||c==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:O,config:e,request:m};et(function(L){n(L),p()},function(L){r(L),p()},I),m=null}"onloadend"in m?m.onloadend=S:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(S)},m.onabort=function(){m&&(r(new w("Request aborted",w.ECONNABORTED,e,m)),m=null)},m.onerror=function(T){const I=T&&T.message?T.message:"Network Error",F=new w(I,w.ERR_NETWORK,e,m);F.event=T||null,r(F),m=null},m.ontimeout=function(){let T=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const I=s.transitional||Ee;s.timeoutErrorMessage&&(T=s.timeoutErrorMessage),r(new w(T,I.clarifyTimeoutError?w.ETIMEDOUT:w.ECONNABORTED,e,m)),m=null},i===void 0&&o.setContentType(null),"setRequestHeader"in m&&a.forEach(o.toJSON(),function(T,I){m.setRequestHeader(I,T)}),a.isUndefined(s.withCredentials)||(m.withCredentials=!!s.withCredentials),c&&c!=="json"&&(m.responseType=s.responseType),l&&([g,d]=ce(l,!0),m.addEventListener("progress",g)),h&&m.upload&&([y,E]=ce(h),m.upload.addEventListener("progress",y),m.upload.addEventListener("loadend",E)),(s.cancelToken||s.signal)&&(u=O=>{m&&(r(!O||O.type?new ee(null,e,m):O),m.abort(),m=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const A=vn(s.url);if(A&&N.protocols.indexOf(A)===-1){r(new w("Unsupported protocol "+A+":",w.ERR_BAD_REQUEST,e));return}m.send(i||null)})},zn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(l){if(!s){s=!0,c();const u=l instanceof Error?l:this.reason;r.abort(u instanceof w?u:new ee(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,i(new w(`timeout of ${t}ms exceeded`,w.ETIMEDOUT))},t);const c=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),e=null)};e.forEach(l=>l.addEventListener("abort",i));const{signal:h}=r;return h.unsubscribe=()=>a.asap(c),h}},Vn=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},Wn=async function*(e,t){for await(const n of Jn(e))yield*Vn(n,t)},Jn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},it=(e,t,n,r)=>{const s=Wn(e,t);let i=0,o,c=h=>{o||(o=!0,r&&r(h))};return new ReadableStream({async pull(h){try{const{done:l,value:u}=await s.next();if(l){c(),h.close();return}let y=u.byteLength;if(n){let g=i+=y;n(g)}h.enqueue(new Uint8Array(u))}catch(l){throw c(l),l}},cancel(h){return c(h),s.return()}},{highWaterMark:2})},at=64*1024,{isFunction:le}=a,Xn=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:ct,TextEncoder:lt}=a.global,ut=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Gn=e=>{e=a.merge.call({skipUndefined:!0},Xn,e);const{fetch:t,Request:n,Response:r}=e,s=t?le(t):typeof fetch=="function",i=le(n),o=le(r);if(!s)return!1;const c=s&&le(ct),h=s&&(typeof lt=="function"?(d=>p=>d.encode(p))(new lt):async d=>new Uint8Array(await new n(d).arrayBuffer())),l=i&&c&&ut(()=>{let d=!1;const p=new n(N.origin,{body:new ct,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!p}),u=o&&c&&ut(()=>a.isReadableStream(new r("").body)),y={stream:u&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!y[d]&&(y[d]=(p,m)=>{let S=p&&p[d];if(S)return S.call(p);throw new w(`Response type '${d}' is not supported`,w.ERR_NOT_SUPPORT,m)})});const g=async d=>{if(d==null)return 0;if(a.isBlob(d))return d.size;if(a.isSpecCompliantForm(d))return(await new n(N.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(a.isArrayBufferView(d)||a.isArrayBuffer(d))return d.byteLength;if(a.isURLSearchParams(d)&&(d=d+""),a.isString(d))return(await h(d)).byteLength},E=async(d,p)=>{const m=a.toFiniteNumber(d.getContentLength());return m??g(p)};return async d=>{let{url:p,method:m,data:S,signal:A,cancelToken:O,timeout:T,onDownloadProgress:I,onUploadProgress:F,responseType:L,headers:Pe,withCredentials:he="same-origin",fetchOptions:Nt}=ot(d),At=t||fetch;L=L?(L+"").toLowerCase():"text";let pe=zn([A,O&&O.toAbortSignal()],T),te=null;const z=pe&&pe.unsubscribe&&(()=>{pe.unsubscribe()});let kt;try{if(F&&l&&m!=="get"&&m!=="head"&&(kt=await E(Pe,S))!==0){let H=new n(p,{method:"POST",body:S,duplex:"half"}),J;if(a.isFormData(S)&&(J=H.headers.get("content-type"))&&Pe.setContentType(J),H.body){const[Re,me]=tt(kt,ce(nt(F)));S=it(H.body,at,Re,me)}}a.isString(he)||(he=he?"include":"omit");const U=i&&"credentials"in n.prototype,xt={...Nt,signal:pe,method:m.toUpperCase(),headers:Pe.normalize().toJSON(),body:S,duplex:"half",credentials:U?he:void 0};te=i&&new n(p,xt);let j=await(i?At(te,Nt):At(p,xt));const Lt=u&&(L==="stream"||L==="response");if(u&&(I||Lt&&z)){const H={};["status","statusText","headers"].forEach(Ut=>{H[Ut]=j[Ut]});const J=a.toFiniteNumber(j.headers.get("content-length")),[Re,me]=I&&tt(J,ce(nt(I),!0))||[];j=new r(it(j.body,at,Re,()=>{me&&me(),z&&z()}),H)}L=L||"text";let Ir=await y[a.findKey(y,L)||"text"](j,d);return!Lt&&z&&z(),await new Promise((H,J)=>{et(H,J,{data:Ir,headers:x.from(j.headers),status:j.status,statusText:j.statusText,config:d,request:te})})}catch(U){throw z&&z(),U&&U.name==="TypeError"&&/Load failed|fetch/i.test(U.message)?Object.assign(new w("Network Error",w.ERR_NETWORK,d,te,U&&U.response),{cause:U.cause||U}):w.from(U,U&&U.code,d,te,U&&U.response)}}},Zn=new Map,dt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,i=[r,s,n];let o=i.length,c=o,h,l,u=Zn;for(;c--;)h=i[c],l=u.get(h),l===void 0&&u.set(h,l=c?new Map:Gn(t)),u=l;return l};dt();const Ne={http:bn,xhr:qn,fetch:{get:dt}};a.forEach(Ne,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ft=e=>`- ${e}`,Qn=e=>a.isFunction(e)||e===null||e===!1;function Yn(e,t){e=a.isArray(e)?e:[e];const{length:n}=e;let r,s;const i={};for(let o=0;o<n;o++){r=e[o];let c;if(s=r,!Qn(r)&&(s=Ne[(c=String(r)).toLowerCase()],s===void 0))throw new w(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(t))))break;i[c||"#"+o]=s}if(!s){const o=Object.entries(i).map(([h,l])=>`adapter ${h} `+(l===!1?"is not supported by the environment":"is not available in the build"));let c=n?o.length>1?`since :
4
+ `+o.map(ft).join(`
5
+ `):" "+ft(o[0]):"as no adapter specified";throw new w("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const ht={getAdapter:Yn,adapters:Ne};function Ae(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ee(null,e)}function pt(e){return Ae(e),e.headers=x.from(e.headers),e.data=Te.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ht.getAdapter(e.adapter||Q.adapter,e)(e).then(function(r){return Ae(e),r.data=Te.call(e,e.transformResponse,r),r.headers=x.from(r.headers),r},function(r){return Ye(r)||(Ae(e),r&&r.response&&(r.response.data=Te.call(e,e.transformResponse,r.response),r.response.headers=x.from(r.response.headers))),Promise.reject(r)})}const mt="1.13.5",ue={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ue[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const yt={};ue.transitional=function(t,n,r){function s(i,o){return"[Axios v"+mt+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,c)=>{if(t===!1)throw new w(s(o," has been removed"+(n?" in "+n:"")),w.ERR_DEPRECATED);return n&&!yt[o]&&(yt[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,c):!0}},ue.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function er(e,t,n){if(typeof e!="object")throw new w("options must be an object",w.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],o=t[i];if(o){const c=e[i],h=c===void 0||o(c,i,e);if(h!==!0)throw new w("option "+i+" must be "+h,w.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new w("Unknown option "+i,w.ERR_BAD_OPTION)}}const de={assertOptions:er,validators:ue},R=de.validators;let q=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ge,response:new Ge}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
+ `+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=$(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&de.assertOptions(r,{silentJSONParsing:R.transitional(R.boolean),forcedJSONParsing:R.transitional(R.boolean),clarifyTimeoutError:R.transitional(R.boolean),legacyInterceptorReqResOrdering:R.transitional(R.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:de.assertOptions(s,{encode:R.function,serialize:R.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),de.assertOptions(n,{baseUrl:R.spelling("baseURL"),withXsrfToken:R.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[n.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),n.headers=x.concat(o,i);const c=[];let h=!0;this.interceptors.request.forEach(function(p){if(typeof p.runWhen=="function"&&p.runWhen(n)===!1)return;h=h&&p.synchronous;const m=n.transitional||Ee;m&&m.legacyInterceptorReqResOrdering?c.unshift(p.fulfilled,p.rejected):c.push(p.fulfilled,p.rejected)});const l=[];this.interceptors.response.forEach(function(p){l.push(p.fulfilled,p.rejected)});let u,y=0,g;if(!h){const d=[pt.bind(this),void 0];for(d.unshift(...c),d.push(...l),g=d.length,u=Promise.resolve(n);y<g;)u=u.then(d[y++],d[y++]);return u}g=c.length;let E=n;for(;y<g;){const d=c[y++],p=c[y++];try{E=d(E)}catch(m){p.call(this,m);break}}try{u=pt.call(this,E)}catch(d){return Promise.reject(d)}for(y=0,g=l.length;y<g;)u=u.then(l[y++],l[y++]);return u}getUri(t){t=$(this.defaults,t);const n=rt(t.baseURL,t.url,t.allowAbsoluteUrls);return Xe(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){q.prototype[t]=function(n,r){return this.request($(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,c){return this.request($(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}q.prototype[t]=n(),q.prototype[t+"Form"]=n(!0)});let tr=class It{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(c=>{r.subscribe(c),i=c}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,c){r.reason||(r.reason=new ee(i,o,c),n(r.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;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new It(function(s){t=s}),cancel:t}}};function nr(e){return function(n){return e.apply(null,n)}}function rr(e){return a.isObject(e)&&e.isAxiosError===!0}const ke={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ke).forEach(([e,t])=>{ke[t]=e});function wt(e){const t=new q(e),n=Fe(q.prototype.request,t);return a.extend(n,q.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return wt($(e,s))},n}const C=wt(Q);C.Axios=q,C.CanceledError=ee,C.CancelToken=tr,C.isCancel=Ye,C.VERSION=mt,C.toFormData=ie,C.AxiosError=w,C.Cancel=C.CanceledError,C.all=function(t){return Promise.all(t)},C.spread=nr,C.isAxiosError=rr,C.mergeConfig=$,C.AxiosHeaders=x,C.formToJSON=e=>Ze(a.isHTMLForm(e)?new FormData(e):e),C.getAdapter=ht.getAdapter,C.HttpStatusCode=ke,C.default=C;const{Axios:Mr,AxiosError:jr,CanceledError:Hr,isCancel:Kr,CancelToken:$r,VERSION:qr,all:zr,Cancel:Vr,isAxiosError:Wr,spread:Jr,toFormData:Xr,AxiosHeaders:Gr,HttpStatusCode:Zr,formToJSON:Qr,getAdapter:Yr,mergeConfig:es}=C,gt="https://connect-api.kryptos.io/";let bt=gt;function sr(e){bt=e||gt}const _=C.create({headers:{"Content-Type":"application/json"}});_.interceptors.request.use(e=>(e.baseURL=bt,e));const or="openid profile offline_access email portfolios:read transactions:read integrations:read tax:read accounting:read reports:read workspace:read users:read";async function ir(e,t,n){return(await _.post("/v1/sendEmailOTP",{email:t,purpose:"login",clientId:n},{headers:{"X-LINK-TOKEN":e}})).data}async function ar(e,t,n,r){return(await _.post("/v1/loginUserUsingOTP",{email:t,code:n,clientId:r,purpose:"login"},{headers:{"X-LINK-TOKEN":e}})).data}async function cr(e,t){var r;return(r=(await _.post("/link-token/login",{clientId:t},{headers:{"X-LINK-TOKEN":e}})).data)==null?void 0:r.data}async function lr(e,t){var r;return(r=(await _.post("/integrations/keys",{keys:[...t]},{headers:{"X-LINK-TOKEN":e}})).data)==null?void 0:r.data}async function ur(e){var n;return(n=(await _.post("/consent",{granted_scopes:or},{headers:{"X-LINK-TOKEN":e}})).data)==null?void 0:n.data}async function dr(e,t){var r;return(r=(await _.post("/integrations/credentials/test",t,{headers:{"X-LINK-TOKEN":e}})).data)==null?void 0:r.data}async function fr(e,t){var r;return(r=(await _.get(`/integrations/providers${t?`?id=${t}`:""}`,{headers:{"X-LINK-TOKEN":e}})).data)==null?void 0:r.data}async function hr(e,t){var r;return(r=(await _.get("/integrations/providers",{params:{searchTerm:t},headers:{"X-LINK-TOKEN":e}})).data)==null?void 0:r.data}async function pr(e){var n;return(n=(await _.get("/integrations",{headers:{"X-LINK-TOKEN":e}})).data)==null?void 0:n.data}async function mr(e,t){var r,s;return((s=(r=(await _.get("/integrations/user-used-chain",{headers:{"X-LINK-TOKEN":e},params:{id:t}})).data)==null?void 0:r.data)==null?void 0:s.chains)||[]}async function yr(e){var n;return(n=(await _.get("/client",{headers:{"X-LINK-TOKEN":e}})).data)==null?void 0:n.data}async function wr(e){var n;return(n=(await _.get("/link-token/session",{headers:{"X-LINK-TOKEN":e}})).data)==null?void 0:n.data}const Et="https://connect-api.kryptos.io/";function xe(){const{linkToken:e,clientId:t,baseUrl:n=Et}=v();b.useEffect(()=>{sr(n??Et)},[n]);const r=b.useCallback(p=>ir(e,p,t),[e,t]),s=b.useCallback((p,m)=>ar(e,p,m,t),[e,t]),i=b.useCallback(()=>cr(e,t),[e,t]),o=b.useCallback(p=>lr(e,p),[e]),c=b.useCallback(()=>ur(e),[e]),h=b.useCallback(p=>dr(e,p),[e]),l=b.useCallback(p=>fr(e,p),[e]),u=b.useCallback(p=>hr(e,p),[e]),y=b.useCallback(()=>pr(e),[e]),g=b.useCallback(p=>mr(e,p),[e]),E=b.useCallback(()=>yr(e),[e]),d=b.useCallback(()=>wr(e),[e]);return{sendEmailOtp:r,loginWithOtp:s,createAnonymousUser:i,addUserIntegration:o,giveUserConsent:c,testCredentials:h,getSupportedProviders:l,searchProviders:u,getUserIntegrations:y,getUserUsedChains:g,getClientInfo:E,getUserInfo:d,linkToken:e,clientId:t}}function D(...e){return e.filter(Boolean).join(" ")}const fe=b.forwardRef(({variant:e="primary",size:t="md",className:n,children:r,...s},i)=>{const o=D("kc-button",`kc-button--${e}`,`kc-button--${t}`,n);return f.jsx("button",{ref:i,className:o,...s,children:r})});fe.displayName="Button";var M=(e=>(e.INIT="INIT",e.AUTH="AUTH",e.OTP="OTP",e.INTEGRATION="INTEGRATION",e.PERMISSIONS="PERMISSIONS",e.STATUS="STATUS",e.END="END",e))(M||{});const gr=({...e})=>f.jsx("svg",{fill:"currentColor",width:"24px",height:"24px",viewBox:"0 0 0.72 0.72",xmlns:"http://www.w3.org/2000/svg",...e,children:f.jsx("path",{d:"M0.658 0.348C0.597 0.207 0.483 0.12 0.36 0.12s-0.237 0.087 -0.298 0.228a0.03 0.03 0 0 0 0 0.024C0.123 0.513 0.237 0.6 0.36 0.6s0.237 -0.087 0.298 -0.228a0.03 0.03 0 0 0 0 -0.024M0.36 0.54c-0.095 0 -0.185 -0.069 -0.237 -0.18C0.175 0.249 0.265 0.18 0.36 0.18s0.185 0.069 0.237 0.18c-0.052 0.111 -0.142 0.18 -0.237 0.18m0 -0.3a0.12 0.12 0 1 0 0.12 0.12 0.12 0.12 0 0 0 -0.12 -0.12m0 0.18a0.06 0.06 0 1 1 0.06 -0.06 0.06 0.06 0 0 1 -0.06 0.06"})}),br=({...e})=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[f.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),f.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]}),Er=({className:e="",...t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`kc-animate-spin ${e}`,...t,children:f.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),Sr=({...e})=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[f.jsx("path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}),f.jsx("path",{d:"m9 12 2 2 4-4"})]}),St=b.forwardRef(({variant:e="default",className:t,children:n,...r},s)=>f.jsx("div",{ref:s,role:"alert",className:D("kc-alert",`kc-alert--${e}`,t),...r,children:n}));St.displayName="Alert";const Cr=b.forwardRef(({className:e,children:t,...n},r)=>f.jsx("div",{ref:r,className:D("kc-alert-title",e),...n,children:t}));Cr.displayName="AlertTitle";const Ct=b.forwardRef(({className:e,children:t,...n},r)=>f.jsx("div",{ref:r,className:D("kc-alert-description",e),...n,children:t}));Ct.displayName="AlertDescription";const Or=()=>{const{config:e}=v();return f.jsx("div",{className:"kc-sandbox-mode",children:"Sandbox Mode"})},Ot=({isDarkTheme:e,width:t="36",height:n="36"})=>f.jsxs("svg",{width:t,height:n,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("path",{d:"M0 4.11429C0 1.84203 1.84203 0 4.11429 0H31.8857C34.158 0 36 1.84203 36 4.11429V31.8857C36 34.158 34.158 36 31.8857 36H4.11429C1.84203 36 0 34.158 0 31.8857V4.11429Z",fill:e?"white":"#00C693"}),f.jsx("path",{d:"M12.3916 28.2857H8.43388C8.03646 28.2857 7.71429 27.9886 7.71429 27.6221V22.92C7.71429 22.744 7.7901 22.5752 7.92505 22.4508L9.66229 20.8487C9.79724 20.7243 9.98027 20.6544 10.1711 20.6544H12.3916C12.789 20.6544 13.1112 20.9515 13.1112 21.318V27.6221C13.1112 27.9886 12.789 28.2857 12.3916 28.2857Z",fill:e?"#00C693":"white"}),f.jsx("path",{d:"M27.5647 28.2857H22.0443C21.8535 28.2857 21.6704 28.2158 21.5355 28.0914L13.9798 21.1236C13.6988 20.8645 13.6988 20.4443 13.9798 20.1851L15.7788 18.5262C15.9137 18.4017 16.0968 18.3318 16.2876 18.3318H18.21C18.4009 18.3318 18.5839 18.4017 18.7189 18.5262L28.0735 27.1529C28.5268 27.5709 28.2058 28.2857 27.5647 28.2857Z",fill:e?"#00C693":"white"}),f.jsx("path",{d:"M27.5647 7.71429H22.0443C21.8535 7.71429 21.6704 7.7842 21.5355 7.90865L13.9798 14.8764C13.6988 15.1355 13.6988 15.5557 13.9798 15.8149L15.7788 17.4738C15.9137 17.5983 16.0968 17.6682 16.2876 17.6682H18.21C18.4009 17.6682 18.5839 17.5983 18.7189 17.4738L28.0735 8.84711C28.5268 8.42907 28.2058 7.71429 27.5647 7.71429Z",fill:e?"#00C693":"white"}),f.jsx("path",{d:"M12.3916 7.71429H8.43388C8.03646 7.71429 7.71429 8.01139 7.71429 8.37788V13.08C7.71429 13.256 7.7901 13.4248 7.92505 13.5492L9.66229 15.1513C9.79724 15.2757 9.98027 15.3456 10.1711 15.3456H12.3916C12.789 15.3456 13.1112 15.0485 13.1112 14.682V8.37788C13.1112 8.01139 12.789 7.71429 12.3916 7.71429Z",fill:e?"#00C693":"white"})]}),Tr=()=>f.jsxs("div",{className:"kc-powered-by",children:["Powered by"," ",f.jsx("span",{className:"kc-powered-by-logo",onClick:()=>window.open("https://kryptos.io","_blank"),children:f.jsx(Ot,{height:"16",width:"16"})})]}),Tt=()=>f.jsxs("div",{className:"kc-footer",children:[f.jsx(Tr,{}),f.jsx(Or,{})]}),Le=({isOpen:e,onClose:t,children:n,size:r="md",closeOnOverlayClick:s=!0,closeOnEsc:i=!0,disableClose:o=!0,className:c})=>{const h=b.useCallback(l=>{!o&&s&&l.target===l.currentTarget&&t()},[o,s,t]);return b.useEffect(()=>{const l=u=>{!o&&i&&u.key==="Escape"&&t()};return e&&(document.addEventListener("keydown",l),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",l),document.body.style.overflow="unset"}},[e,o,i,t]),e?f.jsx("div",{className:"kc-modal-overlay",onClick:h,children:f.jsx("div",{className:D("kc-modal-container",`kc-modal-container--${r}`,c),children:n})}):null};Le.displayName="Modal";const Ue=({children:e,onClose:t,showCloseButton:n=!0,className:r})=>f.jsxs("div",{className:D("kc-modal-header",r),children:[f.jsx("div",{className:"kc-modal-title",children:e}),n&&t&&f.jsx("button",{className:"kc-modal-close",onClick:t,"aria-label":"Close modal",children:f.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:f.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]});Ue.displayName="ModalHeader";const _e=({children:e,className:t})=>f.jsx("div",{className:D("kc-modal-body",t),children:e});_e.displayName="ModalBody";const Ie=({children:e,className:t})=>f.jsx("div",{className:D("kc-modal-footer",t),children:e});Ie.displayName="ModalFooter";const Nr=({...e})=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[f.jsx("path",{d:"m19 5 3-3"}),f.jsx("path",{d:"m2 22 3-3"}),f.jsx("path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z"}),f.jsx("path",{d:"M7.5 13.5 10 11"}),f.jsx("path",{d:"M10.5 16.5 13 14"}),f.jsx("path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z"})]}),Ar=()=>f.jsx("div",{className:"kc-connect-logo-fixed",children:f.jsx(Ot,{})}),kr=()=>{const{appName:e,appLogo:t}=v(),n=s=>{try{return new URL(s),!0}catch{return!1}},r=()=>b.isValidElement(t)?t:typeof t=="string"&&n(t)?f.jsx("img",{src:t,alt:"app-logo",width:24,height:24}):e?e.charAt(0).toUpperCase():"?";return f.jsxs("div",{className:"kc-connect-logo-container",children:[f.jsx(Ar,{}),f.jsx(Nr,{}),f.jsx("div",{className:"kc-connect-logo-dynamic",children:r()})]})},xr=({open:e,onGuestSuccess:t,onClose:n})=>{const{appName:r,setUser:s}=v(),{createAnonymousUser:i}=xe(),[o,c]=b.useState(!1),[h,l]=b.useState(""),u=()=>{n(),l("")},y=async()=>{var g,E;try{c(!0),l("");const d=await i();s(d),t()}catch(d){console.error(d),l(((E=(g=d==null?void 0:d.response)==null?void 0:g.data)==null?void 0:E.message)||"Failed to continue as guest")}finally{c(!1)}};return f.jsxs(Le,{isOpen:e,onClose:u,children:[f.jsxs(Ue,{onClose:u,children:[null," "]}),f.jsx(_e,{children:f.jsxs("div",{className:"kc-auth",children:[f.jsxs("div",{className:"kc-auth-title",children:["Link your accounts to"," ",f.jsx("span",{className:"kc-auth-title-app-name",children:r})," using Kryptos"]}),f.jsx(kr,{}),[{icon:f.jsx(br,{}),title:"Simple and secure",text:"Link your accounts in just a few clicks"},{icon:f.jsx(Sr,{}),title:"Control what you share",text:"We never share your data without your permission"},{icon:f.jsx(gr,{}),title:"View Only Access",text:"Kryptos retrieves view-only data and cannot perform any transactions on your behalf."}].map(g=>f.jsxs("div",{className:"kc-auth-info-section",children:[f.jsx("span",{className:"kc-auth-info-icon",children:g.icon}),f.jsxs("div",{className:"kc-auth-info-content",children:[f.jsx("div",{className:"kc-auth-info-title",children:g.title}),f.jsx("div",{className:"kc-auth-info-description",children:g.text})]})]},g.title)),h&&f.jsx(St,{variant:"destructive",children:f.jsx(Ct,{children:h})}),f.jsxs("div",{className:"kc-auth-footer",children:["By continuing, you agree to Kryptos"," ",f.jsx("a",{target:"_blank",rel:"noreferrer",href:"https://kryptos.io/privacy-policy",children:"Privacy Policy"})," ","and"," ",f.jsx("a",{target:"_blank",rel:"noreferrer",href:"https://kryptos.io/terms-of-services",children:"Terms of Service"})]}),f.jsx(fe,{onClick:y,variant:"primary",disabled:o,style:{width:"100%"},children:o?f.jsx(Er,{className:"size-4"}):"Continue"})]})}),f.jsx(Ie,{children:f.jsx(Tt,{})})]})},Lr=({open:e,onSuccess:t,onClose:n,generateLinkToken:r})=>{const{setIsInitialized:s,isInitialized:i,setLinkToken:o,setIsAuthorized:c,setUser:h}=v(),{getUserInfo:l}=xe();return b.useEffect(()=>{(async()=>{const y=await r();if(o(y.link_token),s(!0),c(!!(y!=null&&y.isAuthorized)),y.isAuthorized){const g=await l();h(g)}t(y.isAuthorized?{isAuthorized:!0}:null)})()},[]),f.jsxs(Le,{isOpen:e,onClose:n,size:"sm",children:[f.jsx(Ue,{onClose:n,children:"Kryptos Connect"}),f.jsx(_e,{children:f.jsxs("div",{className:"kc-init-container",children:[f.jsx("div",{className:"kc-init-spinner"}),f.jsx("p",{className:"kc-init-message",children:i?"Initialized!":"Initializing..."})]})}),f.jsx(Ie,{children:f.jsx(Tt,{})})]})},Ur=({open:e,onClose:t,onConnectSuccess:n,onConnectError:r,generateLinkToken:s,integrationName:i,currentStep:o,setCurrentStep:c})=>{const{theme:h}=v();return e?f.jsxs("div",{className:"kc-connect-flow","data-kc-theme":h,children:[o===M.INIT&&f.jsx(Lr,{open:e,generateLinkToken:s,onSuccess:l=>{l!=null&&l.isAuthorized?c(M.INTEGRATION):c(M.AUTH)},onClose:()=>t()}),o===M.AUTH&&f.jsx(xr,{open:e,onGuestSuccess:()=>c(M.INTEGRATION),onClose:()=>t()})]}):null};function _r({generateLinkToken:e,onConnectSuccess:t,onConnectError:n,children:r,className:s,disabled:i=!1,size:o="md",integrationName:c,...h}){const{setIsInitialized:l,setIsAuthorized:u,setLinkToken:y,setUser:g,setEmail:E,setUserConsent:d}=v(),[p,m]=b.useState(!1),[S,A]=b.useState(!1),[O,T]=b.useState(M.INIT),I=async()=>{if(!i)try{m(!0),A(!0)}catch(L){console.error("Kryptos Connect Modal error:",L)}},F=()=>{A(!1),m(!1),l(!1),T(M.INIT),d(null),g(null),E(""),y("")};return f.jsxs(f.Fragment,{children:[f.jsx(fe,{onClick:I,disabled:i||p,size:o,className:s,"aria-busy":p,...h,children:p?"Connecting...":r??(c?`Connect ${c} Account`:"Connect with Kryptos")}),f.jsx(Ur,{open:S,onClose:F,onConnectSuccess:t,onConnectError:n,generateLinkToken:e,integrationName:c,currentStep:O,setCurrentStep:T})]})}P.Button=fe,P.KryptosConnectButton=_r,P.KryptosConnectProvider=Pt,P.useKryptosApi=xe,P.useKryptosContext=v,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})});
@@ -1,5 +1,5 @@
1
1
  import React, { ComponentType, useEffect, useState } from "react";
2
- import { isKryptosSDKLoaded, loadKryptosSDK } from "./load-remote";
2
+ import { isKryptosSDKLoaded, loadKryptosSDK, setCdnBaseUrl } from "./load-remote";
3
3
 
4
4
  /**
5
5
  * Kryptos Connect SDK - NPM Wrapper
@@ -15,6 +15,8 @@ export interface KryptosConfig {
15
15
  clientId?: string;
16
16
  environment?: "sandbox" | "production";
17
17
  baseUrl?: string;
18
+ /** Custom CDN base URL for loading SDK assets (e.g., "http://localhost:5173/dist" for local dev) */
19
+ cdnBaseUrl?: string;
18
20
  appName: string;
19
21
  appLogo?: React.ReactNode | string;
20
22
  walletConnectProjectId: string;
@@ -58,6 +60,12 @@ function withSDKLoader<P extends object>(
58
60
  return;
59
61
  }
60
62
 
63
+ // Set custom CDN URL from config if provided
64
+ const config = (props as any).config;
65
+ if (config?.cdnBaseUrl) {
66
+ setCdnBaseUrl(config.cdnBaseUrl);
67
+ }
68
+
61
69
  // If already loaded, use it immediately
62
70
  if (isKryptosSDKLoaded()) {
63
71
  const loadedSDK = (window as any).__KRYPTOS_SDK__;
@@ -114,4 +122,4 @@ export const KryptosConnectButton = withSDKLoader<KryptosConnectButtonProps>(
114
122
  );
115
123
 
116
124
  // Export utility functions
117
- export { isKryptosSDKLoaded, loadKryptosSDK } from "./load-remote";
125
+ export { isKryptosSDKLoaded, loadKryptosSDK, setCdnBaseUrl } from "./load-remote";
@@ -5,20 +5,34 @@
5
5
 
6
6
  import React from "react";
7
7
  import ReactDOM from "react-dom";
8
+ import * as ReactJSXRuntime from "react/jsx-runtime";
8
9
 
9
- // For local testing, use the local build output
10
- // For production, use the remote CDN URL
11
- // The dev server (Vite/Next.js) should serve /dist from the root project
12
- // const CDN_BASE_URL =
13
- // process.env.NODE_ENV === "production"
14
- // ? "https://kryptos.com/sdk"
15
- // : typeof window !== "undefined" && window.location.origin
16
- // ? `${window.location.origin}/dist`
17
- // : "http://localhost:5001/dist";
18
- const CDN_BASE_URL = "https://assets.kryptos.io/kryptos-connect/web";
10
+ // Default CDN URL always used unless overridden via setCdnBaseUrl() or config.cdnBaseUrl
11
+ const DEFAULT_CDN_BASE_URL = "https://assets.kryptos.io/kryptos-connect/web";
19
12
 
20
- const CDN_JS_URL = `${CDN_BASE_URL}/kryptos-sdk.umd.js`;
21
- const CDN_CSS_URL = `${CDN_BASE_URL}/style.css`;
13
+ // Configurable CDN base URL (set via setCdnBaseUrl or KryptosConfig.cdnBaseUrl)
14
+ let cdnBaseUrl: string = DEFAULT_CDN_BASE_URL;
15
+
16
+ /**
17
+ * Set a custom CDN base URL for loading the SDK assets.
18
+ * Call this before any components render, or pass cdnBaseUrl in KryptosConfig.
19
+ * Useful for local development (e.g., "http://localhost:5173/dist")
20
+ */
21
+ export function setCdnBaseUrl(url: string): void {
22
+ cdnBaseUrl = url;
23
+ // Reset loading state so SDK reloads from the new URL
24
+ loadingPromise = null;
25
+ isLoaded = false;
26
+ cssLoaded = false;
27
+ }
28
+
29
+ function getCdnJsUrl(): string {
30
+ return `${cdnBaseUrl}/kryptos-sdk.umd.js`;
31
+ }
32
+
33
+ function getCdnCssUrl(): string {
34
+ return `${cdnBaseUrl}/style.css`;
35
+ }
22
36
 
23
37
  const GLOBAL_NAME = "__KRYPTOS_SDK__";
24
38
 
@@ -42,6 +56,10 @@ function ensureReactGlobals(): void {
42
56
  (window as any).ReactDOM = ReactDOM;
43
57
  console.log("[Kryptos SDK] Exposed ReactDOM globally for UMD bundle");
44
58
  }
59
+
60
+ if (!(window as any).ReactJSXRuntime) {
61
+ (window as any).ReactJSXRuntime = ReactJSXRuntime;
62
+ }
45
63
  }
46
64
 
47
65
  /**
@@ -55,7 +73,7 @@ function loadCSS(): Promise<void> {
55
73
  return new Promise((resolve, reject) => {
56
74
  const link = document.createElement("link");
57
75
  link.rel = "stylesheet";
58
- link.href = CDN_CSS_URL;
76
+ link.href = getCdnCssUrl();
59
77
 
60
78
  link.onload = () => {
61
79
  cssLoaded = true;
@@ -63,7 +81,7 @@ function loadCSS(): Promise<void> {
63
81
  };
64
82
 
65
83
  link.onerror = () => {
66
- reject(new Error(`Failed to load CSS from ${CDN_CSS_URL}`));
84
+ reject(new Error(`Failed to load CSS from ${getCdnCssUrl()}`));
67
85
  };
68
86
 
69
87
  document.head.appendChild(link);
@@ -107,7 +125,7 @@ export function loadKryptosSDK(): Promise<any> {
107
125
 
108
126
  // Create script tag
109
127
  const script = document.createElement("script");
110
- script.src = CDN_JS_URL;
128
+ script.src = getCdnJsUrl();
111
129
  script.async = true;
112
130
 
113
131
  script.onload = () => {
@@ -126,7 +144,7 @@ export function loadKryptosSDK(): Promise<any> {
126
144
  };
127
145
 
128
146
  script.onerror = () => {
129
- reject(new Error(`Failed to load SDK from ${CDN_JS_URL}`));
147
+ reject(new Error(`Failed to load SDK from ${getCdnJsUrl()}`));
130
148
  };
131
149
 
132
150
  // Append to document
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kryptos-connect-dynamic-sdk",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -11,6 +11,7 @@
11
11
  "scripts": {
12
12
  "build:cdn": "vite build",
13
13
  "dev": "vite build --watch",
14
+ "dev:serve": "vite preview --outDir dist --port 5001",
14
15
  "typecheck": "tsc --noEmit"
15
16
  },
16
17
  "keywords": [