@fuul/sdk 7.5.3 → 7.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/affiliate-portal/AffiliatePortalService.d.ts +2 -1
- package/dist/affiliate-portal/AffiliatePortalService.d.ts.map +1 -1
- package/dist/affiliate-portal/types/index.d.ts +9 -0
- package/dist/affiliate-portal/types/index.d.ts.map +1 -1
- package/dist/core.d.ts +16 -1
- package/dist/core.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +531 -517
- package/dist/index.umd.js +6 -6
- package/dist/release.json.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(A,P){typeof exports=="object"&&typeof module<"u"?P(exports):typeof define=="function"&&define.amd?define(["exports"],P):(A=typeof globalThis<"u"?globalThis:A||self,P(A.Fuul={}))})(this,function(A){"use strict";var rs=Object.defineProperty;var ns=(A,P,H)=>P in A?rs(A,P,{enumerable:!0,configurable:!0,writable:!0,value:H}):A[P]=H;var S=(A,P,H)=>ns(A,typeof P!="symbol"?P+"":P,H);function P(e,t){return function(){return e.apply(t,arguments)}}const{toString:H}=Object.prototype,{getPrototypeOf:me}=Object,{iterator:te,toStringTag:qe}=Symbol,re=(e=>t=>{const r=H.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),U=e=>(e=e.toLowerCase(),t=>re(t)===e),ne=e=>t=>typeof t===e,{isArray:K}=Array,X=ne("undefined");function Q(e){return e!==null&&!X(e)&&e.constructor!==null&&!X(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ve=U("ArrayBuffer");function xt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ve(e.buffer),t}const Nt=ne("string"),O=ne("function"),Ie=ne("number"),Y=e=>e!==null&&typeof e=="object",Ut=e=>e===!0||e===!1,se=e=>{if(re(e)!=="object")return!1;const t=me(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(qe in e)&&!(te in e)},Lt=e=>{if(!Y(e)||Q(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Ft=U("Date"),Dt=U("File"),kt=U("Blob"),Bt=U("FileList"),qt=e=>Y(e)&&O(e.pipe),vt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||O(e.append)&&((t=re(e))==="formdata"||t==="object"&&O(e.toString)&&e.toString()==="[object FormData]"))},It=U("URLSearchParams"),[jt,$t,Mt,Ht]=["ReadableStream","Request","Response","Headers"].map(U),Kt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function G(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),K(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(Q(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let c;for(n=0;n<o;n++)c=i[n],t.call(null,e[c],c,e)}}function je(e,t){if(Q(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,s;for(;n-- >0;)if(s=r[n],t===s.toLowerCase())return s;return null}const q=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,$e=e=>!X(e)&&e!==q;function ye(){const{caseless:e}=$e(this)&&this||{},t={},r=(n,s)=>{const i=e&&je(t,s)||s;se(t[i])&&se(n)?t[i]=ye(t[i],n):se(n)?t[i]=ye({},n):K(n)?t[i]=n.slice():t[i]=n};for(let n=0,s=arguments.length;n<s;n++)arguments[n]&&G(arguments[n],r);return t}const Vt=(e,t,r,{allOwnKeys:n}={})=>(G(t,(s,i)=>{r&&O(s)?e[i]=P(s,r):e[i]=s},{allOwnKeys:n}),e),zt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Jt=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},Wt=(e,t,r,n)=>{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],(!n||n(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=r!==!1&&me(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Xt=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},Qt=e=>{if(!e)return null;if(K(e))return e;let t=e.length;if(!Ie(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Yt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&me(Uint8Array)),Gt=(e,t)=>{const n=(e&&e[te]).call(e);let s;for(;(s=n.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},Zt=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},er=U("HTMLFormElement"),tr=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),Me=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),rr=U("RegExp"),He=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};G(r,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(n[i]=o||s)}),Object.defineProperties(e,n)},nr=e=>{He(e,(t,r)=>{if(O(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(O(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},sr=(e,t)=>{const r={},n=s=>{s.forEach(i=>{r[i]=!0})};return K(e)?n(e):n(String(e).split(t)),r},ir=()=>{},or=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function ar(e){return!!(e&&O(e.append)&&e[qe]==="FormData"&&e[te])}const cr=e=>{const t=new Array(10),r=(n,s)=>{if(Y(n)){if(t.indexOf(n)>=0)return;if(Q(n))return n;if(!("toJSON"in n)){t[s]=n;const i=K(n)?[]:{};return G(n,(o,c)=>{const f=r(o,s+1);!X(f)&&(i[c]=f)}),t[s]=void 0,i}}return n};return r(e,0)},ur=U("AsyncFunction"),lr=e=>e&&(Y(e)||O(e))&&O(e.then)&&O(e.catch),Ke=((e,t)=>e?setImmediate:t?((r,n)=>(q.addEventListener("message",({source:s,data:i})=>{s===q&&i===r&&n.length&&n.shift()()},!1),s=>{n.push(s),q.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",O(q.postMessage)),fr=typeof queueMicrotask<"u"?queueMicrotask.bind(q):typeof process<"u"&&process.nextTick||Ke,a={isArray:K,isArrayBuffer:ve,isBuffer:Q,isFormData:vt,isArrayBufferView:xt,isString:Nt,isNumber:Ie,isBoolean:Ut,isObject:Y,isPlainObject:se,isEmptyObject:Lt,isReadableStream:jt,isRequest:$t,isResponse:Mt,isHeaders:Ht,isUndefined:X,isDate:Ft,isFile:Dt,isBlob:kt,isRegExp:rr,isFunction:O,isStream:qt,isURLSearchParams:It,isTypedArray:Yt,isFileList:Bt,forEach:G,merge:ye,extend:Vt,trim:Kt,stripBOM:zt,inherits:Jt,toFlatObject:Wt,kindOf:re,kindOfTest:U,endsWith:Xt,toArray:Qt,forEachEntry:Gt,matchAll:Zt,isHTMLForm:er,hasOwnProperty:Me,hasOwnProp:Me,reduceDescriptors:He,freezeMethods:nr,toObjectSet:sr,toCamelCase:tr,noop:ir,toFiniteNumber:or,findKey:je,global:q,isContextDefined:$e,isSpecCompliantForm:ar,toJSONObject:cr,isAsyncFn:ur,isThenable:lr,setImmediate:Ke,asap:fr,isIterable:e=>e!=null&&O(e[te])};function m(e,t,r,n,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(m,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});const Ve=m.prototype,ze={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{ze[e]={value:e}}),Object.defineProperties(m,ze),Object.defineProperty(Ve,"isAxiosError",{value:!0}),m.from=(e,t,r,n,s,i)=>{const o=Object.create(Ve);return a.toFlatObject(e,o,function(f){return f!==Error.prototype},c=>c!=="isAxiosError"),m.call(o,e.message,t,r,n,s),o.cause=e,o.name=e.name,i&&Object.assign(o,i),o};const dr=null;function ge(e){return a.isPlainObject(e)||a.isArray(e)}function Je(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function We(e,t,r){return e?e.concat(t).map(function(s,i){return s=Je(s),!r&&i?"["+s+"]":s}).join(r?".":""):t}function hr(e){return a.isArray(e)&&!e.some(ge)}const pr=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function ie(e,t,r){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=a.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,p){return!a.isUndefined(p[y])});const n=r.metaTokens,s=r.visitor||l,i=r.dots,o=r.indexes,f=(r.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(h){if(h===null)return"";if(a.isDate(h))return h.toISOString();if(a.isBoolean(h))return h.toString();if(!f&&a.isBlob(h))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(h)||a.isTypedArray(h)?f&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function l(h,y,p){let E=h;if(h&&!p&&typeof h=="object"){if(a.endsWith(y,"{}"))y=n?y:y.slice(0,-2),h=JSON.stringify(h);else if(a.isArray(h)&&hr(h)||(a.isFileList(h)||a.endsWith(y,"[]"))&&(E=a.toArray(h)))return y=Je(y),E.forEach(function(R,D){!(a.isUndefined(R)||R===null)&&t.append(o===!0?We([y],D,i):o===null?y:y+"[]",u(R))}),!1}return ge(h)?!0:(t.append(We(p,y,i),u(h)),!1)}const d=[],g=Object.assign(pr,{defaultVisitor:l,convertValue:u,isVisitable:ge});function w(h,y){if(!a.isUndefined(h)){if(d.indexOf(h)!==-1)throw Error("Circular reference detected in "+y.join("."));d.push(h),a.forEach(h,function(E,_){(!(a.isUndefined(E)||E===null)&&s.call(t,E,a.isString(_)?_.trim():_,y,g))===!0&&w(E,y?y.concat(_):[_])}),d.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return w(e),t}function Xe(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function we(e,t){this._pairs=[],e&&ie(e,this,t)}const Qe=we.prototype;Qe.append=function(t,r){this._pairs.push([t,r])},Qe.toString=function(t){const r=t?function(n){return t.call(this,n,Xe)}:Xe;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function mr(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ye(e,t,r){if(!t)return e;const n=r&&r.encode||mr;a.isFunction(r)&&(r={serialize:r});const s=r&&r.serialize;let i;if(s?i=s(t,r):i=a.isURLSearchParams(t)?t.toString():new we(t,r).toString(n),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ge{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.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(n){n!==null&&t(n)})}}const Ze={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},yr={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:we,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},be=typeof window<"u"&&typeof document<"u",Ee=typeof navigator=="object"&&navigator||void 0,gr=be&&(!Ee||["ReactNative","NativeScript","NS"].indexOf(Ee.product)<0),wr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",br=be&&window.location.href||"http://localhost",T={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:be,hasStandardBrowserEnv:gr,hasStandardBrowserWebWorkerEnv:wr,navigator:Ee,origin:br},Symbol.toStringTag,{value:"Module"})),...yr};function Er(e,t){return ie(e,new T.classes.URLSearchParams,{visitor:function(r,n,s,i){return T.isNode&&a.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function Sr(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Cr(e){const t={},r=Object.keys(e);let n;const s=r.length;let i;for(n=0;n<s;n++)i=r[n],t[i]=e[i];return t}function et(e){function t(r,n,s,i){let o=r[i++];if(o==="__proto__")return!0;const c=Number.isFinite(+o),f=i>=r.length;return o=!o&&a.isArray(s)?s.length:o,f?(a.hasOwnProp(s,o)?s[o]=[s[o],n]:s[o]=n,!c):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),t(r,n,s[o],i)&&a.isArray(s[o])&&(s[o]=Cr(s[o])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const r={};return a.forEachEntry(e,(n,s)=>{t(Sr(n),s,r,0)}),r}return null}function _r(e,t,r){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(0,JSON.stringify)(e)}const Z={transitional:Ze,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",s=n.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 r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Er(t,this.formSerializer).toString();if((c=a.isFileList(t))||n.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return ie(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return i||s?(r.setContentType("application/json",!1),_r(t)):t}],transformResponse:[function(t){const r=this.transitional||Z.transitional,n=r&&r.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(n&&!this.responseType||s)){const o=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(o)throw c.name==="SyntaxError"?m.from(c,m.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:T.classes.FormData,Blob:T.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=>{Z.headers[e]={}});const Rr=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"]),Ar=e=>{const t={};let r,n,s;return e&&e.split(`
|
|
2
|
-
`).forEach(function(o){s=o.indexOf(":"),r=o.substring(0,s).trim().toLowerCase(),n=o.substring(s+1).trim(),!(!r||t[r]&&
|
|
3
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(s=>n.set(s)),n}static accessor(t){const n=(this[tt]=this[tt]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=ee(o);n[c]||(xr(s,o),n[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 r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),a.freezeMethods(x);function Ce(e,t){const r=this||Z,n=t||r,s=x.from(n.headers);let i=n.data;return a.forEach(e,function(c){i=c.call(r,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function rt(e){return!!(e&&e.__CANCEL__)}function V(e,t,r){m.call(this,e??"canceled",m.ERR_CANCELED,t,r),this.name="CanceledError"}a.inherits(V,m,{__CANCEL__:!0});function nt(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new m("Request failed with status code "+r.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Nr(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Ur(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(f){const u=Date.now(),l=n[i];o||(o=u),r[s]=f,n[s]=u;let d=i,g=0;for(;d!==s;)g+=r[d++],d=d%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),u-o<t)return;const w=l&&u-l;return w?Math.round(g*1e3/w):void 0}}function Lr(e,t){let r=0,n=1e3/t,s,i;const o=(u,l=Date.now())=>{r=l,s=null,i&&(clearTimeout(i),i=null),e(...u)};return[(...u)=>{const l=Date.now(),d=l-r;d>=n?o(u,l):(s=u,i||(i=setTimeout(()=>{i=null,o(s)},n-d)))},()=>s&&o(s)]}const ae=(e,t,r=3)=>{let n=0;const s=Ur(50,250);return Lr(i=>{const o=i.loaded,c=i.lengthComputable?i.total:void 0,f=o-n,u=s(f),l=o<=c;n=o;const d={loaded:o,total:c,progress:c?o/c:void 0,bytes:f,rate:u||void 0,estimated:u&&c&&l?(c-o)/u:void 0,event:i,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(d)},r)},st=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},it=e=>(...t)=>a.asap(()=>e(...t)),Fr=T.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,T.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(T.origin),T.navigator&&/(msie|trident)/i.test(T.navigator.userAgent)):()=>!0,Dr=T.hasStandardBrowserEnv?{write(e,t,r,n,s,i){const o=[e+"="+encodeURIComponent(t)];a.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),a.isString(n)&&o.push("path="+n),a.isString(s)&&o.push("domain="+s),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function kr(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Br(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ot(e,t,r){let n=!kr(t);return e&&(n||r==!1)?Br(e,t):t}const at=e=>e instanceof x?{...e}:e;function v(e,t){t=t||{};const r={};function n(u,l,d,g){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:g},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(u,l,d,g){if(a.isUndefined(l)){if(!a.isUndefined(u))return n(void 0,u,d,g)}else return n(u,l,d,g)}function i(u,l){if(!a.isUndefined(l))return n(void 0,l)}function o(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return n(void 0,u)}else return n(void 0,l)}function c(u,l,d){if(d in t)return n(u,l);if(d in e)return n(void 0,u)}const f={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:(u,l,d)=>s(at(u),at(l),d,!0)};return a.forEach(Object.keys({...e,...t}),function(l){const d=f[l]||s,g=d(e[l],t[l],l);a.isUndefined(g)&&d!==c||(r[l]=g)}),r}const ct=e=>{const t=v({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:c}=t;t.headers=o=x.from(o),t.url=Ye(ot(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let f;if(a.isFormData(r)){if(T.hasStandardBrowserEnv||T.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((f=o.getContentType())!==!1){const[u,...l]=f?f.split(";").map(d=>d.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...l].join("; "))}}if(T.hasStandardBrowserEnv&&(n&&a.isFunction(n)&&(n=n(t)),n||n!==!1&&Fr(t.url))){const u=s&&i&&Dr.read(i);u&&o.set(s,u)}return t},qr=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const s=ct(e);let i=s.data;const o=x.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:u}=s,l,d,g,w,h;function y(){w&&w(),h&&h(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let p=new XMLHttpRequest;p.open(s.method.toUpperCase(),s.url,!0),p.timeout=s.timeout;function E(){if(!p)return;const R=x.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),N={data:!c||c==="text"||c==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:R,config:e,request:p};nt(function(M){r(M),y()},function(M){n(M),y()},N),p=null}"onloadend"in p?p.onloadend=E:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(E)},p.onabort=function(){p&&(n(new m("Request aborted",m.ECONNABORTED,e,p)),p=null)},p.onerror=function(){n(new m("Network Error",m.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let D=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const N=s.transitional||Ze;s.timeoutErrorMessage&&(D=s.timeoutErrorMessage),n(new m(D,N.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,p)),p=null},i===void 0&&o.setContentType(null),"setRequestHeader"in p&&a.forEach(o.toJSON(),function(D,N){p.setRequestHeader(N,D)}),a.isUndefined(s.withCredentials)||(p.withCredentials=!!s.withCredentials),c&&c!=="json"&&(p.responseType=s.responseType),u&&([g,h]=ae(u,!0),p.addEventListener("progress",g)),f&&p.upload&&([d,w]=ae(f),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",w)),(s.cancelToken||s.signal)&&(l=R=>{p&&(n(!R||R.type?new V(null,e,p):R),p.abort(),p=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const _=Nr(s.url);if(_&&T.protocols.indexOf(_)===-1){n(new m("Unsupported protocol "+_+":",m.ERR_BAD_REQUEST,e));return}p.send(i||null)})},vr=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,s;const i=function(u){if(!s){s=!0,c();const l=u instanceof Error?u:this.reason;n.abort(l instanceof m?l:new V(l instanceof Error?l.message:l))}};let o=t&&setTimeout(()=>{o=null,i(new m(`timeout ${t} of ms exceeded`,m.ETIMEDOUT))},t);const c=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),e=null)};e.forEach(u=>u.addEventListener("abort",i));const{signal:f}=n;return f.unsubscribe=()=>a.asap(c),f}},Ir=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,s;for(;n<r;)s=n+t,yield e.slice(n,s),n=s},jr=async function*(e,t){for await(const r of $r(e))yield*Ir(r,t)},$r=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},ut=(e,t,r,n)=>{const s=jr(e,t);let i=0,o,c=f=>{o||(o=!0,n&&n(f))};return new ReadableStream({async pull(f){try{const{done:u,value:l}=await s.next();if(u){c(),f.close();return}let d=l.byteLength;if(r){let g=i+=d;r(g)}f.enqueue(new Uint8Array(l))}catch(u){throw c(u),u}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},ce=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",lt=ce&&typeof ReadableStream=="function",Mr=ce&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),ft=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Hr=lt&&ft(()=>{let e=!1;const t=new Request(T.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),dt=64*1024,_e=lt&&ft(()=>a.isReadableStream(new Response("").body)),ue={stream:_e&&(e=>e.body)};ce&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ue[t]&&(ue[t]=a.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new m(`Response type '${t}' is not supported`,m.ERR_NOT_SUPPORT,n)})})})(new Response);const Kr=async e=>{if(e==null)return 0;if(a.isBlob(e))return e.size;if(a.isSpecCompliantForm(e))return(await new Request(T.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(a.isArrayBufferView(e)||a.isArrayBuffer(e))return e.byteLength;if(a.isURLSearchParams(e)&&(e=e+""),a.isString(e))return(await Mr(e)).byteLength},Vr=async(e,t)=>{const r=a.toFiniteNumber(e.getContentLength());return r??Kr(t)},Re={http:dr,xhr:qr,fetch:ce&&(async e=>{let{url:t,method:r,data:n,signal:s,cancelToken:i,timeout:o,onDownloadProgress:c,onUploadProgress:f,responseType:u,headers:l,withCredentials:d="same-origin",fetchOptions:g}=ct(e);u=u?(u+"").toLowerCase():"text";let w=vr([s,i&&i.toAbortSignal()],o),h;const y=w&&w.unsubscribe&&(()=>{w.unsubscribe()});let p;try{if(f&&Hr&&r!=="get"&&r!=="head"&&(p=await Vr(l,n))!==0){let N=new Request(t,{method:"POST",body:n,duplex:"half"}),B;if(a.isFormData(n)&&(B=N.headers.get("content-type"))&&l.setContentType(B),N.body){const[M,pe]=st(p,ae(it(f)));n=ut(N.body,dt,M,pe)}}a.isString(d)||(d=d?"include":"omit");const E="credentials"in Request.prototype;h=new Request(t,{...g,signal:w,method:r.toUpperCase(),headers:l.normalize().toJSON(),body:n,duplex:"half",credentials:E?d:void 0});let _=await fetch(h,g);const R=_e&&(u==="stream"||u==="response");if(_e&&(c||R&&y)){const N={};["status","statusText","headers"].forEach(Pt=>{N[Pt]=_[Pt]});const B=a.toFiniteNumber(_.headers.get("content-length")),[M,pe]=c&&st(B,ae(it(c),!0))||[];_=new Response(ut(_.body,dt,M,()=>{pe&&pe(),y&&y()}),N)}u=u||"text";let D=await ue[a.findKey(ue,u)||"text"](_,e);return!R&&y&&y(),await new Promise((N,B)=>{nt(N,B,{data:D,headers:x.from(_.headers),status:_.status,statusText:_.statusText,config:e,request:h})})}catch(E){throw y&&y(),E&&E.name==="TypeError"&&/Load failed|fetch/i.test(E.message)?Object.assign(new m("Network Error",m.ERR_NETWORK,e,h),{cause:E.cause||E}):m.from(E,E&&E.code,e,h)}})};a.forEach(Re,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ht=e=>`- ${e}`,zr=e=>a.isFunction(e)||e===null||e===!1,pt={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let r,n;const s={};for(let i=0;i<t;i++){r=e[i];let o;if(n=r,!zr(r)&&(n=Re[(o=String(r)).toLowerCase()],n===void 0))throw new m(`Unknown adapter '${o}'`);if(n)break;s[o||"#"+i]=n}if(!n){const i=Object.entries(s).map(([c,f])=>`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let o=t?i.length>1?`since :
|
|
4
|
-
`+i.map(
|
|
5
|
-
`):" "+
|
|
6
|
-
`+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=v(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:i}=r;n!==void 0&&fe.assertOptions(n,{silentJSONParsing:L.transitional(L.boolean),forcedJSONParsing:L.transitional(L.boolean),clarifyTimeoutError:L.transitional(L.boolean)},!1),s!=null&&(a.isFunction(s)?r.paramsSerializer={serialize:s}:fe.assertOptions(s,{encode:L.function,serialize:L.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),fe.assertOptions(r,{baseUrl:L.spelling("baseURL"),withXsrfToken:L.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[r.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],h=>{delete i[h]}),r.headers=x.concat(o,i);const c=[];let f=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(r)===!1||(f=f&&y.synchronous,c.unshift(y.fulfilled,y.rejected))});const u=[];this.interceptors.response.forEach(function(y){u.push(y.fulfilled,y.rejected)});let l,d=0,g;if(!f){const h=[mt.bind(this),void 0];for(h.unshift(...c),h.push(...u),g=h.length,l=Promise.resolve(r);d<g;)l=l.then(h[d++],h[d++]);return l}g=c.length;let w=r;for(d=0;d<g;){const h=c[d++],y=c[d++];try{w=h(w)}catch(p){y.call(this,p);break}}try{l=mt.call(this,w)}catch(h){return Promise.reject(h)}for(d=0,g=u.length;d<g;)l=l.then(u[d++],u[d++]);return l}getUri(t){t=v(this.defaults,t);const r=ot(t.baseURL,t.url,t.allowAbsoluteUrls);return Ye(r,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){I.prototype[t]=function(r,n){return this.request(v(n||{},{method:t,url:r,data:(n||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function r(n){return function(i,o,c){return this.request(v(c||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}I.prototype[t]=r(),I.prototype[t+"Form"]=r(!0)});let Wr=class Ot{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(s=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](s);n._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(c=>{n.subscribe(c),i=c}).then(s);return o.cancel=function(){n.unsubscribe(i)},o},t(function(i,o,c){n.reason||(n.reason=new V(i,o,c),r(n.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 r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Ot(function(s){t=s}),cancel:t}}};function Xr(e){return function(r){return e.apply(null,r)}}function Qr(e){return a.isObject(e)&&e.isAxiosError===!0}const Te={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};Object.entries(Te).forEach(([e,t])=>{Te[t]=e});function wt(e){const t=new I(e),r=P(I.prototype.request,t);return a.extend(r,I.prototype,t,{allOwnKeys:!0}),a.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return wt(v(e,s))},r}const b=wt(Z);b.Axios=I,b.CanceledError=V,b.CancelToken=Wr,b.isCancel=rt,b.VERSION=yt,b.toFormData=ie,b.AxiosError=m,b.Cancel=b.CanceledError,b.all=function(t){return Promise.all(t)},b.spread=Xr,b.isAxiosError=Qr,b.mergeConfig=v,b.AxiosHeaders=x,b.formToJSON=e=>et(a.isHTMLForm(e)?new FormData(e):e),b.getAdapter=pt.getAdapter,b.HttpStatusCode=Te,b.default=b;const{Axios:fs,AxiosError:Pe,CanceledError:ds,isCancel:hs,CancelToken:ps,VERSION:ms,all:ys,Cancel:gs,isAxiosError:ws,spread:bs,toFormData:Es,AxiosHeaders:Ss,HttpStatusCode:Cs,formToJSON:_s,getAdapter:Rs,mergeConfig:As}=b;class Oe extends Error{constructor(r){super(r.join(", "));S(this,"errors");this.name="ValidationError",this.errors=r}}class xe extends Error{constructor(r){super("Address already registered.");S(this,"address");this.name="AddressInUseError",this.address=r}}class Ne extends Error{constructor(r){super("Code already registered.");S(this,"code");this.name="CodeInUseError",this.code=r}}class Ue extends Error{constructor(){super("Invalid signature provided"),this.name="InvalidSignatureError"}}class Yr{constructor(t){S(this,"httpClient");S(this,"_debug");this.httpClient=t.httpClient,this._debug=t.debug}async create(t,r,n,s,i,o,c){var f;try{await this.httpClient.post({path:"/affiliates",postData:{address:t,identifier_type:r,name:n,code:n,signature:s,signature_public_key:i,account_chain_id:o,user_split_percentage:c}})}catch(u){if(u instanceof Pe){const l=(f=u.response)==null?void 0:f.data;if(typeof(l==null?void 0:l.message)=="string"){const d=l.message.toLowerCase();throw d=="invalid signature"?new Ue:d=="address in use"?new xe(t):d=="code in use"?new Ne(n):new Error(d)}else if((l==null?void 0:l.message)instanceof Array)throw new Oe(l.message)}throw u}}async update(t,r,n,s,i,o){var c;try{await this.httpClient.post({path:`/affiliates/${t}`,postData:{code:n,user_identifier:t,identifier_type:r,signature:s,signature_public_key:i,account_chain_id:o}})}catch(f){if(f instanceof Pe){const u=(c=f.response)==null?void 0:c.data;if(typeof(u==null?void 0:u.message)=="string"){const l=u.message.toLowerCase();throw l=="invalid signature"?new Ue:l=="address in use"?new xe(t):l=="code in use"?new Ne(n):new Error(l)}else if((u==null?void 0:u.message)instanceof Array)throw new Oe(u.message)}throw f}}async isCodeFree(t){try{return(await this.httpClient.get({path:`/affiliates/codes/${t}`})).data.available}catch(r){throw console.error("Fuul SDK: Could not check affiliate code",r),r}}async getCode(t,r){var n;try{return(await this.httpClient.get({path:`/affiliates/${t}`,queryParams:{identifier_type:r}})).data.code}catch(s){if(s instanceof Pe&&((n=s.response)==null?void 0:n.status)===404)return null;throw console.error("Fuul SDK: Could not get affiliate code",s),s}}}const Gr="/affiliate-portal";class Zr{constructor(t){S(this,"httpClient");this.httpClient=t.httpClient}async getAffiliateStats(t){return(await this.httpClient.get({path:`${Gr}/stats`,queryParams:{user_identifier:t.user_identifier}})).data}}const en="/audiences";class tn{constructor(t){S(this,"httpClient");S(this,"_debug");this.httpClient=t.httpClient,this._debug=t.debug}async getUserAudiences(t){return(await this.httpClient.get({path:`${en}/audience-segments/user`,queryParams:{...t}})).data}}class rn{constructor(t){S(this,"httpClient");this.httpClient=t.httpClient}async getAll(t){const{data:r}=await this.httpClient.get({path:"conversions",queryParams:{...t}});return r}}const bt="fuul.sent",nn=60,sn="connect_wallet",Et=10;class on{constructor(t){S(this,"debug");S(this,"httpClient");this.httpClient=t.httpClient,this.debug=!!t.debug}async sendEvent(t,r){if(this.isDuplicate(t)){this.debug&&console.debug("Fuul SDK: Event is considered duplicate and will not be sent");return}if(!r||!Array.isArray(r)||r.length===0)await this.httpClient.post({path:"events",postData:t});else for(const n of r){const s=structuredClone({...t,project_id:n});s.metadata.project_id=n,await this.httpClient.post({path:"events",postData:s,queryParams:{project_id:n}})}this.debug&&console.debug(`Fuul SDK: Sent '${t.name}' event`),this.saveSentEvent(t)}isDuplicate(t){var l,d,g,w;const r=`${bt}_${t.name}`,n=localStorage.getItem(r);if(!n)return!1;const s=JSON.parse(n);if(this.getCurrentTimestamp()-s.timestamp>nn)return!1;let f=!1;t.metadata&&(f=s.metadata.tracking_id===t.metadata.tracking_id&&s.metadata.project_id===t.metadata.project_id&&s.metadata.referrer===t.metadata.referrer&&s.metadata.source===t.metadata.source&&s.metadata.category===t.metadata.category&&s.metadata.title===t.metadata.title&&s.metadata.tag===t.metadata.tag&&s.user_address===t.user_address&&((l=s.user)==null?void 0:l.identifier)===((d=t.user)==null?void 0:d.identifier)&&((g=s.user)==null?void 0:g.identifier_type)===((w=t.user)==null?void 0:w.identifier_type)&&s.signature===t.signature&&s.signature_message===t.signature_message);let u=!1;return t.args&&s.args&&(u=s.args.page===t.args.page),u&&f}getCurrentTimestamp(){return Date.now()/1e3}saveSentEvent(t){var o,c,f,u;const r=`${bt}_${t.name}`,n=`${r}_all`,s=this.getCurrentTimestamp(),i={...t,timestamp:s};if(localStorage.setItem(r,JSON.stringify(i)),t.name===sn){const l=JSON.parse(localStorage.getItem(n)||"[]"),d={name:t.name,user:{identifier:(o=t.user)==null?void 0:o.identifier,identifier_type:(c=t.user)==null?void 0:c.identifier_type},tracking_id:(f=t.metadata)==null?void 0:f.tracking_id,page:(u=t.args)==null?void 0:u.page};"user_address"in t&&(d.user_address=t.user_address);const g=[...l,d];g.length>Et&&g.splice(0,g.length-Et),localStorage.setItem(n,JSON.stringify(g))}}}const an={version:"7.5.3"};class cn{constructor(t){S(this,"client");S(this,"defaultQueryParams");this.client=b.create({...t,headers:{Authorization:`Bearer ${t.apiKey}`,"X-Fuul-Sdk-Version":an.version}}),this.defaultQueryParams=t.queryParams||{}}makeQueryParams(t){return Object.assign({},this.defaultQueryParams||{},t||{})}async get(t){return this.client.request({url:t.path,params:this.makeQueryParams(t.queryParams),method:"GET"})}async post(t){return this.client.request({url:t.path,params:this.makeQueryParams(t.queryParams),data:t.postData,method:"POST"})}async put(t){return this.client.request({url:t.path,params:this.makeQueryParams(t.queryParams),data:t.postData,method:"PUT"})}async patch(t){return this.client.request({url:t.path,params:this.makeQueryParams(t.queryParams),data:t.postData,method:"PATCH"})}async delete(t){return this.client.request({url:t.path,params:this.makeQueryParams(t.queryParams),method:"DELETE"})}}class un{constructor(t){S(this,"httpClient");this.httpClient=t.httpClient}async getPayoutsLeaderboard(t){return(await this.httpClient.get({path:"/payouts/leaderboard/payouts",queryParams:{...t}})).data}async getPointsLeaderboard(t){return(await this.httpClient.get({path:"/payouts/leaderboard/points",queryParams:{...t}})).data}async getReferredUsersLeaderboard(t){return(await this.httpClient.get({path:"/leaderboard/referred",queryParams:{...t}})).data}}const z="/payouts";class ln{constructor(t){S(this,"httpClient");S(this,"_debug");this.httpClient=t.httpClient,this._debug=t.debug}async getUserPayoutsByConversion(t){return(await this.httpClient.get({path:z,queryParams:{...t,type:"onchain-currency"}})).data}async getUserPointsByConversion(t){return(await this.httpClient.get({path:z,queryParams:{...t,type:"point"}})).data}async getUserPayoutMovements(t){return(await this.httpClient.get({path:`${z}/movements`,queryParams:{...t,type:"onchain-currency"}})).data}async getUserPointsMovements(t){return(await this.httpClient.get({path:`${z}/movements`,queryParams:{...t,type:"point"}})).data}async getVolumeLeaderboard(t){return(await this.httpClient.get({path:`${z}/leaderboard/volume`,queryParams:{...t}})).data}async getPayoutsByReferrer(t){return(await this.httpClient.get({path:`${z}/by-referrer`,queryParams:{user_identifier:t.user_identifier,user_identifier_type:t.user_identifier_type}})).data}}class fn{constructor(t){S(this,"httpClient");S(this,"_debug");this.httpClient=t.httpClient,this._debug=t.debug}async listUserReferralCodes(t){return(await this.httpClient.get({path:"/referral_codes",queryParams:{user_identifier:t.user_identifier,user_identifier_type:t.user_identifier_type,page:t.page,page_size:t.page_size}})).data}async generateReferralCodes(t){return(await this.httpClient.post({path:"/referral_codes",queryParams:{user_identifier:t.user_identifier,user_identifier_type:t.user_identifier_type,quantity:t.quantity,max_uses:t.max_uses}})).data}async getReferralStatus(t){return(await this.httpClient.get({path:"/referral_codes/status",queryParams:{user_identifier:t.user_identifier,user_identifier_type:t.user_identifier_type}})).data}async getReferralCode(t){return(await this.httpClient.get({path:`/referral_codes/${t.code}`})).data}async useReferralCode(t){const{code:r,user_identifier:n,user_identifier_type:s,signature:i,signature_message:o,chain_id:c}=t;await this.httpClient.patch({path:`/referral_codes/${r}/use`,queryParams:{user_identifier:n,user_identifier_type:s,chain_id:c},postData:{signature:i,signature_message:o}})}async updateReferralCode(t){await this.httpClient.patch({path:`/referral_codes/${t.code}`,postData:{max_uses:t.max_uses}})}}const dn="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let hn=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=dn[r[e]&63];return t};const pn="fuul.tracking_id",Le=()=>En(pn,()=>hn()),St=()=>J("af")||J("referrer"),mn=()=>document.referrer,yn=()=>Sn(),gn=()=>J("category"),wn=()=>J("title"),bn=()=>J("tag"),En=(e,t)=>{const r=localStorage.getItem(e);if(r)return r;{const n=t();return n?localStorage.setItem(e,n):localStorage.removeItem(e),n}},J=e=>new URLSearchParams(window.location.search).get(e),Sn=()=>{const e=J("source");if(e)return e},Cn="/user";class _n{constructor(t){S(this,"httpClient");this.httpClient=t.httpClient}async getUserReferrer(t){return(await this.httpClient.get({path:`${Cn}/referrer`,queryParams:{...t}})).data}}const Rn="https://api.fuul.xyz/api/v1/";let k=!1,Fe=!1,De,F,Ct,_t,W,Rt,de,j,At,he,$;function An(e){k=!!e.debug,!Fe&&(De=e.apiKey,Zn(),F=es(e.baseApiUrl??Rn,e.defaultQueryParams??{}),Ct=new rn({httpClient:F,debug:k}),de=new on({httpClient:F,debug:k}),W=new Yr({httpClient:F,debug:k}),Rt=new Zr({httpClient:F}),j=new ln({httpClient:F,debug:k}),_t=new _n({httpClient:F}),At=new tn({httpClient:F,debug:k}),he=new un({httpClient:F}),$=new fn({httpClient:F,debug:k}),Fe=!0,k&&console.debug("Fuul SDK: init() complete"))}function C(){if(!Fe)throw new Error("Fuul SDK: You need to call init() to initialize the library before using any methods")}async function Tn(e,t){C(),ke(),Be();const r={name:e,args:t??{},metadata:{tracking_id:Le()}};await de.sendEvent(r)}async function Pn(e,t){C(),ke(),Be();const r={name:"pageview",args:{page:e??document.location.pathname,locationOrigin:document.location.origin},metadata:{tracking_id:Le(),referrer_url:mn(),source:yn(),affiliate_id:St()??void 0,referrer:St()??void 0,category:gn()??void 0,title:wn()??void 0,tag:bn()??void 0}};await de.sendEvent(r,t)}async function On(e,t){C(),ke(),Be();const r={name:"connect_wallet",user:{identifier:e.identifier,identifier_type:e.identifierType},args:{page:document.location.pathname,locationOrigin:document.location.origin},metadata:{tracking_id:Le()}};e!=null&&e.signature&&(r.signature=e==null?void 0:e.signature,r.signature_message=e==null?void 0:e.message),e!=null&&e.signaturePublicKey&&(r.signature_public_key=e.signaturePublicKey),e!=null&&e.accountChainId&&(r.account_chain_id=e.accountChainId),await de.sendEvent(r,t)}async function xn(e){C(),await W.create(e.userIdentifier,e.identifierType,e.code,e.signature,e.signaturePublicKey,e.accountChainId,e.userSplitPercentage)}async function Nn(e){C(),await W.update(e.userIdentifier,e.identifierType,e.code,e.signature,e.signaturePublicKey,e.accountChainId)}async function Un(e,t){return C(),await W.getCode(e,t)}async function Ln(e){return C(),await W.isCodeFree(e)}async function Fn(e,t,r,n){C();const s=await W.getCode(t,r),i=new URLSearchParams({af:s??t});return n!=null&&n.title&&i.append("af_title",n.title),n!=null&&n.format&&i.append("af_format",n.format),n!=null&&n.place&&i.append("af_place",n.place),`${e}?${i.toString()}`}function Dn(e){return he.getPayoutsLeaderboard(e)}function kn(e){return he.getPointsLeaderboard(e)}function Bn(e){return he.getReferredUsersLeaderboard(e)}function qn(e){return j.getVolumeLeaderboard(e)}function vn(e){return j.getUserPayoutsByConversion(e)}function In(e){return j.getUserPointsByConversion(e)}function jn(e){return j.getUserPayoutMovements(e)}function $n(e){return j.getUserPointsMovements(e)}function Mn(e){return C(),j.getPayoutsByReferrer(e)}async function Hn(e){return C(),Ct.getAll(e)}async function Kn(e){return C(),_t.getUserReferrer(e)}async function Vn(e){return C(),At.getUserAudiences(e)}async function zn(e){return C(),$.listUserReferralCodes(e)}async function Jn(e){return C(),$.generateReferralCodes(e)}async function Wn(e){return C(),$.getReferralStatus(e)}async function Xn(e){return C(),$.getReferralCode(e)}async function Qn(e){return C(),$.useReferralCode(e)}async function Yn(e){return C(),$.updateReferralCode(e)}async function Gn(e){return C(),Rt.getAffiliateStats(e)}function ke(){if(typeof window>"u"||typeof document>"u")throw new Error("Fuul SDK: Browser context required")}function Be(){if(navigator.webdriver)throw new Error("Fuul SDK: Error")}function Zn(){if(!De)throw new Error("Fuul SDK: Invalid API key")}function es(e,t){return new cn({baseURL:e,timeout:3e4,apiKey:De,queryParams:t})}const ts={init:An,sendEvent:Tn,sendPageview:Pn,identifyUser:On,generateTrackingLink:Fn,getConversions:Hn,createAffiliateCode:xn,updateAffiliateCode:Nn,getAffiliateCode:Un,isAffiliateCodeFree:Ln,getPayoutsLeaderboard:Dn,getPointsLeaderboard:kn,getReferredUsersLeaderboard:Bn,getUserAudiences:Vn,getUserPayoutsByConversion:vn,getUserPointsByConversion:In,getUserPointsMovements:$n,getUserPayoutMovements:jn,getPayoutsByReferrer:Mn,getUserReferrer:Kn,getVolumeLeaderboard:qn,listUserReferralCodes:zn,generateReferralCodes:Jn,getReferralStatus:Wn,getReferralCode:Xn,useReferralCode:Qn,updateReferralCode:Yn,getAffiliateStats:Gn};var Tt=(e=>(e.EvmAddress="evm_address",e.SolanaAddress="solana_address",e.XRPLAddress="xrpl_address",e.SuiAddress="sui_address",e.Email="email",e))(Tt||{});A.AddressInUseError=xe,A.CodeInUseError=Ne,A.Fuul=ts,A.InvalidSignatureError=Ue,A.UserIdentifierType=Tt,A.ValidationError=Oe,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(A,P){typeof exports=="object"&&typeof module<"u"?P(exports):typeof define=="function"&&define.amd?define(["exports"],P):(A=typeof globalThis<"u"?globalThis:A||self,P(A.Fuul={}))})(this,function(A){"use strict";var ns=Object.defineProperty;var ss=(A,P,H)=>P in A?ns(A,P,{enumerable:!0,configurable:!0,writable:!0,value:H}):A[P]=H;var C=(A,P,H)=>ss(A,typeof P!="symbol"?P+"":P,H);function P(e,t){return function(){return e.apply(t,arguments)}}const{toString:H}=Object.prototype,{getPrototypeOf:me}=Object,{iterator:te,toStringTag:ve}=Symbol,re=(e=>t=>{const r=H.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),U=e=>(e=e.toLowerCase(),t=>re(t)===e),ne=e=>t=>typeof t===e,{isArray:K}=Array,X=ne("undefined");function Q(e){return e!==null&&!X(e)&&e.constructor!==null&&!X(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ie=U("ArrayBuffer");function xt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ie(e.buffer),t}const Ut=ne("string"),O=ne("function"),je=ne("number"),Y=e=>e!==null&&typeof e=="object",Lt=e=>e===!0||e===!1,se=e=>{if(re(e)!=="object")return!1;const t=me(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(ve in e)&&!(te in e)},Ft=e=>{if(!Y(e)||Q(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Dt=U("Date"),kt=U("File"),Bt=U("Blob"),qt=U("FileList"),vt=e=>Y(e)&&O(e.pipe),It=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||O(e.append)&&((t=re(e))==="formdata"||t==="object"&&O(e.toString)&&e.toString()==="[object FormData]"))},jt=U("URLSearchParams"),[$t,Mt,Ht,Kt]=["ReadableStream","Request","Response","Headers"].map(U),Vt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function G(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),K(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(Q(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let c;for(n=0;n<o;n++)c=i[n],t.call(null,e[c],c,e)}}function $e(e,t){if(Q(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,s;for(;n-- >0;)if(s=r[n],t===s.toLowerCase())return s;return null}const q=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Me=e=>!X(e)&&e!==q;function ye(){const{caseless:e}=Me(this)&&this||{},t={},r=(n,s)=>{const i=e&&$e(t,s)||s;se(t[i])&&se(n)?t[i]=ye(t[i],n):se(n)?t[i]=ye({},n):K(n)?t[i]=n.slice():t[i]=n};for(let n=0,s=arguments.length;n<s;n++)arguments[n]&&G(arguments[n],r);return t}const zt=(e,t,r,{allOwnKeys:n}={})=>(G(t,(s,i)=>{r&&O(s)?e[i]=P(s,r):e[i]=s},{allOwnKeys:n}),e),Jt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Wt=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},Xt=(e,t,r,n)=>{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],(!n||n(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=r!==!1&&me(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Qt=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},Yt=e=>{if(!e)return null;if(K(e))return e;let t=e.length;if(!je(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Gt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&me(Uint8Array)),Zt=(e,t)=>{const n=(e&&e[te]).call(e);let s;for(;(s=n.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},er=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},tr=U("HTMLFormElement"),rr=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),He=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),nr=U("RegExp"),Ke=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};G(r,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(n[i]=o||s)}),Object.defineProperties(e,n)},sr=e=>{Ke(e,(t,r)=>{if(O(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(O(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},ir=(e,t)=>{const r={},n=s=>{s.forEach(i=>{r[i]=!0})};return K(e)?n(e):n(String(e).split(t)),r},or=()=>{},ar=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function cr(e){return!!(e&&O(e.append)&&e[ve]==="FormData"&&e[te])}const ur=e=>{const t=new Array(10),r=(n,s)=>{if(Y(n)){if(t.indexOf(n)>=0)return;if(Q(n))return n;if(!("toJSON"in n)){t[s]=n;const i=K(n)?[]:{};return G(n,(o,c)=>{const f=r(o,s+1);!X(f)&&(i[c]=f)}),t[s]=void 0,i}}return n};return r(e,0)},lr=U("AsyncFunction"),fr=e=>e&&(Y(e)||O(e))&&O(e.then)&&O(e.catch),Ve=((e,t)=>e?setImmediate:t?((r,n)=>(q.addEventListener("message",({source:s,data:i})=>{s===q&&i===r&&n.length&&n.shift()()},!1),s=>{n.push(s),q.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",O(q.postMessage)),dr=typeof queueMicrotask<"u"?queueMicrotask.bind(q):typeof process<"u"&&process.nextTick||Ve,a={isArray:K,isArrayBuffer:Ie,isBuffer:Q,isFormData:It,isArrayBufferView:xt,isString:Ut,isNumber:je,isBoolean:Lt,isObject:Y,isPlainObject:se,isEmptyObject:Ft,isReadableStream:$t,isRequest:Mt,isResponse:Ht,isHeaders:Kt,isUndefined:X,isDate:Dt,isFile:kt,isBlob:Bt,isRegExp:nr,isFunction:O,isStream:vt,isURLSearchParams:jt,isTypedArray:Gt,isFileList:qt,forEach:G,merge:ye,extend:zt,trim:Vt,stripBOM:Jt,inherits:Wt,toFlatObject:Xt,kindOf:re,kindOfTest:U,endsWith:Qt,toArray:Yt,forEachEntry:Zt,matchAll:er,isHTMLForm:tr,hasOwnProperty:He,hasOwnProp:He,reduceDescriptors:Ke,freezeMethods:sr,toObjectSet:ir,toCamelCase:rr,noop:or,toFiniteNumber:ar,findKey:$e,global:q,isContextDefined:Me,isSpecCompliantForm:cr,toJSONObject:ur,isAsyncFn:lr,isThenable:fr,setImmediate:Ve,asap:dr,isIterable:e=>e!=null&&O(e[te])};function m(e,t,r,n,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(m,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});const ze=m.prototype,Je={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Je[e]={value:e}}),Object.defineProperties(m,Je),Object.defineProperty(ze,"isAxiosError",{value:!0}),m.from=(e,t,r,n,s,i)=>{const o=Object.create(ze);return a.toFlatObject(e,o,function(f){return f!==Error.prototype},c=>c!=="isAxiosError"),m.call(o,e.message,t,r,n,s),o.cause=e,o.name=e.name,i&&Object.assign(o,i),o};const hr=null;function ge(e){return a.isPlainObject(e)||a.isArray(e)}function We(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Xe(e,t,r){return e?e.concat(t).map(function(s,i){return s=We(s),!r&&i?"["+s+"]":s}).join(r?".":""):t}function pr(e){return a.isArray(e)&&!e.some(ge)}const mr=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function ie(e,t,r){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=a.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,p){return!a.isUndefined(p[y])});const n=r.metaTokens,s=r.visitor||l,i=r.dots,o=r.indexes,f=(r.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(h){if(h===null)return"";if(a.isDate(h))return h.toISOString();if(a.isBoolean(h))return h.toString();if(!f&&a.isBlob(h))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(h)||a.isTypedArray(h)?f&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function l(h,y,p){let E=h;if(h&&!p&&typeof h=="object"){if(a.endsWith(y,"{}"))y=n?y:y.slice(0,-2),h=JSON.stringify(h);else if(a.isArray(h)&&pr(h)||(a.isFileList(h)||a.endsWith(y,"[]"))&&(E=a.toArray(h)))return y=We(y),E.forEach(function(R,D){!(a.isUndefined(R)||R===null)&&t.append(o===!0?Xe([y],D,i):o===null?y:y+"[]",u(R))}),!1}return ge(h)?!0:(t.append(Xe(p,y,i),u(h)),!1)}const d=[],g=Object.assign(mr,{defaultVisitor:l,convertValue:u,isVisitable:ge});function w(h,y){if(!a.isUndefined(h)){if(d.indexOf(h)!==-1)throw Error("Circular reference detected in "+y.join("."));d.push(h),a.forEach(h,function(E,_){(!(a.isUndefined(E)||E===null)&&s.call(t,E,a.isString(_)?_.trim():_,y,g))===!0&&w(E,y?y.concat(_):[_])}),d.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return w(e),t}function Qe(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function we(e,t){this._pairs=[],e&&ie(e,this,t)}const Ye=we.prototype;Ye.append=function(t,r){this._pairs.push([t,r])},Ye.toString=function(t){const r=t?function(n){return t.call(this,n,Qe)}:Qe;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function yr(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ge(e,t,r){if(!t)return e;const n=r&&r.encode||yr;a.isFunction(r)&&(r={serialize:r});const s=r&&r.serialize;let i;if(s?i=s(t,r):i=a.isURLSearchParams(t)?t.toString():new we(t,r).toString(n),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ze{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.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(n){n!==null&&t(n)})}}const et={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},gr={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:we,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},be=typeof window<"u"&&typeof document<"u",Ee=typeof navigator=="object"&&navigator||void 0,wr=be&&(!Ee||["ReactNative","NativeScript","NS"].indexOf(Ee.product)<0),br=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Er=be&&window.location.href||"http://localhost",T={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:be,hasStandardBrowserEnv:wr,hasStandardBrowserWebWorkerEnv:br,navigator:Ee,origin:Er},Symbol.toStringTag,{value:"Module"})),...gr};function Sr(e,t){return ie(e,new T.classes.URLSearchParams,{visitor:function(r,n,s,i){return T.isNode&&a.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function Cr(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function _r(e){const t={},r=Object.keys(e);let n;const s=r.length;let i;for(n=0;n<s;n++)i=r[n],t[i]=e[i];return t}function tt(e){function t(r,n,s,i){let o=r[i++];if(o==="__proto__")return!0;const c=Number.isFinite(+o),f=i>=r.length;return o=!o&&a.isArray(s)?s.length:o,f?(a.hasOwnProp(s,o)?s[o]=[s[o],n]:s[o]=n,!c):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),t(r,n,s[o],i)&&a.isArray(s[o])&&(s[o]=_r(s[o])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const r={};return a.forEachEntry(e,(n,s)=>{t(Cr(n),s,r,0)}),r}return null}function Rr(e,t,r){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(0,JSON.stringify)(e)}const Z={transitional:et,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(tt(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Sr(t,this.formSerializer).toString();if((c=a.isFileList(t))||n.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return ie(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return i||s?(r.setContentType("application/json",!1),Rr(t)):t}],transformResponse:[function(t){const r=this.transitional||Z.transitional,n=r&&r.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(n&&!this.responseType||s)){const o=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(o)throw c.name==="SyntaxError"?m.from(c,m.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:T.classes.FormData,Blob:T.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=>{Z.headers[e]={}});const Ar=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"]),Tr=e=>{const t={};let r,n,s;return e&&e.split(`
|
|
2
|
+
`).forEach(function(o){s=o.indexOf(":"),r=o.substring(0,s).trim().toLowerCase(),n=o.substring(s+1).trim(),!(!r||t[r]&&Ar[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},rt=Symbol("internals");function ee(e){return e&&String(e).trim().toLowerCase()}function oe(e){return e===!1||e==null?e:a.isArray(e)?e.map(oe):String(e)}function Pr(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const Or=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Se(e,t,r,n,s){if(a.isFunction(n))return n.call(this,t,r);if(s&&(t=r),!!a.isString(t)){if(a.isString(n))return t.indexOf(n)!==-1;if(a.isRegExp(n))return n.test(t)}}function Nr(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function xr(e,t){const r=a.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(s,i,o){return this[n].call(this,t,s,i,o)},configurable:!0})})}let N=class{constructor(t){t&&this.set(t)}set(t,r,n){const s=this;function i(c,f,u){const l=ee(f);if(!l)throw new Error("header name must be a non-empty string");const d=a.findKey(s,l);(!d||s[d]===void 0||u===!0||u===void 0&&s[d]!==!1)&&(s[d||f]=oe(c))}const o=(c,f)=>a.forEach(c,(u,l)=>i(u,l,f));if(a.isPlainObject(t)||t instanceof this.constructor)o(t,r);else if(a.isString(t)&&(t=t.trim())&&!Or(t))o(Tr(t),r);else if(a.isObject(t)&&a.isIterable(t)){let c={},f,u;for(const l of t){if(!a.isArray(l))throw TypeError("Object iterator must return a key-value pair");c[u=l[0]]=(f=c[u])?a.isArray(f)?[...f,l[1]]:[f,l[1]]:l[1]}o(c,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=ee(t),t){const n=a.findKey(this,t);if(n){const s=this[n];if(!r)return s;if(r===!0)return Pr(s);if(a.isFunction(r))return r.call(this,s,n);if(a.isRegExp(r))return r.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=ee(t),t){const n=a.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Se(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let s=!1;function i(o){if(o=ee(o),o){const c=a.findKey(n,o);c&&(!r||Se(n,n[c],c,r))&&(delete n[c],s=!0)}}return a.isArray(t)?t.forEach(i):i(t),s}clear(t){const r=Object.keys(this);let n=r.length,s=!1;for(;n--;){const i=r[n];(!t||Se(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const r=this,n={};return a.forEach(this,(s,i)=>{const o=a.findKey(n,i);if(o){r[o]=oe(s),delete r[i];return}const c=t?Nr(i):String(i).trim();c!==i&&delete r[i],r[c]=oe(s),n[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return a.forEach(this,(n,s)=>{n!=null&&n!==!1&&(r[s]=t&&a.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
|
|
3
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(s=>n.set(s)),n}static accessor(t){const n=(this[rt]=this[rt]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=ee(o);n[c]||(xr(s,o),n[c]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}};N.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(N.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),a.freezeMethods(N);function Ce(e,t){const r=this||Z,n=t||r,s=N.from(n.headers);let i=n.data;return a.forEach(e,function(c){i=c.call(r,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function nt(e){return!!(e&&e.__CANCEL__)}function V(e,t,r){m.call(this,e??"canceled",m.ERR_CANCELED,t,r),this.name="CanceledError"}a.inherits(V,m,{__CANCEL__:!0});function st(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new m("Request failed with status code "+r.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Ur(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Lr(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(f){const u=Date.now(),l=n[i];o||(o=u),r[s]=f,n[s]=u;let d=i,g=0;for(;d!==s;)g+=r[d++],d=d%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),u-o<t)return;const w=l&&u-l;return w?Math.round(g*1e3/w):void 0}}function Fr(e,t){let r=0,n=1e3/t,s,i;const o=(u,l=Date.now())=>{r=l,s=null,i&&(clearTimeout(i),i=null),e(...u)};return[(...u)=>{const l=Date.now(),d=l-r;d>=n?o(u,l):(s=u,i||(i=setTimeout(()=>{i=null,o(s)},n-d)))},()=>s&&o(s)]}const ae=(e,t,r=3)=>{let n=0;const s=Lr(50,250);return Fr(i=>{const o=i.loaded,c=i.lengthComputable?i.total:void 0,f=o-n,u=s(f),l=o<=c;n=o;const d={loaded:o,total:c,progress:c?o/c:void 0,bytes:f,rate:u||void 0,estimated:u&&c&&l?(c-o)/u:void 0,event:i,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(d)},r)},it=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},ot=e=>(...t)=>a.asap(()=>e(...t)),Dr=T.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,T.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(T.origin),T.navigator&&/(msie|trident)/i.test(T.navigator.userAgent)):()=>!0,kr=T.hasStandardBrowserEnv?{write(e,t,r,n,s,i){const o=[e+"="+encodeURIComponent(t)];a.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),a.isString(n)&&o.push("path="+n),a.isString(s)&&o.push("domain="+s),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Br(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function qr(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function at(e,t,r){let n=!Br(t);return e&&(n||r==!1)?qr(e,t):t}const ct=e=>e instanceof N?{...e}:e;function v(e,t){t=t||{};const r={};function n(u,l,d,g){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:g},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(u,l,d,g){if(a.isUndefined(l)){if(!a.isUndefined(u))return n(void 0,u,d,g)}else return n(u,l,d,g)}function i(u,l){if(!a.isUndefined(l))return n(void 0,l)}function o(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return n(void 0,u)}else return n(void 0,l)}function c(u,l,d){if(d in t)return n(u,l);if(d in e)return n(void 0,u)}const f={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:(u,l,d)=>s(ct(u),ct(l),d,!0)};return a.forEach(Object.keys({...e,...t}),function(l){const d=f[l]||s,g=d(e[l],t[l],l);a.isUndefined(g)&&d!==c||(r[l]=g)}),r}const ut=e=>{const t=v({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:c}=t;t.headers=o=N.from(o),t.url=Ge(at(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let f;if(a.isFormData(r)){if(T.hasStandardBrowserEnv||T.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((f=o.getContentType())!==!1){const[u,...l]=f?f.split(";").map(d=>d.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...l].join("; "))}}if(T.hasStandardBrowserEnv&&(n&&a.isFunction(n)&&(n=n(t)),n||n!==!1&&Dr(t.url))){const u=s&&i&&kr.read(i);u&&o.set(s,u)}return t},vr=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const s=ut(e);let i=s.data;const o=N.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:u}=s,l,d,g,w,h;function y(){w&&w(),h&&h(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let p=new XMLHttpRequest;p.open(s.method.toUpperCase(),s.url,!0),p.timeout=s.timeout;function E(){if(!p)return;const R=N.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),x={data:!c||c==="text"||c==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:R,config:e,request:p};st(function(M){r(M),y()},function(M){n(M),y()},x),p=null}"onloadend"in p?p.onloadend=E:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(E)},p.onabort=function(){p&&(n(new m("Request aborted",m.ECONNABORTED,e,p)),p=null)},p.onerror=function(){n(new m("Network Error",m.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let D=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const x=s.transitional||et;s.timeoutErrorMessage&&(D=s.timeoutErrorMessage),n(new m(D,x.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,p)),p=null},i===void 0&&o.setContentType(null),"setRequestHeader"in p&&a.forEach(o.toJSON(),function(D,x){p.setRequestHeader(x,D)}),a.isUndefined(s.withCredentials)||(p.withCredentials=!!s.withCredentials),c&&c!=="json"&&(p.responseType=s.responseType),u&&([g,h]=ae(u,!0),p.addEventListener("progress",g)),f&&p.upload&&([d,w]=ae(f),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",w)),(s.cancelToken||s.signal)&&(l=R=>{p&&(n(!R||R.type?new V(null,e,p):R),p.abort(),p=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const _=Ur(s.url);if(_&&T.protocols.indexOf(_)===-1){n(new m("Unsupported protocol "+_+":",m.ERR_BAD_REQUEST,e));return}p.send(i||null)})},Ir=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,s;const i=function(u){if(!s){s=!0,c();const l=u instanceof Error?u:this.reason;n.abort(l instanceof m?l:new V(l instanceof Error?l.message:l))}};let o=t&&setTimeout(()=>{o=null,i(new m(`timeout ${t} of ms exceeded`,m.ETIMEDOUT))},t);const c=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),e=null)};e.forEach(u=>u.addEventListener("abort",i));const{signal:f}=n;return f.unsubscribe=()=>a.asap(c),f}},jr=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,s;for(;n<r;)s=n+t,yield e.slice(n,s),n=s},$r=async function*(e,t){for await(const r of Mr(e))yield*jr(r,t)},Mr=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},lt=(e,t,r,n)=>{const s=$r(e,t);let i=0,o,c=f=>{o||(o=!0,n&&n(f))};return new ReadableStream({async pull(f){try{const{done:u,value:l}=await s.next();if(u){c(),f.close();return}let d=l.byteLength;if(r){let g=i+=d;r(g)}f.enqueue(new Uint8Array(l))}catch(u){throw c(u),u}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},ce=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ft=ce&&typeof ReadableStream=="function",Hr=ce&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),dt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Kr=ft&&dt(()=>{let e=!1;const t=new Request(T.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),ht=64*1024,_e=ft&&dt(()=>a.isReadableStream(new Response("").body)),ue={stream:_e&&(e=>e.body)};ce&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ue[t]&&(ue[t]=a.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new m(`Response type '${t}' is not supported`,m.ERR_NOT_SUPPORT,n)})})})(new Response);const Vr=async e=>{if(e==null)return 0;if(a.isBlob(e))return e.size;if(a.isSpecCompliantForm(e))return(await new Request(T.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(a.isArrayBufferView(e)||a.isArrayBuffer(e))return e.byteLength;if(a.isURLSearchParams(e)&&(e=e+""),a.isString(e))return(await Hr(e)).byteLength},zr=async(e,t)=>{const r=a.toFiniteNumber(e.getContentLength());return r??Vr(t)},Re={http:hr,xhr:vr,fetch:ce&&(async e=>{let{url:t,method:r,data:n,signal:s,cancelToken:i,timeout:o,onDownloadProgress:c,onUploadProgress:f,responseType:u,headers:l,withCredentials:d="same-origin",fetchOptions:g}=ut(e);u=u?(u+"").toLowerCase():"text";let w=Ir([s,i&&i.toAbortSignal()],o),h;const y=w&&w.unsubscribe&&(()=>{w.unsubscribe()});let p;try{if(f&&Kr&&r!=="get"&&r!=="head"&&(p=await zr(l,n))!==0){let x=new Request(t,{method:"POST",body:n,duplex:"half"}),B;if(a.isFormData(n)&&(B=x.headers.get("content-type"))&&l.setContentType(B),x.body){const[M,pe]=it(p,ae(ot(f)));n=lt(x.body,ht,M,pe)}}a.isString(d)||(d=d?"include":"omit");const E="credentials"in Request.prototype;h=new Request(t,{...g,signal:w,method:r.toUpperCase(),headers:l.normalize().toJSON(),body:n,duplex:"half",credentials:E?d:void 0});let _=await fetch(h,g);const R=_e&&(u==="stream"||u==="response");if(_e&&(c||R&&y)){const x={};["status","statusText","headers"].forEach(Ot=>{x[Ot]=_[Ot]});const B=a.toFiniteNumber(_.headers.get("content-length")),[M,pe]=c&&it(B,ae(ot(c),!0))||[];_=new Response(lt(_.body,ht,M,()=>{pe&&pe(),y&&y()}),x)}u=u||"text";let D=await ue[a.findKey(ue,u)||"text"](_,e);return!R&&y&&y(),await new Promise((x,B)=>{st(x,B,{data:D,headers:N.from(_.headers),status:_.status,statusText:_.statusText,config:e,request:h})})}catch(E){throw y&&y(),E&&E.name==="TypeError"&&/Load failed|fetch/i.test(E.message)?Object.assign(new m("Network Error",m.ERR_NETWORK,e,h),{cause:E.cause||E}):m.from(E,E&&E.code,e,h)}})};a.forEach(Re,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const pt=e=>`- ${e}`,Jr=e=>a.isFunction(e)||e===null||e===!1,mt={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let r,n;const s={};for(let i=0;i<t;i++){r=e[i];let o;if(n=r,!Jr(r)&&(n=Re[(o=String(r)).toLowerCase()],n===void 0))throw new m(`Unknown adapter '${o}'`);if(n)break;s[o||"#"+i]=n}if(!n){const i=Object.entries(s).map(([c,f])=>`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let o=t?i.length>1?`since :
|
|
4
|
+
`+i.map(pt).join(`
|
|
5
|
+
`):" "+pt(i[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:Re};function Ae(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new V(null,e)}function yt(e){return Ae(e),e.headers=N.from(e.headers),e.data=Ce.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),mt.getAdapter(e.adapter||Z.adapter)(e).then(function(n){return Ae(e),n.data=Ce.call(e,e.transformResponse,n),n.headers=N.from(n.headers),n},function(n){return nt(n)||(Ae(e),n&&n.response&&(n.response.data=Ce.call(e,e.transformResponse,n.response),n.response.headers=N.from(n.response.headers))),Promise.reject(n)})}const gt="1.11.0",le={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{le[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const wt={};le.transitional=function(t,r,n){function s(i,o){return"[Axios v"+gt+"] Transitional option '"+i+"'"+o+(n?". "+n:"")}return(i,o,c)=>{if(t===!1)throw new m(s(o," has been removed"+(r?" in "+r:"")),m.ERR_DEPRECATED);return r&&!wt[o]&&(wt[o]=!0,console.warn(s(o," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,o,c):!0}},le.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function Wr(e,t,r){if(typeof e!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const i=n[s],o=t[i];if(o){const c=e[i],f=c===void 0||o(c,i,e);if(f!==!0)throw new m("option "+i+" must be "+f,m.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new m("Unknown option "+i,m.ERR_BAD_OPTION)}}const fe={assertOptions:Wr,validators:le},L=fe.validators;let I=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ze,response:new Ze}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
6
|
+
`+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=v(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:i}=r;n!==void 0&&fe.assertOptions(n,{silentJSONParsing:L.transitional(L.boolean),forcedJSONParsing:L.transitional(L.boolean),clarifyTimeoutError:L.transitional(L.boolean)},!1),s!=null&&(a.isFunction(s)?r.paramsSerializer={serialize:s}:fe.assertOptions(s,{encode:L.function,serialize:L.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),fe.assertOptions(r,{baseUrl:L.spelling("baseURL"),withXsrfToken:L.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[r.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],h=>{delete i[h]}),r.headers=N.concat(o,i);const c=[];let f=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(r)===!1||(f=f&&y.synchronous,c.unshift(y.fulfilled,y.rejected))});const u=[];this.interceptors.response.forEach(function(y){u.push(y.fulfilled,y.rejected)});let l,d=0,g;if(!f){const h=[yt.bind(this),void 0];for(h.unshift(...c),h.push(...u),g=h.length,l=Promise.resolve(r);d<g;)l=l.then(h[d++],h[d++]);return l}g=c.length;let w=r;for(d=0;d<g;){const h=c[d++],y=c[d++];try{w=h(w)}catch(p){y.call(this,p);break}}try{l=yt.call(this,w)}catch(h){return Promise.reject(h)}for(d=0,g=u.length;d<g;)l=l.then(u[d++],u[d++]);return l}getUri(t){t=v(this.defaults,t);const r=at(t.baseURL,t.url,t.allowAbsoluteUrls);return Ge(r,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){I.prototype[t]=function(r,n){return this.request(v(n||{},{method:t,url:r,data:(n||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function r(n){return function(i,o,c){return this.request(v(c||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}I.prototype[t]=r(),I.prototype[t+"Form"]=r(!0)});let Xr=class Nt{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(s=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](s);n._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(c=>{n.subscribe(c),i=c}).then(s);return o.cancel=function(){n.unsubscribe(i)},o},t(function(i,o,c){n.reason||(n.reason=new V(i,o,c),r(n.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 r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Nt(function(s){t=s}),cancel:t}}};function Qr(e){return function(r){return e.apply(null,r)}}function Yr(e){return a.isObject(e)&&e.isAxiosError===!0}const Te={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};Object.entries(Te).forEach(([e,t])=>{Te[t]=e});function bt(e){const t=new I(e),r=P(I.prototype.request,t);return a.extend(r,I.prototype,t,{allOwnKeys:!0}),a.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return bt(v(e,s))},r}const b=bt(Z);b.Axios=I,b.CanceledError=V,b.CancelToken=Xr,b.isCancel=nt,b.VERSION=gt,b.toFormData=ie,b.AxiosError=m,b.Cancel=b.CanceledError,b.all=function(t){return Promise.all(t)},b.spread=Qr,b.isAxiosError=Yr,b.mergeConfig=v,b.AxiosHeaders=N,b.formToJSON=e=>tt(a.isHTMLForm(e)?new FormData(e):e),b.getAdapter=mt.getAdapter,b.HttpStatusCode=Te,b.default=b;const{Axios:ds,AxiosError:Pe,CanceledError:hs,isCancel:ps,CancelToken:ms,VERSION:ys,all:gs,Cancel:ws,isAxiosError:bs,spread:Es,toFormData:Ss,AxiosHeaders:Cs,HttpStatusCode:_s,formToJSON:Rs,getAdapter:As,mergeConfig:Ts}=b;class Oe extends Error{constructor(r){super(r.join(", "));C(this,"errors");this.name="ValidationError",this.errors=r}}class Ne extends Error{constructor(r){super("Address already registered.");C(this,"address");this.name="AddressInUseError",this.address=r}}class xe extends Error{constructor(r){super("Code already registered.");C(this,"code");this.name="CodeInUseError",this.code=r}}class Ue extends Error{constructor(){super("Invalid signature provided"),this.name="InvalidSignatureError"}}class Gr{constructor(t){C(this,"httpClient");C(this,"_debug");this.httpClient=t.httpClient,this._debug=t.debug}async create(t,r,n,s,i,o,c){var f;try{await this.httpClient.post({path:"/affiliates",postData:{address:t,identifier_type:r,name:n,code:n,signature:s,signature_public_key:i,account_chain_id:o,user_split_percentage:c}})}catch(u){if(u instanceof Pe){const l=(f=u.response)==null?void 0:f.data;if(typeof(l==null?void 0:l.message)=="string"){const d=l.message.toLowerCase();throw d=="invalid signature"?new Ue:d=="address in use"?new Ne(t):d=="code in use"?new xe(n):new Error(d)}else if((l==null?void 0:l.message)instanceof Array)throw new Oe(l.message)}throw u}}async update(t,r,n,s,i,o){var c;try{await this.httpClient.post({path:`/affiliates/${t}`,postData:{code:n,user_identifier:t,identifier_type:r,signature:s,signature_public_key:i,account_chain_id:o}})}catch(f){if(f instanceof Pe){const u=(c=f.response)==null?void 0:c.data;if(typeof(u==null?void 0:u.message)=="string"){const l=u.message.toLowerCase();throw l=="invalid signature"?new Ue:l=="address in use"?new Ne(t):l=="code in use"?new xe(n):new Error(l)}else if((u==null?void 0:u.message)instanceof Array)throw new Oe(u.message)}throw f}}async isCodeFree(t){try{return(await this.httpClient.get({path:`/affiliates/codes/${t}`})).data.available}catch(r){throw console.error("Fuul SDK: Could not check affiliate code",r),r}}async getCode(t,r){var n;try{return(await this.httpClient.get({path:`/affiliates/${t}`,queryParams:{identifier_type:r}})).data.code}catch(s){if(s instanceof Pe&&((n=s.response)==null?void 0:n.status)===404)return null;throw console.error("Fuul SDK: Could not get affiliate code",s),s}}}const Et="/affiliate-portal";class Zr{constructor(t){C(this,"httpClient");this.httpClient=t.httpClient}async getAffiliateStats(t){return(await this.httpClient.get({path:`${Et}/stats`,queryParams:{user_identifier:t.user_identifier}})).data}async getAffiliateNewTraders(t){return(await this.httpClient.get({path:`${Et}/new-traders`,queryParams:{user_identifier:t.user_identifier,from:t.from,to:t.to}})).data}}const en="/audiences";class tn{constructor(t){C(this,"httpClient");C(this,"_debug");this.httpClient=t.httpClient,this._debug=t.debug}async getUserAudiences(t){return(await this.httpClient.get({path:`${en}/audience-segments/user`,queryParams:{...t}})).data}}class rn{constructor(t){C(this,"httpClient");this.httpClient=t.httpClient}async getAll(t){const{data:r}=await this.httpClient.get({path:"conversions",queryParams:{...t}});return r}}const St="fuul.sent",nn=60,sn="connect_wallet",Ct=10;class on{constructor(t){C(this,"debug");C(this,"httpClient");this.httpClient=t.httpClient,this.debug=!!t.debug}async sendEvent(t,r){if(this.isDuplicate(t)){this.debug&&console.debug("Fuul SDK: Event is considered duplicate and will not be sent");return}if(!r||!Array.isArray(r)||r.length===0)await this.httpClient.post({path:"events",postData:t});else for(const n of r){const s=structuredClone({...t,project_id:n});s.metadata.project_id=n,await this.httpClient.post({path:"events",postData:s,queryParams:{project_id:n}})}this.debug&&console.debug(`Fuul SDK: Sent '${t.name}' event`),this.saveSentEvent(t)}isDuplicate(t){var l,d,g,w;const r=`${St}_${t.name}`,n=localStorage.getItem(r);if(!n)return!1;const s=JSON.parse(n);if(this.getCurrentTimestamp()-s.timestamp>nn)return!1;let f=!1;t.metadata&&(f=s.metadata.tracking_id===t.metadata.tracking_id&&s.metadata.project_id===t.metadata.project_id&&s.metadata.referrer===t.metadata.referrer&&s.metadata.source===t.metadata.source&&s.metadata.category===t.metadata.category&&s.metadata.title===t.metadata.title&&s.metadata.tag===t.metadata.tag&&s.user_address===t.user_address&&((l=s.user)==null?void 0:l.identifier)===((d=t.user)==null?void 0:d.identifier)&&((g=s.user)==null?void 0:g.identifier_type)===((w=t.user)==null?void 0:w.identifier_type)&&s.signature===t.signature&&s.signature_message===t.signature_message);let u=!1;return t.args&&s.args&&(u=s.args.page===t.args.page),u&&f}getCurrentTimestamp(){return Date.now()/1e3}saveSentEvent(t){var o,c,f,u;const r=`${St}_${t.name}`,n=`${r}_all`,s=this.getCurrentTimestamp(),i={...t,timestamp:s};if(localStorage.setItem(r,JSON.stringify(i)),t.name===sn){const l=JSON.parse(localStorage.getItem(n)||"[]"),d={name:t.name,user:{identifier:(o=t.user)==null?void 0:o.identifier,identifier_type:(c=t.user)==null?void 0:c.identifier_type},tracking_id:(f=t.metadata)==null?void 0:f.tracking_id,page:(u=t.args)==null?void 0:u.page};"user_address"in t&&(d.user_address=t.user_address);const g=[...l,d];g.length>Ct&&g.splice(0,g.length-Ct),localStorage.setItem(n,JSON.stringify(g))}}}const an={version:"7.6.0"};class cn{constructor(t){C(this,"client");C(this,"defaultQueryParams");this.client=b.create({...t,headers:{Authorization:`Bearer ${t.apiKey}`,"X-Fuul-Sdk-Version":an.version}}),this.defaultQueryParams=t.queryParams||{}}makeQueryParams(t){return Object.assign({},this.defaultQueryParams||{},t||{})}async get(t){return this.client.request({url:t.path,params:this.makeQueryParams(t.queryParams),method:"GET"})}async post(t){return this.client.request({url:t.path,params:this.makeQueryParams(t.queryParams),data:t.postData,method:"POST"})}async put(t){return this.client.request({url:t.path,params:this.makeQueryParams(t.queryParams),data:t.postData,method:"PUT"})}async patch(t){return this.client.request({url:t.path,params:this.makeQueryParams(t.queryParams),data:t.postData,method:"PATCH"})}async delete(t){return this.client.request({url:t.path,params:this.makeQueryParams(t.queryParams),method:"DELETE"})}}class un{constructor(t){C(this,"httpClient");this.httpClient=t.httpClient}async getPayoutsLeaderboard(t){return(await this.httpClient.get({path:"/payouts/leaderboard/payouts",queryParams:{...t}})).data}async getPointsLeaderboard(t){return(await this.httpClient.get({path:"/payouts/leaderboard/points",queryParams:{...t}})).data}async getReferredUsersLeaderboard(t){return(await this.httpClient.get({path:"/leaderboard/referred",queryParams:{...t}})).data}}const z="/payouts";class ln{constructor(t){C(this,"httpClient");C(this,"_debug");this.httpClient=t.httpClient,this._debug=t.debug}async getUserPayoutsByConversion(t){return(await this.httpClient.get({path:z,queryParams:{...t,type:"onchain-currency"}})).data}async getUserPointsByConversion(t){return(await this.httpClient.get({path:z,queryParams:{...t,type:"point"}})).data}async getUserPayoutMovements(t){return(await this.httpClient.get({path:`${z}/movements`,queryParams:{...t,type:"onchain-currency"}})).data}async getUserPointsMovements(t){return(await this.httpClient.get({path:`${z}/movements`,queryParams:{...t,type:"point"}})).data}async getVolumeLeaderboard(t){return(await this.httpClient.get({path:`${z}/leaderboard/volume`,queryParams:{...t}})).data}async getPayoutsByReferrer(t){return(await this.httpClient.get({path:`${z}/by-referrer`,queryParams:{user_identifier:t.user_identifier,user_identifier_type:t.user_identifier_type}})).data}}class fn{constructor(t){C(this,"httpClient");C(this,"_debug");this.httpClient=t.httpClient,this._debug=t.debug}async listUserReferralCodes(t){return(await this.httpClient.get({path:"/referral_codes",queryParams:{user_identifier:t.user_identifier,user_identifier_type:t.user_identifier_type,page:t.page,page_size:t.page_size}})).data}async generateReferralCodes(t){return(await this.httpClient.post({path:"/referral_codes",queryParams:{user_identifier:t.user_identifier,user_identifier_type:t.user_identifier_type,quantity:t.quantity,max_uses:t.max_uses}})).data}async getReferralStatus(t){return(await this.httpClient.get({path:"/referral_codes/status",queryParams:{user_identifier:t.user_identifier,user_identifier_type:t.user_identifier_type}})).data}async getReferralCode(t){return(await this.httpClient.get({path:`/referral_codes/${t.code}`})).data}async useReferralCode(t){const{code:r,user_identifier:n,user_identifier_type:s,signature:i,signature_message:o,chain_id:c}=t;await this.httpClient.patch({path:`/referral_codes/${r}/use`,queryParams:{user_identifier:n,user_identifier_type:s,chain_id:c},postData:{signature:i,signature_message:o}})}async updateReferralCode(t){await this.httpClient.patch({path:`/referral_codes/${t.code}`,postData:{max_uses:t.max_uses}})}}const dn="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let hn=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=dn[r[e]&63];return t};const pn="fuul.tracking_id",Le=()=>En(pn,()=>hn()),_t=()=>J("af")||J("referrer"),mn=()=>document.referrer,yn=()=>Sn(),gn=()=>J("category"),wn=()=>J("title"),bn=()=>J("tag"),En=(e,t)=>{const r=localStorage.getItem(e);if(r)return r;{const n=t();return n?localStorage.setItem(e,n):localStorage.removeItem(e),n}},J=e=>new URLSearchParams(window.location.search).get(e),Sn=()=>{const e=J("source");if(e)return e},Cn="/user";class _n{constructor(t){C(this,"httpClient");this.httpClient=t.httpClient}async getUserReferrer(t){return(await this.httpClient.get({path:`${Cn}/referrer`,queryParams:{...t}})).data}}const Rn="https://api.fuul.xyz/api/v1/";let k=!1,Fe=!1,De,F,Rt,At,W,ke,de,j,Tt,he,$;function An(e){k=!!e.debug,!Fe&&(De=e.apiKey,es(),F=ts(e.baseApiUrl??Rn,e.defaultQueryParams??{}),Rt=new rn({httpClient:F,debug:k}),de=new on({httpClient:F,debug:k}),W=new Gr({httpClient:F,debug:k}),ke=new Zr({httpClient:F}),j=new ln({httpClient:F,debug:k}),At=new _n({httpClient:F}),Tt=new tn({httpClient:F,debug:k}),he=new un({httpClient:F}),$=new fn({httpClient:F,debug:k}),Fe=!0,k&&console.debug("Fuul SDK: init() complete"))}function S(){if(!Fe)throw new Error("Fuul SDK: You need to call init() to initialize the library before using any methods")}async function Tn(e,t){S(),Be(),qe();const r={name:e,args:t??{},metadata:{tracking_id:Le()}};await de.sendEvent(r)}async function Pn(e,t){S(),Be(),qe();const r={name:"pageview",args:{page:e??document.location.pathname,locationOrigin:document.location.origin},metadata:{tracking_id:Le(),referrer_url:mn(),source:yn(),affiliate_id:_t()??void 0,referrer:_t()??void 0,category:gn()??void 0,title:wn()??void 0,tag:bn()??void 0}};await de.sendEvent(r,t)}async function On(e,t){S(),Be(),qe();const r={name:"connect_wallet",user:{identifier:e.identifier,identifier_type:e.identifierType},args:{page:document.location.pathname,locationOrigin:document.location.origin},metadata:{tracking_id:Le()}};e!=null&&e.signature&&(r.signature=e==null?void 0:e.signature,r.signature_message=e==null?void 0:e.message),e!=null&&e.signaturePublicKey&&(r.signature_public_key=e.signaturePublicKey),e!=null&&e.accountChainId&&(r.account_chain_id=e.accountChainId),await de.sendEvent(r,t)}async function Nn(e){S(),await W.create(e.userIdentifier,e.identifierType,e.code,e.signature,e.signaturePublicKey,e.accountChainId,e.userSplitPercentage)}async function xn(e){S(),await W.update(e.userIdentifier,e.identifierType,e.code,e.signature,e.signaturePublicKey,e.accountChainId)}async function Un(e,t){return S(),await W.getCode(e,t)}async function Ln(e){return S(),await W.isCodeFree(e)}async function Fn(e,t,r,n){S();const s=await W.getCode(t,r),i=new URLSearchParams({af:s??t});return n!=null&&n.title&&i.append("af_title",n.title),n!=null&&n.format&&i.append("af_format",n.format),n!=null&&n.place&&i.append("af_place",n.place),`${e}?${i.toString()}`}function Dn(e){return he.getPayoutsLeaderboard(e)}function kn(e){return he.getPointsLeaderboard(e)}function Bn(e){return he.getReferredUsersLeaderboard(e)}function qn(e){return j.getVolumeLeaderboard(e)}function vn(e){return j.getUserPayoutsByConversion(e)}function In(e){return j.getUserPointsByConversion(e)}function jn(e){return j.getUserPayoutMovements(e)}function $n(e){return j.getUserPointsMovements(e)}function Mn(e){return S(),j.getPayoutsByReferrer(e)}async function Hn(e){return S(),Rt.getAll(e)}async function Kn(e){return S(),At.getUserReferrer(e)}async function Vn(e){return S(),Tt.getUserAudiences(e)}async function zn(e){return S(),$.listUserReferralCodes(e)}async function Jn(e){return S(),$.generateReferralCodes(e)}async function Wn(e){return S(),$.getReferralStatus(e)}async function Xn(e){return S(),$.getReferralCode(e)}async function Qn(e){return S(),$.useReferralCode(e)}async function Yn(e){return S(),$.updateReferralCode(e)}async function Gn(e){return S(),ke.getAffiliateStats(e)}async function Zn(e){return S(),ke.getAffiliateNewTraders(e)}function Be(){if(typeof window>"u"||typeof document>"u")throw new Error("Fuul SDK: Browser context required")}function qe(){if(navigator.webdriver)throw new Error("Fuul SDK: Error")}function es(){if(!De)throw new Error("Fuul SDK: Invalid API key")}function ts(e,t){return new cn({baseURL:e,timeout:3e4,apiKey:De,queryParams:t})}const rs={init:An,sendEvent:Tn,sendPageview:Pn,identifyUser:On,generateTrackingLink:Fn,getConversions:Hn,createAffiliateCode:Nn,updateAffiliateCode:xn,getAffiliateCode:Un,isAffiliateCodeFree:Ln,getPayoutsLeaderboard:Dn,getPointsLeaderboard:kn,getReferredUsersLeaderboard:Bn,getUserAudiences:Vn,getUserPayoutsByConversion:vn,getUserPointsByConversion:In,getUserPointsMovements:$n,getUserPayoutMovements:jn,getPayoutsByReferrer:Mn,getUserReferrer:Kn,getVolumeLeaderboard:qn,listUserReferralCodes:zn,generateReferralCodes:Jn,getReferralStatus:Wn,getReferralCode:Xn,useReferralCode:Qn,updateReferralCode:Yn,getAffiliateStats:Gn,getAffiliateNewTraders:Zn};var Pt=(e=>(e.EvmAddress="evm_address",e.SolanaAddress="solana_address",e.XRPLAddress="xrpl_address",e.SuiAddress="sui_address",e.Email="email",e))(Pt||{});A.AddressInUseError=Ne,A.CodeInUseError=xe,A.Fuul=rs,A.InvalidSignatureError=Ue,A.UserIdentifierType=Pt,A.ValidationError=Oe,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
|
package/dist/release.json.d.ts
CHANGED