@nside/wefa 0.4.4 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/LegalConsent-BxOWAO0s.js +126 -0
- package/dist/LegalConsent-ChW-GYBv.cjs +1 -0
- package/dist/LegalDocument-BM4HLw9A.js +1580 -0
- package/dist/LegalDocument-hhYW9BBO.cjs +114 -0
- package/dist/LoginView-BpDNpbMQ.cjs +1 -0
- package/dist/LoginView-bUKvV6JV.js +17 -0
- package/dist/LogoutView-BrAt0b2J.js +16 -0
- package/dist/LogoutView-D7D3LcfL.cjs +1 -0
- package/dist/angledown-DgMf_Vjv.cjs +2 -0
- package/dist/angledown-igq2UW-u.js +46 -0
- package/dist/badge-2r_VjcsG.js +102 -0
- package/dist/badge-DPwocFJ8.cjs +76 -0
- package/dist/basecomponent-CGerMr_k.cjs +146 -0
- package/dist/basecomponent-CRTLSsqZ.js +1278 -0
- package/dist/baseeditableholder-BEn83TQE.js +126 -0
- package/dist/baseeditableholder-Q1_XheNU.cjs +1 -0
- package/dist/baseicon-Ct8wtBEp.cjs +34 -0
- package/dist/baseicon-DdvhP0UT.js +90 -0
- package/dist/baseinput-B6KUYtrd.js +37 -0
- package/dist/baseinput-D8710HSg.cjs +1 -0
- package/dist/bff/openapi.yaml +7 -0
- package/dist/button-M3QREAcT.cjs +651 -0
- package/dist/button-xI3Wu15Z.js +311 -0
- package/dist/calendar-B8nJAQne.js +2891 -0
- package/dist/calendar-CW9WbT3C.cjs +477 -0
- package/dist/card-BXosepCe.js +57 -0
- package/dist/card-Db30JagR.cjs +32 -0
- package/dist/check-BYTdkWQh.js +46 -0
- package/dist/check-D4kxzECF.cjs +2 -0
- package/dist/checkbox-BIDoCr_X.cjs +142 -0
- package/dist/checkbox-TAWN7HJG.js +323 -0
- package/dist/chevrondown-DLIH6sRy.cjs +2 -0
- package/dist/chevrondown-v3qKRLEG.js +46 -0
- package/dist/chevronleft-DMbyAEgw.cjs +2 -0
- package/dist/chevronleft-dQlHS1Vs.js +46 -0
- package/dist/chevronright-B3qtGWZb.js +46 -0
- package/dist/chevronright-BisalZVe.cjs +2 -0
- package/dist/chip-CBoKYRL5.js +107 -0
- package/dist/chip-CLwNi1p_.cjs +54 -0
- package/dist/chunk-BK-Lzi7j.cjs +1 -0
- package/dist/chunk-DgQ9yJBH.js +17 -0
- package/dist/classnames-4RuV7Ryo.js +19 -0
- package/dist/classnames-DqVQ5xbt.cjs +1 -0
- package/dist/containers.cjs +23 -26
- package/dist/containers.d.ts +0 -116
- package/dist/containers.js +4476 -5541
- package/dist/focustrap-BhHF6zvb.js +558 -0
- package/dist/focustrap-C_v0dFmU.cjs +152 -0
- package/dist/inputnumber-CvuB8fHc.cjs +195 -0
- package/dist/inputnumber-UfGZdwk2.js +983 -0
- package/dist/inputtext-B-iUN1cV.js +108 -0
- package/dist/inputtext-D2Ay4aYr.cjs +79 -0
- package/dist/legalConsent-B3erdrHX.cjs +1 -0
- package/dist/legalConsent-kc_KWyR6.js +66 -0
- package/dist/lib.cjs +1331 -1
- package/dist/lib.d.ts +0 -728
- package/dist/lib.js +22977 -35
- package/dist/locales-4eL4-K7f.js +3168 -0
- package/dist/locales-DzyBr_JU.cjs +5 -0
- package/dist/markdown-Cb6J3R4j.js +28 -0
- package/dist/markdown-Dxqg6Ggd.cjs +1 -0
- package/dist/network-DD_yGfK6.js +2404 -0
- package/dist/network-uPe9-HeS.cjs +9 -0
- package/dist/network.cjs +1 -1
- package/dist/network.d.ts +0 -103
- package/dist/network.js +2 -48
- package/dist/portal-BbZw4bN9.js +265 -0
- package/dist/portal-pIcEXWz1.cjs +2 -0
- package/dist/{index-EDm9-cRY.cjs → progressbar-BPR5tRX7.cjs} +2 -2
- package/dist/progressbar-CzckKCUr.js +96 -0
- package/dist/rating-DsIxcJXU.js +332 -0
- package/dist/rating-HfRWRXuI.cjs +61 -0
- package/dist/ripple-CoTE8rF8.js +501 -0
- package/dist/ripple-UYfqtU0m.cjs +24 -0
- package/dist/router-CR-sxf1q.js +34 -0
- package/dist/router-qXH6kffG.cjs +1 -0
- package/dist/router.cjs +1 -1
- package/dist/router.d.ts +0 -54
- package/dist/router.js +2 -16
- package/dist/select-C05BBcmi.js +2357 -0
- package/dist/select-CZouTpLB.cjs +360 -0
- package/dist/stores-BAbCgIKW.cjs +1 -0
- package/dist/stores-C5CUNzM_.js +203 -0
- package/dist/textarea-DUmMHVXf.cjs +84 -0
- package/dist/textarea-f6-j7m1N.js +131 -0
- package/dist/times--t6-zeg6.js +46 -0
- package/dist/times-GcOHYs3E.cjs +2 -0
- package/dist/timescircle-CHGzPrwL.cjs +2 -0
- package/dist/timescircle-_NJIsGD1.js +48 -0
- package/dist/wefa.css +2 -1
- package/package.json +36 -34
- package/src/components/DashboardComponent/DashboardGroupComponent.vue +1 -1
- package/src/components/NetworkButton/__tests__/ApiMutationButton.test.ts +12 -3
- package/src/components/NetworkButton/__tests__/ApiQueryButton.test.ts +12 -3
- package/src/containers/LayoutContainer/SideNavigationComponent/MainComponent/NavigationLinkComponent.vue +1 -1
- package/src/containers/SideMenuContainer/SideMenuContainer.vue +14 -3
- package/src/containers/helpers.ts +1 -1
- package/src/router/guards.ts +2 -2
- package/src/stores/__tests__/backend/jwt.test.ts +6 -6
- package/src/stores/__tests__/backend/oauth.test.ts +1 -1
- package/src/stores/__tests__/backend/token.test.ts +5 -5
- package/src/stores/backend/schemes/jwt.ts +3 -3
- package/src/stores/backend/schemes/token.ts +6 -7
- package/dist/LegalConsent-DQ7fkgVc.cjs +0 -1
- package/dist/LegalConsent-OLyvuzRY.js +0 -151
- package/dist/LegalDocument-B-nntRW7.cjs +0 -109
- package/dist/LegalDocument-BKebNzIK.js +0 -1330
- package/dist/LoginView-DUPa_PsC.js +0 -24
- package/dist/LoginView-Dihs8n_X.cjs +0 -1
- package/dist/LogoutView-DAh7MrFi.js +0 -19
- package/dist/LogoutView-Fl3nfeJ0.cjs +0 -1
- package/dist/apiClient-BHDjT0dU.js +0 -928
- package/dist/apiClient-Cr0IvG5Z.cjs +0 -1
- package/dist/axios-CZvsFspN.js +0 -1887
- package/dist/axios-DMqeKDaq.cjs +0 -6
- package/dist/index--_rUTrqU.js +0 -1414
- package/dist/index-05ASaj7N.cjs +0 -477
- package/dist/index-B7hJ2pku.cjs +0 -61
- package/dist/index-BHSxFTgZ.js +0 -49
- package/dist/index-BaA_oL1s.cjs +0 -32
- package/dist/index-Be5h48vc.js +0 -3530
- package/dist/index-Becfy0pF.cjs +0 -2
- package/dist/index-CPv4agmV.js +0 -400
- package/dist/index-CgAb-gZi.js +0 -89
- package/dist/index-DFSkcsx-.cjs +0 -943
- package/dist/index-DGUVQqZw.js +0 -208
- package/dist/index-DRozw3P8.js +0 -167
- package/dist/index-DfCQoHSf.cjs +0 -146
- package/dist/index-DkuJMEY1.js +0 -6731
- package/dist/index-Dv6jyKbT.js +0 -47
- package/dist/index-IGN7_cyg.cjs +0 -2
- package/dist/index-lFl6UsTa.js +0 -212
- package/dist/index-lQmq7gxp.cjs +0 -54
- package/dist/index-t0sdL3f2.cjs +0 -84
- package/dist/lib-DZzubLGt.js +0 -26376
- package/dist/lib-lTzD7ltX.cjs +0 -2104
- package/dist/libRoutes-B-H3e9wZ.js +0 -22
- package/dist/libRoutes-Cl3TklhN.cjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const c=require("vue"),X=require("./axios-DMqeKDaq.cjs");var M=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},it=class extends M{#e;#t;#s;constructor(){super(),this.#s=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#s=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},nt=new it,rt={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},ot=class{#e=rt;#t=!1;setTimeoutProvider(t){process.env.NODE_ENV!=="production"&&this.#t&&t!==this.#e&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#e,provider:t}),this.#e=t,process.env.NODE_ENV!=="production"&&(this.#t=!1)}setTimeout(t,e){return process.env.NODE_ENV!=="production"&&(this.#t=!0),this.#e.setTimeout(t,e)}clearTimeout(t){this.#e.clearTimeout(t)}setInterval(t,e){return process.env.NODE_ENV!=="production"&&(this.#t=!0),this.#e.setInterval(t,e)}clearInterval(t){this.#e.clearInterval(t)}},T=new ot;function at(t){setTimeout(t,0)}var ut=typeof window>"u"||"Deno"in globalThis;function ct(){}function q(t){return typeof t=="number"&&t>=0&&t!==1/0}function ht(t,e){return Math.max(t+(e||0)-Date.now(),0)}function E(t,e){return typeof t=="function"?t(e):t}function y(t,e){return typeof t=="function"?t(e):t}function z(t){return JSON.stringify(t,(e,s)=>L(s)?Object.keys(s).sort().reduce((n,i)=>(n[i]=s[i],n),{}):s)}var lt=Object.prototype.hasOwnProperty;function Q(t,e,s=0){if(t===e)return t;if(s>500)return e;const n=$(t)&&$(e);if(!n&&!(L(t)&&L(e)))return e;const r=(n?t:Object.keys(t)).length,l=n?e:Object.keys(e),o=l.length,f=n?new Array(o):{};let m=0;for(let a=0;a<o;a++){const v=n?a:l[a],h=t[v],u=e[v];if(h===u){f[v]=h,(n?a<r:lt.call(t,v))&&m++;continue}if(h===null||u===null||typeof h!="object"||typeof u!="object"){f[v]=u;continue}const d=Q(h,u,s+1);f[v]=d,d===h&&m++}return r===o&&m===r?t:f}function P(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const s in t)if(t[s]!==e[s])return!1;return!0}function $(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function L(t){if(!W(t))return!1;const e=t.constructor;if(e===void 0)return!0;const s=e.prototype;return!(!W(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function W(t){return Object.prototype.toString.call(t)==="[object Object]"}function B(t,e,s){if(typeof s.structuralSharing=="function")return s.structuralSharing(t,e);if(s.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Q(t,e)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${n}`),n}return Q(t,e)}return e}function x(t,e){return typeof t=="function"?t(...e):!!t}var H=(()=>{let t=()=>ut;return{isServer(){return t()},setIsServer(e){t=e}}})();function J(){let t,e;const s=new Promise((i,r)=>{t=i,e=r});s.status="pending",s.catch(()=>{});function n(i){Object.assign(s,i),delete s.resolve,delete s.reject}return s.resolve=i=>{n({status:"fulfilled",value:i}),t(i)},s.reject=i=>{n({status:"rejected",reason:i}),e(i)},s}var ft=at;function dt(){let t=[],e=0,s=o=>{o()},n=o=>{o()},i=ft;const r=o=>{e?t.push(o):i(()=>{s(o)})},l=()=>{const o=t;t=[],o.length&&i(()=>{n(()=>{o.forEach(f=>{s(f)})})})};return{batch:o=>{let f;e++;try{f=o()}finally{e--,e||l()}return f},batchCalls:o=>(...f)=>{r(()=>{o(...f)})},schedule:r,setNotifyFunction:o=>{s=o},setBatchNotifyFunction:o=>{n=o},setScheduler:o=>{i=o}}}var G=dt(),pt=class extends M{#e=!0;#t;#s;constructor(){super(),this.#s=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#s=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(s=>{s(t)}))}isOnline(){return this.#e}},vt=new pt;function bt(t){return(t??"online")==="online"?vt.isOnline():!0}function yt(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:bt(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}var mt=class extends M{constructor(t,e){super(),this.options=e,this.#e=t,this.#a=null,this.#o=J(),this.bindMethods(),this.setOptions(e)}#e;#t=void 0;#s=void 0;#i=void 0;#n;#r;#o;#a;#v;#f;#d;#c;#h;#u;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Y(this.#t,this.options)?this.#l():this.updateResult(),this.#g())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return U(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return U(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#O(),this.#w(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,s=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof y(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#R(),this.#t.setOptions(this.options),e._defaulted&&!P(this.options,e)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const n=this.hasListeners();n&&Z(this.#t,s,this.options,e)&&this.#l(),this.updateResult(),n&&(this.#t!==s||y(this.options.enabled,this.#t)!==y(e.enabled,this.#t)||E(this.options.staleTime,this.#t)!==E(e.staleTime,this.#t))&&this.#b();const i=this.#y();n&&(this.#t!==s||y(this.options.enabled,this.#t)!==y(e.enabled,this.#t)||i!==this.#u)&&this.#m(i)}getOptimisticResult(t){const e=this.#e.getQueryCache().build(this.#e,t),s=this.createResult(e,t);return Ot(this,s)&&(this.#i=s,this.#r=this.options,this.#n=this.#t.state),s}getCurrentResult(){return this.#i}trackResult(t,e){return new Proxy(t,{get:(s,n)=>(this.trackProp(n),e?.(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,n))})}trackProp(t){this.#p.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#e.defaultQueryOptions(t),s=this.#e.getQueryCache().build(this.#e,e);return s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#l({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#l(t){this.#R();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(ct)),e}#b(){this.#O();const t=E(this.options.staleTime,this.#t);if(H.isServer()||this.#i.isStale||!q(t))return;const s=ht(this.#i.dataUpdatedAt,t)+1;this.#c=T.setTimeout(()=>{this.#i.isStale||this.updateResult()},s)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#m(t){this.#w(),this.#u=t,!(H.isServer()||y(this.options.enabled,this.#t)===!1||!q(this.#u)||this.#u===0)&&(this.#h=T.setInterval(()=>{(this.options.refetchIntervalInBackground||nt.isFocused())&&this.#l()},this.#u))}#g(){this.#b(),this.#m(this.#y())}#O(){this.#c&&(T.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#h&&(T.clearInterval(this.#h),this.#h=void 0)}createResult(t,e){const s=this.#t,n=this.options,i=this.#i,r=this.#n,l=this.#r,f=t!==s?t.state:this.#s,{state:m}=t;let a={...m},v=!1,h;if(e._optimisticResults){const b=this.hasListeners(),S=!b&&Y(t,e),j=b&&Z(t,s,e,n);(S||j)&&(a={...a,...yt(m.data,t.options)}),e._optimisticResults==="isRestoring"&&(a.fetchStatus="idle")}let{error:u,errorUpdatedAt:d,status:p}=a;h=a.data;let R=!1;if(e.placeholderData!==void 0&&h===void 0&&p==="pending"){let b;i?.isPlaceholderData&&e.placeholderData===l?.placeholderData?(b=i.data,R=!0):b=typeof e.placeholderData=="function"?e.placeholderData(this.#d?.state.data,this.#d):e.placeholderData,b!==void 0&&(p="success",h=B(i?.data,b,e),v=!0)}if(e.select&&h!==void 0&&!R)if(i&&h===r?.data&&e.select===this.#v)h=this.#f;else try{this.#v=e.select,h=e.select(h),h=B(i?.data,h,e),this.#f=h,this.#a=null}catch(b){this.#a=b}this.#a&&(u=this.#a,h=this.#f,d=Date.now(),p="error");const O=a.fetchStatus==="fetching",w=p==="pending",D=p==="error",A=w&&O,V=h!==void 0,g={status:p,fetchStatus:a.fetchStatus,isPending:w,isSuccess:p==="success",isError:D,isInitialLoading:A,isLoading:A,data:h,dataUpdatedAt:a.dataUpdatedAt,error:u,errorUpdatedAt:d,failureCount:a.fetchFailureCount,failureReason:a.fetchFailureReason,errorUpdateCount:a.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:a.dataUpdateCount>f.dataUpdateCount||a.errorUpdateCount>f.errorUpdateCount,isFetching:O,isRefetching:O&&!w,isLoadingError:D&&!V,isPaused:a.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:D&&V,isStale:_(t,e),refetch:this.refetch,promise:this.#o,isEnabled:y(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const b=g.data!==void 0,S=g.status==="error"&&!b,j=F=>{S?F.reject(g.error):b&&F.resolve(g.data)},K=()=>{const F=this.#o=g.promise=J();j(F)},I=this.#o;switch(I.status){case"pending":t.queryHash===s.queryHash&&j(I);break;case"fulfilled":(S||g.data!==I.value)&&K();break;case"rejected":(!S||g.error!==I.reason)&&K();break}}return g}updateResult(){const t=this.#i,e=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#r=this.options,this.#n.data!==void 0&&(this.#d=this.#t),P(e,t))return;this.#i=e;const s=()=>{if(!t)return!0;const{notifyOnChangeProps:n}=this.options,i=typeof n=="function"?n():n;if(i==="all"||!i&&!this.#p.size)return!0;const r=new Set(i??this.#p);return this.options.throwOnError&&r.add("error"),Object.keys(this.#i).some(l=>{const o=l;return this.#i[o]!==t[o]&&r.has(o)})};this.#S({listeners:s()})}#R(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#s=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#g()}#S(t){G.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function gt(t,e){return y(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Y(t,e){return gt(t,e)||t.state.data!==void 0&&U(t,e,e.refetchOnMount)}function U(t,e,s){if(y(e.enabled,t)!==!1&&E(e.staleTime,t)!=="static"){const n=typeof s=="function"?s(t):s;return n==="always"||n!==!1&&_(t,e)}return!1}function Z(t,e,s,n){return(t!==e||y(n.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&_(t,s)}function _(t,e){return y(e.enabled,t)!==!1&&t.isStaleByTime(E(e.staleTime,t))}function Ot(t,e){return!P(t.getCurrentResult(),e)}function wt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Rt=class extends M{#e;#t=void 0;#s;#i;constructor(t,e){super(),this.#e=t,this.setOptions(e),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const e=this.options;this.options=this.#e.defaultMutationOptions(t),P(this.options,e)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#s,observer:this}),e?.mutationKey&&this.options.mutationKey&&z(e.mutationKey)!==z(this.options.mutationKey)?this.reset():this.#s?.state.status==="pending"&&this.#s.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#s?.removeObserver(this)}onMutationUpdate(t){this.#n(),this.#r(t)}getCurrentResult(){return this.#t}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#n(),this.#r()}mutate(t,e){return this.#i=e,this.#s?.removeObserver(this),this.#s=this.#e.getMutationCache().build(this.#e,this.options),this.#s.addObserver(this),this.#s.execute(t)}#n(){const t=this.#s?.state??wt();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#r(t){G.batch(()=>{if(this.#i&&this.hasListeners()){const e=this.#t.variables,s=this.#t.context,n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#i.onSuccess?.(t.data,e,s,n)}catch(i){Promise.reject(i)}try{this.#i.onSettled?.(t.data,null,e,s,n)}catch(i){Promise.reject(i)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,e,s,n)}catch(i){Promise.reject(i)}try{this.#i.onSettled?.(void 0,t.error,e,s,n)}catch(i){Promise.reject(i)}}}this.listeners.forEach(e=>{e(this.#t)})})}},St="VUE_QUERY_CLIENT";function Et(t){const e=t?`:${t}`:"";return`${St}${e}`}function N(t,e){Object.keys(t).forEach(s=>{t[s]=e[s]})}function k(t,e,s="",n=0){if(e){const i=e(t,s,n);if(i===void 0&&c.isRef(t)||i!==void 0)return i}if(Array.isArray(t))return t.map((i,r)=>k(i,e,String(r),n+1));if(typeof t=="object"&&jt(t)){const i=Object.entries(t).map(([r,l])=>[r,k(l,e,r,n+1)]);return Object.fromEntries(i)}return t}function Ct(t,e){return k(t,e)}function C(t,e=!1){return Ct(t,(s,n,i)=>{if(i===1&&n==="queryKey")return C(s,!0);if(e&&It(s))return C(s(),e);if(c.isRef(s))return C(c.unref(s),e)})}function jt(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function It(t){return typeof t=="function"}function tt(t=""){if(!c.hasInjectionContext())throw new Error("vue-query hooks can only be used inside setup() function or functions that support injection context.");const e=Et(t),s=c.inject(e);if(!s)throw new Error("No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.");return s}function Ft(t,e,s){process.env.NODE_ENV==="development"&&(c.getCurrentScope()||console.warn('vue-query composable like "useQuery()" should only be used inside a "setup()" function or a running effect scope. They might otherwise lead to memory leaks.'));const n=tt(),i=c.computed(()=>{let u=e;typeof u=="function"&&(u=u());const d=C(u);typeof d.enabled=="function"&&(d.enabled=d.enabled());const p=n.defaultQueryOptions(d);return p._optimisticResults=n.isRestoring?.value?"isRestoring":"optimistic",p}),r=new t(n,i.value),l=i.value.shallow?c.shallowReactive(r.getCurrentResult()):c.reactive(r.getCurrentResult());let o=()=>{};n.isRestoring&&c.watch(n.isRestoring,u=>{u||(o(),o=r.subscribe(d=>{N(l,d)}))},{immediate:!0});const f=()=>{r.setOptions(i.value),N(l,r.getCurrentResult())};c.watch(i,f),c.onScopeDispose(()=>{o()});const m=(...u)=>(f(),l.refetch(...u)),a=()=>new Promise((u,d)=>{let p=()=>{};const R=()=>{if(i.value.enabled!==!1){r.setOptions(i.value);const O=r.getOptimisticResult(i.value);O.isStale?(p(),r.fetchOptimistic(i.value).then(u,w=>{x(i.value.throwOnError,[w,r.getCurrentQuery()])?d(w):u(r.getCurrentResult())})):(p(),u(O))}};R(),p=c.watch(i,R)});c.watch(()=>l.error,u=>{if(l.isError&&!l.isFetching&&x(i.value.throwOnError,[u,r.getCurrentQuery()]))throw u});const v=i.value.shallow?c.shallowReadonly(l):c.readonly(l),h=c.toRefs(v);for(const u in l)typeof l[u]=="function"&&(h[u]=l[u]);return h.suspense=a,h.refetch=m,h}function et(t,e){return Ft(mt,t)}function st(t,e){process.env.NODE_ENV==="development"&&(c.getCurrentScope()||console.warn('vue-query composable like "useQuery()" should only be used inside a "setup()" function or a running effect scope. They might otherwise lead to memory leaks.'));const s=tt(),n=c.computed(()=>{const a=typeof t=="function"?t():t;return s.defaultMutationOptions(C(a))}),i=new Rt(s,n.value),r=n.value.shallow?c.shallowReactive(i.getCurrentResult()):c.reactive(i.getCurrentResult()),l=i.subscribe(a=>{N(r,a)}),o=(a,v)=>{i.mutate(a,v).catch(()=>{})};c.watch(n,()=>{i.setOptions(n.value)}),c.onScopeDispose(()=>{l()});const f=n.value.shallow?c.shallowReadonly(r):c.readonly(r),m=c.toRefs(f);return c.watch(()=>r.error,a=>{if(a&&x(n.value.throwOnError,[a]))throw a}),{...m,mutate:o,mutateAsync:r.mutate,reset:r.reset}}function Tt(t,e){return et({queryKey:[t],queryFn:async()=>t.value?(await X.axiosInstance.get(t.value)).data:void 0,enabled:()=>!!t.value,...e})}function Pt(t,e){return st({mutationFn:async s=>t.value?(await X.axiosInstance.post(t.value,s)).data:void 0,...e})}const Mt={query:Tt,mutation:Pt};exports.apiClient=Mt;exports.useMutation=st;exports.useQuery=et;
|