myquizbot-react 1.0.1 → 1.0.4
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/README.md +35 -3
- package/dist/myquizbot-react.es.js +1509 -1214
- package/dist/myquizbot-react.umd.js +7 -7
- package/package.json +8 -3
- package/dist/react.css +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(G,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],P):(G=typeof globalThis<"u"?globalThis:G||self,P(G.MyQuizBot={},G.React))})(this,(function(G,P){"use strict";var he={exports:{}},ae={};var Ie;function Nt(){if(Ie)return ae;Ie=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,o){var i=null;if(o!==void 0&&(i=""+o),s.key!==void 0&&(i=""+s.key),"key"in s){o={};for(var c in s)c!=="key"&&(o[c]=s[c])}else o=s;return s=o.ref,{$$typeof:e,type:r,key:i,ref:s!==void 0?s:null,props:o}}return ae.Fragment=t,ae.jsx=n,ae.jsxs=n,ae}var ce={};var Be;function _t(){return Be||(Be=1,process.env.NODE_ENV!=="production"&&(function(){function e(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===M?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case h:return"Fragment";case R:return"Profiler";case j:return"StrictMode";case N:return"Suspense";case D:return"SuspenseList";case V:return"Activity"}if(typeof l=="object")switch(typeof l.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),l.$$typeof){case g:return"Portal";case T:return l.displayName||"Context";case A:return(l._context.displayName||"Context")+".Consumer";case _:var x=l.render;return l=l.displayName,l||(l=x.displayName||x.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case K:return x=l.displayName||null,x!==null?x:e(l.type)||"Memo";case W:x=l._payload,l=l._init;try{return e(l(x))}catch{}}return null}function t(l){return""+l}function n(l){try{t(l);var x=!1}catch{x=!0}if(x){x=console;var F=x.error,U=typeof Symbol=="function"&&Symbol.toStringTag&&l[Symbol.toStringTag]||l.constructor.name||"Object";return F.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",U),t(l)}}function r(l){if(l===h)return"<>";if(typeof l=="object"&&l!==null&&l.$$typeof===W)return"<...>";try{var x=e(l);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function s(){var l=L.A;return l===null?null:l.getOwner()}function o(){return Error("react-stack-top-frame")}function i(l){if(B.call(l,"key")){var x=Object.getOwnPropertyDescriptor(l,"key").get;if(x&&x.isReactWarning)return!1}return l.key!==void 0}function c(l,x){function F(){y||(y=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",x))}F.isReactWarning=!0,Object.defineProperty(l,"key",{get:F,configurable:!0})}function p(){var l=e(this.type);return O[l]||(O[l]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),l=this.props.ref,l!==void 0?l:null}function d(l,x,F,U,ne,Ue){var q=F.ref;return l={$$typeof:f,type:l,key:x,props:F,_owner:U},(q!==void 0?q:null)!==null?Object.defineProperty(l,"ref",{enumerable:!1,get:p}):Object.defineProperty(l,"ref",{enumerable:!1,value:null}),l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(l,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(l,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ne}),Object.defineProperty(l,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Ue}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}function u(l,x,F,U,ne,Ue){var q=x.children;if(q!==void 0)if(U)if(k(q)){for(U=0;U<q.length;U++)m(q[U]);Object.freeze&&Object.freeze(q)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else m(q);if(B.call(x,"key")){q=e(l);var ie=Object.keys(x).filter(function(sr){return sr!=="key"});U=0<ie.length?"{key: someKey, "+ie.join(": ..., ")+": ...}":"{key: someKey}",X[q+U]||(ie=0<ie.length?"{"+ie.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,A,N,re,N),Oe[N+A]=!0)}if(N=null,S!==void 0&&(n(S),N=""+S),o(y)&&(n(y.key),N=""+y.key),"key"in y){S={};for(var De in y)De!=="key"&&(S[De]=y[De])}else S=y;return N&&c(S,typeof l=="function"?l.displayName||l.name||"Unknown":l),f(l,N,S,s(),G,Le)}function h(l){E(l)?l._store&&(l._store.validated=1):typeof l=="object"&&l!==null&&l.$$typeof===z&&(l._payload.status==="fulfilled"?E(l._payload.value)&&l._payload.value._store&&(l._payload.value._store.validated=1):l._store&&(l._store.validated=1))}function E(l){return typeof l=="object"&&l!==null&&l.$$typeof===d}var O=U,d=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),C=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),q=Symbol.for("react.client.reference"),v=O.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=Object.prototype.hasOwnProperty,W=Array.isArray,ne=console.createTask?console.createTask:function(){return null};O={react_stack_bottom_frame:function(l){return l()}};var B,fe={},$=O.react_stack_bottom_frame.bind(O,i)(),de=ne(r(i)),Oe={};oe.Fragment=m,oe.jsx=function(l,y,S){var A=1e4>v.recentlyCreatedOwnerStacks++;return u(l,y,S,!1,A?Error("react-stack-top-frame"):$,A?ne(r(l)):de)},oe.jsxs=function(l,y,S){var A=1e4>v.recentlyCreatedOwnerStacks++;return u(l,y,S,!0,A?Error("react-stack-top-frame"):$,A?ne(r(l)):de)}})()),oe}var ze;function Ct(){return ze||(ze=1,process.env.NODE_ENV==="production"?pe.exports=_t():pe.exports=Nt()),pe.exports}var g=Ct();function Ie(e,t){return function(){return e.apply(t,arguments)}}const{toString:Pt}=Object.prototype,{getPrototypeOf:Ae}=Object,{iterator:he,toStringTag:Me}=Symbol,me=(e=>t=>{const n=Pt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),M=e=>(e=e.toLowerCase(),t=>me(t)===e),be=e=>t=>typeof t===e,{isArray:Z}=Array,ee=be("undefined");function ie(e){return e!==null&&!ee(e)&&e.constructor!==null&&!ee(e.constructor)&&L(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const He=M("ArrayBuffer");function jt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&He(e.buffer),t}const kt=be("string"),L=be("function"),$e=be("number"),ae=e=>e!==null&&typeof e=="object",Ft=e=>e===!0||e===!1,ye=e=>{if(me(e)!=="object")return!1;const t=Ae(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Me in e)&&!(he in e)},vt=e=>{if(!ae(e)||ie(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Ut=M("Date"),Lt=M("File"),Dt=M("Blob"),qt=M("FileList"),Bt=e=>ae(e)&&L(e.pipe),zt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||L(e.append)&&((t=me(e))==="formdata"||t==="object"&&L(e.toString)&&e.toString()==="[object FormData]"))},It=M("URLSearchParams"),[Mt,Ht,$t,Jt]=["ReadableStream","Request","Response","Headers"].map(M),Wt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ce(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),Z(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(ie(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let c;for(r=0;r<o;r++)c=i[r],t.call(null,e[c],c,e)}}function Je(e,t){if(ie(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const Y=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,We=e=>!ee(e)&&e!==Y;function xe(){const{caseless:e,skipUndefined:t}=We(this)&&this||{},n={},r=(s,i)=>{const o=e&&Je(n,i)||i;ye(n[o])&&ye(s)?n[o]=xe(n[o],s):ye(s)?n[o]=xe({},s):Z(s)?n[o]=s.slice():(!t||!ee(s))&&(n[o]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&ce(arguments[s],r);return n}const Vt=(e,t,n,{allOwnKeys:r}={})=>(ce(t,(s,i)=>{n&&L(s)?e[i]=Ie(s,n):e[i]=s},{allOwnKeys:r}),e),Yt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Kt=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Xt=(e,t,n,r)=>{let s,i,o;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!r||r(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=n!==!1&&Ae(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Qt=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Gt=e=>{if(!e)return null;if(Z(e))return e;let t=e.length;if(!$e(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Zt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ae(Uint8Array)),en=(e,t)=>{const r=(e&&e[he]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},tn=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},nn=M("HTMLFormElement"),rn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Ve=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),sn=M("RegExp"),Ye=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ce(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},on=e=>{Ye(e,(t,n)=>{if(L(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(L(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},an=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return Z(e)?r(e):r(String(e).split(t)),n},cn=()=>{},ln=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function un(e){return!!(e&&L(e.append)&&e[Me]==="FormData"&&e[he])}const fn=e=>{const t=new Array(10),n=(r,s)=>{if(ae(r)){if(t.indexOf(r)>=0)return;if(ie(r))return r;if(!("toJSON"in r)){t[s]=r;const i=Z(r)?[]:{};return ce(r,(o,c)=>{const p=n(o,s+1);!ee(p)&&(i[c]=p)}),t[s]=void 0,i}}return r};return n(e,0)},dn=M("AsyncFunction"),pn=e=>e&&(ae(e)||L(e))&&L(e.then)&&L(e.catch),Ke=((e,t)=>e?setImmediate:t?((n,r)=>(Y.addEventListener("message",({source:s,data:i})=>{s===Y&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),Y.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",L(Y.postMessage)),hn=typeof queueMicrotask<"u"?queueMicrotask.bind(Y):typeof process<"u"&&process.nextTick||Ke,a={isArray:Z,isArrayBuffer:He,isBuffer:ie,isFormData:zt,isArrayBufferView:jt,isString:kt,isNumber:$e,isBoolean:Ft,isObject:ae,isPlainObject:ye,isEmptyObject:vt,isReadableStream:Mt,isRequest:Ht,isResponse:$t,isHeaders:Jt,isUndefined:ee,isDate:Ut,isFile:Lt,isBlob:Dt,isRegExp:sn,isFunction:L,isStream:Bt,isURLSearchParams:It,isTypedArray:Zt,isFileList:qt,forEach:ce,merge:xe,extend:Vt,trim:Wt,stripBOM:Yt,inherits:Kt,toFlatObject:Xt,kindOf:me,kindOfTest:M,endsWith:Qt,toArray:Gt,forEachEntry:en,matchAll:tn,isHTMLForm:nn,hasOwnProperty:Ve,hasOwnProp:Ve,reduceDescriptors:Ye,freezeMethods:on,toObjectSet:an,toCamelCase:rn,noop:cn,toFiniteNumber:ln,findKey:Je,global:Y,isContextDefined:We,isSpecCompliantForm:un,toJSONObject:fn,isAsyncFn:dn,isThenable:pn,setImmediate:Ke,asap:hn,isIterable:e=>e!=null&&L(e[he])};function w(e,t,n,r,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),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(w,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 Xe=w.prototype,Qe={};["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=>{Qe[e]={value:e}}),Object.defineProperties(w,Qe),Object.defineProperty(Xe,"isAxiosError",{value:!0}),w.from=(e,t,n,r,s,i)=>{const o=Object.create(Xe);a.toFlatObject(e,o,function(u){return u!==Error.prototype},f=>f!=="isAxiosError");const c=e&&e.message?e.message:"Error",p=t==null&&e?e.code:t;return w.call(o,c,p,n,r,s),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",i&&Object.assign(o,i),o};const mn=null;function _e(e){return a.isPlainObject(e)||a.isArray(e)}function Ge(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Ze(e,t,n){return e?e.concat(t).map(function(s,i){return s=Ge(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function bn(e){return a.isArray(e)&&!e.some(_e)}const yn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function we(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,m){return!a.isUndefined(m[b])});const r=n.metaTokens,s=n.visitor||u,i=n.dots,o=n.indexes,p=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function f(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(a.isBoolean(d))return d.toString();if(!p&&a.isBlob(d))throw new w("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?p&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function u(d,b,m){let R=d;if(d&&!m&&typeof d=="object"){if(a.endsWith(b,"{}"))b=r?b:b.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&bn(d)||(a.isFileList(d)||a.endsWith(b,"[]"))&&(R=a.toArray(d)))return b=Ge(b),R.forEach(function(x,C){!(a.isUndefined(x)||x===null)&&t.append(o===!0?Ze([b],C,i):o===null?b:b+"[]",f(x))}),!1}return _e(d)?!0:(t.append(Ze(m,b,i),f(d)),!1)}const h=[],E=Object.assign(yn,{defaultVisitor:u,convertValue:f,isVisitable:_e});function O(d,b){if(!a.isUndefined(d)){if(h.indexOf(d)!==-1)throw Error("Circular reference detected in "+b.join("."));h.push(d),a.forEach(d,function(R,k){(!(a.isUndefined(R)||R===null)&&s.call(t,R,a.isString(k)?k.trim():k,b,E))===!0&&O(R,b?b.concat(k):[k])}),h.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return O(e),t}function et(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Ne(e,t){this._pairs=[],e&&we(e,this,t)}const tt=Ne.prototype;tt.append=function(t,n){this._pairs.push([t,n])},tt.toString=function(t){const n=t?function(r){return t.call(this,r,et)}:et;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function wn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function nt(e,t,n){if(!t)return e;const r=n&&n.encode||wn;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=a.isURLSearchParams(t)?t.toString():new Ne(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class rt{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const st={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},En={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Ne,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Ce=typeof window<"u"&&typeof document<"u",Pe=typeof navigator=="object"&&navigator||void 0,gn=Ce&&(!Pe||["ReactNative","NativeScript","NS"].indexOf(Pe.product)<0),Rn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Sn=Ce&&window.location.href||"http://localhost",j={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ce,hasStandardBrowserEnv:gn,hasStandardBrowserWebWorkerEnv:Rn,navigator:Pe,origin:Sn},Symbol.toStringTag,{value:"Module"})),...En};function Tn(e,t){return we(e,new j.classes.URLSearchParams,{visitor:function(n,r,s,i){return j.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function On(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function An(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function ot(e){function t(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;const c=Number.isFinite(+o),p=i>=n.length;return o=!o&&a.isArray(s)?s.length:o,p?(a.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!c):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&a.isArray(s[o])&&(s[o]=An(s[o])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(On(r),s,n,0)}),n}return null}function xn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const le={transitional:st,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(ot(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Tn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const p=this.env&&this.env.FormData;return we(c?{"files[]":t}:t,p&&new p,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),xn(t)):t}],transformResponse:[function(t){const n=this.transitional||le.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(o)throw c.name==="SyntaxError"?w.from(c,w.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:j.classes.FormData,Blob:j.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=>{le.headers[e]={}});const _n=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Nn=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
7
|
-
`).forEach(function(
|
|
8
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[it]=this[it]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=ue(o);r[c]||(kn(s,o),r[c]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}};D.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(D.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),a.freezeMethods(D);function ke(e,t){const n=this||le,r=t||n,s=D.from(r.headers);let i=r.data;return a.forEach(e,function(c){i=c.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function at(e){return!!(e&&e.__CANCEL__)}function te(e,t,n){w.call(this,e??"canceled",w.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(te,w,{__CANCEL__:!0});function ct(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new w("Request failed with status code "+n.status,[w.ERR_BAD_REQUEST,w.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Fn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function vn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(p){const f=Date.now(),u=r[i];o||(o=f),n[s]=p,r[s]=f;let h=i,E=0;for(;h!==s;)E+=n[h++],h=h%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),f-o<t)return;const O=u&&f-u;return O?Math.round(E*1e3/O):void 0}}function Un(e,t){let n=0,r=1e3/t,s,i;const o=(f,u=Date.now())=>{n=u,s=null,i&&(clearTimeout(i),i=null),e(...f)};return[(...f)=>{const u=Date.now(),h=u-n;h>=r?o(f,u):(s=f,i||(i=setTimeout(()=>{i=null,o(s)},r-h)))},()=>s&&o(s)]}const ge=(e,t,n=3)=>{let r=0;const s=vn(50,250);return Un(i=>{const o=i.loaded,c=i.lengthComputable?i.total:void 0,p=o-r,f=s(p),u=o<=c;r=o;const h={loaded:o,total:c,progress:c?o/c:void 0,bytes:p,rate:f||void 0,estimated:f&&c&&u?(c-o)/f:void 0,event:i,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(h)},n)},lt=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ut=e=>(...t)=>a.asap(()=>e(...t)),Ln=j.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,j.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(j.origin),j.navigator&&/(msie|trident)/i.test(j.navigator.userAgent)):()=>!0,Dn=j.hasStandardBrowserEnv?{write(e,t,n,r,s,i,o){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),a.isString(r)&&c.push(`path=${r}`),a.isString(s)&&c.push(`domain=${s}`),i===!0&&c.push("secure"),a.isString(o)&&c.push(`SameSite=${o}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function qn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Bn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ft(e,t,n){let r=!qn(t);return e&&(r||n==!1)?Bn(e,t):t}const dt=e=>e instanceof D?{...e}:e;function K(e,t){t=t||{};const n={};function r(f,u,h,E){return a.isPlainObject(f)&&a.isPlainObject(u)?a.merge.call({caseless:E},f,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function s(f,u,h,E){if(a.isUndefined(u)){if(!a.isUndefined(f))return r(void 0,f,h,E)}else return r(f,u,h,E)}function i(f,u){if(!a.isUndefined(u))return r(void 0,u)}function o(f,u){if(a.isUndefined(u)){if(!a.isUndefined(f))return r(void 0,f)}else return r(void 0,u)}function c(f,u,h){if(h in t)return r(f,u);if(h in e)return r(void 0,f)}const p={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(f,u,h)=>s(dt(f),dt(u),h,!0)};return a.forEach(Object.keys({...e,...t}),function(u){const h=p[u]||s,E=h(e[u],t[u],u);a.isUndefined(E)&&h!==c||(n[u]=E)}),n}const pt=e=>{const t=K({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:c}=t;if(t.headers=o=D.from(o),t.url=nt(ft(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(n)){if(j.hasStandardBrowserEnv||j.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const p=n.getHeaders(),f=["content-type","content-length"];Object.entries(p).forEach(([u,h])=>{f.includes(u.toLowerCase())&&o.set(u,h)})}}if(j.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&Ln(t.url))){const p=s&&i&&Dn.read(i);p&&o.set(s,p)}return t},zn=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=pt(e);let i=s.data;const o=D.from(s.headers).normalize();let{responseType:c,onUploadProgress:p,onDownloadProgress:f}=s,u,h,E,O,d;function b(){O&&O(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let m=new XMLHttpRequest;m.open(s.method.toUpperCase(),s.url,!0),m.timeout=s.timeout;function R(){if(!m)return;const x=D.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),_={data:!c||c==="text"||c==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:x,config:e,request:m};ct(function(F){n(F),b()},function(F){r(F),b()},_),m=null}"onloadend"in m?m.onloadend=R:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(R)},m.onabort=function(){m&&(r(new w("Request aborted",w.ECONNABORTED,e,m)),m=null)},m.onerror=function(C){const _=C&&C.message?C.message:"Network Error",H=new w(_,w.ERR_NETWORK,e,m);H.event=C||null,r(H),m=null},m.ontimeout=function(){let C=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const _=s.transitional||st;s.timeoutErrorMessage&&(C=s.timeoutErrorMessage),r(new w(C,_.clarifyTimeoutError?w.ETIMEDOUT:w.ECONNABORTED,e,m)),m=null},i===void 0&&o.setContentType(null),"setRequestHeader"in m&&a.forEach(o.toJSON(),function(C,_){m.setRequestHeader(_,C)}),a.isUndefined(s.withCredentials)||(m.withCredentials=!!s.withCredentials),c&&c!=="json"&&(m.responseType=s.responseType),f&&([E,d]=ge(f,!0),m.addEventListener("progress",E)),p&&m.upload&&([h,O]=ge(p),m.upload.addEventListener("progress",h),m.upload.addEventListener("loadend",O)),(s.cancelToken||s.signal)&&(u=x=>{m&&(r(!x||x.type?new te(null,e,m):x),m.abort(),m=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const k=Fn(s.url);if(k&&j.protocols.indexOf(k)===-1){r(new w("Unsupported protocol "+k+":",w.ERR_BAD_REQUEST,e));return}m.send(i||null)})},In=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(f){if(!s){s=!0,c();const u=f instanceof Error?f:this.reason;r.abort(u instanceof w?u:new te(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,i(new w(`timeout ${t} of ms exceeded`,w.ETIMEDOUT))},t);const c=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(i):f.removeEventListener("abort",i)}),e=null)};e.forEach(f=>f.addEventListener("abort",i));const{signal:p}=r;return p.unsubscribe=()=>a.asap(c),p}},Mn=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},Hn=async function*(e,t){for await(const n of $n(e))yield*Mn(n,t)},$n=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},ht=(e,t,n,r)=>{const s=Hn(e,t);let i=0,o,c=p=>{o||(o=!0,r&&r(p))};return new ReadableStream({async pull(p){try{const{done:f,value:u}=await s.next();if(f){c(),p.close();return}let h=u.byteLength;if(n){let E=i+=h;n(E)}p.enqueue(new Uint8Array(u))}catch(f){throw c(f),f}},cancel(p){return c(p),s.return()}},{highWaterMark:2})},mt=64*1024,{isFunction:Re}=a,Jn=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:bt,TextEncoder:yt}=a.global,wt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Wn=e=>{e=a.merge.call({skipUndefined:!0},Jn,e);const{fetch:t,Request:n,Response:r}=e,s=t?Re(t):typeof fetch=="function",i=Re(n),o=Re(r);if(!s)return!1;const c=s&&Re(bt),p=s&&(typeof yt=="function"?(d=>b=>d.encode(b))(new yt):async d=>new Uint8Array(await new n(d).arrayBuffer())),f=i&&c&&wt(()=>{let d=!1;const b=new n(j.origin,{body:new bt,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!b}),u=o&&c&&wt(()=>a.isReadableStream(new r("").body)),h={stream:u&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!h[d]&&(h[d]=(b,m)=>{let R=b&&b[d];if(R)return R.call(b);throw new w(`Response type '${d}' is not supported`,w.ERR_NOT_SUPPORT,m)})});const E=async d=>{if(d==null)return 0;if(a.isBlob(d))return d.size;if(a.isSpecCompliantForm(d))return(await new n(j.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(a.isArrayBufferView(d)||a.isArrayBuffer(d))return d.byteLength;if(a.isURLSearchParams(d)&&(d=d+""),a.isString(d))return(await p(d)).byteLength},O=async(d,b)=>{const m=a.toFiniteNumber(d.getContentLength());return m??E(b)};return async d=>{let{url:b,method:m,data:R,signal:k,cancelToken:x,timeout:C,onDownloadProgress:_,onUploadProgress:H,responseType:F,headers:Q,withCredentials:z="same-origin",fetchOptions:P}=pt(d),q=t||fetch;F=F?(F+"").toLowerCase():"text";let v=In([k,x&&x.toAbortSignal()],C),I=null;const W=v&&v.unsubscribe&&(()=>{v.unsubscribe()});let ne;try{if(H&&f&&m!=="get"&&m!=="head"&&(ne=await O(Q,R))!==0){let l=new n(b,{method:"POST",body:R,duplex:"half"}),y;if(a.isFormData(R)&&(y=l.headers.get("content-type"))&&Q.setContentType(y),l.body){const[S,A]=lt(ne,ge(ut(H)));R=ht(l.body,mt,S,A)}}a.isString(z)||(z=z?"include":"omit");const B=i&&"credentials"in n.prototype,fe={...P,signal:v,method:m.toUpperCase(),headers:Q.normalize().toJSON(),body:R,duplex:"half",credentials:B?z:void 0};I=i&&new n(b,fe);let $=await(i?q(I,P):q(b,fe));const de=u&&(F==="stream"||F==="response");if(u&&(_||de&&W)){const l={};["status","statusText","headers"].forEach(G=>{l[G]=$[G]});const y=a.toFiniteNumber($.headers.get("content-length")),[S,A]=_&<(y,ge(ut(_),!0))||[];$=new r(ht($.body,mt,S,()=>{A&&A(),W&&W()}),l)}F=F||"text";let Oe=await h[a.findKey(h,F)||"text"]($,d);return!de&&W&&W(),await new Promise((l,y)=>{ct(l,y,{data:Oe,headers:D.from($.headers),status:$.status,statusText:$.statusText,config:d,request:I})})}catch(B){throw W&&W(),B&&B.name==="TypeError"&&/Load failed|fetch/i.test(B.message)?Object.assign(new w("Network Error",w.ERR_NETWORK,d,I),{cause:B.cause||B}):w.from(B,B&&B.code,d,I)}}},Vn=new Map,Et=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,i=[r,s,n];let o=i.length,c=o,p,f,u=Vn;for(;c--;)p=i[c],f=u.get(p),f===void 0&&u.set(p,f=c?new Map:Wn(t)),u=f;return f};Et();const Fe={http:mn,xhr:zn,fetch:{get:Et}};a.forEach(Fe,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const gt=e=>`- ${e}`,Yn=e=>a.isFunction(e)||e===null||e===!1;function Kn(e,t){e=a.isArray(e)?e:[e];const{length:n}=e;let r,s;const i={};for(let o=0;o<n;o++){r=e[o];let c;if(s=r,!Yn(r)&&(s=Fe[(c=String(r)).toLowerCase()],s===void 0))throw new w(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(t))))break;i[c||"#"+o]=s}if(!s){const o=Object.entries(i).map(([p,f])=>`adapter ${p} `+(f===!1?"is not supported by the environment":"is not available in the build"));let c=n?o.length>1?`since :
|
|
9
|
-
`+
|
|
10
|
-
`):" "+
|
|
11
|
-
`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=K(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&Te.assertOptions(r,{silentJSONParsing:J.transitional(J.boolean),forcedJSONParsing:J.transitional(J.boolean),clarifyTimeoutError:J.transitional(J.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:Te.assertOptions(s,{encode:J.function,serialize:J.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Te.assertOptions(n,{baseUrl:J.spelling("baseURL"),withXsrfToken:J.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[n.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),n.headers=D.concat(o,i);const c=[];let p=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(n)===!1||(p=p&&b.synchronous,c.unshift(b.fulfilled,b.rejected))});const f=[];this.interceptors.response.forEach(function(b){f.push(b.fulfilled,b.rejected)});let u,h=0,E;if(!p){const d=[St.bind(this),void 0];for(d.unshift(...c),d.push(...f),E=d.length,u=Promise.resolve(n);h<E;)u=u.then(d[h++],d[h++]);return u}E=c.length;let O=n;for(;h<E;){const d=c[h++],b=c[h++];try{O=d(O)}catch(m){b.call(this,m);break}}try{u=St.call(this,O)}catch(d){return Promise.reject(d)}for(h=0,E=f.length;h<E;)u=u.then(f[h++],f[h++]);return u}getUri(t){t=K(this.defaults,t);const n=ft(t.baseURL,t.url,t.allowAbsoluteUrls);return nt(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){X.prototype[t]=function(n,r){return this.request(K(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,c){return this.request(K(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}X.prototype[t]=n(),X.prototype[t+"Form"]=n(!0)});let Qn=class xt{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(c=>{r.subscribe(c),i=c}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,c){r.reason||(r.reason=new te(i,o,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new xt(function(s){t=s}),cancel:t}}};function Gn(e){return function(n){return e.apply(null,n)}}function Zn(e){return a.isObject(e)&&e.isAxiosError===!0}const Ue={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ue).forEach(([e,t])=>{Ue[t]=e});function At(e){const t=new X(e),n=Ie(X.prototype.request,t);return a.extend(n,X.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return At(K(e,s))},n}const T=At(le);T.Axios=X,T.CanceledError=te,T.CancelToken=Qn,T.isCancel=at,T.VERSION=Tt,T.toFormData=we,T.AxiosError=w,T.Cancel=T.CanceledError,T.all=function(t){return Promise.all(t)},T.spread=Gn,T.isAxiosError=Zn,T.mergeConfig=K,T.AxiosHeaders=D,T.formToJSON=e=>ot(a.isHTMLForm(e)?new FormData(e):e),T.getAdapter=Rt.getAdapter,T.HttpStatusCode=Ue,T.default=T;const{Axios:ur,AxiosError:fr,CanceledError:dr,isCancel:pr,CancelToken:hr,VERSION:mr,all:br,Cancel:yr,isAxiosError:wr,spread:Er,toFormData:gr,AxiosHeaders:Rr,HttpStatusCode:Sr,formToJSON:Tr,getAdapter:Or,mergeConfig:Ar}=T;class er{client;constructor(t){this.client=T.create({baseURL:t||void 0||"http://localhost:5003",headers:{"Content-Type":"application/json"}})}setApiKey(t){this.client.defaults.headers.common.Authorization=`Bearer ${t}`}async getQuiz(t){try{return(await this.client.get(`/quiz/${t}`)).data}catch(n){throw T.isAxiosError(n)?new Error(`Failed to fetch quiz: ${n.response?.data?.message||n.message}`):n}}async submitAnswer(t,n,r){try{await this.client.post(`/quiz/session/${t}/answer`,{questionId:n,answer:r})}catch(s){throw T.isAxiosError(s)?new Error(`Failed to submit answer: ${s.response?.data?.message||s.message}`):s}}async createSession(t){try{return(await this.client.post("/quiz/session",{quizId:t})).data}catch(n){throw T.isAxiosError(n)?new Error(`Failed to create session: ${n.response?.data?.message||n.message}`):n}}async completeSession(t){try{await this.client.post(`/quiz/session/${t}/complete`)}catch(n){throw T.isAxiosError(n)?new Error(`Failed to complete session: ${n.response?.data?.message||n.message}`):n}}}const tr=({nodes:e,onAnswer:t,onProgress:n,onComplete:r})=>{const[s,i]=U.useState(0),[o,c]=U.useState({});U.useEffect(()=>{n({currentStep:s+1,totalSteps:e.length,percentage:(s+1)/e.length*100})},[s,e.length,n]);const p=h=>{const E=e[s],O={...o,[E.id]:h};c(O),t({questionId:E.id,answer:h,timestamp:Date.now()}),s<e.length-1?i(s+1):r()},f=()=>{s>0&&i(s-1)};if(e.length===0)return g.jsx("div",{className:"quiz-steps-empty",children:"No questions available"});const u=e[s];return g.jsxs("div",{className:"quiz-steps-container",children:[g.jsx("div",{className:"quiz-steps-progress",children:g.jsx("div",{className:"quiz-steps-progress-bar",style:{width:`${(s+1)/e.length*100}%`}})}),g.jsxs("div",{className:"quiz-steps-content",children:[g.jsx("div",{className:"quiz-steps-header",children:g.jsxs("span",{className:"quiz-steps-counter",children:["Question ",s+1," of ",e.length]})}),g.jsxs("div",{className:"quiz-steps-question",children:[g.jsx("h2",{children:u.data.label||u.data.content}),u.data.content&&u.data.label&&g.jsx("p",{children:u.data.content})]}),g.jsxs("div",{className:"quiz-steps-options",children:[u.type==="multipleChoice"&&u.data.options?.map((h,E)=>g.jsx("button",{className:"quiz-steps-option",onClick:()=>p(h.value||h),children:h.label||h},E)),u.type==="text"&&g.jsxs("div",{className:"quiz-steps-text-input",children:[g.jsx("input",{type:"text",placeholder:"Type your answer...",onKeyPress:h=>{h.key==="Enter"&&p(h.target.value)}}),g.jsx("button",{onClick:h=>{const E=h.currentTarget.previousElementSibling;p(E.value)},children:"Submit"})]})]}),g.jsx("div",{className:"quiz-steps-navigation",children:s>0&&g.jsx("button",{className:"quiz-steps-nav-button",onClick:f,children:"Previous"})})]})]})},nr=({quizId:e,apiKey:t,mode:n="steps",baseUrl:r,onStart:s,onAnswer:i,onProgress:o,onComplete:c,onError:p,className:f,style:u})=>{const[h,E]=U.useState(null),[O,d]=U.useState(!0),[b,m]=U.useState(null),[R,k]=U.useState(null),[x,C]=U.useState({}),_=U.useRef(null);U.useEffect(()=>{_.current=new er(r),_.current.setApiKey(t),(async()=>{try{d(!0),m(null);const q=await _.current.getQuiz(e);E(q);const v=await _.current.createSession(e);if(k(v.sessionId),s){const I={quizId:e,timestamp:Date.now()};s(I)}d(!1)}catch(q){const v=q instanceof Error?q.message:"Failed to load quiz";if(m(v),d(!1),p){const I={error:q instanceof Error?q:new Error(v),message:v,timestamp:Date.now()};p(I)}}})()},[e,t,r,s,p]);const H=async P=>{const q={...x,[P.questionId]:P.answer};if(C(q),R&&_.current)try{await _.current.submitAnswer(R,P.questionId,P.answer)}catch(v){console.error("Failed to submit answer:",v)}i&&i(P)},F=P=>{o&&o(P)},Q=async()=>{if(R&&_.current)try{await _.current.completeSession(R)}catch(P){console.error("Failed to complete session:",P)}if(c){const P={quizId:e,answers:x,timestamp:Date.now(),sessionId:R||void 0};c(P)}};if(O)return g.jsxs("div",{className:`quiz-container quiz-loading ${f||""}`,style:u,children:[g.jsx("div",{className:"quiz-spinner"}),g.jsx("p",{children:"Loading quiz..."})]});if(b)return g.jsxs("div",{className:`quiz-container quiz-error ${f||""}`,style:u,children:[g.jsx("div",{className:"quiz-error-icon",children:"⚠️"}),g.jsx("h3",{children:"Failed to Load Quiz"}),g.jsx("p",{children:b})]});if(!h)return null;const z=n||h.renderMode||"steps";return g.jsxs("div",{className:`quiz-container ${f||""}`,style:u,children:[z==="steps"&&g.jsx(tr,{nodes:h.nodes,onAnswer:H,onProgress:F,onComplete:Q}),z==="single"&&g.jsx("div",{className:"quiz-single-mode",children:g.jsx("p",{children:"Single mode not yet implemented"})}),z==="flow"&&g.jsx("div",{className:"quiz-flow-mode",children:g.jsx("p",{children:"Flow mode not yet implemented"})})]})};V.Quiz=nr,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"})}));
|
|
6
|
+
<%s key={someKey} {...props} />`,U,q,ie,q),X[q+U]=!0)}if(q=null,F!==void 0&&(n(F),q=""+F),i(x)&&(n(x.key),q=""+x.key),"key"in x){F={};for(var Le in x)Le!=="key"&&(F[Le]=x[Le])}else F=x;return q&&c(F,typeof l=="function"?l.displayName||l.name||"Unknown":l),d(l,q,F,s(),ne,Ue)}function m(l){S(l)?l._store&&(l._store.validated=1):typeof l=="object"&&l!==null&&l.$$typeof===W&&(l._payload.status==="fulfilled"?S(l._payload.value)&&l._payload.value._store&&(l._payload.value._store.validated=1):l._store&&(l._store.validated=1))}function S(l){return typeof l=="object"&&l!==null&&l.$$typeof===f}var C=P,f=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),T=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),M=Symbol.for("react.client.reference"),L=C.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=Object.prototype.hasOwnProperty,k=Array.isArray,b=console.createTask?console.createTask:function(){return null};C={react_stack_bottom_frame:function(l){return l()}};var y,O={},v=C.react_stack_bottom_frame.bind(C,o)(),z=b(r(o)),X={};ce.Fragment=h,ce.jsx=function(l,x,F){var U=1e4>L.recentlyCreatedOwnerStacks++;return u(l,x,F,!1,U?Error("react-stack-top-frame"):v,U?b(r(l)):z)},ce.jsxs=function(l,x,F){var U=1e4>L.recentlyCreatedOwnerStacks++;return u(l,x,F,!0,U?Error("react-stack-top-frame"):v,U?b(r(l)):z)}})()),ce}var Me;function Ct(){return Me||(Me=1,process.env.NODE_ENV==="production"?he.exports=Nt():he.exports=_t()),he.exports}var w=Ct();function ze(e,t){return function(){return e.apply(t,arguments)}}const{toString:jt}=Object.prototype,{getPrototypeOf:Ae}=Object,{iterator:me,toStringTag:qe}=Symbol,be=(e=>t=>{const n=jt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Q=e=>(e=e.toLowerCase(),t=>be(t)===e),ye=e=>t=>typeof t===e,{isArray:re}=Array,se=ye("undefined");function le(e){return e!==null&&!se(e)&&e.constructor!==null&&!se(e.constructor)&&J(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const He=Q("ArrayBuffer");function vt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&He(e.buffer),t}const Pt=ye("string"),J=ye("function"),Je=ye("number"),ue=e=>e!==null&&typeof e=="object",kt=e=>e===!0||e===!1,ge=e=>{if(be(e)!=="object")return!1;const t=Ae(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(qe in e)&&!(me in e)},Ft=e=>{if(!ue(e)||le(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Dt=Q("Date"),Ut=Q("File"),Lt=Q("Blob"),It=Q("FileList"),Bt=e=>ue(e)&&J(e.pipe),Mt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||J(e.append)&&((t=be(e))==="formdata"||t==="object"&&J(e.toString)&&e.toString()==="[object FormData]"))},zt=Q("URLSearchParams"),[qt,Ht,Jt,$t]=["ReadableStream","Request","Response","Headers"].map(Q),Wt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function de(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),re(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(le(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(r=0;r<i;r++)c=o[r],t.call(null,e[c],c,e)}}function $e(e,t){if(le(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const Z=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,We=e=>!se(e)&&e!==Z;function Oe(){const{caseless:e,skipUndefined:t}=We(this)&&this||{},n={},r=(s,o)=>{const i=e&&$e(n,o)||o;ge(n[i])&&ge(s)?n[i]=Oe(n[i],s):ge(s)?n[i]=Oe({},s):re(s)?n[i]=s.slice():(!t||!se(s))&&(n[i]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&de(arguments[s],r);return n}const Vt=(e,t,n,{allOwnKeys:r}={})=>(de(t,(s,o)=>{n&&J(s)?e[o]=ze(s,n):e[o]=s},{allOwnKeys:r}),e),Qt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Yt=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Kt=(e,t,n,r)=>{let s,o,i;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&Ae(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Xt=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Gt=e=>{if(!e)return null;if(re(e))return e;let t=e.length;if(!Je(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Zt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ae(Uint8Array)),en=(e,t)=>{const r=(e&&e[me]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},tn=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},nn=Q("HTMLFormElement"),rn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Ve=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),sn=Q("RegExp"),Qe=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};de(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},on=e=>{Qe(e,(t,n)=>{if(J(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(J(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},an=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return re(e)?r(e):r(String(e).split(t)),n},cn=()=>{},ln=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function un(e){return!!(e&&J(e.append)&&e[qe]==="FormData"&&e[me])}const dn=e=>{const t=new Array(10),n=(r,s)=>{if(ue(r)){if(t.indexOf(r)>=0)return;if(le(r))return r;if(!("toJSON"in r)){t[s]=r;const o=re(r)?[]:{};return de(r,(i,c)=>{const p=n(i,s+1);!se(p)&&(o[c]=p)}),t[s]=void 0,o}}return r};return n(e,0)},fn=Q("AsyncFunction"),pn=e=>e&&(ue(e)||J(e))&&J(e.then)&&J(e.catch),Ye=((e,t)=>e?setImmediate:t?((n,r)=>(Z.addEventListener("message",({source:s,data:o})=>{s===Z&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),Z.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",J(Z.postMessage)),hn=typeof queueMicrotask<"u"?queueMicrotask.bind(Z):typeof process<"u"&&process.nextTick||Ye,a={isArray:re,isArrayBuffer:He,isBuffer:le,isFormData:Mt,isArrayBufferView:vt,isString:Pt,isNumber:Je,isBoolean:kt,isObject:ue,isPlainObject:ge,isEmptyObject:Ft,isReadableStream:qt,isRequest:Ht,isResponse:Jt,isHeaders:$t,isUndefined:se,isDate:Dt,isFile:Ut,isBlob:Lt,isRegExp:sn,isFunction:J,isStream:Bt,isURLSearchParams:zt,isTypedArray:Zt,isFileList:It,forEach:de,merge:Oe,extend:Vt,trim:Wt,stripBOM:Qt,inherits:Yt,toFlatObject:Kt,kindOf:be,kindOfTest:Q,endsWith:Xt,toArray:Gt,forEachEntry:en,matchAll:tn,isHTMLForm:nn,hasOwnProperty:Ve,hasOwnProp:Ve,reduceDescriptors:Qe,freezeMethods:on,toObjectSet:an,toCamelCase:rn,noop:cn,toFiniteNumber:ln,findKey:$e,global:Z,isContextDefined:We,isSpecCompliantForm:un,toJSONObject:dn,isAsyncFn:fn,isThenable:pn,setImmediate:Ye,asap:hn,isIterable:e=>e!=null&&J(e[me])};function E(e,t,n,r,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),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(E,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 Ke=E.prototype,Xe={};["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=>{Xe[e]={value:e}}),Object.defineProperties(E,Xe),Object.defineProperty(Ke,"isAxiosError",{value:!0}),E.from=(e,t,n,r,s,o)=>{const i=Object.create(Ke);a.toFlatObject(e,i,function(u){return u!==Error.prototype},d=>d!=="isAxiosError");const c=e&&e.message?e.message:"Error",p=t==null&&e?e.code:t;return E.call(i,c,p,n,r,s),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};const mn=null;function Ne(e){return a.isPlainObject(e)||a.isArray(e)}function Ge(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Ze(e,t,n){return e?e.concat(t).map(function(s,o){return s=Ge(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function bn(e){return a.isArray(e)&&!e.some(Ne)}const yn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function we(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,h){return!a.isUndefined(h[g])});const r=n.metaTokens,s=n.visitor||u,o=n.dots,i=n.indexes,p=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function d(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(a.isBoolean(f))return f.toString();if(!p&&a.isBlob(f))throw new E("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?p&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function u(f,g,h){let j=f;if(f&&!h&&typeof f=="object"){if(a.endsWith(g,"{}"))g=r?g:g.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&bn(f)||(a.isFileList(f)||a.endsWith(g,"[]"))&&(j=a.toArray(f)))return g=Ge(g),j.forEach(function(A,T){!(a.isUndefined(A)||A===null)&&t.append(i===!0?Ze([g],T,o):i===null?g:g+"[]",d(A))}),!1}return Ne(f)?!0:(t.append(Ze(h,g,o),d(f)),!1)}const m=[],S=Object.assign(yn,{defaultVisitor:u,convertValue:d,isVisitable:Ne});function C(f,g){if(!a.isUndefined(f)){if(m.indexOf(f)!==-1)throw Error("Circular reference detected in "+g.join("."));m.push(f),a.forEach(f,function(j,R){(!(a.isUndefined(j)||j===null)&&s.call(t,j,a.isString(R)?R.trim():R,g,S))===!0&&C(j,g?g.concat(R):[R])}),m.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return C(e),t}function et(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function _e(e,t){this._pairs=[],e&&we(e,this,t)}const tt=_e.prototype;tt.append=function(t,n){this._pairs.push([t,n])},tt.toString=function(t){const n=t?function(r){return t.call(this,r,et)}:et;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function gn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function nt(e,t,n){if(!t)return e;const r=n&&n.encode||gn;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(t,n):o=a.isURLSearchParams(t)?t.toString():new _e(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class rt{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const st={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},wn={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:_e,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Ce=typeof window<"u"&&typeof document<"u",je=typeof navigator=="object"&&navigator||void 0,xn=Ce&&(!je||["ReactNative","NativeScript","NS"].indexOf(je.product)<0),En=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Sn=Ce&&window.location.href||"http://localhost",H={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ce,hasStandardBrowserEnv:xn,hasStandardBrowserWebWorkerEnv:En,navigator:je,origin:Sn},Symbol.toStringTag,{value:"Module"})),...wn};function Rn(e,t){return we(e,new H.classes.URLSearchParams,{visitor:function(n,r,s,o){return H.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function Tn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function An(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function ot(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),p=o>=n.length;return i=!i&&a.isArray(s)?s.length:i,p?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!c):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=An(s[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(Tn(r),s,n,0)}),n}return null}function On(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const fe={transitional:st,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(ot(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Rn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const p=this.env&&this.env.FormData;return we(c?{"files[]":t}:t,p&&new p,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),On(t)):t}],transformResponse:[function(t){const n=this.transitional||fe.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(i)throw c.name==="SyntaxError"?E.from(c,E.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:H.classes.FormData,Blob:H.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=>{fe.headers[e]={}});const Nn=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),_n=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
7
|
+
`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&Nn[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},it=Symbol("internals");function pe(e){return e&&String(e).trim().toLowerCase()}function xe(e){return e===!1||e==null?e:a.isArray(e)?e.map(xe):String(e)}function Cn(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const jn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ve(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function vn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Pn(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}let $=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,p,d){const u=pe(p);if(!u)throw new Error("header name must be a non-empty string");const m=a.findKey(s,u);(!m||s[m]===void 0||d===!0||d===void 0&&s[m]!==!1)&&(s[m||p]=xe(c))}const i=(c,p)=>a.forEach(c,(d,u)=>o(d,u,p));if(a.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(a.isString(t)&&(t=t.trim())&&!jn(t))i(_n(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},p,d;for(const u of t){if(!a.isArray(u))throw TypeError("Object iterator must return a key-value pair");c[d=u[0]]=(p=c[d])?a.isArray(p)?[...p,u[1]]:[p,u[1]]:u[1]}i(c,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=pe(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Cn(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=pe(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ve(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=pe(i),i){const c=a.findKey(r,i);c&&(!n||ve(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||ve(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,o)=>{const i=a.findKey(r,o);if(i){n[i]=xe(s),delete n[o];return}const c=t?vn(o):String(o).trim();c!==o&&delete n[o],n[c]=xe(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
8
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[it]=this[it]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=pe(i);r[c]||(Pn(s,i),r[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}};$.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors($.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),a.freezeMethods($);function Pe(e,t){const n=this||fe,r=t||n,s=$.from(r.headers);let o=r.data;return a.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function at(e){return!!(e&&e.__CANCEL__)}function oe(e,t,n){E.call(this,e??"canceled",E.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(oe,E,{__CANCEL__:!0});function ct(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new E("Request failed with status code "+n.status,[E.ERR_BAD_REQUEST,E.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function kn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Fn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(p){const d=Date.now(),u=r[o];i||(i=d),n[s]=p,r[s]=d;let m=o,S=0;for(;m!==s;)S+=n[m++],m=m%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),d-i<t)return;const C=u&&d-u;return C?Math.round(S*1e3/C):void 0}}function Dn(e,t){let n=0,r=1e3/t,s,o;const i=(d,u=Date.now())=>{n=u,s=null,o&&(clearTimeout(o),o=null),e(...d)};return[(...d)=>{const u=Date.now(),m=u-n;m>=r?i(d,u):(s=d,o||(o=setTimeout(()=>{o=null,i(s)},r-m)))},()=>s&&i(s)]}const Ee=(e,t,n=3)=>{let r=0;const s=Fn(50,250);return Dn(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,p=i-r,d=s(p),u=i<=c;r=i;const m={loaded:i,total:c,progress:c?i/c:void 0,bytes:p,rate:d||void 0,estimated:d&&c&&u?(c-i)/d:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(m)},n)},lt=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ut=e=>(...t)=>a.asap(()=>e(...t)),Un=H.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,H.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(H.origin),H.navigator&&/(msie|trident)/i.test(H.navigator.userAgent)):()=>!0,Ln=H.hasStandardBrowserEnv?{write(e,t,n,r,s,o,i){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),a.isString(r)&&c.push(`path=${r}`),a.isString(s)&&c.push(`domain=${s}`),o===!0&&c.push("secure"),a.isString(i)&&c.push(`SameSite=${i}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function In(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Bn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function dt(e,t,n){let r=!In(t);return e&&(r||n==!1)?Bn(e,t):t}const ft=e=>e instanceof $?{...e}:e;function ee(e,t){t=t||{};const n={};function r(d,u,m,S){return a.isPlainObject(d)&&a.isPlainObject(u)?a.merge.call({caseless:S},d,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function s(d,u,m,S){if(a.isUndefined(u)){if(!a.isUndefined(d))return r(void 0,d,m,S)}else return r(d,u,m,S)}function o(d,u){if(!a.isUndefined(u))return r(void 0,u)}function i(d,u){if(a.isUndefined(u)){if(!a.isUndefined(d))return r(void 0,d)}else return r(void 0,u)}function c(d,u,m){if(m in t)return r(d,u);if(m in e)return r(void 0,d)}const p={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(d,u,m)=>s(ft(d),ft(u),m,!0)};return a.forEach(Object.keys({...e,...t}),function(u){const m=p[u]||s,S=m(e[u],t[u],u);a.isUndefined(S)&&m!==c||(n[u]=S)}),n}const pt=e=>{const t=ee({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=t;if(t.headers=i=$.from(i),t.url=nt(dt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(n)){if(H.hasStandardBrowserEnv||H.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const p=n.getHeaders(),d=["content-type","content-length"];Object.entries(p).forEach(([u,m])=>{d.includes(u.toLowerCase())&&i.set(u,m)})}}if(H.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&Un(t.url))){const p=s&&o&&Ln.read(o);p&&i.set(s,p)}return t},Mn=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=pt(e);let o=s.data;const i=$.from(s.headers).normalize();let{responseType:c,onUploadProgress:p,onDownloadProgress:d}=s,u,m,S,C,f;function g(){C&&C(),f&&f(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function j(){if(!h)return;const A=$.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),_={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:A,config:e,request:h};ct(function(D){n(D),g()},function(D){r(D),g()},_),h=null}"onloadend"in h?h.onloadend=j:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(j)},h.onabort=function(){h&&(r(new E("Request aborted",E.ECONNABORTED,e,h)),h=null)},h.onerror=function(T){const _=T&&T.message?T.message:"Network Error",N=new E(_,E.ERR_NETWORK,e,h);N.event=T||null,r(N),h=null},h.ontimeout=function(){let T=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const _=s.transitional||st;s.timeoutErrorMessage&&(T=s.timeoutErrorMessage),r(new E(T,_.clarifyTimeoutError?E.ETIMEDOUT:E.ECONNABORTED,e,h)),h=null},o===void 0&&i.setContentType(null),"setRequestHeader"in h&&a.forEach(i.toJSON(),function(T,_){h.setRequestHeader(_,T)}),a.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),c&&c!=="json"&&(h.responseType=s.responseType),d&&([S,f]=Ee(d,!0),h.addEventListener("progress",S)),p&&h.upload&&([m,C]=Ee(p),h.upload.addEventListener("progress",m),h.upload.addEventListener("loadend",C)),(s.cancelToken||s.signal)&&(u=A=>{h&&(r(!A||A.type?new oe(null,e,h):A),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const R=kn(s.url);if(R&&H.protocols.indexOf(R)===-1){r(new E("Unsupported protocol "+R+":",E.ERR_BAD_REQUEST,e));return}h.send(o||null)})},zn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(d){if(!s){s=!0,c();const u=d instanceof Error?d:this.reason;r.abort(u instanceof E?u:new oe(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,o(new E(`timeout ${t} of ms exceeded`,E.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(o):d.removeEventListener("abort",o)}),e=null)};e.forEach(d=>d.addEventListener("abort",o));const{signal:p}=r;return p.unsubscribe=()=>a.asap(c),p}},qn=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},Hn=async function*(e,t){for await(const n of Jn(e))yield*qn(n,t)},Jn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},ht=(e,t,n,r)=>{const s=Hn(e,t);let o=0,i,c=p=>{i||(i=!0,r&&r(p))};return new ReadableStream({async pull(p){try{const{done:d,value:u}=await s.next();if(d){c(),p.close();return}let m=u.byteLength;if(n){let S=o+=m;n(S)}p.enqueue(new Uint8Array(u))}catch(d){throw c(d),d}},cancel(p){return c(p),s.return()}},{highWaterMark:2})},mt=64*1024,{isFunction:Se}=a,$n=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:bt,TextEncoder:yt}=a.global,gt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Wn=e=>{e=a.merge.call({skipUndefined:!0},$n,e);const{fetch:t,Request:n,Response:r}=e,s=t?Se(t):typeof fetch=="function",o=Se(n),i=Se(r);if(!s)return!1;const c=s&&Se(bt),p=s&&(typeof yt=="function"?(f=>g=>f.encode(g))(new yt):async f=>new Uint8Array(await new n(f).arrayBuffer())),d=o&&c&>(()=>{let f=!1;const g=new n(H.origin,{body:new bt,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!g}),u=i&&c&>(()=>a.isReadableStream(new r("").body)),m={stream:u&&(f=>f.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!m[f]&&(m[f]=(g,h)=>{let j=g&&g[f];if(j)return j.call(g);throw new E(`Response type '${f}' is not supported`,E.ERR_NOT_SUPPORT,h)})});const S=async f=>{if(f==null)return 0;if(a.isBlob(f))return f.size;if(a.isSpecCompliantForm(f))return(await new n(H.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(a.isArrayBufferView(f)||a.isArrayBuffer(f))return f.byteLength;if(a.isURLSearchParams(f)&&(f=f+""),a.isString(f))return(await p(f)).byteLength},C=async(f,g)=>{const h=a.toFiniteNumber(f.getContentLength());return h??S(g)};return async f=>{let{url:g,method:h,data:j,signal:R,cancelToken:A,timeout:T,onDownloadProgress:_,onUploadProgress:N,responseType:D,headers:K,withCredentials:W="same-origin",fetchOptions:V}=pt(f),M=t||fetch;D=D?(D+"").toLowerCase():"text";let L=zn([R,A&&A.toAbortSignal()],T),B=null;const k=L&&L.unsubscribe&&(()=>{L.unsubscribe()});let b;try{if(N&&d&&h!=="get"&&h!=="head"&&(b=await C(K,j))!==0){let l=new n(g,{method:"POST",body:j,duplex:"half"}),x;if(a.isFormData(j)&&(x=l.headers.get("content-type"))&&K.setContentType(x),l.body){const[F,U]=lt(b,Ee(ut(N)));j=ht(l.body,mt,F,U)}}a.isString(W)||(W=W?"include":"omit");const y=o&&"credentials"in n.prototype,O={...V,signal:L,method:h.toUpperCase(),headers:K.normalize().toJSON(),body:j,duplex:"half",credentials:y?W:void 0};B=o&&new n(g,O);let v=await(o?M(B,V):M(g,O));const z=u&&(D==="stream"||D==="response");if(u&&(_||z&&k)){const l={};["status","statusText","headers"].forEach(ne=>{l[ne]=v[ne]});const x=a.toFiniteNumber(v.headers.get("content-length")),[F,U]=_&<(x,Ee(ut(_),!0))||[];v=new r(ht(v.body,mt,F,()=>{U&&U(),k&&k()}),l)}D=D||"text";let X=await m[a.findKey(m,D)||"text"](v,f);return!z&&k&&k(),await new Promise((l,x)=>{ct(l,x,{data:X,headers:$.from(v.headers),status:v.status,statusText:v.statusText,config:f,request:B})})}catch(y){throw k&&k(),y&&y.name==="TypeError"&&/Load failed|fetch/i.test(y.message)?Object.assign(new E("Network Error",E.ERR_NETWORK,f,B),{cause:y.cause||y}):E.from(y,y&&y.code,f,B)}}},Vn=new Map,wt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,o=[r,s,n];let i=o.length,c=i,p,d,u=Vn;for(;c--;)p=o[c],d=u.get(p),d===void 0&&u.set(p,d=c?new Map:Wn(t)),u=d;return d};wt();const ke={http:mn,xhr:Mn,fetch:{get:wt}};a.forEach(ke,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const xt=e=>`- ${e}`,Qn=e=>a.isFunction(e)||e===null||e===!1;function Yn(e,t){e=a.isArray(e)?e:[e];const{length:n}=e;let r,s;const o={};for(let i=0;i<n;i++){r=e[i];let c;if(s=r,!Qn(r)&&(s=ke[(c=String(r)).toLowerCase()],s===void 0))throw new E(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(t))))break;o[c||"#"+i]=s}if(!s){const i=Object.entries(o).map(([p,d])=>`adapter ${p} `+(d===!1?"is not supported by the environment":"is not available in the build"));let c=n?i.length>1?`since :
|
|
9
|
+
`+i.map(xt).join(`
|
|
10
|
+
`):" "+xt(i[0]):"as no adapter specified";throw new E("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const Et={getAdapter:Yn,adapters:ke};function Fe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new oe(null,e)}function St(e){return Fe(e),e.headers=$.from(e.headers),e.data=Pe.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Et.getAdapter(e.adapter||fe.adapter,e)(e).then(function(r){return Fe(e),r.data=Pe.call(e,e.transformResponse,r),r.headers=$.from(r.headers),r},function(r){return at(r)||(Fe(e),r&&r.response&&(r.response.data=Pe.call(e,e.transformResponse,r.response),r.response.headers=$.from(r.response.headers))),Promise.reject(r)})}const Rt="1.13.2",Re={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Re[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Tt={};Re.transitional=function(t,n,r){function s(o,i){return"[Axios v"+Rt+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,c)=>{if(t===!1)throw new E(s(i," has been removed"+(n?" in "+n:"")),E.ERR_DEPRECATED);return n&&!Tt[i]&&(Tt[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}},Re.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Kn(e,t,n){if(typeof e!="object")throw new E("options must be an object",E.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const c=e[o],p=c===void 0||i(c,o,e);if(p!==!0)throw new E("option "+o+" must be "+p,E.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new E("Unknown option "+o,E.ERR_BAD_OPTION)}}const Te={assertOptions:Kn,validators:Re},Y=Te.validators;let te=class{constructor(t){this.defaults=t||{},this.interceptors={request:new rt,response:new rt}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
11
|
+
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ee(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&Te.assertOptions(r,{silentJSONParsing:Y.transitional(Y.boolean),forcedJSONParsing:Y.transitional(Y.boolean),clarifyTimeoutError:Y.transitional(Y.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:Te.assertOptions(s,{encode:Y.function,serialize:Y.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Te.assertOptions(n,{baseUrl:Y.spelling("baseURL"),withXsrfToken:Y.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete o[f]}),n.headers=$.concat(i,o);const c=[];let p=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(p=p&&g.synchronous,c.unshift(g.fulfilled,g.rejected))});const d=[];this.interceptors.response.forEach(function(g){d.push(g.fulfilled,g.rejected)});let u,m=0,S;if(!p){const f=[St.bind(this),void 0];for(f.unshift(...c),f.push(...d),S=f.length,u=Promise.resolve(n);m<S;)u=u.then(f[m++],f[m++]);return u}S=c.length;let C=n;for(;m<S;){const f=c[m++],g=c[m++];try{C=f(C)}catch(h){g.call(this,h);break}}try{u=St.call(this,C)}catch(f){return Promise.reject(f)}for(m=0,S=d.length;m<S;)u=u.then(d[m++],d[m++]);return u}getUri(t){t=ee(this.defaults,t);const n=dt(t.baseURL,t.url,t.allowAbsoluteUrls);return nt(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){te.prototype[t]=function(n,r){return this.request(ee(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request(ee(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}te.prototype[t]=n(),te.prototype[t+"Form"]=n(!0)});let Xn=class Ot{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new oe(o,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ot(function(s){t=s}),cancel:t}}};function Gn(e){return function(n){return e.apply(null,n)}}function Zn(e){return a.isObject(e)&&e.isAxiosError===!0}const De={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(De).forEach(([e,t])=>{De[t]=e});function At(e){const t=new te(e),n=ze(te.prototype.request,t);return a.extend(n,te.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return At(ee(e,s))},n}const I=At(fe);I.Axios=te,I.CanceledError=oe,I.CancelToken=Xn,I.isCancel=at,I.VERSION=Rt,I.toFormData=we,I.AxiosError=E,I.Cancel=I.CanceledError,I.all=function(t){return Promise.all(t)},I.spread=Gn,I.isAxiosError=Zn,I.mergeConfig=ee,I.AxiosHeaders=$,I.formToJSON=e=>ot(a.isHTMLForm(e)?new FormData(e):e),I.getAdapter=Et.getAdapter,I.HttpStatusCode=De,I.default=I;const{Axios:dr,AxiosError:fr,CanceledError:pr,isCancel:hr,CancelToken:mr,VERSION:br,all:yr,Cancel:gr,isAxiosError:wr,spread:xr,toFormData:Er,AxiosHeaders:Sr,HttpStatusCode:Rr,formToJSON:Tr,getAdapter:Ar,mergeConfig:Or}=I;class er{client;constructor(t,n){this.client=I.create({baseURL:t||void 0||"http://localhost:8080",headers:{"Content-Type":"application/json"}}),n&&this.setApiKey(n)}setApiKey(t){this.client.defaults.headers.common.Authorization=`Bearer ${t}`}async getQuiz(t){try{const r=(await this.client.get("/core/quiz")).data,s=Array.isArray(r)?r.find(o=>o.id===t):null;if(!s)throw new Error(`Quiz with ID "${t}" not found`);return{id:s.id,name:s.name,renderMode:s.renderMode||"steps",nodes:s.nodes||[],edges:s.edges||[]}}catch(n){throw I.isAxiosError(n)?n.response?.status===401?new Error("Invalid API key. Please check your authentication credentials."):new Error(`Failed to fetch quiz: ${n.response?.data?.message||n.message}`):n}}async createSession(t){const n=`session_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,r={sessionId:n,quizId:t,startedAt:Date.now(),answers:{}};return localStorage.setItem(`quiz_session_${n}`,JSON.stringify(r)),{sessionId:n}}async submitAnswer(t,n,r){try{const s=`quiz_session_${t}`,o=localStorage.getItem(s);if(!o)throw new Error("Session not found");const i=JSON.parse(o);i.answers[n]=r,localStorage.setItem(s,JSON.stringify(i))}catch(s){console.error("Failed to submit answer:",s)}}async completeSession(t){try{const n=`quiz_session_${t}`,r=localStorage.getItem(n);if(!r)throw new Error("Session not found");const s=JSON.parse(r);s.completedAt=Date.now(),s.status="completed",localStorage.setItem(n,JSON.stringify(s))}catch(n){console.error("Failed to complete session:",n)}}}const tr=({nodes:e,onAnswer:t,onProgress:n,onComplete:r})=>{const[s,o]=P.useState(0),[i,c]=P.useState({}),[p,d]=P.useState({});P.useEffect(()=>{n({currentStep:s+1,totalSteps:e.length,percentage:(s+1)/e.length*100}),d({})},[s,e.length,n]);const u=(R,A,T=!0)=>{c(_=>({..._,[A]:R})),t({questionId:A,answer:R,timestamp:Date.now()}),T&&C()},m=(R,A)=>{d(T=>({...T,[A]:R}))},S=R=>{(R.data.children||[]).forEach(T=>{const _=p[T.id];_!==void 0&&t({questionId:T.id,answer:_,timestamp:Date.now()})}),c(T=>({...T,...p})),C()},C=()=>{s<e.length-1?o(s+1):r()},f=()=>{s>0&&o(s-1)},g=(R,A=!1)=>{const T=R.data?.type||R.type,_=R.id;return w.jsxs("div",{className:`mb-6 ${A?"pl-4 border-l-2 border-gray-100":""}`,children:[w.jsxs("div",{className:"mb-4",children:[w.jsx("h3",{className:"text-xl font-semibold text-gray-800 mb-2 leading-tight",children:R.data.label}),R.data.content&&w.jsx("p",{className:"text-gray-500 mb-6 leading-relaxed",children:R.data.content})]}),w.jsxs("div",{className:"flex flex-col gap-3 mb-6",children:[(T==="multiple-choice"||T==="multipleChoice")&&w.jsx("div",{className:"grid grid-cols-1 gap-3",children:R.data.options?.map((N,D)=>w.jsx("button",{className:`p-4 bg-gray-50 border-2 border-gray-200 rounded-lg text-left text-gray-800 cursor-pointer transition-all duration-200 hover:bg-gray-100 hover:border-indigo-500 hover:-translate-y-0.5 hover:shadow-md ${A&&p[_]===(N.value||N)?"border-indigo-500 bg-indigo-50":""}`,onClick:()=>A?m(N.value||N,_):u(N.value||N,_),children:N.label||N},D))}),(T==="input-text"||T==="input-email"||T==="input-phone"||T==="text")&&w.jsxs("div",{className:"flex flex-col md:flex-row gap-3",children:[w.jsx("input",{className:"flex-1 p-4 border-2 border-gray-200 rounded-lg text-base transition-colors duration-200 focus:outline-none focus:border-indigo-500",type:T==="input-email"?"email":"text",placeholder:R.data.placeholder||"Type your answer...",value:A?p[_]||"":void 0,onChange:N=>A&&m(N.target.value,_),onKeyPress:N=>{!A&&N.key==="Enter"&&u(N.target.value,_)}}),!A&&w.jsx("button",{className:"px-8 py-4 bg-gradient-to-r from-indigo-500 to-purple-600 text-white border-none rounded-lg text-base font-semibold cursor-pointer transition-transform duration-200 hover:-translate-y-0.5 hover:shadow-lg",onClick:N=>{const D=N.currentTarget.previousElementSibling;u(D.value,_)},children:"Submit"})]})]})]},_)};if(e.length===0)return w.jsx("div",{className:"text-center py-16 px-4 text-gray-500 text-lg",children:"No questions available"});const h=e[s],j=h.type;return w.jsxs("div",{className:"max-w-[800px] mx-auto p-5 font-sans md:p-3",children:[w.jsx("div",{className:"w-full h-2 bg-gray-200 rounded-full overflow-hidden mb-8",children:w.jsx("div",{className:"h-full bg-gradient-to-r from-indigo-500 to-purple-600 transition-[width] duration-300 ease-out",style:{width:`${(s+1)/e.length*100}%`}})}),w.jsxs("div",{className:"bg-white rounded-xl p-10 shadow-md md:p-6",children:[w.jsx("div",{className:"mb-5",children:w.jsxs("span",{className:"text-sm text-indigo-500 font-semibold uppercase tracking-wide",children:["Step ",s+1," of ",e.length]})}),j==="group"?w.jsxs("div",{className:"quiz-steps-group",children:[w.jsx("h2",{className:"text-2xl text-gray-800 mb-3 leading-tight font-semibold",children:h.data.label}),w.jsx("div",{className:"mt-6 space-y-4",children:h.data.children?.map(R=>g(R,!0))}),w.jsx("div",{className:"mt-8 flex justify-end",children:w.jsx("button",{className:"px-8 py-3 bg-gradient-to-r from-indigo-500 to-purple-600 text-white rounded-lg font-semibold hover:opacity-90 transition-opacity",onClick:()=>S(h),children:"Continue"})})]}):g(h),w.jsx("div",{className:"flex justify-start mt-6",children:s>0&&w.jsx("button",{className:"px-6 py-3 bg-transparent text-indigo-500 border-2 border-indigo-500 rounded-lg text-sm font-semibold cursor-pointer transition-all duration-200 hover:bg-indigo-500 hover:text-white",onClick:f,children:"Previous"})})]})]})},nr=({nodes:e,edges:t,onAnswer:n,onComplete:r,theme:s})=>{const[o,i]=P.useState([]),[c,p]=P.useState(null),[d,u]=P.useState([]),[m,S]=P.useState(null),[C,f]=P.useState(!1),g=P.useRef(null),h=P.useRef(!1),j=P.useRef(r);P.useEffect(()=>{j.current=r},[r]);const R=()=>{g.current&&(g.current.scrollTop=g.current.scrollHeight)};P.useEffect(()=>{R()},[o,C,m]),P.useEffect(()=>{if(h.current||e.length===0)return;const b=new Set(t.map(O=>O.target)),y=e.find(O=>!b.has(O.id))||e[0];y&&(h.current=!0,A(y.id))},[e,t]);const A=b=>{const y=e.find(O=>O.id===b);if(!y){console.error(`Node ${b} not found`);return}if(y.type==="group"){const O=y.data?.children||y.data||[],v=Array.isArray(O)?O:Array.isArray(y.data)?y.data:[];if(v.length>0){const z=[...d,{groupId:y.id,children:v,currentIndex:0}];u(z),T(v[0])}else D(y.id)}else p(y.id),_(y)},T=b=>{_(b)},_=b=>{S(b),f(!0);const y=V(b),O=Math.min(1e3,500+(y.content?.length||0)*20);setTimeout(()=>{f(!1);const v=y.content||y.label;v&&L("bot",v),M(b)&&setTimeout(()=>{N(null,b)},1500)},O)},N=(b,y,O)=>{const v=y.id||c||"unknown";if(b!==null&&n({questionId:v,answer:b,timestamp:Date.now()}),d.length>0){const z=d[d.length-1];if(z.currentIndex<z.children.length-1){const X=z.currentIndex+1,l={...z,currentIndex:X};u([...d.slice(0,-1),l]),T(z.children[X])}else{const X=z.groupId;u(d.slice(0,-1)),D(X,O)}}else{const z=y.id;D(z,O)}},D=(b,y)=>{const O=t.find(v=>v.source===b&&(!y||v.sourceHandle===y));O?A(O.target):K()},K=async()=>{f(!0),S(null),setTimeout(()=>{f(!1),L("bot","Obrigado! Suas respostas foram enviadas com sucesso."),setTimeout(()=>{j.current&&j.current()},2e3)},1e3)},W=(b,y,O)=>{if(!m)return;L("user",y||b);const v=m;S(null),N(b,v,O)},V=b=>{const y=b.data||b;return{id:b.id,label:y.label||b.label,content:y.content||b.content,type:y.type||b.type,placeholder:y.placeholder||b.placeholder,options:y.options||b.options}},M=b=>{const y=V(b),O=(y.type||"").toLowerCase();return O==="text"||O==="base"||O==="description"||O==="base"&&!y.type||O==="message"},L=(b,y)=>{i(O=>[...O,{id:Date.now().toString(),type:b,content:y,timestamp:Date.now()}])},B=m?V(m):null,k=B?.type;return w.jsxs("div",{className:"flex flex-col h-full rounded-xl overflow-hidden font-[Inter,sans-serif] relative",style:{backgroundColor:s?.backgroundColor||"#f5f7fa"},children:[w.jsxs("div",{ref:g,className:"flex-1 overflow-y-auto p-5 flex flex-col gap-4",children:[o.map(b=>w.jsxs("div",{className:`flex flex-col max-w-[80%] animate-[fadeIn_0.3s_ease] ${b.type==="bot"?"self-start":"self-end items-end"}`,children:[w.jsx("div",{className:`p-3 px-4 rounded-2xl text-[15px] leading-relaxed shadow-sm ${b.type==="bot"?"bg-white text-[#1a1a1a] rounded-tl-sm":"text-white rounded-tr-sm"}`,style:b.type==="user"?{backgroundColor:s?.primaryColor||"#007aff"}:{},children:b.content}),w.jsx("span",{className:`text-[11px] text-[#999] mt-1 ${b.type==="bot"?"ml-1":"mr-1"}`,children:new Date(b.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]},b.id)),C&&w.jsx("div",{className:"flex flex-col max-w-[80%] animate-[fadeIn_0.3s_ease] self-start",children:w.jsxs("div",{className:"flex gap-1 p-3 px-4 bg-white rounded-2xl rounded-tl-sm w-fit",children:[w.jsx("span",{className:"w-1.5 h-1.5 bg-[#ccc] rounded-full animate-bounce animate-bounce-delay-1"}),w.jsx("span",{className:"w-1.5 h-1.5 bg-[#ccc] rounded-full animate-bounce animate-bounce-delay-2"}),w.jsx("span",{className:"w-1.5 h-1.5 bg-[#ccc] rounded-full animate-bounce"})]})})]}),!C&&m&&!M(m)&&w.jsxs("div",{className:"p-4 bg-white border-t border-[#eee]",children:[(k==="multiple-choice"||k==="multipleChoice")&&w.jsx("div",{className:"flex flex-wrap gap-2 justify-center",children:B?.options?.map(b=>w.jsx("button",{onClick:()=>W(b.value||b.label,b.label,b.id),className:"px-5 py-2.5 bg-white border rounded-full cursor-pointer font-medium transition-all duration-200 hover:text-white",style:{borderColor:s?.primaryColor||"#007aff",color:s?.primaryColor||"#007aff"},onMouseEnter:y=>{y.currentTarget.style.backgroundColor=s?.primaryColor||"#007aff",y.currentTarget.style.color="white"},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="white",y.currentTarget.style.color=s?.primaryColor||"#007aff"},children:b.label||b.value||b},b.id||b.label))}),(k==="input-text"||k==="input-email"||k==="input-phone"||k==="text-input"||k==="text")&&w.jsx("div",{className:"w-full",children:w.jsxs("form",{className:"flex gap-2.5",onSubmit:b=>{b.preventDefault();const y=b.currentTarget.elements[0];y.value.trim()&&(W(y.value),y.value="")},children:[w.jsx("input",{type:k==="input-email"?"email":"text",placeholder:B?.placeholder||"Type your answer...",autoFocus:!0,className:"flex-1 p-3 border border-[#ddd] rounded-3xl outline-none text-[15px] focus:border-[var(--primary-color)]",style:{"--primary-color":s?.primaryColor||"#007aff"}}),w.jsx("button",{type:"submit",className:"px-6 text-white border-none rounded-3xl font-semibold cursor-pointer",style:{backgroundColor:s?.primaryColor||"#007aff"},children:"Enviar"})]})})]})]})},rr=({quizId:e,apiKey:t,mode:n="steps",baseUrl:r,onStart:s,onAnswer:o,onProgress:i,onComplete:c,onError:p,className:d,style:u,theme:m})=>{const[S,C]=P.useState(null),[f,g]=P.useState(!0),[h,j]=P.useState(null),[R,A]=P.useState(null),[T,_]=P.useState({}),N=P.useRef(null);P.useEffect(()=>{N.current=new er(r,t),(async()=>{try{g(!0),j(null);const L=await N.current.getQuiz(e);C(L);const B=await N.current.createSession(e);if(A(B.sessionId),s){const k={quizId:e,timestamp:Date.now()};s(k)}g(!1)}catch(L){const B=L instanceof Error?L.message:"Failed to load quiz";if(j(B),g(!1),p){const k={error:L instanceof Error?L:new Error(B),message:B,timestamp:Date.now()};p(k)}}})()},[e,t,r,s,p]);const D=async M=>{const L={...T,[M.questionId]:M.answer};if(_(L),o&&o(M),R&&N.current)try{await N.current.submitAnswer(R,M.questionId,M.answer)}catch(B){console.error("Failed to submit answer:",B)}},K=M=>{i&&i(M)},W=async()=>{if(R&&N.current)try{await N.current.completeSession(R)}catch(M){console.error("Failed to complete session:",M)}if(c){const M=(k,b)=>{for(const y of k){const O=y.data||y;if(y.id===b)return O.label||O.content||"Unknown Question";const v=O.children||(Array.isArray(O)?O:[]);if(v.length>0){const z=M(v,b);if(z!=="Unknown Question")return z}}return"Unknown Question"},L=Object.entries(T).map(([k,b])=>({question:M(S?.nodes||[],k),answer:b})),B={quizId:e,answers:T,result:L,timestamp:Date.now(),sessionId:R||void 0};c(B)}};if(f)return w.jsxs("div",{className:`flex flex-col items-center justify-center py-16 px-5 text-center ${d||""}`,style:u,children:[w.jsx("div",{className:"w-12 h-12 border-4 border-gray-200 border-t-indigo-500 rounded-full animate-spin mb-5"}),w.jsx("p",{className:"text-gray-500",children:"Loading quiz..."})]});if(h)return w.jsxs("div",{className:`flex flex-col items-center justify-center py-16 px-5 text-center ${d||""}`,style:u,children:[w.jsx("div",{className:"text-5xl mb-4",children:"⚠️"}),w.jsx("h3",{className:"text-red-600 text-2xl mb-3",children:"Failed to Load Quiz"}),w.jsx("p",{className:"text-gray-500 mx-auto max-w-[500px]",children:h})]});if(!S)return null;const V=n||S.renderMode||"steps";return w.jsxs("div",{className:`w-full min-h-[400px] ${d||""}`,style:u,children:[V==="steps"&&w.jsx(tr,{nodes:S.nodes,onAnswer:D,onProgress:K,onComplete:W}),V==="chat"&&w.jsx(nr,{nodes:S.nodes,edges:S.edges,onAnswer:D,onProgress:K,onComplete:W,theme:m}),V==="single"&&w.jsx("div",{className:"p-10 text-center text-gray-500",children:w.jsx("p",{children:"Single mode not yet implemented"})}),V==="flow"&&w.jsx("div",{className:"p-10 text-center text-gray-500",children:w.jsx("p",{children:"Flow mode not yet implemented"})})]})};G.Quiz=rr,Object.defineProperty(G,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "myquizbot-react",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "React component library for MyQuizBot - Interactive quiz components with API integration",
|
|
7
7
|
"main": "./dist/myquizbot-react.umd.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"import": "./dist/myquizbot-react.es.js",
|
|
14
14
|
"require": "./dist/myquizbot-react.umd.js"
|
|
15
15
|
},
|
|
16
|
-
"./
|
|
16
|
+
"./style.css": "./dist/style.css"
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
19
|
"dist"
|
|
@@ -33,20 +33,25 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@eslint/js": "^9.39.1",
|
|
36
|
+
"@tailwindcss/postcss": "^4.1.18",
|
|
36
37
|
"@types/node": "^24.10.1",
|
|
37
38
|
"@types/react": "^19.2.5",
|
|
38
39
|
"@types/react-dom": "^19.2.3",
|
|
39
40
|
"@vitejs/plugin-react": "^5.1.1",
|
|
41
|
+
"autoprefixer": "^10.4.23",
|
|
40
42
|
"eslint": "^9.39.1",
|
|
41
43
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
42
44
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
43
45
|
"globals": "^16.5.0",
|
|
46
|
+
"postcss": "^8.5.6",
|
|
44
47
|
"react": "^19.2.0",
|
|
45
48
|
"react-dom": "^19.2.0",
|
|
49
|
+
"tailwindcss": "^4.1.18",
|
|
46
50
|
"typescript": "~5.9.3",
|
|
47
51
|
"typescript-eslint": "^8.46.4",
|
|
48
52
|
"vite": "^7.2.4",
|
|
49
|
-
"vite-plugin-dts": "^4.5.4"
|
|
53
|
+
"vite-plugin-dts": "^4.5.4",
|
|
54
|
+
"vite-plugin-lib-inject-css": "^2.2.2"
|
|
50
55
|
},
|
|
51
56
|
"keywords": [
|
|
52
57
|
"react",
|
package/dist/react.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.quiz-steps-container{max-width:800px;margin:0 auto;padding:20px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif}.quiz-steps-progress{width:100%;height:8px;background-color:#e0e0e0;border-radius:4px;overflow:hidden;margin-bottom:30px}.quiz-steps-progress-bar{height:100%;background:linear-gradient(90deg,#667eea,#764ba2);transition:width .3s ease}.quiz-steps-content{background:#fff;border-radius:12px;padding:40px;box-shadow:0 4px 6px #0000001a}.quiz-steps-header{margin-bottom:20px}.quiz-steps-counter{font-size:14px;color:#667eea;font-weight:600;text-transform:uppercase;letter-spacing:.5px}.quiz-steps-question h2{font-size:28px;color:#2d3748;margin:0 0 12px;line-height:1.3}.quiz-steps-question p{font-size:16px;color:#718096;margin:0 0 30px;line-height:1.6}.quiz-steps-options{display:flex;flex-direction:column;gap:12px;margin-bottom:30px}.quiz-steps-option{padding:16px 24px;background:#f7fafc;border:2px solid #e2e8f0;border-radius:8px;font-size:16px;color:#2d3748;cursor:pointer;transition:all .2s ease;text-align:left}.quiz-steps-option:hover{background:#edf2f7;border-color:#667eea;transform:translateY(-2px);box-shadow:0 4px 12px #667eea26}.quiz-steps-text-input{display:flex;gap:12px}.quiz-steps-text-input input{flex:1;padding:16px;border:2px solid #e2e8f0;border-radius:8px;font-size:16px;transition:border-color .2s ease}.quiz-steps-text-input input:focus{outline:none;border-color:#667eea}.quiz-steps-text-input button{padding:16px 32px;background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;border:none;border-radius:8px;font-size:16px;font-weight:600;cursor:pointer;transition:transform .2s ease,box-shadow .2s ease}.quiz-steps-text-input button:hover{transform:translateY(-2px);box-shadow:0 4px 12px #667eea4d}.quiz-steps-navigation{display:flex;justify-content:flex-start}.quiz-steps-nav-button{padding:12px 24px;background:transparent;color:#667eea;border:2px solid #667eea;border-radius:8px;font-size:14px;font-weight:600;cursor:pointer;transition:all .2s ease}.quiz-steps-nav-button:hover{background:#667eea;color:#fff}.quiz-steps-empty{text-align:center;padding:60px 20px;color:#718096;font-size:18px}@media(max-width:768px){.quiz-steps-container{padding:12px}.quiz-steps-content{padding:24px}.quiz-steps-question h2{font-size:22px}.quiz-steps-text-input{flex-direction:column}}.quiz-container{width:100%;min-height:400px}.quiz-loading,.quiz-error{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px 20px;text-align:center}.quiz-spinner{width:48px;height:48px;border:4px solid #e2e8f0;border-top-color:#667eea;border-radius:50%;animation:quiz-spin .8s linear infinite;margin-bottom:20px}@keyframes quiz-spin{to{transform:rotate(360deg)}}.quiz-loading p{color:#718096;font-size:16px;margin:0}.quiz-error-icon{font-size:48px;margin-bottom:16px}.quiz-error h3{color:#e53e3e;font-size:24px;margin:0 0 12px}.quiz-error p{color:#718096;font-size:16px;margin:0;max-width:500px}.quiz-single-mode,.quiz-flow-mode{padding:40px;text-align:center;color:#718096}
|