@clicktap/state 0.11.5 → 0.12.1
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/auth/AuthProvider.d.ts +266 -230
- package/auth/auth.d.ts +127 -109
- package/index.js +24 -24
- package/index.mjs +1301 -1257
- package/package.json +5 -5
- package/toast/ToastProvider.d.ts +142 -42
- package/toast/timer.d.ts +16 -20
- package/toast/toast.d.ts +71 -21
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function ko(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function xo(){const e=ko();if(e.__xstate__)return e.__xstate__}const Po=e=>{if(typeof window>"u")return;const t=xo();t&&t.register(e)};class Nr{constructor(t){this._process=t,this._active=!1,this._current=null,this._last=null}start(){this._active=!0,this.flush()}clear(){this._current&&(this._current.next=null,this._last=this._current)}enqueue(t){const n={value:t,next:null};if(this._current){this._last.next=n,this._last=n;return}this._current=n,this._last=n,this._active&&this.flush()}flush(){for(;this._current;){const t=this._current;this._process(t.value),this._current=t.next}this._last=null}}const ps=".",Io="",ys="",jo="#",Do="*",ms="xstate.init",$o="xstate.error",Tt="xstate.stop";function Fo(e,t){return{type:`xstate.after.${e}.${t}`}}function Un(e,t){return{type:`xstate.done.state.${e}`,output:t}}function Mo(e,t){return{type:`xstate.done.actor.${e}`,output:t}}function vs(e,t){return{type:`xstate.error.actor.${e}`,error:t}}function gs(e){return{type:ms,input:e}}function Oe(e){setTimeout(()=>{throw e})}const No=(()=>typeof Symbol=="function"&&Symbol.observable||"@@observable")();function Ur(e,t){return`${e.sessionId}.${t}`}let Uo=0;function Lo(e,t){const n=new Map,r=new Map,s=new WeakMap,i=new Set,a={},c=t.clock,h={schedule:(d,m,E,w,b=Math.random().toString(36).slice(2))=>{const O={source:d,target:m,event:E,delay:w,id:b,startedAt:Date.now()},j=Ur(d,b);l._snapshot._scheduledEvents[j]=O;const J=c.setTimeout(()=>{delete a[j],delete l._snapshot._scheduledEvents[j],l._relay(d,m,E)},w);a[j]=J},cancel:(d,m)=>{const E=Ur(d,m),w=a[E];delete a[E],delete l._snapshot._scheduledEvents[E],c.clearTimeout(w)},cancelAll:d=>{for(const m in l._snapshot._scheduledEvents){const E=l._snapshot._scheduledEvents[m];E.source===d&&h.cancel(d,E.id)}}},l={_snapshot:{_scheduledEvents:((t==null?void 0:t.snapshot)&&t.snapshot.scheduler)??{}},_bookId:()=>`x:${Uo++}`,_register:(d,m)=>(n.set(d,m),d),_unregister:d=>{n.delete(d.sessionId);const m=s.get(d);m!==void 0&&(r.delete(m),s.delete(d))},get:d=>r.get(d),_set:(d,m)=>{const E=r.get(d);if(E&&E!==m)throw new Error(`Actor with system ID '${d}' already exists.`);r.set(d,m),s.set(m,d)},inspect:d=>{i.add(d)},_sendInspectionEvent:d=>{const m={...d,rootId:e.sessionId};i.forEach(E=>{var w;return(w=E.next)==null?void 0:w.call(E,m)})},_relay:(d,m,E)=>{l._sendInspectionEvent({type:"@xstate.event",sourceRef:d,actorRef:m,event:E}),m._send(E)},scheduler:h,getSnapshot:()=>({_scheduledEvents:{...l._snapshot._scheduledEvents}}),start:()=>{const d=l._snapshot._scheduledEvents;l._snapshot._scheduledEvents={};for(const m in d){const{source:E,target:w,event:b,delay:O,id:j}=d[m];h.schedule(E,w,b,O,j)}}};return l}function _s(e,t){const n=Lr(e),r=Lr(t);return typeof r=="string"?typeof n=="string"?r===n:!1:typeof n=="string"?n in r:Object.keys(n).every(s=>s in r?_s(n[s],r[s]):!1)}function Gn(e){if(bs(e))return e;let t=[],n="";for(let r=0;r<e.length;r++){switch(e.charCodeAt(r)){case 92:n+=e[r+1],r++;continue;case 46:t.push(n),n="";continue}n+=e[r]}return t.push(n),t}function Lr(e){if(vi(e))return e.value;if(typeof e!="string")return e;const t=Gn(e);return Bo(t)}function Bo(e){if(e.length===1)return e[0];const t={};let n=t;for(let r=0;r<e.length-1;r++)if(r===e.length-2)n[e[r]]=e[r+1];else{const s=n;n={},s[e[r]]=n}return t}function Br(e,t){const n={},r=Object.keys(e);for(let s=0;s<r.length;s++){const i=r[s];n[i]=t(e[i],i,e,s)}return n}function Es(e){return bs(e)?e:[e]}function $e(e){return e===void 0?[]:Es(e)}function Ln(e,t,n,r){return typeof e=="function"?e({context:t,event:n,self:r}):e}function bs(e){return Array.isArray(e)}function Wo(e){return e.type.startsWith("xstate.error.actor")}function it(e){return Es(e).map(t=>typeof t>"u"||typeof t=="string"?{target:t}:t)}function Ss(e){if(!(e===void 0||e===Io))return $e(e)}function Wr(e,t,n){var i,a,c;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(a=r?e.error:t)==null?void 0:a.bind(s),complete:(c=r?e.complete:n)==null?void 0:c.bind(s)}}function Vr(e,t){return`${t}.${e}`}function Xn(e,t){const n=t.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!n)return e.implementations.actors[t];const[,r,s]=n,a=e.getStateNodeById(s).config.invoke;return(Array.isArray(a)?a[r]:a).src}const Zn=1;let fe=function(e){return e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped",e}({});const Vo={clock:{setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)},logger:console.log.bind(console),devTools:!1};class zo{constructor(t,n){this.logic=t,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new Nr(this._process.bind(this)),this.observers=new Set,this.logger=void 0,this._processingStatus=fe.NotStarted,this._parent=void 0,this._syncSnapshot=void 0,this.ref=void 0,this._actorScope=void 0,this._systemId=void 0,this.sessionId=void 0,this.system=void 0,this._doneEvent=void 0,this.src=void 0,this._deferred=[];const r={...Vo,...n},{clock:s,logger:i,parent:a,syncSnapshot:c,id:h,systemId:l,inspect:d}=r;this.system=a?a.system:Lo(this,{clock:s}),d&&!a&&this.system.inspect(Wr(d)),this.sessionId=this.system._bookId(),this.id=h??this.sessionId,this.logger=i,this.clock=s,this._parent=a,this._syncSnapshot=c,this.options=r,this.src=r.src??t,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:m=>{this._deferred.push(m)},system:this.system,stopChild:m=>{if(m._parent!==this)throw new Error(`Cannot stop child actor ${m.id} of ${this.id} because it is not a child`);m._stop()}},this.send=this.send.bind(this),this.system._sendInspectionEvent({type:"@xstate.actor",actorRef:this}),l&&(this._systemId=l,this.system._set(l,this)),this._initState((n==null?void 0:n.snapshot)??(n==null?void 0:n.state)),l&&this._snapshot.status!=="active"&&this.system._unregister(this)}_initState(t){var n;try{this._snapshot=t?this.logic.restoreSnapshot?this.logic.restoreSnapshot(t,this._actorScope):t:this.logic.getInitialSnapshot(this._actorScope,(n=this.options)==null?void 0:n.input)}catch(r){this._snapshot={status:"error",output:void 0,error:r}}}update(t,n){var s,i;this._snapshot=t;let r;for(;r=this._deferred.shift();)try{r()}catch(a){this._deferred.length=0,this._snapshot={...t,status:"error",error:a}}switch(this._snapshot.status){case"active":for(const a of this.observers)try{(s=a.next)==null||s.call(a,t)}catch(c){Oe(c)}break;case"done":for(const a of this.observers)try{(i=a.next)==null||i.call(a,t)}catch(c){Oe(c)}this._stopProcedure(),this._complete(),this._doneEvent=Mo(this.id,this._snapshot.output),this._parent&&this.system._relay(this,this._parent,this._doneEvent);break;case"error":this._error(this._snapshot.error);break}this.system._sendInspectionEvent({type:"@xstate.snapshot",actorRef:this,event:n,snapshot:t})}subscribe(t,n,r){var i;const s=Wr(t,n,r);if(this._processingStatus!==fe.Stopped)this.observers.add(s);else switch(this._snapshot.status){case"done":try{(i=s.complete)==null||i.call(s)}catch(a){Oe(a)}break;case"error":{const a=this._snapshot.error;if(!s.error)Oe(a);else try{s.error(a)}catch(c){Oe(c)}break}}return{unsubscribe:()=>{this.observers.delete(s)}}}start(){if(this._processingStatus===fe.Running)return this;this._syncSnapshot&&this.subscribe({next:r=>{r.status==="active"&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:r})},error:()=>{}}),this.system._register(this.sessionId,this),this._systemId&&this.system._set(this._systemId,this),this._processingStatus=fe.Running;const t=gs(this.options.input);switch(this.system._sendInspectionEvent({type:"@xstate.event",sourceRef:this._parent,actorRef:this,event:t}),this._snapshot.status){case"done":return this.update(this._snapshot,t),this;case"error":return this._error(this._snapshot.error),this}if(this._parent||this.system.start(),this.logic.start)try{this.logic.start(this._snapshot,this._actorScope)}catch(r){return this._snapshot={...this._snapshot,status:"error",error:r},this._error(r),this}return this.update(this._snapshot,t),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(t){let n,r;try{n=this.logic.transition(this._snapshot,t,this._actorScope)}catch(s){r={err:s}}if(r){const{err:s}=r;this._snapshot={...this._snapshot,status:"error",error:s},this._error(s);return}this.update(n,t),t.type===Tt&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===fe.Stopped?this:(this.mailbox.clear(),this._processingStatus===fe.NotStarted?(this._processingStatus=fe.Stopped,this):(this.mailbox.enqueue({type:Tt}),this))}stop(){if(this._parent)throw new Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){var t;for(const n of this.observers)try{(t=n.complete)==null||t.call(n)}catch(r){Oe(r)}this.observers.clear()}_reportError(t){if(!this.observers.size){this._parent||Oe(t);return}let n=!1;for(const r of this.observers){const s=r.error;n||(n=!s);try{s==null||s(t)}catch(i){Oe(i)}}this.observers.clear(),n&&Oe(t)}_error(t){this._stopProcedure(),this._reportError(t),this._parent&&this.system._relay(this,this._parent,vs(this.id,t))}_stopProcedure(){return this._processingStatus!==fe.Running?this:(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new Nr(this._process.bind(this)),this._processingStatus=fe.Stopped,this.system._unregister(this),this)}_send(t){this._processingStatus!==fe.Stopped&&this.mailbox.enqueue(t)}send(t){this.system._relay(void 0,this,t)}attachDevTools(){const{devTools:t}=this.options;t&&(typeof t=="function"?t:Po)(this)}toJSON(){return{xstate$$type:Zn,id:this.id}}getPersistedSnapshot(t){return this.logic.getPersistedSnapshot(this._snapshot,t)}[No](){return this}getSnapshot(){return this._snapshot}}function ut(e,t){return new zo(e,t)}function Ho(e,t,n,r,{sendId:s}){const i=typeof s=="function"?s(n,r):s;return[t,i]}function qo(e,t){e.defer(()=>{e.system.scheduler.cancel(e.self,t)})}function Yo(e){function t(n,r){}return t.type="xstate.cancel",t.sendId=e,t.resolve=Ho,t.execute=qo,t}function Jo(e,t,n,r,{id:s,systemId:i,src:a,input:c,syncSnapshot:h}){const l=typeof a=="string"?Xn(t.machine,a):a,d=typeof s=="function"?s(n):s;let m;return l&&(m=ut(l,{id:d,src:a,parent:e.self,syncSnapshot:h,systemId:i,input:typeof c=="function"?c({context:t.context,event:n.event,self:e.self}):c})),[Xe(t,{children:{...t.children,[d]:m}}),{id:s,actorRef:m}]}function Ko(e,{id:t,actorRef:n}){n&&e.defer(()=>{n._processingStatus!==fe.Stopped&&n.start()})}function Go(...[e,{id:t,systemId:n,input:r,syncSnapshot:s=!1}={}]){function i(a,c){}return i.type="snapshot.spawnChild",i.id=t,i.systemId=n,i.src=e,i.input=r,i.syncSnapshot=s,i.resolve=Jo,i.execute=Ko,i}function Xo(e,t,n,r,{actorRef:s}){const i=typeof s=="function"?s(n,r):s,a=typeof i=="string"?t.children[i]:i;let c=t.children;return a&&(c={...c},delete c[a.id]),[Xe(t,{children:c}),a]}function Zo(e,t){if(t){if(e.system._unregister(t),t._processingStatus!==fe.Running){e.stopChild(t);return}e.defer(()=>{e.stopChild(t)})}}function ws(e){function t(n,r){}return t.type="xstate.stopChild",t.actorRef=e,t.resolve=Xo,t.execute=Zo,t}function Qn(e,t,n,r){const{machine:s}=r,i=typeof e=="function",a=i?e:s.implementations.guards[typeof e=="string"?e:e.type];if(!i&&!a)throw new Error(`Guard '${typeof e=="string"?e:e.type}' is not implemented.'.`);if(typeof a!="function")return Qn(a,t,n,r);const c={context:t,event:n},h=i||typeof e=="string"?void 0:"params"in e?typeof e.params=="function"?e.params({context:t,event:n}):e.params:void 0;return"check"in a?a.check(r,c,a):a(c,h)}const er=e=>e.type==="atomic"||e.type==="final";function ct(e){return Object.values(e.states).filter(t=>t.type!=="history")}function Ot(e,t){const n=[];if(t===e)return n;let r=e.parent;for(;r&&r!==t;)n.push(r),r=r.parent;return n}function Qt(e){const t=new Set(e),n=Rs(t);for(const r of t)if(r.type==="compound"&&(!n.get(r)||!n.get(r).length))zr(r).forEach(s=>t.add(s));else if(r.type==="parallel"){for(const s of ct(r))if(s.type!=="history"&&!t.has(s)){const i=zr(s);for(const a of i)t.add(a)}}for(const r of t){let s=r.parent;for(;s;)t.add(s),s=s.parent}return t}function Ts(e,t){const n=t.get(e);if(!n)return{};if(e.type==="compound"){const s=n[0];if(s){if(er(s))return s.key}else return{}}const r={};for(const s of n)r[s.key]=Ts(s,t);return r}function Rs(e){const t=new Map;for(const n of e)t.has(n)||t.set(n,[]),n.parent&&(t.has(n.parent)||t.set(n.parent,[]),t.get(n.parent).push(n));return t}function Os(e,t){const n=Qt(t);return Ts(e,Rs(n))}function tr(e,t){return t.type==="compound"?ct(t).some(n=>n.type==="final"&&e.has(n)):t.type==="parallel"?ct(t).every(n=>tr(e,n)):t.type==="final"}const rn=e=>e[0]===jo;function Qo(e,t){return e.transitions.get(t)||[...e.transitions.keys()].filter(r=>{if(r===Do)return!0;if(!r.endsWith(".*"))return!1;const s=r.split("."),i=t.split(".");for(let a=0;a<s.length;a++){const c=s[a],h=i[a];if(c==="*")return a===s.length-1;if(c!==h)return!1}return!0}).sort((r,s)=>s.length-r.length).flatMap(r=>e.transitions.get(r))}function ei(e){const t=e.config.after;if(!t)return[];const n=(s,i)=>{const a=Fo(s,e.id),c=a.type;return e.entry.push(Oi(a,{id:c,delay:s})),e.exit.push(Yo(c)),c};return Object.keys(t).flatMap((s,i)=>{const a=t[s],c=typeof a=="string"?{target:a}:a,h=Number.isNaN(+s)?s:+s,l=n(h);return $e(c).map(d=>({...d,event:l,delay:h}))}).map(s=>{const{delay:i}=s;return{...Ke(e,s.event,s),delay:i}})}function Ke(e,t,n){const r=Ss(n.target),s=n.reenter??!1,i=ri(e,r),a={...n,actions:$e(n.actions),guard:n.guard,target:i,source:e,reenter:s,eventType:t,toJSON:()=>({...a,source:`#${e.id}`,target:i?i.map(c=>`#${c.id}`):void 0})};return a}function ti(e){const t=new Map;if(e.config.on)for(const n of Object.keys(e.config.on)){if(n===ys)throw new Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');const r=e.config.on[n];t.set(n,it(r).map(s=>Ke(e,n,s)))}if(e.config.onDone){const n=`xstate.done.state.${e.id}`;t.set(n,it(e.config.onDone).map(r=>Ke(e,n,r)))}for(const n of e.invoke){if(n.onDone){const r=`xstate.done.actor.${n.id}`;t.set(r,it(n.onDone).map(s=>Ke(e,r,s)))}if(n.onError){const r=`xstate.error.actor.${n.id}`;t.set(r,it(n.onError).map(s=>Ke(e,r,s)))}if(n.onSnapshot){const r=`xstate.snapshot.${n.id}`;t.set(r,it(n.onSnapshot).map(s=>Ke(e,r,s)))}}for(const n of e.after){let r=t.get(n.eventType);r||(r=[],t.set(n.eventType,r)),r.push(n)}return t}function ni(e,t){const n=typeof t=="string"?e.states[t]:t?e.states[t.target]:void 0;if(!n&&t)throw new Error(`Initial state node "${t}" not found on parent state node #${e.id}`);const r={source:e,actions:!t||typeof t=="string"?[]:$e(t.actions),eventType:null,reenter:!1,target:n?[n]:[],toJSON:()=>({...r,source:`#${e.id}`,target:n?[`#${n.id}`]:[]})};return r}function ri(e,t){if(t!==void 0)return t.map(n=>{if(typeof n!="string")return n;if(rn(n))return e.machine.getStateNodeById(n);const r=n[0]===ps;if(r&&!e.parent)return en(e,n.slice(1));const s=r?e.key+n:n;if(e.parent)try{return en(e.parent,s)}catch(i){throw new Error(`Invalid transition definition for state node '${e.id}':
|
|
2
|
-
${i.message}`)}else throw new Error(`Invalid target: "${n}" is not a valid target from the root node. Did you mean ".${n}"?`)})}function Cs(e){const t=Ss(e.config.target);return t?{target:t.map(n=>typeof n=="string"?en(e.parent,n):n)}:e.parent.initial}function Ge(e){return e.type==="history"}function zr(e){const t=As(e);for(const n of t)for(const r of Ot(n,e))t.add(r);return t}function As(e){const t=new Set;function n(r){if(!t.has(r)){if(t.add(r),r.type==="compound")n(r.initial.target[0]);else if(r.type==="parallel")for(const s of ct(r))n(s)}}return n(e),t}function ft(e,t){if(rn(t))return e.machine.getStateNodeById(t);if(!e.states)throw new Error(`Unable to retrieve child state '${t}' from '${e.id}'; no child states exist.`);const n=e.states[t];if(!n)throw new Error(`Child state '${t}' does not exist on '${e.id}'`);return n}function en(e,t){if(typeof t=="string"&&rn(t))try{return e.machine.getStateNodeById(t)}catch{}const n=Gn(t).slice();let r=e;for(;n.length;){const s=n.shift();if(!s.length)break;r=ft(r,s)}return r}function tn(e,t){if(typeof t=="string")return[e,e.states[t]];const n=Object.keys(t),r=n.map(s=>ft(e,s)).filter(Boolean);return[e.machine.root,e].concat(r,n.reduce((s,i)=>{const a=ft(e,i);if(!a)return s;const c=tn(a,t[i]);return s.concat(c)},[]))}function si(e,t,n,r){const i=ft(e,t).next(n,r);return!i||!i.length?e.next(n,r):i}function oi(e,t,n,r){const s=Object.keys(t),i=ft(e,s[0]),a=nr(i,t[s[0]],n,r);return!a||!a.length?e.next(n,r):a}function ii(e,t,n,r){const s=[];for(const i of Object.keys(t)){const a=t[i];if(!a)continue;const c=ft(e,i),h=nr(c,a,n,r);h&&s.push(...h)}return s.length?s:e.next(n,r)}function nr(e,t,n,r){return typeof t=="string"?si(e,t,n,r):Object.keys(t).length===1?oi(e,t,n,r):ii(e,t,n,r)}function ai(e){return Object.keys(e.states).map(t=>e.states[t]).filter(t=>t.type==="history")}function Fe(e,t){let n=e;for(;n.parent&&n.parent!==t;)n=n.parent;return n.parent===t}function ui(e,t){const n=new Set(e),r=new Set(t);for(const s of n)if(r.has(s))return!0;for(const s of r)if(n.has(s))return!0;return!1}function ks(e,t,n){const r=new Set;for(const s of e){let i=!1;const a=new Set;for(const c of r)if(ui(Bn([s],t,n),Bn([c],t,n)))if(Fe(s.source,c.source))a.add(c);else{i=!0;break}if(!i){for(const c of a)r.delete(c);r.add(s)}}return Array.from(r)}function ci(e){const[t,...n]=e;for(const r of Ot(t,void 0))if(n.every(s=>Fe(s,r)))return r}function rr(e,t){if(!e.target)return[];const n=new Set;for(const r of e.target)if(Ge(r))if(t[r.id])for(const s of t[r.id])n.add(s);else for(const s of rr(Cs(r),t))n.add(s);else n.add(r);return[...n]}function xs(e,t){const n=rr(e,t);if(!n)return;if(!e.reenter&&n.every(s=>s===e.source||Fe(s,e.source)))return e.source;const r=ci(n.concat(e.source));if(r)return r;if(!e.reenter)return e.source.machine.root}function Bn(e,t,n){var s;const r=new Set;for(const i of e)if((s=i.target)!=null&&s.length){const a=xs(i,n);i.reenter&&i.source===a&&r.add(a);for(const c of t)Fe(c,a)&&r.add(c)}return[...r]}function fi(e,t){if(e.length!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Wn(e,t,n,r,s,i){if(!e.length)return t;const a=new Set(t._nodes);let c=t.historyValue;const h=ks(e,a,c);let l=t;s||([l,c]=pi(l,r,n,h,a,c,i)),l=lt(l,r,n,h.flatMap(m=>m.actions),i),l=di(l,r,n,h,a,i,c,s);const d=[...a];l.status==="done"&&(l=lt(l,r,n,d.sort((m,E)=>E.order-m.order).flatMap(m=>m.exit),i));try{return c===t.historyValue&&fi(t._nodes,a)?l:Xe(l,{_nodes:d,historyValue:c})}catch(m){throw m}}function li(e,t,n,r,s){if(!r.output)return;const i=Un(s.id,s.output&&s.parent?Ln(s.output,e.context,t,n.self):void 0);return Ln(r.output,e.context,i,n.self)}function di(e,t,n,r,s,i,a,c){let h=e;const l=new Set,d=new Set;hi(r,a,d,l),c&&d.add(e.machine.root);const m=new Set;for(const E of[...l].sort((w,b)=>w.order-b.order)){s.add(E);const w=[];w.push(...E.entry);for(const b of E.invoke)w.push(Go(b.src,{...b,syncSnapshot:!!b.onSnapshot}));if(d.has(E)){const b=E.initial.actions;w.push(...b)}if(h=lt(h,t,n,w,i,E.invoke.map(b=>b.id)),E.type==="final"){const b=E.parent;let O=(b==null?void 0:b.type)==="parallel"?b:b==null?void 0:b.parent,j=O||E;for((b==null?void 0:b.type)==="compound"&&i.push(Un(b.id,E.output?Ln(E.output,h.context,t,n.self):void 0));(O==null?void 0:O.type)==="parallel"&&!m.has(O)&&tr(s,O);)m.add(O),i.push(Un(O.id)),j=O,O=O.parent;if(O)continue;h=Xe(h,{status:"done",output:li(h,t,n,h.machine.root,j)})}}return h}function hi(e,t,n,r){for(const s of e){const i=xs(s,t);for(const c of s.target||[])!Ge(c)&&(s.source!==c||s.source!==i||s.reenter)&&(r.add(c),n.add(c)),at(c,t,n,r);const a=rr(s,t);for(const c of a){const h=Ot(c,i);(i==null?void 0:i.type)==="parallel"&&h.push(i),Ps(r,t,n,h,!s.source.parent&&s.reenter?void 0:i)}}}function at(e,t,n,r){var s;if(Ge(e))if(t[e.id]){const i=t[e.id];for(const a of i)r.add(a),at(a,t,n,r);for(const a of i)In(a,e.parent,r,t,n)}else{const i=Cs(e);for(const a of i.target)r.add(a),i===((s=e.parent)==null?void 0:s.initial)&&n.add(e.parent),at(a,t,n,r);for(const a of i.target)In(a,e.parent,r,t,n)}else if(e.type==="compound"){const[i]=e.initial.target;Ge(i)||(r.add(i),n.add(i)),at(i,t,n,r),In(i,e,r,t,n)}else if(e.type==="parallel")for(const i of ct(e).filter(a=>!Ge(a)))[...r].some(a=>Fe(a,i))||(Ge(i)||(r.add(i),n.add(i)),at(i,t,n,r))}function Ps(e,t,n,r,s){for(const i of r)if((!s||Fe(i,s))&&e.add(i),i.type==="parallel")for(const a of ct(i).filter(c=>!Ge(c)))[...e].some(c=>Fe(c,a))||(e.add(a),at(a,t,n,e))}function In(e,t,n,r,s){Ps(n,r,s,Ot(e,t))}function pi(e,t,n,r,s,i,a){let c=e;const h=Bn(r,s,i);h.sort((d,m)=>m.order-d.order);let l;for(const d of h)for(const m of ai(d)){let E;m.history==="deep"?E=w=>er(w)&&Fe(w,d):E=w=>w.parent===d,l??(l={...i}),l[m.id]=Array.from(s).filter(E)}for(const d of h)c=lt(c,t,n,[...d.exit,...d.invoke.map(m=>ws(m.id))],a),s.delete(d);return[c,l||i]}function Is(e,t,n,r,s,i){const{machine:a}=e;let c=e;for(const h of r){const l=typeof h=="function",d=l?h:a.implementations.actions[typeof h=="string"?h:h.type];if(!d)continue;const m={context:c.context,event:t,self:n.self,system:n.system},E=l||typeof h=="string"?void 0:"params"in h?typeof h.params=="function"?h.params({context:c.context,event:t}):h.params:void 0;if(!("resolve"in d)){n.self._processingStatus===fe.Running?d(m,E):n.defer(()=>{d(m,E)});continue}const w=d,[b,O,j]=w.resolve(n,c,m,E,d,s);c=b,"retryResolve"in w&&(i==null||i.push([w,O])),"execute"in w&&(n.self._processingStatus===fe.Running?w.execute(n,O):n.defer(w.execute.bind(null,n,O))),j&&(c=Is(c,t,n,j,s,i))}return c}function lt(e,t,n,r,s,i){const a=i?[]:void 0,c=Is(e,t,n,r,{internalQueue:s,deferredActorIds:i},a);return a==null||a.forEach(([h,l])=>{h.retryResolve(n,c,l)}),c}function jn(e,t,n,r=[]){let s=e;const i=[];if(t.type===Tt)return s=Xe(Hr(s,t,n),{status:"stopped"}),i.push(s),{snapshot:s,microstates:i};let a=t;if(a.type!==ms){const h=a,l=Wo(h),d=qr(h,s);if(l&&!d.length)return s=Xe(e,{status:"error",error:h.error}),i.push(s),{snapshot:s,microstates:i};s=Wn(d,e,n,a,!1,r),i.push(s)}let c=!0;for(;s.status==="active";){let h=c?yi(s,a):[];const l=h.length?s:void 0;if(!h.length){if(!r.length)break;a=r.shift(),h=qr(a,s)}s=Wn(h,s,n,a,!1,r),c=s!==l,i.push(s)}return s.status!=="active"&&Hr(s,a,n),{snapshot:s,microstates:i}}function Hr(e,t,n){return lt(e,t,n,Object.values(e.children).map(r=>ws(r)),[])}function qr(e,t){return t.machine.getTransitionData(t,e)}function yi(e,t){const n=new Set,r=e._nodes.filter(er);for(const s of r)e:for(const i of[s].concat(Ot(s,void 0)))if(i.always){for(const a of i.always)if(a.guard===void 0||Qn(a.guard,e.context,t,e)){n.add(a);break e}}return ks(Array.from(n),new Set(e._nodes),e.historyValue)}function mi(e,t){const n=Qt(tn(e,t));return Os(e,[...n])}function vi(e){return!!e&&typeof e=="object"&&"machine"in e&&"value"in e}const gi=function(t){return _s(t,this.value)},_i=function(t){return this.tags.has(t)},Ei=function(t){const n=this.machine.getTransitionData(this,t);return!!(n!=null&&n.length)&&n.some(r=>r.target!==void 0||r.actions.length)},bi=function(){const{_nodes:t,tags:n,machine:r,getMeta:s,toJSON:i,can:a,hasTag:c,matches:h,...l}=this;return{...l,tags:Array.from(n)}},Si=function(){return this._nodes.reduce((t,n)=>(n.meta!==void 0&&(t[n.id]=n.meta),t),{})};function Jt(e,t){return{status:e.status,output:e.output,error:e.error,machine:t,context:e.context,_nodes:e._nodes,value:Os(t.root,e._nodes),tags:new Set(e._nodes.flatMap(n=>n.tags)),children:e.children,historyValue:e.historyValue||{},matches:gi,hasTag:_i,can:Ei,getMeta:Si,toJSON:bi}}function Xe(e,t={}){return Jt({...e,...t},e.machine)}function wi(e,t){const{_nodes:n,tags:r,machine:s,children:i,context:a,can:c,hasTag:h,matches:l,getMeta:d,toJSON:m,...E}=e,w={};for(const O in i){const j=i[O];w[O]={snapshot:j.getPersistedSnapshot(t),src:j.src,systemId:j._systemId,syncSnapshot:j._syncSnapshot}}return{...E,context:js(a),children:w}}function js(e){let t;for(const n in e){const r=e[n];if(r&&typeof r=="object")if("sessionId"in r&&"send"in r&&"ref"in r)t??(t=Array.isArray(e)?e.slice():{...e}),t[n]={xstate$$type:Zn,id:r.id};else{const s=js(r);s!==r&&(t??(t=Array.isArray(e)?e.slice():{...e}),t[n]=s)}}return t??e}function Ti(e,t,n,r,{event:s,id:i,delay:a},{internalQueue:c}){const h=t.machine.implementations.delays;if(typeof s=="string")throw new Error(`Only event objects may be used with raise; use raise({ type: "${s}" }) instead`);const l=typeof s=="function"?s(n,r):s;let d;if(typeof a=="string"){const m=h&&h[a];d=typeof m=="function"?m(n,r):m}else d=typeof a=="function"?a(n,r):a;return typeof d!="number"&&c.push(l),[t,{event:l,id:i,delay:d}]}function Ri(e,t){const{event:n,delay:r,id:s}=t;if(typeof r=="number"){e.defer(()=>{const i=e.self;e.system.scheduler.schedule(i,i,n,r,s)});return}}function Oi(e,t){function n(r,s){}return n.type="xstate.raise",n.event=e,n.id=t==null?void 0:t.id,n.delay=t==null?void 0:t.delay,n.resolve=Ti,n.execute=Ri,n}const Yr=new WeakMap;function Ci(e){return{config:e,start:(n,r)=>{const{self:s,system:i}=r,a={receivers:void 0,dispose:void 0};Yr.set(s,a),a.dispose=e({input:n.input,system:i,self:s,sendBack:c=>{s.getSnapshot().status!=="stopped"&&s._parent&&i._relay(s,s._parent,c)},receive:c=>{a.receivers??(a.receivers=new Set),a.receivers.add(c)}})},transition:(n,r,s)=>{var a,c;const i=Yr.get(s.self);return r.type===Tt?(n={...n,status:"stopped",error:void 0},(a=i.dispose)==null||a.call(i),n):((c=i.receivers)==null||c.forEach(h=>h(r)),n)},getInitialSnapshot:(n,r)=>({status:"active",output:void 0,error:void 0,input:r}),getPersistedSnapshot:n=>n,restoreSnapshot:n=>n}}const Jr="xstate.promise.resolve",Kr="xstate.promise.reject";function Dn(e){return{config:e,transition:(n,r)=>{if(n.status!=="active")return n;switch(r.type){case Jr:{const s=r.data;return{...n,status:"done",output:s,input:void 0}}case Kr:return{...n,status:"error",error:r.data,input:void 0};case Tt:return{...n,status:"stopped",input:void 0};default:return n}},start:(n,{self:r,system:s})=>{if(n.status!=="active")return;Promise.resolve(e({input:n.input,system:s,self:r})).then(a=>{r.getSnapshot().status==="active"&&s._relay(r,r,{type:Jr,data:a})},a=>{r.getSnapshot().status==="active"&&s._relay(r,r,{type:Kr,data:a})})},getInitialSnapshot:(n,r)=>({status:"active",output:void 0,error:void 0,input:r}),getPersistedSnapshot:n=>n,restoreSnapshot:n=>n}}function Ai(e,{machine:t,context:n},r,s){const i=(a,c={})=>{const{systemId:h,input:l}=c;if(typeof a=="string"){const d=Xn(t,a);if(!d)throw new Error(`Actor logic '${a}' not implemented in machine '${t.id}'`);const m=ut(d,{id:c.id,parent:e.self,syncSnapshot:c.syncSnapshot,input:typeof l=="function"?l({context:n,event:r,self:e.self}):l,src:a,systemId:h});return s[m.id]=m,m}else return ut(a,{id:c.id,parent:e.self,syncSnapshot:c.syncSnapshot,input:c.input,src:a,systemId:h})};return(a,c)=>{const h=i(a,c);return s[h.id]=h,e.defer(()=>{h._processingStatus!==fe.Stopped&&h.start()}),h}}function ki(e,t,n,r,{assignment:s}){if(!t.context)throw new Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");const i={},a={context:t.context,event:n.event,spawn:Ai(e,t,n.event,i),self:e.self,system:e.system};let c={};if(typeof s=="function")c=s(a,r);else for(const l of Object.keys(s)){const d=s[l];c[l]=typeof d=="function"?d(a,r):d}const h=Object.assign({},t.context,c);return[Xe(t,{context:h,children:Object.keys(i).length?{...t.children,...i}:t.children})]}function ge(e){function t(n,r){}return t.type="xstate.assign",t.assignment=e,t.resolve=ki,t}let Gr=function(e){return e.Parent="#_parent",e.Internal="#_internal",e}({});function xi(e,t,n,r,{to:s,event:i,id:a,delay:c},h){var b;const l=t.machine.implementations.delays;if(typeof i=="string")throw new Error(`Only event objects may be used with sendTo; use sendTo({ type: "${i}" }) instead`);const d=typeof i=="function"?i(n,r):i;let m;if(typeof c=="string"){const O=l&&l[c];m=typeof O=="function"?O(n,r):O}else m=typeof c=="function"?c(n,r):c;const E=typeof s=="function"?s(n,r):s;let w;if(typeof E=="string"){if(E===Gr.Parent?w=e.self._parent:E===Gr.Internal?w=e.self:E.startsWith("#_")?w=t.children[E.slice(2)]:w=(b=h.deferredActorIds)!=null&&b.includes(E)?E:t.children[E],!w)throw new Error(`Unable to send event to actor '${E}' from machine '${t.machine.id}'.`)}else w=E||e.self;return[t,{to:w,event:d,id:a,delay:m}]}function Pi(e,t,n){typeof n.to=="string"&&(n.to=t.children[n.to])}function Ii(e,t){e.defer(()=>{const{to:n,event:r,delay:s,id:i}=t;if(typeof s=="number"){e.system.scheduler.schedule(e.self,n,r,s,i);return}e.system._relay(e.self,n,r.type===$o?vs(e.self.id,r.data):r)})}function Xr(e,t,n){function r(s,i){}return r.type="xsnapshot.sendTo",r.to=e,r.event=t,r.id=n==null?void 0:n.id,r.delay=n==null?void 0:n.delay,r.resolve=xi,r.retryResolve=Pi,r.execute=Ii,r}const Zr=new WeakMap;function ot(e,t,n){let r=Zr.get(e);return r?t in r||(r[t]=n()):(r={[t]:n()},Zr.set(e,r)),r[t]}const ji={},_t=e=>typeof e=="string"?{type:e}:typeof e=="function"?"resolve"in e?{type:e.type}:{type:e.name}:e;class sr{constructor(t,n){if(this.config=t,this.key=void 0,this.id=void 0,this.type=void 0,this.path=void 0,this.states=void 0,this.history=void 0,this.entry=void 0,this.exit=void 0,this.parent=void 0,this.machine=void 0,this.meta=void 0,this.output=void 0,this.order=-1,this.description=void 0,this.tags=[],this.transitions=void 0,this.always=void 0,this.parent=n._parent,this.key=n._key,this.machine=n._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join(ps),this.type=this.config.type||(this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.description=this.config.description,this.order=this.machine.idMap.size,this.machine.idMap.set(this.id,this),this.states=this.config.states?Br(this.config.states,(r,s)=>new sr(r,{_parent:this,_key:s,_machine:this.machine})):ji,this.type==="compound"&&!this.config.initial)throw new Error(`No initial state specified for compound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=this.config.history===!0?"shallow":this.config.history||!1,this.entry=$e(this.config.entry).slice(),this.exit=$e(this.config.exit).slice(),this.meta=this.config.meta,this.output=this.type==="final"||!this.parent?this.config.output:void 0,this.tags=$e(t.tags).slice()}_initialize(){this.transitions=ti(this),this.config.always&&(this.always=it(this.config.always).map(t=>Ke(this,ys,t))),Object.keys(this.states).forEach(t=>{this.states[t]._initialize()})}get definition(){return{id:this.id,key:this.key,version:this.machine.version,type:this.type,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(_t),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(t=>`#${t.id}`),source:`#${this.id}`,actions:this.initial.actions.map(_t),eventType:null})}:void 0,history:this.history,states:Br(this.states,t=>t.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(t=>({...t,actions:t.actions.map(_t)})),entry:this.entry.map(_t),exit:this.exit.map(_t),meta:this.meta,order:this.order||-1,output:this.output,invoke:this.invoke,description:this.description,tags:this.tags}}toJSON(){return this.definition}get invoke(){return ot(this,"invoke",()=>$e(this.config.invoke).map((t,n)=>{const{src:r,systemId:s}=t,i=t.id??Vr(this.id,n),a=typeof r=="string"?r:`xstate.invoke.${Vr(this.id,n)}`;return{...t,src:a,id:i,systemId:s,toJSON(){const{onDone:c,onError:h,...l}=t;return{...l,type:"xstate.invoke",src:a,id:i}}}}))}get on(){return ot(this,"on",()=>[...this.transitions].flatMap(([n,r])=>r.map(s=>[n,s])).reduce((n,[r,s])=>(n[r]=n[r]||[],n[r].push(s),n),{}))}get after(){return ot(this,"delayedTransitions",()=>ei(this))}get initial(){return ot(this,"initial",()=>ni(this,this.config.initial))}next(t,n){const r=n.type,s=[];let i;const a=ot(this,`candidates-${r}`,()=>Qo(this,r));for(const c of a){const{guard:h}=c,l=t.context;let d=!1;try{d=!h||Qn(h,l,n,t)}catch(m){const E=typeof h=="string"?h:typeof h=="object"?h.type:void 0;throw new Error(`Unable to evaluate guard ${E?`'${E}' `:""}in transition for event '${r}' in state node '${this.id}':
|
|
3
|
-
${m.message}`)}if(d){s.push(...c.actions),i=c;break}}return i?[i]:void 0}get events(){return ot(this,"events",()=>{const{states:t}=this,n=new Set(this.ownEvents);if(t)for(const r of Object.keys(t)){const s=t[r];if(s.states)for(const i of s.events)n.add(`${i}`)}return Array.from(n)})}get ownEvents(){const t=new Set([...this.transitions.keys()].filter(n=>this.transitions.get(n).some(r=>!(!r.target&&!r.actions.length&&!r.reenter))));return Array.from(t)}}const Di="#";class or{constructor(t,n){this.config=t,this.version=void 0,this.implementations=void 0,this.__xstatenode=!0,this.idMap=new Map,this.root=void 0,this.id=void 0,this.states=void 0,this.events=void 0,this.__TResolvedTypesMeta=void 0,this.id=t.id||"(machine)",this.implementations={actors:(n==null?void 0:n.actors)??{},actions:(n==null?void 0:n.actions)??{},delays:(n==null?void 0:n.delays)??{},guards:(n==null?void 0:n.guards)??{}},this.version=this.config.version,this.transition=this.transition.bind(this),this.getInitialSnapshot=this.getInitialSnapshot.bind(this),this.getPersistedSnapshot=this.getPersistedSnapshot.bind(this),this.restoreSnapshot=this.restoreSnapshot.bind(this),this.start=this.start.bind(this),this.root=new sr(t,{_key:this.id,_machine:this}),this.root._initialize(),this.states=this.root.states,this.events=this.root.events}provide(t){const{actions:n,guards:r,actors:s,delays:i}=this.implementations;return new or(this.config,{actions:{...n,...t.actions},guards:{...r,...t.guards},actors:{...s,...t.actors},delays:{...i,...t.delays}})}resolveState(t){const n=mi(this.root,t.value),r=Qt(tn(this.root,n));return Jt({_nodes:[...r],context:t.context||{},children:{},status:tr(r,this.root)?"done":t.status||"active",output:t.output,error:t.error,historyValue:t.historyValue},this)}transition(t,n,r){return jn(t,n,r).snapshot}microstep(t,n,r){return jn(t,n,r).microstates}getTransitionData(t,n){return nr(this.root,t.value,t,n)||[]}getPreInitialState(t,n,r){const{context:s}=this.config,i=Jt({context:typeof s!="function"&&s?s:{},_nodes:[this.root],children:{},status:"active"},this);return typeof s=="function"?lt(i,n,t,[ge(({spawn:c,event:h,self:l})=>s({spawn:c,input:h.input,self:l}))],r):i}getInitialSnapshot(t,n){const r=gs(n),s=[],i=this.getPreInitialState(t,r,s),a=Wn([{target:[...As(this.root)],source:this.root,reenter:!0,actions:[],eventType:null,toJSON:null}],i,t,r,!0,s),{snapshot:c}=jn(a,r,t,s);return c}start(t){Object.values(t.children).forEach(n=>{n.getSnapshot().status==="active"&&n.start()})}getStateNodeById(t){const n=Gn(t),r=n.slice(1),s=rn(n[0])?n[0].slice(Di.length):n[0],i=this.idMap.get(s);if(!i)throw new Error(`Child state node '#${s}' does not exist on machine '${this.id}'`);return en(i,r)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(t,n){return wi(t,n)}restoreSnapshot(t,n){const r={},s=t.children;Object.keys(s).forEach(h=>{const l=s[h],d=l.snapshot,m=l.src,E=typeof m=="string"?Xn(this,m):m;if(!E)return;const w=ut(E,{id:h,parent:n.self,syncSnapshot:l.syncSnapshot,snapshot:d,src:m,systemId:l.systemId});r[h]=w});const i=Jt({...t,children:r,_nodes:Array.from(Qt(tn(this.root,t.value)))},this);let a=new Set;function c(h,l){if(!a.has(h)){a.add(h);for(let d in h){const m=h[d];if(m&&typeof m=="object"){if("xstate$$type"in m&&m.xstate$$type===Zn){h[d]=l[m.id];continue}c(m,l)}}}}return c(i.context,r),i}}function $i(e,t){return new or(e,t)}function ir({actors:e,actions:t,guards:n,delays:r}){return{createMachine:s=>$i(s,{actors:e,actions:t,guards:n,delays:r})}}function Ds(e,t){return function(){return e.apply(t,arguments)}}const{toString:Fi}=Object.prototype,{getPrototypeOf:ar}=Object,sn=(e=>t=>{const n=Fi.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),we=e=>(e=e.toLowerCase(),t=>sn(t)===e),on=e=>t=>typeof t===e,{isArray:ht}=Array,Rt=on("undefined");function Mi(e){return e!==null&&!Rt(e)&&e.constructor!==null&&!Rt(e.constructor)&&ye(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $s=we("ArrayBuffer");function Ni(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&$s(e.buffer),t}const Ui=on("string"),ye=on("function"),Fs=on("number"),an=e=>e!==null&&typeof e=="object",Li=e=>e===!0||e===!1,Kt=e=>{if(sn(e)!=="object")return!1;const t=ar(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Bi=we("Date"),Wi=we("File"),Vi=we("Blob"),zi=we("FileList"),Hi=e=>an(e)&&ye(e.pipe),qi=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ye(e.append)&&((t=sn(e))==="formdata"||t==="object"&&ye(e.toString)&&e.toString()==="[object FormData]"))},Yi=we("URLSearchParams"),Ji=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ct(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),ht(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let c;for(r=0;r<a;r++)c=i[r],t.call(null,e[c],c,e)}}function Ms(e,t){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 Ns=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Us=e=>!Rt(e)&&e!==Ns;function Vn(){const{caseless:e}=Us(this)&&this||{},t={},n=(r,s)=>{const i=e&&Ms(t,s)||s;Kt(t[i])&&Kt(r)?t[i]=Vn(t[i],r):Kt(r)?t[i]=Vn({},r):ht(r)?t[i]=r.slice():t[i]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&Ct(arguments[r],n);return t}const Ki=(e,t,n,{allOwnKeys:r}={})=>(Ct(t,(s,i)=>{n&&ye(s)?e[i]=Ds(s,n):e[i]=s},{allOwnKeys:r}),e),Gi=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Xi=(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)},Zi=(e,t,n,r)=>{let s,i,a;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)a=s[i],(!r||r(a,e,t))&&!c[a]&&(t[a]=e[a],c[a]=!0);e=n!==!1&&ar(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Qi=(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},ea=e=>{if(!e)return null;if(ht(e))return e;let t=e.length;if(!Fs(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},ta=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ar(Uint8Array)),na=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},ra=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},sa=we("HTMLFormElement"),oa=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Qr=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),ia=we("RegExp"),Ls=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Ct(n,(s,i)=>{let a;(a=t(s,i,e))!==!1&&(r[i]=a||s)}),Object.defineProperties(e,r)},aa=e=>{Ls(e,(t,n)=>{if(ye(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(ye(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+"'")})}})},ua=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return ht(e)?r(e):r(String(e).split(t)),n},ca=()=>{},fa=(e,t)=>(e=+e,Number.isFinite(e)?e:t),$n="abcdefghijklmnopqrstuvwxyz",es="0123456789",Bs={DIGIT:es,ALPHA:$n,ALPHA_DIGIT:$n+$n.toUpperCase()+es},la=(e=16,t=Bs.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function da(e){return!!(e&&ye(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const ha=e=>{const t=new Array(10),n=(r,s)=>{if(an(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const i=ht(r)?[]:{};return Ct(r,(a,c)=>{const h=n(a,s+1);!Rt(h)&&(i[c]=h)}),t[s]=void 0,i}}return r};return n(e,0)},pa=we("AsyncFunction"),ya=e=>e&&(an(e)||ye(e))&&ye(e.then)&&ye(e.catch),g={isArray:ht,isArrayBuffer:$s,isBuffer:Mi,isFormData:qi,isArrayBufferView:Ni,isString:Ui,isNumber:Fs,isBoolean:Li,isObject:an,isPlainObject:Kt,isUndefined:Rt,isDate:Bi,isFile:Wi,isBlob:Vi,isRegExp:ia,isFunction:ye,isStream:Hi,isURLSearchParams:Yi,isTypedArray:ta,isFileList:zi,forEach:Ct,merge:Vn,extend:Ki,trim:Ji,stripBOM:Gi,inherits:Xi,toFlatObject:Zi,kindOf:sn,kindOfTest:we,endsWith:Qi,toArray:ea,forEachEntry:na,matchAll:ra,isHTMLForm:sa,hasOwnProperty:Qr,hasOwnProp:Qr,reduceDescriptors:Ls,freezeMethods:aa,toObjectSet:ua,toCamelCase:oa,noop:ca,toFiniteNumber:fa,findKey:Ms,global:Ns,isContextDefined:Us,ALPHABET:Bs,generateString:la,isSpecCompliantForm:da,toJSONObject:ha,isAsyncFn:pa,isThenable:ya};function L(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)}g.inherits(L,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:g.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Ws=L.prototype,Vs={};["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=>{Vs[e]={value:e}});Object.defineProperties(L,Vs);Object.defineProperty(Ws,"isAxiosError",{value:!0});L.from=(e,t,n,r,s,i)=>{const a=Object.create(Ws);return g.toFlatObject(e,a,function(h){return h!==Error.prototype},c=>c!=="isAxiosError"),L.call(a,e.message,t,n,r,s),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};const ma=null;function zn(e){return g.isPlainObject(e)||g.isArray(e)}function zs(e){return g.endsWith(e,"[]")?e.slice(0,-2):e}function ts(e,t,n){return e?e.concat(t).map(function(s,i){return s=zs(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function va(e){return g.isArray(e)&&!e.some(zn)}const ga=g.toFlatObject(g,{},null,function(t){return/^is[A-Z]/.test(t)});function un(e,t,n){if(!g.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=g.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(O,j){return!g.isUndefined(j[O])});const r=n.metaTokens,s=n.visitor||d,i=n.dots,a=n.indexes,h=(n.Blob||typeof Blob<"u"&&Blob)&&g.isSpecCompliantForm(t);if(!g.isFunction(s))throw new TypeError("visitor must be a function");function l(b){if(b===null)return"";if(g.isDate(b))return b.toISOString();if(!h&&g.isBlob(b))throw new L("Blob is not supported. Use a Buffer instead.");return g.isArrayBuffer(b)||g.isTypedArray(b)?h&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function d(b,O,j){let J=b;if(b&&!j&&typeof b=="object"){if(g.endsWith(O,"{}"))O=r?O:O.slice(0,-2),b=JSON.stringify(b);else if(g.isArray(b)&&va(b)||(g.isFileList(b)||g.endsWith(O,"[]"))&&(J=g.toArray(b)))return O=zs(O),J.forEach(function(he,pe){!(g.isUndefined(he)||he===null)&&t.append(a===!0?ts([O],pe,i):a===null?O:O+"[]",l(he))}),!1}return zn(b)?!0:(t.append(ts(j,O,i),l(b)),!1)}const m=[],E=Object.assign(ga,{defaultVisitor:d,convertValue:l,isVisitable:zn});function w(b,O){if(!g.isUndefined(b)){if(m.indexOf(b)!==-1)throw Error("Circular reference detected in "+O.join("."));m.push(b),g.forEach(b,function(J,W){(!(g.isUndefined(J)||J===null)&&s.call(t,J,g.isString(W)?W.trim():W,O,E))===!0&&w(J,O?O.concat(W):[W])}),m.pop()}}if(!g.isObject(e))throw new TypeError("data must be an object");return w(e),t}function ns(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function ur(e,t){this._pairs=[],e&&un(e,this,t)}const Hs=ur.prototype;Hs.append=function(t,n){this._pairs.push([t,n])};Hs.toString=function(t){const n=t?function(r){return t.call(this,r,ns)}:ns;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function _a(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function qs(e,t,n){if(!t)return e;const r=n&&n.encode||_a,s=n&&n.serialize;let i;if(s?i=s(t,n):i=g.isURLSearchParams(t)?t.toString():new ur(t,n).toString(r),i){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ea{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){g.forEach(this.handlers,function(r){r!==null&&t(r)})}}const rs=Ea,Ys={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ba=typeof URLSearchParams<"u"?URLSearchParams:ur,Sa=typeof FormData<"u"?FormData:null,wa=typeof Blob<"u"?Blob:null,Ta=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Ra=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),_e={isBrowser:!0,classes:{URLSearchParams:ba,FormData:Sa,Blob:wa},isStandardBrowserEnv:Ta,isStandardBrowserWebWorkerEnv:Ra,protocols:["http","https","file","blob","url","data"]};function Oa(e,t){return un(e,new _e.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,i){return _e.isNode&&g.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function Ca(e){return g.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Aa(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 Js(e){function t(n,r,s,i){let a=n[i++];const c=Number.isFinite(+a),h=i>=n.length;return a=!a&&g.isArray(s)?s.length:a,h?(g.hasOwnProp(s,a)?s[a]=[s[a],r]:s[a]=r,!c):((!s[a]||!g.isObject(s[a]))&&(s[a]=[]),t(n,r,s[a],i)&&g.isArray(s[a])&&(s[a]=Aa(s[a])),!c)}if(g.isFormData(e)&&g.isFunction(e.entries)){const n={};return g.forEachEntry(e,(r,s)=>{t(Ca(r),s,n,0)}),n}return null}function ka(e,t,n){if(g.isString(e))try{return(t||JSON.parse)(e),g.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const cr={transitional:Ys,adapter:_e.isNode?"http":"xhr",transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=g.isObject(t);if(i&&g.isHTMLForm(t)&&(t=new FormData(t)),g.isFormData(t))return s&&s?JSON.stringify(Js(t)):t;if(g.isArrayBuffer(t)||g.isBuffer(t)||g.isStream(t)||g.isFile(t)||g.isBlob(t))return t;if(g.isArrayBufferView(t))return t.buffer;if(g.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 Oa(t,this.formSerializer).toString();if((c=g.isFileList(t))||r.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return un(c?{"files[]":t}:t,h&&new h,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),ka(t)):t}],transformResponse:[function(t){const n=this.transitional||cr.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(t&&g.isString(t)&&(r&&!this.responseType||s)){const a=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(a)throw c.name==="SyntaxError"?L.from(c,L.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:_e.classes.FormData,Blob:_e.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};g.forEach(["delete","get","head","post","put","patch"],e=>{cr.headers[e]={}});const fr=cr,xa=g.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"]),Pa=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
4
|
-
`).forEach(function(a){s=a.indexOf(":"),n=a.substring(0,s).trim().toLowerCase(),r=a.substring(s+1).trim(),!(!n||t[n]&&xa[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},ss=Symbol("internals");function Et(e){return e&&String(e).trim().toLowerCase()}function Gt(e){return e===!1||e==null?e:g.isArray(e)?e.map(Gt):String(e)}function Ia(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 ja=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function
|
|
5
|
-
`)}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[ss]=this[ss]={accessors:{}}).accessors,s=this.prototype;function i(a){const c=Et(a);r[c]||($a(s,a),r[c]=!0)}return g.isArray(t)?t.forEach(i):i(t),this}}cn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);g.reduceDescriptors(cn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});g.freezeMethods(cn);const Ce=cn;function Mn(e,t){const n=this||fr,r=t||n,s=Ce.from(r.headers);let i=r.data;return g.forEach(e,function(c){i=c.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function Ks(e){return!!(e&&e.__CANCEL__)}function At(e,t,n){L.call(this,e??"canceled",L.ERR_CANCELED,t,n),this.name="CanceledError"}g.inherits(At,L,{__CANCEL__:!0});function Fa(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new L("Request failed with status code "+n.status,[L.ERR_BAD_REQUEST,L.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const Ma=_e.isStandardBrowserEnv?function(){return{write:function(n,r,s,i,a,c){const h=[];h.push(n+"="+encodeURIComponent(r)),g.isNumber(s)&&h.push("expires="+new Date(s).toGMTString()),g.isString(i)&&h.push("path="+i),g.isString(a)&&h.push("domain="+a),c===!0&&h.push("secure"),document.cookie=h.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Na(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ua(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function Gs(e,t){return e&&!Na(t)?Ua(e,t):t}const La=_e.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(i){let a=i;return t&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(a){const c=g.isString(a)?s(a):a;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}();function Ba(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Wa(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,a;return t=t!==void 0?t:1e3,function(h){const l=Date.now(),d=r[i];a||(a=l),n[s]=h,r[s]=l;let m=i,E=0;for(;m!==s;)E+=n[m++],m=m%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),l-a<t)return;const w=d&&l-d;return w?Math.round(E*1e3/w):void 0}}function os(e,t){let n=0;const r=Wa(50,250);return s=>{const i=s.loaded,a=s.lengthComputable?s.total:void 0,c=i-n,h=r(c),l=i<=a;n=i;const d={loaded:i,total:a,progress:a?i/a:void 0,bytes:c,rate:h||void 0,estimated:h&&a&&l?(a-i)/h:void 0,event:s};d[t?"download":"upload"]=!0,e(d)}}const Va=typeof XMLHttpRequest<"u",za=Va&&function(e){return new Promise(function(n,r){let s=e.data;const i=Ce.from(e.headers).normalize(),a=e.responseType;let c;function h(){e.cancelToken&&e.cancelToken.unsubscribe(c),e.signal&&e.signal.removeEventListener("abort",c)}g.isFormData(s)&&(_e.isStandardBrowserEnv||_e.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let l=new XMLHttpRequest;if(e.auth){const w=e.auth.username||"",b=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(w+":"+b))}const d=Gs(e.baseURL,e.url);l.open(e.method.toUpperCase(),qs(d,e.params,e.paramsSerializer),!0),l.timeout=e.timeout;function m(){if(!l)return;const w=Ce.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),O={data:!a||a==="text"||a==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:w,config:e,request:l};Fa(function(J){n(J),h()},function(J){r(J),h()},O),l=null}if("onloadend"in l?l.onloadend=m:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(m)},l.onabort=function(){l&&(r(new L("Request aborted",L.ECONNABORTED,e,l)),l=null)},l.onerror=function(){r(new L("Network Error",L.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let b=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const O=e.transitional||Ys;e.timeoutErrorMessage&&(b=e.timeoutErrorMessage),r(new L(b,O.clarifyTimeoutError?L.ETIMEDOUT:L.ECONNABORTED,e,l)),l=null},_e.isStandardBrowserEnv){const w=(e.withCredentials||La(d))&&e.xsrfCookieName&&Ma.read(e.xsrfCookieName);w&&i.set(e.xsrfHeaderName,w)}s===void 0&&i.setContentType(null),"setRequestHeader"in l&&g.forEach(i.toJSON(),function(b,O){l.setRequestHeader(O,b)}),g.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),a&&a!=="json"&&(l.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&l.addEventListener("progress",os(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",os(e.onUploadProgress)),(e.cancelToken||e.signal)&&(c=w=>{l&&(r(!w||w.type?new At(null,e,l):w),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(c),e.signal&&(e.signal.aborted?c():e.signal.addEventListener("abort",c)));const E=Ba(d);if(E&&_e.protocols.indexOf(E)===-1){r(new L("Unsupported protocol "+E+":",L.ERR_BAD_REQUEST,e));return}l.send(s||null)})},Xt={http:ma,xhr:za};g.forEach(Xt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Xs={getAdapter:e=>{e=g.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let s=0;s<t&&(n=e[s],!(r=g.isString(n)?Xt[n.toLowerCase()]:n));s++);if(!r)throw r===!1?new L(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(g.hasOwnProp(Xt,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`);if(!g.isFunction(r))throw new TypeError("adapter is not a function");return r},adapters:Xt};function Nn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new At(null,e)}function is(e){return Nn(e),e.headers=Ce.from(e.headers),e.data=Mn.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Xs.getAdapter(e.adapter||fr.adapter)(e).then(function(r){return Nn(e),r.data=Mn.call(e,e.transformResponse,r),r.headers=Ce.from(r.headers),r},function(r){return Ks(r)||(Nn(e),r&&r.response&&(r.response.data=Mn.call(e,e.transformResponse,r.response),r.response.headers=Ce.from(r.response.headers))),Promise.reject(r)})}const as=e=>e instanceof Ce?e.toJSON():e;function dt(e,t){t=t||{};const n={};function r(l,d,m){return g.isPlainObject(l)&&g.isPlainObject(d)?g.merge.call({caseless:m},l,d):g.isPlainObject(d)?g.merge({},d):g.isArray(d)?d.slice():d}function s(l,d,m){if(g.isUndefined(d)){if(!g.isUndefined(l))return r(void 0,l,m)}else return r(l,d,m)}function i(l,d){if(!g.isUndefined(d))return r(void 0,d)}function a(l,d){if(g.isUndefined(d)){if(!g.isUndefined(l))return r(void 0,l)}else return r(void 0,d)}function c(l,d,m){if(m in t)return r(l,d);if(m in e)return r(void 0,l)}const h={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(l,d)=>s(as(l),as(d),!0)};return g.forEach(Object.keys(Object.assign({},e,t)),function(d){const m=h[d]||s,E=m(e[d],t[d],d);g.isUndefined(E)&&m!==c||(n[d]=E)}),n}const Zs="1.5.0",lr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{lr[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const us={};lr.transitional=function(t,n,r){function s(i,a){return"[Axios v"+Zs+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,c)=>{if(t===!1)throw new L(s(a," has been removed"+(n?" in "+n:"")),L.ERR_DEPRECATED);return n&&!us[a]&&(us[a]=!0,console.warn(s(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,a,c):!0}};function Ha(e,t,n){if(typeof e!="object")throw new L("options must be an object",L.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],a=t[i];if(a){const c=e[i],h=c===void 0||a(c,i,e);if(h!==!0)throw new L("option "+i+" must be "+h,L.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new L("Unknown option "+i,L.ERR_BAD_OPTION)}}const Hn={assertOptions:Ha,validators:lr},De=Hn.validators;class nn{constructor(t){this.defaults=t,this.interceptors={request:new rs,response:new rs}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=dt(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&Hn.assertOptions(r,{silentJSONParsing:De.transitional(De.boolean),forcedJSONParsing:De.transitional(De.boolean),clarifyTimeoutError:De.transitional(De.boolean)},!1),s!=null&&(g.isFunction(s)?n.paramsSerializer={serialize:s}:Hn.assertOptions(s,{encode:De.function,serialize:De.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&g.merge(i.common,i[n.method]);i&&g.forEach(["delete","get","head","post","put","patch","common"],b=>{delete i[b]}),n.headers=Ce.concat(a,i);const c=[];let h=!0;this.interceptors.request.forEach(function(O){typeof O.runWhen=="function"&&O.runWhen(n)===!1||(h=h&&O.synchronous,c.unshift(O.fulfilled,O.rejected))});const l=[];this.interceptors.response.forEach(function(O){l.push(O.fulfilled,O.rejected)});let d,m=0,E;if(!h){const b=[is.bind(this),void 0];for(b.unshift.apply(b,c),b.push.apply(b,l),E=b.length,d=Promise.resolve(n);m<E;)d=d.then(b[m++],b[m++]);return d}E=c.length;let w=n;for(m=0;m<E;){const b=c[m++],O=c[m++];try{w=b(w)}catch(j){O.call(this,j);break}}try{d=is.call(this,w)}catch(b){return Promise.reject(b)}for(m=0,E=l.length;m<E;)d=d.then(l[m++],l[m++]);return d}getUri(t){t=dt(this.defaults,t);const n=Gs(t.baseURL,t.url);return qs(n,t.params,t.paramsSerializer)}}g.forEach(["delete","get","head","options"],function(t){nn.prototype[t]=function(n,r){return this.request(dt(r||{},{method:t,url:n,data:(r||{}).data}))}});g.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,c){return this.request(dt(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}nn.prototype[t]=n(),nn.prototype[t+"Form"]=n(!0)});const Zt=nn;class dr{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 a=new Promise(c=>{r.subscribe(c),i=c}).then(s);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,c){r.reason||(r.reason=new At(i,a,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)}static source(){let t;return{token:new dr(function(s){t=s}),cancel:t}}}const qa=dr;function Ya(e){return function(n){return e.apply(null,n)}}function Ja(e){return g.isObject(e)&&e.isAxiosError===!0}const qn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(qn).forEach(([e,t])=>{qn[t]=e});const Ka=qn;function Qs(e){const t=new Zt(e),n=Ds(Zt.prototype.request,t);return g.extend(n,Zt.prototype,t,{allOwnKeys:!0}),g.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Qs(dt(e,s))},n}const re=Qs(fr);re.Axios=Zt;re.CanceledError=At;re.CancelToken=qa;re.isCancel=Ks;re.VERSION=Zs;re.toFormData=un;re.AxiosError=L;re.Cancel=re.CanceledError;re.all=function(t){return Promise.all(t)};re.spread=Ya;re.isAxiosError=Ja;re.mergeConfig=dt;re.AxiosHeaders=Ce;re.formToJSON=e=>Js(g.isHTMLForm(e)?new FormData(e):e);re.getAdapter=Xs.getAdapter;re.HttpStatusCode=Ka;re.default=re;const Ga=re;async function cs(e,t){const n=await fetch(e,t);return n.status===200?n.json():Promise.resolve({message:n.statusText,success:!1})}const Yn=ir({types:{context:{},events:{},input:{}},actions:{setUserContext:ge(({context:e,event:t})=>{if(!t.type.includes("xstate.done.actor"))return e;const n=t;return n.output.type!=="AUTHENTICATE_SUCCESS"?e:{accessToken:n.output.accessToken,ignoreRefreshToken:!1}}),unsetUserContext:ge(()=>({user:null,accessToken:"",refreshToken:"",ignoreRefreshToken:!1})),setAccessToken:ge(({context:e,event:t})=>{if(!t.type.includes("xstate.done.actor"))return e;const n=t;return n.output.type!=="REFRESH_TOKEN_SUCCESS"?e:{accessToken:n.output.accessToken,ignoreRefreshToken:!1}}),unsetRefreshToken:ge(()=>({refreshToken:""})),setIgnoreRefreshToken:ge(()=>({ignoreRefreshToken:!0})),addError:ge(({context:e,event:t})=>{if(!t.type.includes("xstate.error.actor"))return e;const n=t;return{errors:[...e.errors,String(n.error).replace("Error: ","")]}}),clearErrors:ge(()=>({errors:[]}))},actors:{refreshAccessToken:Dn(async({input:e})=>{let t;if(typeof window>"u"){if(e.context.refreshToken==="")throw new Error("Unauthorized.");try{const n=await Ga.post(e.context.endpoints.ssrRefresh,{grant_type:"refresh_token"},{headers:{Cookie:`refresh_token=${e.context.refreshToken}`,"Content-Type":"application/json","clicktap-scope":"view","clicktap-scope-id":"default"},withCredentials:!0}),{data:r}=n;if(typeof r.accessToken>"u")throw new Error("Unauthorized.");return{type:"REFRESH_TOKEN_SUCCESS",accessToken:r.accessToken}}catch{throw new Error("Could not complete refresh request (server)")}}else{t=await cs(e.context.endpoints.refresh,{method:"POST",mode:"cors",credentials:"include",headers:{"Content-Type":"application/json","clicktap-scope":"view","clicktap-scope-id":"default"},body:JSON.stringify({grant_type:"refresh_token"}).toString()});const n=t;if(typeof n.accessToken>"u")throw new Error("Unauthorized.");return{type:"REFRESH_TOKEN_SUCCESS",accessToken:n.accessToken}}}),authenticate:Dn(async({input:e})=>{var r;const n=await cs(e.context.endpoints.login,{method:"POST",mode:"cors",credentials:"include",headers:{"Content-Type":"application/json","clicktap-scope":"view","clicktap-scope-id":"default"},body:JSON.stringify({username:e.username,password:e.password}).toString()});if(!n.success)throw new Error(((r=n.message)==null?void 0:r.toString())??"Sign in failed. Please try again.");return{type:"AUTHENTICATE_SUCCESS",accessToken:n.accessToken}}),unauthenticate:Dn(async({input:e})=>(await fetch(e.context.endpoints.logout,{method:"POST",mode:"cors",credentials:"include",headers:{"clicktap-scope":"view","clicktap-scope-id":"default"}}),{type:"UNAUTHENTICATE"}))}}).createMachine({id:"auth",context:({input:e})=>{var t,n;return{user:null,accessToken:"",refreshToken:((t=e==null?void 0:e.initialContext)==null?void 0:t.refreshToken)??"",ignoreRefreshToken:!1,endpoints:((n=e==null?void 0:e.initialContext)==null?void 0:n.endpoints)??{login:"",logout:"",refresh:"",ssrRefresh:""},errors:[]}},initial:"refreshing",states:{authenticating:{invoke:{src:"authenticate",input:({context:e,event:t})=>t.type!=="LOGIN"?{context:e,username:"",password:""}:{context:e,username:t.username,password:t.password},onDone:[{actions:"setUserContext",target:"loggedIn"}],onError:[{actions:"addError",target:"loggedOut"}]}},unauthenticating:{invoke:{src:"unauthenticate",input:({context:e})=>({context:e}),onDone:[{actions:"unsetUserContext",target:"loggedOut"}],onError:[{actions:["unsetUserContext","setIgnoreRefreshToken"],target:"loggedOut"}]}},refreshing:{invoke:{src:"refreshAccessToken",input:({context:e})=>({context:e}),onDone:[{actions:["unsetRefreshToken","setAccessToken"],target:"loggedIn"}],onError:[{actions:"unsetRefreshToken",target:"unauthenticating"}]}},loggedOut:{on:{LOGIN:{target:"authenticating"},CLEAR_ERRORS:{actions:"clearErrors"}}},loggedIn:{after:{84e4:{guard:()=>typeof window<"u",target:"refreshing"}},on:{LOGOUT:{target:"unauthenticating"},CLEAR_ERRORS:{actions:"clearErrors"}}}}});var Jn={exports:{}},bt={},Kn={exports:{}},$={};/**
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function ko(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function xo(){const e=ko();if(e.__xstate__)return e.__xstate__}const Po=e=>{if(typeof window>"u")return;const t=xo();t&&t.register(e)};class Nr{constructor(t){this._process=t,this._active=!1,this._current=null,this._last=null}start(){this._active=!0,this.flush()}clear(){this._current&&(this._current.next=null,this._last=this._current)}enqueue(t){const n={value:t,next:null};if(this._current){this._last.next=n,this._last=n;return}this._current=n,this._last=n,this._active&&this.flush()}flush(){for(;this._current;){const t=this._current;this._process(t.value),this._current=t.next}this._last=null}}const ps=".",Io="",ys="",jo="#",Do="*",ms="xstate.init",$o="xstate.error",Tt="xstate.stop";function Mo(e,t){return{type:`xstate.after.${e}.${t}`}}function Ln(e,t){return{type:`xstate.done.state.${e}`,output:t}}function Fo(e,t){return{type:`xstate.done.actor.${e}`,output:t}}function vs(e,t){return{type:`xstate.error.actor.${e}`,error:t}}function gs(e){return{type:ms,input:e}}function Oe(e){setTimeout(()=>{throw e})}const No=(()=>typeof Symbol=="function"&&Symbol.observable||"@@observable")();function Lr(e,t){return`${e.sessionId}.${t}`}let Lo=0;function Uo(e,t){const n=new Map,r=new Map,s=new WeakMap,i=new Set,a={},u=t.clock,d={schedule:(h,E,S,_,O=Math.random().toString(36).slice(2))=>{const D={source:h,target:E,event:S,delay:_,id:O,startedAt:Date.now()},L=Lr(h,O);y._snapshot._scheduledEvents[L]=D;const V=u.setTimeout(()=>{delete a[L],delete y._snapshot._scheduledEvents[L],y._relay(h,E,S)},_);a[L]=V},cancel:(h,E)=>{const S=Lr(h,E),_=a[S];delete a[S],delete y._snapshot._scheduledEvents[S],u.clearTimeout(_)},cancelAll:h=>{for(const E in y._snapshot._scheduledEvents){const S=y._snapshot._scheduledEvents[E];S.source===h&&d.cancel(h,S.id)}}},l=h=>{if(!i.size)return;const E={...h,rootId:e.sessionId};i.forEach(S=>{var _;return(_=S.next)==null?void 0:_.call(S,E)})},y={_snapshot:{_scheduledEvents:((t==null?void 0:t.snapshot)&&t.snapshot.scheduler)??{}},_bookId:()=>`x:${Lo++}`,_register:(h,E)=>(n.set(h,E),h),_unregister:h=>{n.delete(h.sessionId);const E=s.get(h);E!==void 0&&(r.delete(E),s.delete(h))},get:h=>r.get(h),_set:(h,E)=>{const S=r.get(h);if(S&&S!==E)throw new Error(`Actor with system ID '${h}' already exists.`);r.set(h,E),s.set(E,h)},inspect:h=>{i.add(h)},_sendInspectionEvent:l,_relay:(h,E,S)=>{y._sendInspectionEvent({type:"@xstate.event",sourceRef:h,actorRef:E,event:S}),E._send(S)},scheduler:d,getSnapshot:()=>({_scheduledEvents:{...y._snapshot._scheduledEvents}}),start:()=>{const h=y._snapshot._scheduledEvents;y._snapshot._scheduledEvents={};for(const E in h){const{source:S,target:_,event:O,delay:D,id:L}=h[E];d.schedule(S,_,O,D,L)}}};return y}function _s(e,t){const n=Ur(e),r=Ur(t);return typeof r=="string"?typeof n=="string"?r===n:!1:typeof n=="string"?n in r:Object.keys(n).every(s=>s in r?_s(n[s],r[s]):!1)}function Gn(e){if(bs(e))return e;let t=[],n="";for(let r=0;r<e.length;r++){switch(e.charCodeAt(r)){case 92:n+=e[r+1],r++;continue;case 46:t.push(n),n="";continue}n+=e[r]}return t.push(n),t}function Ur(e){if(vi(e))return e.value;if(typeof e!="string")return e;const t=Gn(e);return Bo(t)}function Bo(e){if(e.length===1)return e[0];const t={};let n=t;for(let r=0;r<e.length-1;r++)if(r===e.length-2)n[e[r]]=e[r+1];else{const s=n;n={},s[e[r]]=n}return t}function Br(e,t){const n={},r=Object.keys(e);for(let s=0;s<r.length;s++){const i=r[s];n[i]=t(e[i],i,e,s)}return n}function Es(e){return bs(e)?e:[e]}function $e(e){return e===void 0?[]:Es(e)}function Un(e,t,n,r){return typeof e=="function"?e({context:t,event:n,self:r}):e}function bs(e){return Array.isArray(e)}function Wo(e){return e.type.startsWith("xstate.error.actor")}function it(e){return Es(e).map(t=>typeof t>"u"||typeof t=="string"?{target:t}:t)}function Ss(e){if(!(e===void 0||e===Io))return $e(e)}function Wr(e,t,n){var i,a,u;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(a=r?e.error:t)==null?void 0:a.bind(s),complete:(u=r?e.complete:n)==null?void 0:u.bind(s)}}function Vr(e,t){return`${t}.${e}`}function Xn(e,t){const n=t.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!n)return e.implementations.actors[t];const[,r,s]=n,a=e.getStateNodeById(s).config.invoke;return(Array.isArray(a)?a[r]:a).src}const Zn=1;let fe=function(e){return e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped",e}({});const Vo={clock:{setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)},logger:console.log.bind(console),devTools:!1};class zo{constructor(t,n){this.logic=t,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new Nr(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=fe.NotStarted,this._parent=void 0,this._syncSnapshot=void 0,this.ref=void 0,this._actorScope=void 0,this._systemId=void 0,this.sessionId=void 0,this.system=void 0,this._doneEvent=void 0,this.src=void 0,this._deferred=[];const r={...Vo,...n},{clock:s,logger:i,parent:a,syncSnapshot:u,id:d,systemId:l,inspect:y}=r;this.system=a?a.system:Uo(this,{clock:s}),y&&!a&&this.system.inspect(Wr(y)),this.sessionId=this.system._bookId(),this.id=d??this.sessionId,this.logger=i,this.clock=s,this._parent=a,this._syncSnapshot=u,this.options=r,this.src=r.src??t,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:h=>{this._deferred.push(h)},system:this.system,stopChild:h=>{if(h._parent!==this)throw new Error(`Cannot stop child actor ${h.id} of ${this.id} because it is not a child`);h._stop()},emit:h=>{const E=this.eventListeners.get(h.type);if(E)for(const S of Array.from(E))S(h)}},this.send=this.send.bind(this),this.system._sendInspectionEvent({type:"@xstate.actor",actorRef:this}),l&&(this._systemId=l,this.system._set(l,this)),this._initState((n==null?void 0:n.snapshot)??(n==null?void 0:n.state)),l&&this._snapshot.status!=="active"&&this.system._unregister(this)}_initState(t){var n;try{this._snapshot=t?this.logic.restoreSnapshot?this.logic.restoreSnapshot(t,this._actorScope):t:this.logic.getInitialSnapshot(this._actorScope,(n=this.options)==null?void 0:n.input)}catch(r){this._snapshot={status:"error",output:void 0,error:r}}}update(t,n){var s,i;this._snapshot=t;let r;for(;r=this._deferred.shift();)try{r()}catch(a){this._deferred.length=0,this._snapshot={...t,status:"error",error:a}}switch(this._snapshot.status){case"active":for(const a of this.observers)try{(s=a.next)==null||s.call(a,t)}catch(u){Oe(u)}break;case"done":for(const a of this.observers)try{(i=a.next)==null||i.call(a,t)}catch(u){Oe(u)}this._stopProcedure(),this._complete(),this._doneEvent=Fo(this.id,this._snapshot.output),this._parent&&this.system._relay(this,this._parent,this._doneEvent);break;case"error":this._error(this._snapshot.error);break}this.system._sendInspectionEvent({type:"@xstate.snapshot",actorRef:this,event:n,snapshot:t})}subscribe(t,n,r){var i;const s=Wr(t,n,r);if(this._processingStatus!==fe.Stopped)this.observers.add(s);else switch(this._snapshot.status){case"done":try{(i=s.complete)==null||i.call(s)}catch(a){Oe(a)}break;case"error":{const a=this._snapshot.error;if(!s.error)Oe(a);else try{s.error(a)}catch(u){Oe(u)}break}}return{unsubscribe:()=>{this.observers.delete(s)}}}on(t,n){let r=this.eventListeners.get(t);r||(r=new Set,this.eventListeners.set(t,r));const s=n.bind(void 0);return r.add(s),{unsubscribe:()=>{r.delete(s)}}}start(){if(this._processingStatus===fe.Running)return this;this._syncSnapshot&&this.subscribe({next:r=>{r.status==="active"&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:r})},error:()=>{}}),this.system._register(this.sessionId,this),this._systemId&&this.system._set(this._systemId,this),this._processingStatus=fe.Running;const t=gs(this.options.input);switch(this.system._sendInspectionEvent({type:"@xstate.event",sourceRef:this._parent,actorRef:this,event:t}),this._snapshot.status){case"done":return this.update(this._snapshot,t),this;case"error":return this._error(this._snapshot.error),this}if(this._parent||this.system.start(),this.logic.start)try{this.logic.start(this._snapshot,this._actorScope)}catch(r){return this._snapshot={...this._snapshot,status:"error",error:r},this._error(r),this}return this.update(this._snapshot,t),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(t){let n,r;try{n=this.logic.transition(this._snapshot,t,this._actorScope)}catch(s){r={err:s}}if(r){const{err:s}=r;this._snapshot={...this._snapshot,status:"error",error:s},this._error(s);return}this.update(n,t),t.type===Tt&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===fe.Stopped?this:(this.mailbox.clear(),this._processingStatus===fe.NotStarted?(this._processingStatus=fe.Stopped,this):(this.mailbox.enqueue({type:Tt}),this))}stop(){if(this._parent)throw new Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){var t;for(const n of this.observers)try{(t=n.complete)==null||t.call(n)}catch(r){Oe(r)}this.observers.clear()}_reportError(t){if(!this.observers.size){this._parent||Oe(t);return}let n=!1;for(const r of this.observers){const s=r.error;n||(n=!s);try{s==null||s(t)}catch(i){Oe(i)}}this.observers.clear(),n&&Oe(t)}_error(t){this._stopProcedure(),this._reportError(t),this._parent&&this.system._relay(this,this._parent,vs(this.id,t))}_stopProcedure(){return this._processingStatus!==fe.Running?this:(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new Nr(this._process.bind(this)),this._processingStatus=fe.Stopped,this.system._unregister(this),this)}_send(t){this._processingStatus!==fe.Stopped&&this.mailbox.enqueue(t)}send(t){this.system._relay(void 0,this,t)}attachDevTools(){const{devTools:t}=this.options;t&&(typeof t=="function"?t:Po)(this)}toJSON(){return{xstate$$type:Zn,id:this.id}}getPersistedSnapshot(t){return this.logic.getPersistedSnapshot(this._snapshot,t)}[No](){return this}getSnapshot(){return this._snapshot}}function ut(e,...[t]){return new zo(e,t)}function Ho(e,t,n,r,{sendId:s}){const i=typeof s=="function"?s(n,r):s;return[t,i]}function qo(e,t){e.defer(()=>{e.system.scheduler.cancel(e.self,t)})}function Yo(e){function t(n,r){}return t.type="xstate.cancel",t.sendId=e,t.resolve=Ho,t.execute=qo,t}function Jo(e,t,n,r,{id:s,systemId:i,src:a,input:u,syncSnapshot:d}){const l=typeof a=="string"?Xn(t.machine,a):a,y=typeof s=="function"?s(n):s;let h;return l&&(h=ut(l,{id:y,src:a,parent:e.self,syncSnapshot:d,systemId:i,input:typeof u=="function"?u({context:t.context,event:n.event,self:e.self}):u})),[Xe(t,{children:{...t.children,[y]:h}}),{id:s,actorRef:h}]}function Ko(e,{id:t,actorRef:n}){n&&e.defer(()=>{n._processingStatus!==fe.Stopped&&n.start()})}function Go(...[e,{id:t,systemId:n,input:r,syncSnapshot:s=!1}={}]){function i(a,u){}return i.type="snapshot.spawnChild",i.id=t,i.systemId=n,i.src=e,i.input=r,i.syncSnapshot=s,i.resolve=Jo,i.execute=Ko,i}function Xo(e,t,n,r,{actorRef:s}){const i=typeof s=="function"?s(n,r):s,a=typeof i=="string"?t.children[i]:i;let u=t.children;return a&&(u={...u},delete u[a.id]),[Xe(t,{children:u}),a]}function Zo(e,t){if(t){if(e.system._unregister(t),t._processingStatus!==fe.Running){e.stopChild(t);return}e.defer(()=>{e.stopChild(t)})}}function ws(e){function t(n,r){}return t.type="xstate.stopChild",t.actorRef=e,t.resolve=Xo,t.execute=Zo,t}function Qn(e,t,n,r){const{machine:s}=r,i=typeof e=="function",a=i?e:s.implementations.guards[typeof e=="string"?e:e.type];if(!i&&!a)throw new Error(`Guard '${typeof e=="string"?e:e.type}' is not implemented.'.`);if(typeof a!="function")return Qn(a,t,n,r);const u={context:t,event:n},d=i||typeof e=="string"?void 0:"params"in e?typeof e.params=="function"?e.params({context:t,event:n}):e.params:void 0;return"check"in a?a.check(r,u,a):a(u,d)}const er=e=>e.type==="atomic"||e.type==="final";function ct(e){return Object.values(e.states).filter(t=>t.type!=="history")}function Ot(e,t){const n=[];if(t===e)return n;let r=e.parent;for(;r&&r!==t;)n.push(r),r=r.parent;return n}function Qt(e){const t=new Set(e),n=Rs(t);for(const r of t)if(r.type==="compound"&&(!n.get(r)||!n.get(r).length))zr(r).forEach(s=>t.add(s));else if(r.type==="parallel"){for(const s of ct(r))if(s.type!=="history"&&!t.has(s)){const i=zr(s);for(const a of i)t.add(a)}}for(const r of t){let s=r.parent;for(;s;)t.add(s),s=s.parent}return t}function Ts(e,t){const n=t.get(e);if(!n)return{};if(e.type==="compound"){const s=n[0];if(s){if(er(s))return s.key}else return{}}const r={};for(const s of n)r[s.key]=Ts(s,t);return r}function Rs(e){const t=new Map;for(const n of e)t.has(n)||t.set(n,[]),n.parent&&(t.has(n.parent)||t.set(n.parent,[]),t.get(n.parent).push(n));return t}function Os(e,t){const n=Qt(t);return Ts(e,Rs(n))}function tr(e,t){return t.type==="compound"?ct(t).some(n=>n.type==="final"&&e.has(n)):t.type==="parallel"?ct(t).every(n=>tr(e,n)):t.type==="final"}const rn=e=>e[0]===jo;function Qo(e,t){return e.transitions.get(t)||[...e.transitions.keys()].filter(r=>{if(r===Do)return!0;if(!r.endsWith(".*"))return!1;const s=r.split("."),i=t.split(".");for(let a=0;a<s.length;a++){const u=s[a],d=i[a];if(u==="*")return a===s.length-1;if(u!==d)return!1}return!0}).sort((r,s)=>s.length-r.length).flatMap(r=>e.transitions.get(r))}function ei(e){const t=e.config.after;if(!t)return[];const n=(s,i)=>{const a=Mo(s,e.id),u=a.type;return e.entry.push(Oi(a,{id:u,delay:s})),e.exit.push(Yo(u)),u};return Object.keys(t).flatMap((s,i)=>{const a=t[s],u=typeof a=="string"?{target:a}:a,d=Number.isNaN(+s)?s:+s,l=n(d);return $e(u).map(y=>({...y,event:l,delay:d}))}).map(s=>{const{delay:i}=s;return{...Ke(e,s.event,s),delay:i}})}function Ke(e,t,n){const r=Ss(n.target),s=n.reenter??!1,i=ri(e,r),a={...n,actions:$e(n.actions),guard:n.guard,target:i,source:e,reenter:s,eventType:t,toJSON:()=>({...a,source:`#${e.id}`,target:i?i.map(u=>`#${u.id}`):void 0})};return a}function ti(e){const t=new Map;if(e.config.on)for(const n of Object.keys(e.config.on)){if(n===ys)throw new Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');const r=e.config.on[n];t.set(n,it(r).map(s=>Ke(e,n,s)))}if(e.config.onDone){const n=`xstate.done.state.${e.id}`;t.set(n,it(e.config.onDone).map(r=>Ke(e,n,r)))}for(const n of e.invoke){if(n.onDone){const r=`xstate.done.actor.${n.id}`;t.set(r,it(n.onDone).map(s=>Ke(e,r,s)))}if(n.onError){const r=`xstate.error.actor.${n.id}`;t.set(r,it(n.onError).map(s=>Ke(e,r,s)))}if(n.onSnapshot){const r=`xstate.snapshot.${n.id}`;t.set(r,it(n.onSnapshot).map(s=>Ke(e,r,s)))}}for(const n of e.after){let r=t.get(n.eventType);r||(r=[],t.set(n.eventType,r)),r.push(n)}return t}function ni(e,t){const n=typeof t=="string"?e.states[t]:t?e.states[t.target]:void 0;if(!n&&t)throw new Error(`Initial state node "${t}" not found on parent state node #${e.id}`);const r={source:e,actions:!t||typeof t=="string"?[]:$e(t.actions),eventType:null,reenter:!1,target:n?[n]:[],toJSON:()=>({...r,source:`#${e.id}`,target:n?[`#${n.id}`]:[]})};return r}function ri(e,t){if(t!==void 0)return t.map(n=>{if(typeof n!="string")return n;if(rn(n))return e.machine.getStateNodeById(n);const r=n[0]===ps;if(r&&!e.parent)return en(e,n.slice(1));const s=r?e.key+n:n;if(e.parent)try{return en(e.parent,s)}catch(i){throw new Error(`Invalid transition definition for state node '${e.id}':
|
|
2
|
+
${i.message}`)}else throw new Error(`Invalid target: "${n}" is not a valid target from the root node. Did you mean ".${n}"?`)})}function Cs(e){const t=Ss(e.config.target);return t?{target:t.map(n=>typeof n=="string"?en(e.parent,n):n)}:e.parent.initial}function Ge(e){return e.type==="history"}function zr(e){const t=As(e);for(const n of t)for(const r of Ot(n,e))t.add(r);return t}function As(e){const t=new Set;function n(r){if(!t.has(r)){if(t.add(r),r.type==="compound")n(r.initial.target[0]);else if(r.type==="parallel")for(const s of ct(r))n(s)}}return n(e),t}function ft(e,t){if(rn(t))return e.machine.getStateNodeById(t);if(!e.states)throw new Error(`Unable to retrieve child state '${t}' from '${e.id}'; no child states exist.`);const n=e.states[t];if(!n)throw new Error(`Child state '${t}' does not exist on '${e.id}'`);return n}function en(e,t){if(typeof t=="string"&&rn(t))try{return e.machine.getStateNodeById(t)}catch{}const n=Gn(t).slice();let r=e;for(;n.length;){const s=n.shift();if(!s.length)break;r=ft(r,s)}return r}function tn(e,t){if(typeof t=="string"){const s=e.states[t];if(!s)throw new Error(`State '${t}' does not exist on '${e.id}'`);return[e,s]}const n=Object.keys(t),r=n.map(s=>ft(e,s)).filter(Boolean);return[e.machine.root,e].concat(r,n.reduce((s,i)=>{const a=ft(e,i);if(!a)return s;const u=tn(a,t[i]);return s.concat(u)},[]))}function si(e,t,n,r){const i=ft(e,t).next(n,r);return!i||!i.length?e.next(n,r):i}function oi(e,t,n,r){const s=Object.keys(t),i=ft(e,s[0]),a=nr(i,t[s[0]],n,r);return!a||!a.length?e.next(n,r):a}function ii(e,t,n,r){const s=[];for(const i of Object.keys(t)){const a=t[i];if(!a)continue;const u=ft(e,i),d=nr(u,a,n,r);d&&s.push(...d)}return s.length?s:e.next(n,r)}function nr(e,t,n,r){return typeof t=="string"?si(e,t,n,r):Object.keys(t).length===1?oi(e,t,n,r):ii(e,t,n,r)}function ai(e){return Object.keys(e.states).map(t=>e.states[t]).filter(t=>t.type==="history")}function Me(e,t){let n=e;for(;n.parent&&n.parent!==t;)n=n.parent;return n.parent===t}function ui(e,t){const n=new Set(e),r=new Set(t);for(const s of n)if(r.has(s))return!0;for(const s of r)if(n.has(s))return!0;return!1}function ks(e,t,n){const r=new Set;for(const s of e){let i=!1;const a=new Set;for(const u of r)if(ui(Bn([s],t,n),Bn([u],t,n)))if(Me(s.source,u.source))a.add(u);else{i=!0;break}if(!i){for(const u of a)r.delete(u);r.add(s)}}return Array.from(r)}function ci(e){const[t,...n]=e;for(const r of Ot(t,void 0))if(n.every(s=>Me(s,r)))return r}function rr(e,t){if(!e.target)return[];const n=new Set;for(const r of e.target)if(Ge(r))if(t[r.id])for(const s of t[r.id])n.add(s);else for(const s of rr(Cs(r),t))n.add(s);else n.add(r);return[...n]}function xs(e,t){const n=rr(e,t);if(!n)return;if(!e.reenter&&n.every(s=>s===e.source||Me(s,e.source)))return e.source;const r=ci(n.concat(e.source));if(r)return r;if(!e.reenter)return e.source.machine.root}function Bn(e,t,n){var s;const r=new Set;for(const i of e)if((s=i.target)!=null&&s.length){const a=xs(i,n);i.reenter&&i.source===a&&r.add(a);for(const u of t)Me(u,a)&&r.add(u)}return[...r]}function fi(e,t){if(e.length!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Wn(e,t,n,r,s,i){if(!e.length)return t;const a=new Set(t._nodes);let u=t.historyValue;const d=ks(e,a,u);let l=t;s||([l,u]=pi(l,r,n,d,a,u,i)),l=lt(l,r,n,d.flatMap(h=>h.actions),i),l=di(l,r,n,d,a,i,u,s);const y=[...a];l.status==="done"&&(l=lt(l,r,n,y.sort((h,E)=>E.order-h.order).flatMap(h=>h.exit),i));try{return u===t.historyValue&&fi(t._nodes,a)?l:Xe(l,{_nodes:y,historyValue:u})}catch(h){throw h}}function li(e,t,n,r,s){if(r.output===void 0)return;const i=Ln(s.id,s.output!==void 0&&s.parent?Un(s.output,e.context,t,n.self):void 0);return Un(r.output,e.context,i,n.self)}function di(e,t,n,r,s,i,a,u){let d=e;const l=new Set,y=new Set;hi(r,a,y,l),u&&y.add(e.machine.root);const h=new Set;for(const E of[...l].sort((S,_)=>S.order-_.order)){s.add(E);const S=[];S.push(...E.entry);for(const _ of E.invoke)S.push(Go(_.src,{..._,syncSnapshot:!!_.onSnapshot}));if(y.has(E)){const _=E.initial.actions;S.push(..._)}if(d=lt(d,t,n,S,i,E.invoke.map(_=>_.id)),E.type==="final"){const _=E.parent;let O=(_==null?void 0:_.type)==="parallel"?_:_==null?void 0:_.parent,D=O||E;for((_==null?void 0:_.type)==="compound"&&i.push(Ln(_.id,E.output!==void 0?Un(E.output,d.context,t,n.self):void 0));(O==null?void 0:O.type)==="parallel"&&!h.has(O)&&tr(s,O);)h.add(O),i.push(Ln(O.id)),D=O,O=O.parent;if(O)continue;d=Xe(d,{status:"done",output:li(d,t,n,d.machine.root,D)})}}return d}function hi(e,t,n,r){for(const s of e){const i=xs(s,t);for(const u of s.target||[])!Ge(u)&&(s.source!==u||s.source!==i||s.reenter)&&(r.add(u),n.add(u)),at(u,t,n,r);const a=rr(s,t);for(const u of a){const d=Ot(u,i);(i==null?void 0:i.type)==="parallel"&&d.push(i),Ps(r,t,n,d,!s.source.parent&&s.reenter?void 0:i)}}}function at(e,t,n,r){var s;if(Ge(e))if(t[e.id]){const i=t[e.id];for(const a of i)r.add(a),at(a,t,n,r);for(const a of i)In(a,e.parent,r,t,n)}else{const i=Cs(e);for(const a of i.target)r.add(a),i===((s=e.parent)==null?void 0:s.initial)&&n.add(e.parent),at(a,t,n,r);for(const a of i.target)In(a,e.parent,r,t,n)}else if(e.type==="compound"){const[i]=e.initial.target;Ge(i)||(r.add(i),n.add(i)),at(i,t,n,r),In(i,e,r,t,n)}else if(e.type==="parallel")for(const i of ct(e).filter(a=>!Ge(a)))[...r].some(a=>Me(a,i))||(Ge(i)||(r.add(i),n.add(i)),at(i,t,n,r))}function Ps(e,t,n,r,s){for(const i of r)if((!s||Me(i,s))&&e.add(i),i.type==="parallel")for(const a of ct(i).filter(u=>!Ge(u)))[...e].some(u=>Me(u,a))||(e.add(a),at(a,t,n,e))}function In(e,t,n,r,s){Ps(n,r,s,Ot(e,t))}function pi(e,t,n,r,s,i,a){let u=e;const d=Bn(r,s,i);d.sort((y,h)=>h.order-y.order);let l;for(const y of d)for(const h of ai(y)){let E;h.history==="deep"?E=S=>er(S)&&Me(S,y):E=S=>S.parent===y,l??(l={...i}),l[h.id]=Array.from(s).filter(E)}for(const y of d)u=lt(u,t,n,[...y.exit,...y.invoke.map(h=>ws(h.id))],a),s.delete(y);return[u,l||i]}function Is(e,t,n,r,s,i){const{machine:a}=e;let u=e;for(const d of r){let S=function(){n.system._sendInspectionEvent({type:"@xstate.action",actorRef:n.self,action:{type:typeof d=="string"?d:typeof d=="object"?d.type:d.name||"(anonymous)",params:E}}),y(h,E)};const l=typeof d=="function",y=l?d:a.implementations.actions[typeof d=="string"?d:d.type];if(!y)continue;const h={context:u.context,event:t,self:n.self,system:n.system},E=l||typeof d=="string"?void 0:"params"in d?typeof d.params=="function"?d.params({context:u.context,event:t}):d.params:void 0;if(!("resolve"in y)){n.self._processingStatus===fe.Running?S():n.defer(()=>{S()});continue}const _=y,[O,D,L]=_.resolve(n,u,h,E,y,s);u=O,"retryResolve"in _&&(i==null||i.push([_,D])),"execute"in _&&(n.self._processingStatus===fe.Running?_.execute(n,D):n.defer(_.execute.bind(null,n,D))),L&&(u=Is(u,t,n,L,s,i))}return u}function lt(e,t,n,r,s,i){const a=i?[]:void 0,u=Is(e,t,n,r,{internalQueue:s,deferredActorIds:i},a);return a==null||a.forEach(([d,l])=>{d.retryResolve(n,u,l)}),u}function jn(e,t,n,r=[]){let s=e;const i=[];function a(l,y,h){n.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:n.self,event:y,snapshot:l,_transitions:h}),i.push(l)}if(t.type===Tt)return s=Xe(Hr(s,t,n),{status:"stopped"}),a(s,t,[]),{snapshot:s,microstates:i};let u=t;if(u.type!==ms){const l=u,y=Wo(l),h=qr(l,s);if(y&&!h.length)return s=Xe(e,{status:"error",error:l.error}),a(s,l,[]),{snapshot:s,microstates:i};s=Wn(h,e,n,u,!1,r),a(s,l,h)}let d=!0;for(;s.status==="active";){let l=d?yi(s,u):[];const y=l.length?s:void 0;if(!l.length){if(!r.length)break;u=r.shift(),l=qr(u,s)}s=Wn(l,s,n,u,!1,r),d=s!==y,a(s,u,l)}return s.status!=="active"&&Hr(s,u,n),{snapshot:s,microstates:i}}function Hr(e,t,n){return lt(e,t,n,Object.values(e.children).map(r=>ws(r)),[])}function qr(e,t){return t.machine.getTransitionData(t,e)}function yi(e,t){const n=new Set,r=e._nodes.filter(er);for(const s of r)e:for(const i of[s].concat(Ot(s,void 0)))if(i.always){for(const a of i.always)if(a.guard===void 0||Qn(a.guard,e.context,t,e)){n.add(a);break e}}return ks(Array.from(n),new Set(e._nodes),e.historyValue)}function mi(e,t){const n=Qt(tn(e,t));return Os(e,[...n])}function vi(e){return!!e&&typeof e=="object"&&"machine"in e&&"value"in e}const gi=function(t){return _s(t,this.value)},_i=function(t){return this.tags.has(t)},Ei=function(t){const n=this.machine.getTransitionData(this,t);return!!(n!=null&&n.length)&&n.some(r=>r.target!==void 0||r.actions.length)},bi=function(){const{_nodes:t,tags:n,machine:r,getMeta:s,toJSON:i,can:a,hasTag:u,matches:d,...l}=this;return{...l,tags:Array.from(n)}},Si=function(){return this._nodes.reduce((t,n)=>(n.meta!==void 0&&(t[n.id]=n.meta),t),{})};function Jt(e,t){return{status:e.status,output:e.output,error:e.error,machine:t,context:e.context,_nodes:e._nodes,value:Os(t.root,e._nodes),tags:new Set(e._nodes.flatMap(n=>n.tags)),children:e.children,historyValue:e.historyValue||{},matches:gi,hasTag:_i,can:Ei,getMeta:Si,toJSON:bi}}function Xe(e,t={}){return Jt({...e,...t},e.machine)}function wi(e,t){const{_nodes:n,tags:r,machine:s,children:i,context:a,can:u,hasTag:d,matches:l,getMeta:y,toJSON:h,...E}=e,S={};for(const O in i){const D=i[O];S[O]={snapshot:D.getPersistedSnapshot(t),src:D.src,systemId:D._systemId,syncSnapshot:D._syncSnapshot}}return{...E,context:js(a),children:S}}function js(e){let t;for(const n in e){const r=e[n];if(r&&typeof r=="object")if("sessionId"in r&&"send"in r&&"ref"in r)t??(t=Array.isArray(e)?e.slice():{...e}),t[n]={xstate$$type:Zn,id:r.id};else{const s=js(r);s!==r&&(t??(t=Array.isArray(e)?e.slice():{...e}),t[n]=s)}}return t??e}function Ti(e,t,n,r,{event:s,id:i,delay:a},{internalQueue:u}){const d=t.machine.implementations.delays;if(typeof s=="string")throw new Error(`Only event objects may be used with raise; use raise({ type: "${s}" }) instead`);const l=typeof s=="function"?s(n,r):s;let y;if(typeof a=="string"){const h=d&&d[a];y=typeof h=="function"?h(n,r):h}else y=typeof a=="function"?a(n,r):a;return typeof y!="number"&&u.push(l),[t,{event:l,id:i,delay:y}]}function Ri(e,t){const{event:n,delay:r,id:s}=t;if(typeof r=="number"){e.defer(()=>{const i=e.self;e.system.scheduler.schedule(i,i,n,r,s)});return}}function Oi(e,t){function n(r,s){}return n.type="xstate.raise",n.event=e,n.id=t==null?void 0:t.id,n.delay=t==null?void 0:t.delay,n.resolve=Ti,n.execute=Ri,n}const Yr=new WeakMap;function Ci(e){return{config:e,start:(n,r)=>{const{self:s,system:i}=r,a={receivers:void 0,dispose:void 0};Yr.set(s,a),a.dispose=e({input:n.input,system:i,self:s,sendBack:u=>{s.getSnapshot().status!=="stopped"&&s._parent&&i._relay(s,s._parent,u)},receive:u=>{a.receivers??(a.receivers=new Set),a.receivers.add(u)}})},transition:(n,r,s)=>{var a,u;const i=Yr.get(s.self);return r.type===Tt?(n={...n,status:"stopped",error:void 0},(a=i.dispose)==null||a.call(i),n):((u=i.receivers)==null||u.forEach(d=>d(r)),n)},getInitialSnapshot:(n,r)=>({status:"active",output:void 0,error:void 0,input:r}),getPersistedSnapshot:n=>n,restoreSnapshot:n=>n}}const Jr="xstate.promise.resolve",Kr="xstate.promise.reject";function Dn(e){return{config:e,transition:(n,r)=>{if(n.status!=="active")return n;switch(r.type){case Jr:{const s=r.data;return{...n,status:"done",output:s,input:void 0}}case Kr:return{...n,status:"error",error:r.data,input:void 0};case Tt:return{...n,status:"stopped",input:void 0};default:return n}},start:(n,{self:r,system:s})=>{if(n.status!=="active")return;Promise.resolve(e({input:n.input,system:s,self:r})).then(a=>{r.getSnapshot().status==="active"&&s._relay(r,r,{type:Jr,data:a})},a=>{r.getSnapshot().status==="active"&&s._relay(r,r,{type:Kr,data:a})})},getInitialSnapshot:(n,r)=>({status:"active",output:void 0,error:void 0,input:r}),getPersistedSnapshot:n=>n,restoreSnapshot:n=>n}}function Ai(e,{machine:t,context:n},r,s){const i=(a,u={})=>{const{systemId:d,input:l}=u;if(typeof a=="string"){const y=Xn(t,a);if(!y)throw new Error(`Actor logic '${a}' not implemented in machine '${t.id}'`);const h=ut(y,{id:u.id,parent:e.self,syncSnapshot:u.syncSnapshot,input:typeof l=="function"?l({context:n,event:r,self:e.self}):l,src:a,systemId:d});return s[h.id]=h,h}else return ut(a,{id:u.id,parent:e.self,syncSnapshot:u.syncSnapshot,input:u.input,src:a,systemId:d})};return(a,u)=>{const d=i(a,u);return s[d.id]=d,e.defer(()=>{d._processingStatus!==fe.Stopped&&d.start()}),d}}function ki(e,t,n,r,{assignment:s}){if(!t.context)throw new Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");const i={},a={context:t.context,event:n.event,spawn:Ai(e,t,n.event,i),self:e.self,system:e.system};let u={};if(typeof s=="function")u=s(a,r);else for(const l of Object.keys(s)){const y=s[l];u[l]=typeof y=="function"?y(a,r):y}const d=Object.assign({},t.context,u);return[Xe(t,{context:d,children:Object.keys(i).length?{...t.children,...i}:t.children})]}function ge(e){function t(n,r){}return t.type="xstate.assign",t.assignment=e,t.resolve=ki,t}let Gr=function(e){return e.Parent="#_parent",e.Internal="#_internal",e}({});function xi(e,t,n,r,{to:s,event:i,id:a,delay:u},d){var _;const l=t.machine.implementations.delays;if(typeof i=="string")throw new Error(`Only event objects may be used with sendTo; use sendTo({ type: "${i}" }) instead`);const y=typeof i=="function"?i(n,r):i;let h;if(typeof u=="string"){const O=l&&l[u];h=typeof O=="function"?O(n,r):O}else h=typeof u=="function"?u(n,r):u;const E=typeof s=="function"?s(n,r):s;let S;if(typeof E=="string"){if(E===Gr.Parent?S=e.self._parent:E===Gr.Internal?S=e.self:E.startsWith("#_")?S=t.children[E.slice(2)]:S=(_=d.deferredActorIds)!=null&&_.includes(E)?E:t.children[E],!S)throw new Error(`Unable to send event to actor '${E}' from machine '${t.machine.id}'.`)}else S=E||e.self;return[t,{to:S,event:y,id:a,delay:h}]}function Pi(e,t,n){typeof n.to=="string"&&(n.to=t.children[n.to])}function Ii(e,t){e.defer(()=>{const{to:n,event:r,delay:s,id:i}=t;if(typeof s=="number"){e.system.scheduler.schedule(e.self,n,r,s,i);return}e.system._relay(e.self,n,r.type===$o?vs(e.self.id,r.data):r)})}function Xr(e,t,n){function r(s,i){}return r.type="xsnapshot.sendTo",r.to=e,r.event=t,r.id=n==null?void 0:n.id,r.delay=n==null?void 0:n.delay,r.resolve=xi,r.retryResolve=Pi,r.execute=Ii,r}const Zr=new WeakMap;function ot(e,t,n){let r=Zr.get(e);return r?t in r||(r[t]=n()):(r={[t]:n()},Zr.set(e,r)),r[t]}const ji={},_t=e=>typeof e=="string"?{type:e}:typeof e=="function"?"resolve"in e?{type:e.type}:{type:e.name}:e;class sr{constructor(t,n){if(this.config=t,this.key=void 0,this.id=void 0,this.type=void 0,this.path=void 0,this.states=void 0,this.history=void 0,this.entry=void 0,this.exit=void 0,this.parent=void 0,this.machine=void 0,this.meta=void 0,this.output=void 0,this.order=-1,this.description=void 0,this.tags=[],this.transitions=void 0,this.always=void 0,this.parent=n._parent,this.key=n._key,this.machine=n._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join(ps),this.type=this.config.type||(this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.description=this.config.description,this.order=this.machine.idMap.size,this.machine.idMap.set(this.id,this),this.states=this.config.states?Br(this.config.states,(r,s)=>new sr(r,{_parent:this,_key:s,_machine:this.machine})):ji,this.type==="compound"&&!this.config.initial)throw new Error(`No initial state specified for compound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=this.config.history===!0?"shallow":this.config.history||!1,this.entry=$e(this.config.entry).slice(),this.exit=$e(this.config.exit).slice(),this.meta=this.config.meta,this.output=this.type==="final"||!this.parent?this.config.output:void 0,this.tags=$e(t.tags).slice()}_initialize(){this.transitions=ti(this),this.config.always&&(this.always=it(this.config.always).map(t=>Ke(this,ys,t))),Object.keys(this.states).forEach(t=>{this.states[t]._initialize()})}get definition(){return{id:this.id,key:this.key,version:this.machine.version,type:this.type,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(_t),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(t=>`#${t.id}`),source:`#${this.id}`,actions:this.initial.actions.map(_t),eventType:null})}:void 0,history:this.history,states:Br(this.states,t=>t.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(t=>({...t,actions:t.actions.map(_t)})),entry:this.entry.map(_t),exit:this.exit.map(_t),meta:this.meta,order:this.order||-1,output:this.output,invoke:this.invoke,description:this.description,tags:this.tags}}toJSON(){return this.definition}get invoke(){return ot(this,"invoke",()=>$e(this.config.invoke).map((t,n)=>{const{src:r,systemId:s}=t,i=t.id??Vr(this.id,n),a=typeof r=="string"?r:`xstate.invoke.${Vr(this.id,n)}`;return{...t,src:a,id:i,systemId:s,toJSON(){const{onDone:u,onError:d,...l}=t;return{...l,type:"xstate.invoke",src:a,id:i}}}}))}get on(){return ot(this,"on",()=>[...this.transitions].flatMap(([n,r])=>r.map(s=>[n,s])).reduce((n,[r,s])=>(n[r]=n[r]||[],n[r].push(s),n),{}))}get after(){return ot(this,"delayedTransitions",()=>ei(this))}get initial(){return ot(this,"initial",()=>ni(this,this.config.initial))}next(t,n){const r=n.type,s=[];let i;const a=ot(this,`candidates-${r}`,()=>Qo(this,r));for(const u of a){const{guard:d}=u,l=t.context;let y=!1;try{y=!d||Qn(d,l,n,t)}catch(h){const E=typeof d=="string"?d:typeof d=="object"?d.type:void 0;throw new Error(`Unable to evaluate guard ${E?`'${E}' `:""}in transition for event '${r}' in state node '${this.id}':
|
|
3
|
+
${h.message}`)}if(y){s.push(...u.actions),i=u;break}}return i?[i]:void 0}get events(){return ot(this,"events",()=>{const{states:t}=this,n=new Set(this.ownEvents);if(t)for(const r of Object.keys(t)){const s=t[r];if(s.states)for(const i of s.events)n.add(`${i}`)}return Array.from(n)})}get ownEvents(){const t=new Set([...this.transitions.keys()].filter(n=>this.transitions.get(n).some(r=>!(!r.target&&!r.actions.length&&!r.reenter))));return Array.from(t)}}const Di="#";class or{constructor(t,n){this.config=t,this.version=void 0,this.schemas=void 0,this.implementations=void 0,this.__xstatenode=!0,this.idMap=new Map,this.root=void 0,this.id=void 0,this.states=void 0,this.events=void 0,this.__TResolvedTypesMeta=void 0,this.id=t.id||"(machine)",this.implementations={actors:(n==null?void 0:n.actors)??{},actions:(n==null?void 0:n.actions)??{},delays:(n==null?void 0:n.delays)??{},guards:(n==null?void 0:n.guards)??{}},this.version=this.config.version,this.schemas=this.config.schemas,this.transition=this.transition.bind(this),this.getInitialSnapshot=this.getInitialSnapshot.bind(this),this.getPersistedSnapshot=this.getPersistedSnapshot.bind(this),this.restoreSnapshot=this.restoreSnapshot.bind(this),this.start=this.start.bind(this),this.root=new sr(t,{_key:this.id,_machine:this}),this.root._initialize(),this.states=this.root.states,this.events=this.root.events}provide(t){const{actions:n,guards:r,actors:s,delays:i}=this.implementations;return new or(this.config,{actions:{...n,...t.actions},guards:{...r,...t.guards},actors:{...s,...t.actors},delays:{...i,...t.delays}})}resolveState(t){const n=mi(this.root,t.value),r=Qt(tn(this.root,n));return Jt({_nodes:[...r],context:t.context||{},children:{},status:tr(r,this.root)?"done":t.status||"active",output:t.output,error:t.error,historyValue:t.historyValue},this)}transition(t,n,r){return jn(t,n,r).snapshot}microstep(t,n,r){return jn(t,n,r).microstates}getTransitionData(t,n){return nr(this.root,t.value,t,n)||[]}getPreInitialState(t,n,r){const{context:s}=this.config,i=Jt({context:typeof s!="function"&&s?s:{},_nodes:[this.root],children:{},status:"active"},this);return typeof s=="function"?lt(i,n,t,[ge(({spawn:u,event:d,self:l})=>s({spawn:u,input:d.input,self:l}))],r):i}getInitialSnapshot(t,n){const r=gs(n),s=[],i=this.getPreInitialState(t,r,s),a=Wn([{target:[...As(this.root)],source:this.root,reenter:!0,actions:[],eventType:null,toJSON:null}],i,t,r,!0,s),{snapshot:u}=jn(a,r,t,s);return u}start(t){Object.values(t.children).forEach(n=>{n.getSnapshot().status==="active"&&n.start()})}getStateNodeById(t){const n=Gn(t),r=n.slice(1),s=rn(n[0])?n[0].slice(Di.length):n[0],i=this.idMap.get(s);if(!i)throw new Error(`Child state node '#${s}' does not exist on machine '${this.id}'`);return en(i,r)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(t,n){return wi(t,n)}restoreSnapshot(t,n){const r={},s=t.children;Object.keys(s).forEach(d=>{const l=s[d],y=l.snapshot,h=l.src,E=typeof h=="string"?Xn(this,h):h;if(!E)return;const S=ut(E,{id:d,parent:n.self,syncSnapshot:l.syncSnapshot,snapshot:y,src:h,systemId:l.systemId});r[d]=S});const i=Jt({...t,children:r,_nodes:Array.from(Qt(tn(this.root,t.value)))},this);let a=new Set;function u(d,l){if(!a.has(d)){a.add(d);for(let y in d){const h=d[y];if(h&&typeof h=="object"){if("xstate$$type"in h&&h.xstate$$type===Zn){d[y]=l[h.id];continue}u(h,l)}}}}return u(i.context,r),i}}function $i(e,t){return new or(e,t)}function ir({schemas:e,actors:t,actions:n,guards:r,delays:s}){return{createMachine:i=>$i({...i,schemas:e},{actors:t,actions:n,guards:r,delays:s})}}function Ds(e,t){return function(){return e.apply(t,arguments)}}const{toString:Mi}=Object.prototype,{getPrototypeOf:ar}=Object,sn=(e=>t=>{const n=Mi.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),we=e=>(e=e.toLowerCase(),t=>sn(t)===e),on=e=>t=>typeof t===e,{isArray:ht}=Array,Rt=on("undefined");function Fi(e){return e!==null&&!Rt(e)&&e.constructor!==null&&!Rt(e.constructor)&&ye(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $s=we("ArrayBuffer");function Ni(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&$s(e.buffer),t}const Li=on("string"),ye=on("function"),Ms=on("number"),an=e=>e!==null&&typeof e=="object",Ui=e=>e===!0||e===!1,Kt=e=>{if(sn(e)!=="object")return!1;const t=ar(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Bi=we("Date"),Wi=we("File"),Vi=we("Blob"),zi=we("FileList"),Hi=e=>an(e)&&ye(e.pipe),qi=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ye(e.append)&&((t=sn(e))==="formdata"||t==="object"&&ye(e.toString)&&e.toString()==="[object FormData]"))},Yi=we("URLSearchParams"),Ji=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ct(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),ht(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let u;for(r=0;r<a;r++)u=i[r],t.call(null,e[u],u,e)}}function Fs(e,t){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 Ns=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Ls=e=>!Rt(e)&&e!==Ns;function Vn(){const{caseless:e}=Ls(this)&&this||{},t={},n=(r,s)=>{const i=e&&Fs(t,s)||s;Kt(t[i])&&Kt(r)?t[i]=Vn(t[i],r):Kt(r)?t[i]=Vn({},r):ht(r)?t[i]=r.slice():t[i]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&Ct(arguments[r],n);return t}const Ki=(e,t,n,{allOwnKeys:r}={})=>(Ct(t,(s,i)=>{n&&ye(s)?e[i]=Ds(s,n):e[i]=s},{allOwnKeys:r}),e),Gi=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Xi=(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)},Zi=(e,t,n,r)=>{let s,i,a;const u={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)a=s[i],(!r||r(a,e,t))&&!u[a]&&(t[a]=e[a],u[a]=!0);e=n!==!1&&ar(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Qi=(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},ea=e=>{if(!e)return null;if(ht(e))return e;let t=e.length;if(!Ms(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},ta=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ar(Uint8Array)),na=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},ra=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},sa=we("HTMLFormElement"),oa=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Qr=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),ia=we("RegExp"),Us=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Ct(n,(s,i)=>{let a;(a=t(s,i,e))!==!1&&(r[i]=a||s)}),Object.defineProperties(e,r)},aa=e=>{Us(e,(t,n)=>{if(ye(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(ye(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+"'")})}})},ua=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return ht(e)?r(e):r(String(e).split(t)),n},ca=()=>{},fa=(e,t)=>(e=+e,Number.isFinite(e)?e:t),$n="abcdefghijklmnopqrstuvwxyz",es="0123456789",Bs={DIGIT:es,ALPHA:$n,ALPHA_DIGIT:$n+$n.toUpperCase()+es},la=(e=16,t=Bs.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function da(e){return!!(e&&ye(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const ha=e=>{const t=new Array(10),n=(r,s)=>{if(an(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const i=ht(r)?[]:{};return Ct(r,(a,u)=>{const d=n(a,s+1);!Rt(d)&&(i[u]=d)}),t[s]=void 0,i}}return r};return n(e,0)},pa=we("AsyncFunction"),ya=e=>e&&(an(e)||ye(e))&&ye(e.then)&&ye(e.catch),g={isArray:ht,isArrayBuffer:$s,isBuffer:Fi,isFormData:qi,isArrayBufferView:Ni,isString:Li,isNumber:Ms,isBoolean:Ui,isObject:an,isPlainObject:Kt,isUndefined:Rt,isDate:Bi,isFile:Wi,isBlob:Vi,isRegExp:ia,isFunction:ye,isStream:Hi,isURLSearchParams:Yi,isTypedArray:ta,isFileList:zi,forEach:Ct,merge:Vn,extend:Ki,trim:Ji,stripBOM:Gi,inherits:Xi,toFlatObject:Zi,kindOf:sn,kindOfTest:we,endsWith:Qi,toArray:ea,forEachEntry:na,matchAll:ra,isHTMLForm:sa,hasOwnProperty:Qr,hasOwnProp:Qr,reduceDescriptors:Us,freezeMethods:aa,toObjectSet:ua,toCamelCase:oa,noop:ca,toFiniteNumber:fa,findKey:Fs,global:Ns,isContextDefined:Ls,ALPHABET:Bs,generateString:la,isSpecCompliantForm:da,toJSONObject:ha,isAsyncFn:pa,isThenable:ya};function B(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)}g.inherits(B,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:g.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Ws=B.prototype,Vs={};["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=>{Vs[e]={value:e}});Object.defineProperties(B,Vs);Object.defineProperty(Ws,"isAxiosError",{value:!0});B.from=(e,t,n,r,s,i)=>{const a=Object.create(Ws);return g.toFlatObject(e,a,function(d){return d!==Error.prototype},u=>u!=="isAxiosError"),B.call(a,e.message,t,n,r,s),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};const ma=null;function zn(e){return g.isPlainObject(e)||g.isArray(e)}function zs(e){return g.endsWith(e,"[]")?e.slice(0,-2):e}function ts(e,t,n){return e?e.concat(t).map(function(s,i){return s=zs(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function va(e){return g.isArray(e)&&!e.some(zn)}const ga=g.toFlatObject(g,{},null,function(t){return/^is[A-Z]/.test(t)});function un(e,t,n){if(!g.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=g.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(O,D){return!g.isUndefined(D[O])});const r=n.metaTokens,s=n.visitor||y,i=n.dots,a=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&g.isSpecCompliantForm(t);if(!g.isFunction(s))throw new TypeError("visitor must be a function");function l(_){if(_===null)return"";if(g.isDate(_))return _.toISOString();if(!d&&g.isBlob(_))throw new B("Blob is not supported. Use a Buffer instead.");return g.isArrayBuffer(_)||g.isTypedArray(_)?d&&typeof Blob=="function"?new Blob([_]):Buffer.from(_):_}function y(_,O,D){let L=_;if(_&&!D&&typeof _=="object"){if(g.endsWith(O,"{}"))O=r?O:O.slice(0,-2),_=JSON.stringify(_);else if(g.isArray(_)&&va(_)||(g.isFileList(_)||g.endsWith(O,"[]"))&&(L=g.toArray(_)))return O=zs(O),L.forEach(function(he,pe){!(g.isUndefined(he)||he===null)&&t.append(a===!0?ts([O],pe,i):a===null?O:O+"[]",l(he))}),!1}return zn(_)?!0:(t.append(ts(D,O,i),l(_)),!1)}const h=[],E=Object.assign(ga,{defaultVisitor:y,convertValue:l,isVisitable:zn});function S(_,O){if(!g.isUndefined(_)){if(h.indexOf(_)!==-1)throw Error("Circular reference detected in "+O.join("."));h.push(_),g.forEach(_,function(L,V){(!(g.isUndefined(L)||L===null)&&s.call(t,L,g.isString(V)?V.trim():V,O,E))===!0&&S(L,O?O.concat(V):[V])}),h.pop()}}if(!g.isObject(e))throw new TypeError("data must be an object");return S(e),t}function ns(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function ur(e,t){this._pairs=[],e&&un(e,this,t)}const Hs=ur.prototype;Hs.append=function(t,n){this._pairs.push([t,n])};Hs.toString=function(t){const n=t?function(r){return t.call(this,r,ns)}:ns;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function _a(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function qs(e,t,n){if(!t)return e;const r=n&&n.encode||_a,s=n&&n.serialize;let i;if(s?i=s(t,n):i=g.isURLSearchParams(t)?t.toString():new ur(t,n).toString(r),i){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ea{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){g.forEach(this.handlers,function(r){r!==null&&t(r)})}}const rs=Ea,Ys={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ba=typeof URLSearchParams<"u"?URLSearchParams:ur,Sa=typeof FormData<"u"?FormData:null,wa=typeof Blob<"u"?Blob:null,Ta=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Ra=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),_e={isBrowser:!0,classes:{URLSearchParams:ba,FormData:Sa,Blob:wa},isStandardBrowserEnv:Ta,isStandardBrowserWebWorkerEnv:Ra,protocols:["http","https","file","blob","url","data"]};function Oa(e,t){return un(e,new _e.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,i){return _e.isNode&&g.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function Ca(e){return g.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Aa(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 Js(e){function t(n,r,s,i){let a=n[i++];const u=Number.isFinite(+a),d=i>=n.length;return a=!a&&g.isArray(s)?s.length:a,d?(g.hasOwnProp(s,a)?s[a]=[s[a],r]:s[a]=r,!u):((!s[a]||!g.isObject(s[a]))&&(s[a]=[]),t(n,r,s[a],i)&&g.isArray(s[a])&&(s[a]=Aa(s[a])),!u)}if(g.isFormData(e)&&g.isFunction(e.entries)){const n={};return g.forEachEntry(e,(r,s)=>{t(Ca(r),s,n,0)}),n}return null}function ka(e,t,n){if(g.isString(e))try{return(t||JSON.parse)(e),g.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const cr={transitional:Ys,adapter:_e.isNode?"http":"xhr",transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=g.isObject(t);if(i&&g.isHTMLForm(t)&&(t=new FormData(t)),g.isFormData(t))return s&&s?JSON.stringify(Js(t)):t;if(g.isArrayBuffer(t)||g.isBuffer(t)||g.isStream(t)||g.isFile(t)||g.isBlob(t))return t;if(g.isArrayBufferView(t))return t.buffer;if(g.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Oa(t,this.formSerializer).toString();if((u=g.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return un(u?{"files[]":t}:t,d&&new d,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),ka(t)):t}],transformResponse:[function(t){const n=this.transitional||cr.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(t&&g.isString(t)&&(r&&!this.responseType||s)){const a=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(u){if(a)throw u.name==="SyntaxError"?B.from(u,B.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_e.classes.FormData,Blob:_e.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};g.forEach(["delete","get","head","post","put","patch"],e=>{cr.headers[e]={}});const fr=cr,xa=g.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"]),Pa=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
4
|
+
`).forEach(function(a){s=a.indexOf(":"),n=a.substring(0,s).trim().toLowerCase(),r=a.substring(s+1).trim(),!(!n||t[n]&&xa[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},ss=Symbol("internals");function Et(e){return e&&String(e).trim().toLowerCase()}function Gt(e){return e===!1||e==null?e:g.isArray(e)?e.map(Gt):String(e)}function Ia(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 ja=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Mn(e,t,n,r,s){if(g.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!g.isString(t)){if(g.isString(r))return t.indexOf(r)!==-1;if(g.isRegExp(r))return r.test(t)}}function Da(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function $a(e,t){const n=g.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,a){return this[r].call(this,t,s,i,a)},configurable:!0})})}class cn{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(u,d,l){const y=Et(d);if(!y)throw new Error("header name must be a non-empty string");const h=g.findKey(s,y);(!h||s[h]===void 0||l===!0||l===void 0&&s[h]!==!1)&&(s[h||d]=Gt(u))}const a=(u,d)=>g.forEach(u,(l,y)=>i(l,y,d));return g.isPlainObject(t)||t instanceof this.constructor?a(t,n):g.isString(t)&&(t=t.trim())&&!ja(t)?a(Pa(t),n):t!=null&&i(n,t,r),this}get(t,n){if(t=Et(t),t){const r=g.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Ia(s);if(g.isFunction(n))return n.call(this,s,r);if(g.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Et(t),t){const r=g.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Mn(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(a){if(a=Et(a),a){const u=g.findKey(r,a);u&&(!n||Mn(r,r[u],u,n))&&(delete r[u],s=!0)}}return g.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||Mn(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return g.forEach(this,(s,i)=>{const a=g.findKey(r,i);if(a){n[a]=Gt(s),delete n[i];return}const u=t?Da(i):String(i).trim();u!==i&&delete n[i],n[u]=Gt(s),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return g.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&g.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(`
|
|
5
|
+
`)}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[ss]=this[ss]={accessors:{}}).accessors,s=this.prototype;function i(a){const u=Et(a);r[u]||($a(s,a),r[u]=!0)}return g.isArray(t)?t.forEach(i):i(t),this}}cn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);g.reduceDescriptors(cn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});g.freezeMethods(cn);const Ce=cn;function Fn(e,t){const n=this||fr,r=t||n,s=Ce.from(r.headers);let i=r.data;return g.forEach(e,function(u){i=u.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function Ks(e){return!!(e&&e.__CANCEL__)}function At(e,t,n){B.call(this,e??"canceled",B.ERR_CANCELED,t,n),this.name="CanceledError"}g.inherits(At,B,{__CANCEL__:!0});function Ma(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new B("Request failed with status code "+n.status,[B.ERR_BAD_REQUEST,B.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const Fa=_e.isStandardBrowserEnv?function(){return{write:function(n,r,s,i,a,u){const d=[];d.push(n+"="+encodeURIComponent(r)),g.isNumber(s)&&d.push("expires="+new Date(s).toGMTString()),g.isString(i)&&d.push("path="+i),g.isString(a)&&d.push("domain="+a),u===!0&&d.push("secure"),document.cookie=d.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Na(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function La(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function Gs(e,t){return e&&!Na(t)?La(e,t):t}const Ua=_e.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(i){let a=i;return t&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(a){const u=g.isString(a)?s(a):a;return u.protocol===r.protocol&&u.host===r.host}}():function(){return function(){return!0}}();function Ba(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Wa(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,a;return t=t!==void 0?t:1e3,function(d){const l=Date.now(),y=r[i];a||(a=l),n[s]=d,r[s]=l;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),l-a<t)return;const S=y&&l-y;return S?Math.round(E*1e3/S):void 0}}function os(e,t){let n=0;const r=Wa(50,250);return s=>{const i=s.loaded,a=s.lengthComputable?s.total:void 0,u=i-n,d=r(u),l=i<=a;n=i;const y={loaded:i,total:a,progress:a?i/a:void 0,bytes:u,rate:d||void 0,estimated:d&&a&&l?(a-i)/d:void 0,event:s};y[t?"download":"upload"]=!0,e(y)}}const Va=typeof XMLHttpRequest<"u",za=Va&&function(e){return new Promise(function(n,r){let s=e.data;const i=Ce.from(e.headers).normalize(),a=e.responseType;let u;function d(){e.cancelToken&&e.cancelToken.unsubscribe(u),e.signal&&e.signal.removeEventListener("abort",u)}g.isFormData(s)&&(_e.isStandardBrowserEnv||_e.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let l=new XMLHttpRequest;if(e.auth){const S=e.auth.username||"",_=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(S+":"+_))}const y=Gs(e.baseURL,e.url);l.open(e.method.toUpperCase(),qs(y,e.params,e.paramsSerializer),!0),l.timeout=e.timeout;function h(){if(!l)return;const S=Ce.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),O={data:!a||a==="text"||a==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:S,config:e,request:l};Ma(function(L){n(L),d()},function(L){r(L),d()},O),l=null}if("onloadend"in l?l.onloadend=h:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(h)},l.onabort=function(){l&&(r(new B("Request aborted",B.ECONNABORTED,e,l)),l=null)},l.onerror=function(){r(new B("Network Error",B.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let _=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const O=e.transitional||Ys;e.timeoutErrorMessage&&(_=e.timeoutErrorMessage),r(new B(_,O.clarifyTimeoutError?B.ETIMEDOUT:B.ECONNABORTED,e,l)),l=null},_e.isStandardBrowserEnv){const S=(e.withCredentials||Ua(y))&&e.xsrfCookieName&&Fa.read(e.xsrfCookieName);S&&i.set(e.xsrfHeaderName,S)}s===void 0&&i.setContentType(null),"setRequestHeader"in l&&g.forEach(i.toJSON(),function(_,O){l.setRequestHeader(O,_)}),g.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),a&&a!=="json"&&(l.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&l.addEventListener("progress",os(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",os(e.onUploadProgress)),(e.cancelToken||e.signal)&&(u=S=>{l&&(r(!S||S.type?new At(null,e,l):S),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(u),e.signal&&(e.signal.aborted?u():e.signal.addEventListener("abort",u)));const E=Ba(y);if(E&&_e.protocols.indexOf(E)===-1){r(new B("Unsupported protocol "+E+":",B.ERR_BAD_REQUEST,e));return}l.send(s||null)})},Xt={http:ma,xhr:za};g.forEach(Xt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Xs={getAdapter:e=>{e=g.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let s=0;s<t&&(n=e[s],!(r=g.isString(n)?Xt[n.toLowerCase()]:n));s++);if(!r)throw r===!1?new B(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(g.hasOwnProp(Xt,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`);if(!g.isFunction(r))throw new TypeError("adapter is not a function");return r},adapters:Xt};function Nn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new At(null,e)}function is(e){return Nn(e),e.headers=Ce.from(e.headers),e.data=Fn.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Xs.getAdapter(e.adapter||fr.adapter)(e).then(function(r){return Nn(e),r.data=Fn.call(e,e.transformResponse,r),r.headers=Ce.from(r.headers),r},function(r){return Ks(r)||(Nn(e),r&&r.response&&(r.response.data=Fn.call(e,e.transformResponse,r.response),r.response.headers=Ce.from(r.response.headers))),Promise.reject(r)})}const as=e=>e instanceof Ce?e.toJSON():e;function dt(e,t){t=t||{};const n={};function r(l,y,h){return g.isPlainObject(l)&&g.isPlainObject(y)?g.merge.call({caseless:h},l,y):g.isPlainObject(y)?g.merge({},y):g.isArray(y)?y.slice():y}function s(l,y,h){if(g.isUndefined(y)){if(!g.isUndefined(l))return r(void 0,l,h)}else return r(l,y,h)}function i(l,y){if(!g.isUndefined(y))return r(void 0,y)}function a(l,y){if(g.isUndefined(y)){if(!g.isUndefined(l))return r(void 0,l)}else return r(void 0,y)}function u(l,y,h){if(h in t)return r(l,y);if(h in e)return r(void 0,l)}const d={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u,headers:(l,y)=>s(as(l),as(y),!0)};return g.forEach(Object.keys(Object.assign({},e,t)),function(y){const h=d[y]||s,E=h(e[y],t[y],y);g.isUndefined(E)&&h!==u||(n[y]=E)}),n}const Zs="1.5.0",lr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{lr[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const us={};lr.transitional=function(t,n,r){function s(i,a){return"[Axios v"+Zs+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,u)=>{if(t===!1)throw new B(s(a," has been removed"+(n?" in "+n:"")),B.ERR_DEPRECATED);return n&&!us[a]&&(us[a]=!0,console.warn(s(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,a,u):!0}};function Ha(e,t,n){if(typeof e!="object")throw new B("options must be an object",B.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],a=t[i];if(a){const u=e[i],d=u===void 0||a(u,i,e);if(d!==!0)throw new B("option "+i+" must be "+d,B.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new B("Unknown option "+i,B.ERR_BAD_OPTION)}}const Hn={assertOptions:Ha,validators:lr},De=Hn.validators;class nn{constructor(t){this.defaults=t,this.interceptors={request:new rs,response:new rs}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=dt(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&Hn.assertOptions(r,{silentJSONParsing:De.transitional(De.boolean),forcedJSONParsing:De.transitional(De.boolean),clarifyTimeoutError:De.transitional(De.boolean)},!1),s!=null&&(g.isFunction(s)?n.paramsSerializer={serialize:s}:Hn.assertOptions(s,{encode:De.function,serialize:De.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&g.merge(i.common,i[n.method]);i&&g.forEach(["delete","get","head","post","put","patch","common"],_=>{delete i[_]}),n.headers=Ce.concat(a,i);const u=[];let d=!0;this.interceptors.request.forEach(function(O){typeof O.runWhen=="function"&&O.runWhen(n)===!1||(d=d&&O.synchronous,u.unshift(O.fulfilled,O.rejected))});const l=[];this.interceptors.response.forEach(function(O){l.push(O.fulfilled,O.rejected)});let y,h=0,E;if(!d){const _=[is.bind(this),void 0];for(_.unshift.apply(_,u),_.push.apply(_,l),E=_.length,y=Promise.resolve(n);h<E;)y=y.then(_[h++],_[h++]);return y}E=u.length;let S=n;for(h=0;h<E;){const _=u[h++],O=u[h++];try{S=_(S)}catch(D){O.call(this,D);break}}try{y=is.call(this,S)}catch(_){return Promise.reject(_)}for(h=0,E=l.length;h<E;)y=y.then(l[h++],l[h++]);return y}getUri(t){t=dt(this.defaults,t);const n=Gs(t.baseURL,t.url);return qs(n,t.params,t.paramsSerializer)}}g.forEach(["delete","get","head","options"],function(t){nn.prototype[t]=function(n,r){return this.request(dt(r||{},{method:t,url:n,data:(r||{}).data}))}});g.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,u){return this.request(dt(u||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}nn.prototype[t]=n(),nn.prototype[t+"Form"]=n(!0)});const Zt=nn;class dr{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 a=new Promise(u=>{r.subscribe(u),i=u}).then(s);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,u){r.reason||(r.reason=new At(i,a,u),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)}static source(){let t;return{token:new dr(function(s){t=s}),cancel:t}}}const qa=dr;function Ya(e){return function(n){return e.apply(null,n)}}function Ja(e){return g.isObject(e)&&e.isAxiosError===!0}const qn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(qn).forEach(([e,t])=>{qn[t]=e});const Ka=qn;function Qs(e){const t=new Zt(e),n=Ds(Zt.prototype.request,t);return g.extend(n,Zt.prototype,t,{allOwnKeys:!0}),g.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Qs(dt(e,s))},n}const re=Qs(fr);re.Axios=Zt;re.CanceledError=At;re.CancelToken=qa;re.isCancel=Ks;re.VERSION=Zs;re.toFormData=un;re.AxiosError=B;re.Cancel=re.CanceledError;re.all=function(t){return Promise.all(t)};re.spread=Ya;re.isAxiosError=Ja;re.mergeConfig=dt;re.AxiosHeaders=Ce;re.formToJSON=e=>Js(g.isHTMLForm(e)?new FormData(e):e);re.getAdapter=Xs.getAdapter;re.HttpStatusCode=Ka;re.default=re;const Ga=re;async function cs(e,t){const n=await fetch(e,t);return n.status===200?n.json():Promise.resolve({message:n.statusText,success:!1})}const Yn=ir({types:{context:{},events:{},input:{}},actions:{setUserContext:ge(({context:e,event:t})=>{if(!t.type.includes("xstate.done.actor"))return e;const n=t;return n.output.type!=="AUTHENTICATE_SUCCESS"?e:{accessToken:n.output.accessToken,ignoreRefreshToken:!1}}),unsetUserContext:ge(()=>({user:null,accessToken:"",refreshToken:"",ignoreRefreshToken:!1})),setAccessToken:ge(({context:e,event:t})=>{if(!t.type.includes("xstate.done.actor"))return e;const n=t;return n.output.type!=="REFRESH_TOKEN_SUCCESS"?e:{accessToken:n.output.accessToken,ignoreRefreshToken:!1}}),unsetRefreshToken:ge(()=>({refreshToken:""})),setIgnoreRefreshToken:ge(()=>({ignoreRefreshToken:!0})),addError:ge(({context:e,event:t})=>{if(!t.type.includes("xstate.error.actor"))return e;const n=t;return{errors:[...e.errors,String(n.error).replace("Error: ","")]}}),clearErrors:ge(()=>({errors:[]}))},actors:{refreshAccessToken:Dn(async({input:e})=>{let t;if(typeof window>"u"){if(e.context.refreshToken==="")throw new Error("Unauthorized.");try{const n=await Ga.post(e.context.endpoints.ssrRefresh,{grant_type:"refresh_token"},{headers:{Cookie:`refresh_token=${e.context.refreshToken}`,"Content-Type":"application/json","clicktap-scope":"view","clicktap-scope-id":"default"},withCredentials:!0}),{data:r}=n;if(typeof r.accessToken>"u")throw new Error("Unauthorized.");return{type:"REFRESH_TOKEN_SUCCESS",accessToken:r.accessToken}}catch{throw new Error("Could not complete refresh request (server)")}}else{t=await cs(e.context.endpoints.refresh,{method:"POST",mode:"cors",credentials:"include",headers:{"Content-Type":"application/json","clicktap-scope":"view","clicktap-scope-id":"default"},body:JSON.stringify({grant_type:"refresh_token"}).toString()});const n=t;if(typeof n.accessToken>"u")throw new Error("Unauthorized.");return{type:"REFRESH_TOKEN_SUCCESS",accessToken:n.accessToken}}}),authenticate:Dn(async({input:e})=>{var r;const n=await cs(e.context.endpoints.login,{method:"POST",mode:"cors",credentials:"include",headers:{"Content-Type":"application/json","clicktap-scope":"view","clicktap-scope-id":"default"},body:JSON.stringify({username:e.username,password:e.password}).toString()});if(!n.success)throw new Error(((r=n.message)==null?void 0:r.toString())??"Sign in failed. Please try again.");return{type:"AUTHENTICATE_SUCCESS",accessToken:n.accessToken}}),unauthenticate:Dn(async({input:e})=>(await fetch(e.context.endpoints.logout,{method:"POST",mode:"cors",credentials:"include",headers:{"clicktap-scope":"view","clicktap-scope-id":"default"}}),{type:"UNAUTHENTICATE"}))}}).createMachine({id:"auth",context:({input:e})=>{var t,n;return{user:null,accessToken:"",refreshToken:((t=e==null?void 0:e.initialContext)==null?void 0:t.refreshToken)??"",ignoreRefreshToken:!1,endpoints:((n=e==null?void 0:e.initialContext)==null?void 0:n.endpoints)??{login:"",logout:"",refresh:"",ssrRefresh:""},errors:[]}},initial:"refreshing",states:{authenticating:{invoke:{src:"authenticate",input:({context:e,event:t})=>t.type!=="LOGIN"?{context:e,username:"",password:""}:{context:e,username:t.username,password:t.password},onDone:[{actions:"setUserContext",target:"loggedIn"}],onError:[{actions:"addError",target:"loggedOut"}]}},unauthenticating:{invoke:{src:"unauthenticate",input:({context:e})=>({context:e}),onDone:[{actions:"unsetUserContext",target:"loggedOut"}],onError:[{actions:["unsetUserContext","setIgnoreRefreshToken"],target:"loggedOut"}]}},refreshing:{invoke:{src:"refreshAccessToken",input:({context:e})=>({context:e}),onDone:[{actions:["unsetRefreshToken","setAccessToken"],target:"loggedIn"}],onError:[{actions:"unsetRefreshToken",target:"unauthenticating"}]}},loggedOut:{on:{LOGIN:{target:"authenticating"},CLEAR_ERRORS:{actions:"clearErrors"}}},loggedIn:{after:{84e4:{guard:()=>typeof window<"u",target:"refreshing"}},on:{LOGOUT:{target:"unauthenticating"},CLEAR_ERRORS:{actions:"clearErrors"}}}}});var Jn={exports:{}},bt={},Kn={exports:{}},$={};/**
|
|
6
6
|
* @license React
|
|
7
7
|
* react.production.min.js
|
|
8
8
|
*
|
|
@@ -10,7 +10,7 @@ ${m.message}`)}if(d){s.push(...c.actions),i=c;break}}return i?[i]:void 0}get eve
|
|
|
10
10
|
*
|
|
11
11
|
* This source code is licensed under the MIT license found in the
|
|
12
12
|
* LICENSE file in the root directory of this source tree.
|
|
13
|
-
*/var fs;function Xa(){if(fs)return $;fs=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),a=Symbol.for("react.context"),
|
|
13
|
+
*/var fs;function Xa(){if(fs)return $;fs=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),h=Symbol.iterator;function E(p){return p===null||typeof p!="object"?null:(p=h&&p[h]||p["@@iterator"],typeof p=="function"?p:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,O={};function D(p,T,I){this.props=p,this.context=T,this.refs=O,this.updater=I||S}D.prototype.isReactComponent={},D.prototype.setState=function(p,T){if(typeof p!="object"&&typeof p!="function"&&p!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,p,T,"setState")},D.prototype.forceUpdate=function(p){this.updater.enqueueForceUpdate(this,p,"forceUpdate")};function L(){}L.prototype=D.prototype;function V(p,T,I){this.props=p,this.context=T,this.refs=O,this.updater=I||S}var he=V.prototype=new L;he.constructor=V,_(he,D.prototype),he.isPureReactComponent=!0;var pe=Array.isArray,te=Object.prototype.hasOwnProperty,ue={current:null},Ee={key:!0,ref:!0,__self:!0,__source:!0};function Te(p,T,I){var W,M={},J=null,K=null;if(T!=null)for(W in T.ref!==void 0&&(K=T.ref),T.key!==void 0&&(J=""+T.key),T)te.call(T,W)&&!Ee.hasOwnProperty(W)&&(M[W]=T[W]);var q=arguments.length-2;if(q===1)M.children=I;else if(1<q){for(var z=Array(q),se=0;se<q;se++)z[se]=arguments[se+2];M.children=z}if(p&&p.defaultProps)for(W in q=p.defaultProps,q)M[W]===void 0&&(M[W]=q[W]);return{$$typeof:e,type:p,key:J,ref:K,props:M,_owner:ue.current}}function Fe(p,T){return{$$typeof:e,type:p.type,key:T,ref:p.ref,props:p.props,_owner:p._owner}}function Ne(p){return typeof p=="object"&&p!==null&&p.$$typeof===e}function pt(p){var T={"=":"=0",":":"=2"};return"$"+p.replace(/[=:]/g,function(I){return T[I]})}var Le=/\/+/g;function ce(p,T){return typeof p=="object"&&p!==null&&p.key!=null?pt(""+p.key):T.toString(36)}function le(p,T,I,W,M){var J=typeof p;(J==="undefined"||J==="boolean")&&(p=null);var K=!1;if(p===null)K=!0;else switch(J){case"string":case"number":K=!0;break;case"object":switch(p.$$typeof){case e:case t:K=!0}}if(K)return K=p,M=M(K),p=W===""?"."+ce(K,0):W,pe(M)?(I="",p!=null&&(I=p.replace(Le,"$&/")+"/"),le(M,T,I,"",function(se){return se})):M!=null&&(Ne(M)&&(M=Fe(M,I+(!M.key||K&&K.key===M.key?"":(""+M.key).replace(Le,"$&/")+"/")+p)),T.push(M)),1;if(K=0,W=W===""?".":W+":",pe(p))for(var q=0;q<p.length;q++){J=p[q];var z=W+ce(J,q);K+=le(J,T,I,z,M)}else if(z=E(p),typeof z=="function")for(p=z.call(p),q=0;!(J=p.next()).done;)J=J.value,z=W+ce(J,q++),K+=le(J,T,I,z,M);else if(J==="object")throw T=String(p),Error("Objects are not valid as a React child (found: "+(T==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":T)+"). If you meant to render a collection of children, use an array instead.");return K}function oe(p,T,I){if(p==null)return p;var W=[],M=0;return le(p,W,"","",function(J){return T.call(I,J,M++)}),W}function me(p){if(p._status===-1){var T=p._result;T=T(),T.then(function(I){(p._status===0||p._status===-1)&&(p._status=1,p._result=I)},function(I){(p._status===0||p._status===-1)&&(p._status=2,p._result=I)}),p._status===-1&&(p._status=0,p._result=T)}if(p._status===1)return p._result.default;throw p._result}var k={current:null},be={transition:null},Ue={ReactCurrentDispatcher:k,ReactCurrentBatchConfig:be,ReactCurrentOwner:ue};return $.Children={map:oe,forEach:function(p,T,I){oe(p,function(){T.apply(this,arguments)},I)},count:function(p){var T=0;return oe(p,function(){T++}),T},toArray:function(p){return oe(p,function(T){return T})||[]},only:function(p){if(!Ne(p))throw Error("React.Children.only expected to receive a single React element child.");return p}},$.Component=D,$.Fragment=n,$.Profiler=s,$.PureComponent=V,$.StrictMode=r,$.Suspense=d,$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ue,$.cloneElement=function(p,T,I){if(p==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+p+".");var W=_({},p.props),M=p.key,J=p.ref,K=p._owner;if(T!=null){if(T.ref!==void 0&&(J=T.ref,K=ue.current),T.key!==void 0&&(M=""+T.key),p.type&&p.type.defaultProps)var q=p.type.defaultProps;for(z in T)te.call(T,z)&&!Ee.hasOwnProperty(z)&&(W[z]=T[z]===void 0&&q!==void 0?q[z]:T[z])}var z=arguments.length-2;if(z===1)W.children=I;else if(1<z){q=Array(z);for(var se=0;se<z;se++)q[se]=arguments[se+2];W.children=q}return{$$typeof:e,type:p.type,key:M,ref:J,props:W,_owner:K}},$.createContext=function(p){return p={$$typeof:a,_currentValue:p,_currentValue2:p,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},p.Provider={$$typeof:i,_context:p},p.Consumer=p},$.createElement=Te,$.createFactory=function(p){var T=Te.bind(null,p);return T.type=p,T},$.createRef=function(){return{current:null}},$.forwardRef=function(p){return{$$typeof:u,render:p}},$.isValidElement=Ne,$.lazy=function(p){return{$$typeof:y,_payload:{_status:-1,_result:p},_init:me}},$.memo=function(p,T){return{$$typeof:l,type:p,compare:T===void 0?null:T}},$.startTransition=function(p){var T=be.transition;be.transition={};try{p()}finally{be.transition=T}},$.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},$.useCallback=function(p,T){return k.current.useCallback(p,T)},$.useContext=function(p){return k.current.useContext(p)},$.useDebugValue=function(){},$.useDeferredValue=function(p){return k.current.useDeferredValue(p)},$.useEffect=function(p,T){return k.current.useEffect(p,T)},$.useId=function(){return k.current.useId()},$.useImperativeHandle=function(p,T,I){return k.current.useImperativeHandle(p,T,I)},$.useInsertionEffect=function(p,T){return k.current.useInsertionEffect(p,T)},$.useLayoutEffect=function(p,T){return k.current.useLayoutEffect(p,T)},$.useMemo=function(p,T){return k.current.useMemo(p,T)},$.useReducer=function(p,T,I){return k.current.useReducer(p,T,I)},$.useRef=function(p){return k.current.useRef(p)},$.useState=function(p){return k.current.useState(p)},$.useSyncExternalStore=function(p,T,I){return k.current.useSyncExternalStore(p,T,I)},$.useTransition=function(){return k.current.useTransition()},$.version="18.2.0",$}var wt={exports:{}};/**
|
|
14
14
|
* @license React
|
|
15
15
|
* react.development.js
|
|
16
16
|
*
|
|
@@ -18,29 +18,29 @@ ${m.message}`)}if(d){s.push(...c.actions),i=c;break}}return i?[i]:void 0}get eve
|
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the MIT license found in the
|
|
20
20
|
* LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/wt.exports;var ls;function Za(){return ls||(ls=1,function(e,t){process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n="18.2.0",r=Symbol.for("react.element"),s=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),l=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),j=Symbol.iterator,J="@@iterator";function W(o){if(o===null||typeof o!="object")return null;var u=j&&o[j]||o[J];return typeof u=="function"?u:null}var he={current:null},pe={transition:null},te={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},ue={current:null},Ee={},Te=null;function Me(o){Te=o}Ee.setExtraStackFrame=function(o){Te=o},Ee.getCurrentStack=null,Ee.getStackAddendum=function(){var o="";Te&&(o+=Te);var u=Ee.getCurrentStack;return u&&(o+=u()||""),o};var Ne=!1,pt=!1,Ue=!1,ce=!1,le=!1,oe={ReactCurrentDispatcher:he,ReactCurrentBatchConfig:pe,ReactCurrentOwner:ue};oe.ReactDebugCurrentFrame=Ee,oe.ReactCurrentActQueue=te;function me(o){{for(var u=arguments.length,y=new Array(u>1?u-1:0),v=1;v<u;v++)y[v-1]=arguments[v];be("warn",o,y)}}function k(o){{for(var u=arguments.length,y=new Array(u>1?u-1:0),v=1;v<u;v++)y[v-1]=arguments[v];be("error",o,y)}}function be(o,u,y){{var v=oe.ReactDebugCurrentFrame,S=v.getStackAddendum();S!==""&&(u+="%s",y=y.concat([S]));var x=y.map(function(A){return String(A)});x.unshift("Warning: "+u),Function.prototype.apply.call(console[o],console,x)}}var Le={};function p(o,u){{var y=o.constructor,v=y&&(y.displayName||y.name)||"ReactClass",S=v+"."+u;if(Le[S])return;k("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",u,v),Le[S]=!0}}var T={isMounted:function(o){return!1},enqueueForceUpdate:function(o,u,y){p(o,"forceUpdate")},enqueueReplaceState:function(o,u,y,v){p(o,"replaceState")},enqueueSetState:function(o,u,y,v){p(o,"setState")}},I=Object.assign,B={};Object.freeze(B);function F(o,u,y){this.props=o,this.context=u,this.refs=B,this.updater=y||T}F.prototype.isReactComponent={},F.prototype.setState=function(o,u){if(typeof o!="object"&&typeof o!="function"&&o!=null)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,o,u,"setState")},F.prototype.forceUpdate=function(o){this.updater.enqueueForceUpdate(this,o,"forceUpdate")};{var Y={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},K=function(o,u){Object.defineProperty(F.prototype,o,{get:function(){me("%s(...) is deprecated in plain JavaScript React classes. %s",u[0],u[1])}})};for(var H in Y)Y.hasOwnProperty(H)&&K(H,Y[H])}function V(){}V.prototype=F.prototype;function se(o,u,y){this.props=o,this.context=u,this.refs=B,this.updater=y||T}var ke=se.prototype=new V;ke.constructor=se,I(ke,F.prototype),ke.isPureReactComponent=!0;function fn(){var o={current:null};return Object.seal(o),o}var kt=Array.isArray;function Ze(o){return kt(o)}function ln(o){{var u=typeof Symbol=="function"&&Symbol.toStringTag,y=u&&o[Symbol.toStringTag]||o.constructor.name||"Object";return y}}function Qe(o){try{return Be(o),!1}catch{return!0}}function Be(o){return""+o}function We(o){if(Qe(o))return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ln(o)),Be(o)}function xt(o,u,y){var v=o.displayName;if(v)return v;var S=u.displayName||u.name||"";return S!==""?y+"("+S+")":y}function Ve(o){return o.displayName||"Context"}function Se(o){if(o==null)return null;if(typeof o.tag=="number"&&k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case i:return"Fragment";case s:return"Portal";case c:return"Profiler";case a:return"StrictMode";case m:return"Suspense";case E:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case l:var u=o;return Ve(u)+".Consumer";case h:var y=o;return Ve(y._context)+".Provider";case d:return xt(o,o.render,"ForwardRef");case w:var v=o.displayName||null;return v!==null?v:Se(o.type)||"Memo";case b:{var S=o,x=S._payload,A=S._init;try{return Se(A(x))}catch{return null}}}return null}var ze=Object.prototype.hasOwnProperty,et={key:!0,ref:!0,__self:!0,__source:!0},Pt,It,tt;tt={};function yt(o){if(ze.call(o,"ref")){var u=Object.getOwnPropertyDescriptor(o,"ref").get;if(u&&u.isReactWarning)return!1}return o.ref!==void 0}function xe(o){if(ze.call(o,"key")){var u=Object.getOwnPropertyDescriptor(o,"key").get;if(u&&u.isReactWarning)return!1}return o.key!==void 0}function dn(o,u){var y=function(){Pt||(Pt=!0,k("%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://reactjs.org/link/special-props)",u))};y.isReactWarning=!0,Object.defineProperty(o,"key",{get:y,configurable:!0})}function jt(o,u){var y=function(){It||(It=!0,k("%s: `ref` 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://reactjs.org/link/special-props)",u))};y.isReactWarning=!0,Object.defineProperty(o,"ref",{get:y,configurable:!0})}function Dt(o){if(typeof o.ref=="string"&&ue.current&&o.__self&&ue.current.stateNode!==o.__self){var u=Se(ue.current.type);tt[u]||(k('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',u,o.ref),tt[u]=!0)}}var He=function(o,u,y,v,S,x,A){var P={$$typeof:r,type:o,key:u,ref:y,props:A,_owner:x};return P._store={},Object.defineProperty(P._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(P,"_self",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.defineProperty(P,"_source",{configurable:!1,enumerable:!1,writable:!1,value:S}),Object.freeze&&(Object.freeze(P.props),Object.freeze(P)),P};function hn(o,u,y){var v,S={},x=null,A=null,P=null,N=null;if(u!=null){yt(u)&&(A=u.ref,Dt(u)),xe(u)&&(We(u.key),x=""+u.key),P=u.__self===void 0?null:u.__self,N=u.__source===void 0?null:u.__source;for(v in u)ze.call(u,v)&&!et.hasOwnProperty(v)&&(S[v]=u[v])}var q=arguments.length-2;if(q===1)S.children=y;else if(q>1){for(var G=Array(q),X=0;X<q;X++)G[X]=arguments[X+2];Object.freeze&&Object.freeze(G),S.children=G}if(o&&o.defaultProps){var Q=o.defaultProps;for(v in Q)S[v]===void 0&&(S[v]=Q[v])}if(x||A){var ne=typeof o=="function"?o.displayName||o.name||"Unknown":o;x&&dn(S,ne),A&&jt(S,ne)}return He(o,x,A,P,N,ue.current,S)}function pn(o,u){var y=He(o.type,u,o.ref,o._self,o._source,o._owner,o.props);return y}function yn(o,u,y){if(o==null)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+o+".");var v,S=I({},o.props),x=o.key,A=o.ref,P=o._self,N=o._source,q=o._owner;if(u!=null){yt(u)&&(A=u.ref,q=ue.current),xe(u)&&(We(u.key),x=""+u.key);var G;o.type&&o.type.defaultProps&&(G=o.type.defaultProps);for(v in u)ze.call(u,v)&&!et.hasOwnProperty(v)&&(u[v]===void 0&&G!==void 0?S[v]=G[v]:S[v]=u[v])}var X=arguments.length-2;if(X===1)S.children=y;else if(X>1){for(var Q=Array(X),ne=0;ne<X;ne++)Q[ne]=arguments[ne+2];S.children=Q}return He(o.type,x,A,P,N,q,S)}function Pe(o){return typeof o=="object"&&o!==null&&o.$$typeof===r}var $t=".",mn=":";function vn(o){var u=/[=:]/g,y={"=":"=0",":":"=2"},v=o.replace(u,function(S){return y[S]});return"$"+v}var nt=!1,Ft=/\/+/g;function Re(o){return o.replace(Ft,"$&/")}function qe(o,u){return typeof o=="object"&&o!==null&&o.key!=null?(We(o.key),vn(""+o.key)):u.toString(36)}function Ie(o,u,y,v,S){var x=typeof o;(x==="undefined"||x==="boolean")&&(o=null);var A=!1;if(o===null)A=!0;else switch(x){case"string":case"number":A=!0;break;case"object":switch(o.$$typeof){case r:case s:A=!0}}if(A){var P=o,N=S(P),q=v===""?$t+qe(P,0):v;if(Ze(N)){var G="";q!=null&&(G=Re(q)+"/"),Ie(N,u,G,"",function(Ao){return Ao})}else N!=null&&(Pe(N)&&(N.key&&(!P||P.key!==N.key)&&We(N.key),N=pn(N,y+(N.key&&(!P||P.key!==N.key)?Re(""+N.key)+"/":"")+q)),u.push(N));return 1}var X,Q,ne=0,ae=v===""?$t:v+mn;if(Ze(o))for(var Yt=0;Yt<o.length;Yt++)X=o[Yt],Q=ae+qe(X,Yt),ne+=Ie(X,u,y,Q,S);else{var Pn=W(o);if(typeof Pn=="function"){var $r=o;Pn===$r.entries&&(nt||me("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),nt=!0);for(var Oo=Pn.call($r),Fr,Co=0;!(Fr=Oo.next()).done;)X=Fr.value,Q=ae+qe(X,Co++),ne+=Ie(X,u,y,Q,S)}else if(x==="object"){var Mr=String(o);throw new Error("Objects are not valid as a React child (found: "+(Mr==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":Mr)+"). If you meant to render a collection of children, use an array instead.")}}return ne}function Ye(o,u,y){if(o==null)return o;var v=[],S=0;return Ie(o,v,"","",function(x){return u.call(y,x,S++)}),v}function gn(o){var u=0;return Ye(o,function(){u++}),u}function Mt(o,u,y){Ye(o,function(){u.apply(this,arguments)},y)}function _n(o){return Ye(o,function(u){return u})||[]}function Nt(o){if(!Pe(o))throw new Error("React.Children.only expected to receive a single React element child.");return o}function Ut(o){var u={$$typeof:l,_currentValue:o,_currentValue2:o,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};u.Provider={$$typeof:h,_context:u};var y=!1,v=!1,S=!1;{var x={$$typeof:l,_context:u};Object.defineProperties(x,{Provider:{get:function(){return v||(v=!0,k("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),u.Provider},set:function(A){u.Provider=A}},_currentValue:{get:function(){return u._currentValue},set:function(A){u._currentValue=A}},_currentValue2:{get:function(){return u._currentValue2},set:function(A){u._currentValue2=A}},_threadCount:{get:function(){return u._threadCount},set:function(A){u._threadCount=A}},Consumer:{get:function(){return y||(y=!0,k("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),u.Consumer}},displayName:{get:function(){return u.displayName},set:function(A){S||(me("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",A),S=!0)}}}),u.Consumer=x}return u._currentRenderer=null,u._currentRenderer2=null,u}var Je=-1,mt=0,vt=1,En=2;function bn(o){if(o._status===Je){var u=o._result,y=u();if(y.then(function(x){if(o._status===mt||o._status===Je){var A=o;A._status=vt,A._result=x}},function(x){if(o._status===mt||o._status===Je){var A=o;A._status=En,A._result=x}}),o._status===Je){var v=o;v._status=mt,v._result=y}}if(o._status===vt){var S=o._result;return S===void 0&&k(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
21
|
+
*/wt.exports;var ls;function Za(){return ls||(ls=1,function(e,t){process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n="18.2.0",r=Symbol.for("react.element"),s=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),l=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),D=Symbol.iterator,L="@@iterator";function V(o){if(o===null||typeof o!="object")return null;var c=D&&o[D]||o[L];return typeof c=="function"?c:null}var he={current:null},pe={transition:null},te={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},ue={current:null},Ee={},Te=null;function Fe(o){Te=o}Ee.setExtraStackFrame=function(o){Te=o},Ee.getCurrentStack=null,Ee.getStackAddendum=function(){var o="";Te&&(o+=Te);var c=Ee.getCurrentStack;return c&&(o+=c()||""),o};var Ne=!1,pt=!1,Le=!1,ce=!1,le=!1,oe={ReactCurrentDispatcher:he,ReactCurrentBatchConfig:pe,ReactCurrentOwner:ue};oe.ReactDebugCurrentFrame=Ee,oe.ReactCurrentActQueue=te;function me(o){{for(var c=arguments.length,m=new Array(c>1?c-1:0),v=1;v<c;v++)m[v-1]=arguments[v];be("warn",o,m)}}function k(o){{for(var c=arguments.length,m=new Array(c>1?c-1:0),v=1;v<c;v++)m[v-1]=arguments[v];be("error",o,m)}}function be(o,c,m){{var v=oe.ReactDebugCurrentFrame,w=v.getStackAddendum();w!==""&&(c+="%s",m=m.concat([w]));var x=m.map(function(A){return String(A)});x.unshift("Warning: "+c),Function.prototype.apply.call(console[o],console,x)}}var Ue={};function p(o,c){{var m=o.constructor,v=m&&(m.displayName||m.name)||"ReactClass",w=v+"."+c;if(Ue[w])return;k("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",c,v),Ue[w]=!0}}var T={isMounted:function(o){return!1},enqueueForceUpdate:function(o,c,m){p(o,"forceUpdate")},enqueueReplaceState:function(o,c,m,v){p(o,"replaceState")},enqueueSetState:function(o,c,m,v){p(o,"setState")}},I=Object.assign,W={};Object.freeze(W);function M(o,c,m){this.props=o,this.context=c,this.refs=W,this.updater=m||T}M.prototype.isReactComponent={},M.prototype.setState=function(o,c){if(typeof o!="object"&&typeof o!="function"&&o!=null)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,o,c,"setState")},M.prototype.forceUpdate=function(o){this.updater.enqueueForceUpdate(this,o,"forceUpdate")};{var J={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},K=function(o,c){Object.defineProperty(M.prototype,o,{get:function(){me("%s(...) is deprecated in plain JavaScript React classes. %s",c[0],c[1])}})};for(var q in J)J.hasOwnProperty(q)&&K(q,J[q])}function z(){}z.prototype=M.prototype;function se(o,c,m){this.props=o,this.context=c,this.refs=W,this.updater=m||T}var ke=se.prototype=new z;ke.constructor=se,I(ke,M.prototype),ke.isPureReactComponent=!0;function fn(){var o={current:null};return Object.seal(o),o}var kt=Array.isArray;function Ze(o){return kt(o)}function ln(o){{var c=typeof Symbol=="function"&&Symbol.toStringTag,m=c&&o[Symbol.toStringTag]||o.constructor.name||"Object";return m}}function Qe(o){try{return Be(o),!1}catch{return!0}}function Be(o){return""+o}function We(o){if(Qe(o))return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ln(o)),Be(o)}function xt(o,c,m){var v=o.displayName;if(v)return v;var w=c.displayName||c.name||"";return w!==""?m+"("+w+")":m}function Ve(o){return o.displayName||"Context"}function Se(o){if(o==null)return null;if(typeof o.tag=="number"&&k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case i:return"Fragment";case s:return"Portal";case u:return"Profiler";case a:return"StrictMode";case h:return"Suspense";case E:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case l:var c=o;return Ve(c)+".Consumer";case d:var m=o;return Ve(m._context)+".Provider";case y:return xt(o,o.render,"ForwardRef");case S:var v=o.displayName||null;return v!==null?v:Se(o.type)||"Memo";case _:{var w=o,x=w._payload,A=w._init;try{return Se(A(x))}catch{return null}}}return null}var ze=Object.prototype.hasOwnProperty,et={key:!0,ref:!0,__self:!0,__source:!0},Pt,It,tt;tt={};function yt(o){if(ze.call(o,"ref")){var c=Object.getOwnPropertyDescriptor(o,"ref").get;if(c&&c.isReactWarning)return!1}return o.ref!==void 0}function xe(o){if(ze.call(o,"key")){var c=Object.getOwnPropertyDescriptor(o,"key").get;if(c&&c.isReactWarning)return!1}return o.key!==void 0}function dn(o,c){var m=function(){Pt||(Pt=!0,k("%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://reactjs.org/link/special-props)",c))};m.isReactWarning=!0,Object.defineProperty(o,"key",{get:m,configurable:!0})}function jt(o,c){var m=function(){It||(It=!0,k("%s: `ref` 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://reactjs.org/link/special-props)",c))};m.isReactWarning=!0,Object.defineProperty(o,"ref",{get:m,configurable:!0})}function Dt(o){if(typeof o.ref=="string"&&ue.current&&o.__self&&ue.current.stateNode!==o.__self){var c=Se(ue.current.type);tt[c]||(k('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',c,o.ref),tt[c]=!0)}}var He=function(o,c,m,v,w,x,A){var P={$$typeof:r,type:o,key:c,ref:m,props:A,_owner:x};return P._store={},Object.defineProperty(P._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(P,"_self",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.defineProperty(P,"_source",{configurable:!1,enumerable:!1,writable:!1,value:w}),Object.freeze&&(Object.freeze(P.props),Object.freeze(P)),P};function hn(o,c,m){var v,w={},x=null,A=null,P=null,N=null;if(c!=null){yt(c)&&(A=c.ref,Dt(c)),xe(c)&&(We(c.key),x=""+c.key),P=c.__self===void 0?null:c.__self,N=c.__source===void 0?null:c.__source;for(v in c)ze.call(c,v)&&!et.hasOwnProperty(v)&&(w[v]=c[v])}var Y=arguments.length-2;if(Y===1)w.children=m;else if(Y>1){for(var G=Array(Y),X=0;X<Y;X++)G[X]=arguments[X+2];Object.freeze&&Object.freeze(G),w.children=G}if(o&&o.defaultProps){var Q=o.defaultProps;for(v in Q)w[v]===void 0&&(w[v]=Q[v])}if(x||A){var ne=typeof o=="function"?o.displayName||o.name||"Unknown":o;x&&dn(w,ne),A&&jt(w,ne)}return He(o,x,A,P,N,ue.current,w)}function pn(o,c){var m=He(o.type,c,o.ref,o._self,o._source,o._owner,o.props);return m}function yn(o,c,m){if(o==null)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+o+".");var v,w=I({},o.props),x=o.key,A=o.ref,P=o._self,N=o._source,Y=o._owner;if(c!=null){yt(c)&&(A=c.ref,Y=ue.current),xe(c)&&(We(c.key),x=""+c.key);var G;o.type&&o.type.defaultProps&&(G=o.type.defaultProps);for(v in c)ze.call(c,v)&&!et.hasOwnProperty(v)&&(c[v]===void 0&&G!==void 0?w[v]=G[v]:w[v]=c[v])}var X=arguments.length-2;if(X===1)w.children=m;else if(X>1){for(var Q=Array(X),ne=0;ne<X;ne++)Q[ne]=arguments[ne+2];w.children=Q}return He(o.type,x,A,P,N,Y,w)}function Pe(o){return typeof o=="object"&&o!==null&&o.$$typeof===r}var $t=".",mn=":";function vn(o){var c=/[=:]/g,m={"=":"=0",":":"=2"},v=o.replace(c,function(w){return m[w]});return"$"+v}var nt=!1,Mt=/\/+/g;function Re(o){return o.replace(Mt,"$&/")}function qe(o,c){return typeof o=="object"&&o!==null&&o.key!=null?(We(o.key),vn(""+o.key)):c.toString(36)}function Ie(o,c,m,v,w){var x=typeof o;(x==="undefined"||x==="boolean")&&(o=null);var A=!1;if(o===null)A=!0;else switch(x){case"string":case"number":A=!0;break;case"object":switch(o.$$typeof){case r:case s:A=!0}}if(A){var P=o,N=w(P),Y=v===""?$t+qe(P,0):v;if(Ze(N)){var G="";Y!=null&&(G=Re(Y)+"/"),Ie(N,c,G,"",function(Ao){return Ao})}else N!=null&&(Pe(N)&&(N.key&&(!P||P.key!==N.key)&&We(N.key),N=pn(N,m+(N.key&&(!P||P.key!==N.key)?Re(""+N.key)+"/":"")+Y)),c.push(N));return 1}var X,Q,ne=0,ae=v===""?$t:v+mn;if(Ze(o))for(var Yt=0;Yt<o.length;Yt++)X=o[Yt],Q=ae+qe(X,Yt),ne+=Ie(X,c,m,Q,w);else{var Pn=V(o);if(typeof Pn=="function"){var $r=o;Pn===$r.entries&&(nt||me("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),nt=!0);for(var Oo=Pn.call($r),Mr,Co=0;!(Mr=Oo.next()).done;)X=Mr.value,Q=ae+qe(X,Co++),ne+=Ie(X,c,m,Q,w)}else if(x==="object"){var Fr=String(o);throw new Error("Objects are not valid as a React child (found: "+(Fr==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":Fr)+"). If you meant to render a collection of children, use an array instead.")}}return ne}function Ye(o,c,m){if(o==null)return o;var v=[],w=0;return Ie(o,v,"","",function(x){return c.call(m,x,w++)}),v}function gn(o){var c=0;return Ye(o,function(){c++}),c}function Ft(o,c,m){Ye(o,function(){c.apply(this,arguments)},m)}function _n(o){return Ye(o,function(c){return c})||[]}function Nt(o){if(!Pe(o))throw new Error("React.Children.only expected to receive a single React element child.");return o}function Lt(o){var c={$$typeof:l,_currentValue:o,_currentValue2:o,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};c.Provider={$$typeof:d,_context:c};var m=!1,v=!1,w=!1;{var x={$$typeof:l,_context:c};Object.defineProperties(x,{Provider:{get:function(){return v||(v=!0,k("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),c.Provider},set:function(A){c.Provider=A}},_currentValue:{get:function(){return c._currentValue},set:function(A){c._currentValue=A}},_currentValue2:{get:function(){return c._currentValue2},set:function(A){c._currentValue2=A}},_threadCount:{get:function(){return c._threadCount},set:function(A){c._threadCount=A}},Consumer:{get:function(){return m||(m=!0,k("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),c.Consumer}},displayName:{get:function(){return c.displayName},set:function(A){w||(me("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",A),w=!0)}}}),c.Consumer=x}return c._currentRenderer=null,c._currentRenderer2=null,c}var Je=-1,mt=0,vt=1,En=2;function bn(o){if(o._status===Je){var c=o._result,m=c();if(m.then(function(x){if(o._status===mt||o._status===Je){var A=o;A._status=vt,A._result=x}},function(x){if(o._status===mt||o._status===Je){var A=o;A._status=En,A._result=x}}),o._status===Je){var v=o;v._status=mt,v._result=m}}if(o._status===vt){var w=o._result;return w===void 0&&k(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
22
22
|
|
|
23
23
|
Your code should look like:
|
|
24
24
|
const MyComponent = lazy(() => import('./MyComponent'))
|
|
25
25
|
|
|
26
|
-
Did you accidentally put curly braces around the import?`,
|
|
26
|
+
Did you accidentally put curly braces around the import?`,w),"default"in w||k(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
27
27
|
|
|
28
28
|
Your code should look like:
|
|
29
|
-
const MyComponent = lazy(() => import('./MyComponent'))`,
|
|
29
|
+
const MyComponent = lazy(() => import('./MyComponent'))`,w),w.default}else throw o._result}function Sn(o){var c={_status:Je,_result:o},m={$$typeof:_,_payload:c,_init:bn};{var v,w;Object.defineProperties(m,{defaultProps:{configurable:!0,get:function(){return v},set:function(x){k("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),v=x,Object.defineProperty(m,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return w},set:function(x){k("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),w=x,Object.defineProperty(m,"propTypes",{enumerable:!0})}}})}return m}function wn(o){o!=null&&o.$$typeof===S?k("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof o!="function"?k("forwardRef requires a render function but was given %s.",o===null?"null":typeof o):o.length!==0&&o.length!==2&&k("forwardRef render functions accept exactly two parameters: props and ref. %s",o.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),o!=null&&(o.defaultProps!=null||o.propTypes!=null)&&k("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");var c={$$typeof:y,render:o};{var m;Object.defineProperty(c,"displayName",{enumerable:!1,configurable:!0,get:function(){return m},set:function(v){m=v,!o.name&&!o.displayName&&(o.displayName=v)}})}return c}var f;f=Symbol.for("react.module.reference");function b(o){return!!(typeof o=="string"||typeof o=="function"||o===i||o===u||le||o===a||o===h||o===E||ce||o===O||Ne||pt||Le||typeof o=="object"&&o!==null&&(o.$$typeof===_||o.$$typeof===S||o.$$typeof===d||o.$$typeof===l||o.$$typeof===y||o.$$typeof===f||o.getModuleId!==void 0))}function R(o,c){b(o)||k("memo: The first argument must be a component. Instead received: %s",o===null?"null":typeof o);var m={$$typeof:S,type:o,compare:c===void 0?null:c};{var v;Object.defineProperty(m,"displayName",{enumerable:!1,configurable:!0,get:function(){return v},set:function(w){v=w,!o.name&&!o.displayName&&(o.displayName=w)}})}return m}function C(){var o=he.current;return o===null&&k(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
30
30
|
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
31
31
|
2. You might be breaking the Rules of Hooks
|
|
32
32
|
3. You might have more than one copy of React in the same app
|
|
33
|
-
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`),o}function U(o){var
|
|
34
|
-
`+Rn+o}}var On=!1,Wt;{var uo=typeof WeakMap=="function"?WeakMap:Map;Wt=new uo}function wr(o,
|
|
33
|
+
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`),o}function U(o){var c=C();if(o._context!==void 0){var m=o._context;m.Consumer===o?k("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):m.Provider===o&&k("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return c.useContext(o)}function H(o){var c=C();return c.useState(o)}function F(o,c,m){var v=C();return v.useReducer(o,c,m)}function j(o){var c=C();return c.useRef(o)}function ie(o,c){var m=C();return m.useEffect(o,c)}function Z(o,c){var m=C();return m.useInsertionEffect(o,c)}function ee(o,c){var m=C();return m.useLayoutEffect(o,c)}function de(o,c){var m=C();return m.useCallback(o,c)}function je(o,c){var m=C();return m.useMemo(o,c)}function Ut(o,c,m){var v=C();return v.useImperativeHandle(o,c,m)}function ve(o,c){{var m=C();return m.useDebugValue(o,c)}}function no(){var o=C();return o.useTransition()}function ro(o){var c=C();return c.useDeferredValue(o)}function so(){var o=C();return o.useId()}function oo(o,c,m){var v=C();return v.useSyncExternalStore(o,c,m)}var gt=0,yr,mr,vr,gr,_r,Er,br;function Sr(){}Sr.__reactDisabledLog=!0;function io(){{if(gt===0){yr=console.log,mr=console.info,vr=console.warn,gr=console.error,_r=console.group,Er=console.groupCollapsed,br=console.groupEnd;var o={configurable:!0,enumerable:!0,value:Sr,writable:!0};Object.defineProperties(console,{info:o,log:o,warn:o,error:o,group:o,groupCollapsed:o,groupEnd:o})}gt++}}function ao(){{if(gt--,gt===0){var o={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},o,{value:yr}),info:I({},o,{value:mr}),warn:I({},o,{value:vr}),error:I({},o,{value:gr}),group:I({},o,{value:_r}),groupCollapsed:I({},o,{value:Er}),groupEnd:I({},o,{value:br})})}gt<0&&k("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Tn=oe.ReactCurrentDispatcher,Rn;function Bt(o,c,m){{if(Rn===void 0)try{throw Error()}catch(w){var v=w.stack.trim().match(/\n( *(at )?)/);Rn=v&&v[1]||""}return`
|
|
34
|
+
`+Rn+o}}var On=!1,Wt;{var uo=typeof WeakMap=="function"?WeakMap:Map;Wt=new uo}function wr(o,c){if(!o||On)return"";{var m=Wt.get(o);if(m!==void 0)return m}var v;On=!0;var w=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var x;x=Tn.current,Tn.current=null,io();try{if(c){var A=function(){throw Error()};if(Object.defineProperty(A.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(A,[])}catch(ae){v=ae}Reflect.construct(o,[],A)}else{try{A.call()}catch(ae){v=ae}o.call(A.prototype)}}else{try{throw Error()}catch(ae){v=ae}o()}}catch(ae){if(ae&&v&&typeof ae.stack=="string"){for(var P=ae.stack.split(`
|
|
35
35
|
`),N=v.stack.split(`
|
|
36
|
-
`),
|
|
37
|
-
`+P[
|
|
36
|
+
`),Y=P.length-1,G=N.length-1;Y>=1&&G>=0&&P[Y]!==N[G];)G--;for(;Y>=1&&G>=0;Y--,G--)if(P[Y]!==N[G]){if(Y!==1||G!==1)do if(Y--,G--,G<0||P[Y]!==N[G]){var X=`
|
|
37
|
+
`+P[Y].replace(" at new "," at ");return o.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",o.displayName)),typeof o=="function"&&Wt.set(o,X),X}while(Y>=1&&G>=0);break}}}finally{On=!1,Tn.current=x,ao(),Error.prepareStackTrace=w}var Q=o?o.displayName||o.name:"",ne=Q?Bt(Q):"";return typeof o=="function"&&Wt.set(o,ne),ne}function co(o,c,m){return wr(o,!1)}function fo(o){var c=o.prototype;return!!(c&&c.isReactComponent)}function Vt(o,c,m){if(o==null)return"";if(typeof o=="function")return wr(o,fo(o));if(typeof o=="string")return Bt(o);switch(o){case h:return Bt("Suspense");case E:return Bt("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case y:return co(o.render);case S:return Vt(o.type,c,m);case _:{var v=o,w=v._payload,x=v._init;try{return Vt(x(w),c,m)}catch{}}}return""}var Tr={},Rr=oe.ReactDebugCurrentFrame;function zt(o){if(o){var c=o._owner,m=Vt(o.type,o._source,c?c.type:null);Rr.setExtraStackFrame(m)}else Rr.setExtraStackFrame(null)}function lo(o,c,m,v,w){{var x=Function.call.bind(ze);for(var A in o)if(x(o,A)){var P=void 0;try{if(typeof o[A]!="function"){var N=Error((v||"React class")+": "+m+" type `"+A+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[A]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw N.name="Invariant Violation",N}P=o[A](c,A,v,m,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Y){P=Y}P&&!(P instanceof Error)&&(zt(w),k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",v||"React class",m,A,typeof P),zt(null)),P instanceof Error&&!(P.message in Tr)&&(Tr[P.message]=!0,zt(w),k("Failed %s type: %s",m,P.message),zt(null))}}}function rt(o){if(o){var c=o._owner,m=Vt(o.type,o._source,c?c.type:null);Fe(m)}else Fe(null)}var Cn;Cn=!1;function Or(){if(ue.current){var o=Se(ue.current.type);if(o)return`
|
|
38
38
|
|
|
39
|
-
Check the render method of \``+o+"`."}return""}function ho(o){if(o!==void 0){var
|
|
39
|
+
Check the render method of \``+o+"`."}return""}function ho(o){if(o!==void 0){var c=o.fileName.replace(/^.*[\\\/]/,""),m=o.lineNumber;return`
|
|
40
40
|
|
|
41
|
-
Check your code at `+
|
|
41
|
+
Check your code at `+c+":"+m+"."}return""}function po(o){return o!=null?ho(o.__source):""}var Cr={};function yo(o){var c=Or();if(!c){var m=typeof o=="string"?o:o.displayName||o.name;m&&(c=`
|
|
42
42
|
|
|
43
|
-
Check the top-level render call using <`+
|
|
43
|
+
Check the top-level render call using <`+m+">.")}return c}function Ar(o,c){if(!(!o._store||o._store.validated||o.key!=null)){o._store.validated=!0;var m=yo(c);if(!Cr[m]){Cr[m]=!0;var v="";o&&o._owner&&o._owner!==ue.current&&(v=" It was passed a child from "+Se(o._owner.type)+"."),rt(o),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',m,v),rt(null)}}}function kr(o,c){if(typeof o=="object"){if(Ze(o))for(var m=0;m<o.length;m++){var v=o[m];Pe(v)&&Ar(v,c)}else if(Pe(o))o._store&&(o._store.validated=!0);else if(o){var w=V(o);if(typeof w=="function"&&w!==o.entries)for(var x=w.call(o),A;!(A=x.next()).done;)Pe(A.value)&&Ar(A.value,c)}}}function xr(o){{var c=o.type;if(c==null||typeof c=="string")return;var m;if(typeof c=="function")m=c.propTypes;else if(typeof c=="object"&&(c.$$typeof===y||c.$$typeof===S))m=c.propTypes;else return;if(m){var v=Se(c);lo(m,o.props,"prop",v,o)}else if(c.PropTypes!==void 0&&!Cn){Cn=!0;var w=Se(c);k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",w||"Unknown")}typeof c.getDefaultProps=="function"&&!c.getDefaultProps.isReactClassApproved&&k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function mo(o){{for(var c=Object.keys(o.props),m=0;m<c.length;m++){var v=c[m];if(v!=="children"&&v!=="key"){rt(o),k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v),rt(null);break}}o.ref!==null&&(rt(o),k("Invalid attribute `ref` supplied to `React.Fragment`."),rt(null))}}function Pr(o,c,m){var v=b(o);if(!v){var w="";(o===void 0||typeof o=="object"&&o!==null&&Object.keys(o).length===0)&&(w+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var x=po(c);x?w+=x:w+=Or();var A;o===null?A="null":Ze(o)?A="array":o!==void 0&&o.$$typeof===r?(A="<"+(Se(o.type)||"Unknown")+" />",w=" Did you accidentally export a JSX literal instead of a component?"):A=typeof o,k("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",A,w)}var P=hn.apply(this,arguments);if(P==null)return P;if(v)for(var N=2;N<arguments.length;N++)kr(arguments[N],o);return o===i?mo(P):xr(P),P}var Ir=!1;function vo(o){var c=Pr.bind(null,o);return c.type=o,Ir||(Ir=!0,me("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(c,"type",{enumerable:!1,get:function(){return me("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:o}),o}}),c}function go(o,c,m){for(var v=yn.apply(this,arguments),w=2;w<arguments.length;w++)kr(arguments[w],v.type);return xr(v),v}function _o(o,c){var m=pe.transition;pe.transition={};var v=pe.transition;pe.transition._updatedFibers=new Set;try{o()}finally{if(pe.transition=m,m===null&&v._updatedFibers){var w=v._updatedFibers.size;w>10&&me("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),v._updatedFibers.clear()}}}var jr=!1,Ht=null;function Eo(o){if(Ht===null)try{var c=("require"+Math.random()).slice(0,7),m=e&&e[c];Ht=m.call(e,"timers").setImmediate}catch{Ht=function(w){jr===!1&&(jr=!0,typeof MessageChannel>"u"&&k("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var x=new MessageChannel;x.port1.onmessage=w,x.port2.postMessage(void 0)}}return Ht(o)}var st=0,Dr=!1;function bo(o){{var c=st;st++,te.current===null&&(te.current=[]);var m=te.isBatchingLegacy,v;try{if(te.isBatchingLegacy=!0,v=o(),!m&&te.didScheduleLegacyUpdate){var w=te.current;w!==null&&(te.didScheduleLegacyUpdate=!1,xn(w))}}catch(Q){throw qt(c),Q}finally{te.isBatchingLegacy=m}if(v!==null&&typeof v=="object"&&typeof v.then=="function"){var x=v,A=!1,P={then:function(Q,ne){A=!0,x.then(function(ae){qt(c),st===0?An(ae,Q,ne):Q(ae)},function(ae){qt(c),ne(ae)})}};return!Dr&&typeof Promise<"u"&&Promise.resolve().then(function(){}).then(function(){A||(Dr=!0,k("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),P}else{var N=v;if(qt(c),st===0){var Y=te.current;Y!==null&&(xn(Y),te.current=null);var G={then:function(Q,ne){te.current===null?(te.current=[],An(N,Q,ne)):Q(N)}};return G}else{var X={then:function(Q,ne){Q(N)}};return X}}}}function qt(o){o!==st-1&&k("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),st=o}function An(o,c,m){{var v=te.current;if(v!==null)try{xn(v),Eo(function(){v.length===0?(te.current=null,c(o)):An(o,c,m)})}catch(w){m(w)}else c(o)}}var kn=!1;function xn(o){if(!kn){kn=!0;var c=0;try{for(;c<o.length;c++){var m=o[c];do m=m(!0);while(m!==null)}o.length=0}catch(v){throw o=o.slice(c+1),v}finally{kn=!1}}}var So=Pr,wo=go,To=vo,Ro={map:Ye,forEach:Ft,count:gn,toArray:_n,only:Nt};t.Children=Ro,t.Component=M,t.Fragment=i,t.Profiler=u,t.PureComponent=se,t.StrictMode=a,t.Suspense=h,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=oe,t.cloneElement=wo,t.createContext=Lt,t.createElement=So,t.createFactory=To,t.createRef=fn,t.forwardRef=wn,t.isValidElement=Pe,t.lazy=Sn,t.memo=R,t.startTransition=_o,t.unstable_act=bo,t.useCallback=de,t.useContext=U,t.useDebugValue=ve,t.useDeferredValue=ro,t.useEffect=ie,t.useId=so,t.useImperativeHandle=Ut,t.useInsertionEffect=Z,t.useLayoutEffect=ee,t.useMemo=je,t.useReducer=F,t.useRef=j,t.useState=H,t.useSyncExternalStore=oo,t.useTransition=no,t.version=n,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()}(wt,wt.exports)),wt.exports}process.env.NODE_ENV==="production"?Kn.exports=Xa():Kn.exports=Za();var Ae=Kn.exports;/**
|
|
44
44
|
* @license React
|
|
45
45
|
* react-jsx-runtime.production.min.js
|
|
46
46
|
*
|
|
@@ -48,7 +48,7 @@ Check the top-level render call using <`+y+">.")}return u}function Ar(o,u){if(!(
|
|
|
48
48
|
*
|
|
49
49
|
* This source code is licensed under the MIT license found in the
|
|
50
50
|
* LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/var ds;function Qa(){if(ds)return bt;ds=1;var e=Ae,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function a(
|
|
51
|
+
*/var ds;function Qa(){if(ds)return bt;ds=1;var e=Ae,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function a(u,d,l){var y,h={},E=null,S=null;l!==void 0&&(E=""+l),d.key!==void 0&&(E=""+d.key),d.ref!==void 0&&(S=d.ref);for(y in d)r.call(d,y)&&!i.hasOwnProperty(y)&&(h[y]=d[y]);if(u&&u.defaultProps)for(y in d=u.defaultProps,d)h[y]===void 0&&(h[y]=d[y]);return{$$typeof:t,type:u,key:E,ref:S,props:h,_owner:s.current}}return bt.Fragment=n,bt.jsx=a,bt.jsxs=a,bt}var St={};/**
|
|
52
52
|
* @license React
|
|
53
53
|
* react-jsx-runtime.development.js
|
|
54
54
|
*
|
|
@@ -56,14 +56,14 @@ Check the top-level render call using <`+y+">.")}return u}function Ar(o,u){if(!(
|
|
|
56
56
|
*
|
|
57
57
|
* This source code is licensed under the MIT license found in the
|
|
58
58
|
* LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/var hs;function eu(){return hs||(hs=1,process.env.NODE_ENV!=="production"&&function(){var e=Ae,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),
|
|
60
|
-
`+
|
|
59
|
+
*/var hs;function eu(){return hs||(hs=1,process.env.NODE_ENV!=="production"&&function(){var e=Ae,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),_=Symbol.iterator,O="@@iterator";function D(f){if(f===null||typeof f!="object")return null;var b=_&&f[_]||f[O];return typeof b=="function"?b:null}var L=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function V(f){{for(var b=arguments.length,R=new Array(b>1?b-1:0),C=1;C<b;C++)R[C-1]=arguments[C];he("error",f,R)}}function he(f,b,R){{var C=L.ReactDebugCurrentFrame,U=C.getStackAddendum();U!==""&&(b+="%s",R=R.concat([U]));var H=R.map(function(F){return String(F)});H.unshift("Warning: "+b),Function.prototype.apply.call(console[f],console,H)}}var pe=!1,te=!1,ue=!1,Ee=!1,Te=!1,Fe;Fe=Symbol.for("react.module.reference");function Ne(f){return!!(typeof f=="string"||typeof f=="function"||f===r||f===i||Te||f===s||f===l||f===y||Ee||f===S||pe||te||ue||typeof f=="object"&&f!==null&&(f.$$typeof===E||f.$$typeof===h||f.$$typeof===a||f.$$typeof===u||f.$$typeof===d||f.$$typeof===Fe||f.getModuleId!==void 0))}function pt(f,b,R){var C=f.displayName;if(C)return C;var U=b.displayName||b.name||"";return U!==""?R+"("+U+")":R}function Le(f){return f.displayName||"Context"}function ce(f){if(f==null)return null;if(typeof f.tag=="number"&&V("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case s:return"StrictMode";case l:return"Suspense";case y:return"SuspenseList"}if(typeof f=="object")switch(f.$$typeof){case u:var b=f;return Le(b)+".Consumer";case a:var R=f;return Le(R._context)+".Provider";case d:return pt(f,f.render,"ForwardRef");case h:var C=f.displayName||null;return C!==null?C:ce(f.type)||"Memo";case E:{var U=f,H=U._payload,F=U._init;try{return ce(F(H))}catch{return null}}}return null}var le=Object.assign,oe=0,me,k,be,Ue,p,T,I;function W(){}W.__reactDisabledLog=!0;function M(){{if(oe===0){me=console.log,k=console.info,be=console.warn,Ue=console.error,p=console.group,T=console.groupCollapsed,I=console.groupEnd;var f={configurable:!0,enumerable:!0,value:W,writable:!0};Object.defineProperties(console,{info:f,log:f,warn:f,error:f,group:f,groupCollapsed:f,groupEnd:f})}oe++}}function J(){{if(oe--,oe===0){var f={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:le({},f,{value:me}),info:le({},f,{value:k}),warn:le({},f,{value:be}),error:le({},f,{value:Ue}),group:le({},f,{value:p}),groupCollapsed:le({},f,{value:T}),groupEnd:le({},f,{value:I})})}oe<0&&V("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var K=L.ReactCurrentDispatcher,q;function z(f,b,R){{if(q===void 0)try{throw Error()}catch(U){var C=U.stack.trim().match(/\n( *(at )?)/);q=C&&C[1]||""}return`
|
|
60
|
+
`+q+f}}var se=!1,ke;{var fn=typeof WeakMap=="function"?WeakMap:Map;ke=new fn}function kt(f,b){if(!f||se)return"";{var R=ke.get(f);if(R!==void 0)return R}var C;se=!0;var U=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var H;H=K.current,K.current=null,M();try{if(b){var F=function(){throw Error()};if(Object.defineProperty(F.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(F,[])}catch(ve){C=ve}Reflect.construct(f,[],F)}else{try{F.call()}catch(ve){C=ve}f.call(F.prototype)}}else{try{throw Error()}catch(ve){C=ve}f()}}catch(ve){if(ve&&C&&typeof ve.stack=="string"){for(var j=ve.stack.split(`
|
|
61
61
|
`),ie=C.stack.split(`
|
|
62
|
-
`),Z=
|
|
63
|
-
`+
|
|
62
|
+
`),Z=j.length-1,ee=ie.length-1;Z>=1&&ee>=0&&j[Z]!==ie[ee];)ee--;for(;Z>=1&&ee>=0;Z--,ee--)if(j[Z]!==ie[ee]){if(Z!==1||ee!==1)do if(Z--,ee--,ee<0||j[Z]!==ie[ee]){var de=`
|
|
63
|
+
`+j[Z].replace(" at new "," at ");return f.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",f.displayName)),typeof f=="function"&&ke.set(f,de),de}while(Z>=1&&ee>=0);break}}}finally{se=!1,K.current=H,J(),Error.prepareStackTrace=U}var je=f?f.displayName||f.name:"",Ut=je?z(je):"";return typeof f=="function"&&ke.set(f,Ut),Ut}function Ze(f,b,R){return kt(f,!1)}function ln(f){var b=f.prototype;return!!(b&&b.isReactComponent)}function Qe(f,b,R){if(f==null)return"";if(typeof f=="function")return kt(f,ln(f));if(typeof f=="string")return z(f);switch(f){case l:return z("Suspense");case y:return z("SuspenseList")}if(typeof f=="object")switch(f.$$typeof){case d:return Ze(f.render);case h:return Qe(f.type,b,R);case E:{var C=f,U=C._payload,H=C._init;try{return Qe(H(U),b,R)}catch{}}}return""}var Be=Object.prototype.hasOwnProperty,We={},xt=L.ReactDebugCurrentFrame;function Ve(f){if(f){var b=f._owner,R=Qe(f.type,f._source,b?b.type:null);xt.setExtraStackFrame(R)}else xt.setExtraStackFrame(null)}function Se(f,b,R,C,U){{var H=Function.call.bind(Be);for(var F in f)if(H(f,F)){var j=void 0;try{if(typeof f[F]!="function"){var ie=Error((C||"React class")+": "+R+" type `"+F+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof f[F]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ie.name="Invariant Violation",ie}j=f[F](b,F,C,R,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Z){j=Z}j&&!(j instanceof Error)&&(Ve(U),V("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",C||"React class",R,F,typeof j),Ve(null)),j instanceof Error&&!(j.message in We)&&(We[j.message]=!0,Ve(U),V("Failed %s type: %s",R,j.message),Ve(null))}}}var ze=Array.isArray;function et(f){return ze(f)}function Pt(f){{var b=typeof Symbol=="function"&&Symbol.toStringTag,R=b&&f[Symbol.toStringTag]||f.constructor.name||"Object";return R}}function It(f){try{return tt(f),!1}catch{return!0}}function tt(f){return""+f}function yt(f){if(It(f))return V("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Pt(f)),tt(f)}var xe=L.ReactCurrentOwner,dn={key:!0,ref:!0,__self:!0,__source:!0},jt,Dt,He;He={};function hn(f){if(Be.call(f,"ref")){var b=Object.getOwnPropertyDescriptor(f,"ref").get;if(b&&b.isReactWarning)return!1}return f.ref!==void 0}function pn(f){if(Be.call(f,"key")){var b=Object.getOwnPropertyDescriptor(f,"key").get;if(b&&b.isReactWarning)return!1}return f.key!==void 0}function yn(f,b){if(typeof f.ref=="string"&&xe.current&&b&&xe.current.stateNode!==b){var R=ce(xe.current.type);He[R]||(V('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',ce(xe.current.type),f.ref),He[R]=!0)}}function Pe(f,b){{var R=function(){jt||(jt=!0,V("%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://reactjs.org/link/special-props)",b))};R.isReactWarning=!0,Object.defineProperty(f,"key",{get:R,configurable:!0})}}function $t(f,b){{var R=function(){Dt||(Dt=!0,V("%s: `ref` 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://reactjs.org/link/special-props)",b))};R.isReactWarning=!0,Object.defineProperty(f,"ref",{get:R,configurable:!0})}}var mn=function(f,b,R,C,U,H,F){var j={$$typeof:t,type:f,key:b,ref:R,props:F,_owner:H};return j._store={},Object.defineProperty(j._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(j,"_self",{configurable:!1,enumerable:!1,writable:!1,value:C}),Object.defineProperty(j,"_source",{configurable:!1,enumerable:!1,writable:!1,value:U}),Object.freeze&&(Object.freeze(j.props),Object.freeze(j)),j};function vn(f,b,R,C,U){{var H,F={},j=null,ie=null;R!==void 0&&(yt(R),j=""+R),pn(b)&&(yt(b.key),j=""+b.key),hn(b)&&(ie=b.ref,yn(b,U));for(H in b)Be.call(b,H)&&!dn.hasOwnProperty(H)&&(F[H]=b[H]);if(f&&f.defaultProps){var Z=f.defaultProps;for(H in Z)F[H]===void 0&&(F[H]=Z[H])}if(j||ie){var ee=typeof f=="function"?f.displayName||f.name||"Unknown":f;j&&Pe(F,ee),ie&&$t(F,ee)}return mn(f,j,ie,U,C,xe.current,F)}}var nt=L.ReactCurrentOwner,Mt=L.ReactDebugCurrentFrame;function Re(f){if(f){var b=f._owner,R=Qe(f.type,f._source,b?b.type:null);Mt.setExtraStackFrame(R)}else Mt.setExtraStackFrame(null)}var qe;qe=!1;function Ie(f){return typeof f=="object"&&f!==null&&f.$$typeof===t}function Ye(){{if(nt.current){var f=ce(nt.current.type);if(f)return`
|
|
64
64
|
|
|
65
|
-
Check the render method of \``+f+"`."}return""}}function gn(f){{if(f!==void 0){var
|
|
65
|
+
Check the render method of \``+f+"`."}return""}}function gn(f){{if(f!==void 0){var b=f.fileName.replace(/^.*[\\\/]/,""),R=f.lineNumber;return`
|
|
66
66
|
|
|
67
|
-
Check your code at `+
|
|
67
|
+
Check your code at `+b+":"+R+"."}return""}}var Ft={};function _n(f){{var b=Ye();if(!b){var R=typeof f=="string"?f:f.displayName||f.name;R&&(b=`
|
|
68
68
|
|
|
69
|
-
Check the top-level render call using <`+R+">.")}return
|
|
69
|
+
Check the top-level render call using <`+R+">.")}return b}}function Nt(f,b){{if(!f._store||f._store.validated||f.key!=null)return;f._store.validated=!0;var R=_n(b);if(Ft[R])return;Ft[R]=!0;var C="";f&&f._owner&&f._owner!==nt.current&&(C=" It was passed a child from "+ce(f._owner.type)+"."),Re(f),V('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',R,C),Re(null)}}function Lt(f,b){{if(typeof f!="object")return;if(et(f))for(var R=0;R<f.length;R++){var C=f[R];Ie(C)&&Nt(C,b)}else if(Ie(f))f._store&&(f._store.validated=!0);else if(f){var U=D(f);if(typeof U=="function"&&U!==f.entries)for(var H=U.call(f),F;!(F=H.next()).done;)Ie(F.value)&&Nt(F.value,b)}}}function Je(f){{var b=f.type;if(b==null||typeof b=="string")return;var R;if(typeof b=="function")R=b.propTypes;else if(typeof b=="object"&&(b.$$typeof===d||b.$$typeof===h))R=b.propTypes;else return;if(R){var C=ce(b);Se(R,f.props,"prop",C,f)}else if(b.PropTypes!==void 0&&!qe){qe=!0;var U=ce(b);V("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",U||"Unknown")}typeof b.getDefaultProps=="function"&&!b.getDefaultProps.isReactClassApproved&&V("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function mt(f){{for(var b=Object.keys(f.props),R=0;R<b.length;R++){var C=b[R];if(C!=="children"&&C!=="key"){Re(f),V("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",C),Re(null);break}}f.ref!==null&&(Re(f),V("Invalid attribute `ref` supplied to `React.Fragment`."),Re(null))}}function vt(f,b,R,C,U,H){{var F=Ne(f);if(!F){var j="";(f===void 0||typeof f=="object"&&f!==null&&Object.keys(f).length===0)&&(j+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ie=gn(U);ie?j+=ie:j+=Ye();var Z;f===null?Z="null":et(f)?Z="array":f!==void 0&&f.$$typeof===t?(Z="<"+(ce(f.type)||"Unknown")+" />",j=" Did you accidentally export a JSX literal instead of a component?"):Z=typeof f,V("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Z,j)}var ee=vn(f,b,R,U,H);if(ee==null)return ee;if(F){var de=b.children;if(de!==void 0)if(C)if(et(de)){for(var je=0;je<de.length;je++)Lt(de[je],f);Object.freeze&&Object.freeze(de)}else V("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 Lt(de,f)}return f===r?mt(ee):Je(ee),ee}}function En(f,b,R){return vt(f,b,R,!0)}function bn(f,b,R){return vt(f,b,R,!1)}var Sn=bn,wn=En;St.Fragment=r,St.jsx=Sn,St.jsxs=wn}()),St}process.env.NODE_ENV==="production"?Jn.exports=Qa():Jn.exports=eu();var eo=Jn.exports;const hr=Ae.createContext(void 0),tu=()=>{const e=Ae.useContext(hr),[t,n]=Ae.useState((e==null?void 0:e.getSnapshot().value)==="loggedIn");return Ae.useEffect(()=>{const r=e==null?void 0:e.subscribe(s=>{(s.value==="loggedIn"||s.value==="loggedOut")&&n(s.value==="loggedIn")});return()=>{r==null||r.unsubscribe()}},[e]),{authActor:e??void 0,isLoggedIn:t}},nu=async(e="",t={inspect:void 0,endpoints:{login:"",logout:"",refresh:"",ssrRefresh:""}})=>typeof window<"u"?(console.warn("App.getInitialProps::getAuth should not be run on the frontend. You are probably missing getServerSideProps in your page."),ut(Yn,{inspect:t.inspect,input:{initialContext:{endpoints:t.endpoints}}}).start()):ut(Yn,{input:{initialContext:{endpoints:t.endpoints,refreshToken:e}},inspect:t.inspect}).start();function ru({actor:e,children:t}){return eo.jsx(hr.Provider,{value:e,children:t})}let su=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");const to=ir({actors:{tick:Ci(({sendBack:e,input:t})=>{const n=setInterval(()=>{e({type:"TICK"})},t.interval);return()=>{clearInterval(n)}})},types:{context:{},events:{},input:{}}}).createMachine({id:"timer",initial:"running",context:({input:e})=>({elapsed:0,duration:e.initialContext.duration??3e3,interval:100,intervalId:null}),states:{paused:{on:{RESUME_TIMER:{target:"running",guard:({context:e})=>e.elapsed<e.duration}}},running:{invoke:{input:({context:e})=>({interval:e.interval}),src:"tick"},always:[{target:"completed",guard:({context:e})=>e.elapsed>=e.duration}],on:{TICK:{actions:ge(({context:e,event:t})=>t.type!=="TICK"?e:{elapsed:e.elapsed+e.interval})},PAUSE_TIMER:{target:"paused"}}},completed:{type:"final"}}}),ou=ir({actors:{timer:to},types:{context:{},events:{},input:{}},actions:{addItem:ge(({context:e,event:t})=>{if(t.type!=="ADD_ITEM")return e;const n=`notification-${su()}`,r=t.duration??e.duration,s=Ae.cloneElement(t.item,{duration:r,id:n,key:t.item.key??n,...t.item.props}),i={duration:r,id:n,element:s},a=e.items;return e.order==="desc"?a.push(i):a.unshift(i),{items:a,activeItem:n}}),removeItem:ge(({context:e,event:t})=>{if(t.type!=="REMOVE_ITEM"&&t.type!=="xstate.done.actor.timer")return e;const n=e.items;return e.order==="desc"?(n.pop(),{items:n,activeItem:n.length>0?n[n.length-1].id:null}):(n.shift(),{items:n,activeItem:n.length>0?n[0].id:null})})},delays:{ITEM_TIMEOUT:({context:e})=>e.items[e.items.length-1].duration??e.duration},guards:{itemHasTimeout:({context:e})=>e.items[e.items.length-1].duration>0||e.duration>0}}).createMachine({id:"toast",context:{items:[],order:"desc",duration:0,activeItem:null},initial:"idle",states:{idle:{on:{ADD_ITEM:{target:"adding"}}},active:{invoke:{src:"timer",input:({context:e})=>({initialContext:{duration:e.items[e.items.length-1].duration??e.duration}}),onDone:{target:"removing",guard:"itemHasTimeout"}},on:{ADD_ITEM:{target:"adding"},REMOVE_ITEM:{target:"removing"},SET_IDLE:{target:"idle"},RESUME_TIMER:{actions:Xr("timer",{type:"RESUME_TIMER"})},PAUSE_TIMER:{actions:Xr("timer",{type:"PAUSE_TIMER"})}}},adding:{entry:["addItem"],on:{SET_IDLE:{target:"idle"},SET_ACTIVE:{target:"active"}}},removing:{entry:"removeItem",on:{SET_IDLE:{target:"idle"},SET_ACTIVE:{target:"active"}}}}}),pr=Ae.createContext({}),iu=()=>Ae.useContext(pr);function au({children:e,actor:t}){return eo.jsx(pr.Provider,{value:t,children:e})}exports.AuthContext=hr;exports.AuthProvider=ru;exports.ToastContext=pr;exports.ToastProvider=au;exports.authMachine=Yn;exports.getAuth=nu;exports.timerMachine=to;exports.toastMachine=ou;exports.useAuth=tu;exports.useToast=iu;
|