@noxickon/onyx 0.0.2 → 0.0.4-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/Button-D-v4l8ZE.js +20 -0
- package/dist/chunks/{Button-CLMaoxRW.js → Button-bARrxYyo.js} +627 -628
- package/dist/chunks/Input-CLi1H63d.js +1 -0
- package/dist/chunks/{Input-BQQT5eZ0.js → Input-dfvmdIHi.js} +39 -39
- package/dist/chunks/errorHelper--G-SWQzN.js +18 -0
- package/dist/chunks/errorHelper-DaP_XxEx.js +1 -0
- package/dist/chunks/formatTimestamp-CMxOnPo1.js +12 -0
- package/dist/chunks/formatTimestamp-TTsNcy7u.js +1 -0
- package/dist/chunks/{jsx-runtime-C5mzlN2N.js → jsx-runtime--oOP9f8K.js} +15 -15
- package/dist/chunks/{jsx-runtime-DUiatUiq.js → jsx-runtime-CITbqOLs.js} +2 -2
- package/dist/chunks/{index-BgUMV1hv.js → useAuth-DDRXztKj.js} +240 -178
- package/dist/chunks/{index-XTQUUzZ1.js → useAuth-DPnpY3XC.js} +18 -9
- package/dist/chunks/{useForm-BIKRbGHj.js → useForm-D4co95Vn.js} +785 -801
- package/dist/chunks/useForm-DUviJ7xS.js +18 -0
- package/dist/chunks/useQuery-BvCyJMae.js +2065 -0
- package/dist/chunks/useQuery-DTNHO7so.js +3 -0
- package/dist/context/context.cjs.js +1 -1
- package/dist/context/context.es.js +1 -1
- package/dist/context.d.ts +1 -0
- package/dist/hooks/hooks.cjs.js +6 -6
- package/dist/hooks/hooks.es.js +117 -118
- package/dist/index.css +1 -1
- package/dist/index.d.ts +24 -10
- package/dist/layout/layout.cjs.js +1 -1
- package/dist/layout/layout.es.js +2 -2
- package/dist/onyx.cjs.js +1 -12
- package/dist/onyx.es.js +779 -2035
- package/dist/pages/pages.cjs.js +8 -2
- package/dist/pages/pages.es.js +35 -25
- package/dist/utils/utils.cjs.js +1 -0
- package/dist/utils/utils.es.js +8 -0
- package/dist/utils.d.ts +29 -0
- package/package.json +31 -27
- package/dist/chunks/Button-CZYAHivj.js +0 -20
- package/dist/chunks/Input-DJZcvJdP.js +0 -1
- package/dist/chunks/index-1-zQ3RaM.js +0 -601
- package/dist/chunks/index-CjVXr8mh.js +0 -2
- package/dist/chunks/useAuth-C-TIgBfr.js +0 -61
- package/dist/chunks/useAuth-CfKOZqhG.js +0 -10
- package/dist/chunks/useForm-BZEaiRaa.js +0 -26
- package/dist/chunks/useQuery-B_ce5e8f.js +0 -2
- package/dist/chunks/useQuery-CJdYhuQu.js +0 -1481
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";const _t=require("./_commonjsHelpers-DwGv2jUC.js"),wt=require("react");function Ot(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(n,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var X=function(e,t){return X=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},X(e,t)};function ce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");X(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}exports.__assign=function(){return exports.__assign=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},exports.__assign.apply(this,arguments)};function V(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function I(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}var $="Invariant Violation",_e=Object.setPrototypeOf,St=_e===void 0?function(e,t){return e.__proto__=t,e}:_e,$e=function(e){ce(t,e);function t(r){r===void 0&&(r=$);var n=e.call(this,typeof r=="number"?$+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=$,St(n,t.prototype),n}return t}(Error);function P(e,t){if(!e)throw new $e(t)}var He=["debug","log","warn","error","silent"],Et=He.indexOf("log");function Q(e){return function(){if(He.indexOf(e)>=Et){var t=console[e]||console.log;return t.apply(console,arguments)}}}(function(e){e.debug=Q("debug"),e.log=Q("log"),e.warn=Q("warn"),e.error=Q("error")})(P||(P={}));var Be="3.13.8";function E(e){try{return e()}catch{}}const Z=E(function(){return globalThis})||E(function(){return window})||E(function(){return self})||E(function(){return global})||E(function(){return E.constructor("return this")()});var we=new Map;function Pt(e){var t=we.get(e)||1;return we.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function kt(e,t){var r=Pt("stringifyForDisplay");return JSON.stringify(e,function(n,i){return i===void 0?r:i},t).split(JSON.stringify(r)).join("<undefined>")}function C(e){return function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if(typeof t=="number"){var i=t;t=fe(i),t||(t=le(i,r),r=[])}e.apply(void 0,[t].concat(r))}}var g=Object.assign(function(t,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];t||P(t,fe(r,n)||le(r,n))},{debug:C(P.debug),log:C(P.log),warn:C(P.warn),error:C(P.error)});function Ge(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return new $e(fe(e,t)||le(e,t))}var Oe=Symbol.for("ApolloErrorMessageHandler_"+Be);function Je(e){if(typeof e=="string")return e;try{return kt(e,2).slice(0,1e3)}catch{return"<non-serializable>"}}function fe(e,t){if(t===void 0&&(t=[]),!!e)return Z[Oe]&&Z[Oe](e,t.map(Je))}function le(e,t){if(t===void 0&&(t=[]),!!e)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:Be,message:e,args:t.map(Je)})))}function qt(e,t){var r=e.directives;return!r||!r.length?!0:Tt(r).every(function(n){var i=n.directive,o=n.ifArgument,a=!1;return o.value.kind==="Variable"?(a=t&&t[o.value.name.value],g(a!==void 0,78,i.name.value)):a=o.value.value,i.name.value==="skip"?!a:a})}function Dt(e){var t=e.name.value;return t==="skip"||t==="include"}function Tt(e){var t=[];return e&&e.length&&e.forEach(function(r){if(Dt(r)){var n=r.arguments,i=r.name.value;g(n&&n.length===1,79,i);var o=n[0];g(o.name&&o.name.value==="if",80,i);var a=o.value;g(a&&(a.kind==="Variable"||a.kind==="BooleanValue"),81,i),t.push({directive:r,ifArgument:o})}}),t}var It=E(function(){return navigator.product})=="ReactNative",Ke=typeof Symbol=="function"&&typeof Symbol.for=="function",Ye=typeof E(function(){return window.document.createElement})=="function",Ft=E(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1,jt=(Ye||It)&&!Ft;function ee(e){return e!==null&&typeof e=="object"}function Mt(e){e===void 0&&(e=[]);var t={};return e.forEach(function(r){t[r.name.value]=r}),t}function xt(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":{var r=e.name.value;if(typeof t=="function")return t(r);var n=t&&t[r];return g(n,87,r),n||null}default:return null}}function Rt(){}class Se{constructor(t=1/0,r=Rt){this.max=t,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}has(t){return this.map.has(t)}get(t){const r=this.getNode(t);return r&&r.value}get size(){return this.map.size}getNode(t){const r=this.map.get(t);if(r&&r!==this.newest){const{older:n,newer:i}=r;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r}set(t,r){let n=this.getNode(t);return n?n.value=r:(n={key:t,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(t,n),n.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(t){const r=this.map.get(t);return r?(r===this.newest&&(this.newest=r.older),r===this.oldest&&(this.oldest=r.newer),r.newer&&(r.newer.older=r.older),r.older&&(r.older.newer=r.newer),this.map.delete(t),this.dispose(r.value,t),!0):!1}}function te(){}const Qt=te,Ct=typeof WeakRef<"u"?WeakRef:function(e){return{deref:()=>e}},At=typeof WeakMap<"u"?WeakMap:Map,Nt=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:te,unregister:te}},zt=10024;class Ee{constructor(t=1/0,r=Qt){this.max=t,this.dispose=r,this.map=new At,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const n=this.unfinalizedNodes.values();for(let i=0;i<zt;i++){const o=n.next().value;if(!o)break;this.unfinalizedNodes.delete(o);const a=o.key;delete o.key,o.keyRef=new Ct(a),this.registry.register(a,o,o)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new Nt(this.deleteNode.bind(this))}has(t){return this.map.has(t)}get(t){const r=this.getNode(t);return r&&r.value}getNode(t){const r=this.map.get(t);if(r&&r!==this.newest){const{older:n,newer:i}=r;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r}set(t,r){let n=this.getNode(t);return n?n.value=r:(n={key:t,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.scheduleFinalization(n),this.map.set(t,n),this.size++,n.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(t){t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.size--;const r=t.key||t.keyRef&&t.keyRef.deref();this.dispose(t.value,r),t.keyRef?this.registry.unregister(t):this.unfinalizedNodes.delete(t),r&&this.map.delete(r)}delete(t){const r=this.map.get(t);return r?(this.deleteNode(r),!0):!1}scheduleFinalization(t){this.unfinalizedNodes.add(t),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}var H=new WeakSet;function Xe(e){e.size<=(e.max||-1)||H.has(e)||(H.add(e),setTimeout(function(){e.clean(),H.delete(e)},100))}var Lt=function(e,t){var r=new Ee(e,t);return r.set=function(n,i){var o=Ee.prototype.set.call(this,n,i);return Xe(this),o},r},Vt=function(e,t){var r=new Se(e,t);return r.set=function(n,i){var o=Se.prototype.set.call(this,n,i);return Xe(this),o},r},Ut=Symbol.for("apollo.cacheSize"),Ze=exports.__assign({},Z[Ut]),Wt={};function et(e,t){Wt[e]=t}var tt=Object.assign(function(t){return JSON.stringify(t,$t)},{reset:function(){T=new Vt(Ze.canonicalStringify||1e3)}});globalThis.__DEV__!==!1&&et("canonicalStringify",function(){return T.size});var T;tt.reset();function $t(e,t){if(t&&typeof t=="object"){var r=Object.getPrototypeOf(t);if(r===Object.prototype||r===null){var n=Object.keys(t);if(n.every(Ht))return t;var i=JSON.stringify(n),o=T.get(i);if(!o){n.sort();var a=JSON.stringify(n);o=T.get(a)||n,T.set(i,o),T.set(a,o)}var s=Object.create(r);return o.forEach(function(u){s[u]=t[u]}),s}}return t}function Ht(e,t,r){return t===0||r[t-1]<=e}var Bt=["connection","include","skip","client","rest","export","nonreactive"],M=tt;Object.assign(function(e,t,r){if(t&&r&&r.connection&&r.connection.key)if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach(function(s){i[s]=t[s]}),"".concat(r.connection.key,"(").concat(M(i),")")}else return r.connection.key;var o=e;if(t){var a=M(t);o+="(".concat(a,")")}return r&&Object.keys(r).forEach(function(s){Bt.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?o+="@".concat(s,"(").concat(M(r[s]),")"):o+="@".concat(s))}),o},{setStringify:function(e){var t=M;return M=e,t}});function Gt(e){return e.alias?e.alias.value:e.name.value}function Jt(e){return e.kind==="Field"}function rt(e){g(e&&e.kind==="Document",88);var t=e.definitions.filter(function(r){return r.kind!=="FragmentDefinition"}).map(function(r){if(r.kind!=="OperationDefinition")throw Ge(89,r.kind);return r});return g(t.length<=1,90,t.length),e}function nt(e){return rt(e),e.definitions.filter(function(t){return t.kind==="OperationDefinition"})[0]}function Kt(e){return e.definitions.filter(function(t){return t.kind==="FragmentDefinition"})}function Yt(e){var t=nt(e);return g(t&&t.operation==="query",91),t}function Xt(e){rt(e);for(var t,r=0,n=e.definitions;r<n.length;r++){var i=n[r];if(i.kind==="OperationDefinition"){var o=i.operation;if(o==="query"||o==="mutation"||o==="subscription")return i}i.kind==="FragmentDefinition"&&!t&&(t=i)}if(t)return t;throw Ge(95)}let m=null;const Pe={};let Zt=1;const er=()=>class{constructor(){this.id=["slot",Zt++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let t=m;t;t=t.parent)if(this.id in t.slots){const r=t.slots[this.id];if(r===Pe)break;return t!==m&&(m.slots[this.id]=r),!0}return m&&(m.slots[this.id]=Pe),!1}getValue(){if(this.hasValue())return m.slots[this.id]}withValue(t,r,n,i){const o={__proto__:null,[this.id]:t},a=m;m={parent:a,slots:o};try{return r.apply(i,n)}finally{m=a}}static bind(t){const r=m;return function(){const n=m;try{return m=r,t.apply(this,arguments)}finally{m=n}}}static noContext(t,r,n){if(m){const i=m;try{return m=null,t.apply(n,r)}finally{m=i}}else return t.apply(n,r)}};function ke(e){try{return e()}catch{}}const B="@wry/context:Slot",tr=ke(()=>globalThis)||ke(()=>global)||Object.create(null),qe=tr,he=qe[B]||Array[B]||function(e){try{Object.defineProperty(qe,B,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(er()),{bind:Br,noContext:Gr}=he;new he;function it(e){return Array.isArray(e)&&e.length>0}function rr(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=nr(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nr(e,t){if(e){if(typeof e=="string")return De(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return De(e,t)}}function De(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Te(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function pe(e,t,r){return t&&Te(e.prototype,t),r&&Te(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var ye=function(){return typeof Symbol=="function"},ve=function(e){return ye()&&!!Symbol[e]},de=function(e){return ve(e)?Symbol[e]:"@@"+e};ye()&&!ve("observable")&&(Symbol.observable=Symbol("observable"));var ir=de("iterator"),re=de("observable"),ot=de("species");function U(e,t){var r=e[t];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function x(e){var t=e.constructor;return t!==void 0&&(t=t[ot],t===null&&(t=void 0)),t!==void 0?t:j}function or(e){return e instanceof j}function F(e){F.log?F.log(e):setTimeout(function(){throw e})}function N(e){Promise.resolve().then(function(){try{e()}catch(t){F(t)}})}function at(e){var t=e._cleanup;if(t!==void 0&&(e._cleanup=void 0,!!t))try{if(typeof t=="function")t();else{var r=U(t,"unsubscribe");r&&r.call(t)}}catch(n){F(n)}}function ne(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function ar(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(st(e,t[r].type,t[r].value),e._state!=="closed");++r);}}function st(e,t,r){e._state="running";var n=e._observer;try{var i=U(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(ne(e),i)i.call(n,r);else throw r;break;case"complete":ne(e),i&&i.call(n);break}}catch(o){F(o)}e._state==="closed"?at(e):e._state==="running"&&(e._state="ready")}function G(e,t,r){if(e._state!=="closed"){if(e._state==="buffering"){e._queue.push({type:t,value:r});return}if(e._state!=="ready"){e._state="buffering",e._queue=[{type:t,value:r}],N(function(){return ar(e)});return}st(e,t,r)}}var sr=function(){function e(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new ur(this);try{this._cleanup=n.call(void 0,i)}catch(o){i.error(o)}this._state==="initializing"&&(this._state="ready")}var t=e.prototype;return t.unsubscribe=function(){this._state!=="closed"&&(ne(this),at(this))},pe(e,[{key:"closed",get:function(){return this._state==="closed"}}]),e}(),ur=function(){function e(r){this._subscription=r}var t=e.prototype;return t.next=function(n){G(this._subscription,"next",n)},t.error=function(n){G(this._subscription,"error",n)},t.complete=function(){G(this._subscription,"complete")},pe(e,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),e}(),j=function(){function e(r){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var t=e.prototype;return t.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new sr(n,this._subscriber)},t.forEach=function(n){var i=this;return new Promise(function(o,a){if(typeof n!="function"){a(new TypeError(n+" is not a function"));return}function s(){u.unsubscribe(),o()}var u=i.subscribe({next:function(c){try{n(c,s)}catch(f){a(f),u.unsubscribe()}},error:a,complete:o})})},t.map=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var o=x(this);return new o(function(a){return i.subscribe({next:function(s){try{s=n(s)}catch(u){return a.error(u)}a.next(s)},error:function(s){a.error(s)},complete:function(){a.complete()}})})},t.filter=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var o=x(this);return new o(function(a){return i.subscribe({next:function(s){try{if(!n(s))return}catch(u){return a.error(u)}a.next(s)},error:function(s){a.error(s)},complete:function(){a.complete()}})})},t.reduce=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var o=x(this),a=arguments.length>1,s=!1,u=arguments[1],c=u;return new o(function(f){return i.subscribe({next:function(l){var h=!s;if(s=!0,!h||a)try{c=n(c,l)}catch(p){return f.error(p)}else c=l},error:function(l){f.error(l)},complete:function(){if(!s&&!a)return f.error(new TypeError("Cannot reduce an empty sequence"));f.next(c),f.complete()}})})},t.concat=function(){for(var n=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var s=x(this);return new s(function(u){var c,f=0;function l(h){c=h.subscribe({next:function(p){u.next(p)},error:function(p){u.error(p)},complete:function(){f===o.length?(c=void 0,u.complete()):l(s.from(o[f++]))}})}return l(n),function(){c&&(c.unsubscribe(),c=void 0)}})},t.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var o=x(this);return new o(function(a){var s=[],u=i.subscribe({next:function(f){if(n)try{f=n(f)}catch(h){return a.error(h)}var l=o.from(f).subscribe({next:function(h){a.next(h)},error:function(h){a.error(h)},complete:function(){var h=s.indexOf(l);h>=0&&s.splice(h,1),c()}});s.push(l)},error:function(f){a.error(f)},complete:function(){c()}});function c(){u.closed&&s.length===0&&a.complete()}return function(){s.forEach(function(f){return f.unsubscribe()}),u.unsubscribe()}})},t[re]=function(){return this},e.from=function(n){var i=typeof this=="function"?this:e;if(n==null)throw new TypeError(n+" is not an object");var o=U(n,re);if(o){var a=o.call(n);if(Object(a)!==a)throw new TypeError(a+" is not an object");return or(a)&&a.constructor===i?a:new i(function(s){return a.subscribe(s)})}if(ve("iterator")&&(o=U(n,ir),o))return new i(function(s){N(function(){if(!s.closed){for(var u=rr(o.call(n)),c;!(c=u()).done;){var f=c.value;if(s.next(f),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){N(function(){if(!s.closed){for(var u=0;u<n.length;++u)if(s.next(n[u]),s.closed)return;s.complete()}})});throw new TypeError(n+" is not observable")},e.of=function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];var a=typeof this=="function"?this:e;return new a(function(s){N(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})})},pe(e,null,[{key:ot,get:function(){return this}}]),e}();ye()&&Object.defineProperty(j,Symbol("extensions"),{value:{symbol:re,hostReportError:F},configurable:!0});function cr(e){var t,r=e.Symbol;if(typeof r=="function")if(r.observable)t=r.observable;else{typeof r.for=="function"?t=r.for("https://github.com/benlesh/symbol-observable"):t=r("https://github.com/benlesh/symbol-observable");try{r.observable=t}catch{}}else t="@@observable";return t}var D;typeof self<"u"?D=self:typeof window<"u"?D=window:typeof global<"u"?D=global:typeof module<"u"?D=module:D=Function("return this")();cr(D);var Ie=j.prototype,Fe="@@observable";Ie[Fe]||(Ie[Fe]=function(){return this});function fr(e){return e.catch(function(){}),e}var lr=Object.prototype.toString;function hr(e){return ie(e)}function ie(e,t){switch(lr.call(e)){case"[object Array]":{if(t=t||new Map,t.has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach(function(i,o){r[o]=ie(i,t)}),r}case"[object Object]":{if(t=t||new Map,t.has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach(function(i){n[i]=ie(e[i],t)}),n}default:return e}}function pr(e){var t=new Set([e]);return t.forEach(function(r){ee(r)&&yr(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){ee(r[n])&&t.add(r[n])})}),e}function yr(e){if(globalThis.__DEV__!==!1&&!Object.isFrozen(e))try{Object.freeze(e)}catch(t){if(t instanceof TypeError)return null;throw t}return e}function ut(e){return globalThis.__DEV__!==!1&&pr(e),e}function je(e,t,r){var n=[];e.forEach(function(i){return i[t]&&n.push(i)}),n.forEach(function(i){return i[t](r)})}function vr(e){function t(r){Object.defineProperty(e,r,{value:j})}return Ke&&Symbol.species&&t(Symbol.species),t("@@species"),e}function R(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Object.create(null);return e.forEach(function(n){n&&Object.keys(n).forEach(function(i){var o=n[i];o!==void 0&&(r[i]=o)})}),r}function ct(e,t){return R(e,t,t.variables&&{variables:R(exports.__assign(exports.__assign({},e&&e.variables),t.variables))})}function dr(e){return e.hasOwnProperty("graphQLErrors")}var gr=function(e){var t=I(I(I([],e.graphQLErrors,!0),e.clientErrors,!0),e.protocolErrors,!0);return e.networkError&&t.push(e.networkError),t.map(function(r){return ee(r)&&r.message||"Error message not found."}).join(`
|
|
3
|
+
`)},W=function(e){ce(t,e);function t(r){var n=r.graphQLErrors,i=r.protocolErrors,o=r.clientErrors,a=r.networkError,s=r.errorMessage,u=r.extraInfo,c=e.call(this,s)||this;return c.name="ApolloError",c.graphQLErrors=n||[],c.protocolErrors=i||[],c.clientErrors=o||[],c.networkError=a||null,c.message=s||gr(c),c.extraInfo=u,c.cause=I(I(I([a],n||[],!0),i||[],!0),o||[],!0).find(function(f){return!!f})||null,c.__proto__=t.prototype,c}return t}(Error);const{toString:Me,hasOwnProperty:br}=Object.prototype,xe=Function.prototype.toString,oe=new Map;function _(e,t){try{return ae(e,t)}finally{oe.clear()}}function ae(e,t){if(e===t)return!0;const r=Me.call(e),n=Me.call(t);if(r!==n)return!1;switch(r){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(Qe(e,t))return!0;const i=Re(e),o=Re(t),a=i.length;if(a!==o.length)return!1;for(let s=0;s<a;++s)if(!br.call(t,i[s]))return!1;for(let s=0;s<a;++s){const u=i[s];if(!ae(e[u],t[u]))return!1}return!0}case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!==e)return t!==t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e==`${t}`;case"[object Map]":case"[object Set]":{if(e.size!==t.size)return!1;if(Qe(e,t))return!0;const i=e.entries(),o=r==="[object Map]";for(;;){const a=i.next();if(a.done)break;const[s,u]=a.value;if(!t.has(s)||o&&!ae(u,t.get(s)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":{let i=e.byteLength;if(i===t.byteLength)for(;i--&&e[i]===t[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const i=xe.call(e);return i!==xe.call(t)?!1:!wr(i,_r)}}return!1}function Re(e){return Object.keys(e).filter(mr,e)}function mr(e){return this[e]!==void 0}const _r="{ [native code] }";function wr(e,t){const r=e.length-t.length;return r>=0&&e.indexOf(t,r)===r}function Qe(e,t){let r=oe.get(e);if(r){if(r.has(t))return!0}else oe.set(e,r=new Set);return r.add(t),!1}function Or(e,t,r,n){var i=t.data,o=V(t,["data"]),a=r.data,s=V(r,["data"]);return _(o,s)&&z(Xt(e).selectionSet,i,a,{fragmentMap:Mt(Kt(e)),variables:n})}function z(e,t,r,n){if(t===r)return!0;var i=new Set;return e.selections.every(function(o){if(i.has(o)||(i.add(o),!qt(o,n.variables))||Ce(o))return!0;if(Jt(o)){var a=Gt(o),s=t&&t[a],u=r&&r[a],c=o.selectionSet;if(!c)return _(s,u);var f=Array.isArray(s),l=Array.isArray(u);if(f!==l)return!1;if(f&&l){var h=s.length;if(u.length!==h)return!1;for(var p=0;p<h;++p)if(!z(c,s[p],u[p],n))return!1;return!0}return z(c,s,u,n)}else{var y=xt(o,n.fragmentMap);if(y)return Ce(y)?!0:z(y.selectionSet,t,r,n)}})}function Ce(e){return!!e.directives&&e.directives.some(Sr)}function Sr(e){return e.name.value==="nonreactive"}var d;(function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"})(d||(d={}));function A(e){return e?e<7:!1}var Ae=Object.assign,Er=Object.hasOwnProperty,ft=function(e){ce(t,e);function t(r){var n=r.queryManager,i=r.queryInfo,o=r.options,a=this,s=t.inactiveOnCreation.getValue();a=e.call(this,function(v){s&&(n.queries.set(a.queryId,i),s=!1);try{var w=v._subscription._observer;w&&!w.error&&(w.error=Pr)}catch{}var mt=!a.observers.size;a.observers.add(v);var q=a.last;return q&&q.error?v.error&&v.error(q.error):q&&q.result&&v.next&&v.next(a.maskResult(q.result)),mt&&a.reobserve().catch(function(){}),function(){a.observers.delete(v)&&!a.observers.size&&a.tearDownQuery()}})||this,a.observers=new Set,a.subscriptions=new Set,a.dirty=!1,a.queryInfo=i,a.queryManager=n,a.waitForOwnResult=J(o.fetchPolicy),a.isTornDown=!1,a.subscribeToMore=a.subscribeToMore.bind(a),a.maskResult=a.maskResult.bind(a);var u=n.defaultOptions.watchQuery,c=u===void 0?{}:u,f=c.fetchPolicy,l=f===void 0?"cache-first":f,h=o.fetchPolicy,p=h===void 0?l:h,y=o.initialFetchPolicy,S=y===void 0?p==="standby"?l:p:y;a.options=exports.__assign(exports.__assign({},o),{initialFetchPolicy:S,fetchPolicy:p}),a.queryId=i.queryId||n.generateQueryId();var O=nt(a.query);return a.queryName=O&&O.name&&O.name.value,a}return Object.defineProperty(t.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var r=this;return new Promise(function(n,i){var o={next:function(s){n(s),r.observers.delete(o),r.observers.size||r.queryManager.removeQuery(r.queryId),setTimeout(function(){a.unsubscribe()},0)},error:i},a=r.subscribe(o)})},t.prototype.resetDiff=function(){this.queryInfo.resetDiff()},t.prototype.getCurrentFullResult=function(r){r===void 0&&(r=!0);var n=this.getLastResult(!0),i=this.queryInfo.networkStatus||n&&n.networkStatus||d.ready,o=exports.__assign(exports.__assign({},n),{loading:A(i),networkStatus:i}),a=this.options.fetchPolicy,s=a===void 0?"cache-first":a;if(!(J(s)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers))if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var u=this.queryInfo.getDiff();(u.complete||this.options.returnPartialData)&&(o.data=u.result),_(o.data,{})&&(o.data=void 0),u.complete?(delete o.partial,u.complete&&o.networkStatus===d.loading&&(s==="cache-first"||s==="cache-only")&&(o.networkStatus=d.ready,o.loading=!1)):o.partial=!0,o.networkStatus===d.ready&&(o.error||o.errors)&&(o.networkStatus=d.error),globalThis.__DEV__!==!1&&!u.complete&&!this.options.partialRefetch&&!o.loading&&!o.data&&!o.error&&kr(u.missing)}return r&&this.updateLastResult(o),o},t.prototype.getCurrentResult=function(r){return r===void 0&&(r=!0),this.maskResult(this.getCurrentFullResult(r))},t.prototype.isDifferentFromLastResult=function(r,n){if(!this.last)return!0;var i=this.queryManager.getDocumentInfo(this.query),o=this.queryManager.dataMasking,a=o?i.nonReactiveQuery:this.query,s=o||i.hasNonreactiveDirective?!Or(a,this.last.result,r,this.variables):!_(this.last.result,r);return s||n&&!_(this.last.variables,n)},t.prototype.getLast=function(r,n){var i=this.last;if(i&&i[r]&&(!n||_(i.variables,this.variables)))return i[r]},t.prototype.getLastResult=function(r){return this.getLast("result",r)},t.prototype.getLastError=function(r){return this.getLast("error",r)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(r){var n,i={pollInterval:0},o=this.options.fetchPolicy;if(o==="no-cache"?i.fetchPolicy="no-cache":i.fetchPolicy="network-only",globalThis.__DEV__!==!1&&r&&Er.call(r,"variables")){var a=Yt(this.query),s=a.variableDefinitions;(!s||!s.some(function(u){return u.variable.name.value==="variables"}))&&globalThis.__DEV__!==!1&&g.warn(21,r,((n=a.name)===null||n===void 0?void 0:n.value)||a)}return r&&!_(this.options.variables,r)&&(i.variables=this.options.variables=exports.__assign(exports.__assign({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,d.refetch)},t.prototype.fetchMore=function(r){var n=this,i=exports.__assign(exports.__assign({},r.query?r:exports.__assign(exports.__assign(exports.__assign(exports.__assign({},this.options),{query:this.options.query}),r),{variables:exports.__assign(exports.__assign({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"});i.query=this.transformDocument(i.query);var o=this.queryManager.generateQueryId();this.lastQuery=r.query?this.transformDocument(this.options.query):i.query;var a=this.queryInfo,s=a.networkStatus;a.networkStatus=d.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var u=new Set,c=r?.updateQuery,f=this.options.fetchPolicy!=="no-cache";return f||g(c,22),this.queryManager.fetchQuery(o,i,d.fetchMore).then(function(l){if(n.queryManager.removeQuery(o),a.networkStatus===d.fetchMore&&(a.networkStatus=s),f)n.queryManager.cache.batch({update:function(y){var S=r.updateQuery;S?y.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(O){return S(O,{fetchMoreResult:l.data,variables:i.variables})}):y.writeQuery({query:i.query,variables:i.variables,data:l.data})},onWatchUpdated:function(y){u.add(y.query)}});else{var h=n.getLast("result"),p=c(h.data,{fetchMoreResult:l.data,variables:i.variables});n.reportResult(exports.__assign(exports.__assign({},h),{networkStatus:s,loading:A(s),data:p}),n.variables)}return n.maskResult(l)}).finally(function(){f&&!u.has(n.query)&&n.reobserveCacheFirst()})},t.prototype.subscribeToMore=function(r){var n=this,i=this.queryManager.startGraphQLSubscription({query:r.document,variables:r.variables,context:r.context}).subscribe({next:function(o){var a=r.updateQuery;a&&n.updateQuery(function(s,u){return a(s,exports.__assign({subscriptionData:o},u))})},error:function(o){if(r.onError){r.onError(o);return}globalThis.__DEV__!==!1&&g.error(23,o)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},t.prototype.setOptions=function(r){return this.reobserve(r)},t.prototype.silentSetOptions=function(r){var n=R(this.options,r||{});Ae(this.options,n)},t.prototype.setVariables=function(r){return _(this.variables,r)?this.observers.size?this.result():Promise.resolve():(this.options.variables=r,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:r},d.setVariables):Promise.resolve())},t.prototype.updateQuery=function(r){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}),o=i.result,a=i.complete,s=r(o,{variables:this.variables,complete:!!a,previousData:o});s&&(n.cache.writeQuery({query:this.options.query,data:s,variables:this.variables}),n.broadcastQueries())},t.prototype.startPolling=function(r){this.options.pollInterval=r,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(r,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,o=i===void 0?"cache-first":i,a=n.initialFetchPolicy,s=a===void 0?o:a;o==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(o,{reason:r,options:n,observable:this,initialFetchPolicy:s}):r==="variables-changed"?n.fetchPolicy=s:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},t.prototype.fetch=function(r,n,i){var o=this.queryManager.getOrCreateQuery(this.queryId);return o.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(o,r,n,i)},t.prototype.updatePolling=function(){var r=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,o=n.options.pollInterval;if(!o||!this.hasObservers()){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===o)){g(o,24);var a=i||(this.pollingInfo={});a.interval=o;var s=function(){var c,f;r.pollingInfo&&(!A(r.queryInfo.networkStatus)&&!(!((f=(c=r.options).skipPollAttempt)===null||f===void 0)&&f.call(c))?r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},d.poll).then(u,u):u())},u=function(){var c=r.pollingInfo;c&&(clearTimeout(c.timeout),c.timeout=setTimeout(s,c.interval))};u()}}},t.prototype.updateLastResult=function(r,n){n===void 0&&(n=this.variables);var i=this.getLastError();return i&&this.last&&!_(n,this.last.variables)&&(i=void 0),this.last=exports.__assign({result:this.queryManager.assumeImmutableResults?r:hr(r),variables:n},i?{error:i}:null)},t.prototype.reobserveAsConcast=function(r,n){var i=this;this.isTornDown=!1;var o=n===d.refetch||n===d.fetchMore||n===d.poll,a=this.options.variables,s=this.options.fetchPolicy,u=R(this.options,r||{}),c=o?u:Ae(this.options,u),f=this.transformDocument(c.query);this.lastQuery=f,o||(this.updatePolling(),r&&r.variables&&!_(r.variables,a)&&c.fetchPolicy!=="standby"&&(c.fetchPolicy===s||typeof c.nextFetchPolicy=="function")&&(this.applyNextFetchPolicy("variables-changed",c),n===void 0&&(n=d.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=J(c.fetchPolicy));var l=function(){i.concast===y&&(i.waitForOwnResult=!1)},h=c.variables&&exports.__assign({},c.variables),p=this.fetch(c,n,f),y=p.concast,S=p.fromLink,O={next:function(v){_(i.variables,h)&&(l(),i.reportResult(v,h))},error:function(v){_(i.variables,h)&&(dr(v)||(v=new W({networkError:v})),l(),i.reportError(v,h))}};return!o&&(S||!this.concast)&&(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=y,this.observer=O),y.addObserver(O),y},t.prototype.reobserve=function(r,n){return fr(this.reobserveAsConcast(r,n).promise.then(this.maskResult))},t.prototype.resubscribeAfterError=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=this.last;this.resetLastResults();var o=this.subscribe.apply(this,r);return this.last=i,o},t.prototype.observe=function(){this.reportResult(this.getCurrentFullResult(!1),this.variables)},t.prototype.reportResult=function(r,n){var i=this.getLastError(),o=this.isDifferentFromLastResult(r,n);(i||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,n),(i||o)&&je(this.observers,"next",this.maskResult(r))},t.prototype.reportError=function(r,n){var i=exports.__assign(exports.__assign({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:d.error,loading:!1});this.updateLastResult(i,n),je(this.observers,"error",this.last.error=r)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(r){return r.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t.prototype.transformDocument=function(r){return this.queryManager.transform(r)},t.prototype.maskResult=function(r){return r&&"data"in r?exports.__assign(exports.__assign({},r),{data:this.queryManager.maskOperation({document:this.query,data:r.data,fetchPolicy:this.options.fetchPolicy,id:this.queryId})}):r},t.prototype.resetNotifications=function(){this.cancelNotifyTimeout(),this.dirty=!1},t.prototype.cancelNotifyTimeout=function(){this.notifyTimeout&&(clearTimeout(this.notifyTimeout),this.notifyTimeout=void 0)},t.prototype.scheduleNotify=function(){var r=this;this.dirty||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return r.notify()},0)))},t.prototype.notify=function(){if(this.cancelNotifyTimeout(),this.dirty&&(this.options.fetchPolicy=="cache-only"||this.options.fetchPolicy=="cache-and-network"||!A(this.queryInfo.networkStatus))){var r=this.queryInfo.getDiff();r.fromOptimisticTransaction?this.observe():this.reobserveCacheFirst()}this.dirty=!1},t.prototype.reobserveCacheFirst=function(){var r=this.options,n=r.fetchPolicy,i=r.nextFetchPolicy;return n==="cache-and-network"||n==="network-only"?this.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(o,a){return this.nextFetchPolicy=i,typeof this.nextFetchPolicy=="function"?this.nextFetchPolicy(o,a):n}}):this.reobserve()},t.inactiveOnCreation=new he,t}(j);vr(ft);function Pr(e){globalThis.__DEV__!==!1&&g.error(25,e.message,e.stack)}function kr(e){globalThis.__DEV__!==!1&&e&&globalThis.__DEV__!==!1&&g.debug(26,e)}function J(e){return e==="network-only"||e==="no-cache"||e==="standby"}var K={exports:{}},Ne;function qr(){return Ne||(Ne=1,function(e){e.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=void 0,e.exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,e.exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,Object.assign(e.exports,wt)}(K)),K.exports}var b=qr();const Dr=_t.getDefaultExportFromCjs(b),lt=Ot({__proto__:null,default:Dr},[b]);var ze=Ke?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function ht(){g("createContext"in lt,54);var e=b.createContext[ze];return e||(Object.defineProperty(b.createContext,ze,{value:e=b.createContext({}),enumerable:!1,writable:!1,configurable:!0}),e.displayName="ApolloContext"),e}function ge(e){var t=b.useContext(ht()),r=e||t.client;return g(!!r,58),r}var Le=!1,Tr="useSyncExternalStore",Ir=lt[Tr],Fr=Ir||function(e,t,r){var n=t();globalThis.__DEV__!==!1&&!Le&&n!==t()&&(Le=!0,globalThis.__DEV__!==!1&&g.error(68));var i=b.useState({inst:{value:n,getSnapshot:t}}),o=i[0].inst,a=i[1];return jt?b.useLayoutEffect(function(){Object.assign(o,{value:n,getSnapshot:t}),Y(o)&&a({inst:o})},[e,n,t]):Object.assign(o,{value:n,getSnapshot:t}),b.useEffect(function(){return Y(o)&&a({inst:o}),e(function(){Y(o)&&a({inst:o})})},[e]),n};function Y(e){var t=e.value,r=e.getSnapshot;try{return t!==r()}catch{return!0}}exports.DocumentType=void 0;(function(e){e[e.Query=0]="Query",e[e.Mutation=1]="Mutation",e[e.Subscription=2]="Subscription"})(exports.DocumentType||(exports.DocumentType={}));var k;function Ve(e){var t;switch(e){case exports.DocumentType.Query:t="Query";break;case exports.DocumentType.Mutation:t="Mutation";break;case exports.DocumentType.Subscription:t="Subscription";break}return t}function pt(e){k||(k=new Lt(Ze.parser||1e3));var t=k.get(e);if(t)return t;var r,n,i;g(!!e&&!!e.kind,70,e);for(var o=[],a=[],s=[],u=[],c=0,f=e.definitions;c<f.length;c++){var l=f[c];if(l.kind==="FragmentDefinition"){o.push(l);continue}if(l.kind==="OperationDefinition")switch(l.operation){case"query":a.push(l);break;case"mutation":s.push(l);break;case"subscription":u.push(l);break}}g(!o.length||a.length||s.length||u.length,71),g(a.length+s.length+u.length<=1,72,e,a.length,u.length,s.length),n=a.length?exports.DocumentType.Query:exports.DocumentType.Mutation,!a.length&&!s.length&&(n=exports.DocumentType.Subscription);var h=a.length?a:s.length?s:u;g(h.length===1,73,e,h.length);var p=h[0];r=p.variableDefinitions||[],p.name&&p.name.kind==="Name"?i=p.name.value:i="data";var y={name:i,type:n,variables:r};return k.set(e,y),y}pt.resetCache=function(){k=void 0};globalThis.__DEV__!==!1&&et("parser",function(){return k?k.size:0});function yt(e,t){var r=pt(e),n=Ve(t),i=Ve(r.type);g(r.type===t,74,n,n,i)}var jr=Symbol.for("apollo.hook.wrappers");function Mr(e,t,r){var n=r.queryManager,i=n&&n[jr],o=i&&i[e];return o?o(t):t}var xr=Object.prototype.hasOwnProperty;function Ue(){}var L=Symbol();function Rr(e,t){return t===void 0&&(t=Object.create(null)),Mr("useQuery",Qr,ge(t&&t.client))(e,t)}function Qr(e,t){var r=vt(e,t),n=r.result,i=r.obsQueryFields;return b.useMemo(function(){return exports.__assign(exports.__assign({},n),i)},[n,i])}function Cr(e,t,r,n,i){function o(l){var h;yt(t,exports.DocumentType.Query);var p={client:e,query:t,observable:n&&n.getSSRObservable(i())||ft.inactiveOnCreation.withValue(!n,function(){return e.watchQuery(be(void 0,e,r,i()))}),resultData:{previousData:(h=l?.resultData.current)===null||h===void 0?void 0:h.data}};return p}var a=b.useState(o),s=a[0],u=a[1];function c(l){var h,p;Object.assign(s.observable,(h={},h[L]=l,h));var y=s.resultData;u(exports.__assign(exports.__assign({},s),{query:l.query,resultData:Object.assign(y,{previousData:((p=y.current)===null||p===void 0?void 0:p.data)||y.previousData,current:void 0})}))}if(e!==s.client||t!==s.query){var f=o(s);return u(f),[f,c]}return[s,c]}function vt(e,t){var r=ge(t.client),n=b.useContext(ht()).renderPromises,i=!!n,o=r.disableNetworkFetches,a=t.ssr!==!1&&!t.skip,s=t.partialRefetch,u=dt(r,e,t,i),c=Cr(r,e,t,n,u),f=c[0],l=f.observable,h=f.resultData,p=c[1],y=u(l);zr(h,l,r,t,y);var S=b.useMemo(function(){return Wr(l)},[l]);Nr(l,n,a);var O=Ar(h,l,r,t,y,o,s,i,{onCompleted:t.onCompleted||Ue,onError:t.onError||Ue});return{result:O,obsQueryFields:S,observable:l,resultData:h,client:r,onQueryExecuted:p}}function Ar(e,t,r,n,i,o,a,s,u){var c=b.useRef(u);b.useEffect(function(){c.current=u});var f=(s||o)&&n.ssr===!1&&!n.skip?gt:n.skip||i.fetchPolicy==="standby"?bt:void 0,l=e.previousData,h=b.useMemo(function(){return f&&me(f,l,t,r)},[r,t,f,l]);return Fr(b.useCallback(function(p){if(s)return function(){};var y=function(){var v=e.current,w=t.getCurrentResult();v&&v.loading===w.loading&&v.networkStatus===w.networkStatus&&_(v.data,w.data)||se(w,e,t,r,a,p,c.current)},S=function(v){if(O.current.unsubscribe(),O.current=t.resubscribeAfterError(y,S),!xr.call(v,"graphQLErrors"))throw v;var w=e.current;(!w||w&&w.loading||!_(v,w.error))&&se({data:w&&w.data,error:v,loading:!1,networkStatus:d.error},e,t,r,a,p,c.current)},O={current:t.subscribe(y,S)};return function(){setTimeout(function(){return O.current.unsubscribe()})}},[o,s,t,e,a,r]),function(){return h||We(e,t,c.current,a,r)},function(){return h||We(e,t,c.current,a,r)})}function Nr(e,t,r){t&&r&&(t.registerSSRObservable(e),e.getCurrentResult().loading&&t.addObservableQueryPromise(e))}function zr(e,t,r,n,i){var o;t[L]&&!_(t[L],i)&&(t.reobserve(be(t,r,n,i)),e.previousData=((o=e.current)===null||o===void 0?void 0:o.data)||e.previousData,e.current=void 0),t[L]=i}function dt(e,t,r,n){r===void 0&&(r={});var i=r.skip;r.ssr,r.onCompleted,r.onError;var o=r.defaultOptions,a=V(r,["skip","ssr","onCompleted","onError","defaultOptions"]);return function(s){var u=Object.assign(a,{query:t});return n&&(u.fetchPolicy==="network-only"||u.fetchPolicy==="cache-and-network")&&(u.fetchPolicy="cache-first"),u.variables||(u.variables={}),i?(u.initialFetchPolicy=u.initialFetchPolicy||u.fetchPolicy||ue(o,e.defaultOptions),u.fetchPolicy="standby"):u.fetchPolicy||(u.fetchPolicy=s?.options.initialFetchPolicy||ue(o,e.defaultOptions)),u}}function be(e,t,r,n){var i=[],o=t.defaultOptions.watchQuery;return o&&i.push(o),r.defaultOptions&&i.push(r.defaultOptions),i.push(R(e&&e.options,n)),i.reduce(ct)}function se(e,t,r,n,i,o,a){var s=t.current;s&&s.data&&(t.previousData=s.data),!e.error&&it(e.errors)&&(e.error=new W({graphQLErrors:e.errors})),t.current=me(Ur(e,r,i),t.previousData,r,n),o(),Lr(e,s?.networkStatus,a)}function Lr(e,t,r){if(!e.loading){var n=Vr(e);Promise.resolve().then(function(){n?r.onError(n):e.data&&t!==e.networkStatus&&e.networkStatus===d.ready&&r.onCompleted(e.data)}).catch(function(i){globalThis.__DEV__!==!1&&g.warn(i)})}}function We(e,t,r,n,i){return e.current||se(t.getCurrentResult(),e,t,i,n,function(){},r),e.current}function ue(e,t){var r;return e?.fetchPolicy||((r=t?.watchQuery)===null||r===void 0?void 0:r.fetchPolicy)||"cache-first"}function Vr(e){return it(e.errors)?new W({graphQLErrors:e.errors}):e.error}function me(e,t,r,n){var i=e.data;e.partial;var o=V(e,["data","partial"]),a=exports.__assign(exports.__assign({data:i},o),{client:n,observable:r,variables:r.variables,called:e!==gt&&e!==bt,previousData:t});return a}function Ur(e,t,r){return e.partial&&r&&!e.loading&&(!e.data||Object.keys(e.data).length===0)&&t.options.fetchPolicy!=="cache-only"?(t.refetch(),exports.__assign(exports.__assign({},e),{loading:!0,networkStatus:d.refetch})):e}var gt=ut({loading:!0,data:void 0,error:void 0,networkStatus:d.loading}),bt=ut({loading:!1,data:void 0,error:void 0,networkStatus:d.ready});function Wr(e){return{refetch:e.refetch.bind(e),reobserve:e.reobserve.bind(e),fetchMore:e.fetchMore.bind(e),updateQuery:e.updateQuery.bind(e),startPolling:e.startPolling.bind(e),stopPolling:e.stopPolling.bind(e),subscribeToMore:e.subscribeToMore.bind(e)}}exports.ApolloError=W;exports.canUseDOM=Ye;exports.createMakeWatchQueryOptions=dt;exports.equal=_;exports.getDefaultFetchPolicy=ue;exports.getObsQueryOptions=be;exports.mergeOptions=ct;exports.rehacktExports=b;exports.toQueryResult=me;exports.useApolloClient=ge;exports.useQuery=Rr;exports.useQueryInternals=vt;exports.verifyDocumentType=yt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../chunks/useAuth-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../chunks/useAuth-DPnpY3XC.js");exports.OxAuthContext=t.OxAuthContext;exports.OxAuthProvider=t.OxAuthProvider;exports.useOxAuth=t.useOxAuth;
|
package/dist/context.d.ts
CHANGED
package/dist/hooks/hooks.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../chunks/useForm-BZEaiRaa.js"),v=require("react"),A=require("../chunks/index-CjVXr8mh.js"),I=require("../chunks/useQuery-B_ce5e8f.js");var at=["refetch","reobserve","fetchMore","updateQuery","startPolling","stopPolling","subscribeToMore"];function ct(e,t){var n,r=A.rehacktExports.useRef(void 0),s=A.rehacktExports.useRef(void 0),o=A.rehacktExports.useRef(void 0),i=A.mergeOptions(t,r.current||{}),c=(n=i==null?void 0:i.query)!==null&&n!==void 0?n:e;s.current=t,o.current=c;var f=A.__assign(A.__assign({},i),{skip:!r.current}),u=I.useQueryInternals(c,f),l=u.obsQueryFields,d=u.result,w=u.client,g=u.resultData,p=u.observable,m=u.onQueryExecuted,h=p.options.initialFetchPolicy||I.getDefaultFetchPolicy(f.defaultOptions,w.defaultOptions),R=A.rehacktExports.useReducer(function(C){return C+1},0)[1],E=A.rehacktExports.useMemo(function(){for(var C={},N=function(ge){var it=l[ge];C[ge]=function(){return r.current||(r.current=Object.create(null),R()),it.apply(this,arguments)}},M=0,X=at;M<X.length;M++){var ot=X[M];N(ot)}return C},[R,l]),b=!!r.current,T=A.rehacktExports.useMemo(function(){return A.__assign(A.__assign(A.__assign({},d),E),{called:b})},[d,E,b]),S=A.rehacktExports.useCallback(function(C){r.current=C?A.__assign(A.__assign({},C),{fetchPolicy:C.fetchPolicy||h}):{fetchPolicy:h};var N=A.mergeOptions(s.current,A.__assign({query:o.current},r.current)),M=ut(g,p,w,c,A.__assign(A.__assign({},N),{skip:!1}),m).then(function(X){return Object.assign(X,E)});return M.catch(function(){}),M},[w,c,E,h,p,g,m]),x=A.rehacktExports.useRef(S);q.useIsomorphicLayoutEffect(function(){x.current=S});var L=A.rehacktExports.useCallback(function(){for(var C=[],N=0;N<arguments.length;N++)C[N]=arguments[N];return x.current.apply(x,C)},[]);return[L,T]}function ut(e,t,n,r,s,o){var i=s.query||r,c=I.createMakeWatchQueryOptions(n,i,s,!1)(t),f=t.reobserveAsConcast(I.getObsQueryOptions(t,n,s,c));return o(c),new Promise(function(u){var l;f.subscribe({next:function(d){l=d},error:function(){u(I.toQueryResult(t.getCurrentResult(),e.previousData,t,n))},complete:function(){u(I.toQueryResult(t.maskResult(l),e.previousData,t,n))}})})}const lt=(e,t)=>{const n=r=>e(r);return Object.defineProperty(n,"message",{value:t}),n};function Le(e,t){return function(){return e.apply(t,arguments)}}const{toString:ft}=Object.prototype,{getPrototypeOf:be}=Object,{iterator:ne,toStringTag:De}=Symbol,re=(e=>t=>{const n=ft.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),k=e=>(e=e.toLowerCase(),t=>re(t)===e),se=e=>t=>typeof t===e,{isArray:H}=Array,J=se("undefined");function V(e){return e!==null&&!J(e)&&e.constructor!==null&&!J(e.constructor)&&F(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Be=k("ArrayBuffer");function dt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Be(e.buffer),t}const pt=se("string"),F=se("function"),qe=se("number"),W=e=>e!==null&&typeof e=="object",ht=e=>e===!0||e===!1,G=e=>{if(re(e)!=="object")return!1;const t=be(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(De in e)&&!(ne in e)},mt=e=>{if(!W(e)||V(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},yt=k("Date"),bt=k("File"),wt=k("Blob"),Et=k("FileList"),gt=e=>W(e)&&F(e.pipe),Rt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||F(e.append)&&((t=re(e))==="formdata"||t==="object"&&F(e.toString)&&e.toString()==="[object FormData]"))},St=k("URLSearchParams"),[Ot,Tt,At,xt]=["ReadableStream","Request","Response","Headers"].map(k),Ct=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function K(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),H(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(V(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(r=0;r<i;r++)c=o[r],t.call(null,e[c],c,e)}}function je(e,t){if(V(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const D=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Me=e=>!J(e)&&e!==D;function fe(){const{caseless:e}=Me(this)&&this||{},t={},n=(r,s)=>{const o=e&&je(t,s)||s;G(t[o])&&G(r)?t[o]=fe(t[o],r):G(r)?t[o]=fe({},r):H(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&K(arguments[r],n);return t}const Pt=(e,t,n,{allOwnKeys:r}={})=>(K(t,(s,o)=>{n&&F(s)?e[o]=Le(s,n):e[o]=s},{allOwnKeys:r}),e),Ft=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),_t=(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)},Nt=(e,t,n,r)=>{let s,o,i;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&be(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kt=(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},Ut=e=>{if(!e)return null;if(H(e))return e;let t=e.length;if(!qe(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Lt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&be(Uint8Array)),Dt=(e,t)=>{const r=(e&&e[ne]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},Bt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},qt=k("HTMLFormElement"),jt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Re=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Mt=k("RegExp"),ve=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};K(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},vt=e=>{ve(e,(t,n)=>{if(F(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(F(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+"'")})}})},It=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return H(e)?r(e):r(String(e).split(t)),n},Ht=()=>{},zt=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function $t(e){return!!(e&&F(e.append)&&e[De]==="FormData"&&e[ne])}const Jt=e=>{const t=new Array(10),n=(r,s)=>{if(W(r)){if(t.indexOf(r)>=0)return;if(V(r))return r;if(!("toJSON"in r)){t[s]=r;const o=H(r)?[]:{};return K(r,(i,c)=>{const f=n(i,s+1);!J(f)&&(o[c]=f)}),t[s]=void 0,o}}return r};return n(e,0)},Vt=k("AsyncFunction"),Wt=e=>e&&(W(e)||F(e))&&F(e.then)&&F(e.catch),Ie=((e,t)=>e?setImmediate:t?((n,r)=>(D.addEventListener("message",({source:s,data:o})=>{s===D&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),D.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",F(D.postMessage)),Kt=typeof queueMicrotask<"u"?queueMicrotask.bind(D):typeof process<"u"&&process.nextTick||Ie,Qt=e=>e!=null&&F(e[ne]),a={isArray:H,isArrayBuffer:Be,isBuffer:V,isFormData:Rt,isArrayBufferView:dt,isString:pt,isNumber:qe,isBoolean:ht,isObject:W,isPlainObject:G,isEmptyObject:mt,isReadableStream:Ot,isRequest:Tt,isResponse:At,isHeaders:xt,isUndefined:J,isDate:yt,isFile:bt,isBlob:wt,isRegExp:Mt,isFunction:F,isStream:gt,isURLSearchParams:St,isTypedArray:Lt,isFileList:Et,forEach:K,merge:fe,extend:Pt,trim:Ct,stripBOM:Ft,inherits:_t,toFlatObject:Nt,kindOf:re,kindOfTest:k,endsWith:kt,toArray:Ut,forEachEntry:Dt,matchAll:Bt,isHTMLForm:qt,hasOwnProperty:Re,hasOwnProp:Re,reduceDescriptors:ve,freezeMethods:vt,toObjectSet:It,toCamelCase:jt,noop:Ht,toFiniteNumber:zt,findKey:je,global:D,isContextDefined:Me,isSpecCompliantForm:$t,toJSONObject:Jt,isAsyncFn:Vt,isThenable:Wt,setImmediate:Ie,asap:Kt,isIterable:Qt};function y(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(y,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});const He=y.prototype,ze={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{ze[e]={value:e}});Object.defineProperties(y,ze);Object.defineProperty(He,"isAxiosError",{value:!0});y.from=(e,t,n,r,s,o)=>{const i=Object.create(He);return a.toFlatObject(e,i,function(f){return f!==Error.prototype},c=>c!=="isAxiosError"),y.call(i,e.message,t,n,r,s),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};const Xt=null;function de(e){return a.isPlainObject(e)||a.isArray(e)}function $e(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Se(e,t,n){return e?e.concat(t).map(function(s,o){return s=$e(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function Gt(e){return a.isArray(e)&&!e.some(de)}const Zt=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function oe(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,h){return!a.isUndefined(h[m])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(a.isDate(p))return p.toISOString();if(a.isBoolean(p))return p.toString();if(!f&&a.isBlob(p))throw new y("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(p)||a.isTypedArray(p)?f&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function l(p,m,h){let R=p;if(p&&!h&&typeof p=="object"){if(a.endsWith(m,"{}"))m=r?m:m.slice(0,-2),p=JSON.stringify(p);else if(a.isArray(p)&&Gt(p)||(a.isFileList(p)||a.endsWith(m,"[]"))&&(R=a.toArray(p)))return m=$e(m),R.forEach(function(b,T){!(a.isUndefined(b)||b===null)&&t.append(i===!0?Se([m],T,o):i===null?m:m+"[]",u(b))}),!1}return de(p)?!0:(t.append(Se(h,m,o),u(p)),!1)}const d=[],w=Object.assign(Zt,{defaultVisitor:l,convertValue:u,isVisitable:de});function g(p,m){if(!a.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(p),a.forEach(p,function(R,E){(!(a.isUndefined(R)||R===null)&&s.call(t,R,a.isString(E)?E.trim():E,m,w))===!0&&g(R,m?m.concat(E):[E])}),d.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Oe(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function we(e,t){this._pairs=[],e&&oe(e,this,t)}const Je=we.prototype;Je.append=function(t,n){this._pairs.push([t,n])};Je.toString=function(t){const n=t?function(r){return t.call(this,r,Oe)}:Oe;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Yt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ve(e,t,n){if(!t)return e;const r=n&&n.encode||Yt;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(t,n):o=a.isURLSearchParams(t)?t.toString():new we(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Te{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const We={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},en=typeof URLSearchParams<"u"?URLSearchParams:we,tn=typeof FormData<"u"?FormData:null,nn=typeof Blob<"u"?Blob:null,rn={isBrowser:!0,classes:{URLSearchParams:en,FormData:tn,Blob:nn},protocols:["http","https","file","blob","url","data"]},Ee=typeof window<"u"&&typeof document<"u",pe=typeof navigator=="object"&&navigator||void 0,sn=Ee&&(!pe||["ReactNative","NativeScript","NS"].indexOf(pe.product)<0),on=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",an=Ee&&window.location.href||"http://localhost",cn=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ee,hasStandardBrowserEnv:sn,hasStandardBrowserWebWorkerEnv:on,navigator:pe,origin:an},Symbol.toStringTag,{value:"Module"})),P={...cn,...rn};function un(e,t){return oe(e,new P.classes.URLSearchParams,{visitor:function(n,r,s,o){return P.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function ln(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function fn(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function Ke(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),f=o>=n.length;return i=!i&&a.isArray(s)?s.length:i,f?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!c):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=fn(s[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(ln(r),s,n,0)}),n}return null}function dn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Q={transitional:We,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(Ke(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return un(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return oe(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),dn(t)):t}],transformResponse:[function(t){const n=this.transitional||Q.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(i)throw c.name==="SyntaxError"?y.from(c,y.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:P.classes.FormData,Blob:P.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{Q.headers[e]={}});const pn=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),hn=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
2
|
-
`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&
|
|
3
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Ae]=this[Ae]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=$(i);r[c]||(wn(s,i),r[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}};_.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(_.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});a.freezeMethods(_);function ue(e,t){const n=this||Q,r=t||n,s=_.from(r.headers);let o=r.data;return a.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function Qe(e){return!!(e&&e.__CANCEL__)}function z(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(z,y,{__CANCEL__:!0});function Xe(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function En(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function gn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(f){const u=Date.now(),l=r[o];i||(i=u),n[s]=f,r[s]=u;let d=o,w=0;for(;d!==s;)w+=n[d++],d=d%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const g=l&&u-l;return g?Math.round(w*1e3/g):void 0}}function Rn(e,t){let n=0,r=1e3/t,s,o;const i=(u,l=Date.now())=>{n=l,s=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const l=Date.now(),d=l-n;d>=r?i(u,l):(s=u,o||(o=setTimeout(()=>{o=null,i(s)},r-d)))},()=>s&&i(s)]}const ee=(e,t,n=3)=>{let r=0;const s=gn(50,250);return Rn(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,f=i-r,u=s(f),l=i<=c;r=i;const d={loaded:i,total:c,progress:c?i/c:void 0,bytes:f,rate:u||void 0,estimated:u&&c&&l?(c-i)/u:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(d)},n)},xe=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ce=e=>(...t)=>a.asap(()=>e(...t)),Sn=P.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,P.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(P.origin),P.navigator&&/(msie|trident)/i.test(P.navigator.userAgent)):()=>!0,On=P.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const i=[e+"="+encodeURIComponent(t)];a.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),a.isString(r)&&i.push("path="+r),a.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Tn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function An(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ge(e,t,n){let r=!Tn(t);return e&&(r||n==!1)?An(e,t):t}const Pe=e=>e instanceof _?{...e}:e;function j(e,t){t=t||{};const n={};function r(u,l,d,w){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:w},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(u,l,d,w){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u,d,w)}else return r(u,l,d,w)}function o(u,l){if(!a.isUndefined(l))return r(void 0,l)}function i(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,l)}function c(u,l,d){if(d in t)return r(u,l);if(d in e)return r(void 0,u)}const f={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(u,l,d)=>s(Pe(u),Pe(l),d,!0)};return a.forEach(Object.keys({...e,...t}),function(l){const d=f[l]||s,w=d(e[l],t[l],l);a.isUndefined(w)&&d!==c||(n[l]=w)}),n}const Ze=e=>{const t=j({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=t;t.headers=i=_.from(i),t.url=Ve(Ge(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let f;if(a.isFormData(n)){if(P.hasStandardBrowserEnv||P.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((f=i.getContentType())!==!1){const[u,...l]=f?f.split(";").map(d=>d.trim()).filter(Boolean):[];i.setContentType([u||"multipart/form-data",...l].join("; "))}}if(P.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&Sn(t.url))){const u=s&&o&&On.read(o);u&&i.set(s,u)}return t},xn=typeof XMLHttpRequest<"u",Cn=xn&&function(e){return new Promise(function(n,r){const s=Ze(e);let o=s.data;const i=_.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:u}=s,l,d,w,g,p;function m(){g&&g(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function R(){if(!h)return;const b=_.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),S={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:b,config:e,request:h};Xe(function(L){n(L),m()},function(L){r(L),m()},S),h=null}"onloadend"in h?h.onloadend=R:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(R)},h.onabort=function(){h&&(r(new y("Request aborted",y.ECONNABORTED,e,h)),h=null)},h.onerror=function(){r(new y("Network Error",y.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let T=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const S=s.transitional||We;s.timeoutErrorMessage&&(T=s.timeoutErrorMessage),r(new y(T,S.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,h)),h=null},o===void 0&&i.setContentType(null),"setRequestHeader"in h&&a.forEach(i.toJSON(),function(T,S){h.setRequestHeader(S,T)}),a.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),c&&c!=="json"&&(h.responseType=s.responseType),u&&([w,p]=ee(u,!0),h.addEventListener("progress",w)),f&&h.upload&&([d,g]=ee(f),h.upload.addEventListener("progress",d),h.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(l=b=>{h&&(r(!b||b.type?new z(null,e,h):b),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const E=En(s.url);if(E&&P.protocols.indexOf(E)===-1){r(new y("Unsupported protocol "+E+":",y.ERR_BAD_REQUEST,e));return}h.send(o||null)})},Pn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(u){if(!s){s=!0,c();const l=u instanceof Error?u:this.reason;r.abort(l instanceof y?l:new z(l instanceof Error?l.message:l))}};let i=t&&setTimeout(()=>{i=null,o(new y(`timeout ${t} of ms exceeded`,y.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:f}=r;return f.unsubscribe=()=>a.asap(c),f}},Fn=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},_n=async function*(e,t){for await(const n of Nn(e))yield*Fn(n,t)},Nn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Fe=(e,t,n,r)=>{const s=_n(e,t);let o=0,i,c=f=>{i||(i=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:u,value:l}=await s.next();if(u){c(),f.close();return}let d=l.byteLength;if(n){let w=o+=d;n(w)}f.enqueue(new Uint8Array(l))}catch(u){throw c(u),u}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},ie=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ye=ie&&typeof ReadableStream=="function",kn=ie&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),et=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Un=Ye&&et(()=>{let e=!1;const t=new Request(P.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),_e=64*1024,he=Ye&&et(()=>a.isReadableStream(new Response("").body)),te={stream:he&&(e=>e.body)};ie&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!te[t]&&(te[t]=a.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new y(`Response type '${t}' is not supported`,y.ERR_NOT_SUPPORT,r)})})})(new Response);const Ln=async e=>{if(e==null)return 0;if(a.isBlob(e))return e.size;if(a.isSpecCompliantForm(e))return(await new Request(P.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(a.isArrayBufferView(e)||a.isArrayBuffer(e))return e.byteLength;if(a.isURLSearchParams(e)&&(e=e+""),a.isString(e))return(await kn(e)).byteLength},Dn=async(e,t)=>{const n=a.toFiniteNumber(e.getContentLength());return n??Ln(t)},Bn=ie&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:o,timeout:i,onDownloadProgress:c,onUploadProgress:f,responseType:u,headers:l,withCredentials:d="same-origin",fetchOptions:w}=Ze(e);u=u?(u+"").toLowerCase():"text";let g=Pn([s,o&&o.toAbortSignal()],i),p;const m=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let h;try{if(f&&Un&&n!=="get"&&n!=="head"&&(h=await Dn(l,r))!==0){let S=new Request(t,{method:"POST",body:r,duplex:"half"}),x;if(a.isFormData(r)&&(x=S.headers.get("content-type"))&&l.setContentType(x),S.body){const[L,C]=xe(h,ee(Ce(f)));r=Fe(S.body,_e,L,C)}}a.isString(d)||(d=d?"include":"omit");const R="credentials"in Request.prototype;p=new Request(t,{...w,signal:g,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:r,duplex:"half",credentials:R?d:void 0});let E=await fetch(p,w);const b=he&&(u==="stream"||u==="response");if(he&&(c||b&&m)){const S={};["status","statusText","headers"].forEach(N=>{S[N]=E[N]});const x=a.toFiniteNumber(E.headers.get("content-length")),[L,C]=c&&xe(x,ee(Ce(c),!0))||[];E=new Response(Fe(E.body,_e,L,()=>{C&&C(),m&&m()}),S)}u=u||"text";let T=await te[a.findKey(te,u)||"text"](E,e);return!b&&m&&m(),await new Promise((S,x)=>{Xe(S,x,{data:T,headers:_.from(E.headers),status:E.status,statusText:E.statusText,config:e,request:p})})}catch(R){throw m&&m(),R&&R.name==="TypeError"&&/Load failed|fetch/i.test(R.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,e,p),{cause:R.cause||R}):y.from(R,R&&R.code,e,p)}}),me={http:Xt,xhr:Cn,fetch:Bn};a.forEach(me,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ne=e=>`- ${e}`,qn=e=>a.isFunction(e)||e===null||e===!1,tt={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let o=0;o<t;o++){n=e[o];let i;if(r=n,!qn(n)&&(r=me[(i=String(n)).toLowerCase()],r===void 0))throw new y(`Unknown adapter '${i}'`);if(r)break;s[i||"#"+o]=r}if(!r){const o=Object.entries(s).map(([c,f])=>`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since :
|
|
4
|
-
`+o.map(
|
|
5
|
-
`):" "+
|
|
6
|
-
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=j(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../chunks/useForm-DUviJ7xS.js"),v=require("react"),S=require("../chunks/useQuery-DTNHO7so.js");var it=["refetch","reobserve","fetchMore","updateQuery","startPolling","stopPolling","subscribeToMore"];function at(e,t){var n,r=S.rehacktExports.useRef(void 0),s=S.rehacktExports.useRef(void 0),o=S.rehacktExports.useRef(void 0),i=S.mergeOptions(t,r.current||{}),c=(n=i?.query)!==null&&n!==void 0?n:e;s.current=t,o.current=c;var f=S.__assign(S.__assign({},i),{skip:!r.current}),u=S.useQueryInternals(c,f),l=u.obsQueryFields,d=u.result,w=u.client,g=u.resultData,p=u.observable,m=u.onQueryExecuted,h=p.options.initialFetchPolicy||S.getDefaultFetchPolicy(f.defaultOptions,w.defaultOptions),R=S.rehacktExports.useReducer(function(C){return C+1},0)[1],E=S.rehacktExports.useMemo(function(){for(var C={},N=function(Ee){var ot=l[Ee];C[Ee]=function(){return r.current||(r.current=Object.create(null),R()),ot.apply(this,arguments)}},M=0,Q=it;M<Q.length;M++){var st=Q[M];N(st)}return C},[R,l]),b=!!r.current,A=S.rehacktExports.useMemo(function(){return S.__assign(S.__assign(S.__assign({},d),E),{called:b})},[d,E,b]),O=S.rehacktExports.useCallback(function(C){r.current=C?S.__assign(S.__assign({},C),{fetchPolicy:C.fetchPolicy||h}):{fetchPolicy:h};var N=S.mergeOptions(s.current,S.__assign({query:o.current},r.current)),M=ct(g,p,w,c,S.__assign(S.__assign({},N),{skip:!1}),m).then(function(Q){return Object.assign(Q,E)});return M.catch(function(){}),M},[w,c,E,h,p,g,m]),x=S.rehacktExports.useRef(O);q.useIsomorphicLayoutEffect(function(){x.current=O});var L=S.rehacktExports.useCallback(function(){for(var C=[],N=0;N<arguments.length;N++)C[N]=arguments[N];return x.current.apply(x,C)},[]);return[L,A]}function ct(e,t,n,r,s,o){var i=s.query||r,c=S.createMakeWatchQueryOptions(n,i,s,!1)(t),f=t.reobserveAsConcast(S.getObsQueryOptions(t,n,s,c));return o(c),new Promise(function(u){var l;f.subscribe({next:function(d){l=d},error:function(){u(S.toQueryResult(t.getCurrentResult(),e.previousData,t,n))},complete:function(){u(S.toQueryResult(t.maskResult(l),e.previousData,t,n))}})})}const ut=(e,t)=>{const n=r=>e(r);return Object.defineProperty(n,"message",{value:t}),n};function Ue(e,t){return function(){return e.apply(t,arguments)}}const{toString:lt}=Object.prototype,{getPrototypeOf:ye}=Object,{iterator:te,toStringTag:Le}=Symbol,ne=(e=>t=>{const n=lt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),k=e=>(e=e.toLowerCase(),t=>ne(t)===e),re=e=>t=>typeof t===e,{isArray:I}=Array,$=re("undefined");function J(e){return e!==null&&!$(e)&&e.constructor!==null&&!$(e.constructor)&&P(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const De=k("ArrayBuffer");function ft(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&De(e.buffer),t}const dt=re("string"),P=re("function"),Be=re("number"),V=e=>e!==null&&typeof e=="object",pt=e=>e===!0||e===!1,X=e=>{if(ne(e)!=="object")return!1;const t=ye(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Le in e)&&!(te in e)},ht=e=>{if(!V(e)||J(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},mt=k("Date"),yt=k("File"),bt=k("Blob"),wt=k("FileList"),Et=e=>V(e)&&P(e.pipe),gt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||P(e.append)&&((t=ne(e))==="formdata"||t==="object"&&P(e.toString)&&e.toString()==="[object FormData]"))},Rt=k("URLSearchParams"),[St,Ot,Tt,At]=["ReadableStream","Request","Response","Headers"].map(k),xt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function W(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),I(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(J(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(r=0;r<i;r++)c=o[r],t.call(null,e[c],c,e)}}function qe(e,t){if(J(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const D=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,je=e=>!$(e)&&e!==D;function le(){const{caseless:e}=je(this)&&this||{},t={},n=(r,s)=>{const o=e&&qe(t,s)||s;X(t[o])&&X(r)?t[o]=le(t[o],r):X(r)?t[o]=le({},r):I(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&W(arguments[r],n);return t}const Ct=(e,t,n,{allOwnKeys:r}={})=>(W(t,(s,o)=>{n&&P(s)?e[o]=Ue(s,n):e[o]=s},{allOwnKeys:r}),e),Ft=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Pt=(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)},_t=(e,t,n,r)=>{let s,o,i;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&ye(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Nt=(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},kt=e=>{if(!e)return null;if(I(e))return e;let t=e.length;if(!Be(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Ut=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ye(Uint8Array)),Lt=(e,t)=>{const r=(e&&e[te]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},Dt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Bt=k("HTMLFormElement"),qt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),ge=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),jt=k("RegExp"),Me=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};W(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},Mt=e=>{Me(e,(t,n)=>{if(P(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(P(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+"'")})}})},vt=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return I(e)?r(e):r(String(e).split(t)),n},It=()=>{},Ht=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function zt(e){return!!(e&&P(e.append)&&e[Le]==="FormData"&&e[te])}const $t=e=>{const t=new Array(10),n=(r,s)=>{if(V(r)){if(t.indexOf(r)>=0)return;if(J(r))return r;if(!("toJSON"in r)){t[s]=r;const o=I(r)?[]:{};return W(r,(i,c)=>{const f=n(i,s+1);!$(f)&&(o[c]=f)}),t[s]=void 0,o}}return r};return n(e,0)},Jt=k("AsyncFunction"),Vt=e=>e&&(V(e)||P(e))&&P(e.then)&&P(e.catch),ve=((e,t)=>e?setImmediate:t?((n,r)=>(D.addEventListener("message",({source:s,data:o})=>{s===D&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),D.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",P(D.postMessage)),Wt=typeof queueMicrotask<"u"?queueMicrotask.bind(D):typeof process<"u"&&process.nextTick||ve,Kt=e=>e!=null&&P(e[te]),a={isArray:I,isArrayBuffer:De,isBuffer:J,isFormData:gt,isArrayBufferView:ft,isString:dt,isNumber:Be,isBoolean:pt,isObject:V,isPlainObject:X,isEmptyObject:ht,isReadableStream:St,isRequest:Ot,isResponse:Tt,isHeaders:At,isUndefined:$,isDate:mt,isFile:yt,isBlob:bt,isRegExp:jt,isFunction:P,isStream:Et,isURLSearchParams:Rt,isTypedArray:Ut,isFileList:wt,forEach:W,merge:le,extend:Ct,trim:xt,stripBOM:Ft,inherits:Pt,toFlatObject:_t,kindOf:ne,kindOfTest:k,endsWith:Nt,toArray:kt,forEachEntry:Lt,matchAll:Dt,isHTMLForm:Bt,hasOwnProperty:ge,hasOwnProp:ge,reduceDescriptors:Me,freezeMethods:Mt,toObjectSet:vt,toCamelCase:qt,noop:It,toFiniteNumber:Ht,findKey:qe,global:D,isContextDefined:je,isSpecCompliantForm:zt,toJSONObject:$t,isAsyncFn:Jt,isThenable:Vt,setImmediate:ve,asap:Wt,isIterable:Kt};function y(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(y,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});const Ie=y.prototype,He={};["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=>{He[e]={value:e}});Object.defineProperties(y,He);Object.defineProperty(Ie,"isAxiosError",{value:!0});y.from=(e,t,n,r,s,o)=>{const i=Object.create(Ie);return a.toFlatObject(e,i,function(f){return f!==Error.prototype},c=>c!=="isAxiosError"),y.call(i,e.message,t,n,r,s),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};const Qt=null;function fe(e){return a.isPlainObject(e)||a.isArray(e)}function ze(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Re(e,t,n){return e?e.concat(t).map(function(s,o){return s=ze(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function Xt(e){return a.isArray(e)&&!e.some(fe)}const Gt=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function se(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,h){return!a.isUndefined(h[m])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(a.isDate(p))return p.toISOString();if(a.isBoolean(p))return p.toString();if(!f&&a.isBlob(p))throw new y("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(p)||a.isTypedArray(p)?f&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function l(p,m,h){let R=p;if(p&&!h&&typeof p=="object"){if(a.endsWith(m,"{}"))m=r?m:m.slice(0,-2),p=JSON.stringify(p);else if(a.isArray(p)&&Xt(p)||(a.isFileList(p)||a.endsWith(m,"[]"))&&(R=a.toArray(p)))return m=ze(m),R.forEach(function(b,A){!(a.isUndefined(b)||b===null)&&t.append(i===!0?Re([m],A,o):i===null?m:m+"[]",u(b))}),!1}return fe(p)?!0:(t.append(Re(h,m,o),u(p)),!1)}const d=[],w=Object.assign(Gt,{defaultVisitor:l,convertValue:u,isVisitable:fe});function g(p,m){if(!a.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(p),a.forEach(p,function(R,E){(!(a.isUndefined(R)||R===null)&&s.call(t,R,a.isString(E)?E.trim():E,m,w))===!0&&g(R,m?m.concat(E):[E])}),d.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Se(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function be(e,t){this._pairs=[],e&&se(e,this,t)}const $e=be.prototype;$e.append=function(t,n){this._pairs.push([t,n])};$e.toString=function(t){const n=t?function(r){return t.call(this,r,Se)}:Se;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Zt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Je(e,t,n){if(!t)return e;const r=n&&n.encode||Zt;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(t,n):o=a.isURLSearchParams(t)?t.toString():new be(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Oe{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Ve={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Yt=typeof URLSearchParams<"u"?URLSearchParams:be,en=typeof FormData<"u"?FormData:null,tn=typeof Blob<"u"?Blob:null,nn={isBrowser:!0,classes:{URLSearchParams:Yt,FormData:en,Blob:tn},protocols:["http","https","file","blob","url","data"]},we=typeof window<"u"&&typeof document<"u",de=typeof navigator=="object"&&navigator||void 0,rn=we&&(!de||["ReactNative","NativeScript","NS"].indexOf(de.product)<0),sn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",on=we&&window.location.href||"http://localhost",an=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:we,hasStandardBrowserEnv:rn,hasStandardBrowserWebWorkerEnv:sn,navigator:de,origin:on},Symbol.toStringTag,{value:"Module"})),F={...an,...nn};function cn(e,t){return se(e,new F.classes.URLSearchParams,{visitor:function(n,r,s,o){return F.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function un(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function ln(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function We(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),f=o>=n.length;return i=!i&&a.isArray(s)?s.length:i,f?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!c):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=ln(s[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(un(r),s,n,0)}),n}return null}function fn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const K={transitional:Ve,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(We(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return cn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return se(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),fn(t)):t}],transformResponse:[function(t){const n=this.transitional||K.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(i)throw c.name==="SyntaxError"?y.from(c,y.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:F.classes.FormData,Blob:F.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{K.headers[e]={}});const dn=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),pn=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
2
|
+
`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&dn[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Te=Symbol("internals");function z(e){return e&&String(e).trim().toLowerCase()}function G(e){return e===!1||e==null?e:a.isArray(e)?e.map(G):String(e)}function hn(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const mn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ae(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function yn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function bn(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}let _=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,f,u){const l=z(f);if(!l)throw new Error("header name must be a non-empty string");const d=a.findKey(s,l);(!d||s[d]===void 0||u===!0||u===void 0&&s[d]!==!1)&&(s[d||f]=G(c))}const i=(c,f)=>a.forEach(c,(u,l)=>o(u,l,f));if(a.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(a.isString(t)&&(t=t.trim())&&!mn(t))i(pn(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},f,u;for(const l of t){if(!a.isArray(l))throw TypeError("Object iterator must return a key-value pair");c[u=l[0]]=(f=c[u])?a.isArray(f)?[...f,l[1]]:[f,l[1]]:l[1]}i(c,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=z(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return hn(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=z(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ae(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=z(i),i){const c=a.findKey(r,i);c&&(!n||ae(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||ae(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,o)=>{const i=a.findKey(r,o);if(i){n[i]=G(s),delete n[o];return}const c=t?yn(o):String(o).trim();c!==o&&delete n[o],n[c]=G(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
3
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Te]=this[Te]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=z(i);r[c]||(bn(s,i),r[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}};_.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(_.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});a.freezeMethods(_);function ce(e,t){const n=this||K,r=t||n,s=_.from(r.headers);let o=r.data;return a.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function Ke(e){return!!(e&&e.__CANCEL__)}function H(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(H,y,{__CANCEL__:!0});function Qe(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function wn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function En(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(f){const u=Date.now(),l=r[o];i||(i=u),n[s]=f,r[s]=u;let d=o,w=0;for(;d!==s;)w+=n[d++],d=d%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const g=l&&u-l;return g?Math.round(w*1e3/g):void 0}}function gn(e,t){let n=0,r=1e3/t,s,o;const i=(u,l=Date.now())=>{n=l,s=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const l=Date.now(),d=l-n;d>=r?i(u,l):(s=u,o||(o=setTimeout(()=>{o=null,i(s)},r-d)))},()=>s&&i(s)]}const Y=(e,t,n=3)=>{let r=0;const s=En(50,250);return gn(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,f=i-r,u=s(f),l=i<=c;r=i;const d={loaded:i,total:c,progress:c?i/c:void 0,bytes:f,rate:u||void 0,estimated:u&&c&&l?(c-i)/u:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(d)},n)},Ae=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},xe=e=>(...t)=>a.asap(()=>e(...t)),Rn=F.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,F.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(F.origin),F.navigator&&/(msie|trident)/i.test(F.navigator.userAgent)):()=>!0,Sn=F.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const i=[e+"="+encodeURIComponent(t)];a.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),a.isString(r)&&i.push("path="+r),a.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function On(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Tn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Xe(e,t,n){let r=!On(t);return e&&(r||n==!1)?Tn(e,t):t}const Ce=e=>e instanceof _?{...e}:e;function j(e,t){t=t||{};const n={};function r(u,l,d,w){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:w},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(u,l,d,w){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u,d,w)}else return r(u,l,d,w)}function o(u,l){if(!a.isUndefined(l))return r(void 0,l)}function i(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,l)}function c(u,l,d){if(d in t)return r(u,l);if(d in e)return r(void 0,u)}const f={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(u,l,d)=>s(Ce(u),Ce(l),d,!0)};return a.forEach(Object.keys({...e,...t}),function(l){const d=f[l]||s,w=d(e[l],t[l],l);a.isUndefined(w)&&d!==c||(n[l]=w)}),n}const Ge=e=>{const t=j({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=t;t.headers=i=_.from(i),t.url=Je(Xe(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let f;if(a.isFormData(n)){if(F.hasStandardBrowserEnv||F.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((f=i.getContentType())!==!1){const[u,...l]=f?f.split(";").map(d=>d.trim()).filter(Boolean):[];i.setContentType([u||"multipart/form-data",...l].join("; "))}}if(F.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&Rn(t.url))){const u=s&&o&&Sn.read(o);u&&i.set(s,u)}return t},An=typeof XMLHttpRequest<"u",xn=An&&function(e){return new Promise(function(n,r){const s=Ge(e);let o=s.data;const i=_.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:u}=s,l,d,w,g,p;function m(){g&&g(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function R(){if(!h)return;const b=_.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),O={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:b,config:e,request:h};Qe(function(L){n(L),m()},function(L){r(L),m()},O),h=null}"onloadend"in h?h.onloadend=R:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(R)},h.onabort=function(){h&&(r(new y("Request aborted",y.ECONNABORTED,e,h)),h=null)},h.onerror=function(){r(new y("Network Error",y.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let A=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const O=s.transitional||Ve;s.timeoutErrorMessage&&(A=s.timeoutErrorMessage),r(new y(A,O.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,h)),h=null},o===void 0&&i.setContentType(null),"setRequestHeader"in h&&a.forEach(i.toJSON(),function(A,O){h.setRequestHeader(O,A)}),a.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),c&&c!=="json"&&(h.responseType=s.responseType),u&&([w,p]=Y(u,!0),h.addEventListener("progress",w)),f&&h.upload&&([d,g]=Y(f),h.upload.addEventListener("progress",d),h.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(l=b=>{h&&(r(!b||b.type?new H(null,e,h):b),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const E=wn(s.url);if(E&&F.protocols.indexOf(E)===-1){r(new y("Unsupported protocol "+E+":",y.ERR_BAD_REQUEST,e));return}h.send(o||null)})},Cn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(u){if(!s){s=!0,c();const l=u instanceof Error?u:this.reason;r.abort(l instanceof y?l:new H(l instanceof Error?l.message:l))}};let i=t&&setTimeout(()=>{i=null,o(new y(`timeout ${t} of ms exceeded`,y.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:f}=r;return f.unsubscribe=()=>a.asap(c),f}},Fn=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},Pn=async function*(e,t){for await(const n of _n(e))yield*Fn(n,t)},_n=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Fe=(e,t,n,r)=>{const s=Pn(e,t);let o=0,i,c=f=>{i||(i=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:u,value:l}=await s.next();if(u){c(),f.close();return}let d=l.byteLength;if(n){let w=o+=d;n(w)}f.enqueue(new Uint8Array(l))}catch(u){throw c(u),u}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},oe=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ze=oe&&typeof ReadableStream=="function",Nn=oe&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Ye=(e,...t)=>{try{return!!e(...t)}catch{return!1}},kn=Ze&&Ye(()=>{let e=!1;const t=new Request(F.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Pe=64*1024,pe=Ze&&Ye(()=>a.isReadableStream(new Response("").body)),ee={stream:pe&&(e=>e.body)};oe&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ee[t]&&(ee[t]=a.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new y(`Response type '${t}' is not supported`,y.ERR_NOT_SUPPORT,r)})})})(new Response);const Un=async e=>{if(e==null)return 0;if(a.isBlob(e))return e.size;if(a.isSpecCompliantForm(e))return(await new Request(F.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(a.isArrayBufferView(e)||a.isArrayBuffer(e))return e.byteLength;if(a.isURLSearchParams(e)&&(e=e+""),a.isString(e))return(await Nn(e)).byteLength},Ln=async(e,t)=>{const n=a.toFiniteNumber(e.getContentLength());return n??Un(t)},Dn=oe&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:o,timeout:i,onDownloadProgress:c,onUploadProgress:f,responseType:u,headers:l,withCredentials:d="same-origin",fetchOptions:w}=Ge(e);u=u?(u+"").toLowerCase():"text";let g=Cn([s,o&&o.toAbortSignal()],i),p;const m=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let h;try{if(f&&kn&&n!=="get"&&n!=="head"&&(h=await Ln(l,r))!==0){let O=new Request(t,{method:"POST",body:r,duplex:"half"}),x;if(a.isFormData(r)&&(x=O.headers.get("content-type"))&&l.setContentType(x),O.body){const[L,C]=Ae(h,Y(xe(f)));r=Fe(O.body,Pe,L,C)}}a.isString(d)||(d=d?"include":"omit");const R="credentials"in Request.prototype;p=new Request(t,{...w,signal:g,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:r,duplex:"half",credentials:R?d:void 0});let E=await fetch(p,w);const b=pe&&(u==="stream"||u==="response");if(pe&&(c||b&&m)){const O={};["status","statusText","headers"].forEach(N=>{O[N]=E[N]});const x=a.toFiniteNumber(E.headers.get("content-length")),[L,C]=c&&Ae(x,Y(xe(c),!0))||[];E=new Response(Fe(E.body,Pe,L,()=>{C&&C(),m&&m()}),O)}u=u||"text";let A=await ee[a.findKey(ee,u)||"text"](E,e);return!b&&m&&m(),await new Promise((O,x)=>{Qe(O,x,{data:A,headers:_.from(E.headers),status:E.status,statusText:E.statusText,config:e,request:p})})}catch(R){throw m&&m(),R&&R.name==="TypeError"&&/Load failed|fetch/i.test(R.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,e,p),{cause:R.cause||R}):y.from(R,R&&R.code,e,p)}}),he={http:Qt,xhr:xn,fetch:Dn};a.forEach(he,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const _e=e=>`- ${e}`,Bn=e=>a.isFunction(e)||e===null||e===!1,et={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let o=0;o<t;o++){n=e[o];let i;if(r=n,!Bn(n)&&(r=he[(i=String(n)).toLowerCase()],r===void 0))throw new y(`Unknown adapter '${i}'`);if(r)break;s[i||"#"+o]=r}if(!r){const o=Object.entries(s).map(([c,f])=>`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since :
|
|
4
|
+
`+o.map(_e).join(`
|
|
5
|
+
`):" "+_e(o[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:he};function ue(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new H(null,e)}function Ne(e){return ue(e),e.headers=_.from(e.headers),e.data=ce.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),et.getAdapter(e.adapter||K.adapter)(e).then(function(r){return ue(e),r.data=ce.call(e,e.transformResponse,r),r.headers=_.from(r.headers),r},function(r){return Ke(r)||(ue(e),r&&r.response&&(r.response.data=ce.call(e,e.transformResponse,r.response),r.response.headers=_.from(r.response.headers))),Promise.reject(r)})}const tt="1.11.0",ie={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ie[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ke={};ie.transitional=function(t,n,r){function s(o,i){return"[Axios v"+tt+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,c)=>{if(t===!1)throw new y(s(i," has been removed"+(n?" in "+n:"")),y.ERR_DEPRECATED);return n&&!ke[i]&&(ke[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}};ie.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function qn(e,t,n){if(typeof e!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const c=e[o],f=c===void 0||i(c,o,e);if(f!==!0)throw new y("option "+o+" must be "+f,y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new y("Unknown option "+o,y.ERR_BAD_OPTION)}}const Z={assertOptions:qn,validators:ie},U=Z.validators;let B=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Oe,response:new Oe}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
6
|
+
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=j(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&Z.assertOptions(r,{silentJSONParsing:U.transitional(U.boolean),forcedJSONParsing:U.transitional(U.boolean),clarifyTimeoutError:U.transitional(U.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:Z.assertOptions(s,{encode:U.function,serialize:U.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Z.assertOptions(n,{baseUrl:U.spelling("baseURL"),withXsrfToken:U.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=_.concat(i,o);const c=[];let f=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(f=f&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let l,d=0,w;if(!f){const p=[Ne.bind(this),void 0];for(p.unshift(...c),p.push(...u),w=p.length,l=Promise.resolve(n);d<w;)l=l.then(p[d++],p[d++]);return l}w=c.length;let g=n;for(d=0;d<w;){const p=c[d++],m=c[d++];try{g=p(g)}catch(h){m.call(this,h);break}}try{l=Ne.call(this,g)}catch(p){return Promise.reject(p)}for(d=0,w=u.length;d<w;)l=l.then(u[d++],u[d++]);return l}getUri(t){t=j(this.defaults,t);const n=Xe(t.baseURL,t.url,t.allowAbsoluteUrls);return Je(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){B.prototype[t]=function(n,r){return this.request(j(r||{},{method:t,url:n,data:(r||{}).data}))}});a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request(j(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}B.prototype[t]=n(),B.prototype[t+"Form"]=n(!0)});let jn=class nt{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new H(o,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new nt(function(s){t=s}),cancel:t}}};function Mn(e){return function(n){return e.apply(null,n)}}function vn(e){return a.isObject(e)&&e.isAxiosError===!0}const me={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(me).forEach(([e,t])=>{me[t]=e});function rt(e){const t=new B(e),n=Ue(B.prototype.request,t);return a.extend(n,B.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return rt(j(e,s))},n}const T=rt(K);T.Axios=B;T.CanceledError=H;T.CancelToken=jn;T.isCancel=Ke;T.VERSION=tt;T.toFormData=se;T.AxiosError=y;T.Cancel=T.CanceledError;T.all=function(t){return Promise.all(t)};T.spread=Mn;T.isAxiosError=vn;T.mergeConfig=j;T.AxiosHeaders=_;T.formToJSON=e=>We(a.isHTMLForm(e)?new FormData(e):e);T.getAdapter=et.getAdapter;T.HttpStatusCode=me;T.default=T;const{Axios:Jn,AxiosError:Vn,CanceledError:Wn,isCancel:Kn,CancelToken:Qn,VERSION:Xn,all:Gn,Cancel:Zn,isAxiosError:Yn,spread:er,toFormData:tr,AxiosHeaders:nr,HttpStatusCode:rr,formToJSON:sr,getAdapter:or,mergeConfig:ir}=T,In=({endpoint:e,headers:t={},initialData:n,validationRules:r})=>{const s=q.useFormState({initialData:n,validationRules:r}),[o,i]=v.useState(!1),c=v.useRef(null),f=v.useCallback((l={})=>{const{onBefore:d=()=>{},onCancel:w=()=>{},onError:g=()=>{},onFinish:p=()=>{},onSuccess:m=()=>{},onUpload:h=()=>{},skipValidation:R=!1}=l;if(!R&&!s.validate())return;const E=new FormData;Object.entries(s.data).forEach(([b,A])=>{Array.isArray(A)?A.forEach(O=>{O instanceof File?E.append(b,O):E.append(b,String(O))}):A instanceof File?E.append(b,A):E.append(b,String(A))}),d?.(),i(!0),c.current=new AbortController,T.post(e,E,{headers:{"Content-Type":"multipart/form-data",...t},signal:c.current.signal,onUploadProgress:b=>{h?.(b)}}).then(b=>{m?.(b)}).catch(b=>{T.isCancel(b)?w?.(b):g?.(b)}).finally(()=>{p?.(),i(!1),c.current=null})},[e,t,s]),u=v.useCallback(()=>{c.current&&c.current.abort("Upload cancelled by user")},[]);return{...s,upload:f,isUploading:o,cancel:u}},Hn=({headers:e={},initialData:t,options:n={},query:r,validationRules:s})=>{const{data:o,setData:i,validate:c,...f}=q.useFormState({initialData:t,validationRules:s}),[u,{data:l,error:d,loading:w,refetch:g}]=at(r,{fetchPolicy:"network-only",errorPolicy:"all",notifyOnNetworkStatusChange:!0,...n}),p=v.useCallback((h={})=>{const{onBefore:R=()=>{},onError:E=()=>{},onFinish:b=()=>{},onSuccess:A=()=>{},skipValidation:O=!1}=h;!O&&!c()||(R?.(),u({variables:{filters:o},...!q.isEmpty(e)&&{context:{headers:e}}}).then(x=>{A?.(x)}).catch(x=>{E?.(x)}).finally(()=>{b?.()}))},[o,u,e,c]),m=v.useCallback(()=>{g&&g({filters:o})},[g,o]);return{...f,validate:c,filter:o,setFilter:i,isLoading:w,query:p,refetch:m,data:l,error:d}};exports.handleRules=q.handleRules;exports.useForm=q.useForm;exports.useFormState=q.useFormState;exports.useFileUpload=In;exports.useFilter=Hn;exports.validator=ut;
|