From 898109af54eb9d8f7d487aef424a8bdfbdd21964 Mon Sep 17 00:00:00 2001 From: Alexander Shishenko Date: Tue, 4 Feb 2025 00:43:20 +0300 Subject: [PATCH] Add API key requirement to Ingest methods Add API key management methods Update UI --- Cargo.lock | 15 + Cargo.toml | 5 +- notifico-app/Cargo.toml | 5 +- notifico-app/assets/assets/index-DKhqOV6l.js | 275 ++++++++++++++++++ notifico-app/assets/assets/index-DL7kKpS3.js | 275 ------------------ notifico-app/assets/index.html | 2 +- notifico-app/migration/src/lib.rs | 2 + .../m20250203_000001_create_apikey_table.rs | 50 ++++ notifico-app/src/controllers/api_key.rs | 201 +++++++++++++ notifico-app/src/controllers/mod.rs | 1 + notifico-app/src/entity/api_key.rs | 35 +++ notifico-app/src/entity/mod.rs | 1 + notifico-app/src/entity/prelude.rs | 1 + notifico-app/src/entity/project.rs | 8 + notifico-app/src/http/ingest.rs | 68 ++++- notifico-app/src/http/ui/api/api_key.rs | 104 +++++++ notifico-app/src/http/ui/api/mod.rs | 5 + notifico-app/src/http/ui/mod.rs | 2 + notifico-app/src/main.rs | 8 +- notifico-core/src/pipeline/event.rs | 6 +- 20 files changed, 773 insertions(+), 296 deletions(-) create mode 100644 notifico-app/assets/assets/index-DKhqOV6l.js delete mode 100644 notifico-app/assets/assets/index-DL7kKpS3.js create mode 100644 notifico-app/migration/src/m20250203_000001_create_apikey_table.rs create mode 100644 notifico-app/src/controllers/api_key.rs create mode 100644 notifico-app/src/entity/api_key.rs create mode 100644 notifico-app/src/http/ui/api/api_key.rs diff --git a/Cargo.lock b/Cargo.lock index 4ada1e5..03c824c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -489,8 +489,10 @@ checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" dependencies = [ "android-tzdata", "iana-time-zone", + "js-sys", "num-traits", "serde", + "wasm-bindgen", "windows-targets 0.52.6", ] @@ -1778,6 +1780,16 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "metrics" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a7deb012b3b2767169ff203fadb4c6b0b82b947512e5eb9e0b78c2e186ad9e3" +dependencies = [ + "ahash 0.8.11", + "portable-atomic", +] + [[package]] name = "mime" version = "0.3.17" @@ -1915,6 +1927,7 @@ dependencies = [ "axum", "axum-extra", "backoff", + "chrono", "clap", "dotenvy", "fe2o3-amqp", @@ -1922,6 +1935,8 @@ dependencies = [ "futures", "jsonwebtoken", "log", + "metrics", + "moka", "multimap", "notifico-attachment", "notifico-core", diff --git a/Cargo.toml b/Cargo.toml index a8ed3d2..550d253 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,12 +28,13 @@ reqwest = { version = "0.12.12", default-features = false, features = ["json", " axum = { version = "0.8.1", features = ["macros"] } axum-extra = { version = "0.10.0", features = ["typed-header"] } clap = { version = "4.5.23", features = ["derive", "color", "usage", "env"] } +metrics = "0.24.1" tokio = { version = "1.43", features = ["macros", "rt", "sync", "rt-multi-thread", "signal", "io-util"] } url = { version = "2.5.4", features = ["serde"] } -utoipa = { version = "5.3.1", features = ["axum_extras", "uuid", "url"] } +utoipa = { version = "5.3.1", features = ["axum_extras", "chrono", "uuid", "url"] } utoipa-axum = "0.2" utoipa-swagger-ui = { version = "9", features = ["axum", "vendored"] } -uuid = { version = "1.12.0", features = ["serde", "v7", "fast-rng"] } +uuid = { version = "1.12.0", features = ["serde", "v4", "v7", "fast-rng"] } [workspace.dependencies.sea-orm-migration] version = "1.1.4" diff --git a/notifico-app/Cargo.toml b/notifico-app/Cargo.toml index 3bb13db..dbce647 100644 --- a/notifico-app/Cargo.toml +++ b/notifico-app/Cargo.toml @@ -17,6 +17,7 @@ async-trait = "0.1.84" axum = { workspace = true } axum-extra = { workspace = true } backoff = { version = "0.4.0", features = ["tokio"] } +chrono = "0.4.39" clap = { workspace = true } dotenvy = "0.15.7" fe2o3-amqp = { version = "0.13.1" } @@ -24,6 +25,9 @@ flume = "0.11.1" futures = "0.3.31" jsonwebtoken = "9.3.0" log = "0.4.22" +metrics = { workspace = true } +moka = "0.12.10" +multimap = "0.10.0" rust-embed = { version = "8.5.0", features = ["mime-guess"] } sea-orm = { workspace = true } serde = { version = "1.0.217", features = ["derive"] } @@ -38,4 +42,3 @@ utoipa = { workspace = true } utoipa-axum = { workspace = true } utoipa-swagger-ui = { workspace = true } uuid = { workspace = true } -multimap = "0.10.0" diff --git a/notifico-app/assets/assets/index-DKhqOV6l.js b/notifico-app/assets/assets/index-DKhqOV6l.js new file mode 100644 index 0000000..3b3ce48 --- /dev/null +++ b/notifico-app/assets/assets/index-DKhqOV6l.js @@ -0,0 +1,275 @@ +var y4=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);import{r as _x,a as Ox,b as v4,C as T2,S as b4,s as Bd,e as x4,c as Zo,d as S4,f as M2,g as Ax,B as rt,G as K0,T as Ve,h as Jt,i as Fl,I as E4,j as ni,k as Id,l as Rx,m as Hd,n as Vd,o as ii,A as kx,p as Kd,q as Tx,t as c_,E as f_,L as Mx,D as d_,u as w4,v as C4,w as _4,R as h_,V as p_,x as bd,y as m_,z as O4,F as A4,H as R4,J as k4,K as T4,M as M4,N as D4,O as L4,P as q4,Q as W0,U as P4,W as D2,X as kf,Y as Tf,Z as j4,_ as Mf,$ as F4,a0 as g_,a1 as y_,a2 as L2,a3 as N4,a4 as q2,a5 as P2,a6 as j2,a7 as z4,a8 as $4,a9 as U4,aa as z,ab as B4,ac as I4,ad as H4,ae as tl,af as Qe,ag as ls,ah as Hn,ai as Wd,aj as Qd,ak as F2,al as V4,am as K4,an as W4,ao as v_,ap as Df,aq as Q4,ar as G4,as as Y4,at as b_,au as X4,av as Z4,aw as x_,ax as J4,ay as ez,az as tz,aA as nz,aB as rz,aC as az,aD as iz,aE as lz,aF as uz,aG as sz,aH as oz}from"./mui-BkgdmF8m.js";import{r as Kt,a as Q,c as Dx,d as Yu,g as ba,R,e as Fo,W as cz,f as fz,h as dz,i as hz,l as pz,m as mz}from"./monaco_editor-RvQpGkV2.js";var nZ=y4((Ja,ei)=>{(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const u of i)if(u.type==="childList")for(const s of u.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const u={};return i.integrity&&(u.integrity=i.integrity),i.referrerPolicy&&(u.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?u.credentials="include":i.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function r(i){if(i.ep)return;i.ep=!0;const u=n(i);fetch(i.href,u)}})();var Lm={exports:{}},vo={},qm={exports:{}},Pm={};/** + * @license React + * scheduler.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var S_;function gz(){return S_||(S_=1,function(e){function t($,H){var K=$.length;$.push(H);e:for(;0>>1,W=$[ne];if(0>>1;nei(Y,K))Ii(ae,Y)?($[ne]=ae,$[I]=K,ne=I):($[ne]=Y,$[X]=K,ne=X);else if(Ii(ae,K))$[ne]=ae,$[I]=K,ne=I;else break e}}return H}function i($,H){var K=$.sortIndex-H.sortIndex;return K!==0?K:$.id-H.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var s=Date,c=s.now();e.unstable_now=function(){return s.now()-c}}var f=[],d=[],h=1,m=null,v=3,g=!1,y=!1,S=!1,x=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function _($){for(var H=n(d);H!==null;){if(H.callback===null)r(d);else if(H.startTime<=$)r(d),H.sortIndex=H.expirationTime,t(f,H);else break;H=n(d)}}function C($){if(S=!1,_($),!y)if(n(f)!==null)y=!0,F();else{var H=n(d);H!==null&&N(C,H.startTime-$)}}var O=!1,k=-1,D=5,M=-1;function T(){return!(e.unstable_now()-M$&&T());){var ne=m.callback;if(typeof ne=="function"){m.callback=null,v=m.priorityLevel;var W=ne(m.expirationTime<=$);if($=e.unstable_now(),typeof W=="function"){m.callback=W,_($),H=!0;break t}m===n(f)&&r(f),_($)}else r(f);m=n(f)}if(m!==null)H=!0;else{var Z=n(d);Z!==null&&N(C,Z.startTime-$),H=!1}}break e}finally{m=null,v=K,g=!1}H=void 0}}finally{H?P():O=!1}}}var P;if(typeof b=="function")P=function(){b(L)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,q=j.port2;j.port1.onmessage=L,P=function(){q.postMessage(null)}}else P=function(){x(L,0)};function F(){O||(O=!0,P())}function N($,H){k=x(function(){$(e.unstable_now())},H)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function($){$.callback=null},e.unstable_continueExecution=function(){y||g||(y=!0,F())},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function($){switch(v){case 1:case 2:case 3:var H=3;break;default:H=v}var K=v;v=H;try{return $()}finally{v=K}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,H){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var K=v;v=$;try{return H()}finally{v=K}},e.unstable_scheduleCallback=function($,H,K){var ne=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0ne?($.sortIndex=K,t(d,$),n(f)===null&&$===n(d)&&(S?(w(k),k=-1):S=!0,N(C,K-ne))):($.sortIndex=W,t(f,$),y||g||(y=!0,F())),$},e.unstable_shouldYield=T,e.unstable_wrapCallback=function($){var H=v;return function(){var K=v;v=H;try{return $.apply(this,arguments)}finally{v=K}}}}(Pm)),Pm}var E_;function yz(){return E_||(E_=1,qm.exports=gz()),qm.exports}/** + * @license React + * react-dom-client.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var w_;function vz(){if(w_)return vo;w_=1;var e=yz(),t=Kt(),n=_x();function r(a){var l="https://react.dev/errors/"+a;if(1)":-1E||le[p]!==pe[E]){var Re=` +`+le[p].replace(" at new "," at ");return a.displayName&&Re.includes("")&&(Re=Re.replace("",a.displayName)),Re}while(1<=p&&0<=E);break}}}finally{F=!1,Error.prepareStackTrace=o}return(o=a?a.displayName||a.name:"")?q(o):""}function $(a){switch(a.tag){case 26:case 27:case 5:return q(a.type);case 16:return q("Lazy");case 13:return q("Suspense");case 19:return q("SuspenseList");case 0:case 15:return a=N(a.type,!1),a;case 11:return a=N(a.type.render,!1),a;case 1:return a=N(a.type,!0),a;default:return""}}function H(a){try{var l="";do l+=$(a),a=a.return;while(a);return l}catch(o){return` +Error generating stack: `+o.message+` +`+o.stack}}function K(a){var l=a,o=a;if(a.alternate)for(;l.return;)l=l.return;else{a=l;do l=a,l.flags&4098&&(o=l.return),a=l.return;while(a)}return l.tag===3?o:null}function ne(a){if(a.tag===13){var l=a.memoizedState;if(l===null&&(a=a.alternate,a!==null&&(l=a.memoizedState)),l!==null)return l.dehydrated}return null}function W(a){if(K(a)!==a)throw Error(r(188))}function Z(a){var l=a.alternate;if(!l){if(l=K(a),l===null)throw Error(r(188));return l!==a?null:a}for(var o=a,p=l;;){var E=o.return;if(E===null)break;var A=E.alternate;if(A===null){if(p=E.return,p!==null){o=p;continue}break}if(E.child===A.child){for(A=E.child;A;){if(A===o)return W(E),a;if(A===p)return W(E),l;A=A.sibling}throw Error(r(188))}if(o.return!==p.return)o=E,p=A;else{for(var B=!1,J=E.child;J;){if(J===o){B=!0,o=E,p=A;break}if(J===p){B=!0,p=E,o=A;break}J=J.sibling}if(!B){for(J=A.child;J;){if(J===o){B=!0,o=A,p=E;break}if(J===p){B=!0,p=A,o=E;break}J=J.sibling}if(!B)throw Error(r(189))}}if(o.alternate!==p)throw Error(r(190))}if(o.tag!==3)throw Error(r(188));return o.stateNode.current===o?a:l}function X(a){var l=a.tag;if(l===5||l===26||l===27||l===6)return a;for(a=a.child;a!==null;){if(l=X(a),l!==null)return l;a=a.sibling}return null}var Y=Array.isArray,I=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},se=[],ie=-1;function oe(a){return{current:a}}function V(a){0>ie||(a.current=se[ie],se[ie]=null,ie--)}function ue(a,l){ie++,se[ie]=a.current,a.current=l}var me=oe(null),Ee=oe(null),Ce=oe(null),Te=oe(null);function U(a,l){switch(ue(Ce,l),ue(Ee,a),ue(me,null),a=l.nodeType,a){case 9:case 11:l=(l=l.documentElement)&&(l=l.namespaceURI)?zC(l):0;break;default:if(a=a===8?l.parentNode:l,l=a.tagName,a=a.namespaceURI)a=zC(a),l=$C(a,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}V(me),ue(me,l)}function ce(){V(me),V(Ee),V(Ce)}function fe(a){a.memoizedState!==null&&ue(Te,a);var l=me.current,o=$C(l,a.type);l!==o&&(ue(Ee,a),ue(me,o))}function G(a){Ee.current===a&&(V(me),V(Ee)),Te.current===a&&(V(Te),ho._currentValue=ae)}var te=Object.prototype.hasOwnProperty,re=e.unstable_scheduleCallback,de=e.unstable_cancelCallback,_e=e.unstable_shouldYield,be=e.unstable_requestPaint,De=e.unstable_now,Le=e.unstable_getCurrentPriorityLevel,Fe=e.unstable_ImmediatePriority,je=e.unstable_UserBlockingPriority,Ne=e.unstable_NormalPriority,ot=e.unstable_LowPriority,ut=e.unstable_IdlePriority,yt=e.log,jt=e.unstable_setDisableYieldValue,It=null,Et=null;function ye(a){if(Et&&typeof Et.onCommitFiberRoot=="function")try{Et.onCommitFiberRoot(It,a,void 0,(a.current.flags&128)===128)}catch{}}function Se(a){if(typeof yt=="function"&&jt(a),Et&&typeof Et.setStrictMode=="function")try{Et.setStrictMode(It,a)}catch{}}var Ke=Math.clz32?Math.clz32:Ge,pt=Math.log,vt=Math.LN2;function Ge(a){return a>>>=0,a===0?32:31-(pt(a)/vt|0)|0}var xn=128,mt=4194304;function ve(a){var l=a&42;if(l!==0)return l;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Ue(a,l){var o=a.pendingLanes;if(o===0)return 0;var p=0,E=a.suspendedLanes,A=a.pingedLanes,B=a.warmLanes;a=a.finishedLanes!==0;var J=o&134217727;return J!==0?(o=J&~E,o!==0?p=ve(o):(A&=J,A!==0?p=ve(A):a||(B=J&~B,B!==0&&(p=ve(B))))):(J=o&~E,J!==0?p=ve(J):A!==0?p=ve(A):a||(B=o&~B,B!==0&&(p=ve(B)))),p===0?0:l!==0&&l!==p&&!(l&E)&&(E=p&-p,B=l&-l,E>=B||E===32&&(B&4194176)!==0)?l:p}function et(a,l){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&l)===0}function at(a,l){switch(a){case 1:case 2:case 4:case 8:return l+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wt(){var a=xn;return xn<<=1,!(xn&4194176)&&(xn=128),a}function At(){var a=mt;return mt<<=1,!(mt&62914560)&&(mt=4194304),a}function dn(a){for(var l=[],o=0;31>o;o++)l.push(a);return l}function An(a,l){a.pendingLanes|=l,l!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Xt(a,l,o,p,E,A){var B=a.pendingLanes;a.pendingLanes=o,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=o,a.entangledLanes&=o,a.errorRecoveryDisabledLanes&=o,a.shellSuspendCounter=0;var J=a.entanglements,le=a.expirationTimes,pe=a.hiddenUpdates;for(o=B&~o;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cF=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),$S={},US={};function fF(a){return te.call(US,a)?!0:te.call($S,a)?!1:cF.test(a)?US[a]=!0:($S[a]=!0,!1)}function Sc(a,l,o){if(fF(l))if(o===null)a.removeAttribute(l);else{switch(typeof o){case"undefined":case"function":case"symbol":a.removeAttribute(l);return;case"boolean":var p=l.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){a.removeAttribute(l);return}}a.setAttribute(l,""+o)}}function Ec(a,l,o){if(o===null)a.removeAttribute(l);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(l);return}a.setAttribute(l,""+o)}}function Oa(a,l,o,p){if(p===null)a.removeAttribute(o);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(o);return}a.setAttributeNS(l,o,""+p)}}function vr(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function BS(a){var l=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function dF(a){var l=BS(a)?"checked":"value",o=Object.getOwnPropertyDescriptor(a.constructor.prototype,l),p=""+a[l];if(!a.hasOwnProperty(l)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var E=o.get,A=o.set;return Object.defineProperty(a,l,{configurable:!0,get:function(){return E.call(this)},set:function(B){p=""+B,A.call(this,B)}}),Object.defineProperty(a,l,{enumerable:o.enumerable}),{getValue:function(){return p},setValue:function(B){p=""+B},stopTracking:function(){a._valueTracker=null,delete a[l]}}}}function wc(a){a._valueTracker||(a._valueTracker=dF(a))}function IS(a){if(!a)return!1;var l=a._valueTracker;if(!l)return!0;var o=l.getValue(),p="";return a&&(p=BS(a)?a.checked?"true":"false":a.value),a=p,a!==o?(l.setValue(a),!0):!1}function Cc(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var hF=/[\n"\\]/g;function br(a){return a.replace(hF,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Mh(a,l,o,p,E,A,B,J){a.name="",B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?a.type=B:a.removeAttribute("type"),l!=null?B==="number"?(l===0&&a.value===""||a.value!=l)&&(a.value=""+vr(l)):a.value!==""+vr(l)&&(a.value=""+vr(l)):B!=="submit"&&B!=="reset"||a.removeAttribute("value"),l!=null?Dh(a,B,vr(l)):o!=null?Dh(a,B,vr(o)):p!=null&&a.removeAttribute("value"),E==null&&A!=null&&(a.defaultChecked=!!A),E!=null&&(a.checked=E&&typeof E!="function"&&typeof E!="symbol"),J!=null&&typeof J!="function"&&typeof J!="symbol"&&typeof J!="boolean"?a.name=""+vr(J):a.removeAttribute("name")}function HS(a,l,o,p,E,A,B,J){if(A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(a.type=A),l!=null||o!=null){if(!(A!=="submit"&&A!=="reset"||l!=null))return;o=o!=null?""+vr(o):"",l=l!=null?""+vr(l):o,J||l===a.value||(a.value=l),a.defaultValue=l}p=p??E,p=typeof p!="function"&&typeof p!="symbol"&&!!p,a.checked=J?a.checked:!!p,a.defaultChecked=!!p,B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"&&(a.name=B)}function Dh(a,l,o){l==="number"&&Cc(a.ownerDocument)===a||a.defaultValue===""+o||(a.defaultValue=""+o)}function hu(a,l,o,p){if(a=a.options,l){l={};for(var E=0;E=Ts),rE=" ",aE=!1;function iE(a,l){switch(a){case"keyup":return UF.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lE(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var yu=!1;function IF(a,l){switch(a){case"compositionend":return lE(l);case"keypress":return l.which!==32?null:(aE=!0,rE);case"textInput":return a=l.data,a===rE&&aE?null:a;default:return null}}function HF(a,l){if(yu)return a==="compositionend"||!Ih&&iE(a,l)?(a=XS(),Oc=Nh=mi=null,yu=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1=l)return{node:o,offset:l-a};a=p}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=pE(o)}}function gE(a,l){return a&&l?a===l?!0:a&&a.nodeType===3?!1:l&&l.nodeType===3?gE(a,l.parentNode):"contains"in a?a.contains(l):a.compareDocumentPosition?!!(a.compareDocumentPosition(l)&16):!1:!1}function yE(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var l=Cc(a.document);l instanceof a.HTMLIFrameElement;){try{var o=typeof l.contentWindow.location.href=="string"}catch{o=!1}if(o)a=l.contentWindow;else break;l=Cc(a.document)}return l}function Kh(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l&&(l==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||l==="textarea"||a.contentEditable==="true")}function ZF(a,l){var o=yE(l);l=a.focusedElem;var p=a.selectionRange;if(o!==l&&l&&l.ownerDocument&&gE(l.ownerDocument.documentElement,l)){if(p!==null&&Kh(l)){if(a=p.start,o=p.end,o===void 0&&(o=a),"selectionStart"in l)l.selectionStart=a,l.selectionEnd=Math.min(o,l.value.length);else if(o=(a=l.ownerDocument||document)&&a.defaultView||window,o.getSelection){o=o.getSelection();var E=l.textContent.length,A=Math.min(p.start,E);p=p.end===void 0?A:Math.min(p.end,E),!o.extend&&A>p&&(E=p,p=A,A=E),E=mE(l,A);var B=mE(l,p);E&&B&&(o.rangeCount!==1||o.anchorNode!==E.node||o.anchorOffset!==E.offset||o.focusNode!==B.node||o.focusOffset!==B.offset)&&(a=a.createRange(),a.setStart(E.node,E.offset),o.removeAllRanges(),A>p?(o.addRange(a),o.extend(B.node,B.offset)):(a.setEnd(B.node,B.offset),o.addRange(a)))}}for(a=[],o=l;o=o.parentNode;)o.nodeType===1&&a.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l=document.documentMode,vu=null,Wh=null,qs=null,Qh=!1;function vE(a,l,o){var p=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Qh||vu==null||vu!==Cc(p)||(p=vu,"selectionStart"in p&&Kh(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),qs&&Ls(qs,p)||(qs=p,p=pf(Wh,"onSelect"),0>=B,E-=B,Aa=1<<32-Ke(l)+E|o<We?(Cn=Ie,Ie=null):Cn=Ie.sibling;var xt=we(ge,Ie,xe[We],ke);if(xt===null){Ie===null&&(Ie=Cn);break}a&&Ie&&xt.alternate===null&&l(ge,Ie),he=A(xt,he,We),it===null?$e=xt:it.sibling=xt,it=xt,Ie=Cn}if(We===xe.length)return o(ge,Ie),bt&&pl(ge,We),$e;if(Ie===null){for(;WeWe?(Cn=Ie,Ie=null):Cn=Ie.sibling;var Pi=we(ge,Ie,xt.value,ke);if(Pi===null){Ie===null&&(Ie=Cn);break}a&&Ie&&Pi.alternate===null&&l(ge,Ie),he=A(Pi,he,We),it===null?$e=Pi:it.sibling=Pi,it=Pi,Ie=Cn}if(xt.done)return o(ge,Ie),bt&&pl(ge,We),$e;if(Ie===null){for(;!xt.done;We++,xt=xe.next())xt=Me(ge,xt.value,ke),xt!==null&&(he=A(xt,he,We),it===null?$e=xt:it.sibling=xt,it=xt);return bt&&pl(ge,We),$e}for(Ie=p(Ie);!xt.done;We++,xt=xe.next())xt=Ae(Ie,ge,We,xt.value,ke),xt!==null&&(a&&xt.alternate!==null&&Ie.delete(xt.key===null?We:xt.key),he=A(xt,he,We),it===null?$e=xt:it.sibling=xt,it=xt);return a&&Ie.forEach(function(g4){return l(ge,g4)}),bt&&pl(ge,We),$e}function Gt(ge,he,xe,ke){if(typeof xe=="object"&&xe!==null&&xe.type===f&&xe.key===null&&(xe=xe.props.children),typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case s:e:{for(var $e=xe.key;he!==null;){if(he.key===$e){if($e=xe.type,$e===f){if(he.tag===7){o(ge,he.sibling),ke=E(he,xe.props.children),ke.return=ge,ge=ke;break e}}else if(he.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===b&&PE($e)===he.type){o(ge,he.sibling),ke=E(he,xe.props),Us(ke,xe),ke.return=ge,ge=ke;break e}o(ge,he);break}else l(ge,he);he=he.sibling}xe.type===f?(ke=_l(xe.props.children,ge.mode,ke,xe.key),ke.return=ge,ge=ke):(ke=rf(xe.type,xe.key,xe.props,null,ge.mode,ke),Us(ke,xe),ke.return=ge,ge=ke)}return B(ge);case c:e:{for($e=xe.key;he!==null;){if(he.key===$e)if(he.tag===4&&he.stateNode.containerInfo===xe.containerInfo&&he.stateNode.implementation===xe.implementation){o(ge,he.sibling),ke=E(he,xe.children||[]),ke.return=ge,ge=ke;break e}else{o(ge,he);break}else l(ge,he);he=he.sibling}ke=Yp(xe,ge.mode,ke),ke.return=ge,ge=ke}return B(ge);case b:return $e=xe._init,xe=$e(xe._payload),Gt(ge,he,xe,ke)}if(Y(xe))return Be(ge,he,xe,ke);if(k(xe)){if($e=k(xe),typeof $e!="function")throw Error(r(150));return xe=$e.call(xe),Xe(ge,he,xe,ke)}if(typeof xe.then=="function")return Gt(ge,he,Nc(xe),ke);if(xe.$$typeof===g)return Gt(ge,he,ef(ge,xe),ke);zc(ge,xe)}return typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint"?(xe=""+xe,he!==null&&he.tag===6?(o(ge,he.sibling),ke=E(he,xe),ke.return=ge,ge=ke):(o(ge,he),ke=Gp(xe,ge.mode,ke),ke.return=ge,ge=ke),B(ge)):o(ge,he)}return function(ge,he,xe,ke){try{$s=0;var $e=Gt(ge,he,xe,ke);return Cu=null,$e}catch(Ie){if(Ie===Ns)throw Ie;var it=Ar(29,Ie,null,ge.mode);return it.lanes=ke,it.return=ge,it}finally{}}}var gl=jE(!0),FE=jE(!1),_u=oe(null),$c=oe(0);function NE(a,l){a=za,ue($c,a),ue(_u,l),za=a|l.baseLanes}function np(){ue($c,za),ue(_u,_u.current)}function rp(){za=$c.current,V(_u),V($c)}var Cr=oe(null),ia=null;function yi(a){var l=a.alternate;ue(hn,hn.current&1),ue(Cr,a),ia===null&&(l===null||_u.current!==null||l.memoizedState!==null)&&(ia=a)}function zE(a){if(a.tag===22){if(ue(hn,hn.current),ue(Cr,a),ia===null){var l=a.alternate;l!==null&&l.memoizedState!==null&&(ia=a)}}else vi()}function vi(){ue(hn,hn.current),ue(Cr,Cr.current)}function ka(a){V(Cr),ia===a&&(ia=null),V(hn)}var hn=oe(0);function Uc(a){for(var l=a;l!==null;){if(l.tag===13){var o=l.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||o.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if(l.flags&128)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var rN=typeof AbortController<"u"?AbortController:function(){var a=[],l=this.signal={aborted:!1,addEventListener:function(o,p){a.push(p)}};this.abort=function(){l.aborted=!0,a.forEach(function(o){return o()})}},aN=e.unstable_scheduleCallback,iN=e.unstable_NormalPriority,pn={$$typeof:g,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ap(){return{controller:new rN,data:new Map,refCount:0}}function Bs(a){a.refCount--,a.refCount===0&&aN(iN,function(){a.controller.abort()})}var Is=null,ip=0,Ou=0,Au=null;function lN(a,l){if(Is===null){var o=Is=[];ip=0,Ou=fm(),Au={status:"pending",value:void 0,then:function(p){o.push(p)}}}return ip++,l.then($E,$E),l}function $E(){if(--ip===0&&Is!==null){Au!==null&&(Au.status="fulfilled");var a=Is;Is=null,Ou=0,Au=null;for(var l=0;lA?A:8;var B=T.T,J={};T.T=J,Ep(a,!1,l,o);try{var le=E(),pe=T.S;if(pe!==null&&pe(J,le),le!==null&&typeof le=="object"&&typeof le.then=="function"){var Re=uN(le,p);Ks(a,l,Re,cr(a))}else Ks(a,l,p,cr(a))}catch(Me){Ks(a,l,{then:function(){},status:"rejected",reason:Me},cr())}finally{I.p=A,T.T=B}}function dN(){}function xp(a,l,o,p){if(a.tag!==5)throw Error(r(476));var E=yw(a).queue;gw(a,E,l,ae,o===null?dN:function(){return vw(a),o(p)})}function yw(a){var l=a.memoizedState;if(l!==null)return l;l={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:ae},next:null};var o={};return l.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:o},next:null},a.memoizedState=l,a=a.alternate,a!==null&&(a.memoizedState=l),l}function vw(a){var l=yw(a).next.queue;Ks(a,l,{},cr())}function Sp(){return zn(ho)}function bw(){return an().memoizedState}function xw(){return an().memoizedState}function hN(a){for(var l=a.return;l!==null;){switch(l.tag){case 24:case 3:var o=cr();a=wi(o);var p=Ci(l,a,o);p!==null&&(Wn(p,l,o),Gs(p,l,o)),l={cache:ap()},a.payload=l;return}l=l.return}}function pN(a,l,o){var p=cr();o={lane:p,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null},Yc(a)?Ew(l,o):(o=Xh(a,l,o,p),o!==null&&(Wn(o,a,p),ww(o,l,p)))}function Sw(a,l,o){var p=cr();Ks(a,l,o,p)}function Ks(a,l,o,p){var E={lane:p,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null};if(Yc(a))Ew(l,E);else{var A=a.alternate;if(a.lanes===0&&(A===null||A.lanes===0)&&(A=l.lastRenderedReducer,A!==null))try{var B=l.lastRenderedState,J=A(B,o);if(E.hasEagerState=!0,E.eagerState=J,lr(J,B))return Lc(a,l,E,0),Lt===null&&Dc(),!1}catch{}finally{}if(o=Xh(a,l,E,p),o!==null)return Wn(o,a,p),ww(o,l,p),!0}return!1}function Ep(a,l,o,p){if(p={lane:2,revertLane:fm(),action:p,hasEagerState:!1,eagerState:null,next:null},Yc(a)){if(l)throw Error(r(479))}else l=Xh(a,o,p,2),l!==null&&Wn(l,a,2)}function Yc(a){var l=a.alternate;return a===nt||l!==null&&l===nt}function Ew(a,l){Ru=Ic=!0;var o=a.pending;o===null?l.next=l:(l.next=o.next,o.next=l),a.pending=l}function ww(a,l,o){if(o&4194176){var p=l.lanes;p&=a.pendingLanes,o|=p,l.lanes=o,Ct(a,o)}}var la={readContext:zn,use:Kc,useCallback:Zt,useContext:Zt,useEffect:Zt,useImperativeHandle:Zt,useLayoutEffect:Zt,useInsertionEffect:Zt,useMemo:Zt,useReducer:Zt,useRef:Zt,useState:Zt,useDebugValue:Zt,useDeferredValue:Zt,useTransition:Zt,useSyncExternalStore:Zt,useId:Zt};la.useCacheRefresh=Zt,la.useMemoCache=Zt,la.useHostTransitionStatus=Zt,la.useFormState=Zt,la.useActionState=Zt,la.useOptimistic=Zt;var bl={readContext:zn,use:Kc,useCallback:function(a,l){return Jn().memoizedState=[a,l===void 0?null:l],a},useContext:zn,useEffect:sw,useImperativeHandle:function(a,l,o){o=o!=null?o.concat([a]):null,Qc(4194308,4,fw.bind(null,l,a),o)},useLayoutEffect:function(a,l){return Qc(4194308,4,a,l)},useInsertionEffect:function(a,l){Qc(4,2,a,l)},useMemo:function(a,l){var o=Jn();l=l===void 0?null:l;var p=a();if(vl){Se(!0);try{a()}finally{Se(!1)}}return o.memoizedState=[p,l],p},useReducer:function(a,l,o){var p=Jn();if(o!==void 0){var E=o(l);if(vl){Se(!0);try{o(l)}finally{Se(!1)}}}else E=l;return p.memoizedState=p.baseState=E,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:E},p.queue=a,a=a.dispatch=pN.bind(null,nt,a),[p.memoizedState,a]},useRef:function(a){var l=Jn();return a={current:a},l.memoizedState=a},useState:function(a){a=mp(a);var l=a.queue,o=Sw.bind(null,nt,l);return l.dispatch=o,[a.memoizedState,o]},useDebugValue:vp,useDeferredValue:function(a,l){var o=Jn();return bp(o,a,l)},useTransition:function(){var a=mp(!1);return a=gw.bind(null,nt,a.queue,!0,!1),Jn().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,l,o){var p=nt,E=Jn();if(bt){if(o===void 0)throw Error(r(407));o=o()}else{if(o=l(),Lt===null)throw Error(r(349));ft&60||KE(p,l,o)}E.memoizedState=o;var A={value:o,getSnapshot:l};return E.queue=A,sw(QE.bind(null,p,A,a),[a]),p.flags|=2048,Tu(9,WE.bind(null,p,A,o,l),{destroy:void 0},null),o},useId:function(){var a=Jn(),l=Lt.identifierPrefix;if(bt){var o=Ra,p=Aa;o=(p&~(1<<32-Ke(p)-1)).toString(32)+o,l=":"+l+"R"+o,o=Hc++,0 title"))),Dn(A,p,o),A[nn]=a,Sn(A),p=A;break e;case"link":var B=YC("link","href",E).get(p+(o.href||""));if(B){for(var J=0;J<\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof p.is=="string"?E.createElement("select",{is:p.is}):E.createElement("select"),p.multiple?a.multiple=!0:p.size&&(a.size=p.size);break;default:a=typeof p.is=="string"?E.createElement(o,{is:p.is}):E.createElement(o)}}a[nn]=l,a[kn]=p;e:for(E=l.child;E!==null;){if(E.tag===5||E.tag===6)a.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===l)break e;for(;E.sibling===null;){if(E.return===null||E.return===l)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}l.stateNode=a;e:switch(Dn(a,o,p),o){case"button":case"input":case"select":case"textarea":a=!!p.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Fa(l)}}return Ht(l),l.flags&=-16777217,null;case 6:if(a&&l.stateNode!=null)a.memoizedProps!==p&&Fa(l);else{if(typeof p!="string"&&l.stateNode===null)throw Error(r(166));if(a=Ce.current,Ps(l)){if(a=l.stateNode,o=l.memoizedProps,p=null,E=Kn,E!==null)switch(E.tag){case 27:case 5:p=E.memoizedProps}a[nn]=l,a=!!(a.nodeValue===o||p!==null&&p.suppressHydrationWarning===!0||NC(a.nodeValue,o)),a||ml(l)}else a=gf(a).createTextNode(p),a[nn]=l,l.stateNode=a}return Ht(l),null;case 13:if(p=l.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(E=Ps(l),p!==null&&p.dehydrated!==null){if(a===null){if(!E)throw Error(r(318));if(E=l.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(r(317));E[nn]=l}else js(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4;Ht(l),E=!1}else Kr!==null&&(am(Kr),Kr=null),E=!0;if(!E)return l.flags&256?(ka(l),l):(ka(l),null)}if(ka(l),l.flags&128)return l.lanes=o,l;if(o=p!==null,a=a!==null&&a.memoizedState!==null,o){p=l.child,E=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(E=p.alternate.memoizedState.cachePool.pool);var A=null;p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(A=p.memoizedState.cachePool.pool),A!==E&&(p.flags|=2048)}return o!==a&&o&&(l.child.flags|=8192),af(l,l.updateQueue),Ht(l),null;case 4:return ce(),a===null&&mm(l.stateNode.containerInfo),Ht(l),null;case 10:return La(l.type),Ht(l),null;case 19:if(V(hn),E=l.memoizedState,E===null)return Ht(l),null;if(p=(l.flags&128)!==0,A=E.rendering,A===null)if(p)no(E,!1);else{if(Qt!==0||a!==null&&a.flags&128)for(a=l.child;a!==null;){if(A=Uc(a),A!==null){for(l.flags|=128,no(E,!1),a=A.updateQueue,l.updateQueue=a,af(l,a),l.subtreeFlags=0,a=o,o=l.child;o!==null;)dC(o,a),o=o.sibling;return ue(hn,hn.current&1|2),l.child}a=a.sibling}E.tail!==null&&De()>lf&&(l.flags|=128,p=!0,no(E,!1),l.lanes=4194304)}else{if(!p)if(a=Uc(A),a!==null){if(l.flags|=128,p=!0,a=a.updateQueue,l.updateQueue=a,af(l,a),no(E,!0),E.tail===null&&E.tailMode==="hidden"&&!A.alternate&&!bt)return Ht(l),null}else 2*De()-E.renderingStartTime>lf&&o!==536870912&&(l.flags|=128,p=!0,no(E,!1),l.lanes=4194304);E.isBackwards?(A.sibling=l.child,l.child=A):(a=E.last,a!==null?a.sibling=A:l.child=A,E.last=A)}return E.tail!==null?(l=E.tail,E.rendering=l,E.tail=l.sibling,E.renderingStartTime=De(),l.sibling=null,a=hn.current,ue(hn,p?a&1|2:a&1),l):(Ht(l),null);case 22:case 23:return ka(l),rp(),p=l.memoizedState!==null,a!==null?a.memoizedState!==null!==p&&(l.flags|=8192):p&&(l.flags|=8192),p?o&536870912&&!(l.flags&128)&&(Ht(l),l.subtreeFlags&6&&(l.flags|=8192)):Ht(l),o=l.updateQueue,o!==null&&af(l,o.retryQueue),o=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(o=a.memoizedState.cachePool.pool),p=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(p=l.memoizedState.cachePool.pool),p!==o&&(l.flags|=2048),a!==null&&V(yl),null;case 24:return o=null,a!==null&&(o=a.memoizedState.cache),l.memoizedState.cache!==o&&(l.flags|=2048),La(pn),Ht(l),null;case 25:return null}throw Error(r(156,l.tag))}function SN(a,l){switch(Jh(l),l.tag){case 1:return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 3:return La(pn),ce(),a=l.flags,a&65536&&!(a&128)?(l.flags=a&-65537|128,l):null;case 26:case 27:case 5:return G(l),null;case 13:if(ka(l),a=l.memoizedState,a!==null&&a.dehydrated!==null){if(l.alternate===null)throw Error(r(340));js()}return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 19:return V(hn),null;case 4:return ce(),null;case 10:return La(l.type),null;case 22:case 23:return ka(l),rp(),a!==null&&V(yl),a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 24:return La(pn),null;case 25:return null;default:return null}}function mC(a,l){switch(Jh(l),l.tag){case 3:La(pn),ce();break;case 26:case 27:case 5:G(l);break;case 4:ce();break;case 13:ka(l);break;case 19:V(hn);break;case 10:La(l.type);break;case 22:case 23:ka(l),rp(),a!==null&&V(yl);break;case 24:La(pn)}}var EN={getCacheForType:function(a){var l=zn(pn),o=l.data.get(a);return o===void 0&&(o=a(),l.data.set(a,o)),o}},wN=typeof WeakMap=="function"?WeakMap:Map,Vt=0,Lt=null,lt=null,ft=0,qt=0,or=null,Na=!1,qu=!1,Xp=!1,za=0,Qt=0,ki=0,Ol=0,Zp=0,Rr=0,Pu=0,ro=null,ua=null,Jp=!1,em=0,lf=1/0,uf=null,Ti=null,sf=!1,Al=null,ao=0,tm=0,nm=null,io=0,rm=null;function cr(){if(Vt&2&&ft!==0)return ft&-ft;if(T.T!==null){var a=Ou;return a!==0?a:fm()}return yr()}function gC(){Rr===0&&(Rr=!(ft&536870912)||bt?wt():536870912);var a=Cr.current;return a!==null&&(a.flags|=32),Rr}function Wn(a,l,o){(a===Lt&&qt===2||a.cancelPendingCommit!==null)&&(ju(a,0),$a(a,ft,Rr,!1)),An(a,o),(!(Vt&2)||a!==Lt)&&(a===Lt&&(!(Vt&2)&&(Ol|=o),Qt===4&&$a(a,ft,Rr,!1)),sa(a))}function yC(a,l,o){if(Vt&6)throw Error(r(327));var p=!o&&(l&60)===0&&(l&a.expiredLanes)===0||et(a,l),E=p?ON(a,l):um(a,l,!0),A=p;do{if(E===0){qu&&!p&&$a(a,l,0,!1);break}else if(E===6)$a(a,l,0,!Na);else{if(o=a.current.alternate,A&&!CN(o)){E=um(a,l,!1),A=!1;continue}if(E===2){if(A=l,a.errorRecoveryDisabledLanes&A)var B=0;else B=a.pendingLanes&-536870913,B=B!==0?B:B&536870912?536870912:0;if(B!==0){l=B;e:{var J=a;E=ro;var le=J.current.memoizedState.isDehydrated;if(le&&(ju(J,B).flags|=256),B=um(J,B,!1),B!==2){if(Xp&&!le){J.errorRecoveryDisabledLanes|=A,Ol|=A,E=4;break e}A=ua,ua=E,A!==null&&am(A)}E=B}if(A=!1,E!==2)continue}}if(E===1){ju(a,0),$a(a,l,0,!0);break}e:{switch(p=a,E){case 0:case 1:throw Error(r(345));case 4:if((l&4194176)===l){$a(p,l,Rr,!Na);break e}break;case 2:ua=null;break;case 3:case 5:break;default:throw Error(r(329))}if(p.finishedWork=o,p.finishedLanes=l,(l&62914560)===l&&(A=em+300-De(),10o?32:o,T.T=null,Al===null)var A=!1;else{o=nm,nm=null;var B=Al,J=ao;if(Al=null,ao=0,Vt&6)throw Error(r(331));var le=Vt;if(Vt|=4,cC(B.current),uC(B,B.current,J,o),Vt=le,lo(0,!1),Et&&typeof Et.onPostCommitFiberRoot=="function")try{Et.onPostCommitFiberRoot(It,B)}catch{}A=!0}return A}finally{I.p=E,T.T=p,OC(a,l)}}return!1}function AC(a,l,o){l=Sr(o,l),l=_p(a.stateNode,l,2),a=Ci(a,l,2),a!==null&&(An(a,2),sa(a))}function Mt(a,l,o){if(a.tag===3)AC(a,a,o);else for(;l!==null;){if(l.tag===3){AC(l,a,o);break}else if(l.tag===1){var p=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Ti===null||!Ti.has(p))){a=Sr(o,a),o=Tw(2),p=Ci(l,o,2),p!==null&&(Mw(o,p,l,a),An(p,2),sa(p));break}}l=l.return}}function sm(a,l,o){var p=a.pingCache;if(p===null){p=a.pingCache=new wN;var E=new Set;p.set(l,E)}else E=p.get(l),E===void 0&&(E=new Set,p.set(l,E));E.has(o)||(Xp=!0,E.add(o),a=kN.bind(null,a,l,o),l.then(a,a))}function kN(a,l,o){var p=a.pingCache;p!==null&&p.delete(l),a.pingedLanes|=a.suspendedLanes&o,a.warmLanes&=~o,Lt===a&&(ft&o)===o&&(Qt===4||Qt===3&&(ft&62914560)===ft&&300>De()-em?!(Vt&2)&&ju(a,0):Zp|=o,Pu===ft&&(Pu=0)),sa(a)}function RC(a,l){l===0&&(l=At()),a=gi(a,l),a!==null&&(An(a,l),sa(a))}function TN(a){var l=a.memoizedState,o=0;l!==null&&(o=l.retryLane),RC(a,o)}function MN(a,l){var o=0;switch(a.tag){case 13:var p=a.stateNode,E=a.memoizedState;E!==null&&(o=E.retryLane);break;case 19:p=a.stateNode;break;case 22:p=a.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(l),RC(a,o)}function DN(a,l){return re(a,l)}var ff=null,zu=null,om=!1,df=!1,cm=!1,Rl=0;function sa(a){a!==zu&&a.next===null&&(zu===null?ff=zu=a:zu=zu.next=a),df=!0,om||(om=!0,qN(LN))}function lo(a,l){if(!cm&&df){cm=!0;do for(var o=!1,p=ff;p!==null;){if(a!==0){var E=p.pendingLanes;if(E===0)var A=0;else{var B=p.suspendedLanes,J=p.pingedLanes;A=(1<<31-Ke(42|a)+1)-1,A&=E&~(B&~J),A=A&201326677?A&201326677|1:A?A|2:0}A!==0&&(o=!0,MC(p,A))}else A=ft,A=Ue(p,p===Lt?A:0),!(A&3)||et(p,A)||(o=!0,MC(p,A));p=p.next}while(o);cm=!1}}function LN(){df=om=!1;var a=0;Rl!==0&&(BN()&&(a=Rl),Rl=0);for(var l=De(),o=null,p=ff;p!==null;){var E=p.next,A=kC(p,l);A===0?(p.next=null,o===null?ff=E:o.next=E,E===null&&(zu=o)):(o=p,(a!==0||A&3)&&(df=!0)),p=E}lo(a)}function kC(a,l){for(var o=a.suspendedLanes,p=a.pingedLanes,E=a.expirationTimes,A=a.pendingLanes&-62914561;0"u"?null:document;function KC(a,l,o){var p=Uu;if(p&&typeof l=="string"&&l){var E=br(l);E='link[rel="'+a+'"][href="'+E+'"]',typeof o=="string"&&(E+='[crossorigin="'+o+'"]'),VC.has(E)||(VC.add(E),a={rel:a,crossOrigin:o,href:l},p.querySelector(E)===null&&(l=p.createElement("link"),Dn(l,"link",a),Sn(l),p.head.appendChild(l)))}}function YN(a){Ua.D(a),KC("dns-prefetch",a,null)}function XN(a,l){Ua.C(a,l),KC("preconnect",a,l)}function ZN(a,l,o){Ua.L(a,l,o);var p=Uu;if(p&&a&&l){var E='link[rel="preload"][as="'+br(l)+'"]';l==="image"&&o&&o.imageSrcSet?(E+='[imagesrcset="'+br(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(E+='[imagesizes="'+br(o.imageSizes)+'"]')):E+='[href="'+br(a)+'"]';var A=E;switch(l){case"style":A=Bu(a);break;case"script":A=Iu(a)}kr.has(A)||(a=L({rel:"preload",href:l==="image"&&o&&o.imageSrcSet?void 0:a,as:l},o),kr.set(A,a),p.querySelector(E)!==null||l==="style"&&p.querySelector(oo(A))||l==="script"&&p.querySelector(co(A))||(l=p.createElement("link"),Dn(l,"link",a),Sn(l),p.head.appendChild(l)))}}function JN(a,l){Ua.m(a,l);var o=Uu;if(o&&a){var p=l&&typeof l.as=="string"?l.as:"script",E='link[rel="modulepreload"][as="'+br(p)+'"][href="'+br(a)+'"]',A=E;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":A=Iu(a)}if(!kr.has(A)&&(a=L({rel:"modulepreload",href:a},l),kr.set(A,a),o.querySelector(E)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(co(A)))return}p=o.createElement("link"),Dn(p,"link",a),Sn(p),o.head.appendChild(p)}}}function e4(a,l,o){Ua.S(a,l,o);var p=Uu;if(p&&a){var E=fu(p).hoistableStyles,A=Bu(a);l=l||"default";var B=E.get(A);if(!B){var J={loading:0,preload:null};if(B=p.querySelector(oo(A)))J.loading=5;else{a=L({rel:"stylesheet",href:a,"data-precedence":l},o),(o=kr.get(A))&&Cm(a,o);var le=B=p.createElement("link");Sn(le),Dn(le,"link",a),le._p=new Promise(function(pe,Re){le.onload=pe,le.onerror=Re}),le.addEventListener("load",function(){J.loading|=1}),le.addEventListener("error",function(){J.loading|=2}),J.loading|=4,vf(B,l,p)}B={type:"stylesheet",instance:B,count:1,state:J},E.set(A,B)}}}function t4(a,l){Ua.X(a,l);var o=Uu;if(o&&a){var p=fu(o).hoistableScripts,E=Iu(a),A=p.get(E);A||(A=o.querySelector(co(E)),A||(a=L({src:a,async:!0},l),(l=kr.get(E))&&_m(a,l),A=o.createElement("script"),Sn(A),Dn(A,"link",a),o.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},p.set(E,A))}}function n4(a,l){Ua.M(a,l);var o=Uu;if(o&&a){var p=fu(o).hoistableScripts,E=Iu(a),A=p.get(E);A||(A=o.querySelector(co(E)),A||(a=L({src:a,async:!0,type:"module"},l),(l=kr.get(E))&&_m(a,l),A=o.createElement("script"),Sn(A),Dn(A,"link",a),o.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},p.set(E,A))}}function WC(a,l,o,p){var E=(E=Ce.current)?yf(E):null;if(!E)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(l=Bu(o.href),o=fu(E).hoistableStyles,p=o.get(l),p||(p={type:"style",instance:null,count:0,state:null},o.set(l,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){a=Bu(o.href);var A=fu(E).hoistableStyles,B=A.get(a);if(B||(E=E.ownerDocument||E,B={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},A.set(a,B),(A=E.querySelector(oo(a)))&&!A._p&&(B.instance=A,B.state.loading=5),kr.has(a)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},kr.set(a,o),A||r4(E,a,o,B.state))),l&&p===null)throw Error(r(528,""));return B}if(l&&p!==null)throw Error(r(529,""));return null;case"script":return l=o.async,o=o.src,typeof o=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Iu(o),o=fu(E).hoistableScripts,p=o.get(l),p||(p={type:"script",instance:null,count:0,state:null},o.set(l,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Bu(a){return'href="'+br(a)+'"'}function oo(a){return'link[rel="stylesheet"]['+a+"]"}function QC(a){return L({},a,{"data-precedence":a.precedence,precedence:null})}function r4(a,l,o,p){a.querySelector('link[rel="preload"][as="style"]['+l+"]")?p.loading=1:(l=a.createElement("link"),p.preload=l,l.addEventListener("load",function(){return p.loading|=1}),l.addEventListener("error",function(){return p.loading|=2}),Dn(l,"link",o),Sn(l),a.head.appendChild(l))}function Iu(a){return'[src="'+br(a)+'"]'}function co(a){return"script[async]"+a}function GC(a,l,o){if(l.count++,l.instance===null)switch(l.type){case"style":var p=a.querySelector('style[data-href~="'+br(o.href)+'"]');if(p)return l.instance=p,Sn(p),p;var E=L({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return p=(a.ownerDocument||a).createElement("style"),Sn(p),Dn(p,"style",E),vf(p,o.precedence,a),l.instance=p;case"stylesheet":E=Bu(o.href);var A=a.querySelector(oo(E));if(A)return l.state.loading|=4,l.instance=A,Sn(A),A;p=QC(o),(E=kr.get(E))&&Cm(p,E),A=(a.ownerDocument||a).createElement("link"),Sn(A);var B=A;return B._p=new Promise(function(J,le){B.onload=J,B.onerror=le}),Dn(A,"link",p),l.state.loading|=4,vf(A,o.precedence,a),l.instance=A;case"script":return A=Iu(o.src),(E=a.querySelector(co(A)))?(l.instance=E,Sn(E),E):(p=o,(E=kr.get(A))&&(p=L({},o),_m(p,E)),a=a.ownerDocument||a,E=a.createElement("script"),Sn(E),Dn(E,"link",p),a.head.appendChild(E),l.instance=E);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&!(l.state.loading&4)&&(p=l.instance,l.state.loading|=4,vf(p,o.precedence,a));return l.instance}function vf(a,l,o){for(var p=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=p.length?p[p.length-1]:null,A=E,B=0;B title"):null)}function a4(a,l,o){if(o===1||l.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return a=l.disabled,typeof l.precedence=="string"&&a==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function ZC(a){return!(a.type==="stylesheet"&&!(a.state.loading&3))}var fo=null;function i4(){}function l4(a,l,o){if(fo===null)throw Error(r(475));var p=fo;if(l.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&!(l.state.loading&4)){if(l.instance===null){var E=Bu(o.href),A=a.querySelector(oo(E));if(A){a=A._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(p.count++,p=xf.bind(p),a.then(p,p)),l.state.loading|=4,l.instance=A,Sn(A);return}A=a.ownerDocument||a,o=QC(o),(E=kr.get(E))&&Cm(o,E),A=A.createElement("link"),Sn(A);var B=A;B._p=new Promise(function(J,le){B.onload=J,B.onerror=le}),Dn(A,"link",o),l.instance=A}p.stylesheets===null&&(p.stylesheets=new Map),p.stylesheets.set(l,a),(a=l.state.preload)&&!(l.state.loading&3)&&(p.count++,l=xf.bind(p),a.addEventListener("load",l),a.addEventListener("error",l))}}function u4(){if(fo===null)throw Error(r(475));var a=fo;return a.stylesheets&&a.count===0&&Om(a,a.stylesheets),0"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Lm.exports=vz(),Lm.exports}var xz=bz(),nd={exports:{}},rd={exports:{}},Sz=rd.exports,__;function Ez(){return __||(__=1,function(e,t){(function(n,r){e.exports=r()})(Sz,function(){function n(S){return!isNaN(parseFloat(S))&&isFinite(S)}function r(S){return S.charAt(0).toUpperCase()+S.substring(1)}function i(S){return function(){return this[S]}}var u=["isConstructor","isEval","isNative","isToplevel"],s=["columnNumber","lineNumber"],c=["fileName","functionName","source"],f=["args"],d=["evalOrigin"],h=u.concat(s,c,f,d);function m(S){if(S)for(var x=0;x-1&&(h=h.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var m=h.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),v=m.match(/ (\(.+\)$)/);m=v?m.replace(v[0],""):m;var g=this.extractLocation(v?v[1]:m),y=v&&m||void 0,S=["eval",""].indexOf(g[0])>-1?void 0:g[0];return new r({functionName:y,fileName:S,lineNumber:g[1],columnNumber:g[2],source:h})},this)},parseFFOrSafari:function(f){var d=f.stack.split(` +`).filter(function(h){return!h.match(s)},this);return d.map(function(h){if(h.indexOf(" > eval")>-1&&(h=h.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),h.indexOf("@")===-1&&h.indexOf(":")===-1)return new r({functionName:h});var m=/((.*".+"[^@]*)?[^@]*)(?:@)/,v=h.match(m),g=v&&v[1]?v[1]:void 0,y=this.extractLocation(h.replace(m,""));return new r({functionName:g,fileName:y[0],lineNumber:y[1],columnNumber:y[2],source:h})},this)},parseOpera:function(f){return!f.stacktrace||f.message.indexOf(` +`)>-1&&f.message.split(` +`).length>f.stacktrace.split(` +`).length?this.parseOpera9(f):f.stack?this.parseOpera11(f):this.parseOpera10(f)},parseOpera9:function(f){for(var d=/Line (\d+).*script (?:in )?(\S+)/i,h=f.message.split(` +`),m=[],v=2,g=h.length;v/,"$2").replace(/\([^)]*\)/g,"")||void 0,S;g.match(/\(([^)]*)\)/)&&(S=g.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var x=S===void 0||S==="[arguments not available]"?void 0:S.split(",");return new r({functionName:y,args:x,fileName:v[0],lineNumber:v[1],columnNumber:v[2],source:h})},this)}}})}(nd)),nd.exports}Cz();function ht(e,t,n,r){return{hookName:"",trace:[],resourcePath:null,legacyKey:!1}}class us{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){const n={listener:t};return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const Ho=typeof window>"u"||"Deno"in window;function Mr(){}function _z(e,t){return typeof e=="function"?e(t):e}function Q0(e){return typeof e=="number"&&e>=0&&e!==1/0}function N2(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xu(e,t,n){return Jo(e)?typeof t=="function"?{...n,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function Oz(e,t,n){return Jo(e)?typeof t=="function"?{...n,mutationKey:e,mutationFn:t}:{...t,mutationKey:e}:typeof e=="function"?{...t,mutationFn:e}:{...e}}function Ui(e,t,n){return Jo(e)?[{...t,queryKey:e},n]:[e||{},t]}function A_(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:u,queryKey:s,stale:c}=e;if(Jo(s)){if(r){if(t.queryHash!==Lx(s,t.options))return!1}else if(!xd(t.queryKey,s))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||typeof i<"u"&&i!==t.state.fetchStatus||u&&!u(t))}function R_(e,t){const{exact:n,fetching:r,predicate:i,mutationKey:u}=e;if(Jo(u)){if(!t.options.mutationKey)return!1;if(n){if(Nl(t.options.mutationKey)!==Nl(u))return!1}else if(!xd(t.options.mutationKey,u))return!1}return!(typeof r=="boolean"&&t.state.status==="loading"!==r||i&&!i(t))}function Lx(e,t){return((t==null?void 0:t.queryKeyHashFn)||Nl)(e)}function Nl(e){return JSON.stringify(e,(t,n)=>G0(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function xd(e,t){return z2(e,t)}function z2(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!z2(e[n],t[n])):!1}function $2(e,t){if(e===t)return e;const n=k_(e)&&k_(t);if(n||G0(e)&&G0(t)){const r=n?e.length:Object.keys(e).length,i=n?t:Object.keys(t),u=i.length,s=n?[]:{};let c=0;for(let f=0;f"u")return!0;const n=t.prototype;return!(!T_(n)||!n.hasOwnProperty("isPrototypeOf"))}function T_(e){return Object.prototype.toString.call(e)==="[object Object]"}function Jo(e){return Array.isArray(e)}function U2(e){return new Promise(t=>{setTimeout(t,e)})}function M_(e){U2(0).then(e)}function Az(){if(typeof AbortController=="function")return new AbortController}function Y0(e,t,n){return n.isDataEqual!=null&&n.isDataEqual(e,t)?e:typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?$2(e,t):t}class Rz extends us{constructor(){super(),this.setup=t=>{if(!Ho&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),window.addEventListener("focus",n,!1),()=>{window.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(t){this.focused!==t&&(this.focused=t,this.onFocus())}onFocus(){this.listeners.forEach(({listener:t})=>{t()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const Ed=new Rz,D_=["online","offline"];class kz extends us{constructor(){super(),this.setup=t=>{if(!Ho&&window.addEventListener){const n=()=>t();return D_.forEach(r=>{window.addEventListener(r,n,!1)}),()=>{D_.forEach(r=>{window.removeEventListener(r,n)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setOnline(r):this.onOnline()})}setOnline(t){this.online!==t&&(this.online=t,this.onOnline())}onOnline(){this.listeners.forEach(({listener:t})=>{t()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const wd=new kz;function Tz(e){return Math.min(1e3*2**e,3e4)}function Gd(e){return(e??"online")==="online"?wd.isOnline():!0}class B2{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function ad(e){return e instanceof B2}function I2(e){let t=!1,n=0,r=!1,i,u,s;const c=new Promise((x,w)=>{u=x,s=w}),f=x=>{r||(g(new B2(x)),e.abort==null||e.abort())},d=()=>{t=!0},h=()=>{t=!1},m=()=>!Ed.isFocused()||e.networkMode!=="always"&&!wd.isOnline(),v=x=>{r||(r=!0,e.onSuccess==null||e.onSuccess(x),i==null||i(),u(x))},g=x=>{r||(r=!0,e.onError==null||e.onError(x),i==null||i(),s(x))},y=()=>new Promise(x=>{i=w=>{const b=r||!m();return b&&x(w),b},e.onPause==null||e.onPause()}).then(()=>{i=void 0,r||e.onContinue==null||e.onContinue()}),S=()=>{if(r)return;let x;try{x=e.fn()}catch(w){x=Promise.reject(w)}Promise.resolve(x).then(v).catch(w=>{var b,_;if(r)return;const C=(b=e.retry)!=null?b:3,O=(_=e.retryDelay)!=null?_:Tz,k=typeof O=="function"?O(n,w):O,D=C===!0||typeof C=="number"&&n{if(m())return y()}).then(()=>{t?g(w):S()})})};return Gd(e.networkMode)?S():y().then(S),{promise:c,cancel:f,continue:()=>(i==null?void 0:i())?c:Promise.resolve(),cancelRetry:d,continueRetry:h}}const qx=console;function Mz(){let e=[],t=0,n=h=>{h()},r=h=>{h()};const i=h=>{let m;t++;try{m=h()}finally{t--,t||c()}return m},u=h=>{t?e.push(h):M_(()=>{n(h)})},s=h=>(...m)=>{u(()=>{h(...m)})},c=()=>{const h=e;e=[],h.length&&M_(()=>{r(()=>{h.forEach(m=>{n(m)})})})};return{batch:i,batchCalls:s,schedule:u,setNotifyFunction:h=>{n=h},setBatchNotifyFunction:h=>{r=h}}}const Yt=Mz();class H2{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Q0(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t??(Ho?1/0:5*60*1e3))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class Dz extends H2{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||qx,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||Lz(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(t,n){const r=Y0(this.state.data,t,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){this.dispatch({type:"setState",state:t,setStateOptions:n})}cancel(t){var n;const r=this.promise;return(n=this.retryer)==null||n.cancel(t),r?r.then(Mr).catch(Mr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!N2(this.state.dataUpdatedAt,t)}onFocus(){var t;const n=this.observers.find(r=>r.shouldFetchOnWindowFocus());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}onOnline(){var t;const n=this.observers.find(r=>r.shouldFetchOnReconnect());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(t,n){var r,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&n!=null&&n.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var u;return(u=this.retryer)==null||u.continueRetry(),this.promise}}if(t&&this.setOptions(t),!this.options.queryFn){const g=this.observers.find(y=>y.options.queryFn);g&&this.setOptions(g.options)}const s=Az(),c={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},f=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>{if(s)return this.abortSignalConsumed=!0,s.signal}})};f(c);const d=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(c)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),h={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:d};if(f(h),(r=this.options.behavior)==null||r.onFetch(h),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=h.fetchOptions)==null?void 0:i.meta)){var m;this.dispatch({type:"fetch",meta:(m=h.fetchOptions)==null?void 0:m.meta})}const v=g=>{if(ad(g)&&g.silent||this.dispatch({type:"error",error:g}),!ad(g)){var y,S,x,w;(y=(S=this.cache.config).onError)==null||y.call(S,g,this),(x=(w=this.cache.config).onSettled)==null||x.call(w,this.state.data,g,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=I2({fn:h.fetchFn,abort:s==null?void 0:s.abort.bind(s),onSuccess:g=>{var y,S,x,w;if(typeof g>"u"){v(new Error(this.queryHash+" data is undefined"));return}this.setData(g),(y=(S=this.cache.config).onSuccess)==null||y.call(S,g,this),(x=(w=this.cache.config).onSettled)==null||x.call(w,g,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:v,onFail:(g,y)=>{this.dispatch({type:"failed",failureCount:g,error:y})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){const n=r=>{var i,u;switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=t.meta)!=null?i:null,fetchStatus:Gd(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(u=t.dataUpdatedAt)!=null?u:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return ad(s)&&s.revert&&this.revertState?{...this.revertState,fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Yt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function Lz(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"loading",fetchStatus:"idle"}}class qz extends us{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,n,r){var i;const u=n.queryKey,s=(i=n.queryHash)!=null?i:Lx(u,n);let c=this.get(s);return c||(c=new Dz({cache:this,logger:t.getLogger(),queryKey:u,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(u)}),this.add(c)),c}add(t){this.queriesMap[t.queryHash]||(this.queriesMap[t.queryHash]=t,this.queries.push(t),this.notify({type:"added",query:t}))}remove(t){const n=this.queriesMap[t.queryHash];n&&(t.destroy(),this.queries=this.queries.filter(r=>r!==t),n===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){Yt.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,n){const[r]=Ui(t,n);return typeof r.exact>"u"&&(r.exact=!0),this.queries.find(i=>A_(r,i))}findAll(t,n){const[r]=Ui(t,n);return Object.keys(r).length>0?this.queries.filter(i=>A_(r,i)):this.queries}notify(t){Yt.batch(()=>{this.listeners.forEach(({listener:n})=>{n(t)})})}onFocus(){Yt.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){Yt.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class Pz extends H2{constructor(t){super(),this.defaultOptions=t.defaultOptions,this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||qx,this.observers=[],this.state=t.state||V2(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.observers=this.observers.filter(n=>n!==t),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var t,n;return(t=(n=this.retryer)==null?void 0:n.continue())!=null?t:this.execute()}async execute(){const t=()=>{var D;return this.retryer=I2({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(M,T)=>{this.dispatch({type:"failed",failureCount:M,error:T})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(D=this.options.retry)!=null?D:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},n=this.state.status==="loading";try{var r,i,u,s,c,f,d,h;if(!n){var m,v,g,y;this.dispatch({type:"loading",variables:this.options.variables}),await((m=(v=this.mutationCache.config).onMutate)==null?void 0:m.call(v,this.state.variables,this));const M=await((g=(y=this.options).onMutate)==null?void 0:g.call(y,this.state.variables));M!==this.state.context&&this.dispatch({type:"loading",context:M,variables:this.state.variables})}const D=await t();return await((r=(i=this.mutationCache.config).onSuccess)==null?void 0:r.call(i,D,this.state.variables,this.state.context,this)),await((u=(s=this.options).onSuccess)==null?void 0:u.call(s,D,this.state.variables,this.state.context)),await((c=(f=this.mutationCache.config).onSettled)==null?void 0:c.call(f,D,null,this.state.variables,this.state.context,this)),await((d=(h=this.options).onSettled)==null?void 0:d.call(h,D,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:D}),D}catch(D){try{var S,x,w,b,_,C,O,k;throw await((S=(x=this.mutationCache.config).onError)==null?void 0:S.call(x,D,this.state.variables,this.state.context,this)),await((w=(b=this.options).onError)==null?void 0:w.call(b,D,this.state.variables,this.state.context)),await((_=(C=this.mutationCache.config).onSettled)==null?void 0:_.call(C,void 0,D,this.state.variables,this.state.context,this)),await((O=(k=this.options).onSettled)==null?void 0:O.call(k,void 0,D,this.state.variables,this.state.context)),D}finally{this.dispatch({type:"error",error:D})}}}dispatch(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"loading":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Gd(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"};case"setState":return{...r,...t.state}}};this.state=n(this.state),Yt.batch(()=>{this.observers.forEach(r=>{r.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function V2(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class jz extends us{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,n,r){const i=new Pz({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(n),state:r,defaultOptions:n.mutationKey?t.getMutationDefaults(n.mutationKey):void 0});return this.add(i),i}add(t){this.mutations.push(t),this.notify({type:"added",mutation:t})}remove(t){this.mutations=this.mutations.filter(n=>n!==t),this.notify({type:"removed",mutation:t})}clear(){Yt.batch(()=>{this.mutations.forEach(t=>{this.remove(t)})})}getAll(){return this.mutations}find(t){return typeof t.exact>"u"&&(t.exact=!0),this.mutations.find(n=>R_(t,n))}findAll(t){return this.mutations.filter(n=>R_(t,n))}notify(t){Yt.batch(()=>{this.listeners.forEach(({listener:n})=>{n(t)})})}resumePausedMutations(){var t;return this.resuming=((t=this.resuming)!=null?t:Promise.resolve()).then(()=>{const n=this.mutations.filter(r=>r.state.isPaused);return Yt.batch(()=>n.reduce((r,i)=>r.then(()=>i.continue().catch(Mr)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function X0(){return{onFetch:e=>{e.fetchFn=()=>{var t,n,r,i,u,s;const c=(t=e.fetchOptions)==null||(n=t.meta)==null?void 0:n.refetchPage,f=(r=e.fetchOptions)==null||(i=r.meta)==null?void 0:i.fetchMore,d=f==null?void 0:f.pageParam,h=(f==null?void 0:f.direction)==="forward",m=(f==null?void 0:f.direction)==="backward",v=((u=e.state.data)==null?void 0:u.pages)||[],g=((s=e.state.data)==null?void 0:s.pageParams)||[];let y=g,S=!1;const x=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>{var D;if((D=e.signal)!=null&&D.aborted)S=!0;else{var M;(M=e.signal)==null||M.addEventListener("abort",()=>{S=!0})}return e.signal}})},w=e.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+e.options.queryHash+"'")),b=(k,D,M,T)=>(y=T?[D,...y]:[...y,D],T?[M,...k]:[...k,M]),_=(k,D,M,T)=>{if(S)return Promise.reject("Cancelled");if(typeof M>"u"&&!D&&k.length)return Promise.resolve(k);const L={queryKey:e.queryKey,pageParam:M,meta:e.options.meta};x(L);const P=w(L);return Promise.resolve(P).then(q=>b(k,M,q,T))};let C;if(!v.length)C=_([]);else if(h){const k=typeof d<"u",D=k?d:Z0(e.options,v);C=_(v,k,D)}else if(m){const k=typeof d<"u",D=k?d:K2(e.options,v);C=_(v,k,D,!0)}else{y=[];const k=typeof e.options.getNextPageParam>"u";C=(c&&v[0]?c(v[0],0,v):!0)?_([],k,g[0]):Promise.resolve(b([],g[0],v[0]));for(let M=1;M{if(c&&v[M]?c(v[M],M,v):!0){const P=k?g[M]:Z0(e.options,T);return _(T,k,P)}return Promise.resolve(b(T,g[M],v[M]))})}return C.then(k=>({pages:k,pageParams:y}))}}}}function Z0(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function K2(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}function Fz(e,t){if(e.getNextPageParam&&Array.isArray(t)){const n=Z0(e,t);return typeof n<"u"&&n!==null&&n!==!1}}function Nz(e,t){if(e.getPreviousPageParam&&Array.isArray(t)){const n=K2(e,t);return typeof n<"u"&&n!==null&&n!==!1}}class L_{constructor(t={}){this.queryCache=t.queryCache||new qz,this.mutationCache=t.mutationCache||new jz,this.logger=t.logger||qx,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=Ed.subscribe(()=>{Ed.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=wd.subscribe(()=>{wd.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var t,n;this.mountCount--,this.mountCount===0&&((t=this.unsubscribeFocus)==null||t.call(this),this.unsubscribeFocus=void 0,(n=this.unsubscribeOnline)==null||n.call(this),this.unsubscribeOnline=void 0)}isFetching(t,n){const[r]=Ui(t,n);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state.data}ensureQueryData(t,n,r){const i=Xu(t,n,r),u=this.getQueryData(i.queryKey);return u?Promise.resolve(u):this.fetchQuery(i)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:n,state:r})=>{const i=r.data;return[n,i]})}setQueryData(t,n,r){const i=this.queryCache.find(t),u=i==null?void 0:i.state.data,s=_z(n,u);if(typeof s>"u")return;const c=Xu(t),f=this.defaultQueryOptions(c);return this.queryCache.build(this,f).setData(s,{...r,manual:!0})}setQueriesData(t,n,r){return Yt.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,n,r)]))}getQueryState(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state}removeQueries(t,n){const[r]=Ui(t,n),i=this.queryCache;Yt.batch(()=>{i.findAll(r).forEach(u=>{i.remove(u)})})}resetQueries(t,n,r){const[i,u]=Ui(t,n,r),s=this.queryCache,c={type:"active",...i};return Yt.batch(()=>(s.findAll(i).forEach(f=>{f.reset()}),this.refetchQueries(c,u)))}cancelQueries(t,n,r){const[i,u={}]=Ui(t,n,r);typeof u.revert>"u"&&(u.revert=!0);const s=Yt.batch(()=>this.queryCache.findAll(i).map(c=>c.cancel(u)));return Promise.all(s).then(Mr).catch(Mr)}invalidateQueries(t,n,r){const[i,u]=Ui(t,n,r);return Yt.batch(()=>{var s,c;if(this.queryCache.findAll(i).forEach(d=>{d.invalidate()}),i.refetchType==="none")return Promise.resolve();const f={...i,type:(s=(c=i.refetchType)!=null?c:i.type)!=null?s:"active"};return this.refetchQueries(f,u)})}refetchQueries(t,n,r){const[i,u]=Ui(t,n,r),s=Yt.batch(()=>this.queryCache.findAll(i).filter(f=>!f.isDisabled()).map(f=>{var d;return f.fetch(void 0,{...u,cancelRefetch:(d=u==null?void 0:u.cancelRefetch)!=null?d:!0,meta:{refetchPage:i.refetchPage}})}));let c=Promise.all(s).then(Mr);return u!=null&&u.throwOnError||(c=c.catch(Mr)),c}fetchQuery(t,n,r){const i=Xu(t,n,r),u=this.defaultQueryOptions(i);typeof u.retry>"u"&&(u.retry=!1);const s=this.queryCache.build(this,u);return s.isStaleByTime(u.staleTime)?s.fetch(u):Promise.resolve(s.state.data)}prefetchQuery(t,n,r){return this.fetchQuery(t,n,r).then(Mr).catch(Mr)}fetchInfiniteQuery(t,n,r){const i=Xu(t,n,r);return i.behavior=X0(),this.fetchQuery(i)}prefetchInfiniteQuery(t,n,r){return this.fetchInfiniteQuery(t,n,r).then(Mr).catch(Mr)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(t){this.defaultOptions=t}setQueryDefaults(t,n){const r=this.queryDefaults.find(i=>Nl(t)===Nl(i.queryKey));r?r.defaultOptions=n:this.queryDefaults.push({queryKey:t,defaultOptions:n})}getQueryDefaults(t){if(!t)return;const n=this.queryDefaults.find(r=>xd(t,r.queryKey));return n==null?void 0:n.defaultOptions}setMutationDefaults(t,n){const r=this.mutationDefaults.find(i=>Nl(t)===Nl(i.mutationKey));r?r.defaultOptions=n:this.mutationDefaults.push({mutationKey:t,defaultOptions:n})}getMutationDefaults(t){if(!t)return;const n=this.mutationDefaults.find(r=>xd(t,r.mutationKey));return n==null?void 0:n.defaultOptions}defaultQueryOptions(t){if(t!=null&&t._defaulted)return t;const n={...this.defaultOptions.queries,...this.getQueryDefaults(t==null?void 0:t.queryKey),...t,_defaulted:!0};return!n.queryHash&&n.queryKey&&(n.queryHash=Lx(n.queryKey,n)),typeof n.refetchOnReconnect>"u"&&(n.refetchOnReconnect=n.networkMode!=="always"),typeof n.useErrorBoundary>"u"&&(n.useErrorBoundary=!!n.suspense),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...this.defaultOptions.mutations,...this.getMutationDefaults(t==null?void 0:t.mutationKey),...t,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class W2 extends us{constructor(t,n){super(),this.client=t,this.options=n,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(n)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),q_(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return J0(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return J0(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(t,n){const r=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(t),Sd(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();const u=this.hasListeners();u&&P_(this.currentQuery,i,this.options,r)&&this.executeFetch(),this.updateResult(n),u&&(this.currentQuery!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();const s=this.computeRefetchInterval();u&&(this.currentQuery!==i||this.options.enabled!==r.enabled||s!==this.currentRefetchInterval)&&this.updateRefetchInterval(s)}getOptimisticResult(t){const n=this.client.getQueryCache().build(this.client,t),r=this.createResult(n,t);return $z(this,r,t)&&(this.currentResult=r,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),r}getCurrentResult(){return this.currentResult}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),t[r])})}),n}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:t,...n}={}){return this.fetch({...n,meta:{refetchPage:t}})}fetchOptimistic(t){const n=this.client.defaultQueryOptions(t),r=this.client.getQueryCache().build(this.client,n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){var n;return this.executeFetch({...t,cancelRefetch:(n=t.cancelRefetch)!=null?n:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(t){this.updateQuery();let n=this.currentQuery.fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Mr)),n}updateStaleTimeout(){if(this.clearStaleTimeout(),Ho||this.currentResult.isStale||!Q0(this.options.staleTime))return;const n=N2(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},n)}computeRefetchInterval(){var t;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(t=this.options.refetchInterval)!=null?t:!1}updateRefetchInterval(t){this.clearRefetchInterval(),this.currentRefetchInterval=t,!(Ho||this.options.enabled===!1||!Q0(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||Ed.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(t,n){const r=this.currentQuery,i=this.options,u=this.currentResult,s=this.currentResultState,c=this.currentResultOptions,f=t!==r,d=f?t.state:this.currentQueryInitialState,h=f?this.currentResult:this.previousQueryResult,{state:m}=t;let{dataUpdatedAt:v,error:g,errorUpdatedAt:y,fetchStatus:S,status:x}=m,w=!1,b=!1,_;if(n._optimisticResults){const M=this.hasListeners(),T=!M&&q_(t,n),L=M&&P_(t,r,n,i);(T||L)&&(S=Gd(t.options.networkMode)?"fetching":"paused",v||(x="loading")),n._optimisticResults==="isRestoring"&&(S="idle")}if(n.keepPreviousData&&!m.dataUpdatedAt&&h!=null&&h.isSuccess&&x!=="error")_=h.data,v=h.dataUpdatedAt,x=h.status,w=!0;else if(n.select&&typeof m.data<"u")if(u&&m.data===(s==null?void 0:s.data)&&n.select===this.selectFn)_=this.selectResult;else try{this.selectFn=n.select,_=n.select(m.data),_=Y0(u==null?void 0:u.data,_,n),this.selectResult=_,this.selectError=null}catch(M){this.selectError=M}else _=m.data;if(typeof n.placeholderData<"u"&&typeof _>"u"&&x==="loading"){let M;if(u!=null&&u.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData))M=u.data;else if(M=typeof n.placeholderData=="function"?n.placeholderData():n.placeholderData,n.select&&typeof M<"u")try{M=n.select(M),this.selectError=null}catch(T){this.selectError=T}typeof M<"u"&&(x="success",_=Y0(u==null?void 0:u.data,M,n),b=!0)}this.selectError&&(g=this.selectError,_=this.selectResult,y=Date.now(),x="error");const C=S==="fetching",O=x==="loading",k=x==="error";return{status:x,fetchStatus:S,isLoading:O,isSuccess:x==="success",isError:k,isInitialLoading:O&&C,data:_,dataUpdatedAt:v,error:g,errorUpdatedAt:y,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>d.dataUpdateCount||m.errorUpdateCount>d.errorUpdateCount,isFetching:C,isRefetching:C&&!O,isLoadingError:k&&m.dataUpdatedAt===0,isPaused:S==="paused",isPlaceholderData:b,isPreviousData:w,isRefetchError:k&&m.dataUpdatedAt!==0,isStale:Px(t,n),refetch:this.refetch,remove:this.remove}}updateResult(t){const n=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,Sd(r,n))return;this.currentResult=r;const i={cache:!0},u=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,c=typeof s=="function"?s():s;if(c==="all"||!c&&!this.trackedProps.size)return!0;const f=new Set(c??this.trackedProps);return this.options.useErrorBoundary&&f.add("error"),Object.keys(this.currentResult).some(d=>{const h=d;return this.currentResult[h]!==n[h]&&f.has(h)})};(t==null?void 0:t.listeners)!==!1&&u()&&(i.listeners=!0),this.notify({...i,...t})}updateQuery(){const t=this.client.getQueryCache().build(this.client,this.options);if(t===this.currentQuery)return;const n=this.currentQuery;this.currentQuery=t,this.currentQueryInitialState=t.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))}onQueryUpdate(t){const n={};t.type==="success"?n.onSuccess=!t.manual:t.type==="error"&&!ad(t.error)&&(n.onError=!0),this.updateResult(n),this.hasListeners()&&this.updateTimers()}notify(t){Yt.batch(()=>{if(t.onSuccess){var n,r,i,u;(n=(r=this.options).onSuccess)==null||n.call(r,this.currentResult.data),(i=(u=this.options).onSettled)==null||i.call(u,this.currentResult.data,null)}else if(t.onError){var s,c,f,d;(s=(c=this.options).onError)==null||s.call(c,this.currentResult.error),(f=(d=this.options).onSettled)==null||f.call(d,void 0,this.currentResult.error)}t.listeners&&this.listeners.forEach(({listener:h})=>{h(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function zz(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function q_(e,t){return zz(e,t)||e.state.dataUpdatedAt>0&&J0(e,t,t.refetchOnMount)}function J0(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Px(e,t)}return!1}function P_(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Px(e,n)}function Px(e,t){return e.isStaleByTime(t.staleTime)}function $z(e,t,n){return n.keepPreviousData?!1:n.placeholderData!==void 0?t.isPlaceholderData:!Sd(e.getCurrentResult(),t)}class Uz extends W2{constructor(t,n){super(t,n)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t,n){super.setOptions({...t,behavior:X0()},n)}getOptimisticResult(t){return t.behavior=X0(),super.getOptimisticResult(t)}fetchNextPage({pageParam:t,...n}={}){return this.fetch({...n,meta:{fetchMore:{direction:"forward",pageParam:t}}})}fetchPreviousPage({pageParam:t,...n}={}){return this.fetch({...n,meta:{fetchMore:{direction:"backward",pageParam:t}}})}createResult(t,n){var r,i,u,s,c,f;const{state:d}=t,h=super.createResult(t,n),{isFetching:m,isRefetching:v}=h,g=m&&((r=d.fetchMeta)==null||(i=r.fetchMore)==null?void 0:i.direction)==="forward",y=m&&((u=d.fetchMeta)==null||(s=u.fetchMore)==null?void 0:s.direction)==="backward";return{...h,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Fz(n,(c=d.data)==null?void 0:c.pages),hasPreviousPage:Nz(n,(f=d.data)==null?void 0:f.pages),isFetchingNextPage:g,isFetchingPreviousPage:y,isRefetching:v&&!g&&!y}}}let Bz=class extends us{constructor(t,n){super(),this.client=t,this.setOptions(n),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var n;const r=this.options;this.options=this.client.defaultMutationOptions(t),Sd(r,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),(n=this.currentMutation)==null||n.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.currentMutation)==null||t.removeObserver(this)}}onMutationUpdate(t){this.updateResult();const n={listeners:!0};t.type==="success"?n.onSuccess=!0:t.type==="error"&&(n.onError=!0),this.notify(n)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(t,n){return this.mutateOptions=n,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:typeof t<"u"?t:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){const t=this.currentMutation?this.currentMutation.state:V2(),n={...t,isLoading:t.status==="loading",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset};this.currentResult=n}notify(t){Yt.batch(()=>{if(this.mutateOptions&&this.hasListeners()){if(t.onSuccess){var n,r,i,u;(n=(r=this.mutateOptions).onSuccess)==null||n.call(r,this.currentResult.data,this.currentResult.variables,this.currentResult.context),(i=(u=this.mutateOptions).onSettled)==null||i.call(u,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)}else if(t.onError){var s,c,f,d;(s=(c=this.mutateOptions).onError)==null||s.call(c,this.currentResult.error,this.currentResult.variables,this.currentResult.context),(f=(d=this.mutateOptions).onSettled)==null||f.call(d,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context)}}t.listeners&&this.listeners.forEach(({listener:h})=>{h(this.currentResult)})})}};var jm={exports:{}},Fm={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var j_;function Iz(){if(j_)return Fm;j_=1;var e=Kt();function t(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,u=e.useLayoutEffect,s=e.useDebugValue;function c(m,v){var g=v(),y=r({inst:{value:g,getSnapshot:v}}),S=y[0].inst,x=y[1];return u(function(){S.value=g,S.getSnapshot=v,f(S)&&x({inst:S})},[m,g,v]),i(function(){return f(S)&&x({inst:S}),m(function(){f(S)&&x({inst:S})})},[m]),s(g),g}function f(m){var v=m.getSnapshot;m=m.value;try{var g=v();return!n(m,g)}catch{return!0}}function d(m,v){return v()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return Fm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,Fm}var F_;function Hz(){return F_||(F_=1,jm.exports=Iz()),jm.exports}var Vz=Hz();const Q2=Vz.useSyncExternalStore,N_=Q.createContext(void 0),G2=Q.createContext(!1);function Y2(e,t){return e||(t&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=N_),window.ReactQueryClientContext):N_)}const xa=({context:e}={})=>{const t=Q.useContext(Y2(e,Q.useContext(G2)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Kz=({client:e,children:t,context:n,contextSharing:r=!1})=>{Q.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const i=Y2(n,r);return Q.createElement(G2.Provider,{value:!n&&r},Q.createElement(i.Provider,{value:e},t))},X2=Q.createContext(!1),Wz=()=>Q.useContext(X2);X2.Provider;function Qz(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const Gz=Q.createContext(Qz()),Yz=()=>Q.useContext(Gz);function Z2(e,t){return typeof e=="function"?e(...t):!!e}const Xz=(e,t)=>{(e.suspense||e.useErrorBoundary)&&(t.isReset()||(e.retryOnMount=!1))},Zz=e=>{Q.useEffect(()=>{e.clearReset()},[e])},Jz=({result:e,errorResetBoundary:t,useErrorBoundary:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&Z2(n,[e.error,r]),e$=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},t$=(e,t)=>e.isLoading&&e.isFetching&&!t,n$=(e,t,n)=>(e==null?void 0:e.suspense)&&t$(t,n),r$=(e,t,n)=>t.fetchOptimistic(e).then(({data:r})=>{e.onSuccess==null||e.onSuccess(r),e.onSettled==null||e.onSettled(r,null)}).catch(r=>{n.clearReset(),e.onError==null||e.onError(r),e.onSettled==null||e.onSettled(void 0,r)});function J2(e,t){const n=xa({context:e.context}),r=Wz(),i=Yz(),u=n.defaultQueryOptions(e);u._optimisticResults=r?"isRestoring":"optimistic",u.onError&&(u.onError=Yt.batchCalls(u.onError)),u.onSuccess&&(u.onSuccess=Yt.batchCalls(u.onSuccess)),u.onSettled&&(u.onSettled=Yt.batchCalls(u.onSettled)),e$(u),Xz(u,i),Zz(i);const[s]=Q.useState(()=>new t(n,u)),c=s.getOptimisticResult(u);if(Q2(Q.useCallback(f=>{const d=r?()=>{}:s.subscribe(Yt.batchCalls(f));return s.updateResult(),d},[s,r]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),Q.useEffect(()=>{s.setOptions(u,{listeners:!1})},[u,s]),n$(u,c,r))throw r$(u,s,i);if(Jz({result:c,errorResetBoundary:i,useErrorBoundary:u.useErrorBoundary,query:s.getCurrentQuery()}))throw c.error;return u.notifyOnChangeProps?c:s.trackResult(c)}function Pr(e,t,n){const r=Xu(e,t,n);return J2(r,W2)}function tn(e,t,n){const r=Oz(e,t,n),i=xa({context:r.context}),[u]=Q.useState(()=>new Bz(i,r));Q.useEffect(()=>{u.setOptions(r)},[u,r]);const s=Q2(Q.useCallback(f=>u.subscribe(Yt.batchCalls(f)),[u]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),c=Q.useCallback((f,d)=>{u.mutate(f,d).catch(a$)},[u]);if(s.error&&Z2(u.options.useErrorBoundary,[s.error]))throw s.error;return{...s,mutate:c,mutateAsync:s.mutate}}function a$(){}function i$(e,t,n){const r=Xu(e,t,n);return J2(r,Uz)}var eL=typeof global=="object"&&global&&global.Object===Object&&global,l$=typeof self=="object"&&self&&self.Object===Object&&self,Sa=eL||l$||Function("return this")(),Xi=Sa.Symbol,tL=Object.prototype,u$=tL.hasOwnProperty,s$=tL.toString,bo=Xi?Xi.toStringTag:void 0;function o$(e){var t=u$.call(e,bo),n=e[bo];try{e[bo]=void 0;var r=!0}catch{}var i=s$.call(e);return r&&(t?e[bo]=n:delete e[bo]),i}var c$=Object.prototype,f$=c$.toString;function d$(e){return f$.call(e)}var h$="[object Null]",p$="[object Undefined]",z_=Xi?Xi.toStringTag:void 0;function ss(e){return e==null?e===void 0?p$:h$:z_&&z_ in Object(e)?o$(e):d$(e)}function Vo(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var m$="[object AsyncFunction]",g$="[object Function]",y$="[object GeneratorFunction]",v$="[object Proxy]";function nL(e){if(!Vo(e))return!1;var t=ss(e);return t==g$||t==y$||t==m$||t==v$}var Nm=Sa["__core-js_shared__"],$_=function(){var e=/[^.]+$/.exec(Nm&&Nm.keys&&Nm.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function b$(e){return!!$_&&$_ in e}var x$=Function.prototype,S$=x$.toString;function Gl(e){if(e!=null){try{return S$.call(e)}catch{}try{return e+""}catch{}}return""}var E$=/[\\^$.*+?()[\]{}|]/g,w$=/^\[object .+?Constructor\]$/,C$=Function.prototype,_$=Object.prototype,O$=C$.toString,A$=_$.hasOwnProperty,R$=RegExp("^"+O$.call(A$).replace(E$,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function k$(e){if(!Vo(e)||b$(e))return!1;var t=nL(e)?R$:w$;return t.test(Gl(e))}function T$(e,t){return e==null?void 0:e[t]}function Yl(e,t){var n=T$(e,t);return k$(n)?n:void 0}var Ko=Yl(Object,"create");function M$(){this.__data__=Ko?Ko(null):{},this.size=0}function D$(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var L$="__lodash_hash_undefined__",q$=Object.prototype,P$=q$.hasOwnProperty;function j$(e){var t=this.__data__;if(Ko){var n=t[e];return n===L$?void 0:n}return P$.call(t,e)?t[e]:void 0}var F$=Object.prototype,N$=F$.hasOwnProperty;function z$(e){var t=this.__data__;return Ko?t[e]!==void 0:N$.call(t,e)}var $$="__lodash_hash_undefined__";function U$(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ko&&t===void 0?$$:t,this}function Hl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1}function Q$(e,t){var n=this.__data__,r=Yd(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function li(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1}function iL(e,t,n){for(var r=-1,i=e==null?0:e.length;++r=o3&&(u=jx,s=!1,t=new rs(t));e:for(;++i0){if(++t>=v3)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var E3=S3(y3);function Fx(e,t){return E3(m3(e,t,fL),e+"")}var w3=9007199254740991;function Nx(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=w3}function dL(e){return e!=null&&Nx(e.length)&&!nL(e)}function No(e){return Vl(e)&&dL(e)}function hL(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Wi=Fx(function(e,t){var n=hL(t);return No(n)&&(n=void 0),No(e)?c3(e,cL(t,1,No),void 0,n):[]}),Ju=Yl(Sa,"Set");function C3(){}function zx(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var _3=1/0,O3=Ju&&1/zx(new Ju([,-0]))[1]==_3?function(e){return new Ju(e)}:C3,A3=200;function pL(e,t,n){var r=-1,i=aL,u=e.length,s=!0,c=[],f=c;if(n)s=!1,i=iL;else if(u>=A3){var d=t?null:O3(e);if(d)return zx(d);s=!1,i=jx,f=new rs}else f=t?[]:c;e:for(;++r-1e3&&ye<1e3||k.call(/e/,Se))return Se;var Ke=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof ye=="number"){var pt=ye<0?-L(-ye):L(ye);if(pt!==ye){var vt=String(pt),Ge=b.call(Se,vt.length+1);return _.call(vt,Ke,"$&_")+"."+_.call(_.call(Ge,/([0-9]{3})/g,"$&_"),/_$/,"")}}return _.call(Se,Ke,"$&_")}var ne=T3,W=ne.custom,Z=Ce(W)?W:null,X={__proto__:null,double:'"',single:"'"},Y={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};$m=function ye(Se,Ke,pt,vt){var Ge=Ke||{};if(ce(Ge,"quoteStyle")&&!ce(X,Ge.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ce(Ge,"maxStringLength")&&(typeof Ge.maxStringLength=="number"?Ge.maxStringLength<0&&Ge.maxStringLength!==1/0:Ge.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var xn=ce(Ge,"customInspect")?Ge.customInspect:!0;if(typeof xn!="boolean"&&xn!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ce(Ge,"indent")&&Ge.indent!==null&&Ge.indent!==" "&&!(parseInt(Ge.indent,10)===Ge.indent&&Ge.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ce(Ge,"numericSeparator")&&typeof Ge.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var mt=Ge.numericSeparator;if(typeof Se>"u")return"undefined";if(Se===null)return"null";if(typeof Se=="boolean")return Se?"true":"false";if(typeof Se=="string")return Fe(Se,Ge);if(typeof Se=="number"){if(Se===0)return 1/0/Se>0?"0":"-0";var ve=String(Se);return mt?K(Se,ve):ve}if(typeof Se=="bigint"){var Ue=String(Se)+"n";return mt?K(Se,Ue):Ue}var et=typeof Ge.depth>"u"?5:Ge.depth;if(typeof pt>"u"&&(pt=0),pt>=et&&et>0&&typeof Se=="object")return se(Se)?"[Array]":"[Object]";var at=jt(Ge,pt);if(typeof vt>"u")vt=[];else if(te(vt,Se)>=0)return"[Circular]";function wt(Ca,na,Cs){if(na&&(vt=T.call(vt),vt.push(na)),Cs){var ra={depth:Ge.depth};return ce(Ge,"quoteStyle")&&(ra.quoteStyle=Ge.quoteStyle),ye(Ca,ra,pt+1,vt)}return ye(Ca,Ge,pt+1,vt)}if(typeof Se=="function"&&!oe(Se)){var At=G(Se),dn=Et(Se,wt);return"[Function"+(At?": "+At:" (anonymous)")+"]"+(dn.length>0?" { "+M.call(dn,", ")+" }":"")}if(Ce(Se)){var An=F?_.call(String(Se),/^(Symbol\(.*\))_[^)]*$/,"$1"):q.call(Se);return typeof Se=="object"&&!F?Ne(An):An}if(Le(Se)){for(var Xt="<"+O.call(String(Se.nodeName)),Rn=Se.attributes||[],Ct=0;Ct",Xt}if(se(Se)){if(Se.length===0)return"[]";var gr=Et(Se,wt);return at&&!yt(gr)?"["+It(gr,at)+"]":"[ "+M.call(gr,", ")+" ]"}if(V(Se)){var yr=Et(Se,wt);return!("cause"in Error.prototype)&&"cause"in Se&&!$.call(Se,"cause")?"{ ["+String(Se)+"] "+M.call(D.call("[cause]: "+wt(Se.cause),yr),", ")+" }":yr.length===0?"["+String(Se)+"]":"{ ["+String(Se)+"] "+M.call(yr,", ")+" }"}if(typeof Se=="object"&&xn){if(Z&&typeof Se[Z]=="function"&&ne)return ne(Se,{depth:et-pt});if(xn!=="symbol"&&typeof Se.inspect=="function")return Se.inspect()}if(re(Se)){var xc=[];return r&&r.call(Se,function(Ca,na){xc.push(wt(na,Se,!0)+" => "+wt(Ca,Se))}),ut("Map",n.call(Se),xc,at)}if(be(Se)){var Hr=[];return c&&c.call(Se,function(Ca){Hr.push(wt(Ca,Se))}),ut("Set",s.call(Se),Hr,at)}if(de(Se))return ot("WeakMap");if(De(Se))return ot("WeakSet");if(_e(Se))return ot("WeakRef");if(me(Se))return Ne(wt(Number(Se)));if(Te(Se))return Ne(wt(P.call(Se)));if(Ee(Se))return Ne(y.call(Se));if(ue(Se))return Ne(wt(String(Se)));if(typeof window<"u"&&Se===window)return"{ [object Window] }";if(typeof globalThis<"u"&&Se===globalThis||typeof Yu<"u"&&Se===Yu)return"{ [object globalThis] }";if(!ie(Se)&&!oe(Se)){var nn=Et(Se,wt),kn=H?H(Se)===Object.prototype:Se instanceof Object||Se.constructor===Object,ta=Se instanceof Object?"":"null prototype",ou=!kn&&N&&Object(Se)===Se&&N in Se?b.call(fe(Se),8,-1):ta?"Object":"",Th=kn||typeof Se.constructor!="function"?"":Se.constructor.name?Se.constructor.name+" ":"",ws=Th+(ou||ta?"["+M.call(D.call([],ou||[],ta||[]),": ")+"] ":"");return nn.length===0?ws+"{}":at?ws+"{"+It(nn,at)+"}":ws+"{ "+M.call(nn,", ")+" }"}return String(Se)};function I(ye,Se,Ke){var pt=Ke.quoteStyle||Se,vt=X[pt];return vt+ye+vt}function ae(ye){return _.call(String(ye),/"/g,""")}function se(ye){return fe(ye)==="[object Array]"&&(!N||!(typeof ye=="object"&&N in ye))}function ie(ye){return fe(ye)==="[object Date]"&&(!N||!(typeof ye=="object"&&N in ye))}function oe(ye){return fe(ye)==="[object RegExp]"&&(!N||!(typeof ye=="object"&&N in ye))}function V(ye){return fe(ye)==="[object Error]"&&(!N||!(typeof ye=="object"&&N in ye))}function ue(ye){return fe(ye)==="[object String]"&&(!N||!(typeof ye=="object"&&N in ye))}function me(ye){return fe(ye)==="[object Number]"&&(!N||!(typeof ye=="object"&&N in ye))}function Ee(ye){return fe(ye)==="[object Boolean]"&&(!N||!(typeof ye=="object"&&N in ye))}function Ce(ye){if(F)return ye&&typeof ye=="object"&&ye instanceof Symbol;if(typeof ye=="symbol")return!0;if(!ye||typeof ye!="object"||!q)return!1;try{return q.call(ye),!0}catch{}return!1}function Te(ye){if(!ye||typeof ye!="object"||!P)return!1;try{return P.call(ye),!0}catch{}return!1}var U=Object.prototype.hasOwnProperty||function(ye){return ye in this};function ce(ye,Se){return U.call(ye,Se)}function fe(ye){return S.call(ye)}function G(ye){if(ye.name)return ye.name;var Se=w.call(x.call(ye),/^function\s*([\w$]+)/);return Se?Se[1]:null}function te(ye,Se){if(ye.indexOf)return ye.indexOf(Se);for(var Ke=0,pt=ye.length;KeSe.maxStringLength){var Ke=ye.length-Se.maxStringLength,pt="... "+Ke+" more character"+(Ke>1?"s":"");return Fe(b.call(ye,0,Se.maxStringLength),Se)+pt}var vt=Y[Se.quoteStyle||"single"];vt.lastIndex=0;var Ge=_.call(_.call(ye,vt,"\\$1"),/[\x00-\x1f]/g,je);return I(Ge,"single",Se)}function je(ye){var Se=ye.charCodeAt(0),Ke={8:"b",9:"t",10:"n",12:"f",13:"r"}[Se];return Ke?"\\"+Ke:"\\x"+(Se<16?"0":"")+C.call(Se.toString(16))}function Ne(ye){return"Object("+ye+")"}function ot(ye){return ye+" { ? }"}function ut(ye,Se,Ke,pt){var vt=pt?It(Ke,pt):M.call(Ke,", ");return ye+" ("+Se+") {"+vt+"}"}function yt(ye){for(var Se=0;Se=0)return!1;return!0}function jt(ye,Se){var Ke;if(ye.indent===" ")Ke=" ";else if(typeof ye.indent=="number"&&ye.indent>0)Ke=M.call(Array(ye.indent+1)," ");else return null;return{base:Ke,prev:M.call(Array(Se+1),Ke)}}function It(ye,Se){if(ye.length===0)return"";var Ke=` +`+Se.prev+Se.base;return Ke+M.call(ye,","+Ke)+` +`+Se.prev}function Et(ye,Se){var Ke=se(ye),pt=[];if(Ke){pt.length=ye.length;for(var vt=0;vt"u"||!D?e:D(Uint8Array),F={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":k&&D?D([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":j,"%AsyncGenerator%":j,"%AsyncGeneratorFunction%":j,"%AsyncIteratorPrototype%":j,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":x,"%GeneratorFunction%":j,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":k&&D?D(D([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!k||!D?e:D(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":i,"%ReferenceError%":u,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!k||!D?e:D(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":k&&D?D(""[Symbol.iterator]()):e,"%Symbol%":k?Symbol:e,"%SyntaxError%":s,"%ThrowTypeError%":O,"%TypedArray%":q,"%TypeError%":c,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":f,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":P,"%Function.prototype.apply%":L,"%Object.defineProperty%":_,"%Object.getPrototypeOf%":M,"%Math.abs%":d,"%Math.floor%":h,"%Math.max%":m,"%Math.min%":v,"%Math.pow%":g,"%Math.round%":y,"%Math.sign%":S,"%Reflect.getPrototypeOf%":T};if(D)try{null.error}catch(V){var N=D(D(V));F["%Error.prototype%"]=N}var $=function V(ue){var me;if(ue==="%AsyncFunction%")me=w("async function () {}");else if(ue==="%GeneratorFunction%")me=w("function* () {}");else if(ue==="%AsyncGeneratorFunction%")me=w("async function* () {}");else if(ue==="%AsyncGenerator%"){var Ee=V("%AsyncGeneratorFunction%");Ee&&(me=Ee.prototype)}else if(ue==="%AsyncIteratorPrototype%"){var Ce=V("%AsyncGenerator%");Ce&&D&&(me=D(Ce.prototype))}return F[ue]=me,me},H={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},K=Jd(),ne=tU(),W=K.call(P,Array.prototype.concat),Z=K.call(L,Array.prototype.splice),X=K.call(P,String.prototype.replace),Y=K.call(P,String.prototype.slice),I=K.call(P,RegExp.prototype.exec),ae=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,se=/\\(\\)?/g,ie=function(ue){var me=Y(ue,0,1),Ee=Y(ue,-1);if(me==="%"&&Ee!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(Ee==="%"&&me!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var Ce=[];return X(ue,ae,function(Te,U,ce,fe){Ce[Ce.length]=ce?X(fe,se,"$1"):U||Te}),Ce},oe=function(ue,me){var Ee=ue,Ce;if(ne(H,Ee)&&(Ce=H[Ee],Ee="%"+Ce[0]+"%"),ne(F,Ee)){var Te=F[Ee];if(Te===j&&(Te=$(Ee)),typeof Te>"u"&&!me)throw new c("intrinsic "+ue+" exists, but is not available. Please file an issue!");return{alias:Ce,name:Ee,value:Te}}throw new s("intrinsic "+ue+" does not exist!")};return xg=function(ue,me){if(typeof ue!="string"||ue.length===0)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof me!="boolean")throw new c('"allowMissing" argument must be a boolean');if(I(/^%?[^%]*%?$/,ue)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Ee=ie(ue),Ce=Ee.length>0?Ee[0]:"",Te=oe("%"+Ce+"%",me),U=Te.name,ce=Te.value,fe=!1,G=Te.alias;G&&(Ce=G[0],Z(Ee,W([0,1],G)));for(var te=1,re=!0;te=Ee.length){var De=b(ce,de);re=!!De,re&&"get"in De&&!("originalValue"in De.get)?ce=De.get:ce=ce[de]}else re=ne(ce,de),ce=ce[de];re&&!fe&&(F[U]=ce)}}return ce},xg}var Sg,OO;function SL(){if(OO)return Sg;OO=1;var e=Ux(),t=xL(),n=t([e("%String.prototype.indexOf%")]);return Sg=function(i,u){var s=e(i,!!u);return typeof s=="function"&&n(i,".prototype.")>-1?t([s]):s},Sg}var Eg,AO;function EL(){if(AO)return Eg;AO=1;var e=Ux(),t=SL(),n=Zd(),r=os(),i=e("%Map%",!0),u=t("Map.prototype.get",!0),s=t("Map.prototype.set",!0),c=t("Map.prototype.has",!0),f=t("Map.prototype.delete",!0),d=t("Map.prototype.size",!0);return Eg=!!i&&function(){var m,v={assert:function(g){if(!v.has(g))throw new r("Side channel does not contain "+n(g))},delete:function(g){if(m){var y=f(m,g);return d(m)===0&&(m=void 0),y}return!1},get:function(g){if(m)return u(m,g)},has:function(g){return m?c(m,g):!1},set:function(g,y){m||(m=new i),s(m,g,y)}};return v},Eg}var wg,RO;function nU(){if(RO)return wg;RO=1;var e=Ux(),t=SL(),n=Zd(),r=EL(),i=os(),u=e("%WeakMap%",!0),s=t("WeakMap.prototype.get",!0),c=t("WeakMap.prototype.set",!0),f=t("WeakMap.prototype.has",!0),d=t("WeakMap.prototype.delete",!0);return wg=u?function(){var m,v,g={assert:function(y){if(!g.has(y))throw new i("Side channel does not contain "+n(y))},delete:function(y){if(u&&y&&(typeof y=="object"||typeof y=="function")){if(m)return d(m,y)}else if(r&&v)return v.delete(y);return!1},get:function(y){return u&&y&&(typeof y=="object"||typeof y=="function")&&m?s(m,y):v&&v.get(y)},has:function(y){return u&&y&&(typeof y=="object"||typeof y=="function")&&m?f(m,y):!!v&&v.has(y)},set:function(y,S){u&&y&&(typeof y=="object"||typeof y=="function")?(m||(m=new u),c(m,y,S)):r&&(v||(v=r()),v.set(y,S))}};return g}:r,wg}var Cg,kO;function rU(){if(kO)return Cg;kO=1;var e=os(),t=Zd(),n=M3(),r=EL(),i=nU(),u=i||r||n;return Cg=function(){var c,f={assert:function(d){if(!f.has(d))throw new e("Side channel does not contain "+t(d))},delete:function(d){return!!c&&c.delete(d)},get:function(d){return c&&c.get(d)},has:function(d){return!!c&&c.has(d)},set:function(d,h){c||(c=u()),c.set(d,h)}};return f},Cg}var _g,TO;function Bx(){if(TO)return _g;TO=1;var e=String.prototype.replace,t=/%20/g,n={RFC1738:"RFC1738",RFC3986:"RFC3986"};return _g={default:n.RFC3986,formatters:{RFC1738:function(r){return e.call(r,t,"+")},RFC3986:function(r){return String(r)}},RFC1738:n.RFC1738,RFC3986:n.RFC3986},_g}var Og,MO;function wL(){if(MO)return Og;MO=1;var e=Bx(),t=Object.prototype.hasOwnProperty,n=Array.isArray,r=function(){for(var x=[],w=0;w<256;++w)x.push("%"+((w<16?"0":"")+w.toString(16)).toUpperCase());return x}(),i=function(w){for(;w.length>1;){var b=w.pop(),_=b.obj[b.prop];if(n(_)){for(var C=[],O=0;O<_.length;++O)typeof _[O]<"u"&&C.push(_[O]);b.obj[b.prop]=C}}},u=function(w,b){for(var _=b&&b.plainObjects?{__proto__:null}:{},C=0;C=d?k.slice(M,M+d):k,L=[],P=0;P=48&&j<=57||j>=65&&j<=90||j>=97&&j<=122||O===e.RFC1738&&(j===40||j===41)){L[L.length]=T.charAt(P);continue}if(j<128){L[L.length]=r[j];continue}if(j<2048){L[L.length]=r[192|j>>6]+r[128|j&63];continue}if(j<55296||j>=57344){L[L.length]=r[224|j>>12]+r[128|j>>6&63]+r[128|j&63];continue}P+=1,j=65536+((j&1023)<<10|T.charCodeAt(P)&1023),L[L.length]=r[240|j>>18]+r[128|j>>12&63]+r[128|j>>6&63]+r[128|j&63]}D+=L.join("")}return D},m=function(w){for(var b=[{obj:{o:w},prop:"o"}],_=[],C=0;C"u"&&(W=0)}if(typeof T=="function"?K=T(w,K):K instanceof Date?K=j(K):b==="comma"&&u(K)&&(K=t.maybeMap(K,function(U){return U instanceof Date?j(U):U})),K===null){if(O)return M&&!N?M(w,h.encoder,$,"key",q):w;K=""}if(m(K)||t.isBuffer(K)){if(M){var Y=N?w:M(w,h.encoder,$,"key",q);return[F(Y)+"="+F(M(K,h.encoder,$,"value",q))]}return[F(w)+"="+F(String(K))]}var I=[];if(typeof K>"u")return I;var ae;if(b==="comma"&&u(K))N&&M&&(K=t.maybeMap(K,M)),ae=[{value:K.length>0?K.join(",")||null:void 0}];else if(u(T))ae=T;else{var se=Object.keys(K);ae=L?se.sort(L):se}var ie=D?String(w).replace(/\./g,"%2E"):String(w),oe=_&&u(K)&&K.length===1?ie+"[]":ie;if(C&&u(K)&&K.length===0)return oe+"[]";for(var V=0;V"u"?x.encodeDotInKeys===!0?!0:h.allowDots:!!x.allowDots;return{addQueryPrefix:typeof x.addQueryPrefix=="boolean"?x.addQueryPrefix:h.addQueryPrefix,allowDots:k,allowEmptyArrays:typeof x.allowEmptyArrays=="boolean"?!!x.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:O,charset:w,charsetSentinel:typeof x.charsetSentinel=="boolean"?x.charsetSentinel:h.charsetSentinel,commaRoundTrip:!!x.commaRoundTrip,delimiter:typeof x.delimiter>"u"?h.delimiter:x.delimiter,encode:typeof x.encode=="boolean"?x.encode:h.encode,encodeDotInKeys:typeof x.encodeDotInKeys=="boolean"?x.encodeDotInKeys:h.encodeDotInKeys,encoder:typeof x.encoder=="function"?x.encoder:h.encoder,encodeValuesOnly:typeof x.encodeValuesOnly=="boolean"?x.encodeValuesOnly:h.encodeValuesOnly,filter:C,format:b,formatter:_,serializeDate:typeof x.serializeDate=="function"?x.serializeDate:h.serializeDate,skipNulls:typeof x.skipNulls=="boolean"?x.skipNulls:h.skipNulls,sort:typeof x.sort=="function"?x.sort:null,strictNullHandling:typeof x.strictNullHandling=="boolean"?x.strictNullHandling:h.strictNullHandling}};return Ag=function(S,x){var w=S,b=y(x),_,C;typeof b.filter=="function"?(C=b.filter,w=C("",w)):u(b.filter)&&(C=b.filter,_=C);var O=[];if(typeof w!="object"||w===null)return"";var k=i[b.arrayFormat],D=k==="comma"&&b.commaRoundTrip;_||(_=Object.keys(w)),b.sort&&_.sort(b.sort);for(var M=e(),T=0;T<_.length;++T){var L=_[T],P=w[L];b.skipNulls&&P===null||c(O,g(P,L,k,D,b.allowEmptyArrays,b.strictNullHandling,b.skipNulls,b.encodeDotInKeys,b.encode?b.encoder:null,b.filter,b.sort,b.allowDots,b.serializeDate,b.format,b.formatter,b.encodeValuesOnly,b.charset,M))}var j=O.join(b.delimiter),q=b.addQueryPrefix===!0?"?":"";return b.charsetSentinel&&(b.charset==="iso-8859-1"?q+="utf8=%26%2310003%3B&":q+="utf8=%E2%9C%93&"),j.length>0?q+j:""},Ag}var Rg,LO;function iU(){if(LO)return Rg;LO=1;var e=wL(),t=Object.prototype.hasOwnProperty,n=Array.isArray,r={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},i=function(v){return v.replace(/&#(\d+);/g,function(g,y){return String.fromCharCode(parseInt(y,10))})},u=function(v,g,y){if(v&&typeof v=="string"&&g.comma&&v.indexOf(",")>-1)return v.split(",");if(g.throwOnLimitExceeded&&y>=g.arrayLimit)throw new RangeError("Array limit exceeded. Only "+g.arrayLimit+" element"+(g.arrayLimit===1?"":"s")+" allowed in an array.");return v},s="utf8=%26%2310003%3B",c="utf8=%E2%9C%93",f=function(g,y){var S={__proto__:null},x=y.ignoreQueryPrefix?g.replace(/^\?/,""):g;x=x.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var w=y.parameterLimit===1/0?void 0:y.parameterLimit,b=x.split(y.delimiter,y.throwOnLimitExceeded?w+1:w);if(y.throwOnLimitExceeded&&b.length>w)throw new RangeError("Parameter limit exceeded. Only "+w+" parameter"+(w===1?"":"s")+" allowed.");var _=-1,C,O=y.charset;if(y.charsetSentinel)for(C=0;C-1&&(L=n(L)?[L]:L);var P=t.call(S,T);P&&y.duplicates==="combine"?S[T]=e.combine(S[T],L):(!P||y.duplicates==="last")&&(S[T]=L)}return S},d=function(v,g,y,S){var x=0;if(v.length>0&&v[v.length-1]==="[]"){var w=v.slice(0,-1).join("");x=Array.isArray(g)&&g[w]?g[w].length:0}for(var b=S?g:u(g,y,x),_=v.length-1;_>=0;--_){var C,O=v[_];if(O==="[]"&&y.parseArrays)C=y.allowEmptyArrays&&(b===""||y.strictNullHandling&&b===null)?[]:e.combine([],b);else{C=y.plainObjects?{__proto__:null}:{};var k=O.charAt(0)==="["&&O.charAt(O.length-1)==="]"?O.slice(1,-1):O,D=y.decodeDotInKeys?k.replace(/%2E/g,"."):k,M=parseInt(D,10);!y.parseArrays&&D===""?C={0:b}:!isNaN(M)&&O!==D&&String(M)===D&&M>=0&&y.parseArrays&&M<=y.arrayLimit?(C=[],C[M]=b):D!=="__proto__"&&(C[D]=b)}b=C}return b},h=function(g,y,S,x){if(g){var w=S.allowDots?g.replace(/\.([^.[]+)/g,"[$1]"):g,b=/(\[[^[\]]*])/,_=/(\[[^[\]]*])/g,C=S.depth>0&&b.exec(w),O=C?w.slice(0,C.index):w,k=[];if(O){if(!S.plainObjects&&t.call(Object.prototype,O)&&!S.allowPrototypes)return;k.push(O)}for(var D=0;S.depth>0&&(C=_.exec(w))!==null&&D"u"?r.charset:g.charset,S=typeof g.duplicates>"u"?r.duplicates:g.duplicates;if(S!=="combine"&&S!=="first"&&S!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var x=typeof g.allowDots>"u"?g.decodeDotInKeys===!0?!0:r.allowDots:!!g.allowDots;return{allowDots:x,allowEmptyArrays:typeof g.allowEmptyArrays=="boolean"?!!g.allowEmptyArrays:r.allowEmptyArrays,allowPrototypes:typeof g.allowPrototypes=="boolean"?g.allowPrototypes:r.allowPrototypes,allowSparse:typeof g.allowSparse=="boolean"?g.allowSparse:r.allowSparse,arrayLimit:typeof g.arrayLimit=="number"?g.arrayLimit:r.arrayLimit,charset:y,charsetSentinel:typeof g.charsetSentinel=="boolean"?g.charsetSentinel:r.charsetSentinel,comma:typeof g.comma=="boolean"?g.comma:r.comma,decodeDotInKeys:typeof g.decodeDotInKeys=="boolean"?g.decodeDotInKeys:r.decodeDotInKeys,decoder:typeof g.decoder=="function"?g.decoder:r.decoder,delimiter:typeof g.delimiter=="string"||e.isRegExp(g.delimiter)?g.delimiter:r.delimiter,depth:typeof g.depth=="number"||g.depth===!1?+g.depth:r.depth,duplicates:S,ignoreQueryPrefix:g.ignoreQueryPrefix===!0,interpretNumericEntities:typeof g.interpretNumericEntities=="boolean"?g.interpretNumericEntities:r.interpretNumericEntities,parameterLimit:typeof g.parameterLimit=="number"?g.parameterLimit:r.parameterLimit,parseArrays:g.parseArrays!==!1,plainObjects:typeof g.plainObjects=="boolean"?g.plainObjects:r.plainObjects,strictDepth:typeof g.strictDepth=="boolean"?!!g.strictDepth:r.strictDepth,strictNullHandling:typeof g.strictNullHandling=="boolean"?g.strictNullHandling:r.strictNullHandling,throwOnLimitExceeded:typeof g.throwOnLimitExceeded=="boolean"?g.throwOnLimitExceeded:!1}};return Rg=function(v,g){var y=m(g);if(v===""||v===null||typeof v>"u")return y.plainObjects?{__proto__:null}:{};for(var S=typeof v=="string"?f(v,y):v,x=y.plainObjects?{__proto__:null}:{},w=Object.keys(S),b=0;b=t||D<0||m&&M>=u}function w(){var k=Mg();if(x(k))return b(k);c=setTimeout(w,S(k))}function b(k){return c=void 0,v&&r?g(k):(r=i=void 0,s)}function _(){c!==void 0&&clearTimeout(c),d=0,r=f=i=c=void 0}function C(){return c===void 0?s:b(Mg())}function O(){var k=Mg(),D=x(k);if(r=arguments,i=this,f=k,D){if(c===void 0)return y(f);if(m)return clearTimeout(c),c=setTimeout(w,t),g(f)}return c===void 0&&(c=setTimeout(w,t)),s}return O.cancel=_,O.flush=C,O}function TU(){this.__data__=new li,this.size=0}function MU(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function DU(e){return this.__data__.get(e)}function LU(e){return this.__data__.has(e)}var qU=200;function PU(e,t){var n=this.__data__;if(n instanceof li){var r=n.__data__;if(!Wo||r.lengthc))return!1;var d=u.get(e),h=u.get(t);if(d&&h)return d==t&&h==e;var m=-1,v=!0,g=n&NU?new rs:void 0;for(u.set(e,t),u.set(t,e);++m-1&&e%1==0&&e{e.exports=r()})(lI,function n(){var r=typeof self<"u"?self:typeof window<"u"?window:r!==void 0?r:{},i,u=!r.document&&!!r.postMessage,s=r.IS_PAPA_WORKER||!1,c={},f=0,d={};function h(M){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(T){var L=O(T);L.chunkSize=parseInt(L.chunkSize),T.step||T.chunk||(L.chunkSize=null),this._handle=new S(L),(this._handle.streamer=this)._config=L}).call(this,M),this.parseChunk=function(T,L){var P=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0=this._config.preview),s)r.postMessage({results:j,workerId:d.WORKER_ID,finished:P});else if(D(this._config.chunk)&&!L){if(this._config.chunk(j,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=j=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(j.data),this._completeResults.errors=this._completeResults.errors.concat(j.errors),this._completeResults.meta=j.meta),this._completed||!P||!D(this._config.complete)||j&&j.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),P||j&&j.meta.paused||this._nextChunk(),j}this._halted=!0},this._sendError=function(T){D(this._config.error)?this._config.error(T):s&&this._config.error&&r.postMessage({workerId:d.WORKER_ID,error:T,finished:!1})}}function m(M){var T;(M=M||{}).chunkSize||(M.chunkSize=d.RemoteChunkSize),h.call(this,M),this._nextChunk=u?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(L){this._input=L,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(T=new XMLHttpRequest,this._config.withCredentials&&(T.withCredentials=this._config.withCredentials),u||(T.onload=k(this._chunkLoaded,this),T.onerror=k(this._chunkError,this)),T.open(this._config.downloadRequestBody?"POST":"GET",this._input,!u),this._config.downloadRequestHeaders){var L,P=this._config.downloadRequestHeaders;for(L in P)T.setRequestHeader(L,P[L])}var j;this._config.chunkSize&&(j=this._start+this._config.chunkSize-1,T.setRequestHeader("Range","bytes="+this._start+"-"+j));try{T.send(this._config.downloadRequestBody)}catch(q){this._chunkError(q.message)}u&&T.status===0&&this._chunkError()}},this._chunkLoaded=function(){T.readyState===4&&(T.status<200||400<=T.status?this._chunkError():(this._start+=this._config.chunkSize||T.responseText.length,this._finished=!this._config.chunkSize||this._start>=(L=>(L=L.getResponseHeader("Content-Range"))!==null?parseInt(L.substring(L.lastIndexOf("/")+1)):-1)(T),this.parseChunk(T.responseText)))},this._chunkError=function(L){L=T.statusText||L,this._sendError(new Error(L))}}function v(M){(M=M||{}).chunkSize||(M.chunkSize=d.LocalChunkSize),h.call(this,M);var T,L,P=typeof FileReader<"u";this.stream=function(j){this._input=j,L=j.slice||j.webkitSlice||j.mozSlice,P?((T=new FileReader).onload=k(this._chunkLoaded,this),T.onerror=k(this._chunkError,this)):T=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(j.target.result)},this._chunkError=function(){this._sendError(T.error)}}function g(M){var T;h.call(this,M=M||{}),this.stream=function(L){return T=L,this._nextChunk()},this._nextChunk=function(){var L,P;if(!this._finished)return L=this._config.chunkSize,T=L?(P=T.substring(0,L),T.substring(L)):(P=T,""),this._finished=!T,this.parseChunk(P)}}function y(M){h.call(this,M=M||{});var T=[],L=!0,P=!1;this.pause=function(){h.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){h.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(j){this._input=j,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){P&&T.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),T.length?this.parseChunk(T.shift()):L=!0},this._streamData=k(function(j){try{T.push(typeof j=="string"?j:j.toString(this._config.encoding)),L&&(L=!1,this._checkIsFinished(),this.parseChunk(T.shift()))}catch(q){this._streamError(q)}},this),this._streamError=k(function(j){this._streamCleanUp(),this._sendError(j)},this),this._streamEnd=k(function(){this._streamCleanUp(),P=!0,this._streamData("")},this),this._streamCleanUp=k(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function S(M){var T,L,P,j,q=Math.pow(2,53),F=-q,N=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,$=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,H=this,K=0,ne=0,W=!1,Z=!1,X=[],Y={data:[],errors:[],meta:{}};function I(oe){return M.skipEmptyLines==="greedy"?oe.join("").trim()==="":oe.length===1&&oe[0].length===0}function ae(){if(Y&&P&&(ie("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+d.DefaultDelimiter+"'"),P=!1),M.skipEmptyLines&&(Y.data=Y.data.filter(function(me){return!I(me)})),se()){let me=function(Ee,Ce){D(M.transformHeader)&&(Ee=M.transformHeader(Ee,Ce)),X.push(Ee)};if(Y)if(Array.isArray(Y.data[0])){for(var oe=0;se()&&oe(te=>(M.dynamicTypingFunction&&M.dynamicTyping[te]===void 0&&(M.dynamicTyping[te]=M.dynamicTypingFunction(te)),(M.dynamicTyping[te]||M.dynamicTyping)===!0))(fe)?G==="true"||G==="TRUE"||G!=="false"&&G!=="FALSE"&&((te=>{if(N.test(te)&&(te=parseFloat(te),F=X.length?"__parsed_extra":X[Te]:U,ce=M.transform?M.transform(ce,U):ce);U==="__parsed_extra"?(Ce[U]=Ce[U]||[],Ce[U].push(ce)):Ce[U]=ce}return M.header&&(Te>X.length?ie("FieldMismatch","TooManyFields","Too many fields: expected "+X.length+" fields but parsed "+Te,ne+Ee):TeM.preview?L.abort():(Y.data=Y.data[0],j(Y,H))))}),this.parse=function(oe,V,ue){var me=M.quoteChar||'"',me=(M.newline||(M.newline=this.guessLineEndings(oe,me)),P=!1,M.delimiter?D(M.delimiter)&&(M.delimiter=M.delimiter(oe),Y.meta.delimiter=M.delimiter):((me=((Ee,Ce,Te,U,ce)=>{var fe,G,te,re;ce=ce||[","," ","|",";",d.RECORD_SEP,d.UNIT_SEP];for(var de=0;de=ue.length/2?`\r +`:"\r"}}function x(M){return M.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function w(M){var T=(M=M||{}).delimiter,L=M.newline,P=M.comments,j=M.step,q=M.preview,F=M.fastMode,N=null,$=M.quoteChar==null?'"':M.quoteChar,H=$;if(M.escapeChar!==void 0&&(H=M.escapeChar),(typeof T!="string"||-1=q)return be(!0);break}V.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:oe.length,index:K}),fe++}}else if(P&&ue.length===0&&W.substring(K,K+se)===P){if(U===-1)return be();K=U+ae,U=W.indexOf(L,K),Te=W.indexOf(T,K)}else if(Te!==-1&&(Te=q)return be(!0)}return de();function te(Le){oe.push(Le),me=K}function re(Le){var Fe=0;return Fe=Le!==-1&&(Le=W.substring(fe+1,Le))&&Le.trim()===""?Le.length:Fe}function de(Le){return X||(Le===void 0&&(Le=W.substring(K)),ue.push(Le),K=Y,te(ue),ie&&De()),be()}function _e(Le){K=Le,te(ue),ue=[],U=W.indexOf(L,K)}function be(Le){if(M.header&&!Z&&oe.length){var Fe=oe[0],je={},Ne=new Set(Fe);let ot=!1;for(let ut=0;utP.charCodeAt(0)!==65279?P:P.slice(1))(M),L=new(T.download?m:g)(T)):M.readable===!0&&D(M.read)&&D(M.on)?L=new y(T):(r.File&&M instanceof File||M instanceof Object)&&(L=new v(T)),L.stream(M);(L=(()=>{var P;return!!d.WORKERS_SUPPORTED&&(P=(()=>{var j=r.URL||r.webkitURL||null,q=n.toString();return d.BLOB_URL||(d.BLOB_URL=j.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",q,")();"],{type:"text/javascript"})))})(),(P=new r.Worker(P)).onmessage=b,P.id=f++,c[P.id]=P)})()).userStep=T.step,L.userChunk=T.chunk,L.userComplete=T.complete,L.userError=T.error,T.step=D(T.step),T.chunk=D(T.chunk),T.complete=D(T.complete),T.error=D(T.error),delete T.worker,L.postMessage({input:M,config:T,workerId:L.id})},d.unparse=function(M,T){var L=!1,P=!0,j=",",q=`\r +`,F='"',N=F+F,$=!1,H=null,K=!1,ne=((()=>{if(typeof T=="object"){if(typeof T.delimiter!="string"||d.BAD_DELIMITERS.filter(function(X){return T.delimiter.indexOf(X)!==-1}).length||(j=T.delimiter),typeof T.quotes!="boolean"&&typeof T.quotes!="function"&&!Array.isArray(T.quotes)||(L=T.quotes),typeof T.skipEmptyLines!="boolean"&&typeof T.skipEmptyLines!="string"||($=T.skipEmptyLines),typeof T.newline=="string"&&(q=T.newline),typeof T.quoteChar=="string"&&(F=T.quoteChar),typeof T.header=="boolean"&&(P=T.header),Array.isArray(T.columns)){if(T.columns.length===0)throw new Error("Option columns is empty");H=T.columns}T.escapeChar!==void 0&&(N=T.escapeChar+F),T.escapeFormulae instanceof RegExp?K=T.escapeFormulae:typeof T.escapeFormulae=="boolean"&&T.escapeFormulae&&(K=/^[=+\-@\t\r].*$/)}})(),new RegExp(x(F),"g"));if(typeof M=="string"&&(M=JSON.parse(M)),Array.isArray(M)){if(!M.length||Array.isArray(M[0]))return W(null,M,$);if(typeof M[0]=="object")return W(H||Object.keys(M[0]),M,$)}else if(typeof M=="object")return typeof M.data=="string"&&(M.data=JSON.parse(M.data)),Array.isArray(M.data)&&(M.fields||(M.fields=M.meta&&M.meta.fields||H),M.fields||(M.fields=Array.isArray(M.data[0])?M.fields:typeof M.data[0]=="object"?Object.keys(M.data[0]):[]),Array.isArray(M.data[0])||typeof M.data[0]=="object"||(M.data=[M.data])),W(M.fields||[],M.data||[],$);throw new Error("Unable to serialize unrecognized input");function W(X,Y,I){var ae="",se=(typeof X=="string"&&(X=JSON.parse(X)),typeof Y=="string"&&(Y=JSON.parse(Y)),Array.isArray(X)&&0{for(var oe=0;oei?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var u=Array(i);++rMI(e,"name",{value:t,configurable:!0}),zL=R.createContext({}),DI=ee(({children:e,isProvided:t,...n})=>{let{replace:r}=Nn(),i=ee(async f=>{var d;try{return await((d=n.login)==null?void 0:d.call(n,f))}catch(h){return Promise.reject(h)}},"loginFunc"),u=ee(async f=>{var d;try{return await((d=n.register)==null?void 0:d.call(n,f))}catch(h){return Promise.reject(h)}},"registerFunc"),s=ee(async f=>{var d;try{return await((d=n.logout)==null?void 0:d.call(n,f))}catch(h){return Promise.reject(h)}},"logoutFunc"),c=ee(async f=>{var d;try{return await((d=n.checkAuth)==null?void 0:d.call(n,f)),Promise.resolve()}catch(h){return h!=null&&h.redirectPath&&r(h.redirectPath),Promise.reject(h)}},"checkAuthFunc");return R.createElement(zL.Provider,{value:{...n,login:i,logout:s,checkAuth:c,register:u,isProvided:t}},e)},"LegacyAuthContextProvider"),$L=R.createContext({}),LI=ee(({children:e,isProvided:t,...n})=>{let r=ee(async d=>{var h;try{return await((h=n.login)==null?void 0:h.call(n,d))}catch(m){return console.warn("Unhandled Error in login: refine always expects a resolved promise.",m),Promise.reject(m)}},"handleLogin"),i=ee(async d=>{var h;try{return await((h=n.register)==null?void 0:h.call(n,d))}catch(m){return console.warn("Unhandled Error in register: refine always expects a resolved promise.",m),Promise.reject(m)}},"handleRegister"),u=ee(async d=>{var h;try{return await((h=n.logout)==null?void 0:h.call(n,d))}catch(m){return console.warn("Unhandled Error in logout: refine always expects a resolved promise.",m),Promise.reject(m)}},"handleLogout"),s=ee(async d=>{var h;try{let m=await((h=n.check)==null?void 0:h.call(n,d));return Promise.resolve(m)}catch(m){return console.warn("Unhandled Error in check: refine always expects a resolved promise.",m),Promise.reject(m)}},"handleCheck"),c=ee(async d=>{var h;try{let m=await((h=n.forgotPassword)==null?void 0:h.call(n,d));return Promise.resolve(m)}catch(m){return console.warn("Unhandled Error in forgotPassword: refine always expects a resolved promise.",m),Promise.reject(m)}},"handleForgotPassword"),f=ee(async d=>{var h;try{let m=await((h=n.updatePassword)==null?void 0:h.call(n,d));return Promise.resolve(m)}catch(m){return console.warn("Unhandled Error in updatePassword: refine always expects a resolved promise.",m),Promise.reject(m)}},"handleUpdatePassword");return R.createElement($L.Provider,{value:{...n,login:r,logout:u,check:s,register:i,forgotPassword:c,updatePassword:f,isProvided:t}},e)},"AuthBindingsContextProvider"),Nr=ee(()=>R.useContext(zL),"useLegacyAuthContext"),Jr=ee(()=>R.useContext($L),"useAuthBindingsContext"),qg=ee(e=>e/1e3,"userFriendlySecond"),qI=ee((e,t=n=>n)=>{let[n,...r]=e;return r.map(i=>cU(hU(n,i))).map((i,u,s)=>t.call(void 0,i,u,s))},"importCSVMapper"),PI=ee((e="",t)=>{let n=eq(e);return t==="singular"?_d.singular(n):_d.plural(n)},"userFriendlyResourceName");ee((e={})=>e!=null&&e.id?{...e,id:decodeURIComponent(e.id)}:e,"handleUseParams");function da(e,t){return e.findIndex((n,r)=>r<=e.length-t.length&&t.every((i,u)=>e[r+u]===i))}ee(da,"arrayFindIndex");function UL(e){if(e[0]==="data"){let t=e.slice(1);if(t[2]==="many")t[2]="getMany";else if(t[2]==="infinite")t[2]="list";else if(t[2]==="one")t[2]="detail";else if(t[1]==="custom"){let n={...t[2]};return delete n.method,delete n.url,[t[0],t[1],t[2].method,t[2].url,n]}return t}if(e[0]==="audit"&&e[2]==="list")return["logList",e[1],e[3]];if(e[0]==="access"&&e.length===4)return["useCan",{resource:e[1],action:e[2],...e[3]}];if(e[0]==="auth"){if(da(e,["auth","login"])!==-1)return["useLogin"];if(da(e,["auth","logout"])!==-1)return["useLogout"];if(da(e,["auth","identity"])!==-1)return["getUserIdentity"];if(da(e,["auth","register"])!==-1)return["useRegister"];if(da(e,["auth","forgotPassword"])!==-1)return["useForgotPassword"];if(da(e,["auth","check"])!==-1)return["useAuthenticated",e[2]];if(da(e,["auth","onError"])!==-1)return["useCheckError"];if(da(e,["auth","permissions"])!==-1)return["usePermissions"];if(da(e,["auth","updatePassword"])!==-1)return["useUpdatePassword"]}return e}ee(UL,"convertToLegacy");var mr=class{constructor(e=[]){this.segments=[],this.segments=e}key(){return this.segments}legacy(){return UL(this.segments)}get(e){return e?this.legacy():this.segments}};ee(mr,"BaseKeyBuilder");var si=class extends mr{params(e){return new mr([...this.segments,e])}};ee(si,"ParamsKeyBuilder");var BL=class extends mr{id(e){return new si([...this.segments,e?String(e):void 0])}};ee(BL,"DataIdRequiringKeyBuilder");var IL=class extends mr{ids(...e){return new si([...this.segments,...e.length?[e.map(t=>String(t))]:[]])}};ee(IL,"DataIdsRequiringKeyBuilder");var HL=class extends mr{action(e){if(e==="one")return new BL([...this.segments,e]);if(e==="many")return new IL([...this.segments,e]);if(["list","infinite"].includes(e))return new si([...this.segments,e]);throw new Error("Invalid action type")}};ee(HL,"DataResourceKeyBuilder");var VL=class extends mr{resource(e){return new HL([...this.segments,e])}mutation(e){return new si([...e==="custom"?this.segments:[this.segments[0]],e])}};ee(VL,"DataKeyBuilder");var KL=class extends mr{action(e){return new si([...this.segments,e])}};ee(KL,"AuthKeyBuilder");var WL=class extends mr{action(e){return new si([...this.segments,e])}};ee(WL,"AccessResourceKeyBuilder");var QL=class extends mr{resource(e){return new WL([...this.segments,e])}};ee(QL,"AccessKeyBuilder");var GL=class extends mr{action(e){return new si([...this.segments,e])}};ee(GL,"AuditActionKeyBuilder");var YL=class extends mr{resource(e){return new GL([...this.segments,e])}action(e){return new si([...this.segments,e])}};ee(YL,"AuditKeyBuilder");var XL=class extends mr{data(e){return new VL(["data",e||"default"])}auth(){return new KL(["auth"])}access(){return new QL(["access"])}audit(){return new YL(["audit"])}};ee(XL,"KeyBuilder");var ql=ee(()=>new XL([]),"keys"),Pe=ee((...e)=>e.find(t=>typeof t<"u"),"pickNotDeprecated");ee((e,t,n,r)=>{let i=t||"default",u={all:[i],resourceAll:[i,e||""],list:s=>[...u.resourceAll,"list",{...s,...Pe(n,r)||{}}],many:s=>[...u.resourceAll,"getMany",s==null?void 0:s.map(String),{...Pe(n,r)||{}}].filter(c=>c!==void 0),detail:s=>[...u.resourceAll,"detail",s==null?void 0:s.toString(),{...Pe(n,r)||{}}],logList:s=>["logList",e,s,r].filter(c=>c!==void 0)};return u},"queryKeys");var th=ee(e=>(t,n,r,i)=>{let u=n||"default";return{all:ql().data(u).get(e),resourceAll:ql().data(n).resource(t??"").get(e),list:s=>ql().data(n).resource(t??"").action("list").params({...s,...Pe(r,i)||{}}).get(e),many:s=>ql().data(n).resource(t??"").action("many").ids(...s??[]).params({...Pe(r,i)||{}}).get(e),detail:s=>ql().data(n).resource(t??"").action("one").id(s??"").params({...Pe(r,i)||{}}).get(e),logList:s=>[...ql().audit().resource(t).action("list").params(s).get(e),i].filter(c=>c!==void 0)}},"queryKeysReplacement"),jI=ee((e,t)=>!e||!t?!1:!!e.find(n=>n===t),"hasPermission"),Vx=ee(e=>e.startsWith(":"),"isParameter"),as=ee(e=>e.split("/").filter(t=>t!==""),"splitToSegments"),FI=ee((e,t)=>{let n=as(e),r=as(t);return n.length===r.length},"isSegmentCountsSame"),ri=ee(e=>e.replace(/^\/|\/$/g,""),"removeLeadingTrailingSlashes"),NI=ee((e,t)=>{let n=ri(e),r=ri(t);if(!FI(n,r))return!1;let i=as(n);return as(r).every((u,s)=>Vx(u)||u===i[s])},"checkBySegments"),zI=ee((e,t,n)=>{let r=ri(n||""),i=`${r}${r?"/":""}${e}`;return t==="list"?i=`${i}`:t==="create"?i=`${i}/create`:t==="edit"?i=`${i}/edit/:id`:t==="show"?i=`${i}/show/:id`:t==="clone"&&(i=`${i}/clone/:id`),`/${i.replace(/^\//,"")}`},"getDefaultActionPath"),Ji=ee((e,t)=>{var n,r;let i=Pe((n=e.meta)==null?void 0:n.parent,(r=e.options)==null?void 0:r.parent,e.parentName);return i?t.find(u=>(u.identifier??u.name)===i)??{name:i}:void 0},"getParentResource"),ZL=ee((e,t,n)=>{let r=[],i=Ji(e,t);for(;i;)r.push(i),i=Ji(i,t);if(r.length!==0)return`/${r.reverse().map(u=>{var s;let c=n?((s=u.options)==null?void 0:s.route)??u.name:u.name;return ri(c)}).join("/")}`},"getParentPrefixForResource"),fr=ee((e,t,n)=>{let r=[],i=["list","show","edit","create","clone"],u=ZL(e,t,n);return i.forEach(s=>{var c,f;let d=n&&s==="clone"?e.create:e[s],h;typeof d=="function"||n?h=zI(n?((c=e.meta)==null?void 0:c.route)??((f=e.options)==null?void 0:f.route)??e.name:e.name,s,n?u:void 0):typeof d=="string"?h=d:typeof d=="object"&&(h=d.path),h&&r.push({action:s,resource:e,route:`/${h.replace(/^\//,"")}`})}),r},"getActionRoutesFromResource"),$I=ee(e=>{var t;if(e.length===0)return;if(e.length===1)return e[0];let n=e.map(u=>({...u,splitted:as(ri(u.route))})),r=((t=n[0])==null?void 0:t.splitted.length)??0,i=[...n];for(let u=0;u!Vx(c.splitted[u]));if(s.length!==0){if(s.length===1){i=s;break}i=s}}return i[0]},"pickMatchedRoute"),JL=ee((e,t)=>{let n=t.flatMap(i=>fr(i,t)).filter(i=>NI(e,i.route)),r=$I(n);return{found:!!r,resource:r==null?void 0:r.resource,action:r==null?void 0:r.action,matchedRoute:r==null?void 0:r.route}},"matchResourceFromRoute"),UI=ee((e,t)=>{var n;let r,i=ZL(e,t,!0);if(i){let u=Pe(e.meta,e.options);r=`${i}/${(u==null?void 0:u.route)??e.name}`}else r=((n=e.options)==null?void 0:n.route)??e.name;return`/${r.replace(/^\//,"")}`},"routeGenerator");ee(e=>{var t;let n=[],r={},i={},u,s;for(let c=0;c(e=e.replace(/([a-z]{1})([A-Z]{1})/g,"$1-$2"),e=e.replace(/([A-Z]{1})([A-Z]{1})([a-z]{1})/g,"$1-$2$3"),e=e.toLowerCase().replace(/[_-]+/g," ").replace(/\s{2,}/g," ").trim(),e=e.charAt(0).toUpperCase()+e.slice(1),e),"humanizeString"),tq=ee(({children:e})=>R.createElement("div",null,e),"DefaultLayout"),BI={icon:R.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-testid":"refine-logo",id:"refine-default-logo"},R.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.7889 0.422291C12.6627 -0.140764 11.3373 -0.140764 10.2111 0.422291L2.21115 4.42229C0.85601 5.09986 0 6.48491 0 8V16C0 17.5151 0.85601 18.9001 2.21115 19.5777L10.2111 23.5777C11.3373 24.1408 12.6627 24.1408 13.7889 23.5777L21.7889 19.5777C23.144 18.9001 24 17.5151 24 16V8C24 6.48491 23.144 5.09986 21.7889 4.42229L13.7889 0.422291ZM8 8C8 5.79086 9.79086 4 12 4C14.2091 4 16 5.79086 16 8V16C16 18.2091 14.2091 20 12 20C9.79086 20 8 18.2091 8 16V8Z",fill:"currentColor"}),R.createElement("path",{d:"M14 8C14 9.10457 13.1046 10 12 10C10.8954 10 10 9.10457 10 8C10 6.89543 10.8954 6 12 6C13.1046 6 14 6.89543 14 8Z",fill:"currentColor"})),text:"Refine Project"},$n={mutationMode:"pessimistic",syncWithLocation:!1,undoableTimeout:5e3,warnWhenUnsavedChanges:!1,liveMode:"off",redirect:{afterCreate:"list",afterClone:"list",afterEdit:"list"},overtime:{enabled:!0,interval:1e3},textTransformers:{humanize:eq,plural:_d.plural,singular:_d.singular},disableServerSideValidation:!1,title:BI},oi=R.createContext({hasDashboard:!1,mutationMode:"pessimistic",warnWhenUnsavedChanges:!1,syncWithLocation:!1,undoableTimeout:5e3,Title:void 0,Sider:void 0,Header:void 0,Footer:void 0,Layout:tq,OffLayoutArea:void 0,liveMode:"off",onLiveEvent:void 0,options:$n}),II=ee(({hasDashboard:e,mutationMode:t,warnWhenUnsavedChanges:n,syncWithLocation:r,undoableTimeout:i,children:u,DashboardPage:s,Title:c,Layout:f=tq,Header:d,Sider:h,Footer:m,OffLayoutArea:v,LoginPage:g=t6,catchAll:y,liveMode:S="off",onLiveEvent:x,options:w})=>R.createElement(oi.Provider,{value:{__initialized:!0,hasDashboard:e,mutationMode:t,warnWhenUnsavedChanges:n,syncWithLocation:r,Title:c,undoableTimeout:i,Layout:f,Header:d,Sider:h,Footer:m,OffLayoutArea:v,DashboardPage:s,LoginPage:g,catchAll:y,liveMode:S,onLiveEvent:x,options:w}},u),"RefineContextProvider"),HI=ee(({options:e,disableTelemetry:t,liveMode:n,mutationMode:r,reactQueryClientConfig:i,reactQueryDevtoolConfig:u,syncWithLocation:s,undoableTimeout:c,warnWhenUnsavedChanges:f}={})=>{var d,h,m,v,g,y,S,x,w,b,_,C;let O={breadcrumb:e==null?void 0:e.breadcrumb,mutationMode:(e==null?void 0:e.mutationMode)??r??$n.mutationMode,undoableTimeout:(e==null?void 0:e.undoableTimeout)??c??$n.undoableTimeout,syncWithLocation:(e==null?void 0:e.syncWithLocation)??s??$n.syncWithLocation,warnWhenUnsavedChanges:(e==null?void 0:e.warnWhenUnsavedChanges)??f??$n.warnWhenUnsavedChanges,liveMode:(e==null?void 0:e.liveMode)??n??$n.liveMode,redirect:{afterCreate:((d=e==null?void 0:e.redirect)==null?void 0:d.afterCreate)??$n.redirect.afterCreate,afterClone:((h=e==null?void 0:e.redirect)==null?void 0:h.afterClone)??$n.redirect.afterClone,afterEdit:((m=e==null?void 0:e.redirect)==null?void 0:m.afterEdit)??$n.redirect.afterEdit},overtime:(e==null?void 0:e.overtime)??$n.overtime,textTransformers:{humanize:((v=e==null?void 0:e.textTransformers)==null?void 0:v.humanize)??$n.textTransformers.humanize,plural:((g=e==null?void 0:e.textTransformers)==null?void 0:g.plural)??$n.textTransformers.plural,singular:((y=e==null?void 0:e.textTransformers)==null?void 0:y.singular)??$n.textTransformers.singular},disableServerSideValidation:(e==null?void 0:e.disableServerSideValidation)??$n.disableServerSideValidation,projectId:e==null?void 0:e.projectId,useNewQueryKeys:e==null?void 0:e.useNewQueryKeys,title:{icon:typeof((S=e==null?void 0:e.title)==null?void 0:S.icon)>"u"?$n.title.icon:(x=e==null?void 0:e.title)==null?void 0:x.icon,text:typeof((w=e==null?void 0:e.title)==null?void 0:w.text)>"u"?$n.title.text:(b=e==null?void 0:e.title)==null?void 0:b.text}},k=(e==null?void 0:e.disableTelemetry)??t??!1,D={clientConfig:((_=e==null?void 0:e.reactQuery)==null?void 0:_.clientConfig)??i??{},devtoolConfig:((C=e==null?void 0:e.reactQuery)==null?void 0:C.devtoolConfig)??u??{}};return{optionsWithDefaults:O,disableTelemetryWithDefault:k,reactQueryWithDefaults:D}},"handleRefineOptions"),VI=ee(({redirectFromProps:e,action:t,redirectOptions:n})=>{if(e||e===!1)return e;switch(t){case"clone":return n.afterClone;case"create":return n.afterCreate;case"edit":return n.afterEdit;default:return!1}},"redirectPage"),rA=ee(async(e,t,n)=>{let r=[];for(let[i,u]of e.entries())try{let s=await u();r.push(t(s,i))}catch(s){r.push(n(s,i))}return r},"sequentialPromises"),Un=ee((e,t=[],n=!1)=>{if(!e)return;if(n)return t.find(u=>ri(u.route??"")===ri(e))||t.find(u=>u.name===e);let r=t.find(i=>i.identifier===e);return r||(r=t.find(i=>i.name===e)),r},"pickResource"),dt=ee((e,t,n)=>{if(t)return t;let r=Un(e,n),i=Pe(r==null?void 0:r.meta,r==null?void 0:r.options);return i!=null&&i.dataProviderName?i.dataProviderName:"default"},"pickDataProvider"),nh=ee(async e=>({data:(await Promise.all(e)).map(t=>t.data)}),"handleMultiple"),KI=ee(e=>{let{pagination:t,cursor:n}=e;if(n!=null&&n.next)return n.next;let r=(t==null?void 0:t.current)||1,i=(t==null?void 0:t.pageSize)||10,u=Math.ceil((e.total||0)/i);return r{let{pagination:t,cursor:n}=e;if(n!=null&&n.prev)return n.prev;let r=(t==null?void 0:t.current)||1;return r===1?void 0:r-1},"getPreviousPageParam"),QI=ee(e=>{let t=[];return e.forEach(n=>{var r,i;t.push({...n,label:((r=n.meta)==null?void 0:r.label)??((i=n.options)==null?void 0:i.label),route:UI(n,e),canCreate:!!n.create,canEdit:!!n.edit,canShow:!!n.show,canDelete:n.canDelete})}),t},"legacyResourceTransform"),GI=ee(e=>as(ri(e)).flatMap(t=>Vx(t)?[t.slice(1)]:[]),"pickRouteParams"),YI=ee((e,t={})=>e.reduce((n,r)=>{let i=t[r];return typeof i<"u"&&(n[r]=i),n},{}),"prepareRouteParams"),Tr=ee((e,t={},n={},r={})=>{let i=GI(e),u=YI(i,{...t,...typeof(n==null?void 0:n.id)<"u"?{id:n.id}:{},...typeof(n==null?void 0:n.action)<"u"?{action:n.action}:{},...typeof(n==null?void 0:n.resource)<"u"?{resource:n.resource}:{},...n==null?void 0:n.params,...r});return e.replace(/:([^\/]+)/g,(s,c)=>{let f=u[c];return typeof f<"u"?`${f}`:s})},"composeRoute"),vn=ee(()=>{let e=Nr(),t=Jr();return t.isProvided?{isLegacy:!1,...t}:e.isProvided?{isLegacy:!0,...e,check:e.checkAuth,onError:e.checkError,getIdentity:e.getUserIdentity}:null},"useActiveAuthProvider"),nq=ee(({hasPagination:e,pagination:t,configPagination:n}={})=>{let r=e===!1?"off":"server",i=(t==null?void 0:t.mode)??r,u=Pe(t==null?void 0:t.current,n==null?void 0:n.current)??1,s=Pe(t==null?void 0:t.pageSize,n==null?void 0:n.pageSize)??10;return{current:u,pageSize:s,mode:i}},"handlePaginationParams"),aA=ee(e=>{let[t,n]=Q.useState(!1);return Q.useEffect(()=>{let r=window.matchMedia(e);r.matches!==t&&n(r.matches);let i=ee(()=>n(r.matches),"listener");return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[t,e]),t},"useMediaQuery"),Pg=ee((e,t,n,r)=>{let i=r?e(t,r,n):e(t,n);return i===t||typeof i>"u"?n??t:i},"safeTranslate");function rq(e,t,n,r,i){var u;let s={create:"Create new ",clone:`#${r??""} Clone `,edit:`#${r??""} Edit `,show:`#${r??""} Show `,list:""},c=(t==null?void 0:t.identifier)??(t==null?void 0:t.name),f=(t==null?void 0:t.label)??((u=t==null?void 0:t.meta)==null?void 0:u.label)??PI(c,n==="list"?"plural":"singular"),d=i??f,h=Pg(e,"documentTitle.default","Refine"),m=Pg(e,"documentTitle.suffix"," | Refine"),v=h;return n&&c&&(v=Pg(e,`documentTitle.${c}.${n}`,`${s[n]??""}${d}${m}`,{id:r})),v}ee(rq,"generateDefaultDocumentTitle");var Xl=ee((e,t)=>{let{mutationMode:n,undoableTimeout:r}=Q.useContext(oi);return{mutationMode:e??n,undoableTimeout:t??r}},"useMutationMode"),aq=R.createContext({}),XI=ee(({children:e})=>{let[t,n]=Q.useState(!1);return R.createElement(aq.Provider,{value:{warnWhen:t,setWarnWhen:n}},e)},"UnsavedWarnContextProvider"),Zl=ee(()=>{let{warnWhenUnsavedChanges:e}=Q.useContext(oi),{warnWhen:t,setWarnWhen:n}=Q.useContext(aq);return{warnWhenUnsavedChanges:e,warnWhen:!!t,setWarnWhen:n??(()=>{})}},"useWarnAboutChange"),ZI=ee(()=>{let{syncWithLocation:e}=Q.useContext(oi);return{syncWithLocation:e}},"useSyncWithLocation"),JI=ee(()=>{let{Title:e}=Q.useContext(oi);return e},"useTitle"),cn=ee(()=>{let{Footer:e,Header:t,Layout:n,OffLayoutArea:r,Sider:i,Title:u,hasDashboard:s,mutationMode:c,syncWithLocation:f,undoableTimeout:d,warnWhenUnsavedChanges:h,DashboardPage:m,LoginPage:v,catchAll:g,options:y,__initialized:S}=Q.useContext(oi);return{__initialized:S,Footer:e,Header:t,Layout:n,OffLayoutArea:r,Sider:i,Title:u,hasDashboard:s,mutationMode:c,syncWithLocation:f,undoableTimeout:d,warnWhenUnsavedChanges:h,DashboardPage:m,LoginPage:v,catchAll:g,options:y}},"useRefineContext"),Ea=ee(()=>{let{options:{textTransformers:e}}=cn();return ee((t="",n)=>{let r=e.humanize(t);return n==="singular"?e.singular(r):e.plural(r)},"getFriendlyName")},"useUserFriendlyName"),iA=ee(e=>typeof e=="object"&&e!==null,"isNested"),e5=ee(e=>Array.isArray(e),"isArray"),Ad=ee((e,t="")=>iA(e)?Object.keys(e).reduce((n,r)=>{let i=t.length?`${t}.`:"";return iA(e[r])&&Object.keys(e[r]).length&&(e5(e[r])&&e[r].length?e[r].forEach((u,s)=>{Object.assign(n,Ad(u,`${i+r}.${s}`))}):Object.assign(n,Ad(e[r],i+r))),n[i+r]=e[r],n},{}):{[t]:e},"flattenObjectKeys");ee(e=>e.split(".").map(t=>Number.isNaN(Number(t))?t:Number(t)),"propertyPathToArray");var t5=ee((e,t,n)=>{if(typeof window>"u")return;let r=new Blob([t],{type:n}),i=document.createElement("a");i.setAttribute("visibility","hidden"),i.download=e;let u=URL.createObjectURL(r);i.href=u,document.body.appendChild(i),i.click(),document.body.removeChild(i),setTimeout(()=>{URL.revokeObjectURL(u)})},"downloadInBrowser"),lA=ee(e=>{setTimeout(e,0)},"deferExecution"),n5=ee((e,t=1e3,n)=>{let r=[],i=ee(()=>{r.forEach(c=>{var f;return(f=c.reject)==null?void 0:f.call(c,n)}),r=[]},"cancelPrevious"),u=AL((...c)=>{let{resolve:f,reject:d}=r.pop()||{};Promise.resolve(e(...c)).then(f).catch(d)},t),s=ee((...c)=>new Promise((f,d)=>{i(),r.push({resolve:f,reject:d}),u(...c)}),"runner");return s.flush=()=>u.flush(),s.cancel=()=>{u.cancel(),i()},s},"asyncDebounce"),Kl=ee(e=>{let t={queryKey:e.queryKey,pageParam:e.pageParam};return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>e.signal}),t},"prepareQueryContext"),iq=ee(e=>{let{current:t,pageSize:n,sorter:r,sorters:i,filters:u}=ya.parse(e.substring(1));return{parsedCurrent:t&&Number(t),parsedPageSize:n&&Number(n),parsedSorter:Pe(i,r)??[],parsedFilters:u??[]}},"parseTableParams");ee(e=>{let t=ya.stringify(e);return iq(`/${t}`)},"parseTableParamsFromQuery");var uA=ee(e=>{let t={skipNulls:!0,arrayFormat:"indices",encode:!1},{pagination:n,sorter:r,sorters:i,filters:u,...s}=e;return ya.stringify({...s,...n||{},sorters:Pe(i,r),filters:u},t)},"stringifyTableParams"),lq=ee((e,t)=>e.operator!=="and"&&e.operator!=="or"&&t.operator!=="and"&&t.operator!=="or"?("field"in e?e.field:void 0)===("field"in t?t.field:void 0)&&e.operator===t.operator:("key"in e?e.key:void 0)===("key"in t?t.key:void 0)&&e.operator===t.operator,"compareFilters"),uq=ee((e,t)=>e.field===t.field,"compareSorters"),qf=ee((e,t,n=[])=>(t.filter(r=>(r.operator==="or"||r.operator==="and")&&!r.key).length>1&&va(!0,`[conditionalFilters]: You have created multiple Conditional Filters at the top level, this requires the key parameter. +For more information, see https://refine.dev/docs/advanced-tutorials/data-provider/handling-filters/#top-level-multiple-conditional-filters-usage`),Cd(e,t,n,lq).filter(r=>r.value!==void 0&&r.value!==null&&(r.operator!=="or"||r.operator==="or"&&r.value.length!==0)&&(r.operator!=="and"||r.operator==="and"&&r.value.length!==0))),"unionFilters"),sA=ee((e,t)=>Cd(e,t,uq).filter(n=>n.order!==void 0&&n.order!==null),"unionSorters"),oA=ee((e,t)=>[...Wi(t,e,lq),...e],"setInitialFilters"),cA=ee((e,t)=>[...Wi(t,e,uq),...e],"setInitialSorters");ee((e,t)=>{if(!t)return;let n=t.find(r=>r.field===e);if(n)return n.order},"getDefaultSortOrder");ee((e,t,n="eq")=>{let r=t==null?void 0:t.find(i=>{if(i.operator!=="or"&&i.operator!=="and"&&"field"in i){let{operator:u,field:s}=i;return s===e&&u===n}});if(r)return r.value||[]},"getDefaultFilter");ee(e=>new Promise((t,n)=>{let r=new FileReader,i=ee(()=>{r.result&&(r.removeEventListener("load",i,!1),t(r.result))},"resultHandler");r.addEventListener("load",i,!1),r.readAsDataURL(e.originFileObj),r.onerror=u=>(r.removeEventListener("load",i,!1),n(u))}),"file2Base64");var Dt=ee(()=>{let{options:{useNewQueryKeys:e}}=cn();return{keys:ql,preferLegacyKeys:!e}},"useKeys");function r5({v3LegacyAuthProviderCompatible:e=!1,options:t,params:n}={}){let{getPermissions:r}=Nr(),{getPermissions:i}=Jr(),{keys:u,preferLegacyKeys:s}=Dt(),c=Pr({queryKey:u().auth().action("permissions").get(s),queryFn:i?()=>i(n):()=>Promise.resolve(void 0),enabled:!e&&!!i,...e?{}:t,meta:{...e?{}:t==null?void 0:t.meta,...ht()}}),f=Pr({queryKey:[...u().auth().action("permissions").get(s),"v3LegacyAuthProviderCompatible"],queryFn:r?()=>r(n):()=>Promise.resolve(void 0),enabled:e&&!!r,...e?t:{},meta:{...e?t==null?void 0:t.meta:{},...ht()}});return e?f:c}ee(r5,"usePermissions");function rh({v3LegacyAuthProviderCompatible:e=!1,queryOptions:t}={}){let{getUserIdentity:n}=Nr(),{getIdentity:r}=Jr(),{keys:i,preferLegacyKeys:u}=Dt(),s=Pr({queryKey:i().auth().action("identity").get(u),queryFn:r??(()=>Promise.resolve({})),enabled:!e&&!!r,retry:!1,...e===!0?{}:t,meta:{...e===!0?{}:t==null?void 0:t.meta,...ht()}}),c=Pr({queryKey:[...i().auth().action("identity").get(u),"v3LegacyAuthProviderCompatible"],queryFn:n??(()=>Promise.resolve({})),enabled:e&&!!n,retry:!1,...e?t:{},meta:{...e?t==null?void 0:t.meta:{},...ht()}});return e?c:s}ee(rh,"useGetIdentity");var Kx=ee(()=>{let e=xa(),{keys:t,preferLegacyKeys:n}=Dt();return ee(async()=>{await Promise.all(["check","identity","permissions"].map(r=>e.invalidateQueries(t().auth().action(r).get(n))))},"invalidate")},"useInvalidateAuthStore");function Rd({v3LegacyAuthProviderCompatible:e,mutationOptions:t}={}){let n=Kx(),r=Ot(),i=Fn(),{push:u}=Nn(),{open:s,close:c}=Jl(),{logout:f}=Nr(),{logout:d}=Jr(),{keys:h,preferLegacyKeys:m}=Dt(),v=tn({mutationKey:h().auth().action("logout").get(m),mutationFn:d,onSuccess:async(y,S)=>{let{success:x,error:w,redirectTo:b,successNotification:_}=y,{redirectPath:C}=S??{},O=C??b;x&&(c==null||c("useLogout-error"),_&&(s==null||s(a5(_)))),(w||!x)&&(s==null||s(jg(w))),O!==!1&&(r==="legacy"?u(O??"/login"):O&&i({to:O})),await n()},onError:y=>{s==null||s(jg(y))},...e===!0?{}:t,meta:{...e===!0?{}:t==null?void 0:t.meta,...ht()}}),g=tn({mutationKey:[...h().auth().action("logout").get(m),"v3LegacyAuthProviderCompatible"],mutationFn:f,onSuccess:async(y,S)=>{let x=(S==null?void 0:S.redirectPath)??y;if(x!==!1){if(x){r==="legacy"?u(x):i({to:x});return}r==="legacy"?u("/login"):i({to:"/login"}),await n()}},onError:y=>{s==null||s(jg(y))},...e?t:{},meta:{...e?t==null?void 0:t.meta:{},...ht()}});return e?g:v}ee(Rd,"useLogout");var jg=ee(e=>({key:"useLogout-error",type:"error",message:(e==null?void 0:e.name)||"Logout Error",description:(e==null?void 0:e.message)||"Something went wrong during logout"}),"buildNotification"),a5=ee(e=>({message:e.message,description:e.description,key:"logout-success",type:"success"}),"buildSuccessNotification");function Wx({v3LegacyAuthProviderCompatible:e,mutationOptions:t}={}){let n=Kx(),r=Ot(),i=Fn(),{replace:u}=Nn(),s=ar(),{useLocation:c}=_n(),{search:f}=c(),{close:d,open:h}=Jl(),{login:m}=Nr(),{login:v}=Jr(),{keys:g,preferLegacyKeys:y}=Dt(),S=R.useMemo(()=>{var b;return r==="legacy"?ya.parse(f,{ignoreQueryPrefix:!0}).to:(b=s.params)==null?void 0:b.to},[r,s.params,f]),x=tn({mutationKey:g().auth().action("login").get(y),mutationFn:v,onSuccess:async({success:b,redirectTo:_,error:C,successNotification:O})=>{b&&(d==null||d("login-error"),O&&(h==null||h(i5(O)))),(C||!b)&&(h==null||h(Fg(C))),S&&b?r==="legacy"?u(S):i({to:S,type:"replace"}):_?r==="legacy"?u(_):i({to:_,type:"replace"}):r==="legacy"&&u("/"),setTimeout(()=>{n()},32)},onError:b=>{h==null||h(Fg(b))},...e===!0?{}:t,meta:{...e===!0?{}:t==null?void 0:t.meta,...ht()}}),w=tn({mutationKey:[...g().auth().action("login").get(y),"v3LegacyAuthProviderCompatible"],mutationFn:m,onSuccess:async b=>{S&&u(S),b!==!1&&!S&&(typeof b=="string"?r==="legacy"?u(b):i({to:b,type:"replace"}):r==="legacy"?u("/"):i({to:"/",type:"replace"})),setTimeout(()=>{n()},32),d==null||d("login-error")},onError:b=>{h==null||h(Fg(b))},...e?t:{},meta:{...e?t==null?void 0:t.meta:{},...ht()}});return e?w:x}ee(Wx,"useLogin");var Fg=ee(e=>({message:(e==null?void 0:e.name)||"Login Error",description:(e==null?void 0:e.message)||"Invalid credentials",key:"login-error",type:"error"}),"buildNotification"),i5=ee(e=>({message:e.message,description:e.description,key:"login-success",type:"success"}),"buildSuccessNotification");function sq({v3LegacyAuthProviderCompatible:e,mutationOptions:t}={}){let n=Kx(),r=Ot(),i=Fn(),{replace:u}=Nn(),{register:s}=Nr(),{register:c}=Jr(),{close:f,open:d}=Jl(),{keys:h,preferLegacyKeys:m}=Dt(),v=tn({mutationKey:h().auth().action("register").get(m),mutationFn:c,onSuccess:async({success:y,redirectTo:S,error:x,successNotification:w})=>{y&&(f==null||f("register-error"),w&&(d==null||d(l5(w)))),(x||!y)&&(d==null||d(Ng(x))),S?r==="legacy"?u(S):i({to:S,type:"replace"}):r==="legacy"&&u("/"),await n()},onError:y=>{d==null||d(Ng(y))},...e===!0?{}:t,meta:{...e===!0?{}:t==null?void 0:t.meta,...ht()}}),g=tn({mutationKey:[...h().auth().action("register").get(m),"v3LegacyAuthProviderCompatible"],mutationFn:s,onSuccess:async y=>{y!==!1&&(y?r==="legacy"?u(y):i({to:y,type:"replace"}):r==="legacy"?u("/"):i({to:"/",type:"replace"}),await n(),f==null||f("register-error"))},onError:y=>{d==null||d(Ng(y))},...e?t:{},meta:{...e?t==null?void 0:t.meta:{},...ht()}});return e?g:v}ee(sq,"useRegister");var Ng=ee(e=>({message:(e==null?void 0:e.name)||"Register Error",description:(e==null?void 0:e.message)||"Error while registering",key:"register-error",type:"error"}),"buildNotification"),l5=ee(e=>({message:e.message,description:e.description,key:"register-success",type:"success"}),"buildSuccessNotification");function oq({v3LegacyAuthProviderCompatible:e,mutationOptions:t}={}){let n=Ot(),r=Fn(),{replace:i}=Nn(),{forgotPassword:u}=Nr(),{forgotPassword:s}=Jr(),{close:c,open:f}=Jl(),{keys:d,preferLegacyKeys:h}=Dt(),m=tn({mutationKey:d().auth().action("forgotPassword").get(h),mutationFn:s,onSuccess:({success:g,redirectTo:y,error:S,successNotification:x})=>{g&&(c==null||c("forgot-password-error"),x&&(f==null||f(u5(x)))),(S||!g)&&(f==null||f(zg(S))),y&&(n==="legacy"?i(y):r({to:y,type:"replace"}))},onError:g=>{f==null||f(zg(g))},...e===!0?{}:t,meta:{...e===!0?{}:t==null?void 0:t.meta,...ht()}}),v=tn({mutationKey:[...d().auth().action("forgotPassword").get(h),"v3LegacyAuthProviderCompatible"],mutationFn:u,onSuccess:g=>{g!==!1&&g&&(n==="legacy"?i(g):r({to:g,type:"replace"})),c==null||c("forgot-password-error")},onError:g=>{f==null||f(zg(g))},...e?t:{},meta:{...e?t==null?void 0:t.meta:{},...ht()}});return e?v:m}ee(oq,"useForgotPassword");var zg=ee(e=>({message:(e==null?void 0:e.name)||"Forgot Password Error",description:(e==null?void 0:e.message)||"Error while resetting password",key:"forgot-password-error",type:"error"}),"buildNotification"),u5=ee(e=>({message:e.message,description:e.description,key:"forgot-password-success",type:"success"}),"buildSuccessNotification");function cq({v3LegacyAuthProviderCompatible:e,mutationOptions:t}={}){let n=Ot(),r=Fn(),{replace:i}=Nn(),{updatePassword:u}=Nr(),{updatePassword:s}=Jr(),{close:c,open:f}=Jl(),{keys:d,preferLegacyKeys:h}=Dt(),m=ar(),{useLocation:v}=_n(),{search:g}=v(),y=R.useMemo(()=>n==="legacy"?ya.parse(g,{ignoreQueryPrefix:!0})??{}:m.params??{},[g,m,n]),S=tn({mutationKey:d().auth().action("updatePassword").get(h),mutationFn:async w=>s==null?void 0:s({...y,...w}),onSuccess:({success:w,redirectTo:b,error:_,successNotification:C})=>{w&&(c==null||c("update-password-error"),C&&(f==null||f(s5(C)))),(_||!w)&&(f==null||f($g(_))),b&&(n==="legacy"?i(b):r({to:b,type:"replace"}))},onError:w=>{f==null||f($g(w))},...e===!0?{}:t,meta:{...e===!0?{}:t==null?void 0:t.meta,...ht()}}),x=tn({mutationKey:[...d().auth().action("updatePassword").get(h),"v3LegacyAuthProviderCompatible"],mutationFn:async w=>u==null?void 0:u({...y,...w}),onSuccess:w=>{w!==!1&&w&&(n==="legacy"?i(w):r({to:w,type:"replace"})),c==null||c("update-password-error")},onError:w=>{f==null||f($g(w))},...e?t:{},meta:{...e?t==null?void 0:t.meta:{},...ht()}});return e?x:S}ee(cq,"useUpdatePassword");var $g=ee(e=>({message:(e==null?void 0:e.name)||"Update Password Error",description:(e==null?void 0:e.message)||"Error while updating password",key:"update-password-error",type:"error"}),"buildNotification"),s5=ee(e=>({message:e.message,description:e.description,key:"update-password-success",type:"success"}),"buildSuccessNotification");function fq({v3LegacyAuthProviderCompatible:e=!1,params:t}={}){let{checkAuth:n}=Nr(),{check:r}=Jr(),{keys:i,preferLegacyKeys:u}=Dt(),s=Pr({queryKey:i().auth().action("check").params(t).get(u),queryFn:async()=>await(r==null?void 0:r(t))??{},retry:!1,enabled:!e,meta:{...ht()}}),c=Pr({queryKey:[...i().auth().action("check").params(t).get(u),"v3LegacyAuthProviderCompatible"],queryFn:async()=>await(n==null?void 0:n(t))??{},retry:!1,enabled:e,meta:{...ht()}});return e?c:s}ee(fq,"useIsAuthenticated");function zr({v3LegacyAuthProviderCompatible:e=!1}={}){let t=Ot(),n=Fn(),{replace:r}=Nn(),{checkError:i}=Nr(),{onError:u}=Jr(),{keys:s,preferLegacyKeys:c}=Dt(),{mutate:f}=Rd({v3LegacyAuthProviderCompatible:!!e}),{mutate:d}=Rd({v3LegacyAuthProviderCompatible:!!e}),h=tn({mutationKey:s().auth().action("onError").get(c),...u?{mutationFn:u,onSuccess:({logout:v,redirectTo:g})=>{if(v){d({redirectPath:g});return}if(g){t==="legacy"?r(g):n({to:g,type:"replace"});return}}}:{mutationFn:()=>({})},meta:{...ht()}}),m=tn({mutationKey:[...s().auth().action("onError").get(c),"v3LegacyAuthProviderCompatible"],mutationFn:i,onError:v=>{f({redirectPath:v})},meta:{...ht()}});return e?m:h}ee(zr,"useOnError");var dq=ee(()=>{let{isProvided:e}=Nr(),{isProvided:t}=Jr();return!!(t||e)},"useIsExistAuthentication"),nr=ee(({enabled:e,isLoading:t,interval:n,onInterval:r})=>{let[i,u]=Q.useState(void 0),{options:s}=cn(),{overtime:c}=s,f=n??c.interval,d=r??(c==null?void 0:c.onInterval),h=typeof e<"u"?e:typeof c.enabled<"u"?c.enabled:!0;return Q.useEffect(()=>{let m;return h&&t&&(m=setInterval(()=>{u(v=>v===void 0?f:v+f)},f)),()=>{typeof m<"u"&&clearInterval(m),u(void 0)}},[t,f,h]),Q.useEffect(()=>{d&&i&&d(i)},[i]),{elapsedTime:i}},"useLoadingOvertime"),hq=ee(({resource:e,config:t,filters:n,hasPagination:r,pagination:i,sorters:u,queryOptions:s,successNotification:c,errorNotification:f,meta:d,metaData:h,liveMode:m,onLiveEvent:v,liveParams:g,dataProviderName:y,overtimeOptions:S}={})=>{let{resources:x,resource:w,identifier:b}=st(e),_=rr(),C=Je(),O=vn(),{mutate:k}=zr({v3LegacyAuthProviderCompatible:!!(O!=null&&O.isLegacy)}),D=$r(),M=On(),{keys:T,preferLegacyKeys:L}=Dt(),P=dt(b,y,x),j=Pe(d,h),q=Pe(n,t==null?void 0:t.filters),F=Pe(u,t==null?void 0:t.sort),N=Pe(r,t==null?void 0:t.hasPagination),$=nq({pagination:i,configPagination:t==null?void 0:t.pagination,hasPagination:N}),H=$.mode==="server",K=M({resource:w,meta:j}),ne={meta:K,metaData:K,filters:q,hasPagination:H,pagination:$,sorters:F,config:{...t,sort:F}},W=(s==null?void 0:s.enabled)===void 0||(s==null?void 0:s.enabled)===!0,{getList:Z}=_(P);ah({resource:b,types:["*"],params:{meta:K,metaData:K,pagination:$,hasPagination:H,sort:F,sorters:F,filters:q,subscriptionType:"useList",...g},channel:`resources/${w==null?void 0:w.name}`,enabled:W,liveMode:m,onLiveEvent:v,dataProviderName:P,meta:{...d,dataProviderName:y}});let X=Pr({queryKey:T().data(P).resource(b??"").action("list").params({...j||{},filters:q,hasPagination:H,...H&&{pagination:$},...u&&{sorters:u},...(t==null?void 0:t.sort)&&{sort:t==null?void 0:t.sort}}).get(L),queryFn:I=>{let ae={...K,queryContext:Kl(I)};return Z({resource:(w==null?void 0:w.name)??"",pagination:$,hasPagination:H,filters:q,sort:F,sorters:F,meta:ae,metaData:ae})},...s,enabled:typeof(s==null?void 0:s.enabled)<"u"?s==null?void 0:s.enabled:!!(w!=null&&w.name),select:I=>{var ae;let se=I,{current:ie,mode:oe,pageSize:V}=$;return oe==="client"&&(se={...se,data:se.data.slice((ie-1)*V,ie*V),total:se.total}),s!=null&&s.select?(ae=s==null?void 0:s.select)==null?void 0:ae.call(s,se):se},onSuccess:I=>{var ae;(ae=s==null?void 0:s.onSuccess)==null||ae.call(s,I);let se=typeof c=="function"?c(I,ne,b):c;D(se)},onError:I=>{var ae;k(I),(ae=s==null?void 0:s.onError)==null||ae.call(s,I);let se=typeof f=="function"?f(I,ne,b):f;D(se,{key:`${b}-useList-notification`,message:C("notifications.error",{statusCode:I.statusCode},`Error (status code: ${I.statusCode})`),description:I.message,type:"error"})},meta:{...s==null?void 0:s.meta,...ht("useList",L,w==null?void 0:w.name)}}),{elapsedTime:Y}=nr({...S,isLoading:X.isFetching});return{...X,overtime:{elapsedTime:Y}}},"useList"),nl=ee(({resource:e,id:t,queryOptions:n,successNotification:r,errorNotification:i,meta:u,metaData:s,liveMode:c,onLiveEvent:f,liveParams:d,dataProviderName:h,overtimeOptions:m})=>{let{resources:v,resource:g,identifier:y}=st(e),S=rr(),x=Je(),w=vn(),{mutate:b}=zr({v3LegacyAuthProviderCompatible:!!(w!=null&&w.isLegacy)}),_=$r(),C=On(),{keys:O,preferLegacyKeys:k}=Dt(),D=Pe(u,s),M=dt(y,h,v),{getOne:T}=S(M),L=C({resource:g,meta:D});ah({resource:y,types:["*"],channel:`resources/${g==null?void 0:g.name}`,params:{ids:t?[t]:[],id:t,meta:L,metaData:L,subscriptionType:"useOne",...d},enabled:typeof(n==null?void 0:n.enabled)<"u"?n==null?void 0:n.enabled:typeof(g==null?void 0:g.name)<"u"&&typeof t<"u",liveMode:c,onLiveEvent:f,dataProviderName:M,meta:{...u,dataProviderName:h}});let P=Pr({queryKey:O().data(M).resource(y??"").action("one").id(t??"").params({...D||{}}).get(k),queryFn:q=>T({resource:(g==null?void 0:g.name)??"",id:t,meta:{...L,queryContext:Kl(q)},metaData:{...L,queryContext:Kl(q)}}),...n,enabled:typeof(n==null?void 0:n.enabled)<"u"?n==null?void 0:n.enabled:typeof t<"u",onSuccess:q=>{var F;(F=n==null?void 0:n.onSuccess)==null||F.call(n,q);let N=typeof r=="function"?r(q,{id:t,...L},y):r;_(N)},onError:q=>{var F;b(q),(F=n==null?void 0:n.onError)==null||F.call(n,q);let N=typeof i=="function"?i(q,{id:t,...L},y):i;_(N,{key:`${t}-${y}-getOne-notification`,message:x("notifications.error",{statusCode:q.statusCode},`Error (status code: ${q.statusCode})`),description:q.message,type:"error"})},meta:{...n==null?void 0:n.meta,...ht("useOne",k,g==null?void 0:g.name)}}),{elapsedTime:j}=nr({...m,isLoading:P.isFetching});return{...P,overtime:{elapsedTime:j}}},"useOne"),jr=ee(({resource:e,ids:t,queryOptions:n,successNotification:r,errorNotification:i,meta:u,metaData:s,liveMode:c,onLiveEvent:f,liveParams:d,dataProviderName:h,overtimeOptions:m})=>{let{resources:v,resource:g,identifier:y}=st(e),S=rr(),x=Je(),w=vn(),{mutate:b}=zr({v3LegacyAuthProviderCompatible:!!(w!=null&&w.isLegacy)}),_=$r(),C=On(),{keys:O,preferLegacyKeys:k}=Dt(),D=Pe(u,s),M=dt(y,h,v),T=(n==null?void 0:n.enabled)===void 0||(n==null?void 0:n.enabled)===!0,{getMany:L,getOne:P}=S(M),j=C({resource:g,meta:D}),q=Array.isArray(t),F=!!(g!=null&&g.name),N=(n==null?void 0:n.enabled)===!0;va(!q&&!N,o5(t,g==null?void 0:g.name)),va(!F&&!N,c5()),ah({resource:y,types:["*"],params:{ids:t??[],meta:j,metaData:j,subscriptionType:"useMany",...d},channel:`resources/${(g==null?void 0:g.name)??""}`,enabled:T,liveMode:c,onLiveEvent:f,dataProviderName:M,meta:{...u,dataProviderName:h}});let $=Pr({queryKey:O().data(M).resource(y).action("many").ids(...t??[]).params({...D||{}}).get(k),queryFn:K=>{let ne={...j,queryContext:Kl(K)};return L?L({resource:g==null?void 0:g.name,ids:t,meta:ne,metaData:ne}):nh(t.map(W=>P({resource:g==null?void 0:g.name,id:W,meta:ne,metaData:ne})))},enabled:q&&F,...n,onSuccess:K=>{var ne;(ne=n==null?void 0:n.onSuccess)==null||ne.call(n,K);let W=typeof r=="function"?r(K,t,y):r;_(W)},onError:K=>{var ne;b(K),(ne=n==null?void 0:n.onError)==null||ne.call(n,K);let W=typeof i=="function"?i(K,t,y):i;_(W,{key:`${t[0]}-${y}-getMany-notification`,message:x("notifications.error",{statusCode:K.statusCode},`Error (status code: ${K.statusCode})`),description:K.message,type:"error"})},meta:{...n==null?void 0:n.meta,...ht("useMany",k,g==null?void 0:g.name)}}),{elapsedTime:H}=nr({...m,isLoading:$.isFetching});return{...$,overtime:{elapsedTime:H}}},"useMany"),o5=ee((e,t)=>`[useMany]: Missing "ids" prop. Expected an array of ids, but got "${typeof e}". Resource: "${t}" + +See https://refine.dev/docs/data/hooks/use-many/#ids-`,"idsWarningMessage"),c5=ee(()=>`[useMany]: Missing "resource" prop. Expected a string, but got undefined. + +See https://refine.dev/docs/data/hooks/use-many/#resource-`,"resourceWarningMessage"),f5=(e=>(e.ADD="ADD",e.REMOVE="REMOVE",e.DECREASE_NOTIFICATION_SECOND="DECREASE_NOTIFICATION_SECOND",e))(f5||{}),pq=ee(({id:e,resource:t,values:n,dataProviderName:r,successNotification:i,errorNotification:u,meta:s,metaData:c,mutationMode:f,undoableTimeout:d,onCancel:h,optimisticUpdateMap:m,invalidates:v,mutationOptions:g,overtimeOptions:y}={})=>{let{resources:S,select:x}=st(),w=xa(),b=rr(),{mutationMode:_,undoableTimeout:C}=Xl(),O=Je(),k=vn(),{mutate:D}=zr({v3LegacyAuthProviderCompatible:!!(k!=null&&k.isLegacy)}),M=cs(),{log:T}=ds(),{notificationDispatch:L}=rc(),P=$r(),j=wa(),q=On(),{options:{textTransformers:F}}=cn(),{keys:N,preferLegacyKeys:$}=Dt(),H=tn({mutationFn:({id:X=e,values:Y=n,resource:I=t,mutationMode:ae=f,undoableTimeout:se=d,onCancel:ie=h,meta:oe=s,metaData:V=c,dataProviderName:ue=r})=>{if(typeof X>"u")throw So;if(!Y)throw Pf;if(!I)throw xo;let{resource:me,identifier:Ee}=x(I),Ce=q({resource:me,meta:Pe(oe,V)}),Te=ae??_,U=se??C;return Te!=="undoable"?b(dt(Ee,ue,S)).update({resource:me.name,id:X,variables:Y,meta:Ce,metaData:Ce}):new Promise((ce,fe)=>{let G=ee(()=>{b(dt(Ee,ue,S)).update({resource:me.name,id:X,variables:Y,meta:Ce,metaData:Ce}).then(re=>ce(re)).catch(re=>fe(re))},"doMutation"),te=ee(()=>{fe({message:"mutationCancelled"})},"cancelMutation");ie&&ie(te),L({type:"ADD",payload:{id:X,resource:Ee,cancelMutation:te,doMutation:G,seconds:U,isSilent:!!ie}})})},onMutate:async({resource:X=t,id:Y=e,mutationMode:I=f,values:ae=n,dataProviderName:se=r,meta:ie=s,metaData:oe=c,optimisticUpdateMap:V=m??{list:!0,many:!0,detail:!0}})=>{if(typeof Y>"u")throw So;if(!ae)throw Pf;if(!X)throw xo;let{identifier:ue}=x(X),{gqlMutation:me,gqlQuery:Ee,...Ce}=Pe(ie,oe)??{},Te=th($)(ue,dt(ue,se,S),Ce),U=N().data(dt(ue,se,S)).resource(ue),ce=w.getQueriesData(U.get($)),fe=I??_;return await w.cancelQueries(U.get($),void 0,{silent:!0}),fe!=="pessimistic"&&(V.list&&w.setQueriesData(U.action("list").params(Ce??{}).get($),G=>{if(typeof V.list=="function")return V.list(G,ae,Y);if(!G)return null;let te=G.data.map(re=>{var de;return((de=re.id)==null?void 0:de.toString())===(Y==null?void 0:Y.toString())?{id:Y,...re,...ae}:re});return{...G,data:te}}),V.many&&w.setQueriesData(U.action("many").get($),G=>{if(typeof V.many=="function")return V.many(G,ae,Y);if(!G)return null;let te=G.data.map(re=>{var de;return((de=re.id)==null?void 0:de.toString())===(Y==null?void 0:Y.toString())&&(re={id:Y,...re,...ae}),re});return{...G,data:te}}),V.detail&&w.setQueriesData(U.action("one").id(Y).params(Ce??{}).get($),G=>typeof V.detail=="function"?V.detail(G,ae,Y):G?{...G,data:{...G.data,...ae}}:null)),{previousQueries:ce,queryKey:Te}},onSettled:(X,Y,I,ae)=>{var se;let{id:ie=e,resource:oe=t,dataProviderName:V=r,invalidates:ue=v??["list","many","detail"]}=I;if(typeof ie>"u")throw So;if(!oe)throw xo;let{identifier:me}=x(oe);j({resource:me,dataProviderName:dt(me,V,S),invalidates:ue,id:ie}),L({type:"REMOVE",payload:{id:ie,resource:me}}),(se=g==null?void 0:g.onSettled)==null||se.call(g,X,Y,I,ae)},onSuccess:(X,Y,I)=>{var ae,se;let{id:ie=e,resource:oe=t,successNotification:V=i,dataProviderName:ue=r,values:me=n,meta:Ee=s,metaData:Ce=c}=Y;if(typeof ie>"u")throw So;if(!me)throw Pf;if(!oe)throw xo;let{resource:Te,identifier:U}=x(oe),ce=F.singular(U),fe=dt(U,ue,S),G=q({resource:Te,meta:Pe(Ee,Ce)}),te=typeof V=="function"?V(X,{id:ie,values:me},U):V;P(te,{key:`${ie}-${U}-notification`,description:O("notifications.success","Successful"),message:O("notifications.editSuccess",{resource:O(`${U}.${U}`,ce)},`Successfully updated ${ce}`),type:"success"}),M==null||M({channel:`resources/${Te.name}`,type:"updated",payload:{ids:(ae=X.data)!=null&&ae.id?[X.data.id]:void 0},date:new Date,meta:{...G,dataProviderName:fe}});let re;if(I){let Le=w.getQueryData(I.queryKey.detail(ie));re=Object.keys(me||{}).reduce((Fe,je)=>{var Ne;return Fe[je]=(Ne=Le==null?void 0:Le.data)==null?void 0:Ne[je],Fe},{})}let{fields:de,operation:_e,variables:be,...De}=G||{};T==null||T.mutate({action:"update",resource:Te.name,data:me,previousData:re,meta:{id:ie,dataProviderName:fe,...De}}),(se=g==null?void 0:g.onSuccess)==null||se.call(g,X,Y,I)},onError:(X,Y,I)=>{var ae;let{id:se=e,resource:ie=t,errorNotification:oe=u,values:V=n}=Y;if(typeof se>"u")throw So;if(!V)throw Pf;if(!ie)throw xo;let{identifier:ue}=x(ie);if(I)for(let me of I.previousQueries)w.setQueryData(me[0],me[1]);if(X.message!=="mutationCancelled"){D==null||D(X);let me=F.singular(ue),Ee=typeof oe=="function"?oe(X,{id:se,values:V},ue):oe;P(Ee,{key:`${se}-${ue}-notification`,message:O("notifications.editError",{resource:O(`${ue}.${ue}`,me),statusCode:X.statusCode},`Error when updating ${me} (status code: ${X.statusCode})`),description:X.message,type:"error"})}(ae=g==null?void 0:g.onError)==null||ae.call(g,X,Y,I)},mutationKey:N().data().mutation("update").get($),...g,meta:{...g==null?void 0:g.meta,...ht()}}),{mutate:K,mutateAsync:ne,...W}=H,{elapsedTime:Z}=nr({...y,isLoading:W.isLoading});return{...W,mutate:ee((X,Y)=>K(X||{},Y),"handleMutation"),mutateAsync:ee((X,Y)=>ne(X||{},Y),"handleMutateAsync"),overtime:{elapsedTime:Z}}},"useUpdate"),xo=new Error("[useUpdate]: `resource` is not defined or not matched but is required"),So=new Error("[useUpdate]: `id` is not defined but is required in edit and clone actions"),Pf=new Error("[useUpdate]: `values` is not provided but is required"),mq=ee(({resource:e,values:t,dataProviderName:n,successNotification:r,errorNotification:i,invalidates:u,meta:s,metaData:c,mutationOptions:f,overtimeOptions:d}={})=>{let h=vn(),{mutate:m}=zr({v3LegacyAuthProviderCompatible:!!(h!=null&&h.isLegacy)}),v=rr(),g=wa(),{resources:y,select:S}=st(),x=Je(),w=cs(),{log:b}=ds(),_=$r(),C=On(),{options:{textTransformers:O}}=cn(),{keys:k,preferLegacyKeys:D}=Dt(),M=tn({mutationFn:({resource:q=e,values:F=t,meta:N=s,metaData:$=c,dataProviderName:H=n})=>{if(!F)throw Bg;if(!q)throw Ug;let{resource:K,identifier:ne}=S(q),W=C({resource:K,meta:Pe(N,$)});return v(dt(ne,H,y)).create({resource:K.name,variables:F,meta:W,metaData:W})},onSuccess:(q,F,N)=>{var $,H,K;let{resource:ne=e,successNotification:W=r,dataProviderName:Z=n,invalidates:X=u??["list","many"],values:Y=t,meta:I=s,metaData:ae=c}=F;if(!Y)throw Bg;if(!ne)throw Ug;let{resource:se,identifier:ie}=S(ne),oe=O.singular(ie),V=dt(ie,Z,y),ue=C({resource:se,meta:Pe(I,ae)}),me=typeof W=="function"?W(q,Y,ie):W;_(me,{key:`create-${ie}-notification`,message:x("notifications.createSuccess",{resource:x(`${ie}.${ie}`,oe)},`Successfully created ${oe}`),description:x("notifications.success","Success"),type:"success"}),g({resource:ie,dataProviderName:V,invalidates:X}),w==null||w({channel:`resources/${se.name}`,type:"created",payload:{ids:($=q==null?void 0:q.data)!=null&&$.id?[q.data.id]:void 0},date:new Date,meta:{...ue,dataProviderName:V}});let{fields:Ee,operation:Ce,variables:Te,...U}=ue||{};b==null||b.mutate({action:"create",resource:se.name,data:Y,meta:{dataProviderName:V,id:((H=q==null?void 0:q.data)==null?void 0:H.id)??void 0,...U}}),(K=f==null?void 0:f.onSuccess)==null||K.call(f,q,F,N)},onError:(q,F,N)=>{var $;let{resource:H=e,errorNotification:K=i,values:ne=t}=F;if(!ne)throw Bg;if(!H)throw Ug;m(q);let{identifier:W}=S(H),Z=O.singular(W),X=typeof K=="function"?K(q,ne,W):K;_(X,{key:`create-${W}-notification`,description:q.message,message:x("notifications.createError",{resource:x(`${W}.${W}`,Z),statusCode:q.statusCode},`There was an error creating ${Z} (status code: ${q.statusCode})`),type:"error"}),($=f==null?void 0:f.onError)==null||$.call(f,q,F,N)},mutationKey:k().data().mutation("create").get(D),...f,meta:{...f==null?void 0:f.meta,...ht()}}),{mutate:T,mutateAsync:L,...P}=M,{elapsedTime:j}=nr({...d,isLoading:P.isLoading});return{...P,mutate:ee((q,F)=>T(q||{},F),"handleMutation"),mutateAsync:ee((q,F)=>L(q||{},F),"handleMutateAsync"),overtime:{elapsedTime:j}}},"useCreate"),Ug=new Error("[useCreate]: `resource` is not defined or not matched but is required"),Bg=new Error("[useCreate]: `values` is not provided but is required"),gq=ee(({mutationOptions:e,overtimeOptions:t}={})=>{let n=vn(),{mutate:r}=zr({v3LegacyAuthProviderCompatible:!!(n!=null&&n.isLegacy)}),i=rr(),{resources:u,select:s}=st(),c=xa(),{mutationMode:f,undoableTimeout:d}=Xl(),{notificationDispatch:h}=rc(),m=Je(),v=cs(),{log:g}=ds(),y=$r(),S=wa(),x=On(),{options:{textTransformers:w}}=cn(),{keys:b,preferLegacyKeys:_}=Dt(),C=tn({mutationFn:({id:k,mutationMode:D,undoableTimeout:M,resource:T,onCancel:L,meta:P,metaData:j,dataProviderName:q,values:F})=>{let{resource:N,identifier:$}=s(T),H=x({resource:N,meta:Pe(P,j)}),K=D??f,ne=M??d;return K!=="undoable"?i(dt($,q,u)).deleteOne({resource:N.name,id:k,meta:H,metaData:H,variables:F}):new Promise((W,Z)=>{let X=ee(()=>{i(dt($,q,u)).deleteOne({resource:N.name,id:k,meta:H,metaData:H,variables:F}).then(I=>W(I)).catch(I=>Z(I))},"doMutation"),Y=ee(()=>{Z({message:"mutationCancelled"})},"cancelMutation");L&&L(Y),h({type:"ADD",payload:{id:k,resource:$,cancelMutation:Y,doMutation:X,seconds:ne,isSilent:!!L}})})},onMutate:async({id:k,resource:D,mutationMode:M,dataProviderName:T,meta:L,metaData:P})=>{let{identifier:j}=s(D),{gqlMutation:q,gqlQuery:F,...N}=Pe(L,P)??{},$=th(_)(j,dt(j,T,u),N),H=b().data(dt(j,T,u)).resource(j),K=M??f;await c.cancelQueries(H.get(_),void 0,{silent:!0});let ne=c.getQueriesData(H.get(_));return K!=="pessimistic"&&(c.setQueriesData(H.action("list").params(N??{}).get(_),W=>W?{data:W.data.filter(Z=>{var X;return((X=Z.id)==null?void 0:X.toString())!==k.toString()}),total:W.total-1}:null),c.setQueriesData(H.action("many").get(_),W=>{if(!W)return null;let Z=W.data.filter(X=>{var Y;return((Y=X.id)==null?void 0:Y.toString())!==(k==null?void 0:k.toString())});return{...W,data:Z}})),{previousQueries:ne,queryKey:$}},onSettled:(k,D,{id:M,resource:T,dataProviderName:L,invalidates:P=["list","many"]})=>{let{identifier:j}=s(T);S({resource:j,dataProviderName:dt(j,L,u),invalidates:P}),h({type:"REMOVE",payload:{id:M,resource:j}})},onSuccess:(k,{id:D,resource:M,successNotification:T,dataProviderName:L,meta:P,metaData:j},q)=>{let{resource:F,identifier:N}=s(M),$=w.singular(N),H=dt(N,L,u),K=x({resource:F,meta:Pe(P,j)});c.removeQueries(q==null?void 0:q.queryKey.detail(D));let ne=typeof T=="function"?T(k,D,N):T;y(ne,{key:`${D}-${N}-notification`,description:m("notifications.success","Success"),message:m("notifications.deleteSuccess",{resource:m(`${N}.${N}`,$)},`Successfully deleted a ${$}`),type:"success"}),v==null||v({channel:`resources/${F.name}`,type:"deleted",payload:{ids:[D]},date:new Date,meta:{...K,dataProviderName:H}});let{fields:W,operation:Z,variables:X,...Y}=K||{};g==null||g.mutate({action:"delete",resource:F.name,meta:{id:D,dataProviderName:H,...Y}}),c.removeQueries(q==null?void 0:q.queryKey.detail(D))},onError:(k,{id:D,resource:M,errorNotification:T},L)=>{let{identifier:P}=s(M);if(L)for(let j of L.previousQueries)c.setQueryData(j[0],j[1]);if(k.message!=="mutationCancelled"){r(k);let j=w.singular(P),q=typeof T=="function"?T(k,D,P):T;y(q,{key:`${D}-${P}-notification`,message:m("notifications.deleteError",{resource:j,statusCode:k.statusCode},`Error (status code: ${k.statusCode})`),description:k.message,type:"error"})}},mutationKey:b().data().mutation("delete").get(_),...e,meta:{...e==null?void 0:e.meta,...ht()}}),{elapsedTime:O}=nr({...t,isLoading:C.isLoading});return{...C,overtime:{elapsedTime:O}}},"useDelete"),d5=ee(({resource:e,values:t,dataProviderName:n,successNotification:r,errorNotification:i,meta:u,metaData:s,invalidates:c,mutationOptions:f,overtimeOptions:d}={})=>{let h=rr(),{resources:m,select:v}=st(),g=Je(),y=cs(),S=$r(),x=wa(),{log:w}=ds(),b=On(),{options:{textTransformers:_}}=cn(),{keys:C,preferLegacyKeys:O}=Dt(),k=tn({mutationFn:({resource:P=e,values:j=t,meta:q=u,metaData:F=s,dataProviderName:N=n})=>{if(!j)throw Hg;if(!P)throw Ig;let{resource:$,identifier:H}=v(P),K=b({resource:$,meta:Pe(q,F)}),ne=h(dt(H,N,m));return ne.createMany?ne.createMany({resource:$.name,variables:j,meta:K,metaData:K}):nh(j.map(W=>ne.create({resource:$.name,variables:W,meta:K,metaData:K})))},onSuccess:(P,j,q)=>{var F;let{resource:N=e,successNotification:$=r,dataProviderName:H=n,invalidates:K=c??["list","many"],values:ne=t,meta:W=u,metaData:Z=s}=j;if(!ne)throw Hg;if(!N)throw Ig;let{resource:X,identifier:Y}=v(N),I=_.plural(Y),ae=dt(Y,H,m),se=b({resource:X,meta:Pe(W,Z)}),ie=typeof $=="function"?$(P,ne,Y):$;S(ie,{key:`createMany-${Y}-notification`,message:g("notifications.createSuccess",{resource:g(`${Y}.${Y}`,Y)},`Successfully created ${I}`),description:g("notifications.success","Success"),type:"success"}),x({resource:Y,dataProviderName:ae,invalidates:K});let oe=P==null?void 0:P.data.filter(Ce=>(Ce==null?void 0:Ce.id)!==void 0).map(Ce=>Ce.id);y==null||y({channel:`resources/${X.name}`,type:"created",payload:{ids:oe},date:new Date,meta:{...se,dataProviderName:ae}});let{fields:V,operation:ue,variables:me,...Ee}=se||{};w==null||w.mutate({action:"createMany",resource:X.name,data:ne,meta:{dataProviderName:ae,ids:oe,...Ee}}),(F=f==null?void 0:f.onSuccess)==null||F.call(f,P,j,q)},onError:(P,j,q)=>{var F;let{resource:N=e,errorNotification:$=i,values:H=t}=j;if(!H)throw Hg;if(!N)throw Ig;let{identifier:K}=v(N),ne=typeof $=="function"?$(P,H,K):$;S(ne,{key:`createMany-${K}-notification`,description:P.message,message:g("notifications.createError",{resource:g(`${K}.${K}`,K),statusCode:P.statusCode},`There was an error creating ${K} (status code: ${P.statusCode}`),type:"error"}),(F=f==null?void 0:f.onError)==null||F.call(f,P,j,q)},mutationKey:C().data().mutation("createMany").get(O),...f,meta:{...f==null?void 0:f.meta,...ht()}}),{mutate:D,mutateAsync:M,...T}=k,{elapsedTime:L}=nr({...d,isLoading:T.isLoading});return{...T,mutate:ee((P,j)=>D(P||{},j),"handleMutation"),mutateAsync:ee((P,j)=>M(P||{},j),"handleMutateAsync"),overtime:{elapsedTime:L}}},"useCreateMany"),Ig=new Error("[useCreateMany]: `resource` is not defined or not matched but is required"),Hg=new Error("[useCreateMany]: `values` is not provided but is required");ee(({ids:e,resource:t,values:n,dataProviderName:r,successNotification:i,errorNotification:u,meta:s,metaData:c,mutationMode:f,undoableTimeout:d,onCancel:h,optimisticUpdateMap:m,invalidates:v,mutationOptions:g,overtimeOptions:y}={})=>{let{resources:S,select:x}=st(),w=xa(),b=rr(),_=Je(),{mutationMode:C,undoableTimeout:O}=Xl(),k=vn(),{mutate:D}=zr({v3LegacyAuthProviderCompatible:!!(k!=null&&k.isLegacy)}),{notificationDispatch:M}=rc(),T=cs(),L=$r(),P=wa(),{log:j}=ds(),q=On(),{options:{textTransformers:F}}=cn(),{keys:N,preferLegacyKeys:$}=Dt(),H=tn({mutationFn:({ids:X=e,values:Y=n,resource:I=t,onCancel:ae=h,mutationMode:se=f,undoableTimeout:ie=d,meta:oe=s,metaData:V=c,dataProviderName:ue=r})=>{if(!X)throw wo;if(!Y)throw jf;if(!I)throw Eo;let{resource:me,identifier:Ee}=x(I),Ce=q({resource:me,meta:Pe(oe,V)}),Te=se??C,U=ie??O,ce=b(dt(Ee,ue,S)),fe=ee(()=>ce.updateMany?ce.updateMany({resource:me.name,ids:X,variables:Y,meta:Ce,metaData:Ce}):nh(X.map(G=>ce.update({resource:me.name,id:G,variables:Y,meta:Ce,metaData:Ce}))),"mutationFn");return Te!=="undoable"?fe():new Promise((G,te)=>{let re=ee(()=>{fe().then(_e=>G(_e)).catch(_e=>te(_e))},"doMutation"),de=ee(()=>{te({message:"mutationCancelled"})},"cancelMutation");ae&&ae(de),M({type:"ADD",payload:{id:X,resource:Ee,cancelMutation:de,doMutation:re,seconds:U,isSilent:!!ae}})})},onMutate:async({resource:X=t,ids:Y=e,values:I=n,mutationMode:ae=f,dataProviderName:se=r,meta:ie=s,metaData:oe=c,optimisticUpdateMap:V=m??{list:!0,many:!0,detail:!0}})=>{if(!Y)throw wo;if(!I)throw jf;if(!X)throw Eo;let{identifier:ue}=x(X),{gqlMutation:me,gqlQuery:Ee,...Ce}=Pe(ie,oe)??{},Te=th($)(ue,dt(ue,se,S),Ce),U=N().data(dt(ue,se,S)).resource(ue),ce=ae??C;await w.cancelQueries(U.get($),void 0,{silent:!0});let fe=w.getQueriesData(U.get($));if(ce!=="pessimistic"&&(V.list&&w.setQueriesData(U.action("list").params(Ce??{}).get($),G=>{if(typeof V.list=="function")return V.list(G,I,Y);if(!G)return null;let te=G.data.map(re=>re.id!==void 0&&Y.filter(de=>de!==void 0).map(String).includes(re.id.toString())?{...re,...I}:re);return{...G,data:te}}),V.many&&w.setQueriesData(U.action("many").get($),G=>{if(typeof V.many=="function")return V.many(G,I,Y);if(!G)return null;let te=G.data.map(re=>re.id!==void 0&&Y.filter(de=>de!==void 0).map(String).includes(re.id.toString())?{...re,...I}:re);return{...G,data:te}}),V.detail))for(let G of Y)w.setQueriesData(U.action("one").id(G).params(Ce??{}).get($),te=>{if(typeof V.detail=="function")return V.detail(te,I,G);if(!te)return null;let re={...te.data,...I};return{...te,data:re}});return{previousQueries:fe,queryKey:Te}},onSettled:(X,Y,I,ae)=>{var se;let{ids:ie=e,resource:oe=t,dataProviderName:V=r,invalidates:ue=v}=I;if(!ie)throw wo;if(!oe)throw Eo;let{identifier:me}=x(oe);P({resource:me,invalidates:ue??["list","many"],dataProviderName:dt(me,V,S)}),ie.forEach(Ee=>P({resource:me,invalidates:ue??["detail"],dataProviderName:dt(me,V,S),id:Ee})),M({type:"REMOVE",payload:{id:ie,resource:me}}),(se=g==null?void 0:g.onSettled)==null||se.call(g,X,Y,I,ae)},onSuccess:(X,Y,I)=>{var ae;let{ids:se=e,resource:ie=t,values:oe=n,meta:V=s,metaData:ue=c,dataProviderName:me=r,successNotification:Ee=i}=Y;if(!se)throw wo;if(!oe)throw jf;if(!ie)throw Eo;let{resource:Ce,identifier:Te}=x(ie),U=F.singular(Te),ce=dt(Te,me,S),fe=q({resource:Ce,meta:Pe(V,ue)}),G=typeof Ee=="function"?Ee(X,{ids:se,values:oe},Te):Ee;L(G,{key:`${se}-${Te}-notification`,description:_("notifications.success","Successful"),message:_("notifications.editSuccess",{resource:_(`${Te}.${Te}`,Te)},`Successfully updated ${U}`),type:"success"}),T==null||T({channel:`resources/${Ce.name}`,type:"updated",payload:{ids:se.map(String)},date:new Date,meta:{...fe,dataProviderName:ce}});let te=[];I&&se.forEach(De=>{let Le=w.getQueryData(I.queryKey.detail(De));te.push(Object.keys(oe||{}).reduce((Fe,je)=>{var Ne;return Fe[je]=(Ne=Le==null?void 0:Le.data)==null?void 0:Ne[je],Fe},{}))});let{fields:re,operation:de,variables:_e,...be}=fe||{};j==null||j.mutate({action:"updateMany",resource:Ce.name,data:oe,previousData:te,meta:{ids:se,dataProviderName:ce,...be}}),(ae=g==null?void 0:g.onSuccess)==null||ae.call(g,X,Y,I)},onError:(X,Y,I)=>{var ae;let{ids:se=e,resource:ie=t,errorNotification:oe=u,values:V=n}=Y;if(!se)throw wo;if(!V)throw jf;if(!ie)throw Eo;let{identifier:ue}=x(ie);if(I)for(let me of I.previousQueries)w.setQueryData(me[0],me[1]);if(X.message!=="mutationCancelled"){D==null||D(X);let me=F.singular(ue),Ee=typeof oe=="function"?oe(X,{ids:se,values:V},ue):oe;L(Ee,{key:`${se}-${ue}-updateMany-error-notification`,message:_("notifications.editError",{resource:me,statusCode:X.statusCode},`Error when updating ${me} (status code: ${X.statusCode})`),description:X.message,type:"error"})}(ae=g==null?void 0:g.onError)==null||ae.call(g,X,Y,I)},mutationKey:N().data().mutation("updateMany").get($),...g,meta:{...g==null?void 0:g.meta,...ht()}}),{mutate:K,mutateAsync:ne,...W}=H,{elapsedTime:Z}=nr({...y,isLoading:W.isLoading});return{...W,mutate:ee((X,Y)=>K(X||{},Y),"handleMutation"),mutateAsync:ee((X,Y)=>ne(X||{},Y),"handleMutateAsync"),overtime:{elapsedTime:Z}}},"useUpdateMany");var Eo=new Error("[useUpdateMany]: `resource` is not defined or not matched but is required"),wo=new Error("[useUpdateMany]: `id` is not defined but is required in edit and clone actions"),jf=new Error("[useUpdateMany]: `values` is not provided but is required");ee(({mutationOptions:e,overtimeOptions:t}={})=>{let n=vn(),{mutate:r}=zr({v3LegacyAuthProviderCompatible:!!(n!=null&&n.isLegacy)}),{mutationMode:i,undoableTimeout:u}=Xl(),s=rr(),{notificationDispatch:c}=rc(),f=Je(),d=cs(),h=$r(),m=wa(),{log:v}=ds(),{resources:g,select:y}=st(),S=xa(),x=On(),{options:{textTransformers:w}}=cn(),{keys:b,preferLegacyKeys:_}=Dt(),C=tn({mutationFn:({resource:k,ids:D,mutationMode:M,undoableTimeout:T,onCancel:L,meta:P,metaData:j,dataProviderName:q,values:F})=>{let{resource:N,identifier:$}=y(k),H=x({resource:N,meta:Pe(P,j)}),K=M??i,ne=T??u,W=s(dt($,q,g)),Z=ee(()=>W.deleteMany?W.deleteMany({resource:N.name,ids:D,meta:H,metaData:H,variables:F}):nh(D.map(X=>W.deleteOne({resource:N.name,id:X,meta:H,metaData:H,variables:F}))),"mutationFn");return K!=="undoable"?Z():new Promise((X,Y)=>{let I=ee(()=>{Z().then(se=>X(se)).catch(se=>Y(se))},"doMutation"),ae=ee(()=>{Y({message:"mutationCancelled"})},"cancelMutation");L&&L(ae),c({type:"ADD",payload:{id:D,resource:$,cancelMutation:ae,doMutation:I,seconds:ne,isSilent:!!L}})})},onMutate:async({ids:k,resource:D,mutationMode:M,dataProviderName:T,meta:L,metaData:P})=>{let{identifier:j}=y(D),{gqlMutation:q,gqlQuery:F,...N}=Pe(L,P)??{},$=th(_)(j,dt(j,T,g),N),H=b().data(dt(j,T,g)).resource(j),K=M??i;await S.cancelQueries(H.get(_),void 0,{silent:!0});let ne=S.getQueriesData(H.get(_));if(K!=="pessimistic"){S.setQueriesData(H.action("list").params(N??{}).get(_),W=>W?{data:W.data.filter(Z=>Z.id&&!k.map(String).includes(Z.id.toString())),total:W.total-1}:null),S.setQueriesData(H.action("many").get(_),W=>{if(!W)return null;let Z=W.data.filter(X=>X.id?!k.map(String).includes(X.id.toString()):!1);return{...W,data:Z}});for(let W of k)S.setQueriesData(H.action("one").id(W).params(N).get(_),Z=>!Z||Z.data.id===W?null:{...Z})}return{previousQueries:ne,queryKey:$}},onSettled:(k,D,{resource:M,ids:T,dataProviderName:L,invalidates:P=["list","many"]})=>{let{identifier:j}=y(M);m({resource:j,dataProviderName:dt(j,L,g),invalidates:P}),c({type:"REMOVE",payload:{id:T,resource:j}})},onSuccess:(k,{ids:D,resource:M,meta:T,metaData:L,dataProviderName:P,successNotification:j},q)=>{let{resource:F,identifier:N}=y(M),$=dt(N,P,g),H=x({resource:F,meta:Pe(T,L)});D.forEach(Y=>S.removeQueries(q==null?void 0:q.queryKey.detail(Y)));let K=typeof j=="function"?j(k,D,N):j;h(K,{key:`${D}-${N}-notification`,description:f("notifications.success","Success"),message:f("notifications.deleteSuccess",{resource:f(`${N}.${N}`,N)},`Successfully deleted ${N}`),type:"success"}),d==null||d({channel:`resources/${F.name}`,type:"deleted",payload:{ids:D},date:new Date,meta:{...H,dataProviderName:$}});let{fields:ne,operation:W,variables:Z,...X}=H||{};v==null||v.mutate({action:"deleteMany",resource:F.name,meta:{ids:D,dataProviderName:$,...X}}),D.forEach(Y=>S.removeQueries(q==null?void 0:q.queryKey.detail(Y)))},onError:(k,{ids:D,resource:M,errorNotification:T},L)=>{let{identifier:P}=y(M);if(L)for(let j of L.previousQueries)S.setQueryData(j[0],j[1]);if(k.message!=="mutationCancelled"){r(k);let j=w.singular(P),q=typeof T=="function"?T(k,D,P):T;h(q,{key:`${D}-${P}-notification`,message:f("notifications.deleteError",{resource:j,statusCode:k.statusCode},`Error (status code: ${k.statusCode})`),description:k.message,type:"error"})}},mutationKey:b().data().mutation("deleteMany").get(_),...e,meta:{...e==null?void 0:e.meta,...ht()}}),{elapsedTime:O}=nr({...t,isLoading:C.isLoading});return{...C,overtime:{elapsedTime:O}}},"useDeleteMany");ee(e=>{var t;let n=rr(),{resource:r}=st(),{getApiUrl:i}=n(e??((t=Pe(r==null?void 0:r.meta,r==null?void 0:r.options))==null?void 0:t.dataProviderName));return i()},"useApiUrl");ee(({url:e,method:t,config:n,queryOptions:r,successNotification:i,errorNotification:u,meta:s,metaData:c,dataProviderName:f,overtimeOptions:d})=>{let h=rr(),m=vn(),{mutate:v}=zr({v3LegacyAuthProviderCompatible:!!(m!=null&&m.isLegacy)}),g=Je(),y=$r(),S=On(),{keys:x,preferLegacyKeys:w}=Dt(),b=Pe(s,c),{custom:_}=h(f),C=S({meta:b});if(_){let O=Pr({queryKey:x().data(f).mutation("custom").params({method:t,url:e,...n,...b||{}}).get(w),queryFn:D=>_({url:e,method:t,...n,meta:{...C,queryContext:Kl(D)},metaData:{...C,queryContext:Kl(D)}}),...r,onSuccess:D=>{var M;(M=r==null?void 0:r.onSuccess)==null||M.call(r,D);let T=typeof i=="function"?i(D,{...n,...C}):i;y(T)},onError:D=>{var M;v(D),(M=r==null?void 0:r.onError)==null||M.call(r,D);let T=typeof u=="function"?u(D,{...n,...C}):u;y(T,{key:`${t}-notification`,message:g("notifications.error",{statusCode:D.statusCode},`Error (status code: ${D.statusCode})`),description:D.message,type:"error"})},meta:{...r==null?void 0:r.meta,...ht()}}),{elapsedTime:k}=nr({...d,isLoading:O.isFetching});return{...O,overtime:{elapsedTime:k}}}throw Error("Not implemented custom on data provider.")},"useCustom");ee(({mutationOptions:e,overtimeOptions:t}={})=>{let n=vn(),{mutate:r}=zr({v3LegacyAuthProviderCompatible:!!(n!=null&&n.isLegacy)}),i=$r(),u=rr(),s=Je(),c=On(),{keys:f,preferLegacyKeys:d}=Dt(),h=tn(({url:v,method:g,values:y,meta:S,metaData:x,dataProviderName:w,config:b})=>{let _=c({meta:Pe(S,x)}),{custom:C}=u(w);if(C)return C({url:v,method:g,payload:y,meta:_,metaData:_,headers:{...b==null?void 0:b.headers}});throw Error("Not implemented custom on data provider.")},{onSuccess:(v,{successNotification:g,config:y,meta:S,metaData:x})=>{let w=typeof g=="function"?g(v,{...y,...Pe(S,x)||{}}):g;i(w)},onError:(v,{errorNotification:g,method:y,config:S,meta:x,metaData:w})=>{r(v);let b=typeof g=="function"?g(v,{...S,...Pe(x,w)||{}}):g;i(b,{key:`${y}-notification`,message:s("notifications.error",{statusCode:v.statusCode},`Error (status code: ${v.statusCode})`),description:v.message,type:"error"})},mutationKey:f().data().mutation("customMutation").get(d),...e,meta:{...e==null?void 0:e.meta,...ht()}}),{elapsedTime:m}=nr({...t,isLoading:h.isLoading});return{...h,overtime:{elapsedTime:m}}},"useCustomMutation");var yq={default:{}},Qx=R.createContext(yq),h5=ee(({children:e,dataProvider:t})=>{let n=yq;return t&&(!("default"in t)&&("getList"in t||"getOne"in t)?n={default:t}:n=t),R.createElement(Qx.Provider,{value:n},e)},"DataContextProvider"),rr=ee(()=>{let e=Q.useContext(Qx);return Q.useCallback(t=>{if(t){let n=e==null?void 0:e[t];if(!n)throw new Error(`"${t}" Data provider not found`);if(n&&!(e!=null&&e.default))throw new Error("If you have multiple data providers, you must provide default data provider property");return e[t]}if(e.default)return e.default;throw new Error('There is no "default" data provider. Please pass dataProviderName.')},[e])},"useDataProvider");ee(({resource:e,config:t,filters:n,hasPagination:r,pagination:i,sorters:u,queryOptions:s,successNotification:c,errorNotification:f,meta:d,metaData:h,liveMode:m,onLiveEvent:v,liveParams:g,dataProviderName:y,overtimeOptions:S})=>{let{resources:x,resource:w,identifier:b}=st(e),_=rr(),C=Je(),O=vn(),{mutate:k}=zr({v3LegacyAuthProviderCompatible:!!(O!=null&&O.isLegacy)}),D=$r(),M=On(),{keys:T,preferLegacyKeys:L}=Dt(),P=dt(b,y,x),j=Pe(d,h),q=Pe(n,t==null?void 0:t.filters),F=Pe(u,t==null?void 0:t.sort),N=Pe(r,t==null?void 0:t.hasPagination),$=nq({pagination:i,configPagination:t==null?void 0:t.pagination,hasPagination:N}),H=$.mode==="server",K={meta:j,metaData:j,filters:q,hasPagination:H,pagination:$,sorters:F,config:{...t,sort:F}},ne=(s==null?void 0:s.enabled)===void 0||(s==null?void 0:s.enabled)===!0,W=M({resource:w,meta:j}),{getList:Z}=_(P);ah({resource:b,types:["*"],params:{meta:W,metaData:W,pagination:$,hasPagination:H,sort:F,sorters:F,filters:q,subscriptionType:"useList",...g},channel:`resources/${w.name}`,enabled:ne,liveMode:m,onLiveEvent:v,dataProviderName:P,meta:{...W,dataProviderName:y}});let X=i$({queryKey:T().data(P).resource(b).action("infinite").params({...j||{},filters:q,hasPagination:H,...H&&{pagination:$},...u&&{sorters:u},...(t==null?void 0:t.sort)&&{sort:t==null?void 0:t.sort}}).get(L),queryFn:I=>{let ae={...$,current:I.pageParam},se={...W,queryContext:Kl(I)};return Z({resource:w.name,pagination:ae,hasPagination:H,filters:q,sort:F,sorters:F,meta:se,metaData:se}).then(({data:ie,total:oe,...V})=>({data:ie,total:oe,pagination:ae,...V}))},getNextPageParam:I=>KI(I),getPreviousPageParam:I=>WI(I),...s,onSuccess:I=>{var ae;(ae=s==null?void 0:s.onSuccess)==null||ae.call(s,I);let se=typeof c=="function"?c(I,K,b):c;D(se)},onError:I=>{var ae;k(I),(ae=s==null?void 0:s.onError)==null||ae.call(s,I);let se=typeof f=="function"?f(I,K,b):f;D(se,{key:`${b}-useInfiniteList-notification`,message:C("notifications.error",{statusCode:I.statusCode},`Error (status code: ${I.statusCode})`),description:I.message,type:"error"})},meta:{...s==null?void 0:s.meta,...ht("useInfiniteList",L,w==null?void 0:w.name)}}),{elapsedTime:Y}=nr({...S,isLoading:X.isFetching});return{...X,overtime:{elapsedTime:Y}}},"useInfiniteList");var ec=R.createContext({}),p5=ee(({liveProvider:e,children:t})=>R.createElement(ec.Provider,{value:{liveProvider:e}},t),"LiveContextProvider"),wa=ee(()=>{let{resources:e}=st(),t=xa(),{keys:n,preferLegacyKeys:r}=Dt();return Q.useCallback(async({resource:i,dataProviderName:u,invalidates:s,id:c,invalidationFilters:f={type:"all",refetchType:"active"},invalidationOptions:d={cancelRefetch:!1}})=>{if(s===!1)return;let h=dt(i,u,e),m=n().data(h).resource(i??"");await Promise.all(s.map(v=>{switch(v){case"all":return t.invalidateQueries(n().data(h).get(r),f,d);case"list":return t.invalidateQueries(m.action("list").get(r),f,d);case"many":return t.invalidateQueries(m.action("many").get(r),f,d);case"resourceAll":return t.invalidateQueries(m.get(r),f,d);case"detail":return t.invalidateQueries(m.action("one").id(c||"").get(r),f,d);default:return}}))},[])},"useInvalidate"),m5=ee(e=>{let t=Q.useRef(e);return hr(t.current,e)||(t.current=e),t.current},"useMemoized"),vq=ee((e,t)=>{let n=m5(t);return Q.useMemo(e,n)},"useDeepMemo"),tc=R.createContext({resources:[]}),g5=ee(({resources:e,children:t})=>{let n=vq(()=>QI(e??[]),[e]);return R.createElement(tc.Provider,{value:{resources:n}},t)},"ResourceContextProvider"),bq=R.createContext("new"),y5=bq.Provider,Ot=ee(()=>R.useContext(bq),"useRouterType"),xq={},nc=Q.createContext(xq),v5=ee(({children:e,router:t})=>R.createElement(nc.Provider,{value:t??xq},e),"RouterContextProvider"),b5=ee(()=>{let e=Q.useContext(nc);return R.useMemo(()=>(e==null?void 0:e.parse)??(()=>()=>({})),[e==null?void 0:e.parse])()},"useParse"),ar=ee(()=>{let e=b5();return R.useMemo(()=>e(),[e])},"useParsed");function st(e){let{resources:t}=Q.useContext(tc),n=Ot(),r=ar(),i={resourceName:e&&typeof e!="string"?e.resourceName:e,resourceNameOrRouteName:e&&typeof e!="string"?e.resourceNameOrRouteName:e,recordItemId:e&&typeof e!="string"?e.recordItemId:void 0},u=ee((m,v=!0)=>{let g=Un(m,t,n==="legacy");if(g)return{resource:g,identifier:g.identifier??g.name};if(v){let y={name:m,identifier:m},S=y.identifier??y.name;return{resource:y,identifier:S}}},"select"),s=x5(),{useParams:c}=_n(),f=c();if(n==="legacy"){let m=i.resourceNameOrRouteName?i.resourceNameOrRouteName:f.resource,v=m?s(m):void 0,g=(i==null?void 0:i.recordItemId)??f.id,y=f.action,S=(i==null?void 0:i.resourceName)??(v==null?void 0:v.name),x=(v==null?void 0:v.identifier)??(v==null?void 0:v.name);return{resources:t,resource:v,resourceName:S,id:g,action:y,select:u,identifier:x}}let d,h=typeof e=="string"?e:i==null?void 0:i.resourceNameOrRouteName;if(h){let m=Un(h,t);m?d=m:d={name:h}}else r!=null&&r.resource&&(d=r.resource);return{resources:t,resource:d,resourceName:d==null?void 0:d.name,id:r.id,action:r.action,select:u,identifier:(d==null?void 0:d.identifier)??(d==null?void 0:d.name)}}ee(st,"useResource");var x5=ee(()=>{let{resources:e}=Q.useContext(tc);return Q.useCallback(t=>Un(t,e,!0)||{name:t,route:t},[e])},"useResourceWithRoute"),ah=ee(({resource:e,params:t,channel:n,types:r,enabled:i=!0,liveMode:u,onLiveEvent:s,dataProviderName:c,meta:f})=>{var d;let{resource:h,identifier:m}=st(e),{liveProvider:v}=Q.useContext(ec),{liveMode:g,onLiveEvent:y}=Q.useContext(oi),S=u??g,x=wa(),w=c??(f==null?void 0:f.dataProviderName)??((d=h==null?void 0:h.meta)==null?void 0:d.dataProviderName);Q.useEffect(()=>{let b,_=ee(C=>{S==="auto"&&x({resource:m,dataProviderName:w,invalidates:["resourceAll"],invalidationFilters:{type:"active",refetchType:"active"},invalidationOptions:{cancelRefetch:!1}}),s==null||s(C),y==null||y(C)},"callback");return S&&S!=="off"&&i&&(b=v==null?void 0:v.subscribe({channel:n,params:{resource:h==null?void 0:h.name,...t},types:r,callback:_,dataProviderName:w,meta:{...f,dataProviderName:w}})),()=>{b&&(v==null||v.unsubscribe(b))}},[i])},"useResourceSubscription"),Sq=ee(e=>{let{liveMode:t}=Q.useContext(oi);return e??t},"useLiveMode");ee(({params:e,channel:t,types:n=["*"],enabled:r=!0,onLiveEvent:i,dataProviderName:u="default",meta:s})=>{let{liveProvider:c}=Q.useContext(ec);Q.useEffect(()=>{let f;return r&&(f=c==null?void 0:c.subscribe({channel:t,params:e,types:n,callback:i,dataProviderName:u,meta:{...s,dataProviderName:u}})),()=>{f&&(c==null||c.unsubscribe(f))}},[r])},"useSubscription");var cs=ee(()=>{let{liveProvider:e}=Q.useContext(ec);return e==null?void 0:e.publish},"usePublish"),Eq=Q.createContext({notifications:[],notificationDispatch:()=>!1}),S5=[],E5=ee((e,t)=>{switch(t.type){case"ADD":return[...e.filter(n=>!(hr(n.id,t.payload.id)&&n.resource===t.payload.resource)),{...t.payload,isRunning:!0}];case"REMOVE":return e.filter(n=>!(hr(n.id,t.payload.id)&&n.resource===t.payload.resource));case"DECREASE_NOTIFICATION_SECOND":return e.map(n=>hr(n.id,t.payload.id)&&n.resource===t.payload.resource?{...n,seconds:t.payload.seconds-1e3}:n);default:return e}},"undoableQueueReducer"),w5=ee(({children:e})=>{let[t,n]=Q.useReducer(E5,S5),r={notifications:t,notificationDispatch:n};return R.createElement(Eq.Provider,{value:r},e,typeof window<"u"?t.map(i=>R.createElement(C6,{key:`${i.id}-${i.resource}-queue`,notification:i})):null)},"UndoableQueueContextProvider"),rc=ee(()=>{let{notifications:e,notificationDispatch:t}=Q.useContext(Eq);return{notifications:e,notificationDispatch:t}},"useCancelNotification"),Gx=Q.createContext({}),C5=ee(({open:e,close:t,children:n})=>R.createElement(Gx.Provider,{value:{open:e,close:t}},n),"NotificationContextProvider"),Jl=ee(()=>{let{open:e,close:t}=Q.useContext(Gx);return{open:e,close:t}},"useNotification"),$r=ee(()=>{let{open:e}=Jl();return Q.useCallback((t,n)=>{t!==!1&&(t?e==null||e(t):n&&(e==null||e(n)))},[])},"useHandleNotification"),fs=R.createContext({}),_5=ee(({children:e,i18nProvider:t})=>R.createElement(fs.Provider,{value:{i18nProvider:t}},e),"I18nContextProvider"),O5=ee(()=>{let{i18nProvider:e}=Q.useContext(fs);return Q.useCallback(t=>e==null?void 0:e.changeLocale(t),[])},"useSetLocale"),Je=ee(()=>{let{i18nProvider:e}=Q.useContext(fs);return Q.useMemo(()=>{function t(n,r,i){return(e==null?void 0:e.translate(n,r,i))??i??(typeof r=="string"&&typeof i>"u"?r:n)}return ee(t,"translate"),t},[e])},"useTranslate"),A5=ee(()=>{let{i18nProvider:e}=Q.useContext(fs);return Q.useCallback(()=>e==null?void 0:e.getLocale(),[])},"useGetLocale");ee(()=>{let e=Je(),t=O5(),n=A5();return{translate:e,changeLocale:t,getLocale:n}},"useTranslation");ee(({resourceName:e,resource:t,sorter:n,sorters:r,filters:i,maxItemCount:u,pageSize:s=20,mapData:c=ee(S=>S,"mapData"),exportOptions:f,unparseConfig:d,meta:h,metaData:m,dataProviderName:v,onError:g,download:y}={})=>{let[S,x]=Q.useState(!1),w=rr(),b=On(),{resource:_,resources:C,identifier:O}=st(Pe(t,e)),k=`${Ea()(O,"plural")}-${new Date().toLocaleString()}`,{getList:D}=w(dt(O,v,C)),M=b({resource:_,meta:Pe(h,m)});return{isLoading:S,triggerExport:ee(async()=>{x(!0);let T=[],L=1,P=!0;for(;P;)try{let{data:N,total:$}=await D({resource:(_==null?void 0:_.name)??"",filters:i,sort:Pe(r,n),sorters:Pe(r,n),pagination:{current:L,pageSize:s,mode:"server"},meta:M,metaData:M});L++,T.push(...N),u&&T.length>=u&&(T=T.slice(0,u),P=!1),$===T.length&&(P=!1)}catch(N){x(!1),P=!1,g==null||g(N);return}let j=typeof d<"u"&&d!==null;va(j&&typeof f<"u"&&f!==null,`[useExport]: resource: "${O}" + +Both \`unparseConfig\` and \`exportOptions\` are set, \`unparseConfig\` will take precedence`);let q={filename:k,useKeysAsHeaders:!0,useBom:!0,title:"My Generated Report",quoteStrings:'"',...f};va((f==null?void 0:f.decimalSeparator)!==void 0,`[useExport]: resource: "${O}" + +Use of \`decimalSeparator\` no longer supported, please use \`mapData\` instead. + +See https://refine.dev/docs/api-reference/core/hooks/import-export/useExport/`),j?d={quotes:!0,...d}:d={columns:q.useKeysAsHeaders?void 0:q.headers,delimiter:q.fieldSeparator,header:q.showLabels||q.useKeysAsHeaders,quoteChar:q.quoteStrings,quotes:!0};let F=qL.unparse(T.map(c),d);if(q.showTitle&&(F=`${q.title}\r + +${F}`),typeof window<"u"&&F.length>0&&(y??!0)){let N=q.useTextFile?".txt":".csv",$=`text/${q.useTextFile?"plain":"csv"};charset=utf8;`,H=`${(q.filename??"download").replace(/ /g,"_")}${N}`;t5(H,`${q!=null&&q.useBom?"\uFEFF":""}${F}`,$)}return x(!1),F},"triggerExport")}},"useExport");var R5=ee((e={})=>{var t,n,r;let i=On(),u=wa(),{redirect:s}=uh(),{mutationMode:c}=Xl(),{setWarnWhen:f}=Zl(),d=q5(),h=Pe(e.meta,e.metaData),m=e.mutationMode??c,{id:v,setId:g,resource:y,identifier:S,formAction:x}=rl({resource:e.resource,id:e.id,action:e.action}),[w,b]=R.useState(!1),_=x==="edit",C=x==="clone",O=x==="create",k=i({resource:y,meta:h}),D=(_||C)&&!!e.resource,M=typeof e.id<"u",T=((t=e.queryOptions)==null?void 0:t.enabled)===!1;va(D&&!M&&!T,L5(x,S,v));let L=VI({redirectFromProps:e.redirect,action:x,redirectOptions:s}),P=ee((X=_?"list":"edit",Y=v,I={})=>{d({redirect:X,resource:y,id:Y,meta:{...h,...I}})},"redirect"),j=nl({resource:S,id:v,queryOptions:{enabled:!O&&v!==void 0,...e.queryOptions},liveMode:e.liveMode,onLiveEvent:e.onLiveEvent,liveParams:e.liveParams,meta:{...k,...e.queryMeta},dataProviderName:e.dataProviderName,overtimeOptions:{enabled:!1}}),q=mq({mutationOptions:e.createMutationOptions,overtimeOptions:{enabled:!1}}),F=pq({mutationOptions:e.updateMutationOptions,overtimeOptions:{enabled:!1}}),N=_?F:q,$=N.isLoading||j.isFetching,{elapsedTime:H}=nr({...e.overtimeOptions,isLoading:$});R.useEffect(()=>()=>{var X;(X=e.autoSave)!=null&&X.invalidateOnUnmount&&w&&S&&typeof v<"u"&&u({id:v,invalidates:e.invalidates||["list","many","detail"],dataProviderName:e.dataProviderName,resource:S})},[(n=e.autoSave)==null?void 0:n.invalidateOnUnmount,w]);let K=ee(async(X,{isAutosave:Y=!1}={})=>{let I=m==="pessimistic";f(!1);let ae=ee(se=>P(L,se),"onSuccessRedirect");return new Promise((se,ie)=>{if(!y)return ie(k5);if(C&&!v)return ie(T5);if(!X)return ie(M5);if(Y&&!_)return ie(D5);!I&&!Y&&(lA(()=>ae()),se());let oe={values:X,resource:S??y.name,meta:{...k,...e.mutationMeta},metaData:{...k,...e.mutationMeta},dataProviderName:e.dataProviderName,invalidates:Y?[]:e.invalidates,successNotification:Y?!1:e.successNotification,errorNotification:Y?!1:e.errorNotification,..._?{id:v??"",mutationMode:m,undoableTimeout:e.undoableTimeout,optimisticUpdateMap:e.optimisticUpdateMap}:{}},{mutateAsync:V}=_?F:q;V(oe,{onSuccess:e.onMutationSuccess?(ue,me,Ee)=>{var Ce;(Ce=e.onMutationSuccess)==null||Ce.call(e,ue,X,Ee,Y)}:void 0,onError:e.onMutationError?(ue,me,Ee)=>{var Ce;(Ce=e.onMutationError)==null||Ce.call(e,ue,X,Ee,Y)}:void 0}).then(ue=>{I&&!Y&&lA(()=>{var me;return ae((me=ue==null?void 0:ue.data)==null?void 0:me.id)}),Y&&b(!0),se(ue)}).catch(ie)})},"onFinish"),ne=n5(X=>K(X,{isAutosave:!0}),((r=e.autoSave)==null?void 0:r.debounce)||1e3,"Cancelled by debounce"),W={elapsedTime:H},Z={status:F.status,data:F.data,error:F.error};return{onFinish:K,onFinishAutoSave:ne,formLoading:$,mutationResult:N,mutation:N,queryResult:j,query:j,autoSaveProps:Z,id:v,setId:g,redirect:P,overtime:W}},"useForm"),k5=new Error("[useForm]: `resource` is not defined or not matched but is required"),T5=new Error("[useForm]: `id` is not defined but is required in edit and clone actions"),M5=new Error("[useForm]: `values` is not provided but is required"),D5=new Error("[useForm]: `autoSave` is only allowed in edit action"),L5=ee((e,t,n)=>`[useForm]: action: "${e}", resource: "${t}", id: ${n} + +If you don't use the \`setId\` method to set the \`id\`, you should pass the \`id\` prop to \`useForm\`. Otherwise, \`useForm\` will not be able to infer the \`id\` from the current URL with custom resource provided. + +See https://refine.dev/docs/data/hooks/use-form/#id-`,"idWarningMessage"),q5=ee(()=>{let{show:e,edit:t,list:n,create:r}=Nn();return Q.useCallback(({redirect:i,resource:u,id:s,meta:c={}})=>{if(i&&u)return u.show&&i==="show"&&s?e(u,s,void 0,c):u.edit&&i==="edit"&&s?t(u,s,void 0,c):u.create&&i==="create"?r(u,void 0,c):n(u,"push",c)},[])},"useRedirectionAfterSubmission"),ih=ee(()=>{let e=Q.useContext(nc);return R.useMemo(()=>(e==null?void 0:e.back)??(()=>()=>{}),[e==null?void 0:e.back])()},"useBack"),ac=ee(()=>{let e=Ot(),{resource:t,resources:n}=st(),r=ar();return R.useCallback(({resource:i,action:u,meta:s})=>{var c;let f=i||t;if(!f)return;let d=(c=fr(f,n,e==="legacy").find(h=>h.action===u))==null?void 0:c.route;return d?Tr(d,f==null?void 0:f.meta,r,s):void 0},[n,t,r])},"useGetToPath"),Fn=ee(()=>{let e=Q.useContext(nc),{select:t}=st(),n=ac(),r=R.useMemo(()=>(e==null?void 0:e.go)??(()=>()=>{}),[e==null?void 0:e.go])();return Q.useCallback(i=>{if(typeof i.to!="object")return r({...i,to:i.to});let{resource:u}=t(i.to.resource);P5(i.to,u);let s=n({resource:u,action:i.to.action,meta:{id:i.to.id,...i.to.meta}});return r({...i,to:s})},[t,r])},"useGo"),P5=ee((e,t)=>{if(!(e!=null&&e.action)||!(e!=null&&e.resource))throw new Error('[useGo]: "action" or "resource" is required.');if(["edit","show","clone"].includes(e==null?void 0:e.action)&&!e.id)throw new Error(`[useGo]: [action: ${e.action}] requires an "id" for resource [resource: ${e.resource}]`);if(!t[e.action])throw new Error(`[useGo]: [action: ${e.action}] is not defined for [resource: ${e.resource}]`)},"handleResourceErrors"),Nn=ee(()=>{let{resources:e}=st(),t=Ot(),{useHistory:n}=_n(),r=n(),i=ar(),u=Fn(),s=ih(),c=ee((g,y="push")=>{t==="legacy"?r[y](g):u({to:g,type:y})},"handleUrl"),f=ee((g,y={})=>{var S;if(t==="legacy"){let b=typeof g=="string"?Un(g,e,!0)??{name:g,route:g}:g,_=fr(b,e,!0).find(C=>C.action==="create");return _?Tr(_.route,b==null?void 0:b.meta,i,y):""}let x=typeof g=="string"?Un(g,e)??{name:g}:g,w=(S=fr(x,e).find(b=>b.action==="create"))==null?void 0:S.route;return w?u({to:Tr(w,x==null?void 0:x.meta,i,y),type:"path",query:y.query}):""},"createUrl"),d=ee((g,y,S={})=>{var x;let w=encodeURIComponent(y);if(t==="legacy"){let C=typeof g=="string"?Un(g,e,!0)??{name:g,route:g}:g,O=fr(C,e,!0).find(k=>k.action==="edit");return O?Tr(O.route,C==null?void 0:C.meta,i,{...S,id:w}):""}let b=typeof g=="string"?Un(g,e)??{name:g}:g,_=(x=fr(b,e).find(C=>C.action==="edit"))==null?void 0:x.route;return _?u({to:Tr(_,b==null?void 0:b.meta,i,{...S,id:w}),type:"path",query:S.query}):""},"editUrl"),h=ee((g,y,S={})=>{var x;let w=encodeURIComponent(y);if(t==="legacy"){let C=typeof g=="string"?Un(g,e,!0)??{name:g,route:g}:g,O=fr(C,e,!0).find(k=>k.action==="clone");return O?Tr(O.route,C==null?void 0:C.meta,i,{...S,id:w}):""}let b=typeof g=="string"?Un(g,e)??{name:g}:g,_=(x=fr(b,e).find(C=>C.action==="clone"))==null?void 0:x.route;return _?u({to:Tr(_,b==null?void 0:b.meta,i,{...S,id:w}),type:"path",query:S.query}):""},"cloneUrl"),m=ee((g,y,S={})=>{var x;let w=encodeURIComponent(y);if(t==="legacy"){let C=typeof g=="string"?Un(g,e,!0)??{name:g,route:g}:g,O=fr(C,e,!0).find(k=>k.action==="show");return O?Tr(O.route,C==null?void 0:C.meta,i,{...S,id:w}):""}let b=typeof g=="string"?Un(g,e)??{name:g}:g,_=(x=fr(b,e).find(C=>C.action==="show"))==null?void 0:x.route;return _?u({to:Tr(_,b==null?void 0:b.meta,i,{...S,id:w}),type:"path",query:S.query}):""},"showUrl"),v=ee((g,y={})=>{var S;if(t==="legacy"){let b=typeof g=="string"?Un(g,e,!0)??{name:g,route:g}:g,_=fr(b,e,!0).find(C=>C.action==="list");return _?Tr(_.route,b==null?void 0:b.meta,i,y):""}let x=typeof g=="string"?Un(g,e)??{name:g}:g,w=(S=fr(x,e).find(b=>b.action==="list"))==null?void 0:S.route;return w?u({to:Tr(w,x==null?void 0:x.meta,i,y),type:"path",query:y.query}):""},"listUrl");return{create:ee((g,y="push",S={})=>{c(f(g,S),y)},"create"),createUrl:f,edit:ee((g,y,S="push",x={})=>{c(d(g,y,x),S)},"edit"),editUrl:d,clone:ee((g,y,S="push",x={})=>{c(h(g,y,x),S)},"clone"),cloneUrl:h,show:ee((g,y,S="push",x={})=>{c(m(g,y,x),S)},"show"),showUrl:m,list:ee((g,y="push",S={})=>{c(v(g,S),y)},"list"),listUrl:v,push:ee((g,...y)=>{t==="legacy"?r.push(g,...y):u({to:g,type:"push"})},"push"),replace:ee((g,...y)=>{t==="legacy"?r.replace(g,...y):u({to:g,type:"replace"})},"replace"),goBack:ee(()=>{t==="legacy"?r.goBack():s()},"goBack")}},"useNavigation"),eu=ee(({resource:e,id:t,meta:n,metaData:r,queryOptions:i,overtimeOptions:u,...s}={})=>{let{resource:c,identifier:f,id:d,setId:h}=rl({id:t,resource:e}),m=On()({resource:c,meta:Pe(n,r)});va(!!e&&!d,j5(f,d));let v=nl({resource:f,id:d??"",queryOptions:{enabled:d!==void 0,...i},meta:m,metaData:m,overtimeOptions:u,...s});return{queryResult:v,query:v,showId:d,setShowId:h,overtime:v.overtime}},"useShow"),j5=ee((e,t)=>`[useShow]: resource: "${e}", id: ${t} + +If you don't use the \`setShowId\` method to set the \`showId\`, you should pass the \`id\` prop to \`useShow\`. Otherwise, \`useShow\` will not be able to infer the \`id\` from the current URL. + +See https://refine.dev/docs/data/hooks/use-show/#resource`,"idWarningMessage");ee(({resourceName:e,resource:t,mapData:n=ee(h=>h,"mapData"),paparseOptions:r,batchSize:i=Number.MAX_SAFE_INTEGER,onFinish:u,meta:s,metaData:c,onProgress:f,dataProviderName:d}={})=>{let[h,m]=Q.useState(0),[v,g]=Q.useState(0),[y,S]=Q.useState(!1),{resource:x,identifier:w}=st(t??e),b=On(),_=d5(),C=mq(),O=b({resource:x,meta:Pe(s,c)}),k;i===1?k=C:k=_;let D=ee(()=>{g(0),m(0),S(!1)},"handleCleanup"),M=ee(L=>{let P={succeeded:L.filter(j=>j.type==="success"),errored:L.filter(j=>j.type==="error")};u==null||u(P),S(!1)},"handleFinish");Q.useEffect(()=>{f==null||f({totalAmount:v,processedAmount:h})},[v,h]);let T=ee(({file:L})=>(D(),new Promise(P=>{S(!0),qL.parse(L,{complete:async({data:j})=>{let q=qI(j,n);if(g(q.length),i===1){let F=q.map($=>ee(async()=>({response:await C.mutateAsync({resource:w??"",values:$,successNotification:!1,errorNotification:!1,dataProviderName:d,meta:O,metaData:O}),value:$}),"fn")),N=await rA(F,({response:$,value:H})=>(m(K=>K+1),{response:[$.data],type:"success",request:[H]}),($,H)=>({response:[$],type:"error",request:[q[H]]}));P(N)}else{let F=gI(q,i),N=F.map(H=>ee(async()=>({response:await _.mutateAsync({resource:w??"",values:H,successNotification:!1,errorNotification:!1,dataProviderName:d,meta:O,metaData:O}),value:H,currentBatchLength:H.length}),"fn")),$=await rA(N,({response:H,currentBatchLength:K,value:ne})=>(m(W=>W+K),{response:H.data,type:"success",request:ne}),(H,K)=>({response:[H],type:"error",request:F[K]}));P($)}},...r})}).then(P=>(M(P),P))),"handleChange");return{inputProps:{type:"file",accept:".csv",onChange:L=>{L.target.files&&L.target.files.length>0&&T({file:L.target.files[0]})}},mutationResult:k,isLoading:y,handleChange:T}},"useImport");var F5=ee(({defaultVisible:e=!1}={})=>{let[t,n]=Q.useState(e),r=Q.useCallback(()=>n(!0),[t]),i=Q.useCallback(()=>n(!1),[t]);return{visible:t,show:r,close:i}},"useModal"),wq=ee(({resource:e,action:t,meta:n,legacy:r})=>ac()({resource:e,action:t,meta:n,legacy:r}),"useToPath"),N5=ee((e,t)=>{let n=Q.useContext(nc),r=n==null?void 0:n.Link,i=Fn(),u="";return"go"in e&&(n!=null&&n.go||va(!0,"[Link]: `routerProvider` is not found. To use `go`, Please make sure that you have provided the `routerProvider` for `` https://refine.dev/docs/routing/router-provider/ \n"),u=i({...e.go,type:"path"})),"to"in e&&(u=e.to),r?R.createElement(r,{ref:t,...e,to:u,go:void 0}):R.createElement("a",{ref:t,href:u,...e,to:void 0,go:void 0})},"LinkComponent"),z5=Q.forwardRef(N5),tu=ee(()=>z5,"useLink"),Ii={useHistory:()=>!1,useLocation:()=>!1,useParams:()=>({}),Prompt:()=>null,Link:()=>null},Yx=R.createContext(Ii),$5=ee(({children:e,useHistory:t,useLocation:n,useParams:r,Prompt:i,Link:u,routes:s})=>R.createElement(Yx.Provider,{value:{useHistory:t??Ii.useHistory,useLocation:n??Ii.useLocation,useParams:r??Ii.useParams,Prompt:i??Ii.Prompt,Link:u??Ii.Link,routes:s??Ii.routes}},e),"LegacyRouterContextProvider"),_n=ee(()=>{let e=Q.useContext(Yx),{useHistory:t,useLocation:n,useParams:r,Prompt:i,Link:u,routes:s}=e??Ii;return{useHistory:t,useLocation:n,useParams:r,Prompt:i,Link:u,routes:s}},"useRouterContext"),ic=R.createContext({options:{buttons:{enableAccessControl:!0,hideIfUnauthorized:!1}}}),U5=ee(({can:e,children:t,options:n})=>R.createElement(ic.Provider,{value:{can:e,options:n?{...n,buttons:{enableAccessControl:!0,hideIfUnauthorized:!1,...n.buttons}}:{buttons:{enableAccessControl:!0,hideIfUnauthorized:!1},queryOptions:void 0}}},t),"AccessControlContextProvider"),Xx=ee(e=>{if(!e)return;let{icon:t,list:n,edit:r,create:i,show:u,clone:s,children:c,meta:f,options:d,...h}=e,{icon:m,...v}=f??{},{icon:g,...y}=d??{};return{...h,...f?{meta:v}:{},...d?{options:y}:{}}},"sanitizeResource"),Cq=ee(({action:e,resource:t,params:n,queryOptions:r})=>{let{can:i,options:u}=Q.useContext(ic),{keys:s,preferLegacyKeys:c}=Dt(),{queryOptions:f}=u||{},d={...f,...r},{resource:h,...m}=n??{},v=Xx(h),g=Pr({queryKey:s().access().resource(t).action(e).params({params:{...m,resource:v},enabled:d==null?void 0:d.enabled}).get(c),queryFn:()=>(i==null?void 0:i({action:e,resource:t,params:{...m,resource:v}}))??Promise.resolve({can:!0}),enabled:typeof i<"u",...d,meta:{...d==null?void 0:d.meta,...ht()},retry:!1});return typeof i>"u"?{data:{can:!0}}:g},"useCan"),B5=ee(()=>{let{can:e}=R.useContext(ic);return{can:R.useMemo(()=>e?ee(async({params:t,...n})=>{let r=t!=null&&t.resource?Xx(t.resource):void 0;return e({...n,...t?{params:{...t,resource:r}}:{}})},"canWithSanitizedResource"):void 0,[e])}},"useCanWithoutCache"),I5=ee(e=>{let[t,n]=Q.useState([]),[r,i]=Q.useState([]),[u,s]=Q.useState([]),{resource:c,sort:f,sorters:d,filters:h=[],optionLabel:m="title",optionValue:v="id",searchField:g=typeof m=="string"?m:"title",debounce:y=300,successNotification:S,errorNotification:x,defaultValueQueryOptions:w,queryOptions:b,fetchSize:_,pagination:C,hasPagination:O=!1,liveMode:k,defaultValue:D=[],selectedOptionsOrder:M="in-place",onLiveEvent:T,onSearch:L,liveParams:P,meta:j,metaData:q,dataProviderName:F,overtimeOptions:N}=e,$=Q.useCallback(me=>typeof m=="string"?Od(me,m):m(me),[m]),H=Q.useCallback(me=>typeof v=="string"?Od(me,v):v(me),[v]),{resource:K,identifier:ne}=st(c),W=On()({resource:K,meta:Pe(j,q)}),Z=Array.isArray(D)?D:[D],X=Q.useCallback(me=>{s(me.data.map(Ee=>({label:$(Ee),value:H(Ee)})))},[m,v]),Y=w??b,I=jr({resource:ne,ids:Z,queryOptions:{...Y,enabled:Z.length>0&&((Y==null?void 0:Y.enabled)??!0),onSuccess:me=>{var Ee;X(me),(Ee=Y==null?void 0:Y.onSuccess)==null||Ee.call(Y,me)}},overtimeOptions:{enabled:!1},meta:W,metaData:W,liveMode:"off",dataProviderName:F}),ae=Q.useCallback(me=>{i(me.data.map(Ee=>({label:$(Ee),value:H(Ee)})))},[m,v]),se=hq({resource:ne,sorters:Pe(d,f),filters:h.concat(t),pagination:{current:C==null?void 0:C.current,pageSize:(C==null?void 0:C.pageSize)??_,mode:C==null?void 0:C.mode},hasPagination:O,queryOptions:{...b,onSuccess:me=>{var Ee;ae(me),(Ee=b==null?void 0:b.onSuccess)==null||Ee.call(b,me)}},overtimeOptions:{enabled:!1},successNotification:S,errorNotification:x,meta:W,metaData:W,liveMode:k,liveParams:P,onLiveEvent:T,dataProviderName:F}),{elapsedTime:ie}=nr({...N,isLoading:se.isFetching||I.isFetching}),oe=Q.useMemo(()=>TI(M==="in-place"?[...r,...u]:[...u,...r],"value"),[r,u]),V=Q.useRef(L),ue=Q.useMemo(()=>AL(me=>{if(V.current){n(V.current(me));return}if(!me){n([]);return}n([{field:g,operator:"contains",value:me}])},y),[g,y]);return Q.useEffect(()=>{V.current=L},[L]),{queryResult:se,defaultValueQueryResult:I,query:se,defaultValueQuery:I,options:oe,onSearch:ue,overtime:{elapsedTime:ie}}},"useSelect"),fA=[],dA=[];function _q({initialCurrent:e,initialPageSize:t,hasPagination:n=!0,pagination:r,initialSorter:i,permanentSorter:u=dA,defaultSetFilterBehavior:s,initialFilter:c,permanentFilter:f=fA,filters:d,sorters:h,syncWithLocation:m,resource:v,successNotification:g,errorNotification:y,queryOptions:S,liveMode:x,onLiveEvent:w,liveParams:b,meta:_,metaData:C,dataProviderName:O,overtimeOptions:k}={}){var D,M,T,L,P;let{syncWithLocation:j}=ZI(),q=m??j,F=Sq(x),N=Ot(),{useLocation:$}=_n(),{search:H,pathname:K}=$(),ne=On(),W=ar(),Z=((d==null?void 0:d.mode)||"server")==="server",X=((h==null?void 0:h.mode)||"server")==="server",Y=n===!1?"off":"server",I=((r==null?void 0:r.mode)??Y)!=="off",ae=Pe(r==null?void 0:r.current,e),se=Pe(r==null?void 0:r.pageSize,t),ie=Pe(_,C),{parsedCurrent:oe,parsedPageSize:V,parsedSorter:ue,parsedFilters:me}=iq(H??"?"),Ee=Pe(d==null?void 0:d.initial,c),Ce=Pe(d==null?void 0:d.permanent,f)??fA,Te=Pe(h==null?void 0:h.initial,i),U=Pe(h==null?void 0:h.permanent,u)??dA,ce=Pe(d==null?void 0:d.defaultBehavior,s)??"merge",fe,G,te,re;q?(fe=((D=W==null?void 0:W.params)==null?void 0:D.current)||oe||ae||1,G=((M=W==null?void 0:W.params)==null?void 0:M.pageSize)||V||se||10,te=((T=W==null?void 0:W.params)==null?void 0:T.sorters)||(ue.length?ue:Te),re=((L=W==null?void 0:W.params)==null?void 0:L.filters)||(me.length?me:Ee)):(fe=ae||1,G=se||10,te=Te,re=Ee);let{replace:de}=Nn(),_e=Fn(),{resource:be,identifier:De}=st(v),Le=ne({resource:be,meta:ie});R.useEffect(()=>{va(typeof De>"u","useTable: `resource` is not defined.")},[De]);let[Fe,je]=Q.useState(cA(U,te??[])),[Ne,ot]=Q.useState(oA(Ce,re??[])),[ut,yt]=Q.useState(fe),[jt,It]=Q.useState(G),Et=ee(()=>{if(N==="new"){let{sorters:wt,filters:At,pageSize:dn,current:An,...Xt}=(W==null?void 0:W.params)??{};return Xt}let{sorter:mt,filters:ve,pageSize:Ue,current:et,...at}=ya.parse(H,{ignoreQueryPrefix:!0});return at},"getCurrentQueryParams"),ye=ee(({pagination:{current:mt,pageSize:ve},sorter:Ue,filters:et})=>{if(N==="new")return _e({type:"path",options:{keepHash:!0,keepQuery:!0},query:{...I?{current:mt,pageSize:ve}:{},sorters:Ue,filters:et,...Et()}})??"";let at=ya.parse(H==null?void 0:H.substring(1)),wt=uA({pagination:{pageSize:ve,current:mt},sorters:Fe??Ue,filters:et,...at});return`${K??""}?${wt??""}`},"createLinkForSyncWithLocation");Q.useEffect(()=>{H===""&&(yt(fe),It(G),je(cA(U,te??[])),ot(oA(Ce,re??[])))},[H]),Q.useEffect(()=>{if(q){let mt=Et();if(N==="new")_e({type:"replace",options:{keepQuery:!0},query:{...I?{pageSize:jt,current:ut}:{},sorters:Wi(Fe,U,hr),filters:Wi(Ne,Ce,hr)}});else{let ve=uA({...I?{pagination:{pageSize:jt,current:ut}}:{},sorters:Wi(Fe,U,hr),filters:Wi(Ne,Ce,hr),...mt});return de==null?void 0:de(`${K}?${ve}`,void 0,{shallow:!0})}}},[q,ut,jt,Fe,Ne]);let Se=hq({resource:De,hasPagination:n,pagination:{current:ut,pageSize:jt,mode:r==null?void 0:r.mode},filters:Z?qf(Ce,Ne):void 0,sorters:X?sA(U,Fe):void 0,queryOptions:S,overtimeOptions:k,successNotification:g,errorNotification:y,meta:Le,metaData:Le,liveMode:F,liveParams:b,onLiveEvent:w,dataProviderName:O}),Ke=Q.useCallback(mt=>{ot(ve=>qf(Ce,mt,ve))},[Ce]),pt=Q.useCallback(mt=>{ot(qf(Ce,mt))},[Ce]),vt=Q.useCallback(mt=>{ot(ve=>qf(Ce,mt(ve)))},[Ce]),Ge=Q.useCallback((mt,ve=ce)=>{typeof mt=="function"?vt(mt):ve==="replace"?pt(mt):Ke(mt)},[vt,pt,Ke]),xn=Q.useCallback(mt=>{je(()=>sA(U,mt))},[U]);return{tableQueryResult:Se,tableQuery:Se,sorters:Fe,setSorters:xn,sorter:Fe,setSorter:xn,filters:Ne,setFilters:Ge,current:ut,setCurrent:yt,pageSize:jt,setPageSize:It,pageCount:jt?Math.ceil((((P=Se.data)==null?void 0:P.total)??0)/jt):1,createLinkForSyncWithLocation:ye,overtime:Se.overtime}}ee(_q,"useTable");var lh=R.createContext({}),H5=ee(({create:e,get:t,update:n,children:r})=>R.createElement(lh.Provider,{value:{create:e,get:t,update:n}},r),"AuditLogContextProvider"),ds=ee(({logMutationOptions:e,renameMutationOptions:t}={})=>{let n=xa(),r=Q.useContext(lh),{keys:i,preferLegacyKeys:u}=Dt(),s=vn(),{resources:c}=Q.useContext(tc),{data:f,refetch:d,isLoading:h}=rh({v3LegacyAuthProviderCompatible:!!(s!=null&&s.isLegacy),queryOptions:{enabled:!!(r!=null&&r.create)}}),m=tn(async g=>{var y,S,x,w,b;let _=Un(g.resource,c),C=Pe((y=_==null?void 0:_.meta)==null?void 0:y.audit,(S=_==null?void 0:_.options)==null?void 0:S.audit,(w=(x=_==null?void 0:_.options)==null?void 0:x.auditLog)==null?void 0:w.permissions);if(C&&!jI(C,g.action))return;let O;return h&&r!=null&&r.create&&(O=await d()),await((b=r.create)==null?void 0:b.call(r,{...g,author:f??(O==null?void 0:O.data)}))},{mutationKey:i().audit().action("log").get(),...e,meta:{...e==null?void 0:e.meta,...ht()}}),v=tn(async g=>{var y;return await((y=r.update)==null?void 0:y.call(r,g))},{onSuccess:g=>{g!=null&&g.resource&&n.invalidateQueries(i().audit().resource((g==null?void 0:g.resource)??"").action("list").get(u))},mutationKey:i().audit().action("rename").get(),...t,meta:{...t==null?void 0:t.meta,...ht()}});return{log:m,rename:v}},"useLog");ee(({resource:e,action:t,meta:n,author:r,metaData:i,queryOptions:u})=>{let{get:s}=Q.useContext(lh),{keys:c,preferLegacyKeys:f}=Dt();return Pr({queryKey:c().audit().resource(e).action("list").params(n).get(f),queryFn:()=>(s==null?void 0:s({resource:e,action:t,author:r,meta:n,metaData:i}))??Promise.resolve([]),enabled:typeof s<"u",...u,retry:!1,meta:{...u==null?void 0:u.meta,...ht()}})},"useLogList");var V5=ee(({meta:e={}}={})=>{let t=Ot(),{i18nProvider:n}=Q.useContext(fs),r=ar(),i=Je(),{resources:u,resource:s,action:c}=st(),{options:{textTransformers:f}}=cn(),d=[];if(!(s!=null&&s.name))return{breadcrumbs:d};let h=ee(m=>{var v,g,y,S,x,w;let b=typeof m=="string"?Un(m,u,t==="legacy")??{name:m}:m;if(b){let _=Pe((v=b==null?void 0:b.meta)==null?void 0:v.parent,b==null?void 0:b.parentName);_&&h(_);let C=fr(b,u,t==="legacy").find(D=>D.action==="list"),O=(g=C==null?void 0:C.resource)!=null&&g.list?C==null?void 0:C.route:void 0,k=O?t==="legacy"?O:Tr(O,b==null?void 0:b.meta,r,e):void 0;d.push({label:Pe((y=b.meta)==null?void 0:y.label,(S=b.options)==null?void 0:S.label)??i(`${b.name}.${b.name}`,f.humanize(b.name)),href:k,icon:Pe((x=b.meta)==null?void 0:x.icon,(w=b.options)==null?void 0:w.icon,b.icon)})}},"addBreadcrumb");if(h(s),c&&c!=="list"){let m=`actions.${c}`,v=i(m);typeof n<"u"&&v===m?(va(!0,`[useBreadcrumb]: Breadcrumb missing translate key for the "${c}" action. Please add "actions.${c}" key to your translation file. +For more information, see https://refine.dev/docs/api-reference/core/hooks/useBreadcrumb/#i18n-support`),d.push({label:i(`buttons.${c}`,f.humanize(c))})):d.push({label:i(m,f.humanize(c))})}return{breadcrumbs:d}},"useBreadcrumb"),ud=ee((e,t,n=!1)=>{let r=[],i=Ji(e,t);for(;i;)r.push(i),i=Ji(i,t);return r.reverse(),`/${[...r,e].map(u=>ri((n?u.route:void 0)??u.identifier??u.name)).join("/").replace(/^\//,"")}`},"createResourceKey"),K5=ee((e,t=!1)=>{let n={item:{name:"__root__"},children:{}};e.forEach(i=>{let u=[],s=Ji(i,e);for(;s;)u.push(s),s=Ji(s,e);u.reverse();let c=n;u.forEach(d=>{let h=(t?d.route:void 0)??d.identifier??d.name;c.children[h]||(c.children[h]={item:d,children:{}}),c=c.children[h]});let f=(t?i.route:void 0)??i.identifier??i.name;c.children[f]||(c.children[f]={item:i,children:{}})});let r=ee(i=>{let u=[];return Object.keys(i.children).forEach(s=>{let c=ud(i.children[s].item,e,t),f={...i.children[s].item,key:c,children:r(i.children[s])};u.push(f)}),u},"flatten");return r(n)},"createTree"),hA=ee(e=>e.split("?")[0].split("#")[0].replace(/(.+)(\/$)/,"$1"),"getCleanPath"),W5=ee(({meta:e,hideOnMissingParameter:t=!0}={hideOnMissingParameter:!0})=>{let n=Je(),r=ac(),i=Ot(),{resource:u,resources:s}=st(),{pathname:c}=ar(),{useLocation:f}=_n(),{pathname:d}=f(),h=Ea(),m=`/${((i==="legacy"?hA(d):c?hA(c):void 0)??"").replace(/^\//,"")}`,v=u?ud(u,s,i==="legacy"):m??"",g=R.useMemo(()=>{if(!u)return[];let x=Ji(u,s),w=[ud(u,s)];for(;x;)w.push(ud(x,s)),x=Ji(x,s);return w},[]),y=R.useCallback(x=>{var w,b,_,C,O,k;if(Pe((w=x==null?void 0:x.meta)==null?void 0:w.hide,(b=x==null?void 0:x.options)==null?void 0:b.hide)||!(x!=null&&x.list)&&x.children.length===0)return;let D=x.list?r({resource:x,action:"list",legacy:i==="legacy",meta:e}):void 0;if(!(t&&D&&D.match(/(\/|^):(.+?)(\/|$){1}/)))return{...x,route:D,icon:Pe((_=x.meta)==null?void 0:_.icon,(C=x.options)==null?void 0:C.icon,x.icon),label:Pe((O=x==null?void 0:x.meta)==null?void 0:O.label,(k=x==null?void 0:x.options)==null?void 0:k.label)??n(`${x.name}.${x.name}`,h(x.name,"plural"))}},[i,e,r,n,t]),S=R.useMemo(()=>{let x=K5(s,i==="legacy"),w=ee(b=>b.flatMap(_=>{let C=w(_.children),O=y({..._,children:C});return O?[O]:[]}),"prepare");return w(x)},[s,i,y]);return{defaultOpenKeys:g,selectedKey:v,menuItems:S}},"useMenu"),ix=Q.createContext({});ee(({children:e,value:t})=>{let n=Oq(),r=Q.useMemo(()=>({...n,...t}),[n,t]);return R.createElement(ix.Provider,{value:r},e)},"MetaContextProvider");var Oq=ee(()=>{if(!Q.useContext(ix))throw new Error("useMetaContext must be used within a MetaContextProvider");return Q.useContext(ix)},"useMetaContext"),On=ee(()=>{let{params:e}=ar(),t=Oq();return ee(({resource:n,meta:r}={})=>{let{meta:i}=Xx(n)??{meta:{}},{filters:u,sorters:s,current:c,pageSize:f,...d}=e??{},h={...i,...d,...r};return t!=null&&t.tenantId&&(h.tenantId=t.tenantId),h},"getMetaFn")},"useMeta"),uh=ee(()=>{let{options:e}=R.useContext(oi);return e},"useRefineOptions"),Q5=ee(e=>{let t=Ot(),{useParams:n}=_n(),r=ar(),i=n(),u=t==="legacy"?i.id:r.id;return e??u},"useId"),G5=ee(e=>{let t=Ot(),{useParams:n}=_n(),r=ar(),i=n(),u=t==="legacy"?i.action:r.action;return e??u},"useAction");function rl(e){let{select:t,identifier:n}=st(),r=(e==null?void 0:e.resource)??n,{identifier:i=void 0,resource:u=void 0}=r?t(r,!0):{},s=n===i,c=Q5(),f=G5(e==null?void 0:e.action),d=R.useMemo(()=>s?(e==null?void 0:e.id)??c:e==null?void 0:e.id,[s,e==null?void 0:e.id,c]),[h,m]=R.useState(d);R.useMemo(()=>m(d),[d]);let v=R.useMemo(()=>!s&&!(e!=null&&e.action)?"create":f==="edit"||f==="clone"?f:"create",[f,s,e==null?void 0:e.action]);return{id:h,setId:m,resource:u,action:f,identifier:i,formAction:v}}ee(rl,"useResourceParams");function sh({type:e}){let t=Je(),{textTransformers:{humanize:n}}=uh(),r=`buttons.${e}`,i=n(e);return{label:t(r,i)}}ee(sh,"useActionableButton");var Aq=ee(e=>{var t,n,r;let i=Je(),u=R.useContext(ic),s=((t=e.accessControl)==null?void 0:t.enabled)??u.options.buttons.enableAccessControl,c=((n=e.accessControl)==null?void 0:n.hideIfUnauthorized)??u.options.buttons.hideIfUnauthorized,{data:f}=Cq({resource:(r=e.resource)==null?void 0:r.name,action:e.action==="clone"?"create":e.action,params:{id:e.id,resource:e.resource},queryOptions:{enabled:s}}),d=R.useMemo(()=>f!=null&&f.can?"":f!=null&&f.reason?f.reason:i("buttons.notAccessTitle","You don't have permission to access"),[f==null?void 0:f.can,f==null?void 0:f.reason,i]),h=s&&c&&!(f!=null&&f.can),m=(f==null?void 0:f.can)===!1;return{title:d,hidden:h,disabled:m,canAccess:f}},"useButtonCanAccess");function hs(e){var t;let n=Nn(),r=Ot(),i=tu(),{Link:u}=_n(),s=Je(),c=Ea(),{textTransformers:{humanize:f}}=uh(),{id:d,resource:h,identifier:m}=rl({resource:e.resource,id:e.action==="create"?void 0:e.id}),{canAccess:v,title:g,hidden:y,disabled:S}=Aq({action:e.action,accessControl:e.accessControl,id:d,resource:h}),x=r==="legacy"?u:i,w=R.useMemo(()=>{if(!h)return"";switch(e.action){case"create":case"list":return n[`${e.action}Url`](h,e.meta);default:return d?n[`${e.action}Url`](h,d,e.meta):""}},[h,d,e.meta,n[`${e.action}Url`]]),b=e.action==="list"?s(`${m??e.resource}.titles.list`,c(((t=h==null?void 0:h.meta)==null?void 0:t.label)??(h==null?void 0:h.label)??m??e.resource,"plural")):s(`buttons.${e.action}`,f(e.action));return{to:w,label:b,title:g,disabled:S,hidden:y,canAccess:v,LinkComponent:x}}ee(hs,"useNavigationButton");function Rq(e){let t=Je(),{mutate:n,isLoading:r,variables:i}=gq(),{setWarnWhen:u}=Zl(),{mutationMode:s}=Xl(e.mutationMode),{id:c,resource:f,identifier:d}=rl({resource:e.resource,id:e.id}),{title:h,disabled:m,hidden:v,canAccess:g}=Aq({action:"delete",accessControl:e.accessControl,id:c,resource:f}),y=t("buttons.delete","Delete"),S=t("buttons.delete","Delete"),x=t("buttons.confirm","Are you sure?"),w=t("buttons.cancel","Cancel"),b=c===(i==null?void 0:i.id)&&r;return{label:y,title:h,hidden:v,disabled:m,canAccess:g,loading:b,confirmOkLabel:S,cancelLabel:w,confirmTitle:x,onConfirm:ee(()=>{c&&d&&(u(!1),n({id:c,resource:d,mutationMode:s,successNotification:e.successNotification,errorNotification:e.errorNotification,meta:e.meta,metaData:e.meta,dataProviderName:e.dataProviderName,invalidates:e.invalidates},{onSuccess:e.onSuccess}))},"onConfirm")}}ee(Rq,"useDeleteButton");function kq(e){let t=Je(),{keys:n,preferLegacyKeys:r}=Dt(),i=xa(),u=wa(),{identifier:s,id:c}=rl({resource:e.resource,id:e.id}),{resources:f}=st(),d=!!i.isFetching({queryKey:n().data(dt(s,e.dataProviderName,f)).resource(s).action("one").get(r)}),h=ee(()=>{u({id:c,invalidates:["detail"],dataProviderName:e.dataProviderName,resource:s})},"onClick"),m=t("buttons.refresh","Refresh");return{onClick:h,label:m,loading:d}}ee(kq,"useRefreshButton");var Y5=ee(e=>hs({...e,action:"show"}),"useShowButton"),X5=ee(e=>hs({...e,action:"edit"}),"useEditButton");ee(e=>hs({...e,action:"clone"}),"useCloneButton");var Z5=ee(e=>hs({...e,action:"create"}),"useCreateButton"),J5=ee(e=>hs({...e,action:"list"}),"useListButton"),e6=ee(()=>sh({type:"save"}),"useSaveButton");ee(()=>sh({type:"export"}),"useExportButton");ee(()=>sh({type:"import"}),"useImportButton");ee(()=>{let[e,t]=Q.useState(),n=Je(),{push:r}=Nn(),i=Fn(),u=Ot(),{resource:s,action:c}=st();return Q.useEffect(()=>{s&&c&&t(n("pages.error.info",{action:c,resource:s.name},`You may have forgotten to add the "${c}" component to "${s.name}" resource.`))},[s,c]),R.createElement(R.Fragment,null,R.createElement("h1",null,n("pages.error.404",void 0,"Sorry, the page you visited does not exist.")),e&&R.createElement("p",null,e),R.createElement("button",{onClick:()=>{u==="legacy"?r("/"):i({to:"/"})}},n("pages.error.backHome",void 0,"Back Home")))},"ErrorComponent");var t6=ee(()=>{let[e,t]=Q.useState(""),[n,r]=Q.useState(""),i=Je(),u=vn(),{mutate:s}=Wx({v3LegacyAuthProviderCompatible:!!(u!=null&&u.isLegacy)});return R.createElement(R.Fragment,null,R.createElement("h1",null,i("pages.login.title","Sign in your account")),R.createElement("form",{onSubmit:c=>{c.preventDefault(),s({username:e,password:n})}},R.createElement("table",null,R.createElement("tbody",null,R.createElement("tr",null,R.createElement("td",null,i("pages.login.username",void 0,"username"),":"),R.createElement("td",null,R.createElement("input",{type:"text",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",autoFocus:!0,required:!0,value:e,onChange:c=>t(c.target.value)}))),R.createElement("tr",null,R.createElement("td",null,i("pages.login.password",void 0,"password"),":"),R.createElement("td",null,R.createElement("input",{type:"password",required:!0,size:20,value:n,onChange:c=>r(c.target.value)}))))),R.createElement("br",null),R.createElement("input",{type:"submit",value:"login"})))},"LoginPage"),n6=ee(({providers:e,registerLink:t,forgotPasswordLink:n,rememberMe:r,contentProps:i,wrapperProps:u,renderContent:s,formProps:c,title:f=void 0,hideForm:d,mutationVariables:h})=>{let m=Ot(),v=tu(),{Link:g}=_n(),y=m==="legacy"?g:v,[S,x]=Q.useState(""),[w,b]=Q.useState(""),[_,C]=Q.useState(!1),O=Je(),k=vn(),{mutate:D}=Wx({v3LegacyAuthProviderCompatible:!!(k!=null&&k.isLegacy)}),M=ee((P,j)=>R.createElement(y,{to:P},j),"renderLink"),T=ee(()=>e?e.map(P=>R.createElement("div",{key:P.name,style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"1rem"}},R.createElement("button",{onClick:()=>D({...h,providerName:P.name}),style:{display:"flex",alignItems:"center"}},P==null?void 0:P.icon,P.label??R.createElement("label",null,P.label)))):null,"renderProviders"),L=R.createElement("div",{...i},R.createElement("h1",{style:{textAlign:"center"}},O("pages.login.title","Sign in to your account")),T(),!d&&R.createElement(R.Fragment,null,R.createElement("hr",null),R.createElement("form",{onSubmit:P=>{P.preventDefault(),D({...h,email:S,password:w,remember:_})},...c},R.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},R.createElement("label",{htmlFor:"email-input"},O("pages.login.fields.email","Email")),R.createElement("input",{id:"email-input",name:"email",type:"text",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:S,onChange:P=>x(P.target.value)}),R.createElement("label",{htmlFor:"password-input"},O("pages.login.fields.password","Password")),R.createElement("input",{id:"password-input",type:"password",name:"password",required:!0,size:20,value:w,onChange:P=>b(P.target.value)}),r??R.createElement(R.Fragment,null,R.createElement("label",{htmlFor:"remember-me-input"},O("pages.login.buttons.rememberMe","Remember me"),R.createElement("input",{id:"remember-me-input",name:"remember",type:"checkbox",size:20,checked:_,value:_.toString(),onChange:()=>{C(!_)}}))),R.createElement("br",null),n??M("/forgot-password",O("pages.login.buttons.forgotPassword","Forgot password?")),R.createElement("input",{type:"submit",value:O("pages.login.signin","Sign in")}),t??R.createElement("span",null,O("pages.login.buttons.noAccount","Don’t have an account?")," ",M("/register",O("pages.login.register","Sign up")))))),t!==!1&&d&&R.createElement("div",{style:{textAlign:"center"}},O("pages.login.buttons.noAccount","Don’t have an account?")," ",M("/register",O("pages.login.register","Sign up"))));return R.createElement("div",{...u},s?s(L,f):L)},"LoginPage"),r6=ee(({providers:e,loginLink:t,wrapperProps:n,contentProps:r,renderContent:i,formProps:u,title:s=void 0,hideForm:c,mutationVariables:f})=>{let d=Ot(),h=tu(),{Link:m}=_n(),v=d==="legacy"?m:h,[g,y]=Q.useState(""),[S,x]=Q.useState(""),w=Je(),b=vn(),{mutate:_,isLoading:C}=sq({v3LegacyAuthProviderCompatible:!!(b!=null&&b.isLegacy)}),O=ee((M,T)=>R.createElement(v,{to:M},T),"renderLink"),k=ee(()=>e?e.map(M=>R.createElement("div",{key:M.name,style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"1rem"}},R.createElement("button",{onClick:()=>_({...f,providerName:M.name}),style:{display:"flex",alignItems:"center"}},M==null?void 0:M.icon,M.label??R.createElement("label",null,M.label)))):null,"renderProviders"),D=R.createElement("div",{...r},R.createElement("h1",{style:{textAlign:"center"}},w("pages.register.title","Sign up for your account")),k(),!c&&R.createElement(R.Fragment,null,R.createElement("hr",null),R.createElement("form",{onSubmit:M=>{M.preventDefault(),_({...f,email:g,password:S})},...u},R.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},R.createElement("label",{htmlFor:"email-input"},w("pages.register.fields.email","Email")),R.createElement("input",{id:"email-input",name:"email",type:"email",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:g,onChange:M=>y(M.target.value)}),R.createElement("label",{htmlFor:"password-input"},w("pages.register.fields.password","Password")),R.createElement("input",{id:"password-input",name:"password",type:"password",required:!0,size:20,value:S,onChange:M=>x(M.target.value)}),R.createElement("input",{type:"submit",value:w("pages.register.buttons.submit","Sign up"),disabled:C}),t??R.createElement(R.Fragment,null,R.createElement("span",null,w("pages.login.buttons.haveAccount","Have an account?")," ",O("/login",w("pages.login.signin","Sign in"))))))),t!==!1&&c&&R.createElement("div",{style:{textAlign:"center"}},w("pages.login.buttons.haveAccount","Have an account?")," ",O("/login",w("pages.login.signin","Sign in"))));return R.createElement("div",{...n},i?i(D,s):D)},"RegisterPage"),a6=ee(({loginLink:e,wrapperProps:t,contentProps:n,renderContent:r,formProps:i,title:u=void 0,mutationVariables:s})=>{let c=Je(),f=Ot(),d=tu(),{Link:h}=_n(),m=f==="legacy"?h:d,[v,g]=Q.useState(""),{mutate:y,isLoading:S}=oq(),x=ee((b,_)=>R.createElement(m,{to:b},_),"renderLink"),w=R.createElement("div",{...n},R.createElement("h1",{style:{textAlign:"center"}},c("pages.forgotPassword.title","Forgot your password?")),R.createElement("hr",null),R.createElement("form",{onSubmit:b=>{b.preventDefault(),y({...s,email:v})},...i},R.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},R.createElement("label",{htmlFor:"email-input"},c("pages.forgotPassword.fields.email","Email")),R.createElement("input",{id:"email-input",name:"email",type:"mail",autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:v,onChange:b=>g(b.target.value)}),R.createElement("input",{type:"submit",disabled:S,value:c("pages.forgotPassword.buttons.submit","Send reset instructions")}),R.createElement("br",null),e??R.createElement("span",null,c("pages.register.buttons.haveAccount","Have an account? ")," ",x("/login",c("pages.login.signin","Sign in"))))));return R.createElement("div",{...t},r?r(w,u):w)},"ForgotPasswordPage"),i6=ee(({wrapperProps:e,contentProps:t,renderContent:n,formProps:r,title:i=void 0,mutationVariables:u})=>{let s=Je(),c=vn(),{mutate:f,isLoading:d}=cq({v3LegacyAuthProviderCompatible:!!(c!=null&&c.isLegacy)}),[h,m]=Q.useState(""),[v,g]=Q.useState(""),y=R.createElement("div",{...t},R.createElement("h1",{style:{textAlign:"center"}},s("pages.updatePassword.title","Update Password")),R.createElement("hr",null),R.createElement("form",{onSubmit:S=>{S.preventDefault(),f({...u,password:h,confirmPassword:v})},...r},R.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},R.createElement("label",{htmlFor:"password-input"},s("pages.updatePassword.fields.password","New Password")),R.createElement("input",{id:"password-input",name:"password",type:"password",required:!0,size:20,value:h,onChange:S=>m(S.target.value)}),R.createElement("label",{htmlFor:"confirm-password-input"},s("pages.updatePassword.fields.confirmPassword","Confirm New Password")),R.createElement("input",{id:"confirm-password-input",name:"confirmPassword",type:"password",required:!0,size:20,value:v,onChange:S=>g(S.target.value)}),R.createElement("input",{type:"submit",disabled:d,value:s("pages.updatePassword.buttons.submit","Update")}))));return R.createElement("div",{...e},n?n(y,i):y)},"UpdatePasswordPage");ee(e=>{let{type:t}=e;return R.createElement(R.Fragment,null,ee(()=>{switch(t){case"register":return R.createElement(r6,{...e});case"forgotPassword":return R.createElement(a6,{...e});case"updatePassword":return R.createElement(i6,{...e});default:return R.createElement(n6,{...e})}},"renderView")())},"AuthPage");var l6=ee(()=>R.createElement(R.Fragment,null,R.createElement("h1",null,"Welcome on board"),R.createElement("p",null,"Your configuration is completed."),R.createElement("p",null,"Now you can get started by adding your resources to the"," ",R.createElement("code",null,"`resources`")," property of ",R.createElement("code",null,"``")),R.createElement("div",{style:{display:"flex",gap:8}},R.createElement("a",{href:"https://refine.dev",target:"_blank",rel:"noreferrer"},R.createElement("button",null,"Documentation")),R.createElement("a",{href:"https://refine.dev/examples",target:"_blank",rel:"noreferrer"},R.createElement("button",null,"Examples")),R.createElement("a",{href:"https://discord.gg/refine",target:"_blank",rel:"noreferrer"},R.createElement("button",null,"Community")))),"ReadyPage"),u6=[{title:"Documentation",description:"Learn about the technical details of using Refine in your projects.",link:"https://refine.dev/docs",iconUrl:"https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/book.svg"},{title:"Tutorial",description:"Learn how to use Refine by building a fully-functioning CRUD app, from scratch to full launch.",link:"https://refine.dev/tutorial",iconUrl:"https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/hat.svg"},{title:"Templates",description:"Explore a range of pre-built templates, perfect everything from admin panels to dashboards and CRMs.",link:"https://refine.dev/templates",iconUrl:"https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/application.svg"},{title:"Community",description:"Join our Discord community and keep up with the latest news.",link:"https://discord.gg/refine",iconUrl:"https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/discord.svg"}],s6=ee(()=>{let e=aA("(max-width: 1010px)"),t=aA("(max-width: 650px)"),n=ee(()=>t?"1, 280px":e?"2, 280px":"4, 1fr","getGridTemplateColumns"),r=ee(()=>t?"32px":e?"40px":"48px","getHeaderFontSize"),i=ee(()=>t?"16px":e?"20px":"24px","getSubHeaderFontSize");return R.createElement("div",{style:{position:"fixed",zIndex:10,inset:0,overflow:"auto",width:"100dvw",height:"100dvh"}},R.createElement("div",{style:{overflow:"hidden",position:"relative",backgroundSize:"cover",backgroundRepeat:"no-repeat",background:t?"url(https://refine.ams3.cdn.digitaloceanspaces.com/website/static/assets/landing-noise.webp), radial-gradient(88.89% 50% at 50% 100%, rgba(38, 217, 127, 0.10) 0%, rgba(38, 217, 127, 0.00) 100%), radial-gradient(88.89% 50% at 50% 0%, rgba(71, 235, 235, 0.15) 0%, rgba(71, 235, 235, 0.00) 100%), #1D1E30":e?"url(https://refine.ams3.cdn.digitaloceanspaces.com/website/static/assets/landing-noise.webp), radial-gradient(66.67% 50% at 50% 100%, rgba(38, 217, 127, 0.10) 0%, rgba(38, 217, 127, 0.00) 100%), radial-gradient(66.67% 50% at 50% 0%, rgba(71, 235, 235, 0.15) 0%, rgba(71, 235, 235, 0.00) 100%), #1D1E30":"url(https://refine.ams3.cdn.digitaloceanspaces.com/website/static/assets/landing-noise.webp), radial-gradient(35.56% 50% at 50% 100%, rgba(38, 217, 127, 0.12) 0%, rgba(38, 217, 127, 0) 100%), radial-gradient(35.56% 50% at 50% 0%, rgba(71, 235, 235, 0.18) 0%, rgba(71, 235, 235, 0) 100%), #1D1E30",minHeight:"100%",minWidth:"100%",fontFamily:"Arial",color:"#FFFFFF"}},R.createElement("div",{style:{zIndex:2,position:"absolute",width:t?"400px":"800px",height:"552px",opacity:"0.5",background:"url(https://refine.ams3.cdn.digitaloceanspaces.com/assets/welcome-page-hexagon.png)",backgroundRepeat:"no-repeat",backgroundSize:"contain",top:"0",left:"50%",transform:"translateX(-50%)"}}),R.createElement("div",{style:{height:t?"40px":"80px"}}),R.createElement("div",{style:{display:"flex",justifyContent:"center"}},R.createElement("div",{style:{backgroundRepeat:"no-repeat",backgroundSize:t?"112px 58px":"224px 116px",backgroundImage:"url(https://refine.ams3.cdn.digitaloceanspaces.com/assets/refine-logo.svg)",width:t?112:224,height:t?58:116}})),R.createElement("div",{style:{height:t?"120px":e?"200px":"30vh",minHeight:t?"120px":"200px"}}),R.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px",textAlign:"center"}},R.createElement("h1",{style:{fontSize:r(),fontWeight:700,margin:"0px"}},"Welcome Aboard!"),R.createElement("h4",{style:{fontSize:i(),fontWeight:400,margin:"0px"}},"Your configuration is completed.")),R.createElement("div",{style:{height:"64px"}}),R.createElement("div",{style:{display:"grid",gridTemplateColumns:`repeat(${n()})`,justifyContent:"center",gap:"48px",paddingRight:"16px",paddingLeft:"16px",paddingBottom:"32px",maxWidth:"976px",margin:"auto"}},u6.map(u=>R.createElement(o6,{key:`welcome-page-${u.title}`,card:u})))))},"ConfigSuccessPage"),o6=ee(({card:e})=>{let{title:t,description:n,iconUrl:r,link:i}=e,[u,s]=Q.useState(!1);return R.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},R.createElement("div",{style:{display:"flex",alignItems:"center"}},R.createElement("a",{onPointerEnter:()=>s(!0),onPointerLeave:()=>s(!1),style:{display:"flex",alignItems:"center",color:"#fff",textDecoration:"none"},href:i},R.createElement("div",{style:{width:"16px",height:"16px",backgroundPosition:"center",backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundImage:`url(${r})`}}),R.createElement("span",{style:{fontSize:"16px",fontWeight:700,marginLeft:"13px",marginRight:"14px"}},t),R.createElement("svg",{style:{transition:"transform 0.5s ease-in-out, opacity 0.2s ease-in-out",...u&&{transform:"translateX(4px)",opacity:1}},width:"12",height:"8",fill:"none",opacity:"0.5",xmlns:"http://www.w3.org/2000/svg"},R.createElement("path",{d:"M7.293.293a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1 0 1.414l-3 3a1 1 0 0 1-1.414-1.414L8.586 5H1a1 1 0 0 1 0-2h7.586L7.293 1.707a1 1 0 0 1 0-1.414Z",fill:"#fff"})))),R.createElement("span",{style:{fontSize:"12px",opacity:.5,lineHeight:"16px"}},n))},"Card"),c6=ee(()=>R.createElement("div",{style:{position:"fixed",zIndex:11,inset:0,overflow:"auto",width:"100dvw",height:"100dvh"}},R.createElement("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",padding:"24px",background:"#14141FBF",backdropFilter:"blur(3px)"}},R.createElement("div",{style:{maxWidth:"640px",width:"100%",background:"#1D1E30",borderRadius:"16px",border:"1px solid #303450",boxShadow:"0px 0px 120px -24px #000000"}},R.createElement("div",{style:{padding:"16px 20px",borderBottom:"1px solid #303450",display:"flex",alignItems:"center",gap:"8px",position:"relative"}},R.createElement(d6,{style:{position:"absolute",left:0,top:0}}),R.createElement("div",{style:{lineHeight:"24px",fontSize:"16px",color:"#FFFFFF",display:"flex",alignItems:"center",gap:"16px"}},R.createElement(h6,null),R.createElement("span",{style:{fontWeight:400}},"Configuration Error"))),R.createElement("div",{style:{padding:"20px",color:"#A3ADC2",lineHeight:"20px",fontSize:"14px",display:"flex",flexDirection:"column",gap:"20px"}},R.createElement("p",{style:{margin:0,padding:0,lineHeight:"28px",fontSize:"16px"}},R.createElement("code",{style:{display:"inline-block",background:"#30345080",padding:"0 4px",lineHeight:"24px",fontSize:"16px",borderRadius:"4px",color:"#FFFFFF"}},"")," ","is not initialized. Please make sure you have it mounted in your app and placed your components inside it."),R.createElement("div",null,R.createElement(f6,null)))))),"ConfigErrorPage"),f6=ee(()=>R.createElement("pre",{style:{display:"block",overflowX:"auto",borderRadius:"8px",fontSize:"14px",lineHeight:"24px",backgroundColor:"#14141F",color:"#E5ECF2",padding:"16px",margin:"0",maxHeight:"400px",overflow:"auto"}},R.createElement("span",{style:{color:"#FF7B72"}},"import")," ","{"," Refine, WelcomePage"," ","}"," ",R.createElement("span",{style:{color:"#FF7B72"}},"from")," ",R.createElement("span",{style:{color:"#A5D6FF"}},'"@refinedev/core"'),";",` +`,` +`,R.createElement("span",{style:{color:"#FF7B72"}},"export")," ",R.createElement("span",{style:{color:"#FF7B72"}},"default")," ",R.createElement("span",null,R.createElement("span",{style:{color:"#FF7B72"}},"function")," ",R.createElement("span",{style:{color:"#FFA657"}},"App"),"(",R.createElement("span",{style:{color:"rgb(222, 147, 95)"}}),")"," "),"{",` +`," ",R.createElement("span",{style:{color:"#FF7B72"}},"return")," (",` +`," ",R.createElement("span",null,R.createElement("span",{style:{color:"#79C0FF"}},"<",R.createElement("span",{style:{color:"#79C0FF"}},"Refine"),` +`," ",R.createElement("span",{style:{color:"#E5ECF2",opacity:.6}},"// ",R.createElement("span",null,"...")),` +`," ",">"),` +`," ",R.createElement("span",{style:{opacity:.6}},"{","/* ... */","}"),` +`," ",R.createElement("span",{style:{color:"#79C0FF"}},"<",R.createElement("span",{style:{color:"#79C0FF"}},"WelcomePage")," />"),` +`," ",R.createElement("span",{style:{opacity:.6}},"{","/* ... */","}"),` +`," ",R.createElement("span",{style:{color:"#79C0FF"}},"")),` +`," ",");",` +`,"}"),"ExampleImplementation"),d6=ee(e=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:204,height:56,viewBox:"0 0 204 56",fill:"none",...e},R.createElement("path",{fill:"url(#welcome-page-error-gradient-a)",d:"M12 0H0v12L12 0Z"}),R.createElement("path",{fill:"url(#welcome-page-error-gradient-b)",d:"M28 0h-8L0 20v8L28 0Z"}),R.createElement("path",{fill:"url(#welcome-page-error-gradient-c)",d:"M36 0h8L0 44v-8L36 0Z"}),R.createElement("path",{fill:"url(#welcome-page-error-gradient-d)",d:"M60 0h-8L0 52v4h4L60 0Z"}),R.createElement("path",{fill:"url(#welcome-page-error-gradient-e)",d:"M68 0h8L20 56h-8L68 0Z"}),R.createElement("path",{fill:"url(#welcome-page-error-gradient-f)",d:"M92 0h-8L28 56h8L92 0Z"}),R.createElement("path",{fill:"url(#welcome-page-error-gradient-g)",d:"M100 0h8L52 56h-8l56-56Z"}),R.createElement("path",{fill:"url(#welcome-page-error-gradient-h)",d:"M124 0h-8L60 56h8l56-56Z"}),R.createElement("path",{fill:"url(#welcome-page-error-gradient-i)",d:"M140 0h-8L76 56h8l56-56Z"}),R.createElement("path",{fill:"url(#welcome-page-error-gradient-j)",d:"M132 0h8L84 56h-8l56-56Z"}),R.createElement("path",{fill:"url(#welcome-page-error-gradient-k)",d:"M156 0h-8L92 56h8l56-56Z"}),R.createElement("path",{fill:"url(#welcome-page-error-gradient-l)",d:"M164 0h8l-56 56h-8l56-56Z"}),R.createElement("path",{fill:"url(#welcome-page-error-gradient-m)",d:"M188 0h-8l-56 56h8l56-56Z"}),R.createElement("path",{fill:"url(#welcome-page-error-gradient-n)",d:"M204 0h-8l-56 56h8l56-56Z"}),R.createElement("defs",null,R.createElement("radialGradient",{id:"welcome-page-error-gradient-a",cx:0,cy:0,r:1,gradientTransform:"scale(124)",gradientUnits:"userSpaceOnUse"},R.createElement("stop",{stopColor:"#FF4C4D",stopOpacity:.1}),R.createElement("stop",{offset:1,stopColor:"#FF4C4D",stopOpacity:0})),R.createElement("radialGradient",{id:"welcome-page-error-gradient-b",cx:0,cy:0,r:1,gradientTransform:"scale(124)",gradientUnits:"userSpaceOnUse"},R.createElement("stop",{stopColor:"#FF4C4D",stopOpacity:.1}),R.createElement("stop",{offset:1,stopColor:"#FF4C4D",stopOpacity:0})),R.createElement("radialGradient",{id:"welcome-page-error-gradient-c",cx:0,cy:0,r:1,gradientTransform:"scale(124)",gradientUnits:"userSpaceOnUse"},R.createElement("stop",{stopColor:"#FF4C4D",stopOpacity:.1}),R.createElement("stop",{offset:1,stopColor:"#FF4C4D",stopOpacity:0})),R.createElement("radialGradient",{id:"welcome-page-error-gradient-d",cx:0,cy:0,r:1,gradientTransform:"scale(124)",gradientUnits:"userSpaceOnUse"},R.createElement("stop",{stopColor:"#FF4C4D",stopOpacity:.1}),R.createElement("stop",{offset:1,stopColor:"#FF4C4D",stopOpacity:0})),R.createElement("radialGradient",{id:"welcome-page-error-gradient-e",cx:0,cy:0,r:1,gradientTransform:"scale(124)",gradientUnits:"userSpaceOnUse"},R.createElement("stop",{stopColor:"#FF4C4D",stopOpacity:.1}),R.createElement("stop",{offset:1,stopColor:"#FF4C4D",stopOpacity:0})),R.createElement("radialGradient",{id:"welcome-page-error-gradient-f",cx:0,cy:0,r:1,gradientTransform:"scale(124)",gradientUnits:"userSpaceOnUse"},R.createElement("stop",{stopColor:"#FF4C4D",stopOpacity:.1}),R.createElement("stop",{offset:1,stopColor:"#FF4C4D",stopOpacity:0})),R.createElement("radialGradient",{id:"welcome-page-error-gradient-g",cx:0,cy:0,r:1,gradientTransform:"scale(124)",gradientUnits:"userSpaceOnUse"},R.createElement("stop",{stopColor:"#FF4C4D",stopOpacity:.1}),R.createElement("stop",{offset:1,stopColor:"#FF4C4D",stopOpacity:0})),R.createElement("radialGradient",{id:"welcome-page-error-gradient-h",cx:0,cy:0,r:1,gradientTransform:"scale(124)",gradientUnits:"userSpaceOnUse"},R.createElement("stop",{stopColor:"#FF4C4D",stopOpacity:.1}),R.createElement("stop",{offset:1,stopColor:"#FF4C4D",stopOpacity:0})),R.createElement("radialGradient",{id:"welcome-page-error-gradient-i",cx:0,cy:0,r:1,gradientTransform:"scale(124)",gradientUnits:"userSpaceOnUse"},R.createElement("stop",{stopColor:"#FF4C4D",stopOpacity:.1}),R.createElement("stop",{offset:1,stopColor:"#FF4C4D",stopOpacity:0})),R.createElement("radialGradient",{id:"welcome-page-error-gradient-j",cx:0,cy:0,r:1,gradientTransform:"scale(124)",gradientUnits:"userSpaceOnUse"},R.createElement("stop",{stopColor:"#FF4C4D",stopOpacity:.1}),R.createElement("stop",{offset:1,stopColor:"#FF4C4D",stopOpacity:0})),R.createElement("radialGradient",{id:"welcome-page-error-gradient-k",cx:0,cy:0,r:1,gradientTransform:"scale(124)",gradientUnits:"userSpaceOnUse"},R.createElement("stop",{stopColor:"#FF4C4D",stopOpacity:.1}),R.createElement("stop",{offset:1,stopColor:"#FF4C4D",stopOpacity:0})),R.createElement("radialGradient",{id:"welcome-page-error-gradient-l",cx:0,cy:0,r:1,gradientTransform:"scale(124)",gradientUnits:"userSpaceOnUse"},R.createElement("stop",{stopColor:"#FF4C4D",stopOpacity:.1}),R.createElement("stop",{offset:1,stopColor:"#FF4C4D",stopOpacity:0})),R.createElement("radialGradient",{id:"welcome-page-error-gradient-m",cx:0,cy:0,r:1,gradientTransform:"scale(124)",gradientUnits:"userSpaceOnUse"},R.createElement("stop",{stopColor:"#FF4C4D",stopOpacity:.1}),R.createElement("stop",{offset:1,stopColor:"#FF4C4D",stopOpacity:0})),R.createElement("radialGradient",{id:"welcome-page-error-gradient-n",cx:0,cy:0,r:1,gradientTransform:"scale(124)",gradientUnits:"userSpaceOnUse"},R.createElement("stop",{stopColor:"#FF4C4D",stopOpacity:.1}),R.createElement("stop",{offset:1,stopColor:"#FF4C4D",stopOpacity:0})))),"ErrorGradient"),h6=ee(e=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 16 16",fill:"none",...e},R.createElement("path",{fill:"#FF4C4D",fillRule:"evenodd",d:"M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16Z",clipRule:"evenodd"}),R.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M7 8a1 1 0 1 0 2 0V5a1 1 0 1 0-2 0v3Zm0 3a1 1 0 1 1 2 0 1 1 0 0 1-2 0Z",clipRule:"evenodd"})),"ErrorIcon");ee(()=>{let{__initialized:e}=cn();return R.createElement(R.Fragment,null,R.createElement(s6,null),!e&&R.createElement(c6,null))},"WelcomePage");var p6="4.57.5",m6=ee(()=>{var e;let t=dq(),n=Q.useContext(lh),{liveProvider:r}=Q.useContext(ec),i=Q.useContext(Yx),u=Q.useContext(Qx),{i18nProvider:s}=Q.useContext(fs),c=Q.useContext(Gx),f=Q.useContext(ic),{resources:d}=st(),h=cn(),m=!!n.create||!!n.get||!!n.update,v=!!(r!=null&&r.publish)||!!(r!=null&&r.subscribe)||!!(r!=null&&r.unsubscribe),g=!!i.useHistory||!!i.Link||!!i.Prompt||!!i.useLocation||!!i.useParams,y=!!u,S=!!(s!=null&&s.changeLocale)||!!(s!=null&&s.getLocale)||!!(s!=null&&s.translate),x=!!c.close||!!c.open,w=!!f.can,b=(e=h==null?void 0:h.options)==null?void 0:e.projectId;return{providers:{auth:t,auditLog:m,live:v,router:g,data:y,i18n:S,notification:x,accessControl:w},version:p6,resourceCount:d.length,projectId:b}},"useTelemetryData"),g6=ee(e=>{try{let t=JSON.stringify(e||{});return typeof btoa<"u"?btoa(t):Buffer.from(t).toString("base64")}catch{return}},"encode"),y6=ee(e=>{let t=new Image;t.src=e},"throughImage"),v6=ee(e=>{fetch(e)},"throughFetch"),b6=ee(e=>{typeof Image<"u"?y6(e):typeof fetch<"u"&&v6(e)},"transport"),x6=ee(()=>{let e=m6(),t=R.useRef(!1);return R.useEffect(()=>{if(t.current)return;let n=g6(e);n&&(b6(`https://telemetry.refine.dev/telemetry?payload=${n}`),t.current=!0)},[]),null},"Telemetry"),S6=ee(e=>{let t=["go","parse","back","Link"],n=Object.keys(e).filter(r=>!t.includes(r));return n.length>0?(console.warn(`Unsupported properties are found in \`routerProvider\` prop. You provided \`${n.join(", ")}\`. Supported properties are \`${t.join(", ")}\`. You may wanted to use \`legacyRouterProvider\` prop instead.`),!0):!1},"checkRouterPropMisuse"),E6=ee(e=>{let t=R.useRef(!1);R.useEffect(()=>{t.current===!1&&e&&S6(e)&&(t.current=!0)},[e])},"useRouterMisuseWarning"),w6=ee(({legacyAuthProvider:e,authProvider:t,dataProvider:n,legacyRouterProvider:r,routerProvider:i,notificationProvider:u,accessControlProvider:s,auditLogProvider:c,resources:f,DashboardPage:d,ReadyPage:h,LoginPage:m,catchAll:v,children:g,liveProvider:y,i18nProvider:S,Title:x,Layout:w,Sider:b,Header:_,Footer:C,OffLayoutArea:O,onLiveEvent:k,options:D})=>{let{optionsWithDefaults:M,disableTelemetryWithDefault:T,reactQueryWithDefaults:L}=HI({options:D}),P=vq(()=>{var F;return L.clientConfig instanceof L_?L.clientConfig:new L_({...L.clientConfig,defaultOptions:{...L.clientConfig.defaultOptions,queries:{refetchOnWindowFocus:!1,keepPreviousData:!0,...(F=L.clientConfig.defaultOptions)==null?void 0:F.queries}}})},[L.clientConfig]),j=R.useMemo(()=>typeof u=="function"?u:()=>u,[u])();if(E6(i),r&&!i&&(f??[]).length===0)return h?R.createElement(h,null):R.createElement(l6,null);let{RouterComponent:q=R.Fragment}=i?{}:r??{};return R.createElement(Kz,{client:P},R.createElement(C5,{...j},R.createElement(DI,{...e??{},isProvided:!!e},R.createElement(LI,{...t??{},isProvided:!!t},R.createElement(h5,{dataProvider:n},R.createElement(p5,{liveProvider:y},R.createElement(y5,{value:r&&!i?"legacy":"new"},R.createElement(v5,{router:i},R.createElement($5,{...r},R.createElement(g5,{resources:f??[]},R.createElement(_5,{i18nProvider:S},R.createElement(U5,{...s??{}},R.createElement(H5,{...c??{}},R.createElement(w5,null,R.createElement(II,{mutationMode:M.mutationMode,warnWhenUnsavedChanges:M.warnWhenUnsavedChanges,syncWithLocation:M.syncWithLocation,Title:x,undoableTimeout:M.undoableTimeout,catchAll:v,DashboardPage:d,LoginPage:m,Layout:w,Sider:b,Footer:C,Header:_,OffLayoutArea:O,hasDashboard:!!d,liveMode:M.liveMode,onLiveEvent:k,options:M},R.createElement(XI,null,R.createElement(q,null,g,!T&&R.createElement(x6,null),R.createElement(k6,null))))))))))))))))))},"Refine"),C6=ee(({notification:e})=>{let t=Je(),{notificationDispatch:n}=rc(),{open:r}=Jl(),[i,u]=Q.useState(),s=ee(()=>{if(e.isRunning===!0&&(e.seconds===0&&e.doMutation(),e.isSilent||r==null||r({key:`${e.id}-${e.resource}-notification`,type:"progress",message:t("notifications.undoable",{seconds:qg(e.seconds)},`You have ${qg(e.seconds)} seconds to undo`),cancelMutation:e.cancelMutation,undoableTimeout:qg(e.seconds)}),e.seconds>0)){i&&clearTimeout(i);let c=setTimeout(()=>{n({type:"DECREASE_NOTIFICATION_SECOND",payload:{id:e.id,seconds:e.seconds,resource:e.resource}})},1e3);u(c)}},"cancelNotification");return Q.useEffect(()=>{s()},[e]),null},"UndoableQueue");ee(({children:e,Layout:t,Sider:n,Header:r,Title:i,Footer:u,OffLayoutArea:s})=>{let{Layout:c,Footer:f,Header:d,Sider:h,Title:m,OffLayoutArea:v}=cn();return R.createElement(t??c,{Sider:n??h,Header:r??d,Footer:u??f,Title:i??m,OffLayoutArea:s??v},e,R.createElement(_6,null))},"LayoutWrapper");var _6=ee(()=>{let{Prompt:e}=_n(),t=Je(),{warnWhen:n,setWarnWhen:r}=Zl(),i=ee(u=>(u.preventDefault(),u.returnValue=t("warnWhenUnsavedChanges","Are you sure you want to leave? You have unsaved changes."),u.returnValue),"warnWhenListener");return Q.useEffect(()=>(n&&window.addEventListener("beforeunload",i),window.removeEventListener("beforeunload",i)),[n]),R.createElement(e,{when:n,message:t("warnWhenUnsavedChanges","Are you sure you want to leave? You have unsaved changes."),setWarnWhen:r})},"UnsavedPrompt");function O6({redirectOnFail:e=!0,appendCurrentPathToQuery:t=!0,children:n,fallback:r,loading:i,params:u}){var s;let c=vn(),f=Ot(),d=!!(c!=null&&c.isProvided),h=!!(c!=null&&c.isLegacy),m=f==="legacy",v=ar(),g=Fn(),{useLocation:y}=_n(),S=y(),{isFetching:x,isSuccess:w,data:{authenticated:b,redirectTo:_}={}}=fq({v3LegacyAuthProviderCompatible:h,params:u}),C=d?h?w:b:!0;if(!d)return R.createElement(R.Fragment,null,n??null);if(x)return R.createElement(R.Fragment,null,i??null);if(C)return R.createElement(R.Fragment,null,n??null);if(typeof r<"u")return R.createElement(R.Fragment,null,r??null);let O=h?typeof e=="string"?e:"/login":typeof e=="string"?e:_,k=`${m?S==null?void 0:S.pathname:v.pathname}`.replace(/(\?.*|#.*)$/,"");if(O){if(m){let M=t?`?to=${encodeURIComponent(k)}`:"";return R.createElement(R6,{to:`${O}${M}`})}let D=(s=v.params)!=null&&s.to?v.params.to:g({to:k,options:{keepQuery:!0},type:"path"});return R.createElement(A6,{config:{to:O,query:t&&(D??"").length>1?{to:D}:void 0,type:"replace"}})}return null}ee(O6,"Authenticated");var A6=ee(({config:e})=>{let t=Fn();return R.useEffect(()=>{t(e)},[t,e]),null},"Redirect"),R6=ee(({to:e})=>{let{replace:t}=Nn();return R.useEffect(()=>{t(e)},[t,e]),null},"RedirectLegacy"),k6=ee(()=>{let{useLocation:e}=_n(),{checkAuth:t}=Nr(),n=e();return Q.useEffect(()=>{t==null||t().catch(()=>!1)},[n==null?void 0:n.pathname]),null},"RouteChangeHandler"),Vg=ee(({resource:e,action:t,params:n,fallback:r,onUnauthorized:i,children:u,queryOptions:s,...c})=>{let{id:f,resource:d,action:h=""}=rl({resource:e,id:n==null?void 0:n.id}),m=t??h,v=n??{id:f,resource:d},{data:g}=Cq({resource:d==null?void 0:d.name,action:m,params:v,queryOptions:s});return Q.useEffect(()=>{i&&(g==null?void 0:g.can)===!1&&i({resource:d==null?void 0:d.name,action:m,reason:g==null?void 0:g.reason,params:v})},[g==null?void 0:g.can]),g!=null&&g.can?R.isValidElement(u)?R.cloneElement(u,c):R.createElement(R.Fragment,null,u):(g==null?void 0:g.can)===!1?R.createElement(R.Fragment,null,r??null):null},"CanAccess"),T6=[` + .bg-top-announcement { + border-bottom: 1px solid rgba(71, 235, 235, 0.15); + background: radial-gradient( + 218.19% 111.8% at 0% 0%, + rgba(71, 235, 235, 0.1) 0%, + rgba(71, 235, 235, 0.2) 100% + ), + #14141f; + } + `,` + .top-announcement-mask { + mask-image: url(https://refine.ams3.cdn.digitaloceanspaces.com/website/static/assets/hexagon.svg); + -webkit-mask-image: url(https://refine.ams3.cdn.digitaloceanspaces.com/website/static/assets/hexagon.svg); + mask-repeat: repeat; + -webkit-mask-repeat: repeat; + background: rgba(71, 235, 235, 0.25); + } + `,` + .banner { + display: flex; + @media (max-width: 1000px) { + display: none; + } + }`,` + .gh-link, .gh-link:hover, .gh-link:active, .gh-link:visited, .gh-link:focus { + text-decoration: none; + z-index: 9; + } + `,` + @keyframes top-announcement-glow { + 0% { + opacity: 1; + } + + 100% { + opacity: 0; + } + } + `],M6="If you find Refine useful, you can contribute to its growth by giving it a star on GitHub";ee(({containerStyle:e})=>(Q.useEffect(()=>{let t=document.createElement("style");document.head.appendChild(t),T6.forEach(n=>{var r;return(r=t.sheet)==null?void 0:r.insertRule(n,t.sheet.cssRules.length)})},[]),R.createElement("div",{className:"banner bg-top-announcement",style:{width:"100%",height:"48px"}},R.createElement("div",{style:{position:"relative",display:"flex",justifyContent:"center",alignItems:"center",paddingLeft:"200px",width:"100%",maxWidth:"100vw",height:"100%",borderBottom:"1px solid #47ebeb26",...e}},R.createElement("div",{className:"top-announcement-mask",style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",borderBottom:"1px solid #47ebeb26"}},R.createElement("div",{style:{position:"relative",width:"960px",height:"100%",display:"flex",justifyContent:"space-between",margin:"0 auto"}},R.createElement("div",{style:{width:"calc(50% - 300px)",height:"100%",position:"relative"}},R.createElement(Ff,{style:{animationDelay:"1.5s",position:"absolute",top:"2px",right:"220px"},id:"1"}),R.createElement(Ff,{style:{animationDelay:"1s",position:"absolute",top:"8px",right:"100px",transform:"rotate(180deg)"},id:"2"}),R.createElement(pA,{style:{position:"absolute",right:"10px"},id:"3"})),R.createElement("div",{style:{width:"calc(50% - 300px)",height:"100%",position:"relative"}},R.createElement(Ff,{style:{animationDelay:"2s",position:"absolute",top:"6px",right:"180px",transform:"rotate(180deg)"},id:"4"}),R.createElement(Ff,{style:{animationDelay:"0.5s",transitionDelay:"1.3s",position:"absolute",top:"2px",right:"40px"},id:"5"}),R.createElement(pA,{style:{position:"absolute",right:"-70px"},id:"6"})))),R.createElement(D6,{text:M6})))),"GitHubBanner");var D6=ee(({text:e})=>R.createElement("a",{className:"gh-link",href:"https://s.refine.dev/github-support",target:"_blank",rel:"noreferrer",style:{position:"absolute",height:"100%",padding:"0 60px",display:"flex",flexWrap:"nowrap",whiteSpace:"nowrap",justifyContent:"center",alignItems:"center",backgroundImage:"linear-gradient(90deg, rgba(31, 63, 72, 0.00) 0%, #1F3F48 10%, #1F3F48 90%, rgba(31, 63, 72, 0.00) 100%)"}},R.createElement("div",{style:{color:"#fff",display:"flex",flexDirection:"row",gap:"8px"}},R.createElement("span",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"}},"⭐️"),R.createElement("span",{className:"text",style:{fontSize:"16px",lineHeight:"24px"}},e),R.createElement("span",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"}},"⭐️"))),"Text"),Ff=ee(({style:e,...t})=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:80,height:40,fill:"none",style:{opacity:1,animation:"top-announcement-glow 1s ease-in-out infinite alternate",...e}},R.createElement("circle",{cx:40,r:40,fill:`url(#${t.id}-a)`,fillOpacity:.5}),R.createElement("defs",null,R.createElement("radialGradient",{id:`${t.id}-a`,cx:0,cy:0,r:1,gradientTransform:"matrix(0 40 -40 0 40 0)",gradientUnits:"userSpaceOnUse"},R.createElement("stop",{stopColor:"#47EBEB"}),R.createElement("stop",{offset:1,stopColor:"#47EBEB",stopOpacity:0})))),"GlowSmall"),pA=ee(({style:e,...t})=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:120,height:48,fill:"none",...t,style:{opacity:1,animation:"top-announcement-glow 1s ease-in-out infinite alternate",...e}},R.createElement("circle",{cx:60,cy:24,r:60,fill:`url(#${t.id}-a)`,fillOpacity:.5}),R.createElement("defs",null,R.createElement("radialGradient",{id:`${t.id}-a`,cx:0,cy:0,r:1,gradientTransform:"matrix(0 60 -60 0 60 24)",gradientUnits:"userSpaceOnUse"},R.createElement("stop",{stopColor:"#47EBEB"}),R.createElement("stop",{offset:1,stopColor:"#47EBEB",stopOpacity:0})))),"GlowBig"),L6=ee(({status:e,elements:{success:t=R.createElement(Nf,{translationKey:"autoSave.success",defaultMessage:"saved"}),error:n=R.createElement(Nf,{translationKey:"autoSave.error",defaultMessage:"auto save failure"}),loading:r=R.createElement(Nf,{translationKey:"autoSave.loading",defaultMessage:"saving..."}),idle:i=R.createElement(Nf,{translationKey:"autoSave.idle",defaultMessage:"waiting for changes"})}={}})=>{switch(e){case"success":return R.createElement(R.Fragment,null,t);case"error":return R.createElement(R.Fragment,null,n);case"loading":return R.createElement(R.Fragment,null,r);default:return R.createElement(R.Fragment,null,i)}},"AutoSaveIndicator"),Nf=ee(({translationKey:e,defaultMessage:t})=>{let n=Je();return R.createElement("span",null,n(e,t))},"Message"),q6=()=>null,P6=({children:e})=>e,Co={},St={},mA;function nu(){if(mA)return St;mA=1;var e=St.__assign||function(){return e=Object.assign||function(b){for(var _,C=1,O=arguments.length;C"u"?m:u.useLayoutEffect;function v(){var b=document.createElement("div");b.style.visibility="hidden",b.style.overflow="scroll",document.body.appendChild(b);var _=document.createElement("div");b.appendChild(_);var C=b.offsetWidth-_.offsetWidth;return b.parentNode.removeChild(b),C}St.getScrollbarWidth=v;function g(b,_){_===void 0&&(_=100);var C=u.useState(b),O=C[0],k=C[1],D=u.useRef(Date.now());return u.useEffect(function(){if(_!==0){var M=setTimeout(function(){k(b),D.current=Date.now()},D.current-(Date.now()-_));return function(){clearTimeout(M)}}},[_,b]),_===0?b:O}St.useThrottledValue=g;function y(b){var _,C,O,k=b===void 0?{ignoreWhenFocused:[]}:b,D=k.ignoreWhenFocused,M=i(["input","textarea"],D,!0).map(function(P){return P.toLowerCase()}),T=document.activeElement,L=T&&(M.indexOf(T.tagName.toLowerCase())!==-1||((_=T.attributes.getNamedItem("role"))===null||_===void 0?void 0:_.value)==="textbox"||((C=T.attributes.getNamedItem("contenteditable"))===null||C===void 0?void 0:C.value)==="true"||((O=T.attributes.getNamedItem("contenteditable"))===null||O===void 0?void 0:O.value)==="plaintext-only");return L}St.shouldRejectKeystrokes=y;var S=typeof window>"u",x=!S&&window.navigator.platform==="MacIntel";function w(b){return x?b.metaKey:b.ctrlKey}return St.isModKey=w,St.Priority={HIGH:1,NORMAL:0,LOW:-1},St}var kl={},Ba={},Hu={},oa={},jo={exports:{}},j6=jo.exports,gA;function F6(){return gA||(gA=1,function(e,t){(function(n,r){r(t)})(j6,function(n){var r=typeof WeakSet=="function",i=Object.keys;function u(L,P){return L===P||L!==L&&P!==P}function s(L){return L.constructor===Object||L.constructor==null}function c(L){return!!L&&typeof L.then=="function"}function f(L){return!!(L&&L.$$typeof)}function d(){var L=[];return{add:function(P){L.push(P)},has:function(P){return L.indexOf(P)!==-1}}}var h=function(L){return L?function(){return new WeakSet}:d}(r);function m(L){return function(j){var q=L||j;return function(N,$,H){H===void 0&&(H=h());var K=!!N&&typeof N=="object",ne=!!$&&typeof $=="object";if(K||ne){var W=K&&H.has(N),Z=ne&&H.has($);if(W||Z)return W&&Z;K&&H.add(N),ne&&H.add($)}return q(N,$,H)}}}function v(L,P,j,q){var F=L.length;if(P.length!==F)return!1;for(;F-- >0;)if(!j(L[F],P[F],q))return!1;return!0}function g(L,P,j,q){var F=L.size===P.size;if(F&&L.size){var N={};L.forEach(function($,H){if(F){var K=!1,ne=0;P.forEach(function(W,Z){!K&&!N[ne]&&(K=j(H,Z,q)&&j($,W,q),K&&(N[ne]=!0)),ne++}),F=K}})}return F}var y="_owner",S=Function.prototype.bind.call(Function.prototype.call,Object.prototype.hasOwnProperty);function x(L,P,j,q){var F=i(L),N=F.length;if(i(P).length!==N)return!1;if(N)for(var $=void 0;N-- >0;){if($=F[N],$===y){var H=f(L),K=f(P);if((H||K)&&H!==K)return!1}if(!S(P,$)||!j(L[$],P[$],q))return!1}return!0}function w(L,P){return L.source===P.source&&L.global===P.global&&L.ignoreCase===P.ignoreCase&&L.multiline===P.multiline&&L.unicode===P.unicode&&L.sticky===P.sticky&&L.lastIndex===P.lastIndex}function b(L,P,j,q){var F=L.size===P.size;if(F&&L.size){var N={};L.forEach(function($){if(F){var H=!1,K=0;P.forEach(function(ne){!H&&!N[K]&&(H=j($,ne,q),H&&(N[K]=!0)),K++}),F=H}})}return F}var _=typeof Map=="function",C=typeof Set=="function";function O(L){var P=typeof L=="function"?L(j):j;function j(q,F,N){if(q===F)return!0;if(q&&F&&typeof q=="object"&&typeof F=="object"){if(s(q)&&s(F))return x(q,F,P,N);var $=Array.isArray(q),H=Array.isArray(F);return $||H?$===H&&v(q,F,P,N):($=q instanceof Date,H=F instanceof Date,$||H?$===H&&u(q.getTime(),F.getTime()):($=q instanceof RegExp,H=F instanceof RegExp,$||H?$===H&&w(q,F):c(q)||c(F)?q===F:_&&($=q instanceof Map,H=F instanceof Map,$||H)?$===H&&g(q,F,P,N):C&&($=q instanceof Set,H=F instanceof Set,$||H)?$===H&&b(q,F,P,N):x(q,F,P,N)))}return q!==q&&F!==F}return j}var k=O(),D=O(function(){return u}),M=O(m()),T=O(m(u));n.circularDeepEqual=M,n.circularShallowEqual=T,n.createCustomEqual=O,n.deepEqual=k,n.sameValueZeroEqual=u,n.shallowEqual=D,Object.defineProperty(n,"__esModule",{value:!0})})}(jo,jo.exports)),jo.exports}var Kg,yA;function Zx(){if(yA)return Kg;yA=1;var e="Invariant failed";function t(n,r){if(!n)throw new Error(e)}return Kg=t,Kg}var Tl={},Vu={},_o={},vA;function N6(){if(vA)return _o;vA=1,Object.defineProperty(_o,"__esModule",{value:!0}),_o.Command=void 0;var e=function(){function t(n,r){var i=this;r===void 0&&(r={}),this.perform=function(){var u=n.perform();if(typeof u=="function"){var s=r.history;s&&(i.historyItem&&s.remove(i.historyItem),i.historyItem=s.add({perform:n.perform,negate:u}),i.history={undo:function(){return s.undo(i.historyItem)},redo:function(){return s.redo(i.historyItem)}})}}}return t}();return _o.Command=e,_o}var bA;function Tq(){if(bA)return Vu;bA=1;var e=Vu.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Vu,"__esModule",{value:!0}),Vu.ActionImpl=void 0;var t=e(Zx()),n=N6(),r=nu(),i=function(s){var c=s.keywords,f=c===void 0?"":c,d=s.section,h=d===void 0?"":d;return(f+" "+(typeof h=="string"?h:h.name)).trim()},u=function(){function s(c,f){var d=this,h;this.priority=r.Priority.NORMAL,this.ancestors=[],this.children=[],Object.assign(this,c),this.id=c.id,this.name=c.name,this.keywords=i(c);var m=c.perform;if(this.command=m&&new n.Command({perform:function(){return m(d)}},{history:f.history}),this.perform=(h=this.command)===null||h===void 0?void 0:h.perform,c.parent){var v=f.store[c.parent];(0,t.default)(v,"attempted to create an action whos parent: "+c.parent+" does not exist in the store."),v.addChild(this)}}return s.prototype.addChild=function(c){c.ancestors.unshift(this);for(var f=this.parentActionImpl;f;)c.ancestors.unshift(f),f=f.parentActionImpl;this.children.push(c)},s.prototype.removeChild=function(c){var f=this,d=this.children.indexOf(c);d!==-1&&this.children.splice(d,1),c.children&&c.children.forEach(function(h){f.removeChild(h)})},Object.defineProperty(s.prototype,"parentActionImpl",{get:function(){return this.ancestors[this.ancestors.length-1]},enumerable:!1,configurable:!0}),s.create=function(c,f){return new s(c,f)},s}();return Vu.ActionImpl=u,Vu}var xA;function Mq(){if(xA)return Tl;xA=1;var e=Tl.__assign||function(){return e=Object.assign||function(u){for(var s,c=1,f=arguments.length;c"u"||window.addEventListener("keydown",function(s){var c;if(!(!u.redoStack.length&&!u.undoStack.length||(0,e.shouldRejectKeystrokes)())){var f=(c=s.key)===null||c===void 0?void 0:c.toLowerCase();s.metaKey&&f==="z"&&s.shiftKey?u.redo():s.metaKey&&f==="z"&&u.undo()}})},i.prototype.add=function(u){var s=t.create(u);return this.undoStack.push(s),s},i.prototype.remove=function(u){var s=this.undoStack.findIndex(function(f){return f===u});if(s!==-1){this.undoStack.splice(s,1);return}var c=this.redoStack.findIndex(function(f){return f===u});c!==-1&&this.redoStack.splice(c,1)},i.prototype.undo=function(u){if(!u){var s=this.undoStack.pop();return s?(s==null||s.negate(),this.redoStack.push(s),s):void 0}var c=this.undoStack.findIndex(function(f){return f===u});if(c!==-1)return this.undoStack.splice(c,1),u.negate(),this.redoStack.push(u),u},i.prototype.redo=function(u){if(!u){var s=this.redoStack.pop();return s?(s==null||s.perform(),this.undoStack.push(s),s):void 0}var c=this.redoStack.findIndex(function(f){return f===u});if(c!==-1)return this.redoStack.splice(c,1),u.perform(),this.undoStack.push(u),u},i.prototype.reset=function(){this.undoStack.splice(0),this.redoStack.splice(0)},i}(),r=new n;return Ml.history=r,Object.freeze(r),Ml}var Wg={},EA;function ps(){return EA||(EA=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VisualState=void 0,function(t){t.animatingIn="animating-in",t.showing="showing",t.animatingOut="animating-out",t.hidden="hidden"}(e.VisualState||(e.VisualState={}))}(Wg)),Wg}var wA;function $6(){if(wA)return oa;wA=1;var e=oa.__assign||function(){return e=Object.assign||function(y){for(var S,x=1,w=arguments.length;x-1)return this.subscribers.splice(x,1)}},y.prototype.notify=function(){this.subscribers.forEach(function(S){return S.collect()})},y}(),g=function(){function y(S,x){this.collector=S,this.onChange=x}return y.prototype.collect=function(){try{var S=this.collector();(0,u.deepEqual)(S,this.collected)||(this.collected=S,this.onChange&&this.onChange(this.collected))}catch(x){console.warn(x)}},y}();return oa}var Ia={},zf={},CA;function U6(){if(CA)return zf;CA=1,Object.defineProperty(zf,"__esModule",{value:!0});var e=["Shift","Meta","Alt","Control"],t=1e3,n="keydown",r=typeof navigator=="object"&&/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"Meta":"Control";function i(f,d){return typeof f.getModifierState=="function"?f.getModifierState(d):!1}function u(f){return f.trim().split(" ").map(function(d){var h=d.split(/\b\+/),m=h.pop();return h=h.map(function(v){return v==="$mod"?r:v}),[h,m]})}function s(f,d){return/^[^A-Za-z0-9]$/.test(f.key)&&d[1]===f.key?!0:!(d[1].toUpperCase()!==f.key.toUpperCase()&&d[1]!==f.code||d[0].find(function(h){return!i(f,h)})||e.find(function(h){return!d[0].includes(h)&&d[1]!==h&&i(f,h)}))}function c(f,d,h){var m,v;h===void 0&&(h={});var g=(m=h.timeout)!==null&&m!==void 0?m:t,y=(v=h.event)!==null&&v!==void 0?v:n,S=Object.keys(d).map(function(_){return[u(_),d[_]]}),x=new Map,w=null,b=function(_){_ instanceof KeyboardEvent&&(S.forEach(function(C){var O=C[0],k=C[1],D=x.get(O),M=D||O,T=M[0],L=s(_,T);L?M.length>1?x.set(O,M.slice(1)):(x.delete(O),k(_)):i(_,_.key)||x.delete(O)}),w&&clearTimeout(w),w=setTimeout(x.clear.bind(x),g))};return f.addEventListener(y,b),function(){f.removeEventListener(y,b)}}return zf.default=c,zf}var _A;function B6(){if(_A)return Ia;_A=1;var e=Ia.__createBinding||(Object.create?function(x,w,b,_){_===void 0&&(_=b),Object.defineProperty(x,_,{enumerable:!0,get:function(){return w[b]}})}:function(x,w,b,_){_===void 0&&(_=b),x[_]=w[b]}),t=Ia.__setModuleDefault||(Object.create?function(x,w){Object.defineProperty(x,"default",{enumerable:!0,value:w})}:function(x,w){x.default=w}),n=Ia.__importStar||function(x){if(x&&x.__esModule)return x;var w={};if(x!=null)for(var b in x)b!=="default"&&Object.prototype.hasOwnProperty.call(x,b)&&e(w,x,b);return t(w,x),w},r=Ia.__importDefault||function(x){return x&&x.__esModule?x:{default:x}};Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.InternalEvents=void 0;var i=n(Kt()),u=r(U6()),s=ps(),c=al(),f=nu();function d(){return h(),m(),y(),S(),null}Ia.InternalEvents=d;function h(){var x,w,b=(0,c.useKBar)(function(L){return{visualState:L.visualState,showing:L.visualState!==s.VisualState.hidden,disabled:L.disabled}}),_=b.query,C=b.options,O=b.visualState,k=b.showing,D=b.disabled;i.useEffect(function(){var L,P=function(){_.setVisualState(function(F){return F===s.VisualState.hidden||F===s.VisualState.animatingOut?F:s.VisualState.animatingOut})};if(D){P();return}var j=C.toggleShortcut||"$mod+k",q=(0,u.default)(window,(L={},L[j]=function(F){var N,$,H,K;F.defaultPrevented||(F.preventDefault(),_.toggle(),k?($=(N=C.callbacks)===null||N===void 0?void 0:N.onClose)===null||$===void 0||$.call(N):(K=(H=C.callbacks)===null||H===void 0?void 0:H.onOpen)===null||K===void 0||K.call(H))},L.Escape=function(F){var N,$;k&&(F.stopPropagation(),F.preventDefault(),($=(N=C.callbacks)===null||N===void 0?void 0:N.onClose)===null||$===void 0||$.call(N)),P()},L));return function(){q()}},[C.callbacks,C.toggleShortcut,_,k,D]);var M=i.useRef(),T=i.useCallback(function(L){var P,j,q=0;L===s.VisualState.animatingIn&&(q=((P=C.animations)===null||P===void 0?void 0:P.enterMs)||0),L===s.VisualState.animatingOut&&(q=((j=C.animations)===null||j===void 0?void 0:j.exitMs)||0),clearTimeout(M.current),M.current=setTimeout(function(){var F=!1;_.setVisualState(function(){var N=L===s.VisualState.animatingIn?s.VisualState.showing:s.VisualState.hidden;return N===s.VisualState.hidden&&(F=!0),N}),F&&_.setCurrentRootAction(null)},q)},[(x=C.animations)===null||x===void 0?void 0:x.enterMs,(w=C.animations)===null||w===void 0?void 0:w.exitMs,_]);i.useEffect(function(){switch(O){case s.VisualState.animatingIn:case s.VisualState.animatingOut:T(O);break}},[T,O])}function m(){var x=(0,c.useKBar)(function(_){return{visualState:_.visualState}}),w=x.visualState,b=x.options;i.useEffect(function(){if(!b.disableDocumentLock)if(w===s.VisualState.animatingIn){if(document.body.style.overflow="hidden",!b.disableScrollbarManagement){var _=(0,f.getScrollbarWidth)(),C=getComputedStyle(document.body)["margin-right"];C&&(_+=Number(C.replace(/\D/g,""))),document.body.style.marginRight=_+"px"}}else w===s.VisualState.hidden&&(document.body.style.removeProperty("overflow"),b.disableScrollbarManagement||document.body.style.removeProperty("margin-right"))},[b.disableDocumentLock,b.disableScrollbarManagement,w])}var v=new WeakSet;function g(x){return function(w){v.has(w)||(x(w),v.add(w))}}function y(){var x=(0,c.useKBar)(function(k){return{actions:k.actions,open:k.visualState===s.VisualState.showing,disabled:k.disabled}}),w=x.actions,b=x.query,_=x.open,C=x.options,O=x.disabled;i.useEffect(function(){var k;if(!(_||O)){for(var D=Object.keys(w).map(function(H){return w[H]}),M=[],T=0,L=D;T`Invalid value for key ${e}`,G6=e=>`Pattern length exceeds max of ${e}.`,Y6=e=>`Missing ${e} property in key`,X6=e=>`Property 'weight' in key '${e}' must be a positive integer`,RA=Object.prototype.hasOwnProperty;class Z6{constructor(t){this._keys=[],this._keyMap={};let n=0;t.forEach(r=>{let i=jq(r);n+=i.weight,this._keys.push(i),this._keyMap[i.id]=i,n+=i.weight}),this._keys.forEach(r=>{r.weight/=n})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function jq(e){let t=null,n=null,r=null,i=1,u=null;if(pa(e)||ai(e))r=e,t=kA(e),n=lx(e);else{if(!RA.call(e,"name"))throw new Error(Y6("name"));const s=e.name;if(r=s,RA.call(e,"weight")&&(i=e.weight,i<=0))throw new Error(X6(s));t=kA(s),n=lx(s),u=e.getFn}return{path:t,id:n,weight:i,src:r,getFn:u}}function kA(e){return ai(e)?e:e.split(".")}function lx(e){return ai(e)?e.join("."):e}function J6(e,t){let n=[],r=!1;const i=(u,s,c)=>{if(dr(u))if(!s[c])n.push(u);else{let f=s[c];const d=u[f];if(!dr(d))return;if(c===s.length-1&&(pa(d)||Lq(d)||V6(d)))n.push(H6(d));else if(ai(d)){r=!0;for(let h=0,m=d.length;he.score===t.score?e.idx{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,pa(this.docs[0])?this.docs.forEach((t,n)=>{this._addString(t,n)}):this.docs.forEach((t,n)=>{this._addObject(t,n)}),this.norm.clear())}add(t){const n=this.size();pa(t)?this._addString(t,n):this._addObject(t,n)}removeAt(t){this.records.splice(t,1);for(let n=t,r=this.size();n{let s=i.getFn?i.getFn(t):this.getFn(t,i.path);if(dr(s)){if(ai(s)){let c=[];const f=[{nestedArrIndex:-1,value:s}];for(;f.length;){const{nestedArrIndex:d,value:h}=f.pop();if(dr(h))if(pa(h)&&!Qg(h)){let m={v:h,i:d,n:this.norm.get(h)};c.push(m)}else ai(h)&&h.forEach((m,v)=>{f.push({nestedArrIndex:v,value:m})})}r.$[u]=c}else if(pa(s)&&!Qg(s)){let c={v:s,n:this.norm.get(s)};r.$[u]=c}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function Fq(e,t,{getFn:n=Ye.getFn,fieldNormWeight:r=Ye.fieldNormWeight}={}){const i=new Jx({getFn:n,fieldNormWeight:r});return i.setKeys(e.map(jq)),i.setSources(t),i.create(),i}function l8(e,{getFn:t=Ye.getFn,fieldNormWeight:n=Ye.fieldNormWeight}={}){const{keys:r,records:i}=e,u=new Jx({getFn:t,fieldNormWeight:n});return u.setKeys(r),u.setIndexRecords(i),u}function $f(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:i=Ye.distance,ignoreLocation:u=Ye.ignoreLocation}={}){const s=t/e.length;if(u)return s;const c=Math.abs(r-n);return i?s+c/i:c?1:s}function u8(e=[],t=Ye.minMatchCharLength){let n=[],r=-1,i=-1,u=0;for(let s=e.length;u=t&&n.push([r,i]),r=-1)}return e[u-1]&&u-r>=t&&n.push([r,u-1]),n}const Pl=32;function s8(e,t,n,{location:r=Ye.location,distance:i=Ye.distance,threshold:u=Ye.threshold,findAllMatches:s=Ye.findAllMatches,minMatchCharLength:c=Ye.minMatchCharLength,includeMatches:f=Ye.includeMatches,ignoreLocation:d=Ye.ignoreLocation}={}){if(t.length>Pl)throw new Error(G6(Pl));const h=t.length,m=e.length,v=Math.max(0,Math.min(r,m));let g=u,y=v;const S=c>1||f,x=S?Array(m):[];let w;for(;(w=e.indexOf(t,y))>-1;){let D=$f(t,{currentLocation:w,expectedLocation:v,distance:i,ignoreLocation:d});if(g=Math.min(D,g),y=w+h,S){let M=0;for(;M=L;F-=1){let N=F-1,$=n[e.charAt(N)];if(S&&(x[N]=+!!$),j[F]=(j[F+1]<<1|1)&$,D&&(j[F]|=(b[F+1]|b[F])<<1|1|b[F+1]),j[F]&O&&(_=$f(t,{errors:D,currentLocation:N,expectedLocation:v,distance:i,ignoreLocation:d}),_<=g)){if(g=_,y=N,y<=v)break;L=Math.max(1,2*v-y)}}if($f(t,{errors:D+1,currentLocation:v,expectedLocation:v,distance:i,ignoreLocation:d})>g)break;b=j}const k={isMatch:y>=0,score:Math.max(.001,_)};if(S){const D=u8(x,c);D.length?f&&(k.indices=D):k.isMatch=!1}return k}function o8(e){let t={};for(let n=0,r=e.length;n{this.chunks.push({pattern:v,alphabet:o8(v),startIndex:g})},m=this.pattern.length;if(m>Pl){let v=0;const g=m%Pl,y=m-g;for(;v{const{isMatch:w,score:b,indices:_}=s8(t,y,S,{location:i+x,distance:u,threshold:s,findAllMatches:c,minMatchCharLength:f,includeMatches:r,ignoreLocation:d});w&&(v=!0),m+=b,w&&_&&(h=[...h,..._])});let g={isMatch:v,score:v?m/this.chunks.length:1};return v&&r&&(g.indices=h),g}}class il{constructor(t){this.pattern=t}static isMultiMatch(t){return TA(t,this.multiRegex)}static isSingleMatch(t){return TA(t,this.singleRegex)}search(){}}function TA(e,t){const n=e.match(t);return n?n[1]:null}class c8 extends il{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const n=t===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class f8 extends il{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const r=t.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class d8 extends il{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const n=t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class h8 extends il{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const n=!t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class p8 extends il{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const n=t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class m8 extends il{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const n=!t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class zq extends il{constructor(t,{location:n=Ye.location,threshold:r=Ye.threshold,distance:i=Ye.distance,includeMatches:u=Ye.includeMatches,findAllMatches:s=Ye.findAllMatches,minMatchCharLength:c=Ye.minMatchCharLength,isCaseSensitive:f=Ye.isCaseSensitive,ignoreLocation:d=Ye.ignoreLocation}={}){super(t),this._bitapSearch=new Nq(t,{location:n,threshold:r,distance:i,includeMatches:u,findAllMatches:s,minMatchCharLength:c,isCaseSensitive:f,ignoreLocation:d})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class $q extends il{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let n=0,r;const i=[],u=this.pattern.length;for(;(r=t.indexOf(this.pattern,n))>-1;)n=r+u,i.push([r,n-1]);const s=!!i.length;return{isMatch:s,score:s?0:1,indices:i}}}const ux=[c8,$q,d8,h8,m8,p8,f8,zq],MA=ux.length,g8=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,y8="|";function v8(e,t={}){return e.split(y8).map(n=>{let r=n.trim().split(g8).filter(u=>u&&!!u.trim()),i=[];for(let u=0,s=r.length;u!!(e[kd.AND]||e[kd.OR]),E8=e=>!!e[cx.PATH],w8=e=>!ai(e)&&qq(e)&&!fx(e),DA=e=>({[kd.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Uq(e,t,{auto:n=!0}={}){const r=i=>{let u=Object.keys(i);const s=E8(i);if(!s&&u.length>1&&!fx(i))return r(DA(i));if(w8(i)){const f=s?i[cx.PATH]:u[0],d=s?i[cx.PATTERN]:i[f];if(!pa(d))throw new Error(Q6(f));const h={keyId:lx(f),pattern:d};return n&&(h.searcher=ox(d,t)),h}let c={children:[],operator:u[0]};return u.forEach(f=>{const d=i[f];ai(d)&&d.forEach(h=>{c.children.push(r(h))})}),c};return fx(e)||(e=DA(e)),r(e)}function C8(e,{ignoreFieldNorm:t=Ye.ignoreFieldNorm}){e.forEach(n=>{let r=1;n.matches.forEach(({key:i,norm:u,score:s})=>{const c=i?i.weight:null;r*=Math.pow(s===0&&c?Number.EPSILON:s,(c||1)*(t?1:u))}),n.score=r})}function _8(e,t){const n=e.matches;t.matches=[],dr(n)&&n.forEach(r=>{if(!dr(r.indices)||!r.indices.length)return;const{indices:i,value:u}=r;let s={indices:i,value:u};r.key&&(s.key=r.key.src),r.idx>-1&&(s.refIndex=r.idx),t.matches.push(s)})}function O8(e,t){t.score=e.score}function A8(e,t,{includeMatches:n=Ye.includeMatches,includeScore:r=Ye.includeScore}={}){const i=[];return n&&i.push(_8),r&&i.push(O8),e.map(u=>{const{idx:s}=u,c={item:t[s],refIndex:s};return i.length&&i.forEach(f=>{f(u,c)}),c})}class ms{constructor(t,n={},r){this.options={...Ye,...n},this.options.useExtendedSearch,this._keyStore=new Z6(this.options.keys),this.setCollection(t,r)}setCollection(t,n){if(this._docs=t,n&&!(n instanceof Jx))throw new Error(W6);this._myIndex=n||Fq(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){dr(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const n=[];for(let r=0,i=this._docs.length;r-1&&(f=f.slice(0,n)),A8(f,this._docs,{includeMatches:r,includeScore:i})}_searchStringList(t){const n=ox(t,this.options),{records:r}=this._myIndex,i=[];return r.forEach(({v:u,i:s,n:c})=>{if(!dr(u))return;const{isMatch:f,score:d,indices:h}=n.searchIn(u);f&&i.push({item:u,idx:s,matches:[{score:d,value:u,norm:c,indices:h}]})}),i}_searchLogical(t){const n=Uq(t,this.options),r=(c,f,d)=>{if(!c.children){const{keyId:m,searcher:v}=c,g=this._findMatches({key:this._keyStore.get(m),value:this._myIndex.getValueForItemAtKeyId(f,m),searcher:v});return g&&g.length?[{idx:d,item:f,matches:g}]:[]}const h=[];for(let m=0,v=c.children.length;m{if(dr(c)){let d=r(n,c,f);d.length&&(u[f]||(u[f]={idx:f,item:c,matches:[]},s.push(u[f])),d.forEach(({matches:h})=>{u[f].matches.push(...h)}))}}),s}_searchObjectList(t){const n=ox(t,this.options),{keys:r,records:i}=this._myIndex,u=[];return i.forEach(({$:s,i:c})=>{if(!dr(s))return;let f=[];r.forEach((d,h)=>{f.push(...this._findMatches({key:d,value:s[h],searcher:n}))}),f.length&&u.push({idx:c,item:s,matches:f})}),u}_findMatches({key:t,value:n,searcher:r}){if(!dr(n))return[];let i=[];if(ai(n))n.forEach(({v:u,i:s,n:c})=>{if(!dr(u))return;const{isMatch:f,score:d,indices:h}=r.searchIn(u);f&&i.push({score:d,key:t,value:u,idx:s,norm:c,indices:h})});else{const{v:u,n:s}=n,{isMatch:c,score:f,indices:d}=r.searchIn(u);c&&i.push({score:f,key:t,value:u,norm:s,indices:d})}return i}}ms.version="6.6.2";ms.createIndex=Fq;ms.parseIndex=l8;ms.config=Ye;ms.parseQuery=Uq;S8(x8);const R8=Object.freeze(Object.defineProperty({__proto__:null,default:ms},Symbol.toStringTag,{value:"Module"})),k8=Dx(R8);var LA;function T8(){return LA||(LA=1,function(e){var t=kl.__createBinding||(Object.create?function(g,y,S,x){x===void 0&&(x=S),Object.defineProperty(g,x,{enumerable:!0,get:function(){return y[S]}})}:function(g,y,S,x){x===void 0&&(x=S),g[x]=y[S]}),n=kl.__setModuleDefault||(Object.create?function(g,y){Object.defineProperty(g,"default",{enumerable:!0,value:y})}:function(g,y){g.default=y}),r=kl.__importStar||function(g){if(g&&g.__esModule)return g;var y={};if(g!=null)for(var S in g)S!=="default"&&Object.prototype.hasOwnProperty.call(g,S)&&t(y,g,S);return n(y,g),y},i=kl.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(e,"__esModule",{value:!0}),e.useDeepMatches=e.useMatches=e.NO_GROUP=void 0;var u=r(Kt()),s=al(),c=nu(),f=i(k8);e.NO_GROUP={name:"none",priority:c.Priority.NORMAL};var d={keys:[{name:"name",weight:.5},{name:"keywords",getFn:function(g){var y;return((y=g.keywords)!==null&&y!==void 0?y:"").split(",")},weight:.5},"subtitle"],ignoreLocation:!0,includeScore:!0,includeMatches:!0,threshold:.2,minMatchCharLength:1};function h(g,y){return y.priority-g.priority}function m(){var g=(0,s.useKBar)(function(T){return{search:T.searchQuery,actions:T.actions,rootActionId:T.currentRootActionId}}),y=g.search,S=g.actions,x=g.rootActionId,w=u.useMemo(function(){return Object.keys(S).reduce(function(T,L){var P=S[L];if(!P.parent&&!x&&T.push(P),P.id===x)for(var j=0;j0){for(var $=q[N].children,H=0;H<$.length;H++)F.push($[H]);j(q[N].children,F)}return F}(T)},[]),_=!y,C=u.useMemo(function(){return _?w:b(w)},[b,w,_]),O=u.useMemo(function(){return new f.default(C,d)},[C]),k=v(C,y,O),D=u.useMemo(function(){for(var T,L,P={},j=[],q=[],F=0;F{for(var w in x)t(S,w,{get:x[w],enumerable:!0})},c=(S,x,w,b)=>{if(x&&typeof x=="object"||typeof x=="function")for(let _ of r(x))!u.call(S,_)&&_!==w&&t(S,_,{get:()=>x[_],enumerable:!(b=n(x,_))||b.enumerable});return S},f=(S,x,w)=>(w=S!=null?e(i(S)):{},c(!S||!S.__esModule?t(w,"default",{value:S,enumerable:!0}):w,S)),d=S=>c(t({},"__esModule",{value:!0}),S),h={};s(h,{composeRefs:()=>g,useComposedRefs:()=>y}),Gg=d(h);var m=f(Kt());function v(S,x){if(typeof S=="function")return S(x);S!=null&&(S.current=x)}function g(...S){return x=>{let w=!1;const b=S.map(_=>{const C=v(_,x);return!w&&typeof C=="function"&&(w=!0),C});if(w)return()=>{for(let _=0;_{for(var D in k)t(O,D,{get:k[D],enumerable:!0})},c=(O,k,D,M)=>{if(k&&typeof k=="object"||typeof k=="function")for(let T of r(k))!u.call(O,T)&&T!==D&&t(O,T,{get:()=>k[T],enumerable:!(M=n(k,T))||M.enumerable});return O},f=(O,k,D)=>(D=O!=null?e(i(O)):{},c(!O||!O.__esModule?t(D,"default",{value:O,enumerable:!0}):D,O)),d=O=>c(t({},"__esModule",{value:!0}),O),h={};s(h,{Root:()=>C,Slot:()=>y,Slottable:()=>x}),Yg=d(h);var m=f(Kt()),v=M8(),g=Ox(),y=m.forwardRef((O,k)=>{const{children:D,...M}=O,T=m.Children.toArray(D),L=T.find(w);if(L){const P=L.props.children,j=T.map(q=>q===L?m.Children.count(P)>1?m.Children.only(null):m.isValidElement(P)?P.props.children:null:q);return(0,g.jsx)(S,{...M,ref:k,children:m.isValidElement(P)?m.cloneElement(P,void 0,j):null})}return(0,g.jsx)(S,{...M,ref:k,children:D})});y.displayName="Slot";var S=m.forwardRef((O,k)=>{const{children:D,...M}=O;if(m.isValidElement(D)){const T=_(D);return m.cloneElement(D,{...b(M,D.props),ref:k?(0,v.composeRefs)(k,T):T})}return m.Children.count(D)>1?m.Children.only(null):null});S.displayName="SlotClone";var x=({children:O})=>(0,g.jsx)(g.Fragment,{children:O});function w(O){return m.isValidElement(O)&&O.type===x}function b(O,k){const D={...k};for(const M in k){const T=O[M],L=k[M];/^on[A-Z]/.test(M)?T&&L?D[M]=(...j)=>{L(...j),T(...j)}:T&&(D[M]=T):M==="style"?D[M]={...T,...L}:M==="className"&&(D[M]=[T,L].filter(Boolean).join(" "))}return{...O,...D}}function _(O){var M,T;let k=(M=Object.getOwnPropertyDescriptor(O.props,"ref"))==null?void 0:M.get,D=k&&"isReactWarning"in k&&k.isReactWarning;return D?O.ref:(k=(T=Object.getOwnPropertyDescriptor(O,"ref"))==null?void 0:T.get,D=k&&"isReactWarning"in k&&k.isReactWarning,D?O.props.ref:O.props.ref||O.ref)}var C=y;return Yg}var Xg,jA;function L8(){if(jA)return Xg;jA=1;var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,s=(_,C)=>{for(var O in C)t(_,O,{get:C[O],enumerable:!0})},c=(_,C,O,k)=>{if(C&&typeof C=="object"||typeof C=="function")for(let D of r(C))!u.call(_,D)&&D!==O&&t(_,D,{get:()=>C[D],enumerable:!(k=n(C,D))||k.enumerable});return _},f=(_,C,O)=>(O=_!=null?e(i(_)):{},c(!_||!_.__esModule?t(O,"default",{value:_,enumerable:!0}):O,_)),d=_=>c(t({},"__esModule",{value:!0}),_),h={};s(h,{Primitive:()=>x,Root:()=>b,dispatchDiscreteCustomEvent:()=>w}),Xg=d(h);var m=f(Kt()),v=f(_x()),g=D8(),y=Ox(),S=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],x=S.reduce((_,C)=>{const O=m.forwardRef((k,D)=>{const{asChild:M,...T}=k,L=M?g.Slot:C;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,y.jsx)(L,{...T,ref:D})});return O.displayName=`Primitive.${C}`,{..._,[C]:O}},{});function w(_,C){_&&v.flushSync(()=>_.dispatchEvent(C))}var b=x;return Xg}var Zg,FA;function q8(){if(FA)return Zg;FA=1;var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,s=(g,y)=>{for(var S in y)t(g,S,{get:y[S],enumerable:!0})},c=(g,y,S,x)=>{if(y&&typeof y=="object"||typeof y=="function")for(let w of r(y))!u.call(g,w)&&w!==S&&t(g,w,{get:()=>y[w],enumerable:!(x=n(y,w))||x.enumerable});return g},f=(g,y,S)=>(S=g!=null?e(i(g)):{},c(!g||!g.__esModule?t(S,"default",{value:g,enumerable:!0}):S,g)),d=g=>c(t({},"__esModule",{value:!0}),g),h={};s(h,{useLayoutEffect:()=>v}),Zg=d(h);var m=f(Kt()),v=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{};return Zg}var Jg,NA;function P8(){if(NA)return Jg;NA=1;var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,s=(_,C)=>{for(var O in C)t(_,O,{get:C[O],enumerable:!0})},c=(_,C,O,k)=>{if(C&&typeof C=="object"||typeof C=="function")for(let D of r(C))!u.call(_,D)&&D!==O&&t(_,D,{get:()=>C[D],enumerable:!(k=n(C,D))||k.enumerable});return _},f=(_,C,O)=>(O=_!=null?e(i(_)):{},c(!_||!_.__esModule?t(O,"default",{value:_,enumerable:!0}):O,_)),d=_=>c(t({},"__esModule",{value:!0}),_),h={};s(h,{Portal:()=>w,Root:()=>b}),Jg=d(h);var m=f(Kt()),v=f(_x()),g=L8(),y=q8(),S=Ox(),x="Portal",w=m.forwardRef((_,C)=>{var L;const{container:O,...k}=_,[D,M]=m.useState(!1);(0,y.useLayoutEffect)(()=>M(!0),[]);const T=O||D&&((L=globalThis==null?void 0:globalThis.document)==null?void 0:L.body);return T?v.default.createPortal((0,S.jsx)(g.Primitive.div,{...k,ref:C}),T):null});w.displayName=x;var b=w;return Jg}var zA;function j8(){if(zA)return ji;zA=1;var e=ji.__createBinding||(Object.create?function(f,d,h,m){m===void 0&&(m=h),Object.defineProperty(f,m,{enumerable:!0,get:function(){return d[h]}})}:function(f,d,h,m){m===void 0&&(m=h),f[m]=d[h]}),t=ji.__setModuleDefault||(Object.create?function(f,d){Object.defineProperty(f,"default",{enumerable:!0,value:d})}:function(f,d){f.default=d}),n=ji.__importStar||function(f){if(f&&f.__esModule)return f;var d={};if(f!=null)for(var h in f)h!=="default"&&Object.prototype.hasOwnProperty.call(f,h)&&e(d,f,h);return t(d,f),d};Object.defineProperty(ji,"__esModule",{value:!0}),ji.KBarPortal=void 0;var r=P8(),i=n(Kt()),u=ps(),s=al();function c(f){var d=f.children,h=f.container,m=(0,s.useKBar)(function(v){return{showing:v.visualState!==u.VisualState.hidden}}).showing;return m?i.createElement(r.Portal,{container:h},d):null}return ji.KBarPortal=c,ji}var ca={},$A;function F8(){if($A)return ca;$A=1;var e=ca.__assign||function(){return e=Object.assign||function(f){for(var d,h=1,m=arguments.length;h=0)&&(n[i]=e[i]);return n}var z8=["bottom","height","left","right","top","width"],$8=function(t,n){return t===void 0&&(t={}),n===void 0&&(n={}),z8.some(function(r){return t[r]!==n[r]})},$i=new Map,Iq,U8=function e(){var t=[];$i.forEach(function(n,r){var i=r.getBoundingClientRect();$8(i,n.rect)&&(n.rect=i,t.push(n))}),t.forEach(function(n){n.callbacks.forEach(function(r){return r(n.rect)})}),Iq=window.requestAnimationFrame(e)};function B8(e,t){return{observe:function(){var r=$i.size===0;$i.has(e)?$i.get(e).callbacks.push(t):$i.set(e,{rect:void 0,hasRectChanged:!1,callbacks:[t]}),r&&U8()},unobserve:function(){var r=$i.get(e);if(r){var i=r.callbacks.indexOf(t);i>=0&&r.callbacks.splice(i,1),r.callbacks.length||$i.delete(e),$i.size||cancelAnimationFrame(Iq)}}}}var Td=typeof window<"u"?R.useLayoutEffect:R.useEffect;function I8(e,t){t===void 0&&(t={width:0,height:0});var n=R.useState(e.current),r=n[0],i=n[1],u=R.useReducer(H8,t),s=u[0],c=u[1],f=R.useRef(!1);return Td(function(){e.current!==r&&i(e.current)}),Td(function(){if(r&&!f.current){f.current=!0;var d=r.getBoundingClientRect();c({rect:d})}},[r]),R.useEffect(function(){if(r){var d=B8(r,function(h){c({rect:h})});return d.observe(),function(){d.unobserve()}}},[r]),s}function H8(e,t){var n=t.rect;return e.height!==n.height||e.width!==n.width?n:e}var V8=function(){return 50},K8=function(t){return t},W8=function(t,n){var r=n?"offsetWidth":"offsetHeight";return t[r]},Hq=function(t){for(var n=Math.max(t.start-t.overscan,0),r=Math.min(t.end+t.overscan,t.size-1),i=[],u=n;u<=r;u++)i.push(u);return i};function Q8(e){var t,n=e.size,r=n===void 0?0:n,i=e.estimateSize,u=i===void 0?V8:i,s=e.overscan,c=s===void 0?1:s,f=e.paddingStart,d=f===void 0?0:f,h=e.paddingEnd,m=h===void 0?0:h,v=e.parentRef,g=e.horizontal,y=e.scrollToFn,S=e.useObserver,x=e.initialRect,w=e.onScrollElement,b=e.scrollOffsetFn,_=e.keyExtractor,C=_===void 0?K8:_,O=e.measureSize,k=O===void 0?W8:O,D=e.rangeExtractor,M=D===void 0?Hq:D,T=g?"width":"height",L=g?"scrollLeft":"scrollTop",P=R.useRef({scrollOffset:0,measurements:[]}),j=R.useState(0),q=j[0],F=j[1];P.current.scrollOffset=q;var N=S||I8,$=N(v,x),H=$[T];P.current.outerSize=H;var K=R.useCallback(function(te){v.current&&(v.current[L]=te)},[v,L]),ne=y||K;y=R.useCallback(function(te){ne(te,K)},[K,ne]);var W=R.useState({}),Z=W[0],X=W[1],Y=R.useCallback(function(){return X({})},[]),I=R.useRef([]),ae=R.useMemo(function(){var te=I.current.length>0?Math.min.apply(Math,I.current):0;I.current=[];for(var re=P.current.measurements.slice(0,te),de=te;de=Le+Fe?be="end":be="start"),be==="start"?y(te):be==="end"?y(te-Fe):be==="center"&&y(te-Fe/2)},[y]),fe=R.useCallback(function(te,re){var de=re===void 0?{}:re,_e=de.align,be=_e===void 0?"auto":_e,De=N8(de,["align"]),Le=P.current,Fe=Le.measurements,je=Le.scrollOffset,Ne=Le.outerSize,ot=Fe[Math.max(0,Math.min(te,r-1))];if(ot){if(be==="auto")if(ot.end>=je+Ne)be="end";else if(ot.start<=je)be="start";else return;var ut=be==="center"?ot.start+ot.size/2:be==="end"?ot.end:ot.start;ce(ut,jl({align:be},De))}},[ce,r]),G=R.useCallback(function(){for(var te=arguments.length,re=new Array(te),de=0;dei)n=u-1;else return u}return t>0?t-1:0};function Y8(e){for(var t=e.measurements,n=e.outerSize,r=e.scrollOffset,i=t.length-1,u=function(d){return t[d].start},s=G8(0,i,u,r),c=s;cd?j-1:j;if(typeof y.current[q]=="string"){if(q===0)return j;q-=1}return q})):L.key==="ArrowDown"||L.ctrlKey&&L.key==="n"?(L.preventDefault(),L.stopPropagation(),w.setActiveIndex(function(j){var q=jaH(e,"name",{value:t,configurable:!0}),Ku=Za(e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()),"capitalize"),iH=Za(()=>{let e=Je(),{resource:t,resources:n,id:r,action:i}=st(),u=Ot(),s=ac(),c=Fn(),{mutate:f}=gq(),{push:d,list:h,create:m,show:v,edit:g}=Nn(),y=Ea(),S=Q.useContext(Bn.KBarContext),{can:x}=B5(),[w,b]=Q.useState([]);Q.useEffect(()=>{Za(async()=>await Promise.all(_().flatMap(O=>C(O))),"preaparedActions")().then(O=>b(O.flatMap(k=>k)))},[n,r,t,i]),Q.useEffect(()=>{w.length===0&&S.query.setVisualState(Bn.VisualState.hidden)},[w]);let _=Za(()=>{let O=[...n],k=O==null?void 0:O.findIndex(D=>(D.identifier??(D==null?void 0:D.name))===((t==null?void 0:t.identifier)??(t==null?void 0:t.name)));if(k>0){let D=O[k];O.splice(k,1),O.splice(0,0,D)}return O},"moveActionToFirst"),C=Za(async O=>{var k,D,M,T,L,P;let{name:j,label:q,list:F,create:N,canCreate:$,canEdit:H,canShow:K,icon:ne,show:W,canDelete:Z,edit:X,route:Y}=O,I=((k=O==null?void 0:O.meta)==null?void 0:k.label)??((D=O==null?void 0:O.options)==null?void 0:D.label)??q,ae=((M=O==null?void 0:O.meta)==null?void 0:M.icon)??((T=O==null?void 0:O.options)==null?void 0:T.icon)??ne,se=((L=O==null?void 0:O.meta)==null?void 0:L.canDelete)??((P=O==null?void 0:O.options)==null?void 0:P.canDelete)??Z,ie=I??e(`${O.name}.${O.name}`,y(O.name,"plural")),oe=[];if(F&&(t!==void 0&&(t==null?void 0:t.name)!==j||i!==void 0&&(t==null?void 0:t.name)===j)){let{can:V}=await(x==null?void 0:x({resource:j,action:"list",params:{id:r,resource:O}}))||{can:!0};V&&oe.push(Bn.createAction({name:e("actions.list",Ku("list")),section:ie,icon:ae,perform:()=>{let ue=s({resource:O,action:"list",legacy:u==="legacy"});ue&&(u==="legacy"?d(ue):c({to:ue}))}}))}if(($||N)&&N&&(i!=="create"||(t==null?void 0:t.name)!==j)){let{can:V}=await(x==null?void 0:x({resource:j,action:"create",params:{resource:O}}))||{can:!0};V&&oe.push(Bn.createAction({name:e("actions.create",Ku("create")),section:ie,icon:ae,keywords:"new",perform:()=>{let ue=s({resource:O,action:"create",legacy:u==="legacy"});ue&&(u==="legacy"?d(ue):c({to:ue}))}}))}if((t==null?void 0:t.name)===j&&r){if((K||W)&&W&&i!=="show"){let{can:V}=await(x==null?void 0:x({resource:j,action:"show",params:{id:r,resource:O}}))||{can:!0};V&&oe.push(Bn.createAction({name:e("actions.show",Ku("show")),section:ie,icon:ae,perform:()=>{let ue=s({resource:O,action:"show",legacy:u==="legacy",meta:{id:r}});ue&&(u==="legacy"?d(ue):c({to:ue}))}}))}if((H||X)&&X&&i!=="edit"){let{can:V}=await(x==null?void 0:x({resource:j,action:"edit",params:{id:r,resource:O}}))||{can:!0};V&&oe.push(Bn.createAction({name:e("actions.edit",Ku("edit")),section:ie,icon:ae,perform:()=>{let ue=s({resource:O,action:"edit",legacy:u==="legacy",meta:{id:r}});ue&&(u==="legacy"?d(ue):c({to:ue}))}}))}if(se){let{can:V}=await(x==null?void 0:x({resource:j,action:"delete",params:{id:r,resource:O}}))||{can:!0};V&&oe.push({id:"delete",name:e("actions.delete",Ku("delete")),section:ie,icon:ae},Bn.createAction({name:e("buttons.delete",Ku("delete")),section:e("buttons.confirm","Are you sure?"),parent:"delete",perform:()=>{f({resource:O.name,id:r},{onSuccess:()=>{let ue=s({resource:O,action:"list",legacy:u==="legacy"});ue&&(u==="legacy"?d(ue):c({to:ue}))}})}}),Bn.createAction({name:e("buttons.cancel","Cancel"),parent:"delete",perform:()=>null}))}}return oe},"createActionWithResource");Bn.useRegisterActions(w,[w])},"useRefineKbar"),lH=Za(()=>R.createElement(Bn.KBarPortal,null,R.createElement(Bn.KBarPositioner,{style:{opacity:1,transition:"background 0.35s cubic-bezier(0.4, 0, 0.2, 1) 0s",backdropFilter:"saturate(180%) blur(1px)",background:"rgba(0, 0, 0, 0.1)",zIndex:"9999"}},R.createElement(Bn.KBarAnimator,{style:{maxWidth:"600px",width:"100%",background:"white",color:"black",borderRadius:"8px",overflow:"hidden",boxShadow:"0px 4px 4px rgba(0, 0, 0, 0.25)"}},R.createElement(Bn.KBarSearch,{style:{padding:"12px 16px",fontSize:"16px",width:"100%",boxSizing:"border-box",outline:"none",border:"none",background:"rgb(252 252 252)",color:"black"}}),R.createElement(sH,null)))),"CommandBar"),uH={padding:"8px 16px",fontSize:"14px",textTransform:"uppercase",fontWeight:"bold",opacity:.5},sH=Za(()=>{let{results:e,rootActionId:t}=Bn.useMatches();return R.createElement(Bn.KBarResults,{items:e,onRender:({item:n,active:r})=>typeof n=="string"?R.createElement("div",{style:uH},n):R.createElement(Vq,{action:n,active:r,currentRootActionId:t})})},"RenderResults"),Vq=R.forwardRef(({action:e,active:t,currentRootActionId:n},r)=>{var i;let u=R.useMemo(()=>{if(!n)return e.ancestors;let s=e.ancestors.findIndex(c=>c.id===n);return e.ancestors.slice(s+1)},[e.ancestors,n]);return R.createElement("div",{ref:r,style:{padding:"12px 16px",background:t?"rgba(0 0 0 / 0.05)":"transparent",borderLeft:`2px solid ${t?"rgb(28 28 29)":"transparent"}`,display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer"}},R.createElement("div",{style:{display:"flex",gap:"8px",alignItems:"center",fontSize:14}},e.icon&&e.icon,R.createElement("div",{style:{display:"flex",flexDirection:"column"}},R.createElement("div",null,u.length>0&&u.map(s=>R.createElement(R.Fragment,{key:s.id},R.createElement("span",{style:{opacity:.5,marginRight:8}},s.name),R.createElement("span",{style:{marginRight:8}},"›"))),R.createElement("span",{style:{color:e.name.toLocaleUpperCase()==="DELETE"?"red":"black"}},e.name)),e.subtitle&&R.createElement("span",{style:{fontSize:12}},e.subtitle))),(i=e.shortcut)!=null&&i.length?R.createElement("div",{"aria-hidden":!0,style:{display:"grid",gridAutoFlow:"column",gap:"4px"}},e.shortcut.map(s=>R.createElement("kbd",{key:s,style:{padding:"4px 6px",background:"rgba(0 0 0 / .1)",borderRadius:"4px",fontSize:14}},s))):null)});Vq.displayName="ResultItem";var oH=Za(({commandBarProps:e})=>{let t=Q.useContext(Kq);iH();let n={...t,...e};return R.createElement(lH,{...n})},"RefineKbar"),Kq=Q.createContext({}),cH=Za(({children:e,commandBarProps:t})=>R.createElement(Kq.Provider,{value:t??{}},R.createElement(Bn.KBarProvider,null,e)),"RefineKbarProvider");function Wq(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t=0)&&(n[i]=e[i]);return n}function WA(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Qq=R.createContext(),pH={mui:{root:{},anchorOriginTopCenter:{},anchorOriginBottomCenter:{},anchorOriginTopRight:{},anchorOriginBottomRight:{},anchorOriginTopLeft:{},anchorOriginBottomLeft:{}},container:{containerRoot:{},containerAnchorOriginTopCenter:{},containerAnchorOriginBottomCenter:{},containerAnchorOriginTopRight:{},containerAnchorOriginBottomRight:{},containerAnchorOriginTopLeft:{},containerAnchorOriginBottomLeft:{}}},Ka={view:{default:20,dense:4},snackbar:{default:6,dense:2}},zl={maxSnack:3,dense:!1,hideIconVariant:!1,variant:"default",autoHideDuration:5e3,anchorOrigin:{vertical:"bottom",horizontal:"left"},TransitionComponent:b4,transitionDuration:{enter:225,exit:195}},$o=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},mH=function(t){return""+$o(t.vertical)+$o(t.horizontal)},gH=function(t){return Object.keys(t).filter(function(n){return!pH.container[n]}).reduce(function(n,r){var i;return Nt({},n,(i={},i[r]=t[r],i))},{})},Vi={TIMEOUT:"timeout",CLICKAWAY:"clickaway",MAXSNACK:"maxsnack",INSTRUCTED:"instructed"},sd={toContainerAnchorOrigin:function(t){return"containerAnchorOrigin"+t},toAnchorOrigin:function(t){var n=t.vertical,r=t.horizontal;return"anchorOrigin"+$o(n)+$o(r)},toVariant:function(t){return"variant"+$o(t)}},Uf=function(t){return!!t||t===0},QA=function(t){return typeof t=="number"||t===null},yH=function(t,n,r){return function(i){return i==="autoHideDuration"?QA(t.autoHideDuration)?t.autoHideDuration:QA(n.autoHideDuration)?n.autoHideDuration:zl.autoHideDuration:t[i]||n[i]||r[i]}};function ey(e,t,n){return e===void 0&&(e={}),t===void 0&&(t={}),n===void 0&&(n={}),Nt({},n,{},t,{},e)}var vH="SnackbarContent",Gq={root:vH+"-root"},bH=Bd("div")(function(e){var t,n,r=e.theme;return n={},n["&."+Gq.root]=(t={display:"flex",flexWrap:"wrap",flexGrow:1},t[r.breakpoints.up("sm")]={flexGrow:"initial",minWidth:288},t),n}),xH=Q.forwardRef(function(e,t){var n=e.className,r=Gi(e,["className"]);return R.createElement(bH,Object.assign({ref:t,className:Qo(Gq.root,n)},r))}),GA={right:"left",left:"right",bottom:"up",top:"down"},SH=function(t){return t.horizontal!=="center"?GA[t.horizontal]:GA[t.vertical]},EH=function(t){return R.createElement(Zo,Object.assign({},t),R.createElement("path",{d:`M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 + 10.59L10 14.17L17.59 6.58L19 8L10 17Z`}))},wH=function(t){return R.createElement(Zo,Object.assign({},t),R.createElement("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"}))},CH=function(t){return R.createElement(Zo,Object.assign({},t),R.createElement("path",{d:`M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2, + 6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12, + 13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z`}))},_H=function(t){return R.createElement(Zo,Object.assign({},t),R.createElement("path",{d:`M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, + 0 22,12A10,10 0 0,0 12,2Z`}))},Bf={fontSize:20,marginInlineEnd:8},OH={default:void 0,success:R.createElement(EH,{style:Bf}),warning:R.createElement(wH,{style:Bf}),error:R.createElement(CH,{style:Bf}),info:R.createElement(_H,{style:Bf})};function Uo(e,t){return e.reduce(function(n,r){return r==null?n:function(){for(var u=arguments.length,s=new Array(u),c=0;c .MuiCollapse-container, & > .MuiCollapse-root",wrapper:"& > .MuiCollapse-container > .MuiCollapse-wrapper, & > .MuiCollapse-root > .MuiCollapse-wrapper"},ny=16,Dl="SnackbarContainer",Yr={root:Dl+"-root",rootDense:Dl+"-rootDense",top:Dl+"-top",bottom:Dl+"-bottom",left:Dl+"-left",right:Dl+"-right",center:Dl+"-center"},MH=Bd("div")(function(e){var t,n,r,i,u,s,c=e.theme;return s={},s["&."+Yr.root]=(t={boxSizing:"border-box",display:"flex",maxHeight:"100%",position:"fixed",zIndex:c.zIndex.snackbar,height:"auto",width:"auto",transition:"top 300ms ease 0ms, right 300ms ease 0ms, bottom 300ms ease 0ms, left 300ms ease 0ms, margin 300ms ease 0ms, max-width 300ms ease 0ms",pointerEvents:"none"},t[ty.container]={pointerEvents:"all"},t[ty.wrapper]={padding:Ka.snackbar.default+"px 0px",transition:"padding 300ms ease 0ms"},t.maxWidth="calc(100% - "+Ka.view.default*2+"px)",t[c.breakpoints.down("sm")]={width:"100%",maxWidth:"calc(100% - "+ny*2+"px)"},t),s["&."+Yr.rootDense]=(n={},n[ty.wrapper]={padding:Ka.snackbar.dense+"px 0px"},n),s["&."+Yr.top]={top:Ka.view.default-Ka.snackbar.default,flexDirection:"column"},s["&."+Yr.bottom]={bottom:Ka.view.default-Ka.snackbar.default,flexDirection:"column-reverse"},s["&."+Yr.left]=(r={left:Ka.view.default},r[c.breakpoints.up("sm")]={alignItems:"flex-start"},r[c.breakpoints.down("sm")]={left:ny+"px"},r),s["&."+Yr.right]=(i={right:Ka.view.default},i[c.breakpoints.up("sm")]={alignItems:"flex-end"},i[c.breakpoints.down("sm")]={right:ny+"px"},i),s["&."+Yr.center]=(u={left:"50%",transform:"translateX(-50%)"},u[c.breakpoints.up("sm")]={alignItems:"center"},u),s}),DH=function(t){var n=t.className,r=t.anchorOrigin,i=t.dense,u=Gi(t,["className","anchorOrigin","dense"]),s=Qo(Yr[r.vertical],Yr[r.horizontal],Yr.root,n,i&&Yr.rootDense);return R.createElement(MH,Object.assign({className:s},u))},LH=R.memo(DH),qH=function(e){hH(t,e);function t(r){var i;return i=e.call(this,r)||this,i.enqueueSnackbar=function(u,s){s===void 0&&(s={});var c=s,f=c.key,d=c.preventDuplicate,h=Gi(c,["key","preventDuplicate"]),m=Uf(f),v=m?f:new Date().getTime()+Math.random(),g=yH(h,i.props,zl),y=Nt({key:v},h,{message:u,open:!0,entered:!1,requestClose:!1,variant:g("variant"),anchorOrigin:g("anchorOrigin"),autoHideDuration:g("autoHideDuration")});return h.persist&&(y.autoHideDuration=void 0),i.setState(function(S){if(d===void 0&&i.props.preventDuplicate||d){var x=function(C){return m?C.key===f:C.message===u},w=S.queue.findIndex(x)>-1,b=S.snacks.findIndex(x)>-1;if(w||b)return S}return i.handleDisplaySnack(Nt({},S,{queue:[].concat(S.queue,[y])}))}),v},i.handleDisplaySnack=function(u){var s=u.snacks;return s.length>=i.maxSnack?i.handleDismissOldest(u):i.processQueue(u)},i.processQueue=function(u){var s=u.queue,c=u.snacks;return s.length>0?Nt({},u,{snacks:[].concat(c,[s[0]]),queue:s.slice(1,s.length)}):u},i.handleDismissOldest=function(u){if(u.snacks.some(function(h){return!h.open||h.requestClose}))return u;var s=!1,c=!1,f=u.snacks.reduce(function(h,m){return h+(m.open&&m.persist?1:0)},0);f===i.maxSnack&&(c=!0);var d=u.snacks.map(function(h){return!s&&(!h.persist||c)?(s=!0,h.entered?(h.onClose&&h.onClose(null,Vi.MAXSNACK,h.key),i.props.onClose&&i.props.onClose(null,Vi.MAXSNACK,h.key),Nt({},h,{open:!1})):Nt({},h,{requestClose:!0})):Nt({},h)});return Nt({},u,{snacks:d})},i.handleEnteredSnack=function(u,s,c){if(!Uf(c))throw new Error("handleEnteredSnack Cannot be called with undefined key");i.setState(function(f){var d=f.snacks;return{snacks:d.map(function(h){return h.key===c?Nt({},h,{entered:!0}):Nt({},h)})}})},i.handleCloseSnack=function(u,s,c){if(i.props.onClose&&i.props.onClose(u,s,c),s!==Vi.CLICKAWAY){var f=c===void 0;i.setState(function(d){var h=d.snacks,m=d.queue;return{snacks:h.map(function(v){return!f&&v.key!==c?Nt({},v):v.entered?Nt({},v,{open:!1}):Nt({},v,{requestClose:!0})}),queue:m.filter(function(v){return v.key!==c})}})}},i.closeSnackbar=function(u){var s=i.state.snacks.find(function(c){return c.key===u});Uf(u)&&s&&s.onClose&&s.onClose(null,Vi.INSTRUCTED,u),i.handleCloseSnack(null,Vi.INSTRUCTED,u)},i.handleExitedSnack=function(u,s,c){var f=s||c;if(!Uf(f))throw new Error("handleExitedSnack Cannot be called with undefined key");i.setState(function(d){var h=i.processQueue(Nt({},d,{snacks:d.snacks.filter(function(m){return m.key!==f})}));return h.queue.length===0?h:i.handleDismissOldest(h)})},i.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:i.enqueueSnackbar.bind(WA(i)),closeSnackbar:i.closeSnackbar.bind(WA(i))}},i}var n=t.prototype;return n.render=function(){var i=this,u=this.state.contextValue,s=this.props,c=s.iconVariant,f=s.dense,d=f===void 0?zl.dense:f,h=s.hideIconVariant,m=h===void 0?zl.hideIconVariant:h,v=s.domRoot,g=s.children,y=s.classes,S=y===void 0?{}:y,x=Gi(s,["maxSnack","preventDuplicate","variant","anchorOrigin","iconVariant","dense","hideIconVariant","domRoot","children","classes"]),w=this.state.snacks.reduce(function(_,C){var O,k=mH(C.anchorOrigin),D=_[k]||[];return Nt({},_,(O={},O[k]=[].concat(D,[C]),O))},{}),b=Object.keys(w).map(function(_){var C=w[_];return R.createElement(LH,{key:_,dense:d,anchorOrigin:C[0].anchorOrigin,className:Qo(S.containerRoot,S[sd.toContainerAnchorOrigin(_)])},C.map(function(O){return R.createElement(TH,Object.assign({},x,{key:O.key,snack:O,dense:d,iconVariant:c,hideIconVariant:m,classes:gH(S),onClose:i.handleCloseSnack,onExited:Uo([i.handleExitedSnack,i.props.onExited]),onEntered:Uo([i.handleEnteredSnack,i.props.onEntered])}))}))});return R.createElement(Qq.Provider,{value:u},g,v?v4.createPortal(b,v):b)},dH(t,[{key:"maxSnack",get:function(){return this.props.maxSnack||zl.maxSnack}}]),t}(Q.Component),PH=function(){return Q.useContext(Qq)},jH=Object.prototype,FH=jH.hasOwnProperty;function NH(e,t){return e!=null&&FH.call(e,t)}function zH(e,t){return e!=null&&OI(e,t,NH)}var lc=e=>e.type==="checkbox",$l=e=>e instanceof Date,Yn=e=>e==null;const Yq=e=>typeof e=="object";var en=e=>!Yn(e)&&!Array.isArray(e)&&Yq(e)&&!$l(e),Xq=e=>en(e)&&e.target?lc(e.target)?e.target.checked:e.target.value:e,$H=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Zq=(e,t)=>e.has($H(t)),UH=e=>{const t=e.constructor&&e.constructor.prototype;return en(t)&&t.hasOwnProperty("isPrototypeOf")},eS=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function mn(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(eS&&(e instanceof Blob||r))&&(n||en(e)))if(t=n?[]:{},!n&&!UH(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=mn(e[i]));else return e;return t}var uc=e=>Array.isArray(e)?e.filter(Boolean):[],zt=e=>e===void 0,qe=(e,t,n)=>{if(!t||!en(e))return n;const r=uc(t.split(/[,[\].]+?/)).reduce((i,u)=>Yn(i)?i:i[u],e);return zt(r)||r===e?zt(e[t])?n:e[t]:r},Lr=e=>typeof e=="boolean",tS=e=>/^\w*$/.test(e),Jq=e=>uc(e.replace(/["|']|\]/g,"").split(/\.|\[/)),_t=(e,t,n)=>{let r=-1;const i=tS(t)?[t]:Jq(t),u=i.length,s=u-1;for(;++rR.useContext(eP),tP=e=>{const{children:t,...n}=e;return R.createElement(eP.Provider,{value:n},t)};var nP=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const u in e)Object.defineProperty(i,u,{get:()=>{const s=u;return t._proxyFormState[s]!==qr.all&&(t._proxyFormState[s]=!r||qr.all),n&&(n[s]=!0),e[s]}});return i},Qn=e=>en(e)&&!Object.keys(e).length,rP=(e,t,n,r)=>{n(e);const{name:i,...u}=e;return Qn(u)||Object.keys(u).length>=Object.keys(t).length||Object.keys(u).find(s=>t[s]===(!r||qr.all))},er=e=>Array.isArray(e)?e:[e],aP=(e,t,n)=>!e||!t||e===t||er(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function oh(e){const t=R.useRef(e);t.current=e,R.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function BH(e){const t=sc(),{control:n=t.control,disabled:r,name:i,exact:u}=e,[s,c]=R.useState(n._formState),f=R.useRef(!0),d=R.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),h=R.useRef(i);return h.current=i,oh({disabled:r,next:m=>f.current&&aP(h.current,m.name,u)&&rP(m,d.current,n._updateFormState)&&c({...n._formState,...m}),subject:n._subjects.state}),R.useEffect(()=>(f.current=!0,d.current.isValid&&n._updateValid(!0),()=>{f.current=!1}),[n]),R.useMemo(()=>nP(s,n,d.current,!1),[s,n])}var ma=e=>typeof e=="string",iP=(e,t,n,r,i)=>ma(e)?(r&&t.watch.add(e),qe(n,e,i)):Array.isArray(e)?e.map(u=>(r&&t.watch.add(u),qe(n,u))):(r&&(t.watchAll=!0),n);function IH(e){const t=sc(),{control:n=t.control,name:r,defaultValue:i,disabled:u,exact:s}=e,c=R.useRef(r);c.current=r,oh({disabled:u,subject:n._subjects.values,next:h=>{aP(c.current,h.name,s)&&d(mn(iP(c.current,n._names,h.values||n._formValues,!1,i)))}});const[f,d]=R.useState(n._getWatch(r,i));return R.useEffect(()=>n._removeUnmounted()),f}function HH(e){const t=sc(),{name:n,disabled:r,control:i=t.control,shouldUnregister:u}=e,s=Zq(i._names.array,n),c=IH({control:i,name:n,defaultValue:qe(i._formValues,n,qe(i._defaultValues,n,e.defaultValue)),exact:!0}),f=BH({control:i,name:n,exact:!0}),d=R.useRef(i.register(n,{...e.rules,value:c,...Lr(e.disabled)?{disabled:e.disabled}:{}})),h=R.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!qe(f.errors,n)},isDirty:{enumerable:!0,get:()=>!!qe(f.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!qe(f.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!qe(f.validatingFields,n)},error:{enumerable:!0,get:()=>qe(f.errors,n)}}),[f,n]),m=R.useMemo(()=>({name:n,value:c,...Lr(r)||f.disabled?{disabled:f.disabled||r}:{},onChange:v=>d.current.onChange({target:{value:Xq(v),name:n},type:Md.CHANGE}),onBlur:()=>d.current.onBlur({target:{value:qe(i._formValues,n),name:n},type:Md.BLUR}),ref:v=>{const g=qe(i._fields,n);g&&v&&(g._f.ref={focus:()=>v.focus(),select:()=>v.select(),setCustomValidity:y=>v.setCustomValidity(y),reportValidity:()=>v.reportValidity()})}}),[n,i._formValues,r,f.disabled,c,i._fields]);return R.useEffect(()=>{const v=i._options.shouldUnregister||u,g=(y,S)=>{const x=qe(i._fields,y);x&&x._f&&(x._f.mount=S)};if(g(n,!0),v){const y=mn(qe(i._options.defaultValues,n));_t(i._defaultValues,n,y),zt(qe(i._formValues,n))&&_t(i._formValues,n,y)}return!s&&i.register(n),()=>{(s?v&&!i._state.action:v)?i.unregister(n):g(n,!1)}},[n,i,s,u]),R.useEffect(()=>{i._updateDisabledField({disabled:r,fields:i._fields,name:n})},[r,n,i]),R.useMemo(()=>({field:m,formState:f,fieldState:h}),[m,f,h])}const $t=e=>e.render(HH(e));var VH=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},zi=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},ry=(e,t,n={})=>n.shouldFocus||zt(n.shouldFocus)?n.focusName||`${e}.${zt(n.focusIndex)?t:n.focusIndex}.`:"",Bo=e=>({isOnSubmit:!e||e===qr.onSubmit,isOnBlur:e===qr.onBlur,isOnChange:e===qr.onChange,isOnAll:e===qr.all,isOnTouch:e===qr.onTouched}),dx=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const es=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const u=qe(e,i);if(u){const{_f:s,...c}=u;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],i)&&!r)return!0;if(s.ref&&t(s.ref,s.name)&&!r)return!0;if(es(c,t))break}else if(en(c)&&es(c,t))break}}};var lP=(e,t,n)=>{const r=er(qe(e,n));return _t(r,"root",t[n]),_t(e,n,r),e},nS=e=>e.type==="file",ha=e=>typeof e=="function",Dd=e=>{if(!eS)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},od=e=>ma(e),rS=e=>e.type==="radio",Ld=e=>e instanceof RegExp;const XA={value:!1,isValid:!1},ZA={value:!0,isValid:!0};var uP=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!zt(e[0].attributes.value)?zt(e[0].value)||e[0].value===""?ZA:{value:e[0].value,isValid:!0}:ZA:XA}return XA};const JA={isValid:!1,value:null};var sP=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,JA):JA;function eR(e,t,n="validate"){if(od(e)||Array.isArray(e)&&e.every(od)||Lr(e)&&!e)return{type:n,message:od(e)?e:"",ref:t}}var Wu=e=>en(e)&&!Ld(e)?e:{value:e,message:""},hx=async(e,t,n,r,i,u)=>{const{ref:s,refs:c,required:f,maxLength:d,minLength:h,min:m,max:v,pattern:g,validate:y,name:S,valueAsNumber:x,mount:w}=e._f,b=qe(n,S);if(!w||t.has(S))return{};const _=c?c[0]:s,C=j=>{i&&_.reportValidity&&(_.setCustomValidity(Lr(j)?"":j||""),_.reportValidity())},O={},k=rS(s),D=lc(s),M=k||D,T=(x||nS(s))&&zt(s.value)&&zt(b)||Dd(s)&&s.value===""||b===""||Array.isArray(b)&&!b.length,L=VH.bind(null,S,r,O),P=(j,q,F,N=Qa.maxLength,$=Qa.minLength)=>{const H=j?q:F;O[S]={type:j?N:$,message:H,ref:s,...L(j?N:$,H)}};if(u?!Array.isArray(b)||!b.length:f&&(!M&&(T||Yn(b))||Lr(b)&&!b||D&&!uP(c).isValid||k&&!sP(c).isValid)){const{value:j,message:q}=od(f)?{value:!!f,message:f}:Wu(f);if(j&&(O[S]={type:Qa.required,message:q,ref:_,...L(Qa.required,q)},!r))return C(q),O}if(!T&&(!Yn(m)||!Yn(v))){let j,q;const F=Wu(v),N=Wu(m);if(!Yn(b)&&!isNaN(b)){const $=s.valueAsNumber||b&&+b;Yn(F.value)||(j=$>F.value),Yn(N.value)||(q=$new Date(new Date().toDateString()+" "+W),K=s.type=="time",ne=s.type=="week";ma(F.value)&&b&&(j=K?H(b)>H(F.value):ne?b>F.value:$>new Date(F.value)),ma(N.value)&&b&&(q=K?H(b)+j.value,N=!Yn(q.value)&&b.length<+q.value;if((F||N)&&(P(F,j.message,q.message),!r))return C(O[S].message),O}if(g&&!T&&ma(b)){const{value:j,message:q}=Wu(g);if(Ld(j)&&!b.match(j)&&(O[S]={type:Qa.pattern,message:q,ref:s,...L(Qa.pattern,q)},!r))return C(q),O}if(y){if(ha(y)){const j=await y(b,n),q=eR(j,_);if(q&&(O[S]={...q,...L(Qa.validate,q.message)},!r))return C(q.message),O}else if(en(y)){let j={};for(const q in y){if(!Qn(j)&&!r)break;const F=eR(await y[q](b,n),_,q);F&&(j={...F,...L(q,F.message)},C(F.message),r&&(O[S]=j))}if(!Qn(j)&&(O[S]={ref:_,...j},!r))return O}}return C(!0),O},ay=(e,t)=>[...e,...er(t)],iy=e=>Array.isArray(e)?e.map(()=>{}):void 0;function ly(e,t,n){return[...e.slice(0,t),...er(n),...e.slice(t)]}var uy=(e,t,n)=>Array.isArray(e)?(zt(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],sy=(e,t)=>[...er(t),...er(e)];function KH(e,t){let n=0;const r=[...e];for(const i of t)r.splice(i-n,1),n++;return uc(r).length?r:[]}var oy=(e,t)=>zt(t)?[]:KH(e,er(t).sort((n,r)=>n-r)),cy=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]};function WH(e,t){const n=t.slice(0,-1).length;let r=0;for(;r(e[t]=n,e);function oP(e){const t=sc(),{control:n=t.control,name:r,keyName:i="id",shouldUnregister:u,rules:s}=e,[c,f]=R.useState(n._getFieldArray(r)),d=R.useRef(n._getFieldArray(r).map(zi)),h=R.useRef(c),m=R.useRef(r),v=R.useRef(!1);m.current=r,h.current=c,n._names.array.add(r),s&&n.register(r,s),oh({next:({values:k,name:D})=>{if(D===m.current||!D){const M=qe(k,m.current);Array.isArray(M)&&(f(M),d.current=M.map(zi))}},subject:n._subjects.array});const g=R.useCallback(k=>{v.current=!0,n._updateFieldArray(r,k)},[n,r]),y=(k,D)=>{const M=er(mn(k)),T=ay(n._getFieldArray(r),M);n._names.focus=ry(r,T.length-1,D),d.current=ay(d.current,M.map(zi)),g(T),f(T),n._updateFieldArray(r,T,ay,{argA:iy(k)})},S=(k,D)=>{const M=er(mn(k)),T=sy(n._getFieldArray(r),M);n._names.focus=ry(r,0,D),d.current=sy(d.current,M.map(zi)),g(T),f(T),n._updateFieldArray(r,T,sy,{argA:iy(k)})},x=k=>{const D=oy(n._getFieldArray(r),k);d.current=oy(d.current,k),g(D),f(D),!Array.isArray(qe(n._fields,r))&&_t(n._fields,r,void 0),n._updateFieldArray(r,D,oy,{argA:k})},w=(k,D,M)=>{const T=er(mn(D)),L=ly(n._getFieldArray(r),k,T);n._names.focus=ry(r,k,M),d.current=ly(d.current,k,T.map(zi)),g(L),f(L),n._updateFieldArray(r,L,ly,{argA:k,argB:iy(D)})},b=(k,D)=>{const M=n._getFieldArray(r);cy(M,k,D),cy(d.current,k,D),g(M),f(M),n._updateFieldArray(r,M,cy,{argA:k,argB:D},!1)},_=(k,D)=>{const M=n._getFieldArray(r);uy(M,k,D),uy(d.current,k,D),g(M),f(M),n._updateFieldArray(r,M,uy,{argA:k,argB:D},!1)},C=(k,D)=>{const M=mn(D),T=tR(n._getFieldArray(r),k,M);d.current=[...T].map((L,P)=>!L||P===k?zi():d.current[P]),g(T),f([...T]),n._updateFieldArray(r,T,tR,{argA:k,argB:M},!0,!1)},O=k=>{const D=er(mn(k));d.current=D.map(zi),g([...D]),f([...D]),n._updateFieldArray(r,[...D],M=>M,{},!0,!1)};return R.useEffect(()=>{if(n._state.action=!1,dx(r,n._names)&&n._subjects.state.next({...n._formState}),v.current&&(!Bo(n._options.mode).isOnSubmit||n._formState.isSubmitted))if(n._options.resolver)n._executeSchema([r]).then(k=>{const D=qe(k.errors,r),M=qe(n._formState.errors,r);(M?!D&&M.type||D&&(M.type!==D.type||M.message!==D.message):D&&D.type)&&(D?_t(n._formState.errors,r,D):un(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const k=qe(n._fields,r);k&&k._f&&!(Bo(n._options.reValidateMode).isOnSubmit&&Bo(n._options.mode).isOnSubmit)&&hx(k,n._names.disabled,n._formValues,n._options.criteriaMode===qr.all,n._options.shouldUseNativeValidation,!0).then(D=>!Qn(D)&&n._subjects.state.next({errors:lP(n._formState.errors,D,r)}))}n._subjects.values.next({name:r,values:{...n._formValues}}),n._names.focus&&es(n._fields,(k,D)=>{if(n._names.focus&&D.startsWith(n._names.focus)&&k.focus)return k.focus(),1}),n._names.focus="",n._updateValid(),v.current=!1},[c,r,n]),R.useEffect(()=>(!qe(n._formValues,r)&&n._updateFieldArray(r),()=>{(n._options.shouldUnregister||u)&&n.unregister(r)}),[r,n,i,u]),{swap:R.useCallback(b,[g,r,n]),move:R.useCallback(_,[g,r,n]),prepend:R.useCallback(S,[g,r,n]),append:R.useCallback(y,[g,r,n]),remove:R.useCallback(x,[g,r,n]),insert:R.useCallback(w,[g,r,n]),update:R.useCallback(C,[g,r,n]),replace:R.useCallback(O,[g,r,n]),fields:R.useMemo(()=>c.map((k,D)=>({...k,[i]:d.current[D]||zi()})),[c,i])}}var fy=()=>{let e=[];return{get observers(){return e},next:i=>{for(const u of e)u.next&&u.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(u=>u!==i)}}),unsubscribe:()=>{e=[]}}},px=e=>Yn(e)||!Yq(e);function Ki(e,t){if(px(e)||px(t))return e===t;if($l(e)&&$l(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const u=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const s=t[i];if($l(u)&&$l(s)||en(u)&&en(s)||Array.isArray(u)&&Array.isArray(s)?!Ki(u,s):u!==s)return!1}}return!0}var cP=e=>e.type==="select-multiple",GH=e=>rS(e)||lc(e),dy=e=>Dd(e)&&e.isConnected,fP=e=>{for(const t in e)if(ha(e[t]))return!0;return!1};function qd(e,t={}){const n=Array.isArray(e);if(en(e)||n)for(const r in e)Array.isArray(e[r])||en(e[r])&&!fP(e[r])?(t[r]=Array.isArray(e[r])?[]:{},qd(e[r],t[r])):Yn(e[r])||(t[r]=!0);return t}function dP(e,t,n){const r=Array.isArray(e);if(en(e)||r)for(const i in e)Array.isArray(e[i])||en(e[i])&&!fP(e[i])?zt(t)||px(n[i])?n[i]=Array.isArray(e[i])?qd(e[i],[]):{...qd(e[i])}:dP(e[i],Yn(t)?{}:t[i],n[i]):n[i]=!Ki(e[i],t[i]);return n}var Ao=(e,t)=>dP(e,t,qd(t)),hP=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>zt(e)?e:t?e===""?NaN:e&&+e:n&&ma(e)?new Date(e):r?r(e):e;function hy(e){const t=e.ref;return nS(t)?t.files:rS(t)?sP(e.refs).value:cP(t)?[...t.selectedOptions].map(({value:n})=>n):lc(t)?uP(e.refs).value:hP(zt(t.value)?e.ref.value:t.value,e)}var YH=(e,t,n,r)=>{const i={};for(const u of e){const s=qe(t,u);s&&_t(i,u,s._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},Ro=e=>zt(e)?e:Ld(e)?e.source:en(e)?Ld(e.value)?e.value.source:e.value:e;const nR="AsyncFunction";var XH=e=>!!e&&!!e.validate&&!!(ha(e.validate)&&e.validate.constructor.name===nR||en(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===nR)),ZH=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function rR(e,t,n){const r=qe(e,n);if(r||tS(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const u=i.join("."),s=qe(t,u),c=qe(e,u);if(s&&!Array.isArray(s)&&n!==u)return{name:n};if(c&&c.type)return{name:u,error:c};i.pop()}return{name:n}}var JH=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,eV=(e,t)=>!uc(qe(e,t)).length&&un(e,t);const tV={mode:qr.onSubmit,reValidateMode:qr.onChange,shouldFocusError:!0};function nV(e={}){let t={...tV,...e},n={submitCount:0,isDirty:!1,isLoading:ha(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=en(t.defaultValues)||en(t.values)?mn(t.defaultValues||t.values)||{}:{},u=t.shouldUnregister?{}:mn(i),s={action:!1,mount:!1,watch:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},f,d=0;const h={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},m={values:fy(),array:fy(),state:fy()},v=Bo(t.mode),g=Bo(t.reValidateMode),y=t.criteriaMode===qr.all,S=G=>te=>{clearTimeout(d),d=setTimeout(G,te)},x=async G=>{if(!t.disabled&&(h.isValid||G)){const te=t.resolver?Qn((await M()).errors):await L(r,!0);te!==n.isValid&&m.state.next({isValid:te})}},w=(G,te)=>{!t.disabled&&(h.isValidating||h.validatingFields)&&((G||Array.from(c.mount)).forEach(re=>{re&&(te?_t(n.validatingFields,re,te):un(n.validatingFields,re))}),m.state.next({validatingFields:n.validatingFields,isValidating:!Qn(n.validatingFields)}))},b=(G,te=[],re,de,_e=!0,be=!0)=>{if(de&&re&&!t.disabled){if(s.action=!0,be&&Array.isArray(qe(r,G))){const De=re(qe(r,G),de.argA,de.argB);_e&&_t(r,G,De)}if(be&&Array.isArray(qe(n.errors,G))){const De=re(qe(n.errors,G),de.argA,de.argB);_e&&_t(n.errors,G,De),eV(n.errors,G)}if(h.touchedFields&&be&&Array.isArray(qe(n.touchedFields,G))){const De=re(qe(n.touchedFields,G),de.argA,de.argB);_e&&_t(n.touchedFields,G,De)}h.dirtyFields&&(n.dirtyFields=Ao(i,u)),m.state.next({name:G,isDirty:j(G,te),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else _t(u,G,te)},_=(G,te)=>{_t(n.errors,G,te),m.state.next({errors:n.errors})},C=G=>{n.errors=G,m.state.next({errors:n.errors,isValid:!1})},O=(G,te,re,de)=>{const _e=qe(r,G);if(_e){const be=qe(u,G,zt(re)?qe(i,G):re);zt(be)||de&&de.defaultChecked||te?_t(u,G,te?be:hy(_e._f)):N(G,be),s.mount&&x()}},k=(G,te,re,de,_e)=>{let be=!1,De=!1;const Le={name:G};if(!t.disabled){const Fe=!!(qe(r,G)&&qe(r,G)._f&&qe(r,G)._f.disabled);if(!re||de){h.isDirty&&(De=n.isDirty,n.isDirty=Le.isDirty=j(),be=De!==Le.isDirty);const je=Fe||Ki(qe(i,G),te);De=!!(!Fe&&qe(n.dirtyFields,G)),je||Fe?un(n.dirtyFields,G):_t(n.dirtyFields,G,!0),Le.dirtyFields=n.dirtyFields,be=be||h.dirtyFields&&De!==!je}if(re){const je=qe(n.touchedFields,G);je||(_t(n.touchedFields,G,re),Le.touchedFields=n.touchedFields,be=be||h.touchedFields&&je!==re)}be&&_e&&m.state.next(Le)}return be?Le:{}},D=(G,te,re,de)=>{const _e=qe(n.errors,G),be=h.isValid&&Lr(te)&&n.isValid!==te;if(t.delayError&&re?(f=S(()=>_(G,re)),f(t.delayError)):(clearTimeout(d),f=null,re?_t(n.errors,G,re):un(n.errors,G)),(re?!Ki(_e,re):_e)||!Qn(de)||be){const De={...de,...be&&Lr(te)?{isValid:te}:{},errors:n.errors,name:G};n={...n,...De},m.state.next(De)}},M=async G=>{w(G,!0);const te=await t.resolver(u,t.context,YH(G||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(G),te},T=async G=>{const{errors:te}=await M(G);if(G)for(const re of G){const de=qe(te,re);de?_t(n.errors,re,de):un(n.errors,re)}else n.errors=te;return te},L=async(G,te,re={valid:!0})=>{for(const de in G){const _e=G[de];if(_e){const{_f:be,...De}=_e;if(be){const Le=c.array.has(be.name),Fe=_e._f&&XH(_e._f);Fe&&h.validatingFields&&w([de],!0);const je=await hx(_e,c.disabled,u,y,t.shouldUseNativeValidation&&!te,Le);if(Fe&&h.validatingFields&&w([de]),je[be.name]&&(re.valid=!1,te))break;!te&&(qe(je,be.name)?Le?lP(n.errors,je,be.name):_t(n.errors,be.name,je[be.name]):un(n.errors,be.name))}!Qn(De)&&await L(De,te,re)}}return re.valid},P=()=>{for(const G of c.unMount){const te=qe(r,G);te&&(te._f.refs?te._f.refs.every(re=>!dy(re)):!dy(te._f.ref))&&se(G)}c.unMount=new Set},j=(G,te)=>!t.disabled&&(G&&te&&_t(u,G,te),!Ki(Z(),i)),q=(G,te,re)=>iP(G,c,{...s.mount?u:zt(te)?i:ma(G)?{[G]:te}:te},re,te),F=G=>uc(qe(s.mount?u:i,G,t.shouldUnregister?qe(i,G,[]):[])),N=(G,te,re={})=>{const de=qe(r,G);let _e=te;if(de){const be=de._f;be&&(!be.disabled&&_t(u,G,hP(te,be)),_e=Dd(be.ref)&&Yn(te)?"":te,cP(be.ref)?[...be.ref.options].forEach(De=>De.selected=_e.includes(De.value)):be.refs?lc(be.ref)?be.refs.length>1?be.refs.forEach(De=>(!De.defaultChecked||!De.disabled)&&(De.checked=Array.isArray(_e)?!!_e.find(Le=>Le===De.value):_e===De.value)):be.refs[0]&&(be.refs[0].checked=!!_e):be.refs.forEach(De=>De.checked=De.value===_e):nS(be.ref)?be.ref.value="":(be.ref.value=_e,be.ref.type||m.values.next({name:G,values:{...u}})))}(re.shouldDirty||re.shouldTouch)&&k(G,_e,re.shouldTouch,re.shouldDirty,!0),re.shouldValidate&&W(G)},$=(G,te,re)=>{for(const de in te){const _e=te[de],be=`${G}.${de}`,De=qe(r,be);(c.array.has(G)||en(_e)||De&&!De._f)&&!$l(_e)?$(be,_e,re):N(be,_e,re)}},H=(G,te,re={})=>{const de=qe(r,G),_e=c.array.has(G),be=mn(te);_t(u,G,be),_e?(m.array.next({name:G,values:{...u}}),(h.isDirty||h.dirtyFields)&&re.shouldDirty&&m.state.next({name:G,dirtyFields:Ao(i,u),isDirty:j(G,be)})):de&&!de._f&&!Yn(be)?$(G,be,re):N(G,be,re),dx(G,c)&&m.state.next({...n}),m.values.next({name:s.mount?G:void 0,values:{...u}})},K=async G=>{s.mount=!0;const te=G.target;let re=te.name,de=!0;const _e=qe(r,re),be=()=>te.type?hy(_e._f):Xq(G),De=Le=>{de=Number.isNaN(Le)||$l(Le)&&isNaN(Le.getTime())||Ki(Le,qe(u,re,Le))};if(_e){let Le,Fe;const je=be(),Ne=G.type===Md.BLUR||G.type===Md.FOCUS_OUT,ot=!ZH(_e._f)&&!t.resolver&&!qe(n.errors,re)&&!_e._f.deps||JH(Ne,qe(n.touchedFields,re),n.isSubmitted,g,v),ut=dx(re,c,Ne);_t(u,re,je),Ne?(_e._f.onBlur&&_e._f.onBlur(G),f&&f(0)):_e._f.onChange&&_e._f.onChange(G);const yt=k(re,je,Ne,!1),jt=!Qn(yt)||ut;if(!Ne&&m.values.next({name:re,type:G.type,values:{...u}}),ot)return h.isValid&&(t.mode==="onBlur"&&Ne?x():Ne||x()),jt&&m.state.next({name:re,...ut?{}:yt});if(!Ne&&ut&&m.state.next({...n}),t.resolver){const{errors:It}=await M([re]);if(De(je),de){const Et=rR(n.errors,r,re),ye=rR(It,r,Et.name||re);Le=ye.error,re=ye.name,Fe=Qn(It)}}else w([re],!0),Le=(await hx(_e,c.disabled,u,y,t.shouldUseNativeValidation))[re],w([re]),De(je),de&&(Le?Fe=!1:h.isValid&&(Fe=await L(r,!0)));de&&(_e._f.deps&&W(_e._f.deps),D(re,Fe,Le,yt))}},ne=(G,te)=>{if(qe(n.errors,te)&&G.focus)return G.focus(),1},W=async(G,te={})=>{let re,de;const _e=er(G);if(t.resolver){const be=await T(zt(G)?G:_e);re=Qn(be),de=G?!_e.some(De=>qe(be,De)):re}else G?(de=(await Promise.all(_e.map(async be=>{const De=qe(r,be);return await L(De&&De._f?{[be]:De}:De)}))).every(Boolean),!(!de&&!n.isValid)&&x()):de=re=await L(r);return m.state.next({...!ma(G)||h.isValid&&re!==n.isValid?{}:{name:G},...t.resolver||!G?{isValid:re}:{},errors:n.errors}),te.shouldFocus&&!de&&es(r,ne,G?_e:c.mount),de},Z=G=>{const te={...s.mount?u:i};return zt(G)?te:ma(G)?qe(te,G):G.map(re=>qe(te,re))},X=(G,te)=>({invalid:!!qe((te||n).errors,G),isDirty:!!qe((te||n).dirtyFields,G),error:qe((te||n).errors,G),isValidating:!!qe(n.validatingFields,G),isTouched:!!qe((te||n).touchedFields,G)}),Y=G=>{G&&er(G).forEach(te=>un(n.errors,te)),m.state.next({errors:G?n.errors:{}})},I=(G,te,re)=>{const de=(qe(r,G,{_f:{}})._f||{}).ref,_e=qe(n.errors,G)||{},{ref:be,message:De,type:Le,...Fe}=_e;_t(n.errors,G,{...Fe,...te,ref:de}),m.state.next({name:G,errors:n.errors,isValid:!1}),re&&re.shouldFocus&&de&&de.focus&&de.focus()},ae=(G,te)=>ha(G)?m.values.subscribe({next:re=>G(q(void 0,te),re)}):q(G,te,!0),se=(G,te={})=>{for(const re of G?er(G):c.mount)c.mount.delete(re),c.array.delete(re),te.keepValue||(un(r,re),un(u,re)),!te.keepError&&un(n.errors,re),!te.keepDirty&&un(n.dirtyFields,re),!te.keepTouched&&un(n.touchedFields,re),!te.keepIsValidating&&un(n.validatingFields,re),!t.shouldUnregister&&!te.keepDefaultValue&&un(i,re);m.values.next({values:{...u}}),m.state.next({...n,...te.keepDirty?{isDirty:j()}:{}}),!te.keepIsValid&&x()},ie=({disabled:G,name:te,field:re,fields:de})=>{(Lr(G)&&s.mount||G||c.disabled.has(te))&&(G?c.disabled.add(te):c.disabled.delete(te),k(te,hy(re?re._f:qe(de,te)._f),!1,!1,!0))},oe=(G,te={})=>{let re=qe(r,G);const de=Lr(te.disabled)||Lr(t.disabled);return _t(r,G,{...re||{},_f:{...re&&re._f?re._f:{ref:{name:G}},name:G,mount:!0,...te}}),c.mount.add(G),re?ie({field:re,disabled:Lr(te.disabled)?te.disabled:t.disabled,name:G}):O(G,!0,te.value),{...de?{disabled:te.disabled||t.disabled}:{},...t.progressive?{required:!!te.required,min:Ro(te.min),max:Ro(te.max),minLength:Ro(te.minLength),maxLength:Ro(te.maxLength),pattern:Ro(te.pattern)}:{},name:G,onChange:K,onBlur:K,ref:_e=>{if(_e){oe(G,te),re=qe(r,G);const be=zt(_e.value)&&_e.querySelectorAll&&_e.querySelectorAll("input,select,textarea")[0]||_e,De=GH(be),Le=re._f.refs||[];if(De?Le.find(Fe=>Fe===be):be===re._f.ref)return;_t(r,G,{_f:{...re._f,...De?{refs:[...Le.filter(dy),be,...Array.isArray(qe(i,G))?[{}]:[]],ref:{type:be.type,name:G}}:{ref:be}}}),O(G,!1,void 0,be)}else re=qe(r,G,{}),re._f&&(re._f.mount=!1),(t.shouldUnregister||te.shouldUnregister)&&!(Zq(c.array,G)&&s.action)&&c.unMount.add(G)}}},V=()=>t.shouldFocusError&&es(r,ne,c.mount),ue=G=>{Lr(G)&&(m.state.next({disabled:G}),es(r,(te,re)=>{const de=qe(r,re);de&&(te.disabled=de._f.disabled||G,Array.isArray(de._f.refs)&&de._f.refs.forEach(_e=>{_e.disabled=de._f.disabled||G}))},0,!1))},me=(G,te)=>async re=>{let de;re&&(re.preventDefault&&re.preventDefault(),re.persist&&re.persist());let _e=mn(u);if(c.disabled.size)for(const be of c.disabled)_t(_e,be,void 0);if(m.state.next({isSubmitting:!0}),t.resolver){const{errors:be,values:De}=await M();n.errors=be,_e=De}else await L(r);if(un(n.errors,"root"),Qn(n.errors)){m.state.next({errors:{}});try{await G(_e,re)}catch(be){de=be}}else te&&await te({...n.errors},re),V(),setTimeout(V);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Qn(n.errors)&&!de,submitCount:n.submitCount+1,errors:n.errors}),de)throw de},Ee=(G,te={})=>{qe(r,G)&&(zt(te.defaultValue)?H(G,mn(qe(i,G))):(H(G,te.defaultValue),_t(i,G,mn(te.defaultValue))),te.keepTouched||un(n.touchedFields,G),te.keepDirty||(un(n.dirtyFields,G),n.isDirty=te.defaultValue?j(G,mn(qe(i,G))):j()),te.keepError||(un(n.errors,G),h.isValid&&x()),m.state.next({...n}))},Ce=(G,te={})=>{const re=G?mn(G):i,de=mn(re),_e=Qn(G),be=_e?i:de;if(te.keepDefaultValues||(i=re),!te.keepValues){if(te.keepDirtyValues){const De=new Set([...c.mount,...Object.keys(Ao(i,u))]);for(const Le of Array.from(De))qe(n.dirtyFields,Le)?_t(be,Le,qe(u,Le)):H(Le,qe(be,Le))}else{if(eS&&zt(G))for(const De of c.mount){const Le=qe(r,De);if(Le&&Le._f){const Fe=Array.isArray(Le._f.refs)?Le._f.refs[0]:Le._f.ref;if(Dd(Fe)){const je=Fe.closest("form");if(je){je.reset();break}}}}r={}}u=t.shouldUnregister?te.keepDefaultValues?mn(i):{}:mn(be),m.array.next({values:{...be}}),m.values.next({values:{...be}})}c={mount:te.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!h.isValid||!!te.keepIsValid||!!te.keepDirtyValues,s.watch=!!t.shouldUnregister,m.state.next({submitCount:te.keepSubmitCount?n.submitCount:0,isDirty:_e?!1:te.keepDirty?n.isDirty:!!(te.keepDefaultValues&&!Ki(G,i)),isSubmitted:te.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:_e?{}:te.keepDirtyValues?te.keepDefaultValues&&u?Ao(i,u):n.dirtyFields:te.keepDefaultValues&&G?Ao(i,G):te.keepDirty?n.dirtyFields:{},touchedFields:te.keepTouched?n.touchedFields:{},errors:te.keepErrors?n.errors:{},isSubmitSuccessful:te.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Te=(G,te)=>Ce(ha(G)?G(u):G,te);return{control:{register:oe,unregister:se,getFieldState:X,handleSubmit:me,setError:I,_executeSchema:M,_getWatch:q,_getDirty:j,_updateValid:x,_removeUnmounted:P,_updateFieldArray:b,_updateDisabledField:ie,_getFieldArray:F,_reset:Ce,_resetDefaultValues:()=>ha(t.defaultValues)&&t.defaultValues().then(G=>{Te(G,t.resetOptions),m.state.next({isLoading:!1})}),_updateFormState:G=>{n={...n,...G}},_disableForm:ue,_subjects:m,_proxyFormState:h,_setErrors:C,get _fields(){return r},get _formValues(){return u},get _state(){return s},set _state(G){s=G},get _defaultValues(){return i},get _names(){return c},set _names(G){c=G},get _formState(){return n},set _formState(G){n=G},get _options(){return t},set _options(G){t={...t,...G}}},trigger:W,register:oe,handleSubmit:me,watch:ae,setValue:H,getValues:Z,reset:Te,resetField:Ee,clearErrors:Y,unregister:se,setError:I,setFocus:(G,te={})=>{const re=qe(r,G),de=re&&re._f;if(de){const _e=de.refs?de.refs[0]:de.ref;_e.focus&&(_e.focus(),te.shouldSelect&&ha(_e.select)&&_e.select())}},getFieldState:X}}function rV(e={}){const t=R.useRef(void 0),n=R.useRef(void 0),[r,i]=R.useState({isDirty:!1,isValidating:!1,isLoading:ha(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ha(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...nV(e),formState:r});const u=t.current.control;return u._options=e,oh({subject:u._subjects.state,next:s=>{rP(s,u._proxyFormState,u._updateFormState,!0)&&i({...u._formState})}}),R.useEffect(()=>u._disableForm(e.disabled),[u,e.disabled]),R.useEffect(()=>{if(u._proxyFormState.isDirty){const s=u._getDirty();s!==r.isDirty&&u._subjects.state.next({isDirty:s})}},[u,r.isDirty]),R.useEffect(()=>{e.values&&!Ki(e.values,n.current)?(u._reset(e.values,u._options.resetOptions),n.current=e.values,i(s=>({...s}))):u._resetDefaultValues()},[e.values,u]),R.useEffect(()=>{e.errors&&u._setErrors(e.errors)},[e.errors,u]),R.useEffect(()=>{u._state.mount||(u._updateValid(),u._state.mount=!0),u._state.watch&&(u._state.watch=!1,u._subjects.state.next({...u._formState})),u._removeUnmounted()}),R.useEffect(()=>{e.shouldUnregister&&u._subjects.values.next({values:u._getWatch()})},[e.shouldUnregister,u]),t.current.formState=nP(r,u),t.current}var aV=Object.defineProperty,Yi=(e,t)=>aV(e,"name",{value:t,configurable:!0}),Vn=Yi(({refineCoreProps:e,warnWhenUnsavedChanges:t,disableServerSideValidation:n=!1,...r}={})=>{let{options:i}=cn(),u=(i==null?void 0:i.disableServerSideValidation)||n,s=Je(),{warnWhenUnsavedChanges:c,setWarnWhen:f}=Zl(),d=t??c,h=rV({...r}),{watch:m,setValue:v,getValues:g,handleSubmit:y,setError:S}=h,x=R5({...e,onMutationError:(D,M,T)=>{var L,P;if(u){(L=e==null?void 0:e.onMutationError)==null||L.call(e,D,M,T);return}let j=D==null?void 0:D.errors;for(let q in j){if(!Object.keys(Ad(M)).includes(q))continue;let F=j[q],N="";Array.isArray(F)&&(N=F.join(" ")),typeof F=="string"&&(N=F),typeof F=="boolean"&&F&&(N="Field is not valid."),typeof F=="object"&&"key"in F&&(N=s(F.key,F.message)),S(q,{message:N})}(P=e==null?void 0:e.onMutationError)==null||P.call(e,D,M,T)}}),{query:w,onFinish:b,formLoading:_,onFinishAutoSave:C}=x;Q.useEffect(()=>{var D;let M=(D=w==null?void 0:w.data)==null?void 0:D.data;M&&Object.keys(Ad(g())).forEach(T=>{let L=zH(M,T),P=Od(M,T);L&&v(T,P)})},[w==null?void 0:w.data,v,g]),Q.useEffect(()=>{let D=m((M,{type:T})=>{T==="change"&&O(M)});return()=>D.unsubscribe()},[m]);let O=Yi(D=>{var M,T;if(d&&f(!0),(M=e==null?void 0:e.autoSave)!=null&&M.enabled){f(!1);let L=((T=e.autoSave)==null?void 0:T.onFinish)??(P=>P);return C(L(D)).catch(P=>P)}return D},"onValuesChange"),k=Yi((D,M)=>async T=>(f(!1),y(D,M)(T)),"handleSubmit");return{...h,handleSubmit:k,refineCore:x,saveButtonProps:{disabled:_,onClick:D=>{k(M=>b(M).catch(()=>{}),()=>!1)(D)}}}},"useForm");Yi(({stepsProps:e,...t}={})=>{let{defaultStep:n=0,isBackValidate:r=!1}=e??{},[i,u]=Q.useState(n),s=Vn({...t}),{trigger:c,getValues:f,setValue:d,formState:{dirtyFields:h},refineCore:{query:m}}=s;Q.useEffect(()=>{var g;let y=(g=m==null?void 0:m.data)==null?void 0:g.data;if(!y)return;let S=Object.keys(f());console.log({dirtyFields:h,registeredFields:S,data:y}),Object.entries(y).forEach(([x,w])=>{let b=x;S.includes(b)&&(Od(h,b)||d(b,w))})},[m==null?void 0:m.data,i,d,f]);let v=Yi(g=>{let y=g;g<0&&(y=0),u(y)},"go");return{...s,steps:{currentStep:i,gotoStep:Yi(async g=>{if(g!==i){if(g{var i,u;let s=wa(),[c,f]=R.useState(!1),d=Je(),{resource:h,action:m}=t??{},{resource:v,action:g,identifier:y}=st(h),S=ar(),x=Fn(),w=Ea(),b=m??g??"",_=!(typeof n=="object"&&(n==null?void 0:n.syncId)===!1),C=typeof n=="object"&&"key"in n?n.key:v&&b&&n?`modal-${y}-${b}`:void 0,{defaultVisible:O=!1,autoSubmitClose:k=!0,autoResetForm:D=!0}=e??{},M=Vn({refineCoreProps:{...t,meta:{...C?{[C]:void 0}:{},...t==null?void 0:t.meta}},...r}),{reset:T,refineCore:{onFinish:L,id:P,setId:j,autoSaveProps:q},saveButtonProps:F,handleSubmit:N}=M,{visible:$,show:H,close:K}=F5({defaultVisible:O});R.useEffect(()=>{var ae,se,ie,oe;if(c===!1&&C){let V=(se=(ae=S==null?void 0:S.params)==null?void 0:ae[C])==null?void 0:se.open;if(typeof V=="boolean"?V&&H():typeof V=="string"&&V==="true"&&H(),_){let ue=(oe=(ie=S==null?void 0:S.params)==null?void 0:ie[C])==null?void 0:oe.id;ue&&(j==null||j(ue))}f(!0)}},[C,S,_,j]),R.useEffect(()=>{var ae;c===!0&&($&&C?x({query:{[C]:{...(ae=S==null?void 0:S.params)==null?void 0:ae[C],open:!0,..._&&P&&{id:P}}},options:{keepQuery:!0},type:"replace"}):C&&!$&&x({query:{[C]:void 0},options:{keepQuery:!0},type:"replace"}))},[P,$,H,C,_]);let ne=Yi(async ae=>{await L(ae),k&&K(),D&&T()},"submit"),{warnWhen:W,setWarnWhen:Z}=Zl(),X=Q.useCallback(()=>{var ae;if(q.status==="success"&&(ae=t==null?void 0:t.autoSave)!=null&&ae.invalidateOnClose&&s({id:P,invalidates:t.invalidates||["list","many","detail"],dataProviderName:t.dataProviderName,resource:y}),W)if(window.confirm(d("warnWhenUnsavedChanges","Are you sure you want to leave? You have unsaved changes.")))Z(!1);else return;j==null||j(void 0),K()},[W,q.status]),Y=Q.useCallback(ae=>{typeof ae<"u"&&(j==null||j(ae)),(!(b==="edit"||b==="clone")||typeof ae<"u"||typeof P<"u")&&H()},[P]),I=d(`${y}.titles.${m}`,void 0,`${w(`${m} ${((i=v==null?void 0:v.meta)==null?void 0:i.label)??((u=v==null?void 0:v.options)==null?void 0:u.label)??(v==null?void 0:v.label)??y}`,"singular")}`);return{modal:{submit:ne,close:X,show:Y,visible:$,title:I},...M,saveButtonProps:{...F,onClick:ae=>N(ne)(ae)}}},"useModalForm");var ch={Title:"refine-pageHeader-title",SubTitle:"refine-pageHeader-subTitle"},ru={CloneButton:"refine-clone-button",DeleteButton:"refine-delete-button",EditButton:"refine-edit-button",SaveButton:"refine-save-button",CreateButton:"refine-create-button",ImportButton:"refine-import-button",ExportButton:"refine-export-button",ListButton:"refine-list-button",RefreshButton:"refine-refresh-button",ShowButton:"refine-show-button"},cd={exports:{}},iV=cd.exports,aR;function lV(){return aR||(aR=1,function(e,t){(function(n,r){e.exports=r()})(iV,function(){var n=1e3,r=6e4,i=36e5,u="millisecond",s="second",c="minute",f="hour",d="day",h="week",m="month",v="quarter",g="year",y="date",S="Invalid Date",x=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(F){var N=["th","st","nd","rd"],$=F%100;return"["+F+(N[($-20)%10]||N[$]||N[0])+"]"}},_=function(F,N,$){var H=String(F);return!H||H.length>=N?F:""+Array(N+1-H.length).join($)+F},C={s:_,z:function(F){var N=-F.utcOffset(),$=Math.abs(N),H=Math.floor($/60),K=$%60;return(N<=0?"+":"-")+_(H,2,"0")+":"+_(K,2,"0")},m:function F(N,$){if(N.date()<$.date())return-F($,N);var H=12*($.year()-N.year())+($.month()-N.month()),K=N.clone().add(H,m),ne=$-K<0,W=N.clone().add(H+(ne?-1:1),m);return+(-(H+($-K)/(ne?K-W:W-K))||0)},a:function(F){return F<0?Math.ceil(F)||0:Math.floor(F)},p:function(F){return{M:m,y:g,w:h,d,D:y,h:f,m:c,s,ms:u,Q:v}[F]||String(F||"").toLowerCase().replace(/s$/,"")},u:function(F){return F===void 0}},O="en",k={};k[O]=b;var D="$isDayjsObject",M=function(F){return F instanceof j||!(!F||!F[D])},T=function F(N,$,H){var K;if(!N)return O;if(typeof N=="string"){var ne=N.toLowerCase();k[ne]&&(K=ne),$&&(k[ne]=$,K=ne);var W=N.split("-");if(!K&&W.length>1)return F(W[0])}else{var Z=N.name;k[Z]=N,K=Z}return!H&&K&&(O=K),K||!H&&O},L=function(F,N){if(M(F))return F.clone();var $=typeof N=="object"?N:{};return $.date=F,$.args=arguments,new j($)},P=C;P.l=T,P.i=M,P.w=function(F,N){return L(F,{locale:N.$L,utc:N.$u,x:N.$x,$offset:N.$offset})};var j=function(){function F($){this.$L=T($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[D]=!0}var N=F.prototype;return N.parse=function($){this.$d=function(H){var K=H.date,ne=H.utc;if(K===null)return new Date(NaN);if(P.u(K))return new Date;if(K instanceof Date)return new Date(K);if(typeof K=="string"&&!/Z$/i.test(K)){var W=K.match(x);if(W){var Z=W[2]-1||0,X=(W[7]||"0").substring(0,3);return ne?new Date(Date.UTC(W[1],Z,W[3]||1,W[4]||0,W[5]||0,W[6]||0,X)):new Date(W[1],Z,W[3]||1,W[4]||0,W[5]||0,W[6]||0,X)}}return new Date(K)}($),this.init()},N.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},N.$utils=function(){return P},N.isValid=function(){return this.$d.toString()!==S},N.isSame=function($,H){var K=L($);return this.startOf(H)<=K&&K<=this.endOf(H)},N.isAfter=function($,H){return L($)c.length){for(;m--;)if(c.charCodeAt(m)===47){if(g){d=m+1;break}}else h<0&&(g=!0,h=m+1);return h<0?"":c.slice(d,h)}if(f===c)return"";for(v=-1,y=f.length-1;m--;)if(c.charCodeAt(m)===47){if(g){d=m+1;break}}else v<0&&(g=!0,v=m+1),y>-1&&(c.charCodeAt(m)===f.charCodeAt(y--)?y<0&&(h=m):(y=-1,h=v));return d===h?h=v:h<0&&(h=c.length),c.slice(d,h)}function t(c){var f,d,h;if(s(c),!c.length)return".";for(f=-1,h=c.length;--h;)if(c.charCodeAt(h)===47){if(d){f=h;break}}else d||(d=!0);return f<0?c.charCodeAt(0)===47?"/":".":f===1&&c.charCodeAt(0)===47?"//":c.slice(0,f)}function n(c){var f=-1,d=0,h=-1,m=0,v,g,y;for(s(c),y=c.length;y--;){if(g=c.charCodeAt(y),g===47){if(v){d=y+1;break}continue}h<0&&(v=!0,h=y+1),g===46?f<0?f=y:m!==1&&(m=1):f>-1&&(m=-1)}return f<0||h<0||m===0||m===1&&f===h-1&&f===d+1?"":c.slice(f,h)}function r(){for(var c=-1,f;++c2){if(S=d.lastIndexOf("/"),S!==d.length-1){S<0?(d="",h=0):(d=d.slice(0,S),h=d.length-1-d.lastIndexOf("/")),m=g,v=0;continue}}else if(d.length){d="",h=0,m=g,v=0;continue}}f&&(d=d.length?d+"/..":"..",h=2)}else d.length?d+="/"+c.slice(m+1,g):d=c.slice(m+1,g),h=g-m-1;m=g,v=0}else y===46&&v>-1?v++:v=-1}return d}function s(c){if(typeof c!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(c))}return Ll}var gy={},oR;function pV(){if(oR)return gy;oR=1,gy.cwd=e;function e(){return"/"}return gy}/*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */var yy,cR;function mP(){return cR||(cR=1,yy=function(t){return t!=null&&t.constructor!=null&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}),yy}var vy,fR;function mV(){if(fR)return vy;fR=1;var e=hV(),t=pV(),n=mP();vy=u;var r={}.hasOwnProperty,i=["history","path","basename","stem","extname","dirname"];u.prototype.toString=x,Object.defineProperty(u.prototype,"path",{get:s,set:c}),Object.defineProperty(u.prototype,"dirname",{get:f,set:d}),Object.defineProperty(u.prototype,"basename",{get:h,set:m}),Object.defineProperty(u.prototype,"extname",{get:v,set:g}),Object.defineProperty(u.prototype,"stem",{get:y,set:S});function u(C){var O,k;if(!C)C={};else if(typeof C=="string"||n(C))C={contents:C};else if("message"in C&&"messages"in C)return C;if(!(this instanceof u))return new u(C);for(this.data={},this.messages=[],this.history=[],this.cwd=t.cwd(),k=-1;++k-1)throw new Error("`extname` cannot contain multiple dots")}this.path=e.join(this.dirname,this.stem+(C||""))}function y(){return typeof this.path=="string"?e.basename(this.path,this.extname):void 0}function S(C){b(C,"stem"),w(C,"stem"),this.path=e.join(this.dirname||"",C+(this.extname||""))}function x(C){return(this.contents||"").toString(C)}function w(C,O){if(C&&C.indexOf(e.sep)>-1)throw new Error("`"+O+"` cannot be a path: did not expect `"+e.sep+"`")}function b(C,O){if(!C)throw new Error("`"+O+"` cannot be empty")}function _(C,O){if(!C)throw new Error("Setting `"+O+"` requires `path` to be set too")}return vy}var by,dR;function gV(){if(dR)return by;dR=1;var e=dV(),t=mV();by=t,t.prototype.message=n,t.prototype.info=i,t.prototype.fail=r;function n(u,s,c){var f=new e(u,s,c);return this.path&&(f.name=this.path+":"+f.name,f.file=this.path),f.fatal=!1,this.messages.push(f),f}function r(){var u=this.message.apply(this,arguments);throw u.fatal=!0,u}function i(){var u=this.message.apply(this,arguments);return u.fatal=null,u}return by}var xy,hR;function gP(){return hR||(hR=1,xy=gV()),xy}var Sy,pR;function yV(){if(pR)return Sy;pR=1,Sy=e;function e(t){if(t)throw t}return Sy}var Ey,mR;function vV(){if(mR)return Ey;mR=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},u=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var h=e.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!h&&!m)return!1;var v;for(v in d);return typeof v>"u"||e.call(d,v)},s=function(d,h){n&&h.name==="__proto__"?n(d,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):d[h.name]=h.newValue},c=function(d,h){if(h==="__proto__")if(e.call(d,h)){if(r)return r(d,h).value}else return;return d[h]};return Ey=function f(){var d,h,m,v,g,y,S=arguments[0],x=1,w=arguments.length,b=!1;for(typeof S=="boolean"&&(b=S,S=arguments[1]||{},x=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});x{if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}),wy}var Cy,yR;function xV(){if(yR)return Cy;yR=1;var e=[].slice;Cy=t;function t(n,r){var i;return u;function u(){var f=e.call(arguments,0),d=n.length>f.length,h;d&&f.push(s);try{h=n.apply(null,f)}catch(m){if(d&&i)throw m;return s(m)}d||(h&&typeof h.then=="function"?h.then(c,s):h instanceof Error?s(h):c(h))}function s(){i||(i=!0,r.apply(null,arguments))}function c(f){s(null,f)}}return Cy}var _y,vR;function SV(){if(vR)return _y;vR=1;var e=xV();_y=n,n.wrap=e;var t=[].slice;function n(){var r=[],i={};return i.run=u,i.use=s,i;function u(){var c=-1,f=t.call(arguments,0,-1),d=arguments[arguments.length-1];if(typeof d!="function")throw new Error("Expected function as last argument, not "+d);h.apply(null,[null].concat(f));function h(m){var v=r[++c],g=t.call(arguments,0),y=g.slice(1),S=f.length,x=-1;if(m){d(m);return}for(;++x13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":e(i)}return Dy=t,Dy}var If={},Ly,OR;function fn(){if(OR)return Ly;OR=1;function e(t){return t<-2}return Ly=e,Ly}var qy,AR;function ci(){if(AR)return qy;AR=1;function e(t){return t===-2||t===-1||t===32}return qy=e,qy}var Py,RR;function bn(){if(RR)return Py;RR=1;var e=ci();function t(n,r,i,u){var s=u?u-1:1/0,c=0;return f;function f(h){return e(h)?(n.enter(i),d(h)):r(h)}function d(h){return e(h)&&c++P;)h.containerState=m[q][1],m[q][0].exit.call(h,d);m.length=P}function L(P,j){var q=0;return y={},F;function F(W){return q-1?void 0:4)}function f(d,h,m){return t(d,d.lazy(this.parser.constructs.flow,h,m),"linePrefix",this.parser.constructs.disable.null.indexOf("codeIndented")>-1?void 0:4)}return Hf.tokenize=r,Hf}var Vf={},Fy,DR;function vP(){if(DR)return Fy;DR=1;function e(t){for(var n=-1,r=0;++ns?0:s+r:r=r>s?s:r,i=i>0?i:0,u.length<1e4)f=Array.from(u),f.unshift(r,i),e.apply(n,f);else for(i&&e.apply(n,[r,i]);c-1||t(v.events,"linePrefix")<4?d.interrupt(v.parser.constructs.flow,m,h)(S):h(S)}}return Iy=i,Iy}var zR;function kV(){if(zR)return Vf;zR=1,Object.defineProperty(Vf,"__esModule",{value:!0});var e=RV(),t=bn(),n=dh(),r=i;function i(u){var s=this,c=u.attempt(n,f,u.attempt(this.parser.constructs.flowInitial,d,t(u,u.attempt(this.parser.constructs.flow,d,u.attempt(e,d)),"linePrefix")));return c;function f(h){if(h===null){u.consume(h);return}return u.enter("lineEndingBlank"),u.consume(h),u.exit("lineEndingBlank"),s.currentConstruct=void 0,c}function d(h){if(h===null){u.consume(h);return}return u.enter("lineEnding"),u.consume(h),u.exit("lineEnding"),s.currentConstruct=void 0,c}}return Vf.tokenize=r,Vf}var Qu={},$R;function xP(){if($R)return Qu;$R=1,Object.defineProperty(Qu,"__esModule",{value:!0});var e=oc(),t=au(),n=u("text"),r=u("string"),i={resolveAll:s()};function u(f){return{tokenize:d,resolveAll:s(f==="text"?c:void 0)};function d(h){var m=this,v=this.parser.constructs[f],g=h.attempt(v,y,S);return y;function y(b){return w(b)?g(b):S(b)}function S(b){if(b===null){h.consume(b);return}return h.enter("data"),h.consume(b),x}function x(b){return w(b)?(h.exit("data"),g(b)):(h.consume(b),x)}function w(b){var _=v[b],C=-1;if(b===null)return!0;if(_){for(;++C<_.length;)if(!_[C].previous||_[C].previous.call(m,m.previous))return!0}}}}function s(f){return d;function d(h,m){for(var v=-1,g;++v<=h.length;)g===void 0?h[v]&&h[v][1].type==="data"&&(g=v,v++):(!h[v]||h[v][1].type!=="data")&&(v!==g+2&&(h[g][1].end=h[v-1][1].end,h.splice(g+2,v-g-2),v=g+2),g=void 0);return f?f(h,m):h}}function c(f,d){for(var h=-1,m,v,g,y,S,x,w,b;++h<=f.length;)if((h===f.length||f[h][1].type==="lineEnding")&&f[h-1][1].type==="data"){for(v=f[h-1][1],m=d.sliceStream(v),y=m.length,S=-1,x=0,w=void 0;y--;)if(g=m[y],typeof g=="string"){for(S=g.length;g.charCodeAt(S-1)===32;)x++,S--;if(S)break;S=-1}else if(g===-2)w=!0,x++;else if(g!==-1){y++;break}x&&(b={type:h===f.length||w||x<2?"lineSuffix":"hardBreakTrailing",start:{line:v.end.line,column:v.end.column-x,offset:v.end.offset-x,_index:v.start._index+y,_bufferIndex:y?S:v.start._bufferIndex+S},end:t(v.end)},v.end=t(b.start),v.start.offset===v.end.offset?e(v,b):(f.splice(h,0,["enter",b,d],["exit",b,d]),h+=2)),h++}return f}return Qu.resolver=i,Qu.string=r,Qu.text=n,Qu}var Hy,UR;function lS(){if(UR)return Hy;UR=1;function e(t){return t==null?[]:"length"in t?t:[t]}return Hy=e,Hy}var Vy,BR;function SP(){if(BR)return Vy;BR=1;var e=yP(),t=fi(),n=lS();function r(s){for(var c={},f=-1;++f-1&&(c[0]=c[0].slice(i)),s>0&&c.push(t[u].slice(0,s))),c}return Gy=e,Gy}var Yy,WR;function DV(){if(WR)return Yy;WR=1;var e=oc(),t=fn(),n=uS(),r=fi(),i=lS(),u=hh(),s=TV(),c=au(),f=MV();function d(h,m,v){var g=v?c(v):{line:1,column:1,offset:0},y={},S=[],x=[],w=[],b={consume:j,enter:q,exit:F,attempt:H(N),check:H($),interrupt:H($,{interrupt:!0}),lazy:H($,{lazy:!0})},_={previous:null,events:[],parser:h,sliceStream:D,sliceSerialize:k,now:M,defineSkip:T,write:O},C=m.tokenize.call(_,b);return m.resolveAll&&S.push(m),g._index=0,g._bufferIndex=-1,_;function O(Z){return x=n(x,Z),L(),x[x.length-1]!==null?[]:(K(m,0),_.events=u(S,_.events,_),_.events)}function k(Z){return s(D(Z))}function D(Z){return f(x,Z)}function M(){return c(g)}function T(Z){y[Z.line]=Z.column,W()}function L(){for(var Z,X;g._index-1?U():ce.tokenize.call(X?e({},_,X):_,b,Te,U)(G)}}function Te(ce){return Z(V,ue),ae}function U(ce){return ue.restore(),++oe1&&d[m][1].end.offset-d[m][1].start.offset>1?2:1,S={type:w>1?"strongSequence":"emphasisSequence",start:r(u(d[v][1].end),-w),end:u(d[v][1].end)},x={type:w>1?"strongSequence":"emphasisSequence",start:u(d[m][1].start),end:r(u(d[m][1].start),w)},y={type:w>1?"strongText":"emphasisText",start:u(d[v][1].end),end:u(d[m][1].start)},g={type:w>1?"strong":"emphasis",start:u(S.start),end:u(x.end)},d[v][1].end=u(S.start),d[m][1].start=u(x.end),b=[],d[v][1].end.offset-d[v][1].start.offset&&(b=e(b,[["enter",d[v][1],h],["exit",d[v][1],h]])),b=e(b,[["enter",g,h],["enter",S,h],["exit",S,h],["enter",y,h]]),b=e(b,i(h.parser.constructs.insideSpan.null,d.slice(v+1,m),h)),b=e(b,[["exit",y,h],["enter",x,h],["exit",x,h],["exit",g,h]]),d[m][1].end.offset-d[m][1].start.offset?(_=2,b=e(b,[["enter",d[m][1],h],["exit",d[m][1],h]])):_=0,t(d,v-1,m-v+3,b),m=v+b.length-_-2;break}}for(m=-1;++m-1?void 0:4)}function u(s){s.exit("blockQuote")}return cv=n,cv}var fv,sk;function zV(){if(sk)return fv;sk=1;var e=ll(),t=e(/[!-/:-@[-`{-~]/);return fv=t,fv}var dv,ok;function $V(){if(ok)return dv;ok=1;var e=zV(),t={name:"characterEscape",tokenize:n};function n(r,i,u){return s;function s(f){return r.enter("characterEscape"),r.enter("escapeMarker"),r.consume(f),r.exit("escapeMarker"),c}function c(f){return e(f)?(r.enter("characterEscapeValue"),r.consume(f),r.exit("characterEscapeValue"),r.exit("characterEscape"),i):u(f)}}return dv=t,dv}var hv,ck;function wP(){if(ck)return hv;ck=1;var e,t=59;hv=n;function n(r){var i="&"+r+";",u;return e=e||document.createElement("i"),e.innerHTML=i,u=e.textContent,u.charCodeAt(u.length-1)===t&&r!=="semi"||u===i?!1:u}return hv}var pv,fk;function CP(){if(fk)return pv;fk=1;var e=ll(),t=e(/\d/);return pv=t,pv}var mv,dk;function UV(){if(dk)return mv;dk=1;var e=ll(),t=e(/[\dA-Fa-f]/);return mv=t,mv}var gv,hk;function BV(){if(hk)return gv;hk=1;var e=wP(),t=fc(),n=CP(),r=UV();function i(f){return f&&typeof f=="object"&&"default"in f?f:{default:f}}var u=i(e),s={name:"characterReference",tokenize:c};function c(f,d,h){var m=this,v=0,g,y;return S;function S(_){return f.enter("characterReference"),f.enter("characterReferenceMarker"),f.consume(_),f.exit("characterReferenceMarker"),x}function x(_){return _===35?(f.enter("characterReferenceMarkerNumeric"),f.consume(_),f.exit("characterReferenceMarkerNumeric"),w):(f.enter("characterReferenceValue"),g=31,y=t,b(_))}function w(_){return _===88||_===120?(f.enter("characterReferenceMarkerHexadecimal"),f.consume(_),f.exit("characterReferenceMarkerHexadecimal"),f.enter("characterReferenceValue"),g=6,y=r,b):(f.enter("characterReferenceValue"),g=7,y=n,b(_))}function b(_){var C;return _===59&&v?(C=f.exit("characterReferenceValue"),y===t&&!u.default(m.sliceSerialize(C))?h(_):(f.enter("characterReferenceMarker"),f.consume(_),f.exit("characterReferenceMarker"),f.exit("characterReference"),d)):y(_)&&v++-1?void 0:4);function q($){return T.enter("codeFencedFence"),T.enter("codeFencedFenceSequence"),F($)}function F($){return $===g?(T.consume($),j++,F):jg?s(O):(i.consume(O),_):O===41?y--?(i.consume(O),_):(i.exit("chunkString"),i.exit(m),i.exit(h),i.exit(c),u(O)):O===null||t(O)?y?s(O):(i.exit("chunkString"),i.exit(m),i.exit(h),i.exit(c),u(O)):e(O)?s(O):(i.consume(O),O===92?C:_)}function C(O){return O===40||O===41||O===92?(i.consume(O),_):_(O)}}return xv=r,xv}var Sv,vk;function OP(){if(vk)return Sv;vk=1;var e=fn(),t=ci();function n(r,i,u,s,c,f){var d=this,h=0,m;return v;function v(x){return r.enter(s),r.enter(c),r.consume(x),r.exit(c),r.enter(f),g}function g(x){return x===null||x===91||x===93&&!m||x===94&&!h&&"_hiddenFootnoteSupport"in d.parser.constructs||h>999?u(x):x===93?(r.exit(f),r.enter(c),r.consume(x),r.exit(c),r.exit(s),i):e(x)?(r.enter("lineEnding"),r.consume(x),r.exit("lineEnding"),g):(r.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===null||x===91||x===93||e(x)||h++>999?(r.exit("chunkString"),g(x)):(r.consume(x),m=m||!t(x),x===92?S:y)}function S(x){return x===91||x===92||x===93?(r.consume(x),h++,y):y(x)}}return Sv=n,Sv}var Ev,bk;function AP(){if(bk)return Ev;bk=1;var e=fn(),t=ci(),n=bn();function r(i,u){var s;return c;function c(f){return e(f)?(i.enter("lineEnding"),i.consume(f),i.exit("lineEnding"),s=!0,c):t(f)?n(i,c,s?"linePrefix":"lineSuffix")(f):u(f)}}return Ev=r,Ev}var wv,xk;function RP(){if(xk)return wv;xk=1;var e=fn(),t=bn();function n(r,i,u,s,c,f){var d;return h;function h(S){return r.enter(s),r.enter(c),r.consume(S),r.exit(c),d=S===40?41:S,m}function m(S){return S===d?(r.enter(c),r.consume(S),r.exit(c),r.exit(s),i):(r.enter(f),v(S))}function v(S){return S===d?(r.exit(f),m(d)):S===null?u(S):e(S)?(r.enter("lineEnding"),r.consume(S),r.exit("lineEnding"),t(r,v,"linePrefix")):(r.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===d||S===null||e(S)?(r.exit("chunkString"),v(S)):(r.consume(S),S===92?y:g)}function y(S){return S===d||S===92?(r.consume(S),g):g(S)}}return wv=n,wv}var Cv,Sk;function KV(){if(Sk)return Cv;Sk=1;var e=fn(),t=di(),n=iS(),r=_P(),i=OP(),u=bn(),s=AP(),c=RP(),f={name:"definition",tokenize:h},d={tokenize:m,partial:!0};function h(v,g,y){var S=this,x;return w;function w(C){return v.enter("definition"),i.call(S,v,b,y,"definitionLabel","definitionLabelMarker","definitionLabelString")(C)}function b(C){return x=n(S.sliceSerialize(S.events[S.events.length-1][1]).slice(1,-1)),C===58?(v.enter("definitionMarker"),v.consume(C),v.exit("definitionMarker"),s(v,r(v,v.attempt(d,u(v,_,"whitespace"),u(v,_,"whitespace")),y,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString"))):y(C)}function _(C){return C===null||e(C)?(v.exit("definition"),S.parser.defined.indexOf(x)<0&&S.parser.defined.push(x),g(C)):y(C)}}function m(v,g,y){return S;function S(b){return t(b)?s(v,x)(b):y(b)}function x(b){return b===34||b===39||b===40?c(v,u(v,w,"whitespace"),y,"definitionTitle","definitionTitleMarker","definitionTitleString")(b):y(b)}function w(b){return b===null||e(b)?g(b):y(b)}}return Cv=f,Cv}var _v,Ek;function WV(){if(Ek)return _v;Ek=1;var e=fn(),t={name:"hardBreakEscape",tokenize:n};function n(r,i,u){return s;function s(f){return r.enter("hardBreakEscape"),r.enter("escapeMarker"),r.consume(f),c}function c(f){return e(f)?(r.exit("escapeMarker"),r.exit("hardBreakEscape"),i(f)):u(f)}}return _v=t,_v}var Ov,wk;function QV(){if(wk)return Ov;wk=1;var e=fn(),t=di(),n=ci(),r=fi(),i=bn(),u={name:"headingAtx",tokenize:c,resolve:s};function s(f,d){var h=f.length-2,m=3,v,g;return f[m][1].type==="whitespace"&&(m+=2),h-2>m&&f[h][1].type==="whitespace"&&(h-=2),f[h][1].type==="atxHeadingSequence"&&(m===h-1||h-4>m&&f[h-2][1].type==="whitespace")&&(h-=m+1===h?2:4),h>m&&(v={type:"atxHeadingText",start:f[m][1].start,end:f[h][1].end},g={type:"chunkText",start:f[m][1].start,end:f[h][1].end,contentType:"text"},r(f,m,h-m+1,[["enter",v,d],["enter",g,d],["exit",g,d],["exit",v,d]])),f}function c(f,d,h){var m=this,v=0;return g;function g(b){return f.enter("atxHeading"),f.enter("atxHeadingSequence"),y(b)}function y(b){return b===35&&v++<6?(f.consume(b),y):b===null||t(b)?(f.exit("atxHeadingSequence"),m.interrupt?d(b):S(b)):h(b)}function S(b){return b===35?(f.enter("atxHeadingSequence"),x(b)):b===null||e(b)?(f.exit("atxHeading"),d(b)):n(b)?i(f,S,"whitespace")(b):(f.enter("atxHeadingText"),w(b))}function x(b){return b===35?(f.consume(b),x):(f.exit("atxHeadingSequence"),S(b))}function w(b){return b===null||b===35||t(b)?(f.exit("atxHeadingText"),S(b)):(f.consume(b),w)}}return Ov=u,Ov}var Av,Ck;function GV(){if(Ck)return Av;Ck=1;var e=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"];return Av=e,Av}var Rv,_k;function YV(){if(_k)return Rv;_k=1;var e=["pre","script","style","textarea"];return Rv=e,Rv}var kv,Ok;function XV(){if(Ok)return kv;Ok=1;var e=ph(),t=fc(),n=fn(),r=di(),i=ci(),u=fh(),s=GV(),c=YV(),f=dh(),d={name:"htmlFlow",tokenize:v,resolveTo:m,concrete:!0},h={tokenize:g,partial:!0};function m(y){for(var S=y.length;S--&&!(y[S][0]==="enter"&&y[S][1].type==="htmlFlow"););return S>1&&y[S-2][1].type==="linePrefix"&&(y[S][1].start=y[S-2][1].start,y[S+1][1].start=y[S-2][1].start,y.splice(S-2,2)),y}function v(y,S,x){var w=this,b,_,C,O,k;return D;function D(U){return y.enter("htmlFlow"),y.enter("htmlFlowData"),y.consume(U),M}function M(U){return U===33?(y.consume(U),T):U===47?(y.consume(U),j):U===63?(y.consume(U),b=3,w.interrupt?S:Ee):e(U)?(y.consume(U),C=u(U),_=!0,q):x(U)}function T(U){return U===45?(y.consume(U),b=2,L):U===91?(y.consume(U),b=5,C="CDATA[",O=0,P):e(U)?(y.consume(U),b=4,w.interrupt?S:Ee):x(U)}function L(U){return U===45?(y.consume(U),w.interrupt?S:Ee):x(U)}function P(U){return U===C.charCodeAt(O++)?(y.consume(U),O===C.length?w.interrupt?S:ae:P):x(U)}function j(U){return e(U)?(y.consume(U),C=u(U),q):x(U)}function q(U){return U===null||U===47||U===62||r(U)?U!==47&&_&&c.indexOf(C.toLowerCase())>-1?(b=1,w.interrupt?S(U):ae(U)):s.indexOf(C.toLowerCase())>-1?(b=6,U===47?(y.consume(U),F):w.interrupt?S(U):ae(U)):(b=7,w.interrupt?x(U):_?$(U):N(U)):U===45||t(U)?(y.consume(U),C+=u(U),q):x(U)}function F(U){return U===62?(y.consume(U),w.interrupt?S:ae):x(U)}function N(U){return i(U)?(y.consume(U),N):Y(U)}function $(U){return U===47?(y.consume(U),Y):U===58||U===95||e(U)?(y.consume(U),H):i(U)?(y.consume(U),$):Y(U)}function H(U){return U===45||U===46||U===58||U===95||t(U)?(y.consume(U),H):K(U)}function K(U){return U===61?(y.consume(U),ne):i(U)?(y.consume(U),K):$(U)}function ne(U){return U===null||U===60||U===61||U===62||U===96?x(U):U===34||U===39?(y.consume(U),k=U,W):i(U)?(y.consume(U),ne):(k=void 0,Z(U))}function W(U){return U===k?(y.consume(U),X):U===null||n(U)?x(U):(y.consume(U),W)}function Z(U){return U===null||U===34||U===39||U===60||U===61||U===62||U===96||r(U)?K(U):(y.consume(U),Z)}function X(U){return U===47||U===62||i(U)?$(U):x(U)}function Y(U){return U===62?(y.consume(U),I):x(U)}function I(U){return i(U)?(y.consume(U),I):U===null||n(U)?ae(U):x(U)}function ae(U){return U===45&&b===2?(y.consume(U),oe):U===60&&b===1?(y.consume(U),V):U===62&&b===4?(y.consume(U),Ce):U===63&&b===3?(y.consume(U),Ee):U===93&&b===5?(y.consume(U),me):n(U)&&(b===6||b===7)?y.check(h,Ce,se)(U):U===null||n(U)?se(U):(y.consume(U),ae)}function se(U){return y.exit("htmlFlowData"),ie(U)}function ie(U){return U===null?Te(U):n(U)?(y.enter("lineEnding"),y.consume(U),y.exit("lineEnding"),ie):(y.enter("htmlFlowData"),ae(U))}function oe(U){return U===45?(y.consume(U),Ee):ae(U)}function V(U){return U===47?(y.consume(U),C="",ue):ae(U)}function ue(U){return U===62&&c.indexOf(C.toLowerCase())>-1?(y.consume(U),Ce):e(U)&&C.length<8?(y.consume(U),C+=u(U),ue):ae(U)}function me(U){return U===93?(y.consume(U),Ee):ae(U)}function Ee(U){return U===62?(y.consume(U),Ce):ae(U)}function Ce(U){return U===null||n(U)?(y.exit("htmlFlowData"),Te(U)):(y.consume(U),Ce)}function Te(U){return y.exit("htmlFlow"),S(U)}}function g(y,S,x){return w;function w(b){return y.exit("htmlFlowData"),y.enter("lineEndingBlank"),y.consume(b),y.exit("lineEndingBlank"),y.attempt(f,S,x)}}return kv=d,kv}var Tv,Ak;function ZV(){if(Ak)return Tv;Ak=1;var e=ph(),t=fc(),n=fn(),r=di(),i=ci(),u=bn(),s={name:"htmlText",tokenize:c};function c(f,d,h){var m=this,v,g,y,S;return x;function x(V){return f.enter("htmlText"),f.enter("htmlTextData"),f.consume(V),w}function w(V){return V===33?(f.consume(V),b):V===47?(f.consume(V),N):V===63?(f.consume(V),q):e(V)?(f.consume(V),K):h(V)}function b(V){return V===45?(f.consume(V),_):V===91?(f.consume(V),g="CDATA[",y=0,M):e(V)?(f.consume(V),j):h(V)}function _(V){return V===45?(f.consume(V),C):h(V)}function C(V){return V===null||V===62?h(V):V===45?(f.consume(V),O):k(V)}function O(V){return V===null||V===62?h(V):k(V)}function k(V){return V===null?h(V):V===45?(f.consume(V),D):n(V)?(S=k,se(V)):(f.consume(V),k)}function D(V){return V===45?(f.consume(V),oe):k(V)}function M(V){return V===g.charCodeAt(y++)?(f.consume(V),y===g.length?T:M):h(V)}function T(V){return V===null?h(V):V===93?(f.consume(V),L):n(V)?(S=T,se(V)):(f.consume(V),T)}function L(V){return V===93?(f.consume(V),P):T(V)}function P(V){return V===62?oe(V):V===93?(f.consume(V),P):T(V)}function j(V){return V===null||V===62?oe(V):n(V)?(S=j,se(V)):(f.consume(V),j)}function q(V){return V===null?h(V):V===63?(f.consume(V),F):n(V)?(S=q,se(V)):(f.consume(V),q)}function F(V){return V===62?oe(V):q(V)}function N(V){return e(V)?(f.consume(V),$):h(V)}function $(V){return V===45||t(V)?(f.consume(V),$):H(V)}function H(V){return n(V)?(S=H,se(V)):i(V)?(f.consume(V),H):oe(V)}function K(V){return V===45||t(V)?(f.consume(V),K):V===47||V===62||r(V)?ne(V):h(V)}function ne(V){return V===47?(f.consume(V),oe):V===58||V===95||e(V)?(f.consume(V),W):n(V)?(S=ne,se(V)):i(V)?(f.consume(V),ne):oe(V)}function W(V){return V===45||V===46||V===58||V===95||t(V)?(f.consume(V),W):Z(V)}function Z(V){return V===61?(f.consume(V),X):n(V)?(S=Z,se(V)):i(V)?(f.consume(V),Z):ne(V)}function X(V){return V===null||V===60||V===61||V===62||V===96?h(V):V===34||V===39?(f.consume(V),v=V,Y):n(V)?(S=X,se(V)):i(V)?(f.consume(V),X):(f.consume(V),v=void 0,ae)}function Y(V){return V===v?(f.consume(V),I):V===null?h(V):n(V)?(S=Y,se(V)):(f.consume(V),Y)}function I(V){return V===62||V===47||r(V)?ne(V):h(V)}function ae(V){return V===null||V===34||V===39||V===60||V===61||V===96?h(V):V===62||r(V)?ne(V):(f.consume(V),ae)}function se(V){return f.exit("htmlTextData"),f.enter("lineEnding"),f.consume(V),f.exit("lineEnding"),u(f,ie,"linePrefix",m.parser.constructs.disable.null.indexOf("codeIndented")>-1?void 0:4)}function ie(V){return f.enter("htmlTextData"),S(V)}function oe(V){return V===62?(f.consume(V),f.exit("htmlTextData"),f.exit("htmlText"),d):h(V)}}return Tv=s,Tv}var Mv,Rk;function fS(){if(Rk)return Mv;Rk=1;var e=di(),t=uS(),n=fi(),r=iS(),i=hh(),u=au(),s=_P(),c=OP(),f=RP(),d=AP(),h={name:"labelEnd",tokenize:x,resolveTo:S,resolveAll:y},m={tokenize:w},v={tokenize:b},g={tokenize:_};function y(C){for(var O=-1,k;++O-1,C.enter("labelEnd"),C.enter("labelMarker"),C.consume(F),C.exit("labelMarker"),C.exit("labelEnd"),j):k(F)}function j(F){return F===40?C.attempt(m,O,L?O:q)(F):F===91?C.attempt(v,O,L?C.attempt(g,O,q):q)(F):L?O(F):q(F)}function q(F){return T._balanced=!0,k(F)}}function w(C,O,k){return D;function D(j){return C.enter("resource"),C.enter("resourceMarker"),C.consume(j),C.exit("resourceMarker"),d(C,M)}function M(j){return j===41?P(j):s(C,T,k,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",3)(j)}function T(j){return e(j)?d(C,L)(j):P(j)}function L(j){return j===34||j===39||j===40?f(C,d(C,P),k,"resourceTitle","resourceTitleMarker","resourceTitleString")(j):P(j)}function P(j){return j===41?(C.enter("resourceMarker"),C.consume(j),C.exit("resourceMarker"),C.exit("resource"),O):k(j)}}function b(C,O,k){var D=this;return M;function M(L){return c.call(D,C,T,k,"reference","referenceMarker","referenceString")(L)}function T(L){return D.parser.defined.indexOf(r(D.sliceSerialize(D.events[D.events.length-1][1]).slice(1,-1)))<0?k(L):O(L)}}function _(C,O,k){return D;function D(T){return C.enter("reference"),C.enter("referenceMarker"),C.consume(T),C.exit("referenceMarker"),M}function M(T){return T===93?(C.enter("referenceMarker"),C.consume(T),C.exit("referenceMarker"),C.exit("reference"),O):k(T)}}return Mv=h,Mv}var Dv,kk;function JV(){if(kk)return Dv;kk=1;var e=fS(),t={name:"labelStartImage",tokenize:n,resolveAll:e.resolveAll};function n(r,i,u){var s=this;return c;function c(h){return r.enter("labelImage"),r.enter("labelImageMarker"),r.consume(h),r.exit("labelImageMarker"),f}function f(h){return h===91?(r.enter("labelMarker"),r.consume(h),r.exit("labelMarker"),r.exit("labelImage"),d):u(h)}function d(h){return h===94&&"_hiddenFootnoteSupport"in s.parser.constructs?u(h):i(h)}}return Dv=t,Dv}var Lv,Tk;function e9(){if(Tk)return Lv;Tk=1;var e=fS(),t={name:"labelStartLink",tokenize:n,resolveAll:e.resolveAll};function n(r,i,u){var s=this;return c;function c(d){return r.enter("labelLink"),r.enter("labelMarker"),r.consume(d),r.exit("labelMarker"),r.exit("labelLink"),f}function f(d){return d===94&&"_hiddenFootnoteSupport"in s.parser.constructs?u(d):i(d)}}return Lv=t,Lv}var qv,Mk;function t9(){if(Mk)return qv;Mk=1;var e=bn(),t={name:"lineEnding",tokenize:n};function n(r,i){return u;function u(s){return r.enter("lineEnding"),r.consume(s),r.exit("lineEnding"),e(r,i,"linePrefix")}}return qv=t,qv}var Pv,Dk;function kP(){if(Dk)return Pv;Dk=1;var e=fn(),t=ci(),n=bn(),r={name:"thematicBreak",tokenize:i};function i(u,s,c){var f=0,d;return h;function h(g){return u.enter("thematicBreak"),d=g,m(g)}function m(g){return g===d?(u.enter("thematicBreakSequence"),v(g)):t(g)?n(u,m,"whitespace")(g):f<3||g!==null&&!e(g)?c(g):(u.exit("thematicBreak"),s(g))}function v(g){return g===d?(u.consume(g),f++,v):(u.exit("thematicBreakSequence"),m(g))}}return Pv=r,Pv}var jv,Lk;function n9(){if(Lk)return jv;Lk=1;var e=CP(),t=ci(),n=cc(),r=vP(),i=bn(),u=dh(),s=kP(),c={name:"list",tokenize:h,continuation:{tokenize:m},exit:g},f={tokenize:y,partial:!0},d={tokenize:v,partial:!0};function h(S,x,w){var b=this,_=n(b.events,"linePrefix"),C=0;return O;function O(P){var j=b.containerState.type||(P===42||P===43||P===45?"listUnordered":"listOrdered");if(j==="listUnordered"?!b.containerState.marker||P===b.containerState.marker:e(P)){if(b.containerState.type||(b.containerState.type=j,S.enter(j,{_container:!0})),j==="listUnordered")return S.enter("listItemPrefix"),P===42||P===45?S.check(s,w,D)(P):D(P);if(!b.interrupt||P===49)return S.enter("listItemPrefix"),S.enter("listItemValue"),k(P)}return w(P)}function k(P){return e(P)&&++C<10?(S.consume(P),k):(!b.interrupt||C<2)&&(b.containerState.marker?P===b.containerState.marker:P===41||P===46)?(S.exit("listItemValue"),D(P)):w(P)}function D(P){return S.enter("listItemMarker"),S.consume(P),S.exit("listItemMarker"),b.containerState.marker=b.containerState.marker||P,S.check(u,b.interrupt?w:M,S.attempt(f,L,T))}function M(P){return b.containerState.initialBlankLine=!0,_++,L(P)}function T(P){return t(P)?(S.enter("listItemPrefixWhitespace"),S.consume(P),S.exit("listItemPrefixWhitespace"),L):w(P)}function L(P){return b.containerState.size=_+r(b.sliceStream(S.exit("listItemPrefix"))),x(P)}}function m(S,x,w){var b=this;return b.containerState._closeFlow=void 0,S.check(u,_,C);function _(k){return b.containerState.furtherBlankLines=b.containerState.furtherBlankLines||b.containerState.initialBlankLine,i(S,x,"listItemIndent",b.containerState.size+1)(k)}function C(k){return b.containerState.furtherBlankLines||!t(k)?(b.containerState.furtherBlankLines=b.containerState.initialBlankLine=void 0,O(k)):(b.containerState.furtherBlankLines=b.containerState.initialBlankLine=void 0,S.attempt(d,x,O)(k))}function O(k){return b.containerState._closeFlow=!0,b.interrupt=void 0,i(S,S.attempt(c,x,w),"linePrefix",b.parser.constructs.disable.null.indexOf("codeIndented")>-1?void 0:4)(k)}}function v(S,x,w){var b=this;return i(S,_,"listItemIndent",b.containerState.size+1);function _(C){return n(b.events,"listItemIndent")===b.containerState.size?x(C):w(C)}}function g(S){S.exit(this.containerState.type)}function y(S,x,w){var b=this;return i(S,_,"listItemPrefixWhitespace",b.parser.constructs.disable.null.indexOf("codeIndented")>-1?void 0:5);function _(C){return t(C)||!n(b.events,"listItemPrefixWhitespace")?w(C):x(C)}}return jv=c,jv}var Fv,qk;function r9(){if(qk)return Fv;qk=1;var e=fn(),t=au(),n=bn(),r={name:"setextUnderline",tokenize:u,resolveTo:i};function i(s,c){for(var f=s.length,d,h,m,v;f--;)if(s[f][0]==="enter"){if(s[f][1].type==="content"){d=f;break}s[f][1].type==="paragraph"&&(h=f)}else s[f][1].type==="content"&&s.splice(f,1),!m&&s[f][1].type==="definition"&&(m=f);return v={type:"setextHeading",start:t(s[h][1].start),end:t(s[s.length-1][1].end)},s[h][1].type="setextHeadingText",m?(s.splice(h,0,["enter",v,c]),s.splice(m+1,0,["exit",s[d][1],c]),s[d][1].end=t(s[m][1].end)):s[d][1]=v,s.push(["exit",v,c]),s}function u(s,c,f){for(var d=this,h=d.events.length,m,v;h--;)if(d.events[h][1].type!=="lineEnding"&&d.events[h][1].type!=="linePrefix"&&d.events[h][1].type!=="content"){v=d.events[h][1].type==="paragraph";break}return g;function g(x){return!d.lazy&&(d.interrupt||v)?(s.enter("setextHeadingLine"),s.enter("setextHeadingLineSequence"),m=x,y(x)):f(x)}function y(x){return x===m?(s.consume(x),y):(s.exit("setextHeadingLineSequence"),n(s,S,"lineSuffix")(x))}function S(x){return x===null||e(x)?(s.exit("setextHeadingLine"),c(x)):f(x)}}return Fv=r,Fv}var Pk;function a9(){if(Pk)return Gr;Pk=1,Object.defineProperty(Gr,"__esModule",{value:!0});var e=xP(),t=PV(),n=FV(),r=NV(),i=$V(),u=BV(),s=IV(),c=HV(),f=VV(),d=KV(),h=WV(),m=QV(),v=XV(),g=ZV(),y=fS(),S=JV(),x=e9(),w=t9(),b=n9(),_=r9(),C=kP(),O={42:b,43:b,45:b,48:b,49:b,50:b,51:b,52:b,53:b,54:b,55:b,56:b,57:b,62:r},k={91:d},D={"-2":c,"-1":c,32:c},M={35:m,42:C,45:[_,C],60:v,61:_,95:C,96:s,126:s},T={38:u,92:i},L={"-5":w,"-4":w,"-3":w,33:S,38:u,42:t,60:[n,g],91:x,92:[h,i],93:y,95:t,96:f},P={null:[t,e.resolver]},j={null:[]};return Gr.contentInitial=k,Gr.disable=j,Gr.document=O,Gr.flow=M,Gr.flowInitial=D,Gr.insideSpan=P,Gr.string=T,Gr.text=L,Gr}var Nv,jk;function i9(){if(jk)return Nv;jk=1;var e=_V(),t=OV(),n=kV(),r=xP(),i=SP(),u=DV(),s=lS(),c=a9();function f(d){var h=d||{},m={defined:[],constructs:i([c].concat(s(h.extensions))),content:v(e),document:v(t),flow:v(n),string:v(r.string),text:v(r.text)};return m;function v(g){return y;function y(S){return u(m,g,S)}}}return Nv=f,Nv}var zv,Fk;function l9(){if(Fk)return zv;Fk=1;var e=/[\0\t\n\r]/g;function t(){var n=!0,r=1,i="",u;return s;function s(c,f,d){var h=[],m,v,g,y,S;for(c=i+c.toString(f),g=0,i="",n&&(c.charCodeAt(0)===65279&&g++,n=void 0);g-1&&(ie.call(this,ve),oe.call(this,ve))}function ue(){C("atHardBreak",!0)}function me(){var ve=this.resume();this.stack[this.stack.length-1].value=ve}function Ee(){var ve=this.resume();this.stack[this.stack.length-1].value=ve}function Ce(){var ve=this.resume();this.stack[this.stack.length-1].value=ve}function Te(){var ve=this.stack[this.stack.length-1];O("inReference")?(ve.type+="Reference",ve.referenceType=O("referenceType")||"shortcut",delete ve.url,delete ve.title):(delete ve.identifier,delete ve.label,delete ve.referenceType),C("referenceType")}function U(){var ve=this.stack[this.stack.length-1];O("inReference")?(ve.type+="Reference",ve.referenceType=O("referenceType")||"shortcut",delete ve.url,delete ve.title):(delete ve.identifier,delete ve.label,delete ve.referenceType),C("referenceType")}function ce(ve){this.stack[this.stack.length-2].identifier=r(this.sliceSerialize(ve)).toLowerCase()}function fe(){var ve=this.stack[this.stack.length-1],Ue=this.resume();this.stack[this.stack.length-1].label=Ue,C("inReference",!0),this.stack[this.stack.length-1].type==="link"?this.stack[this.stack.length-1].children=ve.children:this.stack[this.stack.length-1].alt=Ue}function G(){var ve=this.resume();this.stack[this.stack.length-1].url=ve}function te(){var ve=this.resume();this.stack[this.stack.length-1].title=ve}function re(){C("inReference")}function de(){C("referenceType","collapsed")}function _e(ve){var Ue=this.resume();this.stack[this.stack.length-1].label=Ue,this.stack[this.stack.length-1].identifier=r(this.sliceSerialize(ve)).toLowerCase(),C("referenceType","full")}function be(ve){C("characterReferenceType",ve.type)}function De(ve){var Ue=this.sliceSerialize(ve),et=O("characterReferenceType"),at,wt;et?(at=i(Ue,et==="characterReferenceMarkerNumeric"?10:16),C("characterReferenceType")):at=f(Ue),wt=this.stack.pop(),wt.value+=at,wt.position.end=k(ve.end)}function Le(ve){oe.call(this,ve),this.stack[this.stack.length-1].url=this.sliceSerialize(ve)}function Fe(ve){oe.call(this,ve),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(ve)}function je(){return{type:"blockquote",children:[]}}function Ne(){return{type:"code",lang:null,meta:null,value:""}}function ot(){return{type:"inlineCode",value:""}}function ut(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function yt(){return{type:"emphasis",children:[]}}function jt(){return{type:"heading",depth:void 0,children:[]}}function It(){return{type:"break"}}function Et(){return{type:"html",value:""}}function ye(){return{type:"image",title:null,url:"",alt:null}}function Se(){return{type:"link",title:null,url:"",children:[]}}function Ke(ve){return{type:"list",ordered:ve.type==="listOrdered",start:null,spread:ve._spread,children:[]}}function pt(ve){return{type:"listItem",spread:ve._spread,checked:null,children:[]}}function vt(){return{type:"paragraph",children:[]}}function Ge(){return{type:"strong",children:[]}}function xn(){return{type:"text",value:""}}function mt(){return{type:"thematicBreak"}}}function v(y,S){for(var x=-1;++x":""))+")"),_;function _(){var C=x.concat(y),O=[],k,D;if((!f||v(y,S,x[x.length-1]||null))&&(O=s(d(y,x)),O[0]===i))return O;if(y.children&&O[0]!==r)for(D=(h?y.children.length:-1)+m;D>-1&&D-1?m=s:m=c.unknownHandler,(typeof m=="function"?m:r)(c,f,d)}function u(c){var f=c.data||{};return n.call(f,"hName")||n.call(f,"hProperties")||n.call(f,"hChildren")?!1:"value"in c}function s(c,f){var d;return f.children?(d=Object.assign({},f),d.children=t(c,f),d):f}return Jv}var eb,Zk;function qP(){if(Zk)return eb;Zk=1,eb=e;function e(t,n){return t(n,"hr")}return eb}var tb,Jk;function dc(){if(Jk)return tb;Jk=1,tb=t;var e=Ur();function t(n,r){var i=[],u=-1,s=n.length;for(r&&i.push(e("text",` +`));++u0&&i.push(e("text",` +`)),i}return tb}var nb,eT;function PP(){if(eT)return nb;eT=1,nb=n;var e=dc(),t=ir();function n(r,i){var u={},s=i.ordered?"ol":"ul",c,f=-1,d;for(typeof i.start=="number"&&i.start!==1&&(u.start=i.start),c=t(r,i),d=c.length;++f"u"&&(u=!0),h=t(i),s=0,c=r.length;s=55296&&f<=57343){if(f>=55296&&f<=56319&&s+1=56320&&d<=57343)){m+=encodeURIComponent(r[s]+r[s+1]),s++;continue}m+="%EF%BF%BD";continue}m+=encodeURIComponent(r[s])}return m}return n.defaultChars=";/?:@&=+$,-_.!~*'()#",n.componentChars="-_.!~*'()",hb=n,hb}var pb,dT;function FP(){if(dT)return pb;dT=1,pb=n;var e=Ur(),t=ir();function n(r,i){var u=i.referenceType,s="]",c,f,d;return u==="collapsed"?s+="[]":u==="full"&&(s+="["+(i.label||i.identifier)+"]"),i.type==="imageReference"?e("text","!["+i.alt+s):(c=t(r,i),f=c[0],f&&f.type==="text"?f.value="["+f.value:c.unshift(e("text","[")),d=c[c.length-1],d&&d.type==="text"?d.value+=s:c.push(e("text",s)),c)}return pb}var mb,hT;function w9(){if(hT)return mb;hT=1,mb=n;var e=mh(),t=FP();function n(r,i){var u=r.definition(i.identifier),s;return u?(s={src:e(u.url||""),alt:i.alt},u.title!==null&&u.title!==void 0&&(s.title=u.title),r(i,"img",s)):t(r,i)}return mb}var gb,pT;function C9(){if(pT)return gb;pT=1;var e=mh();gb=t;function t(n,r){var i={src:e(r.url),alt:r.alt};return r.title!==null&&r.title!==void 0&&(i.title=r.title),n(r,"img",i)}return gb}var yb,mT;function _9(){if(mT)return yb;mT=1,yb=t;var e=Ur();function t(n,r){var i=r.value.replace(/\r?\n|\r/g," ");return n(r,"code",[e("text",i)])}return yb}var vb,gT;function O9(){if(gT)return vb;gT=1,vb=r;var e=mh(),t=FP(),n=ir();function r(i,u){var s=i.definition(u.identifier),c;return s?(c={href:e(s.url||"")},s.title!==null&&s.title!==void 0&&(c.title=s.title),i(u,"a",c,n(i,u))):t(i,u)}return vb}var bb,yT;function A9(){if(yT)return bb;yT=1;var e=mh(),t=ir();bb=n;function n(r,i){var u={href:e(i.url)};return i.title!==null&&i.title!==void 0&&(u.title=i.title),r(i,"a",u,t(r,i))}return bb}var xb,vT;function R9(){if(vT)return xb;vT=1,xb=n;var e=Ur(),t=ir();function n(u,s,c){var f=t(u,s),d=f[0],h=c?r(c):i(s),m={},v=[],g,y,S;for(typeof s.checked=="boolean"&&((!d||d.tagName!=="p")&&(d=u(null,"p",[]),f.unshift(d)),d.children.length>0&&d.children.unshift(e("text"," ")),d.children.unshift(u(null,"input",{type:"checkbox",checked:s.checked,disabled:!0})),m.className=["task-list-item"]),g=f.length,y=-1;++y1}return xb}var Sb,bT;function k9(){if(bT)return Sb;bT=1,Sb=t;var e=ir();function t(n,r){return n(r,"p",e(n,r))}return Sb}var Eb,xT;function T9(){if(xT)return Eb;xT=1,Eb=r;var e=Ur(),t=dc(),n=ir();function r(i,u){return i.augment(u,e("root",t(n(i,u))))}return Eb}var wb,ST;function M9(){if(ST)return wb;ST=1,wb=t;var e=ir();function t(n,r){return n(r,"strong",e(n,r))}return wb}var Cb,ET;function D9(){if(ET)return Cb;ET=1,Cb=r;var e=DP(),t=dc(),n=ir();function r(i,u){for(var s=u.children,c=s.length,f=u.align||[],d=f.length,h=[],m,v,g,y,S;c--;){for(v=s[c].children,y=c===0?"th":"td",m=d||v.length,g=[];m--;)S=v[m],g[m]=i(S,y,{align:f[m]},S?n(i,S):[]);h[c]=i(s[c],"tr",t(g,!0))}return i(u,"table",t([i(h[0].position,"thead",t([h[0]],!0))].concat(h[1]?i({start:e.start(h[1]),end:e.end(h[h.length-1])},"tbody",t(h.slice(1),!0)):[]),!0))}return Cb}var _b,wT;function L9(){if(wT)return _b;wT=1,_b=t;var e=Ur();function t(n,r){return n.augment(r,e("text",String(r.value).replace(/[ \t]*(\r?\n|\r)[ \t]*/g,"$1")))}return _b}var Ob,CT;function q9(){if(CT)return Ob;CT=1,Ob={blockquote:m9(),break:g9(),code:y9(),delete:v9(),emphasis:b9(),footnoteReference:jP(),footnote:x9(),heading:S9(),html:E9(),imageReference:w9(),image:C9(),inlineCode:_9(),linkReference:O9(),link:A9(),listItem:R9(),list:PP(),paragraph:k9(),root:T9(),strong:M9(),table:D9(),text:L9(),thematicBreak:qP(),toml:e,yaml:e,definition:e,footnoteDefinition:e};function e(){return null}return Ob}var Ab,_T;function P9(){if(_T)return Ab;_T=1,Ab=m;var e=Ur(),t=dS(),n=DP(),r=d9(),i=h9(),u=LP(),s=p9(),c=q9(),f={}.hasOwnProperty,d=!1;function h(v,g){var y=g||{};y.allowDangerousHTML!==void 0&&!d&&(d=!0,console.warn("mdast-util-to-hast: deprecation: `allowDangerousHTML` is nonstandard, use `allowDangerousHtml` instead"));var S=y.allowDangerousHtml||y.allowDangerousHTML,x={};return b.dangerous=S,b.definition=i(v),b.footnoteById=x,b.footnoteOrder=[],b.augment=w,b.handlers=Object.assign({},c,y.handlers),b.unknownHandler=y.unknownHandler,b.passThrough=y.passThrough,t(v,"footnoteDefinition",_),b;function w(C,O){var k,D;return C&&C.data&&(k=C.data,k.hName&&(O.type!=="element"&&(O={type:"element",tagName:"",properties:{},children:[]}),O.tagName=k.hName),O.type==="element"&&k.hProperties&&(O.properties=Object.assign({},O.properties,k.hProperties)),O.children&&k.hChildren&&(O.children=k.hChildren)),D=C&&C.position?C:{position:C},r(D)||(O.position={start:n.start(D),end:n.end(D)}),O}function b(C,O,k,D){return D==null&&typeof k=="object"&&"length"in k&&(D=k,k={}),w(C,{type:"element",tagName:O,properties:k||{},children:D||[]})}function _(C){var O=String(C.identifier).toUpperCase();f.call(x,O)||(x[O]=C)}}function m(v,g){var y=h(v,g),S=u(y,v),x=s(y);return x&&(S.children=S.children.concat(e("text",` +`),x)),S}return Ab}var Rb,OT;function j9(){return OT||(OT=1,Rb=P9()),Rb}var kb,AT;function F9(){if(AT)return kb;AT=1;var e=j9();kb=t;function t(i,u){return i&&!i.process&&(u=i,i=null),i?n(i,u):r(u)}function n(i,u){return s;function s(c,f,d){i.run(e(c,u),f,h);function h(m){d(m)}}}function r(i){return u;function u(s){return e(s,i)}}return kb}var Tb,RT;function N9(){if(RT)return Tb;RT=1,Tb=t;var e=Object.prototype.hasOwnProperty;function t(){for(var n={},r=0;r{e(i,"element",r)};function r(i,u,s){const c=i,f=s;let d;if(n.allowedElements?d=!n.allowedElements.includes(c.tagName):n.disallowedElements&&(d=n.disallowedElements.includes(c.tagName)),!d&&n.allowElement&&typeof u=="number"&&(d=!n.allowElement(c,u,f)),d&&typeof u=="number")return n.unwrapDisallowed&&c.children?f.children.splice(u,1,...c.children):f.children.splice(u,1),u}}return Vb}var Kb,VT;function B9(){if(VT)return Kb;VT=1;const e=["http","https","mailto","tel"];Kb=t;function t(n){const r=(n||"").trim(),i=r.charAt(0);if(i==="#"||i==="/")return r;const u=r.indexOf(":");if(u===-1)return r;let s=-1;for(;++ss||(s=r.indexOf("#"),s!==-1&&u>s)?r:"javascript:void(0)"}return Kb}var Kf={},Wb={exports:{}},Tt={};/** @license React v17.0.2 + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var KT;function I9(){if(KT)return Tt;KT=1;var e=60103,t=60106,n=60107,r=60108,i=60114,u=60109,s=60110,c=60112,f=60113,d=60120,h=60115,m=60116,v=60121,g=60122,y=60117,S=60129,x=60131;if(typeof Symbol=="function"&&Symbol.for){var w=Symbol.for;e=w("react.element"),t=w("react.portal"),n=w("react.fragment"),r=w("react.strict_mode"),i=w("react.profiler"),u=w("react.provider"),s=w("react.context"),c=w("react.forward_ref"),f=w("react.suspense"),d=w("react.suspense_list"),h=w("react.memo"),m=w("react.lazy"),v=w("react.block"),g=w("react.server.block"),y=w("react.fundamental"),S=w("react.debug_trace_mode"),x=w("react.legacy_hidden")}function b(q){if(typeof q=="object"&&q!==null){var F=q.$$typeof;switch(F){case e:switch(q=q.type,q){case n:case i:case r:case f:case d:return q;default:switch(q=q&&q.$$typeof,q){case s:case c:case m:case h:case u:return q;default:return F}}case t:return F}}}var _=u,C=e,O=c,k=n,D=m,M=h,T=t,L=i,P=r,j=f;return Tt.ContextConsumer=s,Tt.ContextProvider=_,Tt.Element=C,Tt.ForwardRef=O,Tt.Fragment=k,Tt.Lazy=D,Tt.Memo=M,Tt.Portal=T,Tt.Profiler=L,Tt.StrictMode=P,Tt.Suspense=j,Tt.isAsyncMode=function(){return!1},Tt.isConcurrentMode=function(){return!1},Tt.isContextConsumer=function(q){return b(q)===s},Tt.isContextProvider=function(q){return b(q)===u},Tt.isElement=function(q){return typeof q=="object"&&q!==null&&q.$$typeof===e},Tt.isForwardRef=function(q){return b(q)===c},Tt.isFragment=function(q){return b(q)===n},Tt.isLazy=function(q){return b(q)===m},Tt.isMemo=function(q){return b(q)===h},Tt.isPortal=function(q){return b(q)===t},Tt.isProfiler=function(q){return b(q)===i},Tt.isStrictMode=function(q){return b(q)===r},Tt.isSuspense=function(q){return b(q)===f},Tt.isValidElementType=function(q){return typeof q=="string"||typeof q=="function"||q===n||q===i||q===S||q===r||q===f||q===d||q===x||typeof q=="object"&&q!==null&&(q.$$typeof===m||q.$$typeof===h||q.$$typeof===u||q.$$typeof===s||q.$$typeof===c||q.$$typeof===y||q.$$typeof===v||q[0]===g)},Tt.typeOf=b,Tt}var WT;function H9(){return WT||(WT=1,Wb.exports=I9()),Wb.exports}var Qb,QT;function V9(){if(QT)return Qb;QT=1;var e=gh(),t=gs(),n=VP(),r=e.boolean,i=e.number,u=e.spaceSeparated,s=e.commaSeparated,c=e.commaOrSpaceSeparated;return Qb=t({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:n,properties:{about:c,accentHeight:i,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:i,amplitude:i,arabicForm:null,ascent:i,attributeName:null,attributeType:null,azimuth:i,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:i,by:null,calcMode:null,capHeight:i,className:u,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:i,diffuseConstant:i,direction:null,display:null,dur:null,divisor:i,dominantBaseline:null,download:r,dx:null,dy:null,edgeMode:null,editable:null,elevation:i,enableBackground:null,end:null,event:null,exponent:i,externalResourcesRequired:null,fill:null,fillOpacity:i,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:s,g2:s,glyphName:s,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:i,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:i,horizOriginX:i,horizOriginY:i,id:null,ideographic:i,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:i,k:i,k1:i,k2:i,k3:i,k4:i,kernelMatrix:c,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:i,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:i,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:i,overlineThickness:i,paintOrder:null,panose1:null,path:null,pathLength:i,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:u,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:i,pointsAtY:i,pointsAtZ:i,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:c,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:c,rev:c,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:c,requiredFeatures:c,requiredFonts:c,requiredFormats:c,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:i,specularExponent:i,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:i,strikethroughThickness:i,string:null,stroke:null,strokeDashArray:c,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:i,strokeOpacity:i,strokeWidth:null,style:null,surfaceScale:i,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:c,tabIndex:i,tableValues:null,target:null,targetX:i,targetY:i,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:c,to:null,transform:null,u1:null,u2:null,underlinePosition:i,underlineThickness:i,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:i,values:null,vAlphabetic:i,vMathematical:i,vectorEffect:null,vHanging:i,vIdeographic:i,version:null,vertAdvY:i,vertOriginX:i,vertOriginY:i,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:i,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),Qb}var Gb,GT;function K9(){if(GT)return Gb;GT=1;var e=zP(),t=IP(),n=HP(),r=WP(),i=QP(),u=V9();return Gb=e([n,t,r,i,u]),Gb}var Yb,YT;function W9(){if(YT)return Yb;YT=1;var e=$P(),t=BP(),n=UP(),r="data";Yb=c;var i=/^data[-\w.:]+$/i,u=/-[a-z]/g,s=/[A-Z]/g;function c(v,g){var y=e(g),S=g,x=n;return y in v.normal?v.property[v.normal[y]]:(y.length>4&&y.slice(0,4)===r&&i.test(g)&&(g.charAt(4)==="-"?S=f(g):g=d(g),x=t),new x(S,g))}function f(v){var g=v.slice(5).replace(u,m);return r+g.charAt(0).toUpperCase()+g.slice(1)}function d(v){var g=v.slice(4);return u.test(g)?v:(g=g.replace(s,h),g.charAt(0)!=="-"&&(g="-"+g),r+g)}function h(v){return"-"+v.toLowerCase()}function m(v){return v.charAt(1).toUpperCase()}return Yb}const Q9="classID",G9="datatype",Y9="itemID",X9="strokeDasharray",Z9="strokeDashoffset",J9="strokeLinecap",e7="strokeLinejoin",t7="strokeMiterlimit",n7="typeof",r7="xlinkActuate",a7="xlinkArcrole",i7="xlinkHref",l7="xlinkRole",u7="xlinkShow",s7="xlinkTitle",o7="xlinkType",c7="xmlnsXlink",f7={classId:Q9,dataType:G9,itemId:Y9,strokeDashArray:X9,strokeDashOffset:Z9,strokeLineCap:J9,strokeLineJoin:e7,strokeMiterLimit:t7,typeOf:n7,xLinkActuate:r7,xLinkArcRole:a7,xLinkHref:i7,xLinkRole:l7,xLinkShow:u7,xLinkTitle:s7,xLinkType:o7,xmlnsXLink:c7};var Wf={},XT;function d7(){if(XT)return Wf;XT=1,Wf.parse=r,Wf.stringify=i;var e="",t=" ",n=/[ \t\n\r\f]+/g;function r(u){var s=String(u||e).trim();return s===e?[]:s.split(n)}function i(u){return u.join(t).trim()}return Wf}var Qf={},ZT;function h7(){if(ZT)return Qf;ZT=1,Qf.parse=r,Qf.stringify=i;var e=",",t=" ",n="";function r(u){for(var s=[],c=String(u||n),f=c.indexOf(e),d=0,h=!1,m;!h;)f===-1&&(f=c.length,h=!0),m=c.slice(d,f).trim(),(m||!h)&&s.push(m),d=f+1,f=c.indexOf(e,d);return s}function i(u,s){var c=s||{},f=c.padLeft===!1?n:t,d=c.padRight?t:n;return u[u.length-1]===n&&(u=u.concat(n)),u.join(d+e+f).trim()}return Qf}var Xb,JT;function p7(){if(JT)return Xb;JT=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,c=/^\s+|\s+$/g,f=` +`,d="/",h="*",m="",v="comment",g="declaration";Xb=function(S,x){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];x=x||{};var w=1,b=1;function _(q){var F=q.match(t);F&&(w+=F.length);var N=q.lastIndexOf(f);b=~N?q.length-N:b+q.length}function C(){var q={line:w,column:b};return function(F){return F.position=new O(q),M(),F}}function O(q){this.start=q,this.end={line:w,column:b},this.source=x.source}O.prototype.content=S;function k(q){var F=new Error(x.source+":"+w+":"+b+": "+q);if(F.reason=q,F.filename=x.source,F.line=w,F.column=b,F.source=S,!x.silent)throw F}function D(q){var F=q.exec(S);if(F){var N=F[0];return _(N),S=S.slice(N.length),F}}function M(){D(n)}function T(q){var F;for(q=q||[];F=L();)F!==!1&&q.push(F);return q}function L(){var q=C();if(!(d!=S.charAt(0)||h!=S.charAt(1))){for(var F=2;m!=S.charAt(F)&&(h!=S.charAt(F)||d!=S.charAt(F+1));)++F;if(F+=2,m===S.charAt(F-1))return k("End of comment missing");var N=S.slice(2,F-2);return b+=2,_(N),S=S.slice(F),b+=2,q({type:v,comment:N})}}function P(){var q=C(),F=D(r);if(F){if(L(),!D(i))return k("property missing ':'");var N=D(u),$=q({type:g,property:y(F[0].replace(e,m)),value:N?y(N[0].replace(e,m)):m});return D(s),$}}function j(){var q=[];T(q);for(var F;F=P();)F!==!1&&(q.push(F),T(q));return q}return M(),j()};function y(S){return S?S.replace(c,m):m}return Xb}var Zb,eM;function m7(){if(eM)return Zb;eM=1;var e=p7();function t(n,r){var i=null;if(!n||typeof n!="string")return i;for(var u,s=e(n),c=typeof r=="function",f,d,h=0,m=s.length;h0?e.createElement(F,T,j):e.createElement(F,T)}function v(b){let _=-1;for(;++_String(_)).join("")}return Kf}var Jb,nM;function y7(){if(nM)return Jb;nM=1;const e=Kt(),t=gP(),n=EV(),r=c9(),i=F9(),u=M2(),s=$9(),c=U9(),f=B9(),d=g7().hastChildrenToReact;Jb=g;const h={}.hasOwnProperty,m="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",v={renderers:{to:"components",id:"change-renderers-to-components"},astPlugins:{id:"remove-buggy-html-in-markdown-parser"},allowDangerousHtml:{id:"remove-buggy-html-in-markdown-parser"},escapeHtml:{id:"remove-buggy-html-in-markdown-parser"},source:{to:"children",id:"change-source-to-children"},allowNode:{to:"allowElement",id:"replace-allownode-allowedtypes-and-disallowedtypes"},allowedTypes:{to:"allowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},disallowedTypes:{to:"disallowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},includeNodeIndex:{to:"includeElementIndex",id:"change-includenodeindex-to-includeelementindex"}};function g(y){for(const _ in v)if(h.call(v,_)&&h.call(y,_)){const C=v[_];console.warn(`[react-markdown] Warning: please ${C.to?`use \`${C.to}\` instead of`:"remove"} \`${_}\` (see <${m}#${C.id}> for more info)`),delete v[_]}const S=n().use(r).use(y.remarkPlugins||y.plugins||[]).use(i,{allowDangerousHtml:!0}).use(y.rehypePlugins||[]).use(c,y);let x;typeof y.children=="string"?x=t(y.children):(y.children!==void 0&&y.children!==null&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${y.children}\`)`),x=t());const w=S.runSync(S.parse(x),x);if(w.type!=="root")throw new TypeError("Expected a `root` node");let b=e.createElement(e.Fragment,{},d({options:y,schema:s,listDepth:0},w));return y.className&&(b=e.createElement("div",{className:y.className},b)),b}return g.defaultProps={transformLinkUri:f},g.propTypes={children:u.string,className:u.string,allowElement:u.func,allowedElements:u.arrayOf(u.string),disallowedElements:u.arrayOf(u.string),unwrapDisallowed:u.bool,remarkPlugins:u.arrayOf(u.oneOfType([u.object,u.func,u.arrayOf(u.oneOfType([u.object,u.func]))])),rehypePlugins:u.arrayOf(u.oneOfType([u.object,u.func,u.arrayOf(u.oneOfType([u.object,u.func]))])),sourcePos:u.bool,rawSourcePos:u.bool,skipHtml:u.bool,includeElementIndex:u.bool,transformLinkUri:u.oneOfType([u.func,u.bool]),linkTarget:u.oneOfType([u.func,u.string]),transformImageUri:u.func,components:u.object},g.uriTransformer=f,Jb}y7();var e1={},rM;function v7(){if(rM)return e1;rM=1;var e=ph(),t=fc(),n=cS(),r=fn(),i=sS(),u=oS(),s={tokenize:_,partial:!0},c={tokenize:C,partial:!0},f={tokenize:O,partial:!0},d={tokenize:D,partial:!0},h={tokenize:k,partial:!0},m={tokenize:w,previous:P},v={tokenize:b,previous:j},g={tokenize:x,previous:q},y={};e1.text=y;for(var S=48;S<123;)y[S]=g,S++,S===58?S=65:S===91&&(S=97);y[43]=g,y[45]=g,y[46]=g,y[95]=g,y[72]=[g,v],y[104]=[g,v],y[87]=[g,m],y[119]=[g,m];function x(N,$,H){var K=this,ne;return W;function W(ie){return!L(ie)||!q(K.previous)||F(K.events)?H(ie):(N.enter("literalAutolink"),N.enter("literalAutolinkEmail"),Z(ie))}function Z(ie){return L(ie)?(N.consume(ie),Z):ie===64?(N.consume(ie),X):H(ie)}function X(ie){return ie===46?N.check(d,se,Y)(ie):ie===45||ie===95?N.check(d,H,I)(ie):t(ie)?(N.consume(ie),X):se(ie)}function Y(ie){return N.consume(ie),ne=!0,X}function I(ie){return N.consume(ie),ae}function ae(ie){return ie===46?N.check(d,H,Y)(ie):X(ie)}function se(ie){return ne?(N.exit("literalAutolinkEmail"),N.exit("literalAutolink"),$(ie)):H(ie)}}function w(N,$,H){var K=this;return ne;function ne(Z){return Z!==87&&Z-32!==87||!P(K.previous)||F(K.events)?H(Z):(N.enter("literalAutolink"),N.enter("literalAutolinkWww"),N.check(s,N.attempt(c,N.attempt(f,W),H),H)(Z))}function W(Z){return N.exit("literalAutolinkWww"),N.exit("literalAutolink"),$(Z)}}function b(N,$,H){var K=this;return ne;function ne(V){return V!==72&&V-32!==72||!j(K.previous)||F(K.events)?H(V):(N.enter("literalAutolink"),N.enter("literalAutolinkHttp"),N.consume(V),W)}function W(V){return V===84||V-32===84?(N.consume(V),Z):H(V)}function Z(V){return V===84||V-32===84?(N.consume(V),X):H(V)}function X(V){return V===80||V-32===80?(N.consume(V),Y):H(V)}function Y(V){return V===83||V-32===83?(N.consume(V),I):I(V)}function I(V){return V===58?(N.consume(V),ae):H(V)}function ae(V){return V===47?(N.consume(V),se):H(V)}function se(V){return V===47?(N.consume(V),ie):H(V)}function ie(V){return n(V)||u(V)||i(V)?H(V):N.attempt(c,N.attempt(f,oe),H)(V)}function oe(V){return N.exit("literalAutolinkHttp"),N.exit("literalAutolink"),$(V)}}function _(N,$,H){return K;function K(Y){return N.consume(Y),ne}function ne(Y){return Y===87||Y-32===87?(N.consume(Y),W):H(Y)}function W(Y){return Y===87||Y-32===87?(N.consume(Y),Z):H(Y)}function Z(Y){return Y===46?(N.consume(Y),X):H(Y)}function X(Y){return Y===null||r(Y)?H(Y):$(Y)}}function C(N,$,H){var K,ne;return W;function W(Y){return Y===38?N.check(h,X,Z)(Y):Y===46||Y===95?N.check(d,X,Z)(Y):n(Y)||u(Y)||Y!==45&&i(Y)?X(Y):(N.consume(Y),W)}function Z(Y){return Y===46?(ne=K,K=void 0,N.consume(Y),W):(Y===95&&(K=!0),N.consume(Y),W)}function X(Y){return!ne&&!K?$(Y):H(Y)}}function O(N,$){var H=0;return K;function K(Z){return Z===38?N.check(h,$,ne)(Z):(Z===40&&H++,Z===41?N.check(d,W,ne)(Z):T(Z)?$(Z):M(Z)?N.check(d,$,ne)(Z):(N.consume(Z),K))}function ne(Z){return N.consume(Z),K}function W(Z){return H--,H<0?$(Z):ne(Z)}}function k(N,$,H){return K;function K(Z){return N.consume(Z),ne}function ne(Z){return e(Z)?(N.consume(Z),ne):Z===59?(N.consume(Z),W):H(Z)}function W(Z){return T(Z)?$(Z):H(Z)}}function D(N,$,H){return K;function K(W){return N.consume(W),ne}function ne(W){return M(W)?(N.consume(W),ne):T(W)?$(W):H(W)}}function M(N){return N===33||N===34||N===39||N===41||N===42||N===44||N===46||N===58||N===59||N===60||N===63||N===95||N===126}function T(N){return N===null||N<0||N===32||N===60}function L(N){return N===43||N===45||N===46||N===95||t(N)}function P(N){return N===null||N<0||N===32||N===40||N===42||N===95||N===126}function j(N){return N===null||!e(N)}function q(N){return N!==47&&j(N)}function F(N){for(var $=N.length;$--;)if((N[$][1].type==="labelLink"||N[$][1].type==="labelImage")&&!N[$][1]._balanced)return!0}return e1}var t1,aM;function b7(){return aM||(aM=1,t1=v7()),t1}var n1,iM;function x7(){if(iM)return n1;iM=1,n1=i;var e=EP(),t=fi(),n=hh(),r=au();function i(u){var s=u||{},c=s.singleTilde,f={tokenize:m,resolveAll:d};return c==null&&(c=!0),{text:{126:f},insideSpan:{null:f}};function d(v,g){for(var y=-1,S,x,w,b;++y1?y(C):(v.consume(C),w++,_):w<2&&!c?y(C):(k=v.exit("strikethroughSequenceTemporary"),D=e(C),k._open=!D||D===2&&O,k._close=!O||O===2&&D,g(C))}}}return n1}var r1={},lM;function S7(){if(lM)return r1;lM=1,r1.flow={null:{tokenize:i,resolve:r,interruptible:!0}};var e=bn(),t={tokenize:u,partial:!0},n={tokenize:s,partial:!0};function r(c,f){for(var d=c.length,h=-1,m,v,g,y,S,x,w,b,_,C;++h{if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}),c1}var f1,pM;function k7(){if(pM)return f1;pM=1,f1=i;var e=MP(),t=TP(),n=R7(),r=[].splice;function i(d,h,m,v){var g,y;return typeof h=="string"||h&&typeof h.exec=="function"?y=[[h,m]]:(y=h,v=m),g=v||{},u(d,g,S(s(y))),d;function S(x){var w=x[0];return b;function b(_,C){var O=w[0],k=w[1],D=[],M=0,T=C.children.indexOf(_),L,P,j,q;for(O.lastIndex=0,P=O.exec(_.value);P&&(L=P.index,q=k.apply(null,[].concat(P,{index:P.index,input:P.input})),q!==!1&&(M!==L&&D.push({type:"text",value:_.value.slice(M,L)}),typeof q=="string"&&q.length>0&&(q={type:"text",value:q}),q&&(D=[].concat(D,q)),M=L+P[0].length),!!O.global);)P=O.exec(_.value);if(L===void 0?(D=[_],T--):(M<_.value.length&&D.push({type:"text",value:_.value.slice(M)}),D.unshift(T,1),r.apply(C.children,D)),x.length>1)for(j=S(x.slice(1)),L=-1;++L?\]}]+$/.exec(x),b,_,C;if(w)for(x=x.slice(0,w.index),w=w[0],b=w.indexOf(")"),_=e(x,"("),C=e(x,")");b!==-1&&_>C;)x+=w.slice(0,b+1),w=w.slice(b+1),b=w.indexOf(")"),C++;return[x,w]}function S(x,w){var b=x.input.charCodeAt(x.index-1);return(b!==b||r(b)||n(b))&&(!w||b!==47)}return ko}var To={},gM;function M7(){if(gM)return To;gM=1,To.canContainEols=["delete"],To.enter={strikethrough:e},To.exit={strikethrough:t};function e(n){this.enter({type:"delete",children:[]},n)}function t(n){this.exit(n)}return To}var Gf={},yM;function D7(){if(yM)return Gf;yM=1,Gf.enter={table:e,tableData:i,tableHeader:i,tableRow:n},Gf.exit={codeText:u,table:t,tableData:r,tableHeader:r,tableRow:r};function e(c){this.enter({type:"table",align:c._align,children:[]},c),this.setData("inTable",!0)}function t(c){this.exit(c),this.setData("inTable")}function n(c){this.enter({type:"tableRow",children:[]},c)}function r(c){this.exit(c)}function i(c){this.enter({type:"tableCell",children:[]},c)}function u(c){var f=this.resume();this.getData("inTable")&&(f=f.replace(/\\([\\|])/g,s)),this.stack[this.stack.length-1].value=f,this.exit(c)}function s(c,f){return f==="|"?f:c}return Gf}var d1={},vM;function L7(){if(vM)return d1;vM=1,d1.exit={taskListCheckValueChecked:e,taskListCheckValueUnchecked:e,paragraph:t};function e(n){this.stack[this.stack.length-2].checked=n.type==="taskListCheckValueChecked"}function t(n){var r=this.stack[this.stack.length-2],i=this.stack[this.stack.length-1],u=r.children,s=i.children[0],c=-1,f;if(r&&r.type==="listItem"&&typeof r.checked=="boolean"&&s&&s.type==="text"){for(;++c0&&(c==="\r"||c===` +`)&&h.type==="html"&&(u[u.length-1]=u[u.length-1].replace(/(\r?\n|\r)$/," "),c=" "),u.push(n.handle(h,t,n,{before:c,after:f})),c=u[u.length-1].slice(-1);return u.join("")}return m1}var EM;function j7(){if(EM)return Yf;EM=1;var e=GP();Yf.unsafe=[{character:"~",inConstruct:"phrasing"}],Yf.handlers={delete:t},t.peek=n;function t(r,i,u){var s=u.enter("emphasis"),c=e(r,u,{before:"~",after:"~"});return s(),"~~"+c+"~~"}function n(){return"~"}return Yf}var g1,wM;function F7(){if(wM)return g1;wM=1,g1=e;function e(t){var n,r;return t._compiled||(n=t.before?"(?:"+t.before+")":"",r=t.after?"(?:"+t.after+")":"",t.atBreak&&(n="[\\r\\n][\\t ]*"+n),t._compiled=new RegExp((n?"("+n+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(t.character)?"\\":"")+t.character+(r||""),"g")),t._compiled}return g1}var y1,CM;function N7(){if(CM)return y1;CM=1,y1=t,t.peek=n;var e=F7();function t(r,i,u){for(var s=r.value||"",c="`",f=-1,d,h,m,v;new RegExp("(^|[^`])"+c+"([^`]|$)").test(s);)c+="`";for(/[^ \r\n]/.test(s)&&(/[ \r\n`]/.test(s.charAt(0))||/[ \r\n`]/.test(s.charAt(s.length-1)))&&(s=" "+s+" ");++f + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */var v1,_M;function hS(){if(_M)return v1;_M=1;var e="",t;v1=n;function n(r,i){if(typeof r!="string")throw new TypeError("expected a string");if(i===1)return r;if(i===2)return r+r;var u=r.length*i;if(t!==r||typeof t>"u")t=r,e="";else if(e.length>=u)return e.substr(0,u);for(;u>e.length&&i>1;)i&1&&(e+=r),i>>=1,r+=r;return e+=r,e=e.substr(0,u),e}return v1}var b1,OM;function z7(){if(OM)return b1;OM=1;var e=hS();b1=y;var t=/ +$/,n=" ",r=` +`,i="-",u=":",s="|",c=0,f=67,d=76,h=82,m=99,v=108,g=114;function y(b,_){for(var C=_||{},O=C.padding!==!1,k=C.delimiterStart!==!1,D=C.delimiterEnd!==!1,M=(C.align||[]).concat(),T=C.alignDelimiters!==!1,L=[],P=C.stringLength||x,j=-1,q=b.length,F=[],N=[],$=[],H=[],K=[],ne=0,W,Z,X,Y,I,ae,se,ie,oe,V,ue;++jne&&(ne=X);++ZY)&&(K[Z]=I)),$.push(ae);F[j]=$,N[j]=H}if(Z=-1,X=ne,typeof M=="object"&&"length"in M)for(;++ZK[Z]&&(K[Z]=I),H[Z]=I),$[Z]=ae;for(F.splice(1,0,$),N.splice(1,0,H),j=-1,q=F.length,se=[];++j + +`}return` + +`}}return w1}var C1,MM;function H7(){if(MM)return C1;MM=1,C1=t;var e=/\r?\n|\r/g;function t(n,r){for(var i=[],u=0,s=0,c;c=e.exec(n);)f(n.slice(u,c.index)),i.push(c[0]),u=c.index+c[0].length,s++;return f(n.slice(u)),i.join("");function f(d){i.push(r(d,s,!d))}}return C1}var _1,DM;function V7(){if(DM)return _1;DM=1,_1=u;var e=hS(),t=U7(),n=B7(),r=I7(),i=H7();function u(s,c,f){var d=t(f),h=n(f),m,v,g;return c&&c.ordered&&(d=(c.start>-1?c.start:1)+(f.options.incrementListMarker===!1?0:c.children.indexOf(s))+"."),m=d.length+1,(h==="tab"||h==="mixed"&&(c&&c.spread||s.spread))&&(m=Math.ceil(m/4)*4),g=f.enter("listItem"),v=i(r(s,f),y),g(),v;function y(S,x,w){return x?(w?"":e(" ",m))+S:(w?d:d+e(" ",m-d.length))+S}}return _1}var LM;function K7(){if(LM)return Xf;LM=1;var e=V7();Xf.unsafe=[{atBreak:!0,character:"-",after:"[:|-]"}],Xf.handlers={listItem:t};function t(n,r,i){var u=e(n,r,i),s=n.children[0];return typeof n.checked=="boolean"&&s&&s.type==="paragraph"&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),u;function c(f){return f+"["+(n.checked?"x":" ")+"] "}}return Xf}var O1,qM;function W7(){if(qM)return O1;qM=1,O1=e;function e(t,n){var r=-1,i;if(n.extensions)for(;++rY7(e,"name",{value:t,configurable:!0}),YP=R.createContext({siderCollapsed:!1,mobileSiderOpen:!1,setSiderCollapsed:()=>{},setMobileSiderOpen:()=>{}}),X7=He(({children:e,initialSiderCollapsed:t,onSiderCollapsed:n})=>{const[r,i]=Q.useState(t??!1),[u,s]=Q.useState(!1),c=He(f=>{i(f),n&&n(f)},"setSiderCollapsed");return R.createElement(YP.Provider,{value:{siderCollapsed:r,mobileSiderOpen:u,setSiderCollapsed:c,setMobileSiderOpen:s,onSiderCollapsed:n}},e)},"ThemedLayoutContextProvider"),jn=He(e=>{var t,n,r,i;const{query:u,defaultValueQuery:s,onSearch:c,overtime:f}=I5(e);return{autocompleteProps:{options:e.selectedOptionsOrder==="selected-first"?Cd(((t=s.data)==null?void 0:t.data)||[],((n=u.data)==null?void 0:n.data)||[],hr):Cd(((r=u.data)==null?void 0:r.data)||[],((i=s.data)==null?void 0:i.data)||[],hr),loading:u.isFetching||s.isFetching,onInputChange:(d,h)=>{(d==null?void 0:d.type)==="change"?c(h):(d==null?void 0:d.type)==="click"&&c("")},filterOptions:d=>d},onSearch:c,query:u,defaultValueQuery:s,queryResult:u,defaultValueQueryResult:s,overtime:f}},"useAutocomplete"),Z7=He(e=>e.map(({field:n,sort:r})=>({field:n,order:r||"asc"})),"transformSortModelToCrudSorting"),J7=He(e=>e.map(({field:n,order:r})=>({field:n,sort:r})),"transformCrudSortingToSortModel"),eK=He(e=>{if(!e)return"eq";switch(e){case"equals":case"is":case"=":return"eq";case"!=":case"not":return"ne";case"contains":return"contains";case"isAnyOf":return"in";case">":case"after":return"gt";case">=":case"onOrAfter":return"gte";case"<":case"before":return"lt";case"<=":case"onOrBefore":return"lte";case"startsWith":return"startswith";case"endsWith":return"endswith";case"isEmpty":return"null";case"isNotEmpty":return"nnull";default:return e}},"transformMuiOperatorToCrudOperator"),tK=He(({items:e,logicOperator:t})=>{const n=e.map(({field:r,value:i,operator:u})=>({field:r,value:["isEmpty","isNotEmpty"].includes(u)?!0:i??"",operator:eK(u)}));return t===W0.Or?[{operator:"or",value:n}]:n},"transformFilterModelToCrudFilters"),FM=He((e,t)=>{switch(t){case"number":switch(e){case"eq":return"=";case"ne":return"!=";case"gt":return">";case"gte":return">=";case"lt":return"<";case"lte":return"<=";case"null":return"isEmpty";case"nnull":return"isNotEmpty";case"in":return"isAnyOf";default:return e}case"singleSelect":case"boolean":switch(e){case"eq":return"is";default:return e}case void 0:case"string":switch(e){case"eq":return"equals";case"contains":return"contains";case"null":return"isEmpty";case"nnull":return"isNotEmpty";case"startswith":return"startsWith";case"endswith":return"endsWith";case"in":return"isAnyOf";default:return e}case"date":case"dateTime":switch(e){case"eq":return"is";case"ne":return"not";case"gt":return"after";case"gte":return"onOrAfter";case"lt":return"before";case"lte":return"onOrBefore";case"null":return"isEmpty";case"nnull":return"isNotEmpty";default:return e}default:return e}},"transformCrudOperatorToMuiOperator"),nK=He((e,t)=>{var n;const r=[],i=e.some(u=>u.operator==="or");return t&&(i?((n=e.find(s=>s.operator==="or"))==null?void 0:n.value).map(({field:s,value:c,operator:f})=>{const d=t[s];r.push({field:s,operator:FM(f,d),value:c===""?void 0:c,id:s+f})}):e.map(({field:u,value:s,operator:c})=>{const f=t[u];r.push({field:u,operator:FM(c,f),value:s===""?void 0:s,id:u+c})})),{items:r,logicOperator:i?W0.Or:W0.And}},"transformCrudFiltersToFilterModel");function hi({onSearch:e,initialCurrent:t,initialPageSize:n=25,pagination:r,hasPagination:i=!0,initialSorter:u,permanentSorter:s,defaultSetFilterBehavior:c="replace",initialFilter:f,permanentFilter:d,filters:h,sorters:m,syncWithLocation:v,resource:g,successNotification:y,errorNotification:S,queryOptions:x,liveMode:w,onLiveEvent:b,liveParams:_,meta:C,metaData:O,dataProviderName:k,overtimeOptions:D,editable:M=!1,updateMutationOptions:T}={}){const L=Sq(w),P=Q.useRef(),{identifier:j}=rl({resource:g}),{tableQueryResult:q,tableQuery:F,current:N,setCurrent:$,pageSize:H,setPageSize:K,filters:ne,setFilters:W,sorters:Z,setSorters:X,sorter:Y,setSorter:I,pageCount:ae,createLinkForSyncWithLocation:se,overtime:ie}=_q({permanentSorter:s,permanentFilter:d,initialCurrent:t,initialPageSize:n,pagination:r,hasPagination:i,initialSorter:u,initialFilter:f,filters:h,sorters:m,syncWithLocation:v,defaultSetFilterBehavior:c,resource:g,successNotification:y,errorNotification:S,queryOptions:x,liveMode:w,onLiveEvent:b,liveParams:_,meta:Pe(C,O),metaData:Pe(C,O),dataProviderName:k,overtimeOptions:D}),[oe,V]=Q.useState(ne),{data:ue,isFetched:me,isLoading:Ee}=q,Ce=((h==null?void 0:h.mode)||"server")==="server",Te=((m==null?void 0:m.mode)||"server")==="server",U=i===!1?"off":"server",ce=((r==null?void 0:r.mode)??U)!=="off",fe=Pe(m==null?void 0:m.permanent,s)??[],G=Pe(h==null?void 0:h.permanent,d)??[],te=He(je=>{ce&&$(je+1)},"handlePageChange"),re=He(je=>{ce&&K(je)},"handlePageSizeChange"),de=He(je=>{const Ne=Z7(je);X(Ne)},"handleSortModelChange"),_e=He(je=>{const Ne=tK(je);V(Ne),W(Ne.filter(ot=>ot.value!=="")),ce&&$(1)},"handleFilterModelChange"),be=He(async je=>{if(e){const Ne=await e(je);V(Ne),W(Ne.filter(ot=>ot.value!=="")),ce&&$(1)}},"search"),De=He(()=>ce?{paginationMode:"server",paginationModel:{page:N-1,pageSize:H},onPaginationModelChange:je=>{te(je.page),re(je.pageSize)}}:{paginationMode:"client"},"dataGridPaginationValues"),{mutate:Le}=pq({mutationOptions:T}),Fe=He(async(je,Ne)=>M?j?new Promise((ot,ut)=>{Le({resource:j,id:je.id,values:je},{onError:yt=>{ut(yt)},onSuccess:yt=>{ot(je)}})}):Promise.reject(new Error("Resource is not defined")):Promise.resolve(Ne),"processRowUpdate");return{tableQueryResult:q,tableQuery:F,dataGridProps:{disableRowSelectionOnClick:!0,rows:(ue==null?void 0:ue.data)||[],loading:L==="auto"?Ee:!me,rowCount:(ue==null?void 0:ue.total)||0,...De(),sortingMode:Te?"server":"client",sortModel:J7(Wi(Z,fe,hr)),onSortModelChange:de,filterMode:Ce?"server":"client",filterModel:nK(Wi(oe,G,hr),P.current),onFilterModelChange:_e,onStateChange:je=>{const Ne=Object.fromEntries(Object.entries(je.columns.lookup).map(([ut,yt])=>[ut,yt.type]));!hr(Ne,P)&&(P.current=Ne)},processRowUpdate:M?Fe:void 0},current:N,setCurrent:$,pageSize:H,setPageSize:K,pageCount:ae,sorters:Z,setSorters:X,sorter:Y,setSorter:I,filters:ne,setFilters:W,search:be,createLinkForSyncWithLocation:se,overtime:ie}}He(hi,"useDataGrid");var XP=He(()=>{const{mobileSiderOpen:e,siderCollapsed:t,setMobileSiderOpen:n,setSiderCollapsed:r}=Q.useContext(YP);return{mobileSiderOpen:e,siderCollapsed:t,setMobileSiderOpen:n,setSiderCollapsed:r}},"useThemedLayoutContext"),rK=He(({Title:e,render:t,meta:n,activeItemDisabled:r=!1})=>{const{siderCollapsed:i,setSiderCollapsed:u,mobileSiderOpen:s,setMobileSiderOpen:c}=XP(),f=He(()=>i?56:240,"drawerWidth"),d=Je(),h=Ot(),m=tu(),{Link:v}=_n(),g=h==="legacy"?v:m,{hasDashboard:y}=cn(),S=Je(),{menuItems:x,selectedKey:w,defaultOpenKeys:b}=W5({meta:n}),_=dq(),C=JI(),O=vn(),{warnWhen:k,setWarnWhen:D}=Zl(),{mutate:M}=Rd({v3LegacyAuthProviderCompatible:!!(O!=null&&O.isLegacy)}),[T,L]=Q.useState({});R.useEffect(()=>{L(W=>{const X=Object.keys(W).filter(ae=>W[ae]),Y=new Set([...X,...b]);return Object.fromEntries(Array.from(Y.values()).map(ae=>[ae,!0]))})},[b]);const P=e??C??lK,j=He(W=>{L({...T,[W]:!T[W]})},"handleClick"),q=He((W,Z)=>W.map(X=>{const{icon:Y,label:I,route:ae,name:se,children:ie,parentName:oe,meta:V,options:ue}=X,me=T[X.key||""]||!1,Ee=X.key===Z,Ce=Pe(V==null?void 0:V.parent,ue==null?void 0:ue.parent,oe)!==void 0;if(ie.length>0)return R.createElement(Vg,{key:X.key,resource:se,action:"list",params:{resource:X}},R.createElement("div",{key:X.key},R.createElement(Fl,{title:I??se,placement:"right",disableHoverListener:!i,arrow:!0},R.createElement(kf,{onClick:()=>{i?(u(!1),me||j(X.key||"")):j(X.key||"")},sx:{pl:Ce?4:2,justifyContent:"center"}},R.createElement(Tf,{sx:{justifyContent:"center",minWidth:"24px",transition:"margin-right 0.3s",marginRight:i?"0px":"12px",color:"currentColor"}},Y??R.createElement(bd,null)),R.createElement(Mf,{primary:I,primaryTypographyProps:{noWrap:!0,fontSize:"14px"}}),me?R.createElement($4,{sx:{color:"text.icon"}}):R.createElement(U4,{sx:{color:"text.icon"}}))),!i&&R.createElement(T2,{in:T[X.key||""],timeout:"auto",unmountOnExit:!0},R.createElement(g_,{component:"div",disablePadding:!0},q(ie,Z)))));const Te=r&&Ee?{pointerEvents:"none"}:{};return R.createElement(Vg,{key:X.key,resource:se,action:"list",params:{resource:X}},R.createElement(Fl,{title:I??se,placement:"right",disableHoverListener:!i,arrow:!0},R.createElement(kf,{component:g,to:ae,selected:Ee,style:Te,onClick:()=>{c(!1)},sx:{pl:Ce?4:2,py:Ce?1.25:1,justifyContent:"center",color:Ee?"primary.main":"text.primary"}},R.createElement(Tf,{sx:{justifyContent:"center",transition:"margin-right 0.3s",marginRight:i?"0px":"12px",minWidth:"24px",color:"currentColor"}},Y??R.createElement(bd,null)),R.createElement(Mf,{primary:I,primaryTypographyProps:{noWrap:!0,fontSize:"14px"}}))))}),"renderTreeView"),F=y?R.createElement(Vg,{resource:"dashboard",action:"list"},R.createElement(Fl,{title:S("dashboard.title","Dashboard"),placement:"right",disableHoverListener:!i,arrow:!0},R.createElement(kf,{component:g,to:"/",selected:w==="/",onClick:()=>{c(!1)},sx:{pl:2,py:1,justifyContent:"center",color:w==="/"?"primary.main":"text.primary"}},R.createElement(Tf,{sx:{justifyContent:"center",minWidth:"24px",transition:"margin-right 0.3s",marginRight:i?"0px":"12px",color:"currentColor",fontSize:"14px"}},R.createElement(j4,null)),R.createElement(Mf,{primary:S("dashboard.title","Dashboard"),primaryTypographyProps:{noWrap:!0,fontSize:"14px"}})))):null,N=He(()=>{k?window.confirm(d("warnWhenUnsavedChanges","Are you sure you want to leave? You have unsaved changes."))&&(D(!1),M()):M()},"handleLogout"),$=_&&R.createElement(Fl,{title:d("buttons.logout","Logout"),placement:"right",disableHoverListener:!i,arrow:!0},R.createElement(kf,{key:"logout",onClick:()=>N(),sx:{justifyContent:"center"}},R.createElement(Tf,{sx:{justifyContent:"center",minWidth:"24px",transition:"margin-right 0.3s",marginRight:i?"0px":"12px",color:"currentColor"}},R.createElement(F4,null)),R.createElement(Mf,{primary:d("buttons.logout","Logout"),primaryTypographyProps:{noWrap:!0,fontSize:"14px"}}))),H=q(x,w),K=He(()=>t?t({dashboard:F,logout:$,items:H,collapsed:i}):R.createElement(R.Fragment,null,F,H,$),"renderSider"),ne=R.createElement(g_,{disablePadding:!0,sx:{flexGrow:1,paddingTop:"16px"}},K());return R.createElement(R.Fragment,null,R.createElement(rt,{sx:{width:{xs:f()},display:{xs:"none",md:"block"},transition:"width 0.3s ease"}}),R.createElement(rt,{component:"nav",sx:{position:"fixed",zIndex:1101,width:{sm:f()},display:"flex"}},R.createElement(y_,{variant:"temporary",elevation:2,open:s,onClose:()=>c(!1),ModalProps:{keepMounted:!0},sx:{display:{sm:"block",md:"none"}}},R.createElement(rt,{sx:{width:f()}},R.createElement(rt,{sx:{height:64,display:"flex",alignItems:"center",paddingLeft:"16px",fontSize:"14px"}},R.createElement(P,{collapsed:!1})),ne)),R.createElement(y_,{variant:"permanent",sx:{display:{xs:"none",md:"block"},"& .MuiDrawer-paper":{width:f(),overflow:"hidden",transition:"width 200ms cubic-bezier(0.4, 0, 0.6, 1) 0ms"}},open:!0},R.createElement(L2,{elevation:0,sx:{fontSize:"14px",width:"100%",height:64,display:"flex",flexShrink:0,alignItems:"center",justifyContent:i?"center":"space-between",paddingLeft:i?0:"16px",paddingRight:i?0:"8px",variant:"outlined",borderRadius:0,borderBottom:W=>`1px solid ${W.palette.action.focus}`}},R.createElement(P,{collapsed:i}),!i&&R.createElement(ii,{size:"small",onClick:()=>u(!0)},R.createElement(N4,null))),R.createElement(rt,{sx:{flexGrow:1,overflowX:"hidden",overflowY:"auto"}},ne))))},"ThemedSiderV2"),NM=He(e=>R.createElement(ii,{color:"inherit","aria-label":"open drawer",edge:"start",...e},R.createElement(P4,null)),"HamburgerIcon"),ZP=He(()=>{const{siderCollapsed:e,setSiderCollapsed:t,mobileSiderOpen:n,setMobileSiderOpen:r}=XP();return R.createElement(R.Fragment,null,R.createElement(NM,{onClick:()=>t(!e),sx:{mr:2,display:{xs:"none",md:"flex"},...!e&&{display:"none"}}}),R.createElement(NM,{onClick:()=>r(!n),sx:{mr:2,display:{xs:"flex",md:"none"},...n&&{display:"none"}}}))},"HamburgerMenu"),aK=He(({isSticky:e,sticky:t})=>{const n=vn(),{data:r}=rh({v3LegacyAuthProviderCompatible:!!(n!=null&&n.isLegacy)}),i=Pe(t,e)??!0;return R.createElement(q2,{position:i?"sticky":"relative"},R.createElement(P2,null,R.createElement(ZP,null),R.createElement(Jt,{direction:"row",width:"100%",justifyContent:"flex-end",alignItems:"center"},R.createElement(Jt,{direction:"row",gap:"16px",alignItems:"center",justifyContent:"center"},(r==null?void 0:r.name)&&R.createElement(Ve,{variant:"subtitle2"},r==null?void 0:r.name),(r==null?void 0:r.avatar)&&R.createElement(j2,{src:r==null?void 0:r.avatar,alt:r==null?void 0:r.name})))))},"ThemedHeaderV2"),iK=He(({Sider:e,Header:t,Title:n,Footer:r,OffLayoutArea:i,children:u,initialSiderCollapsed:s,onSiderCollapsed:c,childrenBoxProps:f={},containerBoxProps:d={}})=>{const h=e??rK,m=t??aK,{sx:v,...g}=f,{sx:y,...S}=d;return R.createElement(X7,{initialSiderCollapsed:s,onSiderCollapsed:c},R.createElement(rt,{sx:{display:"flex",flexDirection:"row",...y},...S},R.createElement(h,{Title:n}),R.createElement(rt,{sx:[{display:"flex",flexDirection:"column",flex:1,minWidth:"1px",minHeight:"1px"}]},R.createElement(m,null),R.createElement(rt,{component:"main",sx:{p:{xs:1,md:2,lg:3},flexGrow:1,bgcolor:x=>x.palette.background.default,...v},...g},u),r&&R.createElement(r,null)),i&&R.createElement(i,null)))},"ThemedLayoutV2"),lK=He(({collapsed:e,wrapperStyles:t,icon:n,text:r})=>{const{title:{icon:i,text:u}={}}=uh(),s=typeof n>"u"?i:n,c=typeof r>"u"?u:r,f=Ot(),d=tu(),{Link:h}=_n(),m=f==="legacy"?h:d;return R.createElement(D2,{to:"/",component:m,underline:"none",sx:{display:"flex",alignItems:"center",gap:"12px",...t}},R.createElement(Zo,{height:"24px",width:"24px",color:"primary"},s),!e&&R.createElement(Ve,{variant:"h6",fontWeight:700,color:"text.primary",fontSize:"inherit",textOverflow:"ellipsis",overflow:"hidden"},c))},"ThemedTitleV2"),uK=He(()=>{const[e,t]=Q.useState(),{push:n}=Nn(),r=Fn(),i=Ot(),{resource:u,action:s}=st(),c=Je();return Q.useEffect(()=>{u&&s&&t(c("pages.error.info",{action:s,resource:u==null?void 0:u.name},`You may have forgotten to add the "${s}" component to "${u==null?void 0:u.name}" resource.`))},[s,u]),R.createElement(K0,{display:"flex",justifyContent:"center",alignItems:"center",mt:20},R.createElement(K0,{container:!0,direction:"column",display:"flex",alignItems:"center"},R.createElement(Ve,{variant:"h1"},"404"),R.createElement(Jt,{direction:"row",spacing:"2"},R.createElement(Ve,null,c("pages.error.404","Sorry, the page you visited does not exist.")),e&&R.createElement(Fl,{title:e},R.createElement(E4,{}))),R.createElement(ni,{onClick:()=>{i==="legacy"?n("/"):r({to:"/"})}},c("pages.error.backHome","Back Home"))))},"ErrorComponent"),iu=He(({title:e,children:t,saveButtonProps:n,resource:r,isLoading:i=!1,breadcrumb:u,wrapperProps:s,headerProps:c,contentProps:f,headerButtonProps:d,headerButtons:h,footerButtonProps:m,footerButtons:v,goBack:g})=>{var y,S;const x=Je(),{options:{breadcrumb:w}={}}=cn(),b=Ot(),_=ih(),{goBack:C}=Nn(),O=Ea(),{resource:k,action:D,identifier:M}=st(r),T=typeof u>"u"?w:u,L=typeof T<"u"?R.createElement(R.Fragment,null,T)??void 0:R.createElement(yh,null),P={...i?{disabled:!0}:{},...n},j=R.createElement(tj,{...P});return R.createElement(Id,{...s??{},sx:{position:"relative",...s==null?void 0:s.sx}},i&&R.createElement(rt,{sx:{position:"absolute",inset:0,display:"flex",justifyContent:"center",alignItems:"center",zIndex:q=>q.zIndex.drawer+1,bgcolor:q=>Rx(q.palette.background.paper,.4)}},R.createElement(Hd,null)),L,R.createElement(Vd,{sx:{display:"flex",flexWrap:"wrap",".MuiCardHeader-action":{margin:0,alignSelf:"center"}},title:e??R.createElement(Ve,{variant:"h5",className:ch.Title},x(`${M}.titles.create`,`Create ${O(((y=k==null?void 0:k.meta)==null?void 0:y.label)??((S=k==null?void 0:k.options)==null?void 0:S.label)??(k==null?void 0:k.label)??M,"singular")}`)),avatar:typeof g<"u"?g:R.createElement(ii,{onClick:D!=="list"||typeof D<"u"?b==="legacy"?C:_:void 0},R.createElement(kx,null)),action:h?R.createElement(rt,{display:"flex",gap:"16px",...d??{}},h?typeof h=="function"?h({defaultButtons:null}):h:null):void 0,...c??{}}),R.createElement(Kd,{...f??{}},t),R.createElement(Tx,{sx:{display:"flex",justifyContent:"flex-end",gap:"16px",padding:"16px"},...m??{}},v?typeof v=="function"?v({defaultButtons:j,saveButtonProps:P}):v:j))},"Create"),lu=He(({title:e,saveButtonProps:t,mutationMode:n,recordItemId:r,children:i,deleteButtonProps:u,canDelete:s,resource:c,isLoading:f=!1,breadcrumb:d,dataProviderName:h,wrapperProps:m,headerProps:v,contentProps:g,headerButtonProps:y,headerButtons:S,footerButtonProps:x,footerButtons:w,goBack:b,autoSaveProps:_})=>{var C,O,k;const D=Je(),{options:{breadcrumb:M}={}}=cn(),{mutationMode:T}=Xl(),L=n??T,P=Ot(),j=ih(),q=Fn(),{goBack:F,list:N}=Nn(),$=Ea(),{resource:H,action:K,id:ne,identifier:W}=st(c),Z=wq({resource:H,action:"list"}),X=r??ne,Y=typeof d>"u"?M:d,I=(H==null?void 0:H.list)&&!r,ae=s??((((C=H==null?void 0:H.meta)==null?void 0:C.canDelete)??(H==null?void 0:H.canDelete))||u),se=typeof Y<"u"?R.createElement(R.Fragment,null,Y)??void 0:R.createElement(yh,null),ie=I?{...f?{disabled:!0}:{},resource:P==="legacy"?H==null?void 0:H.route:W}:void 0,oe={...f?{disabled:!0}:{},resource:P==="legacy"?H==null?void 0:H.route:W,recordItemId:X,dataProviderName:h},V=R.createElement(rt,{display:"flex",flexDirection:"row",alignItems:"center"},_&&R.createElement(dK,{..._}),I&&R.createElement(ej,{...ie}),R.createElement(JP,{...oe})),ue=ae?{...f?{disabled:!0}:{},resource:P==="legacy"?H==null?void 0:H.route:W,mutationMode:L,variant:"outlined",onSuccess:()=>{P==="legacy"?N((H==null?void 0:H.route)??(H==null?void 0:H.name)??""):q({to:Z})},recordItemId:X,dataProviderName:h,...u}:void 0,me={...f?{disabled:!0}:{},...t},Ee=R.createElement(R.Fragment,null,ae&&R.createElement(pi,{...ue}),R.createElement(tj,{...me}));return R.createElement(Id,{...m??{},sx:{position:"relative",...m==null?void 0:m.sx}},f&&R.createElement(rt,{sx:{position:"absolute",inset:0,display:"flex",justifyContent:"center",alignItems:"center",zIndex:Ce=>Ce.zIndex.drawer+1,bgcolor:Ce=>Rx(Ce.palette.background.paper,.4)}},R.createElement(Hd,null)),se,R.createElement(Vd,{sx:{display:"flex",flexWrap:"wrap",".MuiCardHeader-action":{margin:0,alignSelf:"center"}},title:e??R.createElement(Ve,{variant:"h5",className:ch.Title},D(`${W}.titles.edit`,`Edit ${$(((O=H==null?void 0:H.meta)==null?void 0:O.label)??((k=H==null?void 0:H.options)==null?void 0:k.label)??(H==null?void 0:H.label)??W,"singular")}`)),avatar:typeof b<"u"?b:R.createElement(ii,{onClick:K!=="list"&&typeof K<"u"?P==="legacy"?F:j:void 0},R.createElement(kx,null)),action:R.createElement(rt,{display:"flex",gap:"16px",...y??{}},S?typeof S=="function"?S({defaultButtons:V,listButtonProps:ie,refreshButtonProps:oe}):S:V),...v??{}}),R.createElement(Kd,{...g??{}},i),R.createElement(Tx,{sx:{display:"flex",justifyContent:"flex-end",gap:"16px",padding:"16px"},...x??{}},w?typeof w=="function"?w({defaultButtons:Ee,deleteButtonProps:ue,saveButtonProps:me}):w:Ee))},"Edit"),ul=He(({title:e,canCreate:t,children:n,createButtonProps:r,resource:i,breadcrumb:u,wrapperProps:s,headerProps:c,contentProps:f,headerButtonProps:d,headerButtons:h})=>{var m,v;const g=Je(),{options:{breadcrumb:y}={}}=cn(),S=Ea(),x=Ot(),{resource:w,identifier:b}=st(i),_=t??(((w==null?void 0:w.canCreate)??!!(w!=null&&w.create))||r),C=typeof u>"u"?y:u,O=typeof C<"u"?R.createElement(R.Fragment,null,C)??void 0:R.createElement(yh,null),k=_?{resource:x==="legacy"?w==null?void 0:w.route:b,...r}:void 0,D=_?R.createElement(sK,{...k}):null;return R.createElement(Id,{...s??{}},O,R.createElement(Vd,{sx:{display:"flex",flexWrap:"wrap",".MuiCardHeader-action":{margin:0,alignSelf:"center"}},title:e??R.createElement(Ve,{variant:"h5",className:ch.Title},g(`${b}.titles.list`,S(((m=w==null?void 0:w.meta)==null?void 0:m.label)??((v=w==null?void 0:w.options)==null?void 0:v.label)??(w==null?void 0:w.label)??b,"plural"))),action:R.createElement(rt,{display:"flex",gap:"16px",...d},h?typeof h=="function"?h({defaultButtons:D,createButtonProps:k}):h:D),...c??{}}),R.createElement(Kd,{...f??{}},n))},"List"),uu=He(({title:e,canEdit:t,canDelete:n,isLoading:r=!1,children:i,resource:u,recordItemId:s,breadcrumb:c,dataProviderName:f,wrapperProps:d,headerProps:h,contentProps:m,headerButtonProps:v,headerButtons:g,footerButtonProps:y,footerButtons:S,goBack:x})=>{var w,b,_;const C=Je(),{options:{breadcrumb:O}={}}=cn(),k=Ot(),D=ih(),M=Fn(),{goBack:T,list:L}=Nn(),P=Ea(),{resource:j,action:q,id:F,identifier:N}=st(u),$=wq({resource:j,action:"list"}),H=s??F,K=typeof c>"u"?O:c,ne=(j==null?void 0:j.list)&&!s,Z=(n??((w=j==null?void 0:j.meta)==null?void 0:w.canDelete)??(j==null?void 0:j.canDelete))&&typeof H<"u",X=t??(j==null?void 0:j.canEdit)??!!(j!=null&&j.edit),Y=typeof K<"u"?R.createElement(R.Fragment,null,K)??void 0:R.createElement(yh,null),I=ne?{...r?{disabled:!0}:{},resource:k==="legacy"?j==null?void 0:j.route:N}:void 0,ae=X?{...r?{disabled:!0}:{},resource:k==="legacy"?j==null?void 0:j.route:N,recordItemId:H}:void 0,se=Z?{...r?{disabled:!0}:{},resource:k==="legacy"?j==null?void 0:j.route:N,recordItemId:H,onSuccess:()=>{k==="legacy"?L((j==null?void 0:j.route)??(j==null?void 0:j.name)??""):M({to:$})},dataProviderName:f}:void 0,ie={...r?{disabled:!0}:{},resource:k==="legacy"?j==null?void 0:j.route:N,recordItemId:H,dataProviderName:f},oe=R.createElement(R.Fragment,null,ne&&R.createElement(ej,{...I}),X&&R.createElement(sl,{...ae}),Z&&R.createElement(pi,{...se}),R.createElement(JP,{...ie}));return R.createElement(Id,{...d??{},sx:{position:"relative",...d==null?void 0:d.sx}},r&&R.createElement(rt,{sx:{position:"absolute",inset:0,display:"flex",justifyContent:"center",alignItems:"center",zIndex:V=>V.zIndex.drawer+1,bgcolor:V=>Rx(V.palette.background.paper,.4)}},R.createElement(Hd,null)),Y,R.createElement(Vd,{sx:{display:"flex",flexWrap:"wrap",".MuiCardHeader-action":{margin:0,alignSelf:"center"}},title:e??R.createElement(Ve,{variant:"h5",className:ch.Title},C(`${N}.titles.show`,`Show ${P(((b=j==null?void 0:j.meta)==null?void 0:b.label)??((_=j==null?void 0:j.options)==null?void 0:_.label)??(j==null?void 0:j.label)??N,"singular")}`)),avatar:typeof x<"u"?x:R.createElement(ii,{onClick:q!=="list"&&typeof q<"u"?k==="legacy"?T:D:void 0},R.createElement(kx,null)),action:R.createElement(rt,{display:"flex",gap:"16px",...v??{}},g?typeof g=="function"?g({defaultButtons:oe,deleteButtonProps:se,editButtonProps:ae,listButtonProps:I,refreshButtonProps:ie}):g:oe),...h??{}}),R.createElement(Kd,{...m??{}},i),R.createElement(Tx,{sx:{padding:"16px"},...y??{}},S?typeof S=="function"?S({defaultButtons:null}):S:null))},"Show"),sK=He(({resource:e,resourceNameOrRouteName:t,hideText:n=!1,accessControl:r,svgIconProps:i,meta:u,children:s,onClick:c,...f})=>{const{to:d,label:h,title:m,disabled:v,hidden:g,LinkComponent:y}=Z5({resource:e??t,meta:u,accessControl:r}),S=v||f.disabled;if(g||f.hidden)return null;const{sx:w,...b}=f;return R.createElement(y,{to:d,replace:!1,onClick:_=>{if(S){_.preventDefault();return}c&&(_.preventDefault(),c(_))},style:{textDecoration:"none"}},R.createElement(ni,{disabled:S,startIcon:!n&&R.createElement(c_,{...i}),title:m,variant:"contained",sx:{minWidth:0,...w},className:ru.CreateButton,...b},n?R.createElement(c_,{fontSize:"small",...i}):s??h))},"CreateButton"),sl=He(({resource:e,resourceNameOrRouteName:t,recordItemId:n,hideText:r=!1,accessControl:i,svgIconProps:u,meta:s,children:c,onClick:f,...d})=>{const{to:h,label:m,title:v,hidden:g,disabled:y,LinkComponent:S}=X5({resource:e??t,id:n,accessControl:i,meta:s}),x=y||d.disabled;if(g||d.hidden)return null;const{sx:b,..._}=d;return R.createElement(S,{to:h,replace:!1,onClick:C=>{if(x){C.preventDefault();return}f&&(C.preventDefault(),f(C))},style:{textDecoration:"none"}},R.createElement(ni,{disabled:x,startIcon:!r&&R.createElement(f_,{sx:{selfAlign:"center"},...u}),title:v,sx:{minWidth:0,...b},className:ru.EditButton,..._},r?R.createElement(f_,{fontSize:"small",...u}):c??m))},"EditButton"),pi=He(({resource:e,resourceNameOrRouteName:t,recordItemId:n,onSuccess:r,mutationMode:i,children:u,successNotification:s,errorNotification:c,hideText:f=!1,accessControl:d,meta:h,metaData:m,dataProviderName:v,confirmTitle:g,confirmOkText:y,confirmCancelText:S,svgIconProps:x,invalidates:w,...b})=>{const{onConfirm:_,title:C,label:O,hidden:k,disabled:D,loading:M,confirmTitle:T,confirmOkLabel:L,cancelLabel:P}=Rq({resource:e??t,id:n,dataProviderName:v,mutationMode:i,accessControl:d,invalidates:w,onSuccess:r,meta:h,successNotification:s,errorNotification:c}),[j,q]=R.useState(!1),{sx:F,...N}=b,$=D||b.disabled;return k||b.hidden?null:R.createElement("div",null,R.createElement(Mx,{color:"error",onClick:()=>q(!0),disabled:$,loading:M,startIcon:!f&&R.createElement(d_,{...x}),title:C,sx:{minWidth:0,...F},loadingPosition:f?"center":"start",className:ru.DeleteButton,...N},f?R.createElement(d_,{fontSize:"small",...x}):u??O),R.createElement(w4,{open:j,onClose:()=>q(!1),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description"},R.createElement(C4,{id:"alert-dialog-title"},g??T),R.createElement(_4,{sx:{justifyContent:"center"}},R.createElement(ni,{onClick:()=>q(!1)},S??P),R.createElement(ni,{color:"error",onClick:()=>{_(),q(!1)},autoFocus:!0},y??L))))},"DeleteButton"),JP=He(({resource:e,resourceNameOrRouteName:t,recordItemId:n,hideText:r=!1,dataProviderName:i,svgIconProps:u,children:s,onClick:c,meta:f,metaData:d,...h})=>{const{onClick:m,loading:v,label:g}=kq({resource:e??t,id:n,dataProviderName:i}),{sx:y,...S}=h;return R.createElement(Mx,{startIcon:!r&&R.createElement(h_,{...u}),loading:v,loadingPosition:r?"center":"start",onClick:c||m,sx:{minWidth:0,...y},className:ru.RefreshButton,...S},r?R.createElement(h_,{fontSize:"small",...u}):s??g)},"RefreshButton"),su=He(({resource:e,resourceNameOrRouteName:t,recordItemId:n,hideText:r=!1,accessControl:i,svgIconProps:u,meta:s,children:c,onClick:f,...d})=>{const{to:h,label:m,title:v,hidden:g,disabled:y,LinkComponent:S}=Y5({resource:e??t,id:n,accessControl:i,meta:s}),x=y||d.disabled;if(g||d.hidden)return null;const{sx:b,..._}=d;return R.createElement(S,{to:h,replace:!1,onClick:C=>{if(x){C.preventDefault();return}f&&(C.preventDefault(),f(C))},style:{textDecoration:"none"}},R.createElement(ni,{disabled:x,startIcon:!r&&R.createElement(p_,{...u}),title:v,sx:{minWidth:0,...b},className:ru.ShowButton,..._},r?R.createElement(p_,{fontSize:"small",...u}):c??m))},"ShowButton"),ej=He(({resource:e,resourceNameOrRouteName:t,hideText:n=!1,accessControl:r,svgIconProps:i,meta:u,children:s,onClick:c,...f})=>{const{to:d,label:h,title:m,hidden:v,disabled:g,LinkComponent:y}=J5({resource:e??t,meta:u,accessControl:r}),S=g||f.disabled;if(v||f.hidden)return null;const{sx:w,...b}=f;return R.createElement(y,{to:d,replace:!1,onClick:_=>{if(S){_.preventDefault();return}c&&(_.preventDefault(),c(_))},style:{textDecoration:"none"}},R.createElement(ni,{disabled:S,startIcon:!n&&R.createElement(bd,{...i}),title:m,sx:{minWidth:0,...w},className:ru.ListButton,...b},n?R.createElement(bd,{fontSize:"small",...i}):s??h))},"ListButton"),tj=He(({hideText:e=!1,svgIconProps:t,children:n,...r})=>{const{label:i}=e6(),{sx:u,...s}=r;return R.createElement(Mx,{startIcon:!e&&R.createElement(m_,{...t}),sx:{minWidth:0,...u},variant:"contained",className:ru.SaveButton,...s},e?R.createElement(m_,{fontSize:"small",...t}):n??i)},"SaveButton"),oK=He(({undoableTimeout:e,message:t})=>{const[n,r]=Q.useState(100),[i,u]=Q.useState(e);return Q.useEffect(()=>{const s=100/e,c=setInterval(()=>{u(f=>f-1),r(f=>f-s)},1e3);return i===0&&clearInterval(c),()=>{clearInterval(c)}},[i]),R.createElement(R.Fragment,null,R.createElement(rt,{sx:{position:"relative",display:"inline-flex"}},R.createElement(Hd,{color:"inherit",variant:"determinate",value:n}),R.createElement(rt,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"}},R.createElement(Ve,{component:"div"},i))),R.createElement(rt,{sx:{marginLeft:"10px",maxWidth:{xs:"150px",md:"100%"}}},R.createElement(Ve,{variant:"subtitle2"},t)))},"CircularDeterminate"),Pn=He(({value:e,...t})=>R.createElement(Ve,{variant:"body2",...t},e),"TextField"),is=He(({value:e,...t})=>R.createElement(O4,{label:e==null?void 0:e.toString(),...t}),"TagField"),nj=He(({value:e,valueLabelTrue:t="true",valueLabelFalse:n="false",trueIcon:r,falseIcon:i,svgIconProps:u,...s})=>R.createElement(Fl,{title:e?t:n,...s},e?R.createElement("span",null,r??R.createElement(A4,{...u})):R.createElement("span",null,i??R.createElement(R4,{...u}))),"BooleanField");aS.extend(fV);var cK=aS.locale(),rj=He(({value:e,locales:t,format:n="L",...r})=>R.createElement(Ve,{variant:"body2",...r},e?aS(e).locale(t||cK).format(n):""),"DateField");function fK(){return!!(typeof Intl=="object"&&Intl&&typeof Intl.NumberFormat=="function")}He(fK,"toLocaleStringSupportsOptions");var yh=He(({breadcrumbProps:e,showHome:t=!0,hideIcons:n=!1,meta:r,minItems:i=2})=>{var u,s;const{breadcrumbs:c}=V5({meta:r}),f=Ot(),d=tu(),{Link:h}=_n(),m=f==="legacy"?h:d,{hasDashboard:v}=cn(),{resources:g}=st(),y=JL("/",g);if(c.lengthR.createElement(D2,{...x,component:m}),"LinkRouter");return R.createElement(k4,{"aria-label":"breadcrumb",sx:{padding:2,...(e==null?void 0:e.sx)??{}},...e},t&&(v||y.found)&&R.createElement(S,{underline:"hover",sx:{display:"flex",alignItems:"center"},color:"inherit",to:"/"},((s=(u=y==null?void 0:y.resource)==null?void 0:u.meta)==null?void 0:s.icon)??R.createElement(T4,{sx:{fontSize:"18px"}})),c.map(({label:x,icon:w,href:b})=>R.createElement(K0,{key:x,sx:{display:"flex",alignItems:"center","& .MuiSvgIcon-root":{fontSize:"16px"}}},!n&&w,b?R.createElement(S,{underline:"hover",sx:{display:"flex",alignItems:"center",fontSize:"14px"},color:"inherit",to:b,variant:"subtitle1",marginLeft:.5},x):R.createElement(Ve,{fontSize:"14px"},x))))},"Breadcrumb"),dK=He(({status:e,elements:{success:t=R.createElement(Zf,{translationKey:"autoSave.success",defaultMessage:"saved",icon:R.createElement(M4,{fontSize:"small"})}),error:n=R.createElement(Zf,{translationKey:"autoSave.error",defaultMessage:"auto save failure",icon:R.createElement(D4,{fontSize:"small"})}),loading:r=R.createElement(Zf,{translationKey:"autoSave.loading",defaultMessage:"saving...",icon:R.createElement(L4,{fontSize:"small"})}),idle:i=R.createElement(Zf,{translationKey:"autoSave.idle",defaultMessage:"waiting for changes",icon:R.createElement(q4,{fontSize:"small"})})}={}})=>R.createElement(L6,{status:e,elements:{success:t,error:n,loading:r,idle:i}}),"AutoSaveIndicator"),Zf=He(({translationKey:e,defaultMessage:t,icon:n})=>{const r=Je();return R.createElement(Ve,{color:"gray",fontSize:"0.8rem",position:"relative",display:"flex",alignItems:"center",flexWrap:"wrap",marginRight:".3rem"},r(e,t),R.createElement("span",{style:{position:"relative",top:"3px",marginLeft:"3px"}},n))},"Message"),hK={mode:"light",primary:{main:"#67be23",contrastText:"#fff"},secondary:{main:"#2A132E",contrastText:"#fff"},background:{default:"#f0f0f0",paper:"#ffffff"},success:{main:"#67be23",contrastText:"#fff"},error:{main:"#fa541c",contrastText:"#fff"},warning:{main:"#fa8c16",contrastText:"#fff"},info:{main:"#0b82f0",contrastText:"#fff"},divider:"rgba(0,0,0,0)",text:{primary:"#626262",secondary:"#9f9f9f",disabled:"#c1c1c1"}},pK={mode:"dark",primary:{main:"#67be23",contrastText:"#fff"},secondary:{main:"#2A132E",contrastText:"#fff"},background:{default:"#212121",paper:"#242424"},success:{main:"#67be23",contrastText:"#fff"},error:{main:"#ee2a1e",contrastText:"#fff"},warning:{main:"#fa8c16",contrastText:"#fff"},info:{main:"#1890ff",contrastText:"#fff"},divider:"rgba(0,0,0,0)",text:{primary:"#fff",secondary:"rgba(255,255,255,0.7)",disabled:"#d1d1d1"}},mK={fontFamily:["Montserrat","-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"'].join(",")},zM={Blue:{mode:"light",primary:{main:"#1976D2",light:"#4791db",dark:"#115293"}},BlueDark:{mode:"dark",primary:{main:"#67b7f7",light:"#85c5f8",dark:"#4880ac"}},Purple:{mode:"light",primary:{main:"#7B1FA2",light:"#954bb4",dark:"#561571"}},PurpleDark:{mode:"dark",primary:{main:"#AB47BC",light:"#bb6bc9",dark:"#773183"}},Magenta:{mode:"light",primary:{main:"#C2185B",light:"#ce467b",dark:"#87103f"}},MagentaDark:{mode:"dark",primary:{main:"#EC407A",light:"#ef6694",dark:"#a52c55"}},Red:{mode:"light",primary:{main:"#D32F2F",light:"#db5858",dark:"#932020"}},RedDark:{mode:"dark",primary:{main:"#EF5350",light:"#f27573",dark:"#a73a38"}},Orange:{mode:"light",primary:{main:"#F57C00",light:"#f79633",dark:"#ab5600"}},OrangeDark:{mode:"dark",primary:{main:"#FFA726",light:"#ffb851",dark:"#b2741a"}},Yellow:{mode:"light",primary:{main:"#FFA000",light:"#ffb333",dark:"#b27000"}},YellowDark:{mode:"dark",primary:{main:"#FFCA28",light:"#ffd453",dark:"#E87040"}},Green:{mode:"light",primary:{main:"#689F38",light:"#86b25f",dark:"#486f27"}},GreenDark:{mode:"dark",primary:{main:"#9CCC65",light:"#afd683",dark:"#6d8e46"}}},aj={shape:{borderRadius:6},typography:{...mK}};Ax({...aj,palette:hK,components:{MuiAppBar:{styleOverrides:{colorDefault:{backgroundColor:"#fff"}}},MuiPaper:{styleOverrides:{root:{backgroundImage:"linear-gradient(rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0.01))"}}},MuiTypography:{styleOverrides:{h5:{fontWeight:800,lineHeight:"2rem"}}}}});Ax({...aj,palette:pK,components:{MuiPaper:{styleOverrides:{root:{backgroundImage:"linear-gradient(rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.025))"}}},MuiAppBar:{defaultProps:{color:"transparent"}},MuiTypography:{styleOverrides:{h5:{fontWeight:800,lineHeight:"2rem"}}}}});var $M=Object.keys(zM).reduce((e,t)=>{const n=t;return{...e,[t]:Ax({palette:{...zM[n]},components:{MuiButton:{styleOverrides:{root:({ownerState:r})=>({...r.variant==="contained"&&r.color==="primary"&&{color:"#fff"}})}}}})}},{}),gK=He(()=>{const{closeSnackbar:e,enqueueSnackbar:t}=PH();return{open:({message:r,type:i,undoableTimeout:u,key:s,cancelMutation:c,description:f})=>{if(i==="progress"){const d=He(h=>R.createElement(ii,{onClick:()=>{c==null||c(),e(h)},color:"inherit"},R.createElement(z4,null)),"action");t(R.createElement(R.Fragment,null,R.createElement(oK,{undoableTimeout:u??0,message:r})),{action:d,preventDuplicate:!0,key:s,autoHideDuration:(u??0)*1e3})}else t(R.createElement(rt,null,R.createElement(Ve,{variant:"subtitle2",component:"h6"},f),R.createElement(Ve,{variant:"caption",component:"p"},r)),{key:s,variant:i})},close:r=>{e(r)}}},"useNotificationProvider"),yK=He(({anchorOrigin:e={vertical:"top",horizontal:"right"},disableWindowBlurListener:t=!0,...n})=>R.createElement(qH,{anchorOrigin:e,disableWindowBlurListener:t,...n}),"SnackbarProviderWithDefaultValues"),vK=Bd(yK)` +&.SnackbarItem-contentRoot { + background-color: ${e=>e.theme.palette.background.default}; + color: ${e=>e.theme.palette.primary.main}; +} +&.SnackbarItem-variantSuccess { + background-color: ${e=>e.theme.palette.success.main}; + color: ${e=>e.theme.palette.success.contrastText}; +} +&.SnackbarItem-variantError { + background-color: ${e=>e.theme.palette.error.main}; + color: ${e=>e.theme.palette.error.contrastText}; +} +&.SnackbarItem-variantInfo { + background-color: ${e=>e.theme.palette.info.main}; + color: ${e=>e.theme.palette.info.contrastText}; +} +&.SnackbarItem-variantWarning { + background-color: ${e=>e.theme.palette.warning.main}; + color: ${e=>e.theme.palette.warning.contrastText}; +} +`,Mo={},UM;function bK(){if(UM)return Mo;UM=1,Object.defineProperty(Mo,"__esModule",{value:!0}),Mo.parse=s,Mo.serialize=d;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,n=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,i=Object.prototype.toString,u=(()=>{const v=function(){};return v.prototype=Object.create(null),v})();function s(v,g){const y=new u,S=v.length;if(S<2)return y;const x=(g==null?void 0:g.decode)||h;let w=0;do{const b=v.indexOf("=",w);if(b===-1)break;const _=v.indexOf(";",w),C=_===-1?S:_;if(b>C){w=v.lastIndexOf(";",b-1)+1;continue}const O=c(v,w,b),k=f(v,b,O),D=v.slice(O,k);if(y[D]===void 0){let M=c(v,b+1,C),T=f(v,C,M);const L=x(v.slice(M,T));y[D]=L}w=C+1}while(wy;){const S=v.charCodeAt(--g);if(S!==32&&S!==9)return g+1}return y}function d(v,g,y){const S=(y==null?void 0:y.encode)||encodeURIComponent;if(!e.test(v))throw new TypeError(`argument name is invalid: ${v}`);const x=S(g);if(!t.test(x))throw new TypeError(`argument val is invalid: ${g}`);let w=v+"="+x;if(!y)return w;if(y.maxAge!==void 0){if(!Number.isInteger(y.maxAge))throw new TypeError(`option maxAge is invalid: ${y.maxAge}`);w+="; Max-Age="+y.maxAge}if(y.domain){if(!n.test(y.domain))throw new TypeError(`option domain is invalid: ${y.domain}`);w+="; Domain="+y.domain}if(y.path){if(!r.test(y.path))throw new TypeError(`option path is invalid: ${y.path}`);w+="; Path="+y.path}if(y.expires){if(!m(y.expires)||!Number.isFinite(y.expires.valueOf()))throw new TypeError(`option expires is invalid: ${y.expires}`);w+="; Expires="+y.expires.toUTCString()}if(y.httpOnly&&(w+="; HttpOnly"),y.secure&&(w+="; Secure"),y.partitioned&&(w+="; Partitioned"),y.priority)switch(typeof y.priority=="string"?y.priority.toLowerCase():void 0){case"low":w+="; Priority=Low";break;case"medium":w+="; Priority=Medium";break;case"high":w+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${y.priority}`)}if(y.sameSite)switch(typeof y.sameSite=="string"?y.sameSite.toLowerCase():y.sameSite){case!0:case"strict":w+="; SameSite=Strict";break;case"lax":w+="; SameSite=Lax";break;case"none":w+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${y.sameSite}`)}return w}function h(v){if(v.indexOf("%")===-1)return v;try{return decodeURIComponent(v)}catch{return v}}function m(v){return i.call(v)==="[object Date]"}return Mo}bK();/** + * react-router v7.1.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */var BM="popstate";function xK(e={}){function t(r,i){let{pathname:u,search:s,hash:c}=r.location;return mx("",{pathname:u,search:s,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Go(i)}return EK(t,n,null,e)}function Bt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Zr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function SK(){return Math.random().toString(36).substring(2,10)}function IM(e,t){return{usr:e.state,key:e.key,idx:t}}function mx(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ys(t):t,state:n,key:t&&t.key||r||SK()}}function Go({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function ys(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function EK(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:u=!1}=r,s=i.history,c="POP",f=null,d=h();d==null&&(d=0,s.replaceState({...s.state,idx:d},""));function h(){return(s.state||{idx:null}).idx}function m(){c="POP";let x=h(),w=x==null?null:x-d;d=x,f&&f({action:c,location:S.location,delta:w})}function v(x,w){c="PUSH";let b=mx(S.location,x,w);d=h()+1;let _=IM(b,d),C=S.createHref(b);try{s.pushState(_,"",C)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;i.location.assign(C)}u&&f&&f({action:c,location:S.location,delta:1})}function g(x,w){c="REPLACE";let b=mx(S.location,x,w);d=h();let _=IM(b,d),C=S.createHref(b);s.replaceState(_,"",C),u&&f&&f({action:c,location:S.location,delta:0})}function y(x){let w=i.location.origin!=="null"?i.location.origin:i.location.href,b=typeof x=="string"?x:Go(x);return b=b.replace(/ $/,"%20"),Bt(w,`No window.location.(origin|href) available to create URL for href: ${b}`),new URL(b,w)}let S={get action(){return c},get location(){return e(i,s)},listen(x){if(f)throw new Error("A history only accepts one active listener");return i.addEventListener(BM,m),f=x,()=>{i.removeEventListener(BM,m),f=null}},createHref(x){return t(i,x)},createURL:y,encodeLocation(x){let w=y(x);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:v,replace:g,go(x){return s.go(x)}};return S}function ij(e,t,n="/"){return wK(e,t,n,!1)}function wK(e,t,n,r){let i=typeof t=="string"?ys(t):t,u=el(i.pathname||"/",n);if(u==null)return null;let s=lj(e);CK(s);let c=null;for(let f=0;c==null&&f{let f={relativePath:c===void 0?u.path||"":c,caseSensitive:u.caseSensitive===!0,childrenIndex:s,route:u};f.relativePath.startsWith("/")&&(Bt(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length));let d=ti([r,f.relativePath]),h=n.concat(f);u.children&&u.children.length>0&&(Bt(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),lj(u.children,t,h,d)),!(u.path==null&&!u.index)&&t.push({path:d,score:MK(d,u.index),routesMeta:h})};return e.forEach((u,s)=>{var c;if(u.path===""||!((c=u.path)!=null&&c.includes("?")))i(u,s);else for(let f of uj(u.path))i(u,s,f)}),t}function uj(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),u=n.replace(/\?$/,"");if(r.length===0)return i?[u,""]:[u];let s=uj(r.join("/")),c=[];return c.push(...s.map(f=>f===""?u:[u,f].join("/"))),i&&c.push(...s),c.map(f=>e.startsWith("/")&&f===""?"/":f)}function CK(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:DK(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var _K=/^:[\w-]+$/,OK=3,AK=2,RK=1,kK=10,TK=-2,HM=e=>e==="*";function MK(e,t){let n=e.split("/"),r=n.length;return n.some(HM)&&(r+=TK),t&&(r+=AK),n.filter(i=>!HM(i)).reduce((i,u)=>i+(_K.test(u)?OK:u===""?RK:kK),r)}function DK(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function LK(e,t,n=!1){let{routesMeta:r}=e,i={},u="/",s=[];for(let c=0;c{if(h==="*"){let y=c[v]||"";s=u.slice(0,u.length-y.length).replace(/(.)\/+$/,"$1")}const g=c[v];return m&&!g?d[h]=void 0:d[h]=(g||"").replace(/%2F/g,"/"),d},{}),pathname:u,pathnameBase:s,pattern:e}}function qK(e,t=!1,n=!0){Zr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,c,f)=>(r.push({paramName:c,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function PK(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Zr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function el(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function jK(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?ys(e):e;return{pathname:n?n.startsWith("/")?n:FK(n,t):t,search:$K(r),hash:UK(i)}}function FK(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function k1(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function NK(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function pS(e){let t=NK(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function mS(e,t,n,r=!1){let i;typeof e=="string"?i=ys(e):(i={...e},Bt(!i.pathname||!i.pathname.includes("?"),k1("?","pathname","search",i)),Bt(!i.pathname||!i.pathname.includes("#"),k1("#","pathname","hash",i)),Bt(!i.search||!i.search.includes("#"),k1("#","search","hash",i)));let u=e===""||i.pathname==="",s=u?"/":i.pathname,c;if(s==null)c=n;else{let m=t.length-1;if(!r&&s.startsWith("..")){let v=s.split("/");for(;v[0]==="..";)v.shift(),m-=1;i.pathname=v.join("/")}c=m>=0?t[m]:"/"}let f=jK(i,c),d=s&&s!=="/"&&s.endsWith("/"),h=(u||s===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(d||h)&&(f.pathname+="/"),f}var ti=e=>e.join("/").replace(/\/\/+/g,"/"),zK=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),$K=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,UK=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function BK(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var sj=["POST","PUT","PATCH","DELETE"];new Set(sj);var IK=["GET",...sj];new Set(IK);var vs=Q.createContext(null);vs.displayName="DataRouter";var vh=Q.createContext(null);vh.displayName="DataRouterState";var oj=Q.createContext({isTransitioning:!1});oj.displayName="ViewTransition";var HK=Q.createContext(new Map);HK.displayName="Fetchers";var VK=Q.createContext(null);VK.displayName="Await";var Br=Q.createContext(null);Br.displayName="Navigation";var hc=Q.createContext(null);hc.displayName="Location";var Ir=Q.createContext({outlet:null,matches:[],isDataRoute:!1});Ir.displayName="Route";var gS=Q.createContext(null);gS.displayName="RouteError";function KK(e,{relative:t}={}){Bt(bs(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=Q.useContext(Br),{hash:i,pathname:u,search:s}=pc(e,{relative:t}),c=u;return n!=="/"&&(c=u==="/"?n:ti([n,u])),r.createHref({pathname:c,search:s,hash:i})}function bs(){return Q.useContext(hc)!=null}function Fr(){return Bt(bs(),"useLocation() may be used only in the context of a component."),Q.useContext(hc).location}var cj="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function fj(e){Q.useContext(Br).static||Q.useLayoutEffect(e)}function Pd(){let{isDataRoute:e}=Q.useContext(Ir);return e?sW():WK()}function WK(){Bt(bs(),"useNavigate() may be used only in the context of a component.");let e=Q.useContext(vs),{basename:t,navigator:n}=Q.useContext(Br),{matches:r}=Q.useContext(Ir),{pathname:i}=Fr(),u=JSON.stringify(pS(r)),s=Q.useRef(!1);return fj(()=>{s.current=!0}),Q.useCallback((f,d={})=>{if(Zr(s.current,cj),!s.current)return;if(typeof f=="number"){n.go(f);return}let h=mS(f,JSON.parse(u),i,d.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:ti([t,h.pathname])),(d.replace?n.replace:n.push)(h,d.state,d)},[t,n,u,i,e])}var QK=Q.createContext(null);function GK(e){let t=Q.useContext(Ir).outlet;return t&&Q.createElement(QK.Provider,{value:e},t)}function YK(){let{matches:e}=Q.useContext(Ir),t=e[e.length-1];return t?t.params:{}}function pc(e,{relative:t}={}){let{matches:n}=Q.useContext(Ir),{pathname:r}=Fr(),i=JSON.stringify(pS(n));return Q.useMemo(()=>mS(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function XK(e,t){return dj(e,t)}function dj(e,t,n,r){var w;Bt(bs(),"useRoutes() may be used only in the context of a component.");let{navigator:i}=Q.useContext(Br),{matches:u}=Q.useContext(Ir),s=u[u.length-1],c=s?s.params:{},f=s?s.pathname:"/",d=s?s.pathnameBase:"/",h=s&&s.route;{let b=h&&h.path||"";hj(f,!h||b.endsWith("*")||b.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${f}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. + +Please change the parent to .`)}let m=Fr(),v;if(t){let b=typeof t=="string"?ys(t):t;Bt(d==="/"||((w=b.pathname)==null?void 0:w.startsWith(d)),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${b.pathname}" was given in the \`location\` prop.`),v=b}else v=m;let g=v.pathname||"/",y=g;if(d!=="/"){let b=d.replace(/^\//,"").split("/");y="/"+g.replace(/^\//,"").split("/").slice(b.length).join("/")}let S=ij(e,{pathname:y});Zr(h||S!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Zr(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let x=nW(S&&S.map(b=>Object.assign({},b,{params:Object.assign({},c,b.params),pathname:ti([d,i.encodeLocation?i.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?d:ti([d,i.encodeLocation?i.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),u,n,r);return t&&x?Q.createElement(hc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},x):x}function ZK(){let e=uW(),t=BK(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},u={padding:"2px 4px",backgroundColor:r},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=Q.createElement(Q.Fragment,null,Q.createElement("p",null,"💿 Hey developer 👋"),Q.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",Q.createElement("code",{style:u},"ErrorBoundary")," or"," ",Q.createElement("code",{style:u},"errorElement")," prop on your route.")),Q.createElement(Q.Fragment,null,Q.createElement("h2",null,"Unexpected Application Error!"),Q.createElement("h3",{style:{fontStyle:"italic"}},t),n?Q.createElement("pre",{style:i},n):null,s)}var JK=Q.createElement(ZK,null),eW=class extends Q.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?Q.createElement(Ir.Provider,{value:this.props.routeContext},Q.createElement(gS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function tW({routeContext:e,match:t,children:n}){let r=Q.useContext(vs);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),Q.createElement(Ir.Provider,{value:e},n)}function nW(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,u=n==null?void 0:n.errors;if(u!=null){let f=i.findIndex(d=>d.route.id&&(u==null?void 0:u[d.route.id])!==void 0);Bt(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),i=i.slice(0,Math.min(i.length,f+1))}let s=!1,c=-1;if(n)for(let f=0;f=0?i=i.slice(0,c+1):i=[i[0]];break}}}return i.reduceRight((f,d,h)=>{let m,v=!1,g=null,y=null;n&&(m=u&&d.route.id?u[d.route.id]:void 0,g=d.route.errorElement||JK,s&&(c<0&&h===0?(hj("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,y=null):c===h&&(v=!0,y=d.route.hydrateFallbackElement||null)));let S=t.concat(i.slice(0,h+1)),x=()=>{let w;return m?w=g:v?w=y:d.route.Component?w=Q.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=f,Q.createElement(tW,{match:d,routeContext:{outlet:f,matches:S,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?Q.createElement(eW,{location:n.location,revalidation:n.revalidation,component:g,error:m,children:x(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):x()},null)}function yS(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function rW(e){let t=Q.useContext(vs);return Bt(t,yS(e)),t}function aW(e){let t=Q.useContext(vh);return Bt(t,yS(e)),t}function iW(e){let t=Q.useContext(Ir);return Bt(t,yS(e)),t}function vS(e){let t=iW(e),n=t.matches[t.matches.length-1];return Bt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function lW(){return vS("useRouteId")}function uW(){var r;let e=Q.useContext(gS),t=aW("useRouteError"),n=vS("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function sW(){let{router:e}=rW("useNavigate"),t=vS("useNavigate"),n=Q.useRef(!1);return fj(()=>{n.current=!0}),Q.useCallback(async(i,u={})=>{Zr(n.current,cj),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...u}))},[e,t])}var VM={};function hj(e,t,n){!t&&!VM[e]&&(VM[e]=!0,Zr(!1,n))}Q.memo(oW);function oW({routes:e,future:t,state:n}){return dj(e,void 0,n,t)}function cW({to:e,replace:t,state:n,relative:r}){Bt(bs()," may be used only in the context of a component.");let{static:i}=Q.useContext(Br);Zr(!i," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:u}=Q.useContext(Ir),{pathname:s}=Fr(),c=Pd(),f=mS(e,pS(u),s,r==="path"),d=JSON.stringify(f);return Q.useEffect(()=>{c(JSON.parse(d),{replace:t,state:n,relative:r})},[c,d,r,t,n]),null}function fW(e){return GK(e.context)}function tt(e){Bt(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function dW({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:u=!1}){Bt(!bs(),"You cannot render a inside another . You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),c=Q.useMemo(()=>({basename:s,navigator:i,static:u,future:{}}),[s,i,u]);typeof n=="string"&&(n=ys(n));let{pathname:f="/",search:d="",hash:h="",state:m=null,key:v="default"}=n,g=Q.useMemo(()=>{let y=el(f,s);return y==null?null:{location:{pathname:y,search:d,hash:h,state:m,key:v},navigationType:r}},[s,f,d,h,m,v,r]);return Zr(g!=null,` is not able to match the URL "${f}${d}${h}" because it does not start with the basename, so the won't render anything.`),g==null?null:Q.createElement(Br.Provider,{value:c},Q.createElement(hc.Provider,{children:t,value:g}))}function hW({children:e,location:t}){return XK(gx(e),t)}function gx(e,t=[]){let n=[];return Q.Children.forEach(e,(r,i)=>{if(!Q.isValidElement(r))return;let u=[...t,i];if(r.type===Q.Fragment){n.push.apply(n,gx(r.props.children,u));return}Bt(r.type===tt,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),Bt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let s={id:r.props.id||u.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=gx(r.props.children,u)),n.push(s)}),n}var dd="get",hd="application/x-www-form-urlencoded";function bh(e){return e!=null&&typeof e.tagName=="string"}function pW(e){return bh(e)&&e.tagName.toLowerCase()==="button"}function mW(e){return bh(e)&&e.tagName.toLowerCase()==="form"}function gW(e){return bh(e)&&e.tagName.toLowerCase()==="input"}function yW(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function vW(e,t){return e.button===0&&(!t||t==="_self")&&!yW(e)}var Jf=null;function bW(){if(Jf===null)try{new FormData(document.createElement("form"),0),Jf=!1}catch{Jf=!0}return Jf}var xW=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function T1(e){return e!=null&&!xW.has(e)?(Zr(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${hd}"`),null):e}function SW(e,t){let n,r,i,u,s;if(mW(e)){let c=e.getAttribute("action");r=c?el(c,t):null,n=e.getAttribute("method")||dd,i=T1(e.getAttribute("enctype"))||hd,u=new FormData(e)}else if(pW(e)||gW(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a