@isardsat/editorial-admin 6.1.2 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/client/assets/{authSlice-C1VgtCUs.js → authSlice-BWVz4jZT.js} +154 -154
- package/build/client/assets/button-DjJX-cbR.js +1 -0
- package/build/client/assets/{chevron-down-DTegokyb.js → chevron-down-CYVLN3e-.js} +1 -1
- package/build/client/assets/chunk-EF7DTUVF-CZaHNoTs.js +51 -0
- package/build/client/assets/{createLucideIcon-CEJSFbyG.js → createLucideIcon-BOhrmKcl.js} +1 -1
- package/build/client/assets/dashboard-uK1JUDJC.js +1 -0
- package/build/client/assets/{dashboard._collection-BInenL6o.js → dashboard._collection-BNdxRLEC.js} +2 -2
- package/build/client/assets/dashboard._collection._document-CZS2Adz-.js +1 -0
- package/build/client/assets/dashboard._collection.new-BEBBwujj.js +1 -0
- package/build/client/assets/{dashboard._layout-BcFSiUec.js → dashboard._layout-Ce0XSLxb.js} +2 -2
- package/build/client/assets/{dashboard.files-DKvKXV6U.js → dashboard.files-D1ph0y7T.js} +4 -4
- package/build/client/assets/editorialApi-sCf3FFWc.js +9 -0
- package/build/client/assets/entry.client-DxhHtLqO.js +29 -0
- package/build/client/assets/{home-C_M0Cqq5.js → home-D_H1PlMw.js} +1 -1
- package/build/client/assets/{index-C4BMMXbp.js → index-B0NebLYn.js} +1 -1
- package/build/client/assets/{index-CvFp8wi_.js → index-BnyqKVWo.js} +1 -1
- package/build/client/assets/{index-ofqdEjlP.js → index-CQvFoK7s.js} +1 -1
- package/build/client/assets/{index-DWY8ISpx.js → index-b1VEd5BJ.js} +1 -1
- package/build/client/assets/{input-BScD3Ruq.js → input-DA43W1bc.js} +1 -1
- package/build/client/assets/{itemForm-BCRilPzX.js → itemForm-DTE9G8eu.js} +1 -1
- package/build/client/assets/manifest-62c94c94.js +1 -0
- package/build/client/assets/root-5pkwWV_K.js +1 -0
- package/build/client/assets/{root-DGV68qoS.css → root-DdgoqUZJ.css} +1 -1
- package/build/client/assets/{trash-DN4yNrfZ.js → trash-CYTPibS3.js} +1 -1
- package/build/client/index.html +3 -10
- package/package.json +5 -3
- package/build/client/assets/button-D7P-1kQx.js +0 -1
- package/build/client/assets/chunk-QMGIS6GS-BoPxQm7X.js +0 -51
- package/build/client/assets/dashboard-z6MevYdb.js +0 -1
- package/build/client/assets/dashboard._collection._document-CThHIpx7.js +0 -1
- package/build/client/assets/dashboard._collection.new-I4A2SBlr.js +0 -1
- package/build/client/assets/editorialApi-Dg2JizYW.js +0 -1
- package/build/client/assets/entry.client-B2XAvOmi.js +0 -34
- package/build/client/assets/manifest-94cf7c47.js +0 -1
- package/build/client/assets/react-redux-CRJHAKt_.js +0 -9
- package/build/client/assets/root-CJsg41xt.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{p as e,a as j,x as u,w as g}from"./chunk-EF7DTUVF-CZaHNoTs.js";import{e as v,j as N}from"./authSlice-BWVz4jZT.js";import{p as k,q as w}from"./editorialApi-sCf3FFWc.js";import{c as b,b as z,a as _}from"./utils-BSDwSRl3.js";import{c as o}from"./createLucideIcon-BOhrmKcl.js";import{C as F}from"./chevron-down-CYVLN3e-.js";import{T as r}from"./trash-CYTPibS3.js";import"./tslib.es6-De9GV7Vy.js";/**
|
|
2
2
|
* @license lucide-react v0.487.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -18,12 +18,12 @@ import{o as e,a as j,v as u,w as v}from"./chunk-QMGIS6GS-BoPxQm7X.js";import{h a
|
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const
|
|
21
|
+
*/const q=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],I=o("file-text",q);/**
|
|
22
22
|
* @license lucide-react v0.487.0 - ISC
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the ISC license.
|
|
25
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const
|
|
26
|
+
*/const L=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],S=o("file",L);/**
|
|
27
27
|
* @license lucide-react v0.487.0 - ISC
|
|
28
28
|
*
|
|
29
29
|
* This source code is licensed under the ISC license.
|
|
@@ -33,4 +33,4 @@ import{o as e,a as j,v as u,w as v}from"./chunk-QMGIS6GS-BoPxQm7X.js";import{h a
|
|
|
33
33
|
*
|
|
34
34
|
* This source code is licensed under the ISC license.
|
|
35
35
|
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const V=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],P=o("folder",V),Z=["txt","md","html","pdf"],A=["svg","webp","png","jpeg","jpg"],R=[{Icon:T,test:s=>A.some(i=>s.name.endsWith(i))},{Icon:
|
|
36
|
+
*/const V=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],P=o("folder",V),Z=["txt","md","html","pdf"],A=["svg","webp","png","jpeg","jpg"],R=[{Icon:T,test:s=>A.some(i=>s.name.endsWith(i))},{Icon:I,test:s=>Z.some(i=>s.name.endsWith(i))}],W={Icon:S},p=({node:s,level:i=0,onDelete:c})=>{const[a,d]=j.useState(!1),x=v(N),m=R.find(t=>t.test(s))??W,l=s.type==="directory",h=l?"div":u,f=()=>{l&&d(!a)};return e.jsxs("div",{className:"select-none",children:[e.jsxs(h,{to:s.path,target:"_blank",className:"flex items-center gap-2 h-10 p-2 group hover:bg-muted/50 cursor-pointer",style:{paddingLeft:`calc(0.5rem + ${i*20}px)`},onClick:f,children:[l?e.jsx(F,{size:16,className:b("transition-transform",{"rotate-180":a})}):e.jsx("div",{className:"w-4"}),e.jsxs("div",{className:"flex flex-grow w-24 items-center gap-2 ml-2",children:[l?a?e.jsx(E,{size:16,className:"text-yellow-500"}):e.jsx(P,{size:16,className:"text-yellow-500"}):e.jsx(m.Icon,{size:16,className:" text-gray-500"}),e.jsx("span",{className:"text-sm whitespace-nowrap text-ellipsis overflow-hidden w-full",children:s.name})]}),e.jsx("div",{className:"flex w-24 justify-end gap-2",children:e.jsx("span",{className:"text-sm text-gray-500",children:l?"--":z(s.size)})}),x==="developer"&&e.jsxs("div",{className:"flex items-center gap-1 ml-4 group-hover:visible invisible z-20",children:[e.jsxs("button",{className:_("hover:text-yellow-500 p-1 hover:bg-muted rounded-clsx",l&&"invisible"),onClick:t=>{t.preventDefault(),t.stopPropagation(),navigator.clipboard.writeText(s.path)},children:[e.jsx(n,{size:16}),e.jsx("span",{className:"sr-only",children:"Copy file URL"})]}),e.jsxs("button",{className:"hover:text-red-500 p-1 hover:bg-muted rounded-sm",onClick:t=>{t.preventDefault(),t.stopPropagation(),c(s.path)},children:[e.jsx(r,{size:16}),e.jsx("span",{className:"sr-only",children:"Delete this file"})]})]})]}),l&&a&&s.children&&e.jsx("div",{children:s.children.map((t,y)=>e.jsx(p,{node:t,level:i+1,onDelete:c},`${t.name}-${y}`))})]})};function G(){const{data:s,isLoading:i}=k(),[c]=w();return!s||i?null:s.toSorted(a=>a.type==="directory"?-1:1).map(a=>e.jsx(p,{node:a,onDelete:c},a.name))}const ee=g(function(){return e.jsx("div",{className:"overflow-auto flex flex-1 p-4 gap-4",children:e.jsx("div",{className:"flex flex-col flex-1 gap-8",children:e.jsxs("div",{className:"overflow-auto h-full max-w-[800px] rounded-xl border",children:[e.jsxs("div",{className:"sticky top-0 bg-white flex items-center gap-2 py-1 px-2 border-b group",children:[e.jsx("div",{className:"w-4"}),e.jsx("div",{className:"flex flex-grow items-center gap-2 ml-2",children:e.jsx("span",{className:"text-sm font-semibold",children:"Name"})}),e.jsx("div",{className:"flex w-24 items-center gap-2 ml-2",children:e.jsx("span",{className:"text-sm font-semibold",children:"Size"})}),e.jsxs("div",{className:"flex items-center gap-1 invisible",children:[e.jsx(n,{size:14}),e.jsx(r,{size:14}),e.jsx(C,{size:14})]})]}),e.jsx(G,{})]})})})});export{ee as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var Zn=Object.defineProperty;var er=(e,t,n)=>t in e?Zn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ue=(e,t,n)=>er(e,typeof t!="symbol"?t+"":t,n);import{r as tr,a as x}from"./chunk-EF7DTUVF-CZaHNoTs.js";function B(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var nr=typeof Symbol=="function"&&Symbol.observable||"@@observable",Ht=nr,pt=()=>Math.random().toString(36).substring(7).split("").join("."),rr={INIT:`@@redux/INIT${pt()}`,REPLACE:`@@redux/REPLACE${pt()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${pt()}`},Je=rr;function fe(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Pn(e,t,n){if(typeof e!="function")throw new Error(B(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(B(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(B(1));return n(Pn)(e,t)}let r=e,i=t,o=new Map,a=o,y=0,b=!1;function v(){a===o&&(a=new Map,o.forEach((R,h)=>{a.set(h,R)}))}function E(){if(b)throw new Error(B(3));return i}function O(R){if(typeof R!="function")throw new Error(B(4));if(b)throw new Error(B(5));let h=!0;v();const M=y++;return a.set(M,R),function(){if(h){if(b)throw new Error(B(6));h=!1,v(),a.delete(M),o=null}}}function f(R){if(!fe(R))throw new Error(B(7));if(typeof R.type>"u")throw new Error(B(8));if(typeof R.type!="string")throw new Error(B(17));if(b)throw new Error(B(9));try{b=!0,i=r(i,R)}finally{b=!1}return(o=a).forEach(M=>{M()}),R}function l(R){if(typeof R!="function")throw new Error(B(10));r=R,f({type:Je.REPLACE})}function w(){const R=O;return{subscribe(h){if(typeof h!="object"||h===null)throw new Error(B(11));function M(){const s=h;s.next&&s.next(E())}return M(),{unsubscribe:R(M)}},[Ht](){return this}}}return f({type:Je.INIT}),{dispatch:f,subscribe:O,getState:E,replaceReducer:l,[Ht]:w}}function ir(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Je.INIT})>"u")throw new Error(B(12));if(typeof n(void 0,{type:Je.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(B(13))})}function On(e){const t=Object.keys(e),n={};for(let o=0;o<t.length;o++){const a=t[o];typeof e[a]=="function"&&(n[a]=e[a])}const r=Object.keys(n);let i;try{ir(n)}catch(o){i=o}return function(a={},y){if(i)throw i;let b=!1;const v={};for(let E=0;E<r.length;E++){const O=r[E],f=n[O],l=a[O],w=f(l,y);if(typeof w>"u")throw y&&y.type,new Error(B(14));v[O]=w,b=b||w!==l}return b=b||r.length!==Object.keys(a).length,b?v:a}}function Xe(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function sr(...e){return t=>(n,r)=>{const i=t(n,r);let o=()=>{throw new Error(B(15))};const a={getState:i.getState,dispatch:(b,...v)=>o(b,...v)},y=e.map(b=>b(a));return o=Xe(...y)(i.dispatch),{...i,dispatch:o}}}function Cn(e){return fe(e)&&"type"in e&&typeof e.type=="string"}var xt=Symbol.for("immer-nothing"),Me=Symbol.for("immer-draftable"),X=Symbol.for("immer-state");function H(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var he=Object.getPrototypeOf;function se(e){return!!e&&!!e[X]}function ne(e){var t;return e?An(e)||Array.isArray(e)||!!e[Me]||!!((t=e.constructor)!=null&&t[Me])||Fe(e)||Ne(e):!1}var or=Object.prototype.constructor.toString();function An(e){if(!e||typeof e!="object")return!1;const t=he(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===or}function ur(e){return se(e)||H(15,e),e[X].base_}function De(e,t){ge(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function ge(e){const t=e[X];return t?t.type_:Array.isArray(e)?1:Fe(e)?2:Ne(e)?3:0}function qe(e,t){return ge(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function yt(e,t){return ge(e)===2?e.get(t):e[t]}function Mn(e,t,n){const r=ge(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function cr(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Fe(e){return e instanceof Map}function Ne(e){return e instanceof Set}function ye(e){return e.copy_||e.base_}function Ct(e,t){if(Fe(e))return new Map(e);if(Ne(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=An(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[X];let i=Reflect.ownKeys(r);for(let o=0;o<i.length;o++){const a=i[o],y=r[a];y.writable===!1&&(y.writable=!0,y.configurable=!0),(y.get||y.set)&&(r[a]={configurable:!0,writable:!0,enumerable:y.enumerable,value:e[a]})}return Object.create(he(e),r)}else{const r=he(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function Ft(e,t=!1){return it(e)||se(e)||!ne(e)||(ge(e)>1&&(e.set=e.add=e.clear=e.delete=ar),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>Ft(r,!0))),e}function ar(){H(2)}function it(e){return Object.isFrozen(e)}var At={};function me(e){const t=At[e];return t||H(0,e),t}function fr(e,t){At[e]||(At[e]=t)}var Qe;function In(){return Qe}function lr(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Gt(e,t){t&&(me("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Mt(e){It(e),e.drafts_.forEach(dr),e.drafts_=null}function It(e){e===Qe&&(Qe=e.parent_)}function Jt(e){return Qe=lr(Qe,e)}function dr(e){const t=e[X];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Xt(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[X].modified_&&(Mt(t),H(4)),ne(e)&&(e=Ye(t,e),t.parent_||Ze(t,e)),t.patches_&&me("Patches").generateReplacementPatches_(n[X].base_,e,t.patches_,t.inversePatches_)):e=Ye(t,n,[]),Mt(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==xt?e:void 0}function Ye(e,t,n){if(it(t))return t;const r=t[X];if(!r)return De(t,(i,o)=>Yt(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return Ze(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let o=i,a=!1;r.type_===3&&(o=new Set(i),i.clear(),a=!0),De(o,(y,b)=>Yt(e,r,i,y,b,n,a)),Ze(e,i,!1),n&&e.patches_&&me("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Yt(e,t,n,r,i,o,a){if(se(i)){const y=o&&t&&t.type_!==3&&!qe(t.assigned_,r)?o.concat(r):void 0,b=Ye(e,i,y);if(Mn(n,r,b),se(b))e.canAutoFreeze_=!1;else return}else a&&n.add(i);if(ne(i)&&!it(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Ye(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&Ze(e,i)}}function Ze(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ft(t,n)}function pr(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:In(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=Nt;n&&(i=[r],o=ke);const{revoke:a,proxy:y}=Proxy.revocable(i,o);return r.draft_=y,r.revoke_=a,y}var Nt={get(e,t){if(t===X)return e;const n=ye(e);if(!qe(n,t))return yr(e,n,t);const r=n[t];return e.finalized_||!ne(r)?r:r===ht(e.base_,t)?(gt(e),e.copy_[t]=Dt(r,e)):r},has(e,t){return t in ye(e)},ownKeys(e){return Reflect.ownKeys(ye(e))},set(e,t,n){const r=Tn(ye(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=ht(ye(e),t),o=i==null?void 0:i[X];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(cr(n,i)&&(n!==void 0||qe(e.base_,t)))return!0;gt(e),Tt(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return ht(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,gt(e),Tt(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=ye(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){H(11)},getPrototypeOf(e){return he(e.base_)},setPrototypeOf(){H(12)}},ke={};De(Nt,(e,t)=>{ke[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ke.deleteProperty=function(e,t){return ke.set.call(this,e,t,void 0)};ke.set=function(e,t,n){return Nt.set.call(this,e[0],t,n,e[0])};function ht(e,t){const n=e[X];return(n?ye(n):e)[t]}function yr(e,t,n){var i;const r=Tn(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function Tn(e,t){if(!(t in e))return;let n=he(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=he(n)}}function Tt(e){e.modified_||(e.modified_=!0,e.parent_&&Tt(e.parent_))}function gt(e){e.copy_||(e.copy_=Ct(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var hr=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const a=this;return function(b=o,...v){return a.produce(b,E=>n.call(this,E,...v))}}typeof n!="function"&&H(6),r!==void 0&&typeof r!="function"&&H(7);let i;if(ne(t)){const o=Jt(this),a=Dt(t,void 0);let y=!0;try{i=n(a),y=!1}finally{y?Mt(o):It(o)}return Gt(o,r),Xt(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===xt&&(i=void 0),this.autoFreeze_&&Ft(i,!0),r){const o=[],a=[];me("Patches").generateReplacementPatches_(t,i,o,a),r(o,a)}return i}else H(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(a,...y)=>this.produceWithPatches(a,b=>t(b,...y));let r,i;return[this.produce(t,n,(a,y)=>{r=a,i=y}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ne(e)||H(8),se(e)&&(e=gr(e));const t=Jt(this),n=Dt(e,void 0);return n[X].isManual_=!0,It(t),n}finishDraft(e,t){const n=e&&e[X];(!n||!n.isManual_)&&H(9);const{scope_:r}=n;return Gt(r,t),Xt(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=me("Patches").applyPatches_;return se(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Dt(e,t){const n=Fe(e)?me("MapSet").proxyMap_(e,t):Ne(e)?me("MapSet").proxySet_(e,t):pr(e,t);return(t?t.scope_:In()).drafts_.push(n),n}function gr(e){return se(e)||H(10,e),Dn(e)}function Dn(e){if(!ne(e)||it(e))return e;const t=e[X];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Ct(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Ct(e,!0);return De(n,(r,i)=>{Mn(n,r,Dn(i))}),t&&(t.finalized_=!1),n}function mr(){const t="replace",n="add",r="remove";function i(f,l,w,C){switch(f.type_){case 0:case 2:return a(f,l,w,C);case 1:return o(f,l,w,C);case 3:return y(f,l,w,C)}}function o(f,l,w,C){let{base_:R,assigned_:h}=f,M=f.copy_;M.length<R.length&&([R,M]=[M,R],[w,C]=[C,w]);for(let c=0;c<R.length;c++)if(h[c]&&M[c]!==R[c]){const s=l.concat([c]);w.push({op:t,path:s,value:O(M[c])}),C.push({op:t,path:s,value:O(R[c])})}for(let c=R.length;c<M.length;c++){const s=l.concat([c]);w.push({op:n,path:s,value:O(M[c])})}for(let c=M.length-1;R.length<=c;--c){const s=l.concat([c]);C.push({op:r,path:s})}}function a(f,l,w,C){const{base_:R,copy_:h}=f;De(f.assigned_,(M,c)=>{const s=yt(R,M),u=yt(h,M),S=c?qe(R,M)?t:n:r;if(s===u&&S===t)return;const A=l.concat(M);w.push(S===r?{op:S,path:A}:{op:S,path:A,value:u}),C.push(S===n?{op:r,path:A}:S===r?{op:n,path:A,value:O(s)}:{op:t,path:A,value:O(s)})})}function y(f,l,w,C){let{base_:R,copy_:h}=f,M=0;R.forEach(c=>{if(!h.has(c)){const s=l.concat([M]);w.push({op:r,path:s,value:c}),C.unshift({op:n,path:s,value:c})}M++}),M=0,h.forEach(c=>{if(!R.has(c)){const s=l.concat([M]);w.push({op:n,path:s,value:c}),C.unshift({op:r,path:s,value:c})}M++})}function b(f,l,w,C){w.push({op:t,path:[],value:l===xt?void 0:l}),C.push({op:t,path:[],value:f})}function v(f,l){return l.forEach(w=>{const{path:C,op:R}=w;let h=f;for(let u=0;u<C.length-1;u++){const S=ge(h);let A=C[u];typeof A!="string"&&typeof A!="number"&&(A=""+A),(S===0||S===1)&&(A==="__proto__"||A==="constructor")&&H(19),typeof h=="function"&&A==="prototype"&&H(19),h=yt(h,A),typeof h!="object"&&H(18,C.join("/"))}const M=ge(h),c=E(w.value),s=C[C.length-1];switch(R){case t:switch(M){case 2:return h.set(s,c);case 3:H(16);default:return h[s]=c}case n:switch(M){case 1:return s==="-"?h.push(c):h.splice(s,0,c);case 2:return h.set(s,c);case 3:return h.add(c);default:return h[s]=c}case r:switch(M){case 1:return h.splice(s,1);case 2:return h.delete(s);case 3:return h.delete(w.value);default:return delete h[s]}default:H(17,R)}}),f}function E(f){if(!ne(f))return f;if(Array.isArray(f))return f.map(E);if(Fe(f))return new Map(Array.from(f.entries()).map(([w,C])=>[w,E(C)]));if(Ne(f))return new Set(Array.from(f).map(E));const l=Object.create(he(f));for(const w in f)l[w]=E(f[w]);return qe(f,Me)&&(l[Me]=f[Me]),l}function O(f){return se(f)?E(f):f}fr("Patches",{applyPatches_:v,generatePatches_:i,generateReplacementPatches_:b})}var Y=new hr,ze=Y.produce,qn=Y.produceWithPatches.bind(Y);Y.setAutoFreeze.bind(Y);Y.setUseStrictShallowCopy.bind(Y);var Zt=Y.applyPatches.bind(Y);Y.createDraft.bind(Y);Y.finishDraft.bind(Y);function br(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function vr(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Sr(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var en=e=>Array.isArray(e)?e:[e];function wr(e){const t=Array.isArray(e[0])?e[0]:e;return Sr(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function _r(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Er=class{constructor(e){this.value=e}deref(){return this.value}},Rr=typeof WeakRef<"u"?WeakRef:Er,Pr=0,tn=1;function $e(){return{s:Pr,v:void 0,o:null,p:null}}function et(e,t={}){let n=$e();const{resultEqualityCheck:r}=t;let i,o=0;function a(){var O;let y=n;const{length:b}=arguments;for(let f=0,l=b;f<l;f++){const w=arguments[f];if(typeof w=="function"||typeof w=="object"&&w!==null){let C=y.o;C===null&&(y.o=C=new WeakMap);const R=C.get(w);R===void 0?(y=$e(),C.set(w,y)):y=R}else{let C=y.p;C===null&&(y.p=C=new Map);const R=C.get(w);R===void 0?(y=$e(),C.set(w,y)):y=R}}const v=y;let E;if(y.s===tn)E=y.v;else if(E=e.apply(null,arguments),o++,r){const f=((O=i==null?void 0:i.deref)==null?void 0:O.call(i))??i;f!=null&&r(f,E)&&(E=f,o!==0&&o--),i=typeof E=="object"&&E!==null||typeof E=="function"?new Rr(E):E}return v.s=tn,v.v=E,E}return a.clearCache=()=>{n=$e(),a.resetResultsCount()},a.resultsCount=()=>o,a.resetResultsCount=()=>{o=0},a}function Or(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let o=0,a=0,y,b={},v=i.pop();typeof v=="object"&&(b=v,v=i.pop()),br(v,`createSelector expects an output function after the inputs, but received: [${typeof v}]`);const E={...n,...b},{memoize:O,memoizeOptions:f=[],argsMemoize:l=et,argsMemoizeOptions:w=[]}=E,C=en(f),R=en(w),h=wr(i),M=O(function(){return o++,v.apply(null,arguments)},...C),c=l(function(){a++;const u=_r(h,arguments);return y=M.apply(null,u),y},...R);return Object.assign(c,{resultFunc:v,memoizedResultFunc:M,dependencies:h,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>y,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:O,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var zt=Or(et),Cr=Object.assign((e,t=zt)=>{vr(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(o=>e[o]);return t(r,(...o)=>o.reduce((a,y,b)=>(a[n[b]]=y,a),{}))},{withTypes:()=>Cr});function Qn(e){return({dispatch:n,getState:r})=>i=>o=>typeof o=="function"?o(n,r,e):i(o)}var Ar=Qn(),Mr=Qn,Ir=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Xe:Xe.apply(null,arguments)},Tr=e=>e&&typeof e.match=="function";function ee(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(te(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>Cn(r)&&r.type===e,n}var kn=class Ae extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ae.prototype)}static get[Symbol.species](){return Ae}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ae(...t[0].concat(this)):new Ae(...t.concat(this))}};function nn(e){return ne(e)?ze(e,()=>{}):e}function We(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Dr(e){return typeof e=="boolean"}var qr=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{};let a=new kn;return n&&(Dr(n)?a.push(Ar):a.push(Mr(n.extraArgument))),a},st="RTK_autoBatch",Pe=()=>e=>({payload:e,meta:{[st]:!0}}),rn=e=>t=>{setTimeout(t,e)},Qr=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,o=!1,a=!1;const y=new Set,b=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:rn(10):e.type==="callback"?e.queueNotification:rn(e.timeout),v=()=>{a=!1,o&&(o=!1,y.forEach(E=>E()))};return Object.assign({},r,{subscribe(E){const O=()=>i&&E(),f=r.subscribe(O);return y.add(E),()=>{f(),y.delete(E)}},dispatch(E){var O;try{return i=!((O=E==null?void 0:E.meta)!=null&&O[st]),o=!i,o&&(a||(a=!0,b(v))),r.dispatch(E)}finally{i=!0}}})},kr=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new kn(e);return r&&i.push(Qr(typeof r=="object"?r:void 0)),i};function as(e){const t=qr(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:o=void 0,enhancers:a=void 0}=e||{};let y;if(typeof n=="function")y=n;else if(fe(n))y=On(n);else throw new Error(te(1));let b;typeof r=="function"?b=r(t):b=t();let v=Xe;i&&(v=Ir({trace:!1,...typeof i=="object"&&i}));const E=sr(...b),O=kr(E);let f=typeof a=="function"?a(O):O();const l=v(...f);return Pn(y,o,l)}function jn(e){const t={},n=[];let r;const i={addCase(o,a){const y=typeof o=="string"?o:o.type;if(!y)throw new Error(te(28));if(y in t)throw new Error(te(29));return t[y]=a,i},addMatcher(o,a){return n.push({matcher:o,reducer:a}),i},addDefaultCase(o){return r=o,i}};return e(i),[t,n,r]}function jr(e){return typeof e=="function"}function xr(e,t){let[n,r,i]=jn(t),o;if(jr(e))o=()=>nn(e());else{const y=nn(e);o=()=>y}function a(y=o(),b){let v=[n[b.type],...r.filter(({matcher:E})=>E(b)).map(({reducer:E})=>E)];return v.filter(E=>!!E).length===0&&(v=[i]),v.reduce((E,O)=>{if(O)if(se(E)){const l=O(E,b);return l===void 0?E:l}else{if(ne(E))return ze(E,f=>O(f,b));{const f=O(E,b);if(f===void 0){if(E===null)return E;throw Error("A case reducer on a non-draftable value must not return undefined")}return f}}return E},y)}return a.getInitialState=o,a}var xn=(e,t)=>Tr(e)?e.match(t):e(t);function ce(...e){return t=>e.some(n=>xn(n,t))}function Ie(...e){return t=>e.every(n=>xn(n,t))}function ot(e,t){if(!e||!e.meta)return!1;const n=typeof e.meta.requestId=="string",r=t.indexOf(e.meta.requestStatus)>-1;return n&&r}function Le(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Lt(...e){return e.length===0?t=>ot(t,["pending"]):Le(e)?ce(...e.map(t=>t.pending)):Lt()(e[0])}function Ee(...e){return e.length===0?t=>ot(t,["rejected"]):Le(e)?ce(...e.map(t=>t.rejected)):Ee()(e[0])}function ut(...e){const t=n=>n&&n.meta&&n.meta.rejectedWithValue;return e.length===0?Ie(Ee(...e),t):Le(e)?Ie(Ee(...e),t):ut()(e[0])}function le(...e){return e.length===0?t=>ot(t,["fulfilled"]):Le(e)?ce(...e.map(t=>t.fulfilled)):le()(e[0])}function qt(...e){return e.length===0?t=>ot(t,["pending","fulfilled","rejected"]):Le(e)?ce(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):qt()(e[0])}var Fr="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ut=(e=21)=>{let t="",n=e;for(;n--;)t+=Fr[Math.random()*64|0];return t},Nr=["name","message","stack","code"],mt=class{constructor(e,t){Ue(this,"_type");this.payload=e,this.meta=t}},sn=class{constructor(e,t){Ue(this,"_type");this.payload=e,this.meta=t}},zr=e=>{if(typeof e=="object"&&e!==null){const t={};for(const n of Nr)typeof e[n]=="string"&&(t[n]=e[n]);return t}return{message:String(e)}},on="External signal was aborted",un=(()=>{function e(t,n,r){const i=ee(t+"/fulfilled",(b,v,E,O)=>({payload:b,meta:{...O||{},arg:E,requestId:v,requestStatus:"fulfilled"}})),o=ee(t+"/pending",(b,v,E)=>({payload:void 0,meta:{...E||{},arg:v,requestId:b,requestStatus:"pending"}})),a=ee(t+"/rejected",(b,v,E,O,f)=>({payload:O,error:(r&&r.serializeError||zr)(b||"Rejected"),meta:{...f||{},arg:E,requestId:v,rejectedWithValue:!!O,requestStatus:"rejected",aborted:(b==null?void 0:b.name)==="AbortError",condition:(b==null?void 0:b.name)==="ConditionError"}}));function y(b,{signal:v}={}){return(E,O,f)=>{const l=r!=null&&r.idGenerator?r.idGenerator(b):Ut(),w=new AbortController;let C,R;function h(c){R=c,w.abort()}v&&(v.aborted?h(on):v.addEventListener("abort",()=>h(on),{once:!0}));const M=async function(){var u,S;let c;try{let A=(u=r==null?void 0:r.condition)==null?void 0:u.call(r,b,{getState:O,extra:f});if(Ur(A)&&(A=await A),A===!1||w.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const I=new Promise((g,d)=>{C=()=>{d({name:"AbortError",message:R||"Aborted"})},w.signal.addEventListener("abort",C)});E(o(l,b,(S=r==null?void 0:r.getPendingMeta)==null?void 0:S.call(r,{requestId:l,arg:b},{getState:O,extra:f}))),c=await Promise.race([I,Promise.resolve(n(b,{dispatch:E,getState:O,extra:f,requestId:l,signal:w.signal,abort:h,rejectWithValue:(g,d)=>new mt(g,d),fulfillWithValue:(g,d)=>new sn(g,d)})).then(g=>{if(g instanceof mt)throw g;return g instanceof sn?i(g.payload,l,b,g.meta):i(g,l,b)})])}catch(A){c=A instanceof mt?a(null,l,b,A.payload,A.meta):a(A,l,b)}finally{C&&w.signal.removeEventListener("abort",C)}return r&&!r.dispatchConditionRejection&&a.match(c)&&c.meta.condition||E(c),c}();return Object.assign(M,{abort:h,requestId:l,arg:b,unwrap(){return M.then(Lr)}})}}return Object.assign(y,{pending:o,rejected:a,fulfilled:i,settled:ce(a,i),typePrefix:t})}return e.withTypes=()=>e,e})();function Lr(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Ur(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var $r=Symbol.for("rtk-slice-createasyncthunk");function Wr(e,t){return`${e}/${t}`}function Vr({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[$r];return function(i){const{name:o,reducerPath:a=o}=i;if(!o)throw new Error(te(11));const y=(typeof i.reducers=="function"?i.reducers(Br()):i.reducers)||{},b=Object.keys(y),v={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},E={addCase(s,u){const S=typeof s=="string"?s:s.type;if(!S)throw new Error(te(12));if(S in v.sliceCaseReducersByType)throw new Error(te(13));return v.sliceCaseReducersByType[S]=u,E},addMatcher(s,u){return v.sliceMatchers.push({matcher:s,reducer:u}),E},exposeAction(s,u){return v.actionCreators[s]=u,E},exposeCaseReducer(s,u){return v.sliceCaseReducersByName[s]=u,E}};b.forEach(s=>{const u=y[s],S={reducerName:s,type:Wr(o,s),createNotation:typeof i.reducers=="function"};Gr(u)?Xr(S,u,E,t):Hr(S,u,E)});function O(){const[s={},u=[],S=void 0]=typeof i.extraReducers=="function"?jn(i.extraReducers):[i.extraReducers],A={...s,...v.sliceCaseReducersByType};return xr(i.initialState,I=>{for(let g in A)I.addCase(g,A[g]);for(let g of v.sliceMatchers)I.addMatcher(g.matcher,g.reducer);for(let g of u)I.addMatcher(g.matcher,g.reducer);S&&I.addDefaultCase(S)})}const f=s=>s,l=new Map,w=new WeakMap;let C;function R(s,u){return C||(C=O()),C(s,u)}function h(){return C||(C=O()),C.getInitialState()}function M(s,u=!1){function S(I){let g=I[s];return typeof g>"u"&&u&&(g=We(w,S,h)),g}function A(I=f){const g=We(l,u,()=>new WeakMap);return We(g,I,()=>{const d={};for(const[p,m]of Object.entries(i.selectors??{}))d[p]=Kr(m,I,()=>We(w,I,h),u);return d})}return{reducerPath:s,getSelectors:A,get selectors(){return A(S)},selectSlice:S}}const c={name:o,reducer:R,actions:v.actionCreators,caseReducers:v.sliceCaseReducersByName,getInitialState:h,...M(a),injectInto(s,{reducerPath:u,...S}={}){const A=u??a;return s.inject({reducerPath:A,reducer:R},S),{...c,...M(A,!0)}}};return c}}function Kr(e,t,n,r){function i(o,...a){let y=t(o);return typeof y>"u"&&r&&(y=n()),e(y,...a)}return i.unwrapped=e,i}var Se=Vr();function Br(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function Hr({type:e,reducerName:t,createNotation:n},r,i){let o,a;if("reducer"in r){if(n&&!Jr(r))throw new Error(te(17));o=r.reducer,a=r.prepare}else o=r;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,a?ee(e,a):ee(e))}function Gr(e){return e._reducerDefinitionType==="asyncThunk"}function Jr(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Xr({type:e,reducerName:t},n,r,i){if(!i)throw new Error(te(18));const{payloadCreator:o,fulfilled:a,pending:y,rejected:b,settled:v,options:E}=n,O=i(e,o,E);r.exposeAction(t,O),a&&r.addCase(O.fulfilled,a),y&&r.addCase(O.pending,y),b&&r.addCase(O.rejected,b),v&&r.addMatcher(O.settled,v),r.exposeCaseReducer(t,{fulfilled:a||Ve,pending:y||Ve,rejected:b||Ve,settled:v||Ve})}function Ve(){}function te(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var bt={exports:{}},vt={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* use-sync-external-store-with-selector.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var cn;function Yr(){if(cn)return vt;cn=1;var e=tr();function t(b,v){return b===v&&(b!==0||1/b===1/v)||b!==b&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,o=e.useEffect,a=e.useMemo,y=e.useDebugValue;return vt.useSyncExternalStoreWithSelector=function(b,v,E,O,f){var l=i(null);if(l.current===null){var w={hasValue:!1,value:null};l.current=w}else w=l.current;l=a(function(){function R(u){if(!h){if(h=!0,M=u,u=O(u),f!==void 0&&w.hasValue){var S=w.value;if(f(S,u))return c=S}return c=u}if(S=c,n(M,u))return S;var A=O(u);return f!==void 0&&f(S,A)?(M=u,S):(M=u,c=A)}var h=!1,M,c,s=E===void 0?null:E;return[function(){return R(v())},s===null?void 0:function(){return R(s())}]},[v,E,O,f]);var C=r(b,l[0],l[1]);return o(function(){w.hasValue=!0,w.value=C},[C]),y(C),C},vt}var an;function Zr(){return an||(an=1,bt.exports=Yr()),bt.exports}var ei=Zr();function Fn(e){e()}function ti(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Fn(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var fn={notify(){},get:()=>[]};function ni(e,t){let n,r=fn,i=0,o=!1;function a(C){E();const R=r.subscribe(C);let h=!1;return()=>{h||(h=!0,R(),O())}}function y(){r.notify()}function b(){w.onStateChange&&w.onStateChange()}function v(){return o}function E(){i++,n||(n=e.subscribe(b),r=ti())}function O(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=fn)}function f(){o||(o=!0,E())}function l(){o&&(o=!1,O())}const w={addNestedSub:a,notifyNestedSubs:y,handleChangeWrapper:b,isSubscribed:v,trySubscribe:f,tryUnsubscribe:l,getListeners:()=>r};return w}var ri=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ii=ri(),si=()=>typeof navigator<"u"&&navigator.product==="ReactNative",oi=si(),ui=()=>ii||oi?x.useLayoutEffect:x.useEffect,ci=ui();function ln(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Te(e,t){if(ln(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!ln(e[n[i]],t[n[i]]))return!1;return!0}var St=Symbol.for("react-redux-context"),wt=typeof globalThis<"u"?globalThis:{};function ai(){if(!x.createContext)return{};const e=wt[St]??(wt[St]=new Map);let t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}var de=ai();function fi(e){const{children:t,context:n,serverState:r,store:i}=e,o=x.useMemo(()=>{const b=ni(i);return{store:i,subscription:b,getServerState:r?()=>r:void 0}},[i,r]),a=x.useMemo(()=>i.getState(),[i]);ci(()=>{const{subscription:b}=o;return b.onStateChange=b.notifyNestedSubs,b.trySubscribe(),a!==i.getState()&&b.notifyNestedSubs(),()=>{b.tryUnsubscribe(),b.onStateChange=void 0}},[o,a]);const y=n||de;return x.createElement(y.Provider,{value:o},t)}var fs=fi;function $t(e=de){return function(){return x.useContext(e)}}var Nn=$t();function zn(e=de){const t=e===de?Nn:$t(e),n=()=>{const{store:r}=t();return r};return Object.assign(n,{withTypes:()=>n}),n}var Ln=zn();function li(e=de){const t=e===de?Ln:zn(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var di=li(),pi=(e,t)=>e===t;function yi(e=de){const t=e===de?Nn:$t(e),n=(r,i={})=>{const{equalityFn:o=pi}=typeof i=="function"?{equalityFn:i}:i,a=t(),{store:y,subscription:b,getServerState:v}=a;x.useRef(!0);const E=x.useCallback({[r.name](f){return r(f)}}[r.name],[r]),O=ei.useSyncExternalStoreWithSelector(b.addNestedSub,y.getState,v||y.getState,E,o);return x.useDebugValue(O),O};return Object.assign(n,{withTypes:()=>n}),n}var hi=yi(),gi=Fn;const dn={EDITORIAL_API_URL:"http://localhost:3001"};var mi=class extends Error{constructor(t){super(t[0].message);Ue(this,"issues");this.name="SchemaError",this.issues=t}},Un=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(Un||{});function pn(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var yn=fe;function $n(e,t){if(e===t||!(yn(e)&&yn(t)||Array.isArray(e)&&Array.isArray(t)))return t;const n=Object.keys(t),r=Object.keys(e);let i=n.length===r.length;const o=Array.isArray(t)?[]:{};for(const a of n)o[a]=$n(e[a],t[a]),i&&(i=e[a]===o[a]);return i?e:o}function _e(e){let t=0;for(const n in e)t++;return t}var hn=e=>[].concat(...e);function bi(e){return new RegExp("(^|:)//").test(e)}function vi(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function tt(e){return e!=null}function Si(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var wi=e=>e.replace(/\/$/,""),_i=e=>e.replace(/^\//,"");function Ei(e,t){if(!e)return t;if(!t)return e;if(bi(t))return t;const n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=wi(e),t=_i(t),`${e}${n}${t}`}function Ri(e,t,n){return e.has(t)?e.get(t):e.set(t,n).get(t)}var gn=(...e)=>fetch(...e),Pi=e=>e.status>=200&&e.status<=299,Oi=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function mn(e){if(!fe(e))return e;const t={...e};for(const[n,r]of Object.entries(t))r===void 0&&delete t[n];return t}function Ci({baseUrl:e,prepareHeaders:t=O=>O,fetchFn:n=gn,paramsSerializer:r,isJsonContentType:i=Oi,jsonContentType:o="application/json",jsonReplacer:a,timeout:y,responseHandler:b,validateStatus:v,...E}={}){return typeof fetch>"u"&&n===gn&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(f,l,w)=>{const{getState:C,extra:R,endpoint:h,forced:M,type:c}=l;let s,{url:u,headers:S=new Headers(E.headers),params:A=void 0,responseHandler:I=b??"json",validateStatus:g=v??Pi,timeout:d=y,...p}=typeof f=="string"?{url:f}:f,m,_=l.signal;d&&(m=new AbortController,l.signal.addEventListener("abort",m.abort),_=m.signal);let P={...E,signal:_,...p};S=new Headers(mn(S)),P.headers=await t(S,{getState:C,arg:f,extra:R,endpoint:h,forced:M,type:c,extraOptions:w})||S;const T=L=>typeof L=="object"&&(fe(L)||Array.isArray(L)||typeof L.toJSON=="function");if(!P.headers.has("content-type")&&T(P.body)&&P.headers.set("content-type",o),T(P.body)&&i(P.headers)&&(P.body=JSON.stringify(P.body,a)),A){const L=~u.indexOf("?")?"&":"?",k=r?r(A):new URLSearchParams(mn(A));u+=L+k}u=Ei(e,u);const D=new Request(u,P);s={request:new Request(u,P)};let j,q=!1,F=m&&setTimeout(()=>{q=!0,m.abort()},d);try{j=await n(D)}catch(L){return{error:{status:q?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(L)},meta:s}}finally{F&&clearTimeout(F),m==null||m.signal.removeEventListener("abort",m.abort)}const N=j.clone();s.response=N;let U,K="";try{let L;if(await Promise.all([O(j,I).then(k=>U=k,k=>L=k),N.text().then(k=>K=k,()=>{})]),L)throw L}catch(L){return{error:{status:"PARSING_ERROR",originalStatus:j.status,data:K,error:String(L)},meta:s}}return g(j,U)?{data:U,meta:s}:{error:{status:j.status,data:U},meta:s}};async function O(f,l){if(typeof l=="function")return l(f);if(l==="content-type"&&(l=i(f.headers)?"json":"text"),l==="json"){const w=await f.text();return w.length?JSON.parse(w):null}return f.text()}}var bn=class{constructor(e,t=void 0){this.value=e,this.meta=t}},ct=ee("__rtkq/focused"),Wt=ee("__rtkq/unfocused"),at=ee("__rtkq/online"),Vt=ee("__rtkq/offline"),_t=!1;function ls(e,t){function n(){const r=()=>e(ct()),i=()=>e(Wt()),o=()=>e(at()),a=()=>e(Vt()),y=()=>{window.document.visibilityState==="visible"?r():i()};return _t||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",y,!1),window.addEventListener("focus",r,!1),window.addEventListener("online",o,!1),window.addEventListener("offline",a,!1),_t=!0),()=>{window.removeEventListener("focus",r),window.removeEventListener("visibilitychange",y),window.removeEventListener("online",o),window.removeEventListener("offline",a),_t=!1}}return n()}function ft(e){return e.type==="query"}function Ai(e){return e.type==="mutation"}function lt(e){return e.type==="infinitequery"}function nt(e){return ft(e)||lt(e)}function Kt(e,t,n,r,i,o){return Mi(e)?e(t,n,r,i).filter(tt).map(Qt).map(o):Array.isArray(e)?e.map(Qt).map(o):[]}function Mi(e){return typeof e=="function"}function Qt(e){return typeof e=="string"?{type:e}:e}function Ii(e,t){return e.catch(t)}var je=Symbol("forceQueryFn"),kt=e=>typeof e[je]=="function";function Ti({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:n,mutationThunk:r,api:i,context:o}){const a=new Map,y=new Map,{unsubscribeQueryResult:b,removeMutationResult:v,updateSubscriptionOptions:E}=i.internalActions;return{buildInitiateQuery:R,buildInitiateInfiniteQuery:h,buildInitiateMutation:M,getRunningQueryThunk:O,getRunningMutationThunk:f,getRunningQueriesThunk:l,getRunningMutationsThunk:w};function O(c,s){return u=>{var I;const S=o.endpointDefinitions[c],A=e({queryArgs:s,endpointDefinition:S,endpointName:c});return(I=a.get(u))==null?void 0:I[A]}}function f(c,s){return u=>{var S;return(S=y.get(u))==null?void 0:S[s]}}function l(){return c=>Object.values(a.get(c)||{}).filter(tt)}function w(){return c=>Object.values(y.get(c)||{}).filter(tt)}function C(c,s){const u=(S,{subscribe:A=!0,forceRefetch:I,subscriptionOptions:g,[je]:d,...p}={})=>(m,_)=>{var W;const P=e({queryArgs:S,endpointDefinition:s,endpointName:c});let T;const D={...p,type:"query",subscribe:A,forceRefetch:I,subscriptionOptions:g,endpointName:c,originalArgs:S,queryCacheKey:P,[je]:d};if(ft(s))T=t(D);else{const{direction:z,initialPageParam:J}=p;T=n({...D,direction:z,initialPageParam:J})}const Q=i.endpoints[c].select(S),j=m(T),q=Q(_()),{requestId:F,abort:N}=j,U=q.requestId!==F,K=(W=a.get(m))==null?void 0:W[P],L=()=>Q(_()),k=Object.assign(d?j.then(L):U&&!K?Promise.resolve(q):Promise.all([K,j]).then(L),{arg:S,requestId:F,subscriptionOptions:g,queryCacheKey:P,abort:N,async unwrap(){const z=await k;if(z.isError)throw z.error;return z.data},refetch:()=>m(u(S,{subscribe:!1,forceRefetch:!0})),unsubscribe(){A&&m(b({queryCacheKey:P,requestId:F}))},updateSubscriptionOptions(z){k.subscriptionOptions=z,m(E({endpointName:c,requestId:F,queryCacheKey:P,options:z}))}});if(!K&&!U&&!d){const z=Ri(a,m,{});z[P]=k,k.then(()=>{delete z[P],_e(z)||a.delete(m)})}return k};return u}function R(c,s){return C(c,s)}function h(c,s){return C(c,s)}function M(c){return(s,{track:u=!0,fixedCacheKey:S}={})=>(A,I)=>{const g=r({type:"mutation",endpointName:c,originalArgs:s,track:u,fixedCacheKey:S}),d=A(g),{requestId:p,abort:m,unwrap:_}=d,P=Ii(d.unwrap().then(j=>({data:j})),j=>({error:j})),T=()=>{A(v({requestId:p,fixedCacheKey:S}))},D=Object.assign(P,{arg:d.arg,requestId:p,abort:m,unwrap:_,reset:T}),Q=y.get(A)||{};return y.set(A,Q),Q[p]=D,D.then(()=>{delete Q[p],_e(Q)||y.delete(A)}),S&&(Q[S]=D,D.then(()=>{Q[S]===D&&(delete Q[S],_e(Q)||y.delete(A))})),D}}}var Wn=class extends mi{constructor(e,t,n,r){super(e),this.value=t,this.schemaName=n,this._bqMeta=r}};async function pe(e,t,n,r){const i=await e["~standard"].validate(t);if(i.issues)throw new Wn(i.issues,t,n,r);return i.value}function Di(e){return e}var Oe=(e={})=>({...e,[st]:!0});function qi({reducerPath:e,baseQuery:t,context:{endpointDefinitions:n},serializeQueryArgs:r,api:i,assertTagType:o,selectors:a,onSchemaFailure:y,catchSchemaFailure:b,skipSchemaValidation:v}){const E=(p,m,_,P)=>(T,D)=>{const Q=n[p],j=r({queryArgs:m,endpointDefinition:Q,endpointName:p});if(T(i.internalActions.queryResultPatched({queryCacheKey:j,patches:_})),!P)return;const q=i.endpoints[p].select(m)(D()),F=Kt(Q.providesTags,q.data,void 0,m,{},o);T(i.internalActions.updateProvidedBy([{queryCacheKey:j,providedTags:F}]))};function O(p,m,_=0){const P=[m,...p];return _&&P.length>_?P.slice(0,-1):P}function f(p,m,_=0){const P=[...p,m];return _&&P.length>_?P.slice(1):P}const l=(p,m,_,P=!0)=>(T,D)=>{const j=i.endpoints[p].select(m)(D()),q={patches:[],inversePatches:[],undo:()=>T(i.util.patchQueryData(p,m,q.inversePatches,P))};if(j.status==="uninitialized")return q;let F;if("data"in j)if(ne(j.data)){const[N,U,K]=qn(j.data,_);q.patches.push(...U),q.inversePatches.push(...K),F=N}else F=_(j.data),q.patches.push({op:"replace",path:[],value:F}),q.inversePatches.push({op:"replace",path:[],value:j.data});return q.patches.length===0||T(i.util.patchQueryData(p,m,q.patches,P)),q},w=(p,m,_)=>P=>P(i.endpoints[p].initiate(m,{subscribe:!1,forceRefetch:!0,[je]:()=>({data:_})})),C=(p,m)=>p.query&&p[m]?p[m]:Di,R=async(p,{signal:m,abort:_,rejectWithValue:P,fulfillWithValue:T,dispatch:D,getState:Q,extra:j})=>{var U,K;const q=n[p.endpointName],{metaSchema:F,skipSchemaValidation:N=v}=q;try{let L=C(q,"transformResponse");const k={signal:m,abort:_,dispatch:D,getState:Q,extra:j,endpoint:p.endpointName,type:p.type,forced:p.type==="query"?h(p,Q()):void 0,queryCacheKey:p.type==="query"?p.queryCacheKey:void 0},W=p.type==="query"?p[je]:void 0;let z;const J=async(V,$,G,be)=>{if($==null&&V.pages.length)return Promise.resolve({data:V});const re={queryArg:p.originalArgs,pageParam:$},ve=await oe(re),ie=be?O:f;return{data:{pages:ie(V.pages,ve.data,G),pageParams:ie(V.pageParams,$,G)},meta:ve.meta}};async function oe(V){let $;const{extraOptions:G,argSchema:be,rawResponseSchema:re,responseSchema:ve}=q;if(be&&!N&&(V=await pe(be,V,"argSchema",{})),W?$=W():q.query?$=await t(q.query(V),k,G):$=await q.queryFn(V,k,G,Re=>t(Re,k,G)),typeof process<"u",$.error)throw new bn($.error,$.meta);let{data:ie}=$;re&&!N&&(ie=await pe(re,$.data,"rawResponseSchema",$.meta));let ae=await L(ie,$.meta,V);return ve&&!N&&(ae=await pe(ve,ae,"responseSchema",$.meta)),{...$,data:ae}}if(p.type==="query"&&"infiniteQueryOptions"in q){const{infiniteQueryOptions:V}=q,{maxPages:$=1/0}=V;let G;const be={pages:[],pageParams:[]},re=(U=a.selectQueryEntry(Q(),p.queryCacheKey))==null?void 0:U.data,ie=h(p,Q())&&!p.direction||!re?be:re;if("direction"in p&&p.direction&&ie.pages.length){const ae=p.direction==="backward",dt=(ae?Vn:jt)(V,ie,p.originalArgs);G=await J(ie,dt,$,ae)}else{const{initialPageParam:ae=V.initialPageParam}=p,Re=(re==null?void 0:re.pageParams)??[],dt=Re[0]??ae,Xn=Re.length;G=await J(ie,dt,$),W&&(G={data:G.data.pages[0]});for(let Bt=1;Bt<Xn;Bt++){const Yn=jt(V,G.data,p.originalArgs);G=await J(G.data,Yn,$)}}z=G}else z=await oe(p.originalArgs);return F&&!N&&z.meta&&(z.meta=await pe(F,z.meta,"metaSchema",z.meta)),T(z.data,Oe({fulfilledTimeStamp:Date.now(),baseQueryMeta:z.meta}))}catch(L){let k=L;if(k instanceof bn){let W=C(q,"transformErrorResponse");const{rawErrorResponseSchema:z,errorResponseSchema:J}=q;let{value:oe,meta:V}=k;try{z&&!N&&(oe=await pe(z,oe,"rawErrorResponseSchema",V)),F&&!N&&(V=await pe(F,V,"metaSchema",V));let $=await W(oe,V,p.originalArgs);return J&&!N&&($=await pe(J,$,"errorResponseSchema",V)),P($,Oe({baseQueryMeta:V}))}catch($){k=$}}try{if(k instanceof Wn){const W={endpoint:p.endpointName,arg:p.originalArgs,type:p.type,queryCacheKey:p.type==="query"?p.queryCacheKey:void 0};(K=q.onSchemaFailure)==null||K.call(q,k,W),y==null||y(k,W);const{catchSchemaFailure:z=b}=q;if(z)return P(z(k,W),Oe({baseQueryMeta:k._bqMeta}))}}catch(W){k=W}throw console.error(k),k}};function h(p,m){const _=a.selectQueryEntry(m,p.queryCacheKey),P=a.selectConfig(m).refetchOnMountOrArgChange,T=_==null?void 0:_.fulfilledTimeStamp,D=p.forceRefetch??(p.subscribe&&P);return D?D===!0||(Number(new Date)-Number(T))/1e3>=D:!1}const M=()=>un(`${e}/executeQuery`,R,{getPendingMeta({arg:m}){const _=n[m.endpointName];return Oe({startedTimeStamp:Date.now(),...lt(_)?{direction:m.direction}:{}})},condition(m,{getState:_}){var N;const P=_(),T=a.selectQueryEntry(P,m.queryCacheKey),D=T==null?void 0:T.fulfilledTimeStamp,Q=m.originalArgs,j=T==null?void 0:T.originalArgs,q=n[m.endpointName],F=m.direction;return kt(m)?!0:(T==null?void 0:T.status)==="pending"?!1:h(m,P)||ft(q)&&((N=q==null?void 0:q.forceRefetch)!=null&&N.call(q,{currentArg:Q,previousArg:j,endpointState:T,state:P}))?!0:!(D&&!F)},dispatchConditionRejection:!0}),c=M(),s=M(),u=un(`${e}/executeMutation`,R,{getPendingMeta(){return Oe({startedTimeStamp:Date.now()})}}),S=p=>"force"in p,A=p=>"ifOlderThan"in p,I=(p,m,_)=>(P,T)=>{const D=S(_)&&_.force,Q=A(_)&&_.ifOlderThan,j=(F=!0)=>{const N={forceRefetch:F,isPrefetch:!0};return i.endpoints[p].initiate(m,N)},q=i.endpoints[p].select(m)(T());if(D)P(j());else if(Q){const F=q==null?void 0:q.fulfilledTimeStamp;if(!F){P(j());return}(Number(new Date)-Number(new Date(F)))/1e3>=Q&&P(j())}else P(j(!1))};function g(p){return m=>{var _,P;return((P=(_=m==null?void 0:m.meta)==null?void 0:_.arg)==null?void 0:P.endpointName)===p}}function d(p,m){return{matchPending:Ie(Lt(p),g(m)),matchFulfilled:Ie(le(p),g(m)),matchRejected:Ie(Ee(p),g(m))}}return{queryThunk:c,mutationThunk:u,infiniteQueryThunk:s,prefetch:I,updateQueryData:l,upsertQueryData:w,patchQueryData:E,buildMatchThunkActions:d}}function jt(e,{pages:t,pageParams:n},r){const i=t.length-1;return e.getNextPageParam(t[i],t,n[i],n,r)}function Vn(e,{pages:t,pageParams:n},r){var i;return(i=e.getPreviousPageParam)==null?void 0:i.call(e,t[0],t,n[0],n,r)}function Kn(e,t,n,r){return Kt(n[e.meta.arg.endpointName][t],le(e)?e.payload:void 0,ut(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,r)}function Ke(e,t,n){const r=e[t];r&&n(r)}function xe(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function vn(e,t,n){const r=e[xe(t)];r&&n(r)}var Be={};function Qi({reducerPath:e,queryThunk:t,mutationThunk:n,serializeQueryArgs:r,context:{endpointDefinitions:i,apiUid:o,extractRehydrationInfo:a,hasRehydrationInfo:y},assertTagType:b,config:v}){const E=ee(`${e}/resetApiState`);function O(g,d,p,m){var _;g[_=d.queryCacheKey]??(g[_]={status:"uninitialized",endpointName:d.endpointName}),Ke(g,d.queryCacheKey,P=>{P.status="pending",P.requestId=p&&P.requestId?P.requestId:m.requestId,d.originalArgs!==void 0&&(P.originalArgs=d.originalArgs),P.startedTimeStamp=m.startedTimeStamp;const T=i[m.arg.endpointName];lt(T)&&"direction"in d&&(P.direction=d.direction)})}function f(g,d,p,m){Ke(g,d.arg.queryCacheKey,_=>{if(_.requestId!==d.requestId&&!m)return;const{merge:P}=i[d.arg.endpointName];if(_.status="fulfilled",P)if(_.data!==void 0){const{fulfilledTimeStamp:T,arg:D,baseQueryMeta:Q,requestId:j}=d;let q=ze(_.data,F=>P(F,p,{arg:D.originalArgs,baseQueryMeta:Q,fulfilledTimeStamp:T,requestId:j}));_.data=q}else _.data=p;else _.data=i[d.arg.endpointName].structuralSharing??!0?$n(se(_.data)?ur(_.data):_.data,p):p;delete _.error,_.fulfilledTimeStamp=d.fulfilledTimeStamp})}const l=Se({name:`${e}/queries`,initialState:Be,reducers:{removeQueryResult:{reducer(g,{payload:{queryCacheKey:d}}){delete g[d]},prepare:Pe()},cacheEntriesUpserted:{reducer(g,d){for(const p of d.payload){const{queryDescription:m,value:_}=p;O(g,m,!0,{arg:m,requestId:d.meta.requestId,startedTimeStamp:d.meta.timestamp}),f(g,{arg:m,requestId:d.meta.requestId,fulfilledTimeStamp:d.meta.timestamp,baseQueryMeta:{}},_,!0)}},prepare:g=>({payload:g.map(m=>{const{endpointName:_,arg:P,value:T}=m,D=i[_];return{queryDescription:{type:"query",endpointName:_,originalArgs:m.arg,queryCacheKey:r({queryArgs:P,endpointDefinition:D,endpointName:_})},value:T}}),meta:{[st]:!0,requestId:Ut(),timestamp:Date.now()}})},queryResultPatched:{reducer(g,{payload:{queryCacheKey:d,patches:p}}){Ke(g,d,m=>{m.data=Zt(m.data,p.concat())})},prepare:Pe()}},extraReducers(g){g.addCase(t.pending,(d,{meta:p,meta:{arg:m}})=>{const _=kt(m);O(d,m,_,p)}).addCase(t.fulfilled,(d,{meta:p,payload:m})=>{const _=kt(p.arg);f(d,p,m,_)}).addCase(t.rejected,(d,{meta:{condition:p,arg:m,requestId:_},error:P,payload:T})=>{Ke(d,m.queryCacheKey,D=>{if(!p){if(D.requestId!==_)return;D.status="rejected",D.error=T??P}})}).addMatcher(y,(d,p)=>{const{queries:m}=a(p);for(const[_,P]of Object.entries(m))((P==null?void 0:P.status)==="fulfilled"||(P==null?void 0:P.status)==="rejected")&&(d[_]=P)})}}),w=Se({name:`${e}/mutations`,initialState:Be,reducers:{removeMutationResult:{reducer(g,{payload:d}){const p=xe(d);p in g&&delete g[p]},prepare:Pe()}},extraReducers(g){g.addCase(n.pending,(d,{meta:p,meta:{requestId:m,arg:_,startedTimeStamp:P}})=>{_.track&&(d[xe(p)]={requestId:m,status:"pending",endpointName:_.endpointName,startedTimeStamp:P})}).addCase(n.fulfilled,(d,{payload:p,meta:m})=>{m.arg.track&&vn(d,m,_=>{_.requestId===m.requestId&&(_.status="fulfilled",_.data=p,_.fulfilledTimeStamp=m.fulfilledTimeStamp)})}).addCase(n.rejected,(d,{payload:p,error:m,meta:_})=>{_.arg.track&&vn(d,_,P=>{P.requestId===_.requestId&&(P.status="rejected",P.error=p??m)})}).addMatcher(y,(d,p)=>{const{mutations:m}=a(p);for(const[_,P]of Object.entries(m))((P==null?void 0:P.status)==="fulfilled"||(P==null?void 0:P.status)==="rejected")&&_!==(P==null?void 0:P.requestId)&&(d[_]=P)})}}),C={tags:{},keys:{}},R=Se({name:`${e}/invalidation`,initialState:C,reducers:{updateProvidedBy:{reducer(g,d){var p,m,_;for(const{queryCacheKey:P,providedTags:T}of d.payload){h(g,P);for(const{type:D,id:Q}of T){const j=(m=(p=g.tags)[D]??(p[D]={}))[_=Q||"__internal_without_id"]??(m[_]=[]);j.includes(P)||j.push(P)}g.keys[P]=T}},prepare:Pe()}},extraReducers(g){g.addCase(l.actions.removeQueryResult,(d,{payload:{queryCacheKey:p}})=>{h(d,p)}).addMatcher(y,(d,p)=>{var _,P,T;const{provided:m}=a(p);for(const[D,Q]of Object.entries(m))for(const[j,q]of Object.entries(Q)){const F=(P=(_=d.tags)[D]??(_[D]={}))[T=j||"__internal_without_id"]??(P[T]=[]);for(const N of q)F.includes(N)||F.push(N)}}).addMatcher(ce(le(t),ut(t)),(d,p)=>{M(d,[p])}).addMatcher(l.actions.cacheEntriesUpserted.match,(d,p)=>{const m=p.payload.map(({queryDescription:_,value:P})=>({type:"UNKNOWN",payload:P,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:_}}));M(d,m)})}});function h(g,d){var m;const p=g.keys[d]??[];for(const _ of p){const P=_.type,T=_.id??"__internal_without_id",D=(m=g.tags[P])==null?void 0:m[T];D&&(g.tags[P][T]=D.filter(Q=>Q!==d))}delete g.keys[d]}function M(g,d){const p=d.map(m=>{const _=Kn(m,"providesTags",i,b),{queryCacheKey:P}=m.meta.arg;return{queryCacheKey:P,providedTags:_}});R.caseReducers.updateProvidedBy(g,R.actions.updateProvidedBy(p))}const c=Se({name:`${e}/subscriptions`,initialState:Be,reducers:{updateSubscriptionOptions(g,d){},unsubscribeQueryResult(g,d){},internal_getRTKQSubscriptions(){}}}),s=Se({name:`${e}/internalSubscriptions`,initialState:Be,reducers:{subscriptionsUpdated:{reducer(g,d){return Zt(g,d.payload)},prepare:Pe()}}}),u=Se({name:`${e}/config`,initialState:{online:Si(),focused:vi(),middlewareRegistered:!1,...v},reducers:{middlewareRegistered(g,{payload:d}){g.middlewareRegistered=g.middlewareRegistered==="conflict"||o!==d?"conflict":!0}},extraReducers:g=>{g.addCase(at,d=>{d.online=!0}).addCase(Vt,d=>{d.online=!1}).addCase(ct,d=>{d.focused=!0}).addCase(Wt,d=>{d.focused=!1}).addMatcher(y,d=>({...d}))}}),S=On({queries:l.reducer,mutations:w.reducer,provided:R.reducer,subscriptions:s.reducer,config:u.reducer}),A=(g,d)=>S(E.match(d)?void 0:g,d),I={...u.actions,...l.actions,...c.actions,...s.actions,...w.actions,...R.actions,resetApiState:E};return{reducer:A,actions:I}}var Z=Symbol.for("RTKQ/skipToken"),Bn={status:"uninitialized"},Sn=ze(Bn,()=>{}),wn=ze(Bn,()=>{});function ki({serializeQueryArgs:e,reducerPath:t,createSelector:n}){const r=c=>Sn,i=c=>wn;return{buildQuerySelector:f,buildInfiniteQuerySelector:l,buildMutationSelector:w,selectInvalidatedBy:C,selectCachedArgsForQuery:R,selectApiState:a,selectQueries:y,selectMutations:v,selectQueryEntry:b,selectConfig:E};function o(c){return{...c,...pn(c.status)}}function a(c){return c[t]}function y(c){var s;return(s=a(c))==null?void 0:s.queries}function b(c,s){var u;return(u=y(c))==null?void 0:u[s]}function v(c){var s;return(s=a(c))==null?void 0:s.mutations}function E(c){var s;return(s=a(c))==null?void 0:s.config}function O(c,s,u){return S=>{if(S===Z)return n(r,u);const A=e({queryArgs:S,endpointDefinition:s,endpointName:c});return n(g=>b(g,A)??Sn,u)}}function f(c,s){return O(c,s,o)}function l(c,s){const{infiniteQueryOptions:u}=s;function S(A){const I={...A,...pn(A.status)},{isLoading:g,isError:d,direction:p}=I,m=p==="forward",_=p==="backward";return{...I,hasNextPage:h(u,I.data,I.originalArgs),hasPreviousPage:M(u,I.data,I.originalArgs),isFetchingNextPage:g&&m,isFetchingPreviousPage:g&&_,isFetchNextPageError:d&&m,isFetchPreviousPageError:d&&_}}return O(c,s,S)}function w(){return c=>{let s;return typeof c=="object"?s=xe(c)??Z:s=c,n(s===Z?i:A=>{var I,g;return((g=(I=a(A))==null?void 0:I.mutations)==null?void 0:g[s])??wn},o)}}function C(c,s){const u=c[t],S=new Set;for(const A of s.filter(tt).map(Qt)){const I=u.provided.tags[A.type];if(!I)continue;let g=(A.id!==void 0?I[A.id]:hn(Object.values(I)))??[];for(const d of g)S.add(d)}return hn(Array.from(S.values()).map(A=>{const I=u.queries[A];return I?[{queryCacheKey:A,endpointName:I.endpointName,originalArgs:I.originalArgs}]:[]}))}function R(c,s){return Object.values(y(c)).filter(u=>(u==null?void 0:u.endpointName)===s&&u.status!=="uninitialized").map(u=>u.originalArgs)}function h(c,s,u){return s?jt(c,s,u)!=null:!1}function M(c,s,u){return!s||!c.getPreviousPageParam?!1:Vn(c,s,u)!=null}}var we=WeakMap?new WeakMap:void 0,rt=({endpointName:e,queryArgs:t})=>{let n="";const r=we==null?void 0:we.get(t);if(typeof r=="string")n=r;else{const i=JSON.stringify(t,(o,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=fe(a)?Object.keys(a).sort().reduce((y,b)=>(y[b]=a[b],y),{}):a,a));fe(t)&&(we==null||we.set(t,i)),n=i}return`${e}(${n})`};function Hn(...e){return function(n){const r=et(v=>{var E;return(E=n.extractRehydrationInfo)==null?void 0:E.call(n,v,{reducerPath:n.reducerPath??"api"})}),i={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...n,extractRehydrationInfo:r,serializeQueryArgs(v){let E=rt;if("serializeQueryArgs"in v.endpointDefinition){const O=v.endpointDefinition.serializeQueryArgs;E=f=>{const l=O(f);return typeof l=="string"?l:rt({...f,queryArgs:l})}}else n.serializeQueryArgs&&(E=n.serializeQueryArgs);return E(v)},tagTypes:[...n.tagTypes||[]]},o={endpointDefinitions:{},batch(v){v()},apiUid:Ut(),extractRehydrationInfo:r,hasRehydrationInfo:et(v=>r(v)!=null)},a={injectEndpoints:b,enhanceEndpoints({addTagTypes:v,endpoints:E}){if(v)for(const O of v)i.tagTypes.includes(O)||i.tagTypes.push(O);if(E)for(const[O,f]of Object.entries(E))typeof f=="function"?f(o.endpointDefinitions[O]):Object.assign(o.endpointDefinitions[O]||{},f);return a}},y=e.map(v=>v.init(a,i,o));function b(v){const E=v.endpoints({query:O=>({...O,type:"query"}),mutation:O=>({...O,type:"mutation"}),infiniteQuery:O=>({...O,type:"infinitequery"})});for(const[O,f]of Object.entries(E)){if(v.overrideExisting!==!0&&O in o.endpointDefinitions){if(v.overrideExisting==="throw")throw new Error(te(39));continue}o.endpointDefinitions[O]=f;for(const l of y)l.injectEndpoint(O,f)}return a}return a.injectEndpoints({endpoints:n.endpoints})}}function ue(e,...t){return Object.assign(e,...t)}var ji=({api:e,queryThunk:t,internalState:n})=>{const r=`${e.reducerPath}/subscriptions`;let i=null,o=null;const{updateSubscriptionOptions:a,unsubscribeQueryResult:y}=e.internalActions,b=(l,w)=>{var R,h,M;if(a.match(w)){const{queryCacheKey:c,requestId:s,options:u}=w.payload;return(R=l==null?void 0:l[c])!=null&&R[s]&&(l[c][s]=u),!0}if(y.match(w)){const{queryCacheKey:c,requestId:s}=w.payload;return l[c]&&delete l[c][s],!0}if(e.internalActions.removeQueryResult.match(w))return delete l[w.payload.queryCacheKey],!0;if(t.pending.match(w)){const{meta:{arg:c,requestId:s}}=w,u=l[h=c.queryCacheKey]??(l[h]={});return u[`${s}_running`]={},c.subscribe&&(u[s]=c.subscriptionOptions??u[s]??{}),!0}let C=!1;if(t.fulfilled.match(w)||t.rejected.match(w)){const c=l[w.meta.arg.queryCacheKey]||{},s=`${w.meta.requestId}_running`;C||(C=!!c[s]),delete c[s]}if(t.rejected.match(w)){const{meta:{condition:c,arg:s,requestId:u}}=w;if(c&&s.subscribe){const S=l[M=s.queryCacheKey]??(l[M]={});S[u]=s.subscriptionOptions??S[u]??{},C=!0}}return C},v=()=>n.currentSubscriptions,f={getSubscriptions:v,getSubscriptionCount:l=>{const C=v()[l]??{};return _e(C)},isRequestSubscribed:(l,w)=>{var R;const C=v();return!!((R=C==null?void 0:C[l])!=null&&R[w])}};return(l,w)=>{if(i||(i=JSON.parse(JSON.stringify(n.currentSubscriptions))),e.util.resetApiState.match(l))return i=n.currentSubscriptions={},o=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(l))return[!1,f];const C=b(n.currentSubscriptions,l);let R=!0;if(C){o||(o=setTimeout(()=>{const c=JSON.parse(JSON.stringify(n.currentSubscriptions)),[,s]=qn(i,()=>c);w.next(e.internalActions.subscriptionsUpdated(s)),i=c,o=null},500));const h=typeof l.type=="string"&&!!l.type.startsWith(r),M=t.rejected.match(l)&&l.meta.condition&&!!l.meta.arg.subscribe;R=!h&&!M}return[R,!1]}};function xi(e){for(const t in e)return!1;return!0}var Fi=2147483647/1e3-1,Ni=({reducerPath:e,api:t,queryThunk:n,context:r,internalState:i,selectors:{selectQueryEntry:o,selectConfig:a}})=>{const{removeQueryResult:y,unsubscribeQueryResult:b,cacheEntriesUpserted:v}=t.internalActions,E=ce(b.match,n.fulfilled,n.rejected,v.match);function O(R){const h=i.currentSubscriptions[R];return!!h&&!xi(h)}const f={},l=(R,h,M)=>{const c=h.getState(),s=a(c);if(E(R)){let u;if(v.match(R))u=R.payload.map(S=>S.queryDescription.queryCacheKey);else{const{queryCacheKey:S}=b.match(R)?R.payload:R.meta.arg;u=[S]}w(u,h,s)}if(t.util.resetApiState.match(R))for(const[u,S]of Object.entries(f))S&&clearTimeout(S),delete f[u];if(r.hasRehydrationInfo(R)){const{queries:u}=r.extractRehydrationInfo(R);w(Object.keys(u),h,s)}};function w(R,h,M){const c=h.getState();for(const s of R){const u=o(c,s);C(s,u==null?void 0:u.endpointName,h,M)}}function C(R,h,M,c){const s=r.endpointDefinitions[h],u=(s==null?void 0:s.keepUnusedDataFor)??c.keepUnusedDataFor;if(u===1/0)return;const S=Math.max(0,Math.min(u,Fi));if(!O(R)){const A=f[R];A&&clearTimeout(A),f[R]=setTimeout(()=>{O(R)||M.dispatch(y({queryCacheKey:R})),delete f[R]},S*1e3)}}return l},_n=new Error("Promise never resolved before cacheEntryRemoved."),zi=({api:e,reducerPath:t,context:n,queryThunk:r,mutationThunk:i,internalState:o,selectors:{selectQueryEntry:a,selectApiState:y}})=>{const b=qt(r),v=qt(i),E=le(r,i),O={};function f(h,M,c){const s=O[h];s!=null&&s.valueResolved&&(s.valueResolved({data:M,meta:c}),delete s.valueResolved)}function l(h){const M=O[h];M&&(delete O[h],M.cacheEntryRemoved())}const w=(h,M,c)=>{const s=C(h);function u(S,A,I,g){const d=a(c,A),p=a(M.getState(),A);!d&&p&&R(S,g,A,M,I)}if(r.pending.match(h))u(h.meta.arg.endpointName,s,h.meta.requestId,h.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(h))for(const{queryDescription:S,value:A}of h.payload){const{endpointName:I,originalArgs:g,queryCacheKey:d}=S;u(I,d,h.meta.requestId,g),f(d,A,{})}else if(i.pending.match(h))M.getState()[t].mutations[s]&&R(h.meta.arg.endpointName,h.meta.arg.originalArgs,s,M,h.meta.requestId);else if(E(h))f(s,h.payload,h.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(h)||e.internalActions.removeMutationResult.match(h))l(s);else if(e.util.resetApiState.match(h))for(const S of Object.keys(O))l(S)};function C(h){return b(h)?h.meta.arg.queryCacheKey:v(h)?h.meta.arg.fixedCacheKey??h.meta.requestId:e.internalActions.removeQueryResult.match(h)?h.payload.queryCacheKey:e.internalActions.removeMutationResult.match(h)?xe(h.payload):""}function R(h,M,c,s,u){const S=n.endpointDefinitions[h],A=S==null?void 0:S.onCacheEntryAdded;if(!A)return;const I={},g=new Promise(T=>{I.cacheEntryRemoved=T}),d=Promise.race([new Promise(T=>{I.valueResolved=T}),g.then(()=>{throw _n})]);d.catch(()=>{}),O[c]=I;const p=e.endpoints[h].select(nt(S)?M:c),m=s.dispatch((T,D,Q)=>Q),_={...s,getCacheEntry:()=>p(s.getState()),requestId:u,extra:m,updateCachedData:nt(S)?T=>s.dispatch(e.util.updateQueryData(h,M,T)):void 0,cacheDataLoaded:d,cacheEntryRemoved:g},P=A(M,_);Promise.resolve(P).catch(T=>{if(T!==_n)throw T})}return w},Li=({api:e,context:{apiUid:t},reducerPath:n})=>(r,i)=>{e.util.resetApiState.match(r)&&i.dispatch(e.internalActions.middlewareRegistered(t))},Ui=({reducerPath:e,context:t,context:{endpointDefinitions:n},mutationThunk:r,queryThunk:i,api:o,assertTagType:a,refetchQuery:y,internalState:b})=>{const{removeQueryResult:v}=o.internalActions,E=ce(le(r),ut(r)),O=ce(le(r,i),Ee(r,i));let f=[];const l=(R,h)=>{E(R)?C(Kn(R,"invalidatesTags",n,a),h):O(R)?C([],h):o.util.invalidateTags.match(R)&&C(Kt(R.payload,void 0,void 0,void 0,void 0,a),h)};function w(R){var c;const{queries:h,mutations:M}=R;for(const s of[h,M])for(const u in s)if(((c=s[u])==null?void 0:c.status)==="pending")return!0;return!1}function C(R,h){const M=h.getState(),c=M[e];if(f.push(...R),c.config.invalidationBehavior==="delayed"&&w(c))return;const s=f;if(f=[],s.length===0)return;const u=o.util.selectInvalidatedBy(M,s);t.batch(()=>{const S=Array.from(u.values());for(const{queryCacheKey:A}of S){const I=c.queries[A],g=b.currentSubscriptions[A]??{};I&&(_e(g)===0?h.dispatch(v({queryCacheKey:A})):I.status!=="uninitialized"&&h.dispatch(y(I)))}})}return l},$i=({reducerPath:e,queryThunk:t,api:n,refetchQuery:r,internalState:i})=>{const o={},a=(f,l)=>{(n.internalActions.updateSubscriptionOptions.match(f)||n.internalActions.unsubscribeQueryResult.match(f))&&b(f.payload,l),(t.pending.match(f)||t.rejected.match(f)&&f.meta.condition)&&b(f.meta.arg,l),(t.fulfilled.match(f)||t.rejected.match(f)&&!f.meta.condition)&&y(f.meta.arg,l),n.util.resetApiState.match(f)&&E()};function y({queryCacheKey:f},l){const w=l.getState()[e],C=w.queries[f],R=i.currentSubscriptions[f];if(!C||C.status==="uninitialized")return;const{lowestPollingInterval:h,skipPollingIfUnfocused:M}=O(R);if(!Number.isFinite(h))return;const c=o[f];c!=null&&c.timeout&&(clearTimeout(c.timeout),c.timeout=void 0);const s=Date.now()+h;o[f]={nextPollTimestamp:s,pollingInterval:h,timeout:setTimeout(()=>{(w.config.focused||!M)&&l.dispatch(r(C)),y({queryCacheKey:f},l)},h)}}function b({queryCacheKey:f},l){const C=l.getState()[e].queries[f],R=i.currentSubscriptions[f];if(!C||C.status==="uninitialized")return;const{lowestPollingInterval:h}=O(R);if(!Number.isFinite(h)){v(f);return}const M=o[f],c=Date.now()+h;(!M||c<M.nextPollTimestamp)&&y({queryCacheKey:f},l)}function v(f){const l=o[f];l!=null&&l.timeout&&clearTimeout(l.timeout),delete o[f]}function E(){for(const f of Object.keys(o))v(f)}function O(f={}){let l=!1,w=Number.POSITIVE_INFINITY;for(let C in f)f[C].pollingInterval&&(w=Math.min(f[C].pollingInterval,w),l=f[C].skipPollingIfUnfocused||l);return{lowestPollingInterval:w,skipPollingIfUnfocused:l}}return a},Wi=({api:e,context:t,queryThunk:n,mutationThunk:r})=>{const i=Lt(n,r),o=Ee(n,r),a=le(n,r),y={};return(v,E)=>{var O,f;if(i(v)){const{requestId:l,arg:{endpointName:w,originalArgs:C}}=v.meta,R=t.endpointDefinitions[w],h=R==null?void 0:R.onQueryStarted;if(h){const M={},c=new Promise((A,I)=>{M.resolve=A,M.reject=I});c.catch(()=>{}),y[l]=M;const s=e.endpoints[w].select(nt(R)?C:l),u=E.dispatch((A,I,g)=>g),S={...E,getCacheEntry:()=>s(E.getState()),requestId:l,extra:u,updateCachedData:nt(R)?A=>E.dispatch(e.util.updateQueryData(w,C,A)):void 0,queryFulfilled:c};h(C,S)}}else if(a(v)){const{requestId:l,baseQueryMeta:w}=v.meta;(O=y[l])==null||O.resolve({data:v.payload,meta:w}),delete y[l]}else if(o(v)){const{requestId:l,rejectedWithValue:w,baseQueryMeta:C}=v.meta;(f=y[l])==null||f.reject({error:v.payload??v.error,isUnhandledError:!w,meta:C}),delete y[l]}}},Vi=({reducerPath:e,context:t,api:n,refetchQuery:r,internalState:i})=>{const{removeQueryResult:o}=n.internalActions,a=(b,v)=>{ct.match(b)&&y(v,"refetchOnFocus"),at.match(b)&&y(v,"refetchOnReconnect")};function y(b,v){const E=b.getState()[e],O=E.queries,f=i.currentSubscriptions;t.batch(()=>{for(const l of Object.keys(f)){const w=O[l],C=f[l];if(!C||!w)continue;(Object.values(C).some(h=>h[v]===!0)||Object.values(C).every(h=>h[v]===void 0)&&E.config[v])&&(_e(C)===0?b.dispatch(o({queryCacheKey:l})):w.status!=="uninitialized"&&b.dispatch(r(w)))}})}return a};function Ki(e){const{reducerPath:t,queryThunk:n,api:r,context:i}=e,{apiUid:o}=i,a={invalidateTags:ee(`${t}/invalidateTags`)},y=O=>O.type.startsWith(`${t}/`),b=[Li,Ni,Ui,$i,zi,Wi];return{middleware:O=>{let f=!1;const w={...e,internalState:{currentSubscriptions:{}},refetchQuery:E,isThisApiSliceAction:y},C=b.map(M=>M(w)),R=ji(w),h=Vi(w);return M=>c=>{if(!Cn(c))return M(c);f||(f=!0,O.dispatch(r.internalActions.middlewareRegistered(o)));const s={...O,next:M},u=O.getState(),[S,A]=R(c,s,u);let I;if(S?I=M(c):I=A,O.getState()[t]&&(h(c,s,u),y(c)||i.hasRehydrationInfo(c)))for(const g of C)g(c,s,u);return I}},actions:a};function E(O){return e.api.endpoints[O.endpointName].initiate(O.originalArgs,{subscribe:!1,forceRefetch:!0})}}var En=Symbol(),Gn=({createSelector:e=zt}={})=>({name:En,init(t,{baseQuery:n,tagTypes:r,reducerPath:i,serializeQueryArgs:o,keepUnusedDataFor:a,refetchOnMountOrArgChange:y,refetchOnFocus:b,refetchOnReconnect:v,invalidationBehavior:E,onSchemaFailure:O,catchSchemaFailure:f,skipSchemaValidation:l},w){mr();const C=k=>k;Object.assign(t,{reducerPath:i,endpoints:{},internalActions:{onOnline:at,onOffline:Vt,onFocus:ct,onFocusLost:Wt},util:{}});const R=ki({serializeQueryArgs:o,reducerPath:i,createSelector:e}),{selectInvalidatedBy:h,selectCachedArgsForQuery:M,buildQuerySelector:c,buildInfiniteQuerySelector:s,buildMutationSelector:u}=R;ue(t.util,{selectInvalidatedBy:h,selectCachedArgsForQuery:M});const{queryThunk:S,infiniteQueryThunk:A,mutationThunk:I,patchQueryData:g,updateQueryData:d,upsertQueryData:p,prefetch:m,buildMatchThunkActions:_}=qi({baseQuery:n,reducerPath:i,context:w,api:t,serializeQueryArgs:o,assertTagType:C,selectors:R,onSchemaFailure:O,catchSchemaFailure:f,skipSchemaValidation:l}),{reducer:P,actions:T}=Qi({context:w,queryThunk:S,mutationThunk:I,serializeQueryArgs:o,reducerPath:i,assertTagType:C,config:{refetchOnFocus:b,refetchOnReconnect:v,refetchOnMountOrArgChange:y,keepUnusedDataFor:a,reducerPath:i,invalidationBehavior:E}});ue(t.util,{patchQueryData:g,updateQueryData:d,upsertQueryData:p,prefetch:m,resetApiState:T.resetApiState,upsertQueryEntries:T.cacheEntriesUpserted}),ue(t.internalActions,T);const{middleware:D,actions:Q}=Ki({reducerPath:i,context:w,queryThunk:S,mutationThunk:I,infiniteQueryThunk:A,api:t,assertTagType:C,selectors:R});ue(t.util,Q),ue(t,{reducer:P,middleware:D});const{buildInitiateQuery:j,buildInitiateInfiniteQuery:q,buildInitiateMutation:F,getRunningMutationThunk:N,getRunningMutationsThunk:U,getRunningQueriesThunk:K,getRunningQueryThunk:L}=Ti({queryThunk:S,mutationThunk:I,infiniteQueryThunk:A,api:t,serializeQueryArgs:o,context:w});return ue(t.util,{getRunningMutationThunk:N,getRunningMutationsThunk:U,getRunningQueryThunk:L,getRunningQueriesThunk:K}),{name:En,injectEndpoint(k,W){var oe;const J=(oe=t.endpoints)[k]??(oe[k]={});ft(W)&&ue(J,{name:k,select:c(k,W),initiate:j(k,W)},_(S,k)),Ai(W)&&ue(J,{name:k,select:u(),initiate:F(k)},_(I,k)),lt(W)&&ue(J,{name:k,select:s(k,W),initiate:q(k,W)},_(S,k))}}}});Gn();function He(e){return e.replace(e[0],e[0].toUpperCase())}function Bi(e){return e.type==="query"}function Hi(e){return e.type==="mutation"}function Jn(e){return e.type==="infinitequery"}function Ce(e,...t){return Object.assign(e,...t)}var Et=Symbol();function Rt(e,t,n,r){const i=x.useMemo(()=>({queryArgs:e,serialized:typeof e=="object"?t({queryArgs:e,endpointDefinition:n,endpointName:r}):e}),[e,t,n,r]),o=x.useRef(i);return x.useEffect(()=>{o.current.serialized!==i.serialized&&(o.current=i)},[i]),o.current.serialized===i.serialized?o.current.queryArgs:e}function Ge(e){const t=x.useRef(e);return x.useEffect(()=>{Te(t.current,e)||(t.current=e)},[e]),Te(t.current,e)?t.current:e}var Gi=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Ji=Gi(),Xi=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Yi=Xi(),Zi=()=>Ji||Yi?x.useLayoutEffect:x.useEffect,es=Zi(),Rn=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:Un.pending}:e;function Pt(e,...t){const n={};return t.forEach(r=>{n[r]=e[r]}),n}var Ot=["data","status","isLoading","isSuccess","isError","error"];function ts({api:e,moduleOptions:{batch:t,hooks:{useDispatch:n,useSelector:r,useStore:i},unstable__sideEffectsInRender:o,createSelector:a},serializeQueryArgs:y,context:b}){const v=o?s=>s():x.useEffect;return{buildQueryHooks:h,buildInfiniteQueryHooks:M,buildMutationHook:c,usePrefetch:f};function E(s,u,S){if(u!=null&&u.endpointName&&s.isUninitialized){const{endpointName:m}=u,_=b.endpointDefinitions[m];S!==Z&&y({queryArgs:u.originalArgs,endpointDefinition:_,endpointName:m})===y({queryArgs:S,endpointDefinition:_,endpointName:m})&&(u=void 0)}let A=s.isSuccess?s.data:u==null?void 0:u.data;A===void 0&&(A=s.data);const I=A!==void 0,g=s.isLoading,d=(!u||u.isLoading||u.isUninitialized)&&!I&&g,p=s.isSuccess||I&&(g&&!(u!=null&&u.isError)||s.isUninitialized);return{...s,data:A,currentData:s.data,isFetching:g,isLoading:d,isSuccess:p}}function O(s,u,S){if(u!=null&&u.endpointName&&s.isUninitialized){const{endpointName:m}=u,_=b.endpointDefinitions[m];S!==Z&&y({queryArgs:u.originalArgs,endpointDefinition:_,endpointName:m})===y({queryArgs:S,endpointDefinition:_,endpointName:m})&&(u=void 0)}let A=s.isSuccess?s.data:u==null?void 0:u.data;A===void 0&&(A=s.data);const I=A!==void 0,g=s.isLoading,d=(!u||u.isLoading||u.isUninitialized)&&!I&&g,p=s.isSuccess||g&&I;return{...s,data:A,currentData:s.data,isFetching:g,isLoading:d,isSuccess:p}}function f(s,u){const S=n(),A=Ge(u);return x.useCallback((I,g)=>S(e.util.prefetch(s,I,{...A,...g})),[s,S,A])}function l(s,u,{refetchOnReconnect:S,refetchOnFocus:A,refetchOnMountOrArgChange:I,skip:g=!1,pollingInterval:d=0,skipPollingIfUnfocused:p=!1,...m}={}){const{initiate:_}=e.endpoints[s],P=n(),T=x.useRef(void 0);if(!T.current){const k=P(e.internalActions.internal_getRTKQSubscriptions());T.current=k}const D=Rt(g?Z:u,rt,b.endpointDefinitions[s],s),Q=Ge({refetchOnReconnect:S,refetchOnFocus:A,pollingInterval:d,skipPollingIfUnfocused:p}),j=m.initialPageParam,q=Ge(j),F=x.useRef(void 0);let{queryCacheKey:N,requestId:U}=F.current||{},K=!1;N&&U&&(K=T.current.isRequestSubscribed(N,U));const L=!K&&F.current!==void 0;return v(()=>{L&&(F.current=void 0)},[L]),v(()=>{var z;const k=F.current;if(D===Z){k==null||k.unsubscribe(),F.current=void 0;return}const W=(z=F.current)==null?void 0:z.subscriptionOptions;if(!k||k.arg!==D){k==null||k.unsubscribe();const J=P(_(D,{subscriptionOptions:Q,forceRefetch:I,...Jn(b.endpointDefinitions[s])?{initialPageParam:q}:{}}));F.current=J}else Q!==W&&k.updateSubscriptionOptions(Q)},[P,_,I,D,Q,L,q,s]),[F,P,_,Q]}function w(s,u){return(A,{skip:I=!1,selectFromResult:g}={})=>{const{select:d}=e.endpoints[s],p=Rt(I?Z:A,y,b.endpointDefinitions[s],s),m=x.useRef(void 0),_=x.useMemo(()=>a([d(p),(j,q)=>q,j=>p],u,{memoizeOptions:{resultEqualityCheck:Te}}),[d,p]),P=x.useMemo(()=>g?a([_],g,{devModeChecks:{identityFunctionCheck:"never"}}):_,[_,g]),T=r(j=>P(j,m.current),Te),D=i(),Q=_(D.getState(),m.current);return es(()=>{m.current=Q},[Q]),T}}function C(s){x.useEffect(()=>()=>{var u,S;(S=(u=s.current)==null?void 0:u.unsubscribe)==null||S.call(u),s.current=void 0},[s])}function R(s){if(!s.current)throw new Error(te(38));return s.current.refetch()}function h(s){const u=(I,g={})=>{const[d]=l(s,I,g);return C(d),x.useMemo(()=>({refetch:()=>R(d)}),[d])},S=({refetchOnReconnect:I,refetchOnFocus:g,pollingInterval:d=0,skipPollingIfUnfocused:p=!1}={})=>{const{initiate:m}=e.endpoints[s],_=n(),[P,T]=x.useState(Et),D=x.useRef(void 0),Q=Ge({refetchOnReconnect:I,refetchOnFocus:g,pollingInterval:d,skipPollingIfUnfocused:p});v(()=>{var U,K;const N=(U=D.current)==null?void 0:U.subscriptionOptions;Q!==N&&((K=D.current)==null||K.updateSubscriptionOptions(Q))},[Q]);const j=x.useRef(Q);v(()=>{j.current=Q},[Q]);const q=x.useCallback(function(N,U=!1){let K;return t(()=>{var L;(L=D.current)==null||L.unsubscribe(),D.current=K=_(m(N,{subscriptionOptions:j.current,forceRefetch:!U})),T(N)}),K},[_,m]),F=x.useCallback(()=>{var N,U;(N=D.current)!=null&&N.queryCacheKey&&_(e.internalActions.removeQueryResult({queryCacheKey:(U=D.current)==null?void 0:U.queryCacheKey}))},[_]);return x.useEffect(()=>()=>{var N;(N=D==null?void 0:D.current)==null||N.unsubscribe()},[]),x.useEffect(()=>{P!==Et&&!D.current&&q(P,!0)},[P,q]),x.useMemo(()=>[q,P,{reset:F}],[q,P,F])},A=w(s,E);return{useQueryState:A,useQuerySubscription:u,useLazyQuerySubscription:S,useLazyQuery(I){const[g,d,{reset:p}]=S(I),m=A(d,{...I,skip:d===Et}),_=x.useMemo(()=>({lastArg:d}),[d]);return x.useMemo(()=>[g,{...m,reset:p},_],[g,m,p,_])},useQuery(I,g){const d=u(I,g),p=A(I,{selectFromResult:I===Z||g!=null&&g.skip?void 0:Rn,...g}),m=Pt(p,...Ot);return x.useDebugValue(m),x.useMemo(()=>({...p,...d}),[p,d])}}}function M(s){const u=(A,I={})=>{const[g,d,p,m]=l(s,A,I),_=x.useRef(m);v(()=>{_.current=m},[m]);const P=x.useCallback(function(Q,j){let q;return t(()=>{var F;(F=g.current)==null||F.unsubscribe(),g.current=q=d(p(Q,{subscriptionOptions:_.current,direction:j}))}),q},[g,d,p]);C(g);const T=Rt(I.skip?Z:A,rt,b.endpointDefinitions[s],s),D=x.useCallback(()=>R(g),[g]);return x.useMemo(()=>({trigger:P,refetch:D,fetchNextPage:()=>P(T,"forward"),fetchPreviousPage:()=>P(T,"backward")}),[D,P,T])},S=w(s,O);return{useInfiniteQueryState:S,useInfiniteQuerySubscription:u,useInfiniteQuery(A,I){const{refetch:g,fetchNextPage:d,fetchPreviousPage:p}=u(A,I),m=S(A,{selectFromResult:A===Z||I!=null&&I.skip?void 0:Rn,...I}),_=Pt(m,...Ot,"hasNextPage","hasPreviousPage");return x.useDebugValue(_),x.useMemo(()=>({...m,fetchNextPage:d,fetchPreviousPage:p,refetch:g}),[m,d,p,g])}}}function c(s){return({selectFromResult:u,fixedCacheKey:S}={})=>{const{select:A,initiate:I}=e.endpoints[s],g=n(),[d,p]=x.useState();x.useEffect(()=>()=>{d!=null&&d.arg.fixedCacheKey||d==null||d.reset()},[d]);const m=x.useCallback(function(N){const U=g(I(N,{fixedCacheKey:S}));return p(U),U},[g,I,S]),{requestId:_}=d||{},P=x.useMemo(()=>A({fixedCacheKey:S,requestId:d==null?void 0:d.requestId}),[S,d,A]),T=x.useMemo(()=>u?a([P],u):P,[u,P]),D=r(T,Te),Q=S==null?d==null?void 0:d.arg.originalArgs:void 0,j=x.useCallback(()=>{t(()=>{d&&p(void 0),S&&g(e.internalActions.removeMutationResult({requestId:_,fixedCacheKey:S}))})},[g,S,d,_]),q=Pt(D,...Ot,"endpointName");x.useDebugValue(q);const F=x.useMemo(()=>({...D,originalArgs:Q,reset:j}),[D,Q,j]);return x.useMemo(()=>[m,F],[m,F])}}}var ns=Symbol(),rs=({batch:e=gi,hooks:t={useDispatch:di,useSelector:hi,useStore:Ln},createSelector:n=zt,unstable__sideEffectsInRender:r=!1,...i}={})=>({name:ns,init(o,{serializeQueryArgs:a},y){const b=o,{buildQueryHooks:v,buildInfiniteQueryHooks:E,buildMutationHook:O,usePrefetch:f}=ts({api:o,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:r,createSelector:n},serializeQueryArgs:a,context:y});return Ce(b,{usePrefetch:f}),Ce(y,{batch:e}),{injectEndpoint(l,w){if(Bi(w)){const{useQuery:C,useLazyQuery:R,useLazyQuerySubscription:h,useQueryState:M,useQuerySubscription:c}=v(l);Ce(b.endpoints[l],{useQuery:C,useLazyQuery:R,useLazyQuerySubscription:h,useQueryState:M,useQuerySubscription:c}),o[`use${He(l)}Query`]=C,o[`useLazy${He(l)}Query`]=R}if(Hi(w)){const C=O(l);Ce(b.endpoints[l],{useMutation:C}),o[`use${He(l)}Mutation`]=C}else if(Jn(w)){const{useInfiniteQuery:C,useInfiniteQuerySubscription:R,useInfiniteQueryState:h}=E(l);Ce(b.endpoints[l],{useInfiniteQuery:C,useInfiniteQuerySubscription:R,useInfiniteQueryState:h}),o[`use${He(l)}InfiniteQuery`]=C}}}}}),is=Hn(Gn(),rs());const ss=Ci({baseUrl:dn.EDITORIAL_API_URL?`${dn.EDITORIAL_API_URL}/api/v1`:"/api/v1"}),os=is({reducerPath:"editorialApi",baseQuery:ss,tagTypes:["schema","data","files","config"],endpoints:e=>({getConfig:e.query({query:()=>"/config",providesTags:[{type:"config"}]}),pull:e.mutation({query:()=>({url:"/pull",method:"POST"})}),push:e.mutation({query:()=>({url:"/push",method:"POST"})}),publish:e.mutation({query:()=>({url:"/publish",method:"POST"})}),getSchema:e.query({query:()=>"/schema",providesTags:[{type:"schema"}]}),getSchemaType:e.query({query:()=>"/schema",transformResponse:(t,n,r)=>t[r]||null,providesTags:(t,n,r)=>[{type:"schema",id:r}]}),getData:e.query({query:()=>"/data",providesTags:()=>[{type:"data"}]}),getDataCount:e.query({query:()=>"/data",transformResponse(t){return Object.values(t).reduce((r,i)=>r+Object.keys(i).length,0)}}),getDataObject:e.query({query:()=>"/data",transformResponse:(t,n,{itemType:r,id:i})=>t[r][i]||null,providesTags:(t,n,{itemType:r,id:i})=>[{type:"data",id:`${r}-${i}`}]}),getFiles:e.query({query:()=>"/files",transformResponse:t=>t.files,providesTags:()=>[{type:"files"}]}),getFileCount:e.query({query:()=>"/files",transformResponse:t=>{function n(i){let o=i.type==="file"?1:0;return i.children&&i.children.length>0&&(o+=i.children.reduce((a,y)=>a+n(y),0)),o}function r(i){return i.reduce((o,a)=>o+n(a),0)}return r(t.files)}}),getFilesTotalSize:e.query({query:()=>"/files",transformResponse:t=>t.totalSize,providesTags:()=>[{type:"files"}]}),deleteFile:e.mutation({query:t=>({url:"/files",method:"DELETE",body:{path:t}}),invalidatesTags:()=>[{type:"files"}]}),updateObject:e.mutation({query:({id:t,type:n,...r})=>({url:`/data/${n}/${t}`,method:"PATCH",body:{id:t,type:n,...r}}),invalidatesTags:()=>[{type:"data"}]}),createObject:e.mutation({query:({id:t,type:n,...r})=>({url:`/data/${n}/${t}`,method:"PUT",body:{id:t,type:n,...r}}),invalidatesTags:()=>[{type:"data"}]}),deleteObject:e.mutation({query:({id:t,type:n})=>({url:`/data/${n}/${t}`,method:"DELETE"}),invalidatesTags:()=>[{type:"data"}]})})}),{useCreateObjectMutation:ds,useDeleteFileMutation:ps,useDeleteObjectMutation:ys,useGetConfigQuery:hs,useGetDataCountQuery:gs,useGetDataObjectQuery:ms,useGetDataQuery:bs,useGetFileCountQuery:vs,useGetFilesQuery:Ss,useGetFilesTotalSizeQuery:ws,useGetSchemaQuery:_s,useGetSchemaTypeQuery:Es,usePublishMutation:Rs,usePullMutation:Ps,usePushMutation:Os,useUpdateObjectMutation:Cs}=os;export{fs as P,_s as a,bs as b,as as c,Rs as d,os as e,Ps as f,Os as g,ws as h,gs as i,vs as j,Es as k,ys as l,ms as m,ds as n,Cs as o,Ss as p,ps as q,di as r,ls as s,hi as t,hs as u,Ln as v,un as w,Se as x};
|