schemalens 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,127 @@
1
+ var nq=e=>{throw TypeError(e)};var Hp=(e,n,r)=>n.has(e)||nq("Cannot "+r);var Y=(e,n,r)=>(Hp(e,n,"read from private field"),r?r.call(e):n.get(e)),Ee=(e,n,r)=>n.has(e)?nq("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,r),ye=(e,n,r,s)=>(Hp(e,n,"write to private field"),s?s.call(e,r):n.set(e,r),r),$e=(e,n,r)=>(Hp(e,n,"access private method"),r);var Xc=(e,n,r,s)=>({set _(a){ye(e,n,a,r)},get _(){return Y(e,n,s)}});function Ez(e,n){for(var r=0;r<n.length;r++){const s=n[r];if(typeof s!="string"&&!Array.isArray(s)){for(const a in s)if(a!=="default"&&!(a in e)){const o=Object.getOwnPropertyDescriptor(s,a);o&&Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>s[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function r(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(a){if(a.ep)return;a.ep=!0;const o=r(a);fetch(a.href,o)}})();var Wc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cE(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function xz(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var n=e.default;if(typeof n=="function"){var r=function s(){return this instanceof s?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};r.prototype=n.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(s){var a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,a.get?a:{enumerable:!0,get:function(){return e[s]}})}),r}var Vp={exports:{}},Su={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var rq;function Sz(){if(rq)return Su;rq=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(s,a,o){var l=null;if(o!==void 0&&(l=""+o),a.key!==void 0&&(l=""+a.key),"key"in a){o={};for(var u in a)u!=="key"&&(o[u]=a[u])}else o=a;return a=o.ref,{$$typeof:e,type:s,key:l,ref:a!==void 0?a:null,props:o}}return Su.Fragment=n,Su.jsx=r,Su.jsxs=r,Su}var iq;function Tz(){return iq||(iq=1,Vp.exports=Sz()),Vp.exports}var F=Tz(),Fp={exports:{}},Ie={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var sq;function qz(){if(sq)return Ie;sq=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),g=Symbol.iterator;function y(B){return B===null||typeof B!="object"?null:(B=g&&B[g]||B["@@iterator"],typeof B=="function"?B:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,v={};function b(B,K,te){this.props=B,this.context=K,this.refs=v,this.updater=te||C}b.prototype.isReactComponent={},b.prototype.setState=function(B,K){if(typeof B!="object"&&typeof B!="function"&&B!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,B,K,"setState")},b.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function w(){}w.prototype=b.prototype;function E(B,K,te){this.props=B,this.context=K,this.refs=v,this.updater=te||C}var q=E.prototype=new w;q.constructor=E,x(q,b.prototype),q.isPureReactComponent=!0;var A=Array.isArray;function R(){}var O={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function k(B,K,te){var Q=te.ref;return{$$typeof:e,type:B,key:K,ref:Q!==void 0?Q:null,props:te}}function N(B,K){return k(B.type,K,B.props)}function j(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function D(B){var K={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(te){return K[te]})}var z=/\/+/g;function T(B,K){return typeof B=="object"&&B!==null&&B.key!=null?D(""+B.key):K.toString(36)}function M(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(R,R):(B.status="pending",B.then(function(K){B.status==="pending"&&(B.status="fulfilled",B.value=K)},function(K){B.status==="pending"&&(B.status="rejected",B.reason=K)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function $(B,K,te,Q,J){var ie=typeof B;(ie==="undefined"||ie==="boolean")&&(B=null);var oe=!1;if(B===null)oe=!0;else switch(ie){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(B.$$typeof){case e:case n:oe=!0;break;case p:return oe=B._init,$(oe(B._payload),K,te,Q,J)}}if(oe)return J=J(B),oe=Q===""?"."+T(B,0):Q,A(J)?(te="",oe!=null&&(te=oe.replace(z,"$&/")+"/"),$(J,K,te,"",function(be){return be})):J!=null&&(j(J)&&(J=N(J,te+(J.key==null||B&&B.key===J.key?"":(""+J.key).replace(z,"$&/")+"/")+oe)),K.push(J)),1;oe=0;var ee=Q===""?".":Q+":";if(A(B))for(var fe=0;fe<B.length;fe++)Q=B[fe],ie=ee+T(Q,fe),oe+=$(Q,K,te,ie,J);else if(fe=y(B),typeof fe=="function")for(B=fe.call(B),fe=0;!(Q=B.next()).done;)Q=Q.value,ie=ee+T(Q,fe++),oe+=$(Q,K,te,ie,J);else if(ie==="object"){if(typeof B.then=="function")return $(M(B),K,te,Q,J);throw K=String(B),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return oe}function P(B,K,te){if(B==null)return B;var Q=[],J=0;return $(B,Q,"","",function(ie){return K.call(te,ie,J++)}),Q}function H(B){if(B._status===-1){var K=B._result;K=K(),K.then(function(te){(B._status===0||B._status===-1)&&(B._status=1,B._result=te)},function(te){(B._status===0||B._status===-1)&&(B._status=2,B._result=te)}),B._status===-1&&(B._status=0,B._result=K)}if(B._status===1)return B._result.default;throw B._result}var G=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},V={map:P,forEach:function(B,K,te){P(B,function(){K.apply(this,arguments)},te)},count:function(B){var K=0;return P(B,function(){K++}),K},toArray:function(B){return P(B,function(K){return K})||[]},only:function(B){if(!j(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return Ie.Activity=d,Ie.Children=V,Ie.Component=b,Ie.Fragment=r,Ie.Profiler=a,Ie.PureComponent=E,Ie.StrictMode=s,Ie.Suspense=h,Ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,Ie.__COMPILER_RUNTIME={__proto__:null,c:function(B){return O.H.useMemoCache(B)}},Ie.cache=function(B){return function(){return B.apply(null,arguments)}},Ie.cacheSignal=function(){return null},Ie.cloneElement=function(B,K,te){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var Q=x({},B.props),J=B.key;if(K!=null)for(ie in K.key!==void 0&&(J=""+K.key),K)!I.call(K,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&K.ref===void 0||(Q[ie]=K[ie]);var ie=arguments.length-2;if(ie===1)Q.children=te;else if(1<ie){for(var oe=Array(ie),ee=0;ee<ie;ee++)oe[ee]=arguments[ee+2];Q.children=oe}return k(B.type,J,Q)},Ie.createContext=function(B){return B={$$typeof:l,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:o,_context:B},B},Ie.createElement=function(B,K,te){var Q,J={},ie=null;if(K!=null)for(Q in K.key!==void 0&&(ie=""+K.key),K)I.call(K,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(J[Q]=K[Q]);var oe=arguments.length-2;if(oe===1)J.children=te;else if(1<oe){for(var ee=Array(oe),fe=0;fe<oe;fe++)ee[fe]=arguments[fe+2];J.children=ee}if(B&&B.defaultProps)for(Q in oe=B.defaultProps,oe)J[Q]===void 0&&(J[Q]=oe[Q]);return k(B,ie,J)},Ie.createRef=function(){return{current:null}},Ie.forwardRef=function(B){return{$$typeof:u,render:B}},Ie.isValidElement=j,Ie.lazy=function(B){return{$$typeof:p,_payload:{_status:-1,_result:B},_init:H}},Ie.memo=function(B,K){return{$$typeof:f,type:B,compare:K===void 0?null:K}},Ie.startTransition=function(B){var K=O.T,te={};O.T=te;try{var Q=B(),J=O.S;J!==null&&J(te,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(R,G)}catch(ie){G(ie)}finally{K!==null&&te.types!==null&&(K.types=te.types),O.T=K}},Ie.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},Ie.use=function(B){return O.H.use(B)},Ie.useActionState=function(B,K,te){return O.H.useActionState(B,K,te)},Ie.useCallback=function(B,K){return O.H.useCallback(B,K)},Ie.useContext=function(B){return O.H.useContext(B)},Ie.useDebugValue=function(){},Ie.useDeferredValue=function(B,K){return O.H.useDeferredValue(B,K)},Ie.useEffect=function(B,K){return O.H.useEffect(B,K)},Ie.useEffectEvent=function(B){return O.H.useEffectEvent(B)},Ie.useId=function(){return O.H.useId()},Ie.useImperativeHandle=function(B,K,te){return O.H.useImperativeHandle(B,K,te)},Ie.useInsertionEffect=function(B,K){return O.H.useInsertionEffect(B,K)},Ie.useLayoutEffect=function(B,K){return O.H.useLayoutEffect(B,K)},Ie.useMemo=function(B,K){return O.H.useMemo(B,K)},Ie.useOptimistic=function(B,K){return O.H.useOptimistic(B,K)},Ie.useReducer=function(B,K,te){return O.H.useReducer(B,K,te)},Ie.useRef=function(B){return O.H.useRef(B)},Ie.useState=function(B){return O.H.useState(B)},Ie.useSyncExternalStore=function(B,K,te){return O.H.useSyncExternalStore(B,K,te)},Ie.useTransition=function(){return O.H.useTransition()},Ie.version="19.2.4",Ie}var aq;function al(){return aq||(aq=1,Fp.exports=qz()),Fp.exports}var re=al();const Fa=cE(re),Az=Ez({__proto__:null,default:Fa},[re]);var Gp={exports:{}},Tu={},Kp={exports:{}},Yp={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var oq;function Nz(){return oq||(oq=1,(function(e){function n($,P){var H=$.length;$.push(P);e:for(;0<H;){var G=H-1>>>1,V=$[G];if(0<a(V,P))$[G]=P,$[H]=V,H=G;else break e}}function r($){return $.length===0?null:$[0]}function s($){if($.length===0)return null;var P=$[0],H=$.pop();if(H!==P){$[0]=H;e:for(var G=0,V=$.length,B=V>>>1;G<B;){var K=2*(G+1)-1,te=$[K],Q=K+1,J=$[Q];if(0>a(te,H))Q<V&&0>a(J,te)?($[G]=J,$[Q]=H,G=Q):($[G]=te,$[K]=H,G=K);else if(Q<V&&0>a(J,H))$[G]=J,$[Q]=H,G=Q;else break e}}return P}function a($,P){var H=$.sortIndex-P.sortIndex;return H!==0?H:$.id-P.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var h=[],f=[],p=1,d=null,g=3,y=!1,C=!1,x=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function q($){for(var P=r(f);P!==null;){if(P.callback===null)s(f);else if(P.startTime<=$)s(f),P.sortIndex=P.expirationTime,n(h,P);else break;P=r(f)}}function A($){if(x=!1,q($),!C)if(r(h)!==null)C=!0,R||(R=!0,D());else{var P=r(f);P!==null&&M(A,P.startTime-$)}}var R=!1,O=-1,I=5,k=-1;function N(){return v?!0:!(e.unstable_now()-k<I)}function j(){if(v=!1,R){var $=e.unstable_now();k=$;var P=!0;try{e:{C=!1,x&&(x=!1,w(O),O=-1),y=!0;var H=g;try{t:{for(q($),d=r(h);d!==null&&!(d.expirationTime>$&&N());){var G=d.callback;if(typeof G=="function"){d.callback=null,g=d.priorityLevel;var V=G(d.expirationTime<=$);if($=e.unstable_now(),typeof V=="function"){d.callback=V,q($),P=!0;break t}d===r(h)&&s(h),q($)}else s(h);d=r(h)}if(d!==null)P=!0;else{var B=r(f);B!==null&&M(A,B.startTime-$),P=!1}}break e}finally{d=null,g=H,y=!1}P=void 0}}finally{P?D():R=!1}}}var D;if(typeof E=="function")D=function(){E(j)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,T=z.port2;z.port1.onmessage=j,D=function(){T.postMessage(null)}}else D=function(){b(j,0)};function M($,P){O=b(function(){$(e.unstable_now())},P)}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_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"):I=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function($){switch(g){case 1:case 2:case 3:var P=3;break;default:P=g}var H=g;g=P;try{return $()}finally{g=H}},e.unstable_requestPaint=function(){v=!0},e.unstable_runWithPriority=function($,P){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var H=g;g=$;try{return P()}finally{g=H}},e.unstable_scheduleCallback=function($,P,H){var G=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?G+H:G):H=G,$){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=H+V,$={id:p++,callback:P,priorityLevel:$,startTime:H,expirationTime:V,sortIndex:-1},H>G?($.sortIndex=H,n(f,$),r(h)===null&&$===r(f)&&(x?(w(O),O=-1):x=!0,M(A,H-G))):($.sortIndex=V,n(h,$),C||y||(C=!0,R||(R=!0,D()))),$},e.unstable_shouldYield=N,e.unstable_wrapCallback=function($){var P=g;return function(){var H=g;g=P;try{return $.apply(this,arguments)}finally{g=H}}}})(Yp)),Yp}var uq;function Rz(){return uq||(uq=1,Kp.exports=Nz()),Kp.exports}var Xp={exports:{}},Kt={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var lq;function Oz(){if(lq)return Kt;lq=1;var e=al();function n(h){var f="https://react.dev/errors/"+h;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+h+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var s={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for("react.portal");function o(h,f,p){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:d==null?null:""+d,children:h,containerInfo:f,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(h,f){if(h==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Kt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Kt.createPortal=function(h,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(n(299));return o(h,f,null,p)},Kt.flushSync=function(h){var f=l.T,p=s.p;try{if(l.T=null,s.p=2,h)return h()}finally{l.T=f,s.p=p,s.d.f()}},Kt.preconnect=function(h,f){typeof h=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,s.d.C(h,f))},Kt.prefetchDNS=function(h){typeof h=="string"&&s.d.D(h)},Kt.preinit=function(h,f){if(typeof h=="string"&&f&&typeof f.as=="string"){var p=f.as,d=u(p,f.crossOrigin),g=typeof f.integrity=="string"?f.integrity:void 0,y=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?s.d.S(h,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:d,integrity:g,fetchPriority:y}):p==="script"&&s.d.X(h,{crossOrigin:d,integrity:g,fetchPriority:y,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Kt.preinitModule=function(h,f){if(typeof h=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=u(f.as,f.crossOrigin);s.d.M(h,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&s.d.M(h)},Kt.preload=function(h,f){if(typeof h=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,d=u(p,f.crossOrigin);s.d.L(h,p,{crossOrigin:d,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Kt.preloadModule=function(h,f){if(typeof h=="string")if(f){var p=u(f.as,f.crossOrigin);s.d.m(h,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else s.d.m(h)},Kt.requestFormReset=function(h){s.d.r(h)},Kt.unstable_batchedUpdates=function(h,f){return h(f)},Kt.useFormState=function(h,f,p){return l.H.useFormState(h,f,p)},Kt.useFormStatus=function(){return l.H.useHostTransitionStatus()},Kt.version="19.2.4",Kt}var cq;function xI(){if(cq)return Xp.exports;cq=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Xp.exports=Oz(),Xp.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var fq;function Mz(){if(fq)return Tu;fq=1;var e=Rz(),n=al(),r=xI();function s(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)i+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+t+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function o(t){var i=t,c=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(c=i.return),t=i.return;while(t)}return i.tag===3?c:null}function l(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function u(t){if(t.tag===31){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function h(t){if(o(t)!==t)throw Error(s(188))}function f(t){var i=t.alternate;if(!i){if(i=o(t),i===null)throw Error(s(188));return i!==t?null:t}for(var c=t,m=i;;){var _=c.return;if(_===null)break;var S=_.alternate;if(S===null){if(m=_.return,m!==null){c=m;continue}break}if(_.child===S.child){for(S=_.child;S;){if(S===c)return h(_),t;if(S===m)return h(_),i;S=S.sibling}throw Error(s(188))}if(c.return!==m.return)c=_,m=S;else{for(var L=!1,U=_.child;U;){if(U===c){L=!0,c=_,m=S;break}if(U===m){L=!0,m=_,c=S;break}U=U.sibling}if(!L){for(U=S.child;U;){if(U===c){L=!0,c=S,m=_;break}if(U===m){L=!0,m=S,c=_;break}U=U.sibling}if(!L)throw Error(s(189))}}if(c.alternate!==m)throw Error(s(190))}if(c.tag!==3)throw Error(s(188));return c.stateNode.current===c?t:i}function p(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=p(t),i!==null)return i;t=t.sibling}return null}var d=Object.assign,g=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),E=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),k=Symbol.for("react.activity"),N=Symbol.for("react.memo_cache_sentinel"),j=Symbol.iterator;function D(t){return t===null||typeof t!="object"?null:(t=j&&t[j]||t["@@iterator"],typeof t=="function"?t:null)}var z=Symbol.for("react.client.reference");function T(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===z?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case x:return"Fragment";case b:return"Profiler";case v:return"StrictMode";case A:return"Suspense";case R:return"SuspenseList";case k:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case C:return"Portal";case E:return t.displayName||"Context";case w:return(t._context.displayName||"Context")+".Consumer";case q:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case O:return i=t.displayName||null,i!==null?i:T(t.type)||"Memo";case I:i=t._payload,t=t._init;try{return T(t(i))}catch{}}return null}var M=Array.isArray,$=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},G=[],V=-1;function B(t){return{current:t}}function K(t){0>V||(t.current=G[V],G[V]=null,V--)}function te(t,i){V++,G[V]=t.current,t.current=i}var Q=B(null),J=B(null),ie=B(null),oe=B(null);function ee(t,i){switch(te(ie,i),te(J,t),te(Q,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?ST(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=ST(i),t=TT(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}K(Q),te(Q,t)}function fe(){K(Q),K(J),K(ie)}function be(t){t.memoizedState!==null&&te(oe,t);var i=Q.current,c=TT(i,t.type);i!==c&&(te(J,t),te(Q,c))}function ve(t){J.current===t&&(K(Q),K(J)),oe.current===t&&(K(oe),wu._currentValue=H)}var _e,we;function W(t){if(_e===void 0)try{throw Error()}catch(c){var i=c.stack.trim().match(/\n( *(at )?)/);_e=i&&i[1]||"",we=-1<c.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+_e+t+we}var ae=!1;function xe(t,i){if(!t||ae)return"";ae=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(i){var ge=function(){throw Error()};if(Object.defineProperty(ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(he){var ce=he}Reflect.construct(t,[],ge)}else{try{ge.call()}catch(he){ce=he}t.call(ge.prototype)}}else{try{throw Error()}catch(he){ce=he}(ge=t())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(he){if(he&&ce&&typeof he.stack=="string")return[he.stack,ce.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var _=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");_&&_.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=m.DetermineComponentFrameRoot(),L=S[0],U=S[1];if(L&&U){var Z=L.split(`
44
+ `),le=U.split(`
45
+ `);for(_=m=0;m<Z.length&&!Z[m].includes("DetermineComponentFrameRoot");)m++;for(;_<le.length&&!le[_].includes("DetermineComponentFrameRoot");)_++;if(m===Z.length||_===le.length)for(m=Z.length-1,_=le.length-1;1<=m&&0<=_&&Z[m]!==le[_];)_--;for(;1<=m&&0<=_;m--,_--)if(Z[m]!==le[_]){if(m!==1||_!==1)do if(m--,_--,0>_||Z[m]!==le[_]){var pe=`
46
+ `+Z[m].replace(" at new "," at ");return t.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",t.displayName)),pe}while(1<=m&&0<=_);break}}}finally{ae=!1,Error.prepareStackTrace=c}return(c=t?t.displayName||t.name:"")?W(c):""}function Se(t,i){switch(t.tag){case 26:case 27:case 5:return W(t.type);case 16:return W("Lazy");case 13:return t.child!==i&&i!==null?W("Suspense Fallback"):W("Suspense");case 19:return W("SuspenseList");case 0:case 15:return xe(t.type,!1);case 11:return xe(t.type.render,!1);case 1:return xe(t.type,!0);case 31:return W("Activity");default:return""}}function gt(t){try{var i="",c=null;do i+=Se(t,c),c=t,t=t.return;while(t);return i}catch(m){return`
47
+ Error generating stack: `+m.message+`
48
+ `+m.stack}}var ut=Object.prototype.hasOwnProperty,It=e.unstable_scheduleCallback,Tt=e.unstable_cancelCallback,qt=e.unstable_shouldYield,Ge=e.unstable_requestPaint,Oe=e.unstable_now,We=e.unstable_getCurrentPriorityLevel,Je=e.unstable_ImmediatePriority,rt=e.unstable_UserBlockingPriority,de=e.unstable_NormalPriority,X=e.unstable_LowPriority,Me=e.unstable_IdlePriority,Oo=e.log,ia=e.unstable_setDisableYieldValue,Ft=null,yt=null;function ar(t){if(typeof Oo=="function"&&ia(t),yt&&typeof yt.setStrictMode=="function")try{yt.setStrictMode(Ft,t)}catch{}}var Wt=Math.clz32?Math.clz32:Mh,Rh=Math.log,Oh=Math.LN2;function Mh(t){return t>>>=0,t===0?32:31-(Rh(t)/Oh|0)|0}var sa=256,aa=262144,oa=4194304;function Er(t){var i=t&42;if(i!==0)return i;switch(t&-t){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:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function ua(t,i,c){var m=t.pendingLanes;if(m===0)return 0;var _=0,S=t.suspendedLanes,L=t.pingedLanes;t=t.warmLanes;var U=m&134217727;return U!==0?(m=U&~S,m!==0?_=Er(m):(L&=U,L!==0?_=Er(L):c||(c=U&~t,c!==0&&(_=Er(c))))):(U=m&~S,U!==0?_=Er(U):L!==0?_=Er(L):c||(c=m&~t,c!==0&&(_=Er(c)))),_===0?0:i!==0&&i!==_&&(i&S)===0&&(S=_&-_,c=i&-i,S>=c||S===32&&(c&4194048)!==0)?i:_}function Zi(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function jh(t,i){switch(t){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32: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 i+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 ql(){var t=oa;return oa<<=1,(oa&62914560)===0&&(oa=4194304),t}function Mo(t){for(var i=[],c=0;31>c;c++)i.push(t);return i}function es(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function $h(t,i,c,m,_,S){var L=t.pendingLanes;t.pendingLanes=c,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=c,t.entangledLanes&=c,t.errorRecoveryDisabledLanes&=c,t.shellSuspendCounter=0;var U=t.entanglements,Z=t.expirationTimes,le=t.hiddenUpdates;for(c=L&~c;0<c;){var pe=31-Wt(c),ge=1<<pe;U[pe]=0,Z[pe]=-1;var ce=le[pe];if(ce!==null)for(le[pe]=null,pe=0;pe<ce.length;pe++){var he=ce[pe];he!==null&&(he.lane&=-536870913)}c&=~ge}m!==0&&Al(t,m,0),S!==0&&_===0&&t.tag!==0&&(t.suspendedLanes|=S&~(L&~i))}function Al(t,i,c){t.pendingLanes|=i,t.suspendedLanes&=~i;var m=31-Wt(i);t.entangledLanes|=i,t.entanglements[m]=t.entanglements[m]|1073741824|c&261930}function Nl(t,i){var c=t.entangledLanes|=i;for(t=t.entanglements;c;){var m=31-Wt(c),_=1<<m;_&i|t[m]&i&&(t[m]|=i),c&=~_}}function Rl(t,i){var c=i&-i;return c=(c&42)!==0?1:jo(c),(c&(t.suspendedLanes|i))!==0?0:c}function jo(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function $o(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Ol(){var t=P.p;return t!==0?t:(t=window.event,t===void 0?32:YT(t.type))}function Ml(t,i){var c=P.p;try{return P.p=t,i()}finally{P.p=c}}var or=Math.random().toString(36).slice(2),$t="__reactFiber$"+or,Gt="__reactProps$"+or,xr="__reactContainer$"+or,la="__reactEvents$"+or,jl="__reactListeners$"+or,Lh="__reactHandles$"+or,$l="__reactResources$"+or,ts="__reactMarker$"+or;function Lo(t){delete t[$t],delete t[Gt],delete t[la],delete t[jl],delete t[Lh]}function ri(t){var i=t[$t];if(i)return i;for(var c=t.parentNode;c;){if(i=c[xr]||c[$t]){if(c=i.alternate,i.child!==null||c!==null&&c.child!==null)for(t=jT(t);t!==null;){if(c=t[$t])return c;t=jT(t)}return i}t=c,c=t.parentNode}return null}function ii(t){if(t=t[$t]||t[xr]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function si(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(s(33))}function ai(t){var i=t[$l];return i||(i=t[$l]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function At(t){t[ts]=!0}var Ll=new Set,Il={};function Sr(t,i){oi(t,i),oi(t+"Capture",i)}function oi(t,i){for(Il[t]=i,t=0;t<i.length;t++)Ll.add(i[t])}var Ih=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]*$"),Io={},Dl={};function Dh(t){return ut.call(Dl,t)?!0:ut.call(Io,t)?!1:Ih.test(t)?Dl[t]=!0:(Io[t]=!0,!1)}function ca(t,i,c){if(Dh(i))if(c===null)t.removeAttribute(i);else{switch(typeof c){case"undefined":case"function":case"symbol":t.removeAttribute(i);return;case"boolean":var m=i.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){t.removeAttribute(i);return}}t.setAttribute(i,""+c)}}function fa(t,i,c){if(c===null)t.removeAttribute(i);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+c)}}function zn(t,i,c,m){if(m===null)t.removeAttribute(c);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(c);return}t.setAttributeNS(i,c,""+m)}}function nn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function kl(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function kh(t,i,c){var m=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);if(!t.hasOwnProperty(i)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var _=m.get,S=m.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return _.call(this)},set:function(L){c=""+L,S.call(this,L)}}),Object.defineProperty(t,i,{enumerable:m.enumerable}),{getValue:function(){return c},setValue:function(L){c=""+L},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function ui(t){if(!t._valueTracker){var i=kl(t)?"checked":"value";t._valueTracker=kh(t,i,""+t[i])}}function Bl(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var c=i.getValue(),m="";return t&&(m=kl(t)?t.checked?"true":"false":t.value),t=m,t!==c?(i.setValue(t),!0):!1}function ns(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Bh=/[\n"\\]/g;function rn(t){return t.replace(Bh,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function rs(t,i,c,m,_,S,L,U){t.name="",L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?t.type=L:t.removeAttribute("type"),i!=null?L==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+nn(i)):t.value!==""+nn(i)&&(t.value=""+nn(i)):L!=="submit"&&L!=="reset"||t.removeAttribute("value"),i!=null?Do(t,L,nn(i)):c!=null?Do(t,L,nn(c)):m!=null&&t.removeAttribute("value"),_==null&&S!=null&&(t.defaultChecked=!!S),_!=null&&(t.checked=_&&typeof _!="function"&&typeof _!="symbol"),U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?t.name=""+nn(U):t.removeAttribute("name")}function Pl(t,i,c,m,_,S,L,U){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(t.type=S),i!=null||c!=null){if(!(S!=="submit"&&S!=="reset"||i!=null)){ui(t);return}c=c!=null?""+nn(c):"",i=i!=null?""+nn(i):c,U||i===t.value||(t.value=i),t.defaultValue=i}m=m??_,m=typeof m!="function"&&typeof m!="symbol"&&!!m,t.checked=U?t.checked:!!m,t.defaultChecked=!!m,L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"&&(t.name=L),ui(t)}function Do(t,i,c){i==="number"&&ns(t.ownerDocument)===t||t.defaultValue===""+c||(t.defaultValue=""+c)}function Tr(t,i,c,m){if(t=t.options,i){i={};for(var _=0;_<c.length;_++)i["$"+c[_]]=!0;for(c=0;c<t.length;c++)_=i.hasOwnProperty("$"+t[c].value),t[c].selected!==_&&(t[c].selected=_),_&&m&&(t[c].defaultSelected=!0)}else{for(c=""+nn(c),i=null,_=0;_<t.length;_++){if(t[_].value===c){t[_].selected=!0,m&&(t[_].defaultSelected=!0);return}i!==null||t[_].disabled||(i=t[_])}i!==null&&(i.selected=!0)}}function _x(t,i,c){if(i!=null&&(i=""+nn(i),i!==t.value&&(t.value=i),c==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=c!=null?""+nn(c):""}function wx(t,i,c,m){if(i==null){if(m!=null){if(c!=null)throw Error(s(92));if(M(m)){if(1<m.length)throw Error(s(93));m=m[0]}c=m}c==null&&(c=""),i=c}c=nn(i),t.defaultValue=c,m=t.textContent,m===c&&m!==""&&m!==null&&(t.value=m),ui(t)}function ha(t,i){if(i){var c=t.firstChild;if(c&&c===t.lastChild&&c.nodeType===3){c.nodeValue=i;return}}t.textContent=i}var vP=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Cx(t,i,c){var m=i.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?m?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":m?t.setProperty(i,c):typeof c!="number"||c===0||vP.has(i)?i==="float"?t.cssFloat=c:t[i]=(""+c).trim():t[i]=c+"px"}function Ex(t,i,c){if(i!=null&&typeof i!="object")throw Error(s(62));if(t=t.style,c!=null){for(var m in c)!c.hasOwnProperty(m)||i!=null&&i.hasOwnProperty(m)||(m.indexOf("--")===0?t.setProperty(m,""):m==="float"?t.cssFloat="":t[m]="");for(var _ in i)m=i[_],i.hasOwnProperty(_)&&c[_]!==m&&Cx(t,_,m)}else for(var S in i)i.hasOwnProperty(S)&&Cx(t,S,i[S])}function Ph(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var bP=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["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"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["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"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["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"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),_P=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function zl(t){return _P.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function qr(){}var zh=null;function Uh(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var da=null,pa=null;function xx(t){var i=ii(t);if(i&&(t=i.stateNode)){var c=t[Gt]||null;e:switch(t=i.stateNode,i.type){case"input":if(rs(t,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),i=c.name,c.type==="radio"&&i!=null){for(c=t;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+rn(""+i)+'"][type="radio"]'),i=0;i<c.length;i++){var m=c[i];if(m!==t&&m.form===t.form){var _=m[Gt]||null;if(!_)throw Error(s(90));rs(m,_.value,_.defaultValue,_.defaultValue,_.checked,_.defaultChecked,_.type,_.name)}}for(i=0;i<c.length;i++)m=c[i],m.form===t.form&&Bl(m)}break e;case"textarea":_x(t,c.value,c.defaultValue);break e;case"select":i=c.value,i!=null&&Tr(t,!!c.multiple,i,!1)}}}var Qh=!1;function Sx(t,i,c){if(Qh)return t(i,c);Qh=!0;try{var m=t(i);return m}finally{if(Qh=!1,(da!==null||pa!==null)&&(Ac(),da&&(i=da,t=pa,pa=da=null,xx(i),t)))for(i=0;i<t.length;i++)xx(t[i])}}function ko(t,i){var c=t.stateNode;if(c===null)return null;var m=c[Gt]||null;if(m===null)return null;c=m[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(t=t.type,m=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!m;break e;default:t=!1}if(t)return null;if(c&&typeof c!="function")throw Error(s(231,i,typeof c));return c}var Ar=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hh=!1;if(Ar)try{var Bo={};Object.defineProperty(Bo,"passive",{get:function(){Hh=!0}}),window.addEventListener("test",Bo,Bo),window.removeEventListener("test",Bo,Bo)}catch{Hh=!1}var li=null,Vh=null,Ul=null;function Tx(){if(Ul)return Ul;var t,i=Vh,c=i.length,m,_="value"in li?li.value:li.textContent,S=_.length;for(t=0;t<c&&i[t]===_[t];t++);var L=c-t;for(m=1;m<=L&&i[c-m]===_[S-m];m++);return Ul=_.slice(t,1<m?1-m:void 0)}function Ql(t){var i=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&i===13&&(t=13)):t=i,t===10&&(t=13),32<=t||t===13?t:0}function Hl(){return!0}function qx(){return!1}function sn(t){function i(c,m,_,S,L){this._reactName=c,this._targetInst=_,this.type=m,this.nativeEvent=S,this.target=L,this.currentTarget=null;for(var U in t)t.hasOwnProperty(U)&&(c=t[U],this[U]=c?c(S):S[U]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?Hl:qx,this.isPropagationStopped=qx,this}return d(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=Hl)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Hl)},persist:function(){},isPersistent:Hl}),i}var is={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vl=sn(is),Po=d({},is,{view:0,detail:0}),wP=sn(Po),Fh,Gh,zo,Fl=d({},Po,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yh,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==zo&&(zo&&t.type==="mousemove"?(Fh=t.screenX-zo.screenX,Gh=t.screenY-zo.screenY):Gh=Fh=0,zo=t),Fh)},movementY:function(t){return"movementY"in t?t.movementY:Gh}}),Ax=sn(Fl),CP=d({},Fl,{dataTransfer:0}),EP=sn(CP),xP=d({},Po,{relatedTarget:0}),Kh=sn(xP),SP=d({},is,{animationName:0,elapsedTime:0,pseudoElement:0}),TP=sn(SP),qP=d({},is,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),AP=sn(qP),NP=d({},is,{data:0}),Nx=sn(NP),RP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},OP={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},MP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jP(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=MP[t])?!!i[t]:!1}function Yh(){return jP}var $P=d({},Po,{key:function(t){if(t.key){var i=RP[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=Ql(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?OP[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yh,charCode:function(t){return t.type==="keypress"?Ql(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Ql(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),LP=sn($P),IP=d({},Fl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rx=sn(IP),DP=d({},Po,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yh}),kP=sn(DP),BP=d({},is,{propertyName:0,elapsedTime:0,pseudoElement:0}),PP=sn(BP),zP=d({},Fl,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),UP=sn(zP),QP=d({},is,{newState:0,oldState:0}),HP=sn(QP),VP=[9,13,27,32],Xh=Ar&&"CompositionEvent"in window,Uo=null;Ar&&"documentMode"in document&&(Uo=document.documentMode);var FP=Ar&&"TextEvent"in window&&!Uo,Ox=Ar&&(!Xh||Uo&&8<Uo&&11>=Uo),Mx=" ",jx=!1;function $x(t,i){switch(t){case"keyup":return VP.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lx(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ma=!1;function GP(t,i){switch(t){case"compositionend":return Lx(i);case"keypress":return i.which!==32?null:(jx=!0,Mx);case"textInput":return t=i.data,t===Mx&&jx?null:t;default:return null}}function KP(t,i){if(ma)return t==="compositionend"||!Xh&&$x(t,i)?(t=Tx(),Ul=Vh=li=null,ma=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Ox&&i.locale!=="ko"?null:i.data;default:return null}}var YP={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ix(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!YP[t.type]:i==="textarea"}function Dx(t,i,c,m){da?pa?pa.push(m):pa=[m]:da=m,i=Lc(i,"onChange"),0<i.length&&(c=new Vl("onChange","change",null,c,m),t.push({event:c,listeners:i}))}var Qo=null,Ho=null;function XP(t){bT(t,0)}function Gl(t){var i=si(t);if(Bl(i))return t}function kx(t,i){if(t==="change")return i}var Bx=!1;if(Ar){var Wh;if(Ar){var Jh="oninput"in document;if(!Jh){var Px=document.createElement("div");Px.setAttribute("oninput","return;"),Jh=typeof Px.oninput=="function"}Wh=Jh}else Wh=!1;Bx=Wh&&(!document.documentMode||9<document.documentMode)}function zx(){Qo&&(Qo.detachEvent("onpropertychange",Ux),Ho=Qo=null)}function Ux(t){if(t.propertyName==="value"&&Gl(Ho)){var i=[];Dx(i,Ho,t,Uh(t)),Sx(XP,i)}}function WP(t,i,c){t==="focusin"?(zx(),Qo=i,Ho=c,Qo.attachEvent("onpropertychange",Ux)):t==="focusout"&&zx()}function JP(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Gl(Ho)}function ZP(t,i){if(t==="click")return Gl(i)}function e3(t,i){if(t==="input"||t==="change")return Gl(i)}function t3(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var gn=typeof Object.is=="function"?Object.is:t3;function Vo(t,i){if(gn(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var c=Object.keys(t),m=Object.keys(i);if(c.length!==m.length)return!1;for(m=0;m<c.length;m++){var _=c[m];if(!ut.call(i,_)||!gn(t[_],i[_]))return!1}return!0}function Qx(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Hx(t,i){var c=Qx(t);t=0;for(var m;c;){if(c.nodeType===3){if(m=t+c.textContent.length,t<=i&&m>=i)return{node:c,offset:i-t};t=m}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Qx(c)}}function Vx(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?Vx(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function Fx(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=ns(t.document);i instanceof t.HTMLIFrameElement;){try{var c=typeof i.contentWindow.location.href=="string"}catch{c=!1}if(c)t=i.contentWindow;else break;i=ns(t.document)}return i}function Zh(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i&&(i==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||i==="textarea"||t.contentEditable==="true")}var n3=Ar&&"documentMode"in document&&11>=document.documentMode,ga=null,ed=null,Fo=null,td=!1;function Gx(t,i,c){var m=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;td||ga==null||ga!==ns(m)||(m=ga,"selectionStart"in m&&Zh(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Fo&&Vo(Fo,m)||(Fo=m,m=Lc(ed,"onSelect"),0<m.length&&(i=new Vl("onSelect","select",null,i,c),t.push({event:i,listeners:m}),i.target=ga)))}function ss(t,i){var c={};return c[t.toLowerCase()]=i.toLowerCase(),c["Webkit"+t]="webkit"+i,c["Moz"+t]="moz"+i,c}var ya={animationend:ss("Animation","AnimationEnd"),animationiteration:ss("Animation","AnimationIteration"),animationstart:ss("Animation","AnimationStart"),transitionrun:ss("Transition","TransitionRun"),transitionstart:ss("Transition","TransitionStart"),transitioncancel:ss("Transition","TransitionCancel"),transitionend:ss("Transition","TransitionEnd")},nd={},Kx={};Ar&&(Kx=document.createElement("div").style,"AnimationEvent"in window||(delete ya.animationend.animation,delete ya.animationiteration.animation,delete ya.animationstart.animation),"TransitionEvent"in window||delete ya.transitionend.transition);function as(t){if(nd[t])return nd[t];if(!ya[t])return t;var i=ya[t],c;for(c in i)if(i.hasOwnProperty(c)&&c in Kx)return nd[t]=i[c];return t}var Yx=as("animationend"),Xx=as("animationiteration"),Wx=as("animationstart"),r3=as("transitionrun"),i3=as("transitionstart"),s3=as("transitioncancel"),Jx=as("transitionend"),Zx=new Map,rd="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");rd.push("scrollEnd");function Un(t,i){Zx.set(t,i),Sr(i,[t])}var Kl=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},An=[],va=0,id=0;function Yl(){for(var t=va,i=id=va=0;i<t;){var c=An[i];An[i++]=null;var m=An[i];An[i++]=null;var _=An[i];An[i++]=null;var S=An[i];if(An[i++]=null,m!==null&&_!==null){var L=m.pending;L===null?_.next=_:(_.next=L.next,L.next=_),m.pending=_}S!==0&&e1(c,_,S)}}function Xl(t,i,c,m){An[va++]=t,An[va++]=i,An[va++]=c,An[va++]=m,id|=m,t.lanes|=m,t=t.alternate,t!==null&&(t.lanes|=m)}function sd(t,i,c,m){return Xl(t,i,c,m),Wl(t)}function os(t,i){return Xl(t,null,null,i),Wl(t)}function e1(t,i,c){t.lanes|=c;var m=t.alternate;m!==null&&(m.lanes|=c);for(var _=!1,S=t.return;S!==null;)S.childLanes|=c,m=S.alternate,m!==null&&(m.childLanes|=c),S.tag===22&&(t=S.stateNode,t===null||t._visibility&1||(_=!0)),t=S,S=S.return;return t.tag===3?(S=t.stateNode,_&&i!==null&&(_=31-Wt(c),t=S.hiddenUpdates,m=t[_],m===null?t[_]=[i]:m.push(i),i.lane=c|536870912),S):null}function Wl(t){if(50<pu)throw pu=0,pp=null,Error(s(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var ba={};function a3(t,i,c,m){this.tag=t,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yn(t,i,c,m){return new a3(t,i,c,m)}function ad(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Nr(t,i){var c=t.alternate;return c===null?(c=yn(t.tag,i,t.key,t.mode),c.elementType=t.elementType,c.type=t.type,c.stateNode=t.stateNode,c.alternate=t,t.alternate=c):(c.pendingProps=i,c.type=t.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=t.flags&65011712,c.childLanes=t.childLanes,c.lanes=t.lanes,c.child=t.child,c.memoizedProps=t.memoizedProps,c.memoizedState=t.memoizedState,c.updateQueue=t.updateQueue,i=t.dependencies,c.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},c.sibling=t.sibling,c.index=t.index,c.ref=t.ref,c.refCleanup=t.refCleanup,c}function t1(t,i){t.flags&=65011714;var c=t.alternate;return c===null?(t.childLanes=0,t.lanes=i,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=c.childLanes,t.lanes=c.lanes,t.child=c.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=c.memoizedProps,t.memoizedState=c.memoizedState,t.updateQueue=c.updateQueue,t.type=c.type,i=c.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function Jl(t,i,c,m,_,S){var L=0;if(m=t,typeof t=="function")ad(t)&&(L=1);else if(typeof t=="string")L=fz(t,c,Q.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case k:return t=yn(31,c,i,_),t.elementType=k,t.lanes=S,t;case x:return us(c.children,_,S,i);case v:L=8,_|=24;break;case b:return t=yn(12,c,i,_|2),t.elementType=b,t.lanes=S,t;case A:return t=yn(13,c,i,_),t.elementType=A,t.lanes=S,t;case R:return t=yn(19,c,i,_),t.elementType=R,t.lanes=S,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case E:L=10;break e;case w:L=9;break e;case q:L=11;break e;case O:L=14;break e;case I:L=16,m=null;break e}L=29,c=Error(s(130,t===null?"null":typeof t,"")),m=null}return i=yn(L,c,i,_),i.elementType=t,i.type=m,i.lanes=S,i}function us(t,i,c,m){return t=yn(7,t,m,i),t.lanes=c,t}function od(t,i,c){return t=yn(6,t,null,i),t.lanes=c,t}function n1(t){var i=yn(18,null,null,0);return i.stateNode=t,i}function ud(t,i,c){return i=yn(4,t.children!==null?t.children:[],t.key,i),i.lanes=c,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var r1=new WeakMap;function Nn(t,i){if(typeof t=="object"&&t!==null){var c=r1.get(t);return c!==void 0?c:(i={value:t,source:i,stack:gt(i)},r1.set(t,i),i)}return{value:t,source:i,stack:gt(i)}}var _a=[],wa=0,Zl=null,Go=0,Rn=[],On=0,ci=null,ur=1,lr="";function Rr(t,i){_a[wa++]=Go,_a[wa++]=Zl,Zl=t,Go=i}function i1(t,i,c){Rn[On++]=ur,Rn[On++]=lr,Rn[On++]=ci,ci=t;var m=ur;t=lr;var _=32-Wt(m)-1;m&=~(1<<_),c+=1;var S=32-Wt(i)+_;if(30<S){var L=_-_%5;S=(m&(1<<L)-1).toString(32),m>>=L,_-=L,ur=1<<32-Wt(i)+_|c<<_|m,lr=S+t}else ur=1<<S|c<<_|m,lr=t}function ld(t){t.return!==null&&(Rr(t,1),i1(t,1,0))}function cd(t){for(;t===Zl;)Zl=_a[--wa],_a[wa]=null,Go=_a[--wa],_a[wa]=null;for(;t===ci;)ci=Rn[--On],Rn[On]=null,lr=Rn[--On],Rn[On]=null,ur=Rn[--On],Rn[On]=null}function s1(t,i){Rn[On++]=ur,Rn[On++]=lr,Rn[On++]=ci,ur=i.id,lr=i.overflow,ci=t}var Bt=null,lt=null,He=!1,fi=null,Mn=!1,fd=Error(s(519));function hi(t){var i=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ko(Nn(i,t)),fd}function a1(t){var i=t.stateNode,c=t.type,m=t.memoizedProps;switch(i[$t]=t,i[Gt]=m,c){case"dialog":Pe("cancel",i),Pe("close",i);break;case"iframe":case"object":case"embed":Pe("load",i);break;case"video":case"audio":for(c=0;c<gu.length;c++)Pe(gu[c],i);break;case"source":Pe("error",i);break;case"img":case"image":case"link":Pe("error",i),Pe("load",i);break;case"details":Pe("toggle",i);break;case"input":Pe("invalid",i),Pl(i,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Pe("invalid",i);break;case"textarea":Pe("invalid",i),wx(i,m.value,m.defaultValue,m.children)}c=m.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||i.textContent===""+c||m.suppressHydrationWarning===!0||ET(i.textContent,c)?(m.popover!=null&&(Pe("beforetoggle",i),Pe("toggle",i)),m.onScroll!=null&&Pe("scroll",i),m.onScrollEnd!=null&&Pe("scrollend",i),m.onClick!=null&&(i.onclick=qr),i=!0):i=!1,i||hi(t,!0)}function o1(t){for(Bt=t.return;Bt;)switch(Bt.tag){case 5:case 31:case 13:Mn=!1;return;case 27:case 3:Mn=!0;return;default:Bt=Bt.return}}function Ca(t){if(t!==Bt)return!1;if(!He)return o1(t),He=!0,!1;var i=t.tag,c;if((c=i!==3&&i!==27)&&((c=i===5)&&(c=t.type,c=!(c!=="form"&&c!=="button")||Np(t.type,t.memoizedProps)),c=!c),c&&lt&&hi(t),o1(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));lt=MT(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));lt=MT(t)}else i===27?(i=lt,Ti(t.type)?(t=$p,$p=null,lt=t):lt=i):lt=Bt?$n(t.stateNode.nextSibling):null;return!0}function ls(){lt=Bt=null,He=!1}function hd(){var t=fi;return t!==null&&(ln===null?ln=t:ln.push.apply(ln,t),fi=null),t}function Ko(t){fi===null?fi=[t]:fi.push(t)}var dd=B(null),cs=null,Or=null;function di(t,i,c){te(dd,i._currentValue),i._currentValue=c}function Mr(t){t._currentValue=dd.current,K(dd)}function pd(t,i,c){for(;t!==null;){var m=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,m!==null&&(m.childLanes|=i)):m!==null&&(m.childLanes&i)!==i&&(m.childLanes|=i),t===c)break;t=t.return}}function md(t,i,c,m){var _=t.child;for(_!==null&&(_.return=t);_!==null;){var S=_.dependencies;if(S!==null){var L=_.child;S=S.firstContext;e:for(;S!==null;){var U=S;S=_;for(var Z=0;Z<i.length;Z++)if(U.context===i[Z]){S.lanes|=c,U=S.alternate,U!==null&&(U.lanes|=c),pd(S.return,c,t),m||(L=null);break e}S=U.next}}else if(_.tag===18){if(L=_.return,L===null)throw Error(s(341));L.lanes|=c,S=L.alternate,S!==null&&(S.lanes|=c),pd(L,c,t),L=null}else L=_.child;if(L!==null)L.return=_;else for(L=_;L!==null;){if(L===t){L=null;break}if(_=L.sibling,_!==null){_.return=L.return,L=_;break}L=L.return}_=L}}function Ea(t,i,c,m){t=null;for(var _=i,S=!1;_!==null;){if(!S){if((_.flags&524288)!==0)S=!0;else if((_.flags&262144)!==0)break}if(_.tag===10){var L=_.alternate;if(L===null)throw Error(s(387));if(L=L.memoizedProps,L!==null){var U=_.type;gn(_.pendingProps.value,L.value)||(t!==null?t.push(U):t=[U])}}else if(_===oe.current){if(L=_.alternate,L===null)throw Error(s(387));L.memoizedState.memoizedState!==_.memoizedState.memoizedState&&(t!==null?t.push(wu):t=[wu])}_=_.return}t!==null&&md(i,t,c,m),i.flags|=262144}function ec(t){for(t=t.firstContext;t!==null;){if(!gn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function fs(t){cs=t,Or=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Pt(t){return u1(cs,t)}function tc(t,i){return cs===null&&fs(t),u1(t,i)}function u1(t,i){var c=i._currentValue;if(i={context:i,memoizedValue:c,next:null},Or===null){if(t===null)throw Error(s(308));Or=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else Or=Or.next=i;return c}var o3=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(c,m){t.push(m)}};this.abort=function(){i.aborted=!0,t.forEach(function(c){return c()})}},u3=e.unstable_scheduleCallback,l3=e.unstable_NormalPriority,Nt={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function gd(){return{controller:new o3,data:new Map,refCount:0}}function Yo(t){t.refCount--,t.refCount===0&&u3(l3,function(){t.controller.abort()})}var Xo=null,yd=0,xa=0,Sa=null;function c3(t,i){if(Xo===null){var c=Xo=[];yd=0,xa=_p(),Sa={status:"pending",value:void 0,then:function(m){c.push(m)}}}return yd++,i.then(l1,l1),i}function l1(){if(--yd===0&&Xo!==null){Sa!==null&&(Sa.status="fulfilled");var t=Xo;Xo=null,xa=0,Sa=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function f3(t,i){var c=[],m={status:"pending",value:null,reason:null,then:function(_){c.push(_)}};return t.then(function(){m.status="fulfilled",m.value=i;for(var _=0;_<c.length;_++)(0,c[_])(i)},function(_){for(m.status="rejected",m.reason=_,_=0;_<c.length;_++)(0,c[_])(void 0)}),m}var c1=$.S;$.S=function(t,i){GS=Oe(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&c3(t,i),c1!==null&&c1(t,i)};var hs=B(null);function vd(){var t=hs.current;return t!==null?t:ot.pooledCache}function nc(t,i){i===null?te(hs,hs.current):te(hs,i.pool)}function f1(){var t=vd();return t===null?null:{parent:Nt._currentValue,pool:t}}var Ta=Error(s(460)),bd=Error(s(474)),rc=Error(s(542)),ic={then:function(){}};function h1(t){return t=t.status,t==="fulfilled"||t==="rejected"}function d1(t,i,c){switch(c=t[c],c===void 0?t.push(i):c!==i&&(i.then(qr,qr),i=c),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,m1(t),t;default:if(typeof i.status=="string")i.then(qr,qr);else{if(t=ot,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=i,t.status="pending",t.then(function(m){if(i.status==="pending"){var _=i;_.status="fulfilled",_.value=m}},function(m){if(i.status==="pending"){var _=i;_.status="rejected",_.reason=m}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,m1(t),t}throw ps=i,Ta}}function ds(t){try{var i=t._init;return i(t._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(ps=c,Ta):c}}var ps=null;function p1(){if(ps===null)throw Error(s(459));var t=ps;return ps=null,t}function m1(t){if(t===Ta||t===rc)throw Error(s(483))}var qa=null,Wo=0;function sc(t){var i=Wo;return Wo+=1,qa===null&&(qa=[]),d1(qa,t,i)}function Jo(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function ac(t,i){throw i.$$typeof===g?Error(s(525)):(t=Object.prototype.toString.call(i),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function g1(t){function i(se,ne){if(t){var ue=se.deletions;ue===null?(se.deletions=[ne],se.flags|=16):ue.push(ne)}}function c(se,ne){if(!t)return null;for(;ne!==null;)i(se,ne),ne=ne.sibling;return null}function m(se){for(var ne=new Map;se!==null;)se.key!==null?ne.set(se.key,se):ne.set(se.index,se),se=se.sibling;return ne}function _(se,ne){return se=Nr(se,ne),se.index=0,se.sibling=null,se}function S(se,ne,ue){return se.index=ue,t?(ue=se.alternate,ue!==null?(ue=ue.index,ue<ne?(se.flags|=67108866,ne):ue):(se.flags|=67108866,ne)):(se.flags|=1048576,ne)}function L(se){return t&&se.alternate===null&&(se.flags|=67108866),se}function U(se,ne,ue,me){return ne===null||ne.tag!==6?(ne=od(ue,se.mode,me),ne.return=se,ne):(ne=_(ne,ue),ne.return=se,ne)}function Z(se,ne,ue,me){var Re=ue.type;return Re===x?pe(se,ne,ue.props.children,me,ue.key):ne!==null&&(ne.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===I&&ds(Re)===ne.type)?(ne=_(ne,ue.props),Jo(ne,ue),ne.return=se,ne):(ne=Jl(ue.type,ue.key,ue.props,null,se.mode,me),Jo(ne,ue),ne.return=se,ne)}function le(se,ne,ue,me){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==ue.containerInfo||ne.stateNode.implementation!==ue.implementation?(ne=ud(ue,se.mode,me),ne.return=se,ne):(ne=_(ne,ue.children||[]),ne.return=se,ne)}function pe(se,ne,ue,me,Re){return ne===null||ne.tag!==7?(ne=us(ue,se.mode,me,Re),ne.return=se,ne):(ne=_(ne,ue),ne.return=se,ne)}function ge(se,ne,ue){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return ne=od(""+ne,se.mode,ue),ne.return=se,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case y:return ue=Jl(ne.type,ne.key,ne.props,null,se.mode,ue),Jo(ue,ne),ue.return=se,ue;case C:return ne=ud(ne,se.mode,ue),ne.return=se,ne;case I:return ne=ds(ne),ge(se,ne,ue)}if(M(ne)||D(ne))return ne=us(ne,se.mode,ue,null),ne.return=se,ne;if(typeof ne.then=="function")return ge(se,sc(ne),ue);if(ne.$$typeof===E)return ge(se,tc(se,ne),ue);ac(se,ne)}return null}function ce(se,ne,ue,me){var Re=ne!==null?ne.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return Re!==null?null:U(se,ne,""+ue,me);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case y:return ue.key===Re?Z(se,ne,ue,me):null;case C:return ue.key===Re?le(se,ne,ue,me):null;case I:return ue=ds(ue),ce(se,ne,ue,me)}if(M(ue)||D(ue))return Re!==null?null:pe(se,ne,ue,me,null);if(typeof ue.then=="function")return ce(se,ne,sc(ue),me);if(ue.$$typeof===E)return ce(se,ne,tc(se,ue),me);ac(se,ue)}return null}function he(se,ne,ue,me,Re){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return se=se.get(ue)||null,U(ne,se,""+me,Re);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case y:return se=se.get(me.key===null?ue:me.key)||null,Z(ne,se,me,Re);case C:return se=se.get(me.key===null?ue:me.key)||null,le(ne,se,me,Re);case I:return me=ds(me),he(se,ne,ue,me,Re)}if(M(me)||D(me))return se=se.get(ue)||null,pe(ne,se,me,Re,null);if(typeof me.then=="function")return he(se,ne,ue,sc(me),Re);if(me.$$typeof===E)return he(se,ne,ue,tc(ne,me),Re);ac(ne,me)}return null}function Te(se,ne,ue,me){for(var Re=null,Ke=null,Ae=ne,ke=ne=0,Ue=null;Ae!==null&&ke<ue.length;ke++){Ae.index>ke?(Ue=Ae,Ae=null):Ue=Ae.sibling;var Ye=ce(se,Ae,ue[ke],me);if(Ye===null){Ae===null&&(Ae=Ue);break}t&&Ae&&Ye.alternate===null&&i(se,Ae),ne=S(Ye,ne,ke),Ke===null?Re=Ye:Ke.sibling=Ye,Ke=Ye,Ae=Ue}if(ke===ue.length)return c(se,Ae),He&&Rr(se,ke),Re;if(Ae===null){for(;ke<ue.length;ke++)Ae=ge(se,ue[ke],me),Ae!==null&&(ne=S(Ae,ne,ke),Ke===null?Re=Ae:Ke.sibling=Ae,Ke=Ae);return He&&Rr(se,ke),Re}for(Ae=m(Ae);ke<ue.length;ke++)Ue=he(Ae,se,ke,ue[ke],me),Ue!==null&&(t&&Ue.alternate!==null&&Ae.delete(Ue.key===null?ke:Ue.key),ne=S(Ue,ne,ke),Ke===null?Re=Ue:Ke.sibling=Ue,Ke=Ue);return t&&Ae.forEach(function(Oi){return i(se,Oi)}),He&&Rr(se,ke),Re}function je(se,ne,ue,me){if(ue==null)throw Error(s(151));for(var Re=null,Ke=null,Ae=ne,ke=ne=0,Ue=null,Ye=ue.next();Ae!==null&&!Ye.done;ke++,Ye=ue.next()){Ae.index>ke?(Ue=Ae,Ae=null):Ue=Ae.sibling;var Oi=ce(se,Ae,Ye.value,me);if(Oi===null){Ae===null&&(Ae=Ue);break}t&&Ae&&Oi.alternate===null&&i(se,Ae),ne=S(Oi,ne,ke),Ke===null?Re=Oi:Ke.sibling=Oi,Ke=Oi,Ae=Ue}if(Ye.done)return c(se,Ae),He&&Rr(se,ke),Re;if(Ae===null){for(;!Ye.done;ke++,Ye=ue.next())Ye=ge(se,Ye.value,me),Ye!==null&&(ne=S(Ye,ne,ke),Ke===null?Re=Ye:Ke.sibling=Ye,Ke=Ye);return He&&Rr(se,ke),Re}for(Ae=m(Ae);!Ye.done;ke++,Ye=ue.next())Ye=he(Ae,se,ke,Ye.value,me),Ye!==null&&(t&&Ye.alternate!==null&&Ae.delete(Ye.key===null?ke:Ye.key),ne=S(Ye,ne,ke),Ke===null?Re=Ye:Ke.sibling=Ye,Ke=Ye);return t&&Ae.forEach(function(Cz){return i(se,Cz)}),He&&Rr(se,ke),Re}function at(se,ne,ue,me){if(typeof ue=="object"&&ue!==null&&ue.type===x&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case y:e:{for(var Re=ue.key;ne!==null;){if(ne.key===Re){if(Re=ue.type,Re===x){if(ne.tag===7){c(se,ne.sibling),me=_(ne,ue.props.children),me.return=se,se=me;break e}}else if(ne.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===I&&ds(Re)===ne.type){c(se,ne.sibling),me=_(ne,ue.props),Jo(me,ue),me.return=se,se=me;break e}c(se,ne);break}else i(se,ne);ne=ne.sibling}ue.type===x?(me=us(ue.props.children,se.mode,me,ue.key),me.return=se,se=me):(me=Jl(ue.type,ue.key,ue.props,null,se.mode,me),Jo(me,ue),me.return=se,se=me)}return L(se);case C:e:{for(Re=ue.key;ne!==null;){if(ne.key===Re)if(ne.tag===4&&ne.stateNode.containerInfo===ue.containerInfo&&ne.stateNode.implementation===ue.implementation){c(se,ne.sibling),me=_(ne,ue.children||[]),me.return=se,se=me;break e}else{c(se,ne);break}else i(se,ne);ne=ne.sibling}me=ud(ue,se.mode,me),me.return=se,se=me}return L(se);case I:return ue=ds(ue),at(se,ne,ue,me)}if(M(ue))return Te(se,ne,ue,me);if(D(ue)){if(Re=D(ue),typeof Re!="function")throw Error(s(150));return ue=Re.call(ue),je(se,ne,ue,me)}if(typeof ue.then=="function")return at(se,ne,sc(ue),me);if(ue.$$typeof===E)return at(se,ne,tc(se,ue),me);ac(se,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,ne!==null&&ne.tag===6?(c(se,ne.sibling),me=_(ne,ue),me.return=se,se=me):(c(se,ne),me=od(ue,se.mode,me),me.return=se,se=me),L(se)):c(se,ne)}return function(se,ne,ue,me){try{Wo=0;var Re=at(se,ne,ue,me);return qa=null,Re}catch(Ae){if(Ae===Ta||Ae===rc)throw Ae;var Ke=yn(29,Ae,null,se.mode);return Ke.lanes=me,Ke.return=se,Ke}finally{}}}var ms=g1(!0),y1=g1(!1),pi=!1;function _d(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wd(t,i){t=t.updateQueue,i.updateQueue===t&&(i.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function mi(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function gi(t,i,c){var m=t.updateQueue;if(m===null)return null;if(m=m.shared,(Ze&2)!==0){var _=m.pending;return _===null?i.next=i:(i.next=_.next,_.next=i),m.pending=i,i=Wl(t),e1(t,null,c),i}return Xl(t,m,i,c),Wl(t)}function Zo(t,i,c){if(i=i.updateQueue,i!==null&&(i=i.shared,(c&4194048)!==0)){var m=i.lanes;m&=t.pendingLanes,c|=m,i.lanes=c,Nl(t,c)}}function Cd(t,i){var c=t.updateQueue,m=t.alternate;if(m!==null&&(m=m.updateQueue,c===m)){var _=null,S=null;if(c=c.firstBaseUpdate,c!==null){do{var L={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};S===null?_=S=L:S=S.next=L,c=c.next}while(c!==null);S===null?_=S=i:S=S.next=i}else _=S=i;c={baseState:m.baseState,firstBaseUpdate:_,lastBaseUpdate:S,shared:m.shared,callbacks:m.callbacks},t.updateQueue=c;return}t=c.lastBaseUpdate,t===null?c.firstBaseUpdate=i:t.next=i,c.lastBaseUpdate=i}var Ed=!1;function eu(){if(Ed){var t=Sa;if(t!==null)throw t}}function tu(t,i,c,m){Ed=!1;var _=t.updateQueue;pi=!1;var S=_.firstBaseUpdate,L=_.lastBaseUpdate,U=_.shared.pending;if(U!==null){_.shared.pending=null;var Z=U,le=Z.next;Z.next=null,L===null?S=le:L.next=le,L=Z;var pe=t.alternate;pe!==null&&(pe=pe.updateQueue,U=pe.lastBaseUpdate,U!==L&&(U===null?pe.firstBaseUpdate=le:U.next=le,pe.lastBaseUpdate=Z))}if(S!==null){var ge=_.baseState;L=0,pe=le=Z=null,U=S;do{var ce=U.lane&-536870913,he=ce!==U.lane;if(he?(ze&ce)===ce:(m&ce)===ce){ce!==0&&ce===xa&&(Ed=!0),pe!==null&&(pe=pe.next={lane:0,tag:U.tag,payload:U.payload,callback:null,next:null});e:{var Te=t,je=U;ce=i;var at=c;switch(je.tag){case 1:if(Te=je.payload,typeof Te=="function"){ge=Te.call(at,ge,ce);break e}ge=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=je.payload,ce=typeof Te=="function"?Te.call(at,ge,ce):Te,ce==null)break e;ge=d({},ge,ce);break e;case 2:pi=!0}}ce=U.callback,ce!==null&&(t.flags|=64,he&&(t.flags|=8192),he=_.callbacks,he===null?_.callbacks=[ce]:he.push(ce))}else he={lane:ce,tag:U.tag,payload:U.payload,callback:U.callback,next:null},pe===null?(le=pe=he,Z=ge):pe=pe.next=he,L|=ce;if(U=U.next,U===null){if(U=_.shared.pending,U===null)break;he=U,U=he.next,he.next=null,_.lastBaseUpdate=he,_.shared.pending=null}}while(!0);pe===null&&(Z=ge),_.baseState=Z,_.firstBaseUpdate=le,_.lastBaseUpdate=pe,S===null&&(_.shared.lanes=0),wi|=L,t.lanes=L,t.memoizedState=ge}}function v1(t,i){if(typeof t!="function")throw Error(s(191,t));t.call(i)}function b1(t,i){var c=t.callbacks;if(c!==null)for(t.callbacks=null,t=0;t<c.length;t++)v1(c[t],i)}var Aa=B(null),oc=B(0);function _1(t,i){t=zr,te(oc,t),te(Aa,i),zr=t|i.baseLanes}function xd(){te(oc,zr),te(Aa,Aa.current)}function Sd(){zr=oc.current,K(Aa),K(oc)}var vn=B(null),jn=null;function yi(t){var i=t.alternate;te(Et,Et.current&1),te(vn,t),jn===null&&(i===null||Aa.current!==null||i.memoizedState!==null)&&(jn=t)}function Td(t){te(Et,Et.current),te(vn,t),jn===null&&(jn=t)}function w1(t){t.tag===22?(te(Et,Et.current),te(vn,t),jn===null&&(jn=t)):vi()}function vi(){te(Et,Et.current),te(vn,vn.current)}function bn(t){K(vn),jn===t&&(jn=null),K(Et)}var Et=B(0);function uc(t){for(var i=t;i!==null;){if(i.tag===13){var c=i.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Mp(c)||jp(c)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var jr=0,De=null,it=null,Rt=null,lc=!1,Na=!1,gs=!1,cc=0,nu=0,Ra=null,h3=0;function bt(){throw Error(s(321))}function qd(t,i){if(i===null)return!1;for(var c=0;c<i.length&&c<t.length;c++)if(!gn(t[c],i[c]))return!1;return!0}function Ad(t,i,c,m,_,S){return jr=S,De=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,$.H=t===null||t.memoizedState===null?iS:Qd,gs=!1,S=c(m,_),gs=!1,Na&&(S=E1(i,c,m,_)),C1(t),S}function C1(t){$.H=su;var i=it!==null&&it.next!==null;if(jr=0,Rt=it=De=null,lc=!1,nu=0,Ra=null,i)throw Error(s(300));t===null||Ot||(t=t.dependencies,t!==null&&ec(t)&&(Ot=!0))}function E1(t,i,c,m){De=t;var _=0;do{if(Na&&(Ra=null),nu=0,Na=!1,25<=_)throw Error(s(301));if(_+=1,Rt=it=null,t.updateQueue!=null){var S=t.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}$.H=sS,S=i(c,m)}while(Na);return S}function d3(){var t=$.H,i=t.useState()[0];return i=typeof i.then=="function"?ru(i):i,t=t.useState()[0],(it!==null?it.memoizedState:null)!==t&&(De.flags|=1024),i}function Nd(){var t=cc!==0;return cc=0,t}function Rd(t,i,c){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~c}function Od(t){if(lc){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}lc=!1}jr=0,Rt=it=De=null,Na=!1,nu=cc=0,Ra=null}function Jt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rt===null?De.memoizedState=Rt=t:Rt=Rt.next=t,Rt}function xt(){if(it===null){var t=De.alternate;t=t!==null?t.memoizedState:null}else t=it.next;var i=Rt===null?De.memoizedState:Rt.next;if(i!==null)Rt=i,it=t;else{if(t===null)throw De.alternate===null?Error(s(467)):Error(s(310));it=t,t={memoizedState:it.memoizedState,baseState:it.baseState,baseQueue:it.baseQueue,queue:it.queue,next:null},Rt===null?De.memoizedState=Rt=t:Rt=Rt.next=t}return Rt}function fc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ru(t){var i=nu;return nu+=1,Ra===null&&(Ra=[]),t=d1(Ra,t,i),i=De,(Rt===null?i.memoizedState:Rt.next)===null&&(i=i.alternate,$.H=i===null||i.memoizedState===null?iS:Qd),t}function hc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return ru(t);if(t.$$typeof===E)return Pt(t)}throw Error(s(438,String(t)))}function Md(t){var i=null,c=De.updateQueue;if(c!==null&&(i=c.memoCache),i==null){var m=De.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(i={data:m.data.map(function(_){return _.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),c===null&&(c=fc(),De.updateQueue=c),c.memoCache=i,c=i.data[i.index],c===void 0)for(c=i.data[i.index]=Array(t),m=0;m<t;m++)c[m]=N;return i.index++,c}function $r(t,i){return typeof i=="function"?i(t):i}function dc(t){var i=xt();return jd(i,it,t)}function jd(t,i,c){var m=t.queue;if(m===null)throw Error(s(311));m.lastRenderedReducer=c;var _=t.baseQueue,S=m.pending;if(S!==null){if(_!==null){var L=_.next;_.next=S.next,S.next=L}i.baseQueue=_=S,m.pending=null}if(S=t.baseState,_===null)t.memoizedState=S;else{i=_.next;var U=L=null,Z=null,le=i,pe=!1;do{var ge=le.lane&-536870913;if(ge!==le.lane?(ze&ge)===ge:(jr&ge)===ge){var ce=le.revertLane;if(ce===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),ge===xa&&(pe=!0);else if((jr&ce)===ce){le=le.next,ce===xa&&(pe=!0);continue}else ge={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},Z===null?(U=Z=ge,L=S):Z=Z.next=ge,De.lanes|=ce,wi|=ce;ge=le.action,gs&&c(S,ge),S=le.hasEagerState?le.eagerState:c(S,ge)}else ce={lane:ge,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},Z===null?(U=Z=ce,L=S):Z=Z.next=ce,De.lanes|=ge,wi|=ge;le=le.next}while(le!==null&&le!==i);if(Z===null?L=S:Z.next=U,!gn(S,t.memoizedState)&&(Ot=!0,pe&&(c=Sa,c!==null)))throw c;t.memoizedState=S,t.baseState=L,t.baseQueue=Z,m.lastRenderedState=S}return _===null&&(m.lanes=0),[t.memoizedState,m.dispatch]}function $d(t){var i=xt(),c=i.queue;if(c===null)throw Error(s(311));c.lastRenderedReducer=t;var m=c.dispatch,_=c.pending,S=i.memoizedState;if(_!==null){c.pending=null;var L=_=_.next;do S=t(S,L.action),L=L.next;while(L!==_);gn(S,i.memoizedState)||(Ot=!0),i.memoizedState=S,i.baseQueue===null&&(i.baseState=S),c.lastRenderedState=S}return[S,m]}function x1(t,i,c){var m=De,_=xt(),S=He;if(S){if(c===void 0)throw Error(s(407));c=c()}else c=i();var L=!gn((it||_).memoizedState,c);if(L&&(_.memoizedState=c,Ot=!0),_=_.queue,Dd(q1.bind(null,m,_,t),[t]),_.getSnapshot!==i||L||Rt!==null&&Rt.memoizedState.tag&1){if(m.flags|=2048,Oa(9,{destroy:void 0},T1.bind(null,m,_,c,i),null),ot===null)throw Error(s(349));S||(jr&127)!==0||S1(m,i,c)}return c}function S1(t,i,c){t.flags|=16384,t={getSnapshot:i,value:c},i=De.updateQueue,i===null?(i=fc(),De.updateQueue=i,i.stores=[t]):(c=i.stores,c===null?i.stores=[t]:c.push(t))}function T1(t,i,c,m){i.value=c,i.getSnapshot=m,A1(i)&&N1(t)}function q1(t,i,c){return c(function(){A1(i)&&N1(t)})}function A1(t){var i=t.getSnapshot;t=t.value;try{var c=i();return!gn(t,c)}catch{return!0}}function N1(t){var i=os(t,2);i!==null&&cn(i,t,2)}function Ld(t){var i=Jt();if(typeof t=="function"){var c=t;if(t=c(),gs){ar(!0);try{c()}finally{ar(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$r,lastRenderedState:t},i}function R1(t,i,c,m){return t.baseState=c,jd(t,it,typeof m=="function"?m:$r)}function p3(t,i,c,m,_){if(gc(t))throw Error(s(485));if(t=i.action,t!==null){var S={payload:_,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(L){S.listeners.push(L)}};$.T!==null?c(!0):S.isTransition=!1,m(S),c=i.pending,c===null?(S.next=i.pending=S,O1(i,S)):(S.next=c.next,i.pending=c.next=S)}}function O1(t,i){var c=i.action,m=i.payload,_=t.state;if(i.isTransition){var S=$.T,L={};$.T=L;try{var U=c(_,m),Z=$.S;Z!==null&&Z(L,U),M1(t,i,U)}catch(le){Id(t,i,le)}finally{S!==null&&L.types!==null&&(S.types=L.types),$.T=S}}else try{S=c(_,m),M1(t,i,S)}catch(le){Id(t,i,le)}}function M1(t,i,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(m){j1(t,i,m)},function(m){return Id(t,i,m)}):j1(t,i,c)}function j1(t,i,c){i.status="fulfilled",i.value=c,$1(i),t.state=c,i=t.pending,i!==null&&(c=i.next,c===i?t.pending=null:(c=c.next,i.next=c,O1(t,c)))}function Id(t,i,c){var m=t.pending;if(t.pending=null,m!==null){m=m.next;do i.status="rejected",i.reason=c,$1(i),i=i.next;while(i!==m)}t.action=null}function $1(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function L1(t,i){return i}function I1(t,i){if(He){var c=ot.formState;if(c!==null){e:{var m=De;if(He){if(lt){t:{for(var _=lt,S=Mn;_.nodeType!==8;){if(!S){_=null;break t}if(_=$n(_.nextSibling),_===null){_=null;break t}}S=_.data,_=S==="F!"||S==="F"?_:null}if(_){lt=$n(_.nextSibling),m=_.data==="F!";break e}}hi(m)}m=!1}m&&(i=c[0])}}return c=Jt(),c.memoizedState=c.baseState=i,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:L1,lastRenderedState:i},c.queue=m,c=tS.bind(null,De,m),m.dispatch=c,m=Ld(!1),S=Ud.bind(null,De,!1,m.queue),m=Jt(),_={state:i,dispatch:null,action:t,pending:null},m.queue=_,c=p3.bind(null,De,_,S,c),_.dispatch=c,m.memoizedState=t,[i,c,!1]}function D1(t){var i=xt();return k1(i,it,t)}function k1(t,i,c){if(i=jd(t,i,L1)[0],t=dc($r)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var m=ru(i)}catch(L){throw L===Ta?rc:L}else m=i;i=xt();var _=i.queue,S=_.dispatch;return c!==i.memoizedState&&(De.flags|=2048,Oa(9,{destroy:void 0},m3.bind(null,_,c),null)),[m,S,t]}function m3(t,i){t.action=i}function B1(t){var i=xt(),c=it;if(c!==null)return k1(i,c,t);xt(),i=i.memoizedState,c=xt();var m=c.queue.dispatch;return c.memoizedState=t,[i,m,!1]}function Oa(t,i,c,m){return t={tag:t,create:c,deps:m,inst:i,next:null},i=De.updateQueue,i===null&&(i=fc(),De.updateQueue=i),c=i.lastEffect,c===null?i.lastEffect=t.next=t:(m=c.next,c.next=t,t.next=m,i.lastEffect=t),t}function P1(){return xt().memoizedState}function pc(t,i,c,m){var _=Jt();De.flags|=t,_.memoizedState=Oa(1|i,{destroy:void 0},c,m===void 0?null:m)}function mc(t,i,c,m){var _=xt();m=m===void 0?null:m;var S=_.memoizedState.inst;it!==null&&m!==null&&qd(m,it.memoizedState.deps)?_.memoizedState=Oa(i,S,c,m):(De.flags|=t,_.memoizedState=Oa(1|i,S,c,m))}function z1(t,i){pc(8390656,8,t,i)}function Dd(t,i){mc(2048,8,t,i)}function g3(t){De.flags|=4;var i=De.updateQueue;if(i===null)i=fc(),De.updateQueue=i,i.events=[t];else{var c=i.events;c===null?i.events=[t]:c.push(t)}}function U1(t){var i=xt().memoizedState;return g3({ref:i,nextImpl:t}),function(){if((Ze&2)!==0)throw Error(s(440));return i.impl.apply(void 0,arguments)}}function Q1(t,i){return mc(4,2,t,i)}function H1(t,i){return mc(4,4,t,i)}function V1(t,i){if(typeof i=="function"){t=t();var c=i(t);return function(){typeof c=="function"?c():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function F1(t,i,c){c=c!=null?c.concat([t]):null,mc(4,4,V1.bind(null,i,t),c)}function kd(){}function G1(t,i){var c=xt();i=i===void 0?null:i;var m=c.memoizedState;return i!==null&&qd(i,m[1])?m[0]:(c.memoizedState=[t,i],t)}function K1(t,i){var c=xt();i=i===void 0?null:i;var m=c.memoizedState;if(i!==null&&qd(i,m[1]))return m[0];if(m=t(),gs){ar(!0);try{t()}finally{ar(!1)}}return c.memoizedState=[m,i],m}function Bd(t,i,c){return c===void 0||(jr&1073741824)!==0&&(ze&261930)===0?t.memoizedState=i:(t.memoizedState=c,t=YS(),De.lanes|=t,wi|=t,c)}function Y1(t,i,c,m){return gn(c,i)?c:Aa.current!==null?(t=Bd(t,c,m),gn(t,i)||(Ot=!0),t):(jr&42)===0||(jr&1073741824)!==0&&(ze&261930)===0?(Ot=!0,t.memoizedState=c):(t=YS(),De.lanes|=t,wi|=t,i)}function X1(t,i,c,m,_){var S=P.p;P.p=S!==0&&8>S?S:8;var L=$.T,U={};$.T=U,Ud(t,!1,i,c);try{var Z=_(),le=$.S;if(le!==null&&le(U,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var pe=f3(Z,m);iu(t,i,pe,Cn(t))}else iu(t,i,m,Cn(t))}catch(ge){iu(t,i,{then:function(){},status:"rejected",reason:ge},Cn())}finally{P.p=S,L!==null&&U.types!==null&&(L.types=U.types),$.T=L}}function y3(){}function Pd(t,i,c,m){if(t.tag!==5)throw Error(s(476));var _=W1(t).queue;X1(t,_,i,H,c===null?y3:function(){return J1(t),c(m)})}function W1(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$r,lastRenderedState:H},next:null};var c={};return i.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$r,lastRenderedState:c},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function J1(t){var i=W1(t);i.next===null&&(i=t.alternate.memoizedState),iu(t,i.next.queue,{},Cn())}function zd(){return Pt(wu)}function Z1(){return xt().memoizedState}function eS(){return xt().memoizedState}function v3(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var c=Cn();t=mi(c);var m=gi(i,t,c);m!==null&&(cn(m,i,c),Zo(m,i,c)),i={cache:gd()},t.payload=i;return}i=i.return}}function b3(t,i,c){var m=Cn();c={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},gc(t)?nS(i,c):(c=sd(t,i,c,m),c!==null&&(cn(c,t,m),rS(c,i,m)))}function tS(t,i,c){var m=Cn();iu(t,i,c,m)}function iu(t,i,c,m){var _={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(gc(t))nS(i,_);else{var S=t.alternate;if(t.lanes===0&&(S===null||S.lanes===0)&&(S=i.lastRenderedReducer,S!==null))try{var L=i.lastRenderedState,U=S(L,c);if(_.hasEagerState=!0,_.eagerState=U,gn(U,L))return Xl(t,i,_,0),ot===null&&Yl(),!1}catch{}finally{}if(c=sd(t,i,_,m),c!==null)return cn(c,t,m),rS(c,i,m),!0}return!1}function Ud(t,i,c,m){if(m={lane:2,revertLane:_p(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},gc(t)){if(i)throw Error(s(479))}else i=sd(t,c,m,2),i!==null&&cn(i,t,2)}function gc(t){var i=t.alternate;return t===De||i!==null&&i===De}function nS(t,i){Na=lc=!0;var c=t.pending;c===null?i.next=i:(i.next=c.next,c.next=i),t.pending=i}function rS(t,i,c){if((c&4194048)!==0){var m=i.lanes;m&=t.pendingLanes,c|=m,i.lanes=c,Nl(t,c)}}var su={readContext:Pt,use:hc,useCallback:bt,useContext:bt,useEffect:bt,useImperativeHandle:bt,useLayoutEffect:bt,useInsertionEffect:bt,useMemo:bt,useReducer:bt,useRef:bt,useState:bt,useDebugValue:bt,useDeferredValue:bt,useTransition:bt,useSyncExternalStore:bt,useId:bt,useHostTransitionStatus:bt,useFormState:bt,useActionState:bt,useOptimistic:bt,useMemoCache:bt,useCacheRefresh:bt};su.useEffectEvent=bt;var iS={readContext:Pt,use:hc,useCallback:function(t,i){return Jt().memoizedState=[t,i===void 0?null:i],t},useContext:Pt,useEffect:z1,useImperativeHandle:function(t,i,c){c=c!=null?c.concat([t]):null,pc(4194308,4,V1.bind(null,i,t),c)},useLayoutEffect:function(t,i){return pc(4194308,4,t,i)},useInsertionEffect:function(t,i){pc(4,2,t,i)},useMemo:function(t,i){var c=Jt();i=i===void 0?null:i;var m=t();if(gs){ar(!0);try{t()}finally{ar(!1)}}return c.memoizedState=[m,i],m},useReducer:function(t,i,c){var m=Jt();if(c!==void 0){var _=c(i);if(gs){ar(!0);try{c(i)}finally{ar(!1)}}}else _=i;return m.memoizedState=m.baseState=_,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:_},m.queue=t,t=t.dispatch=b3.bind(null,De,t),[m.memoizedState,t]},useRef:function(t){var i=Jt();return t={current:t},i.memoizedState=t},useState:function(t){t=Ld(t);var i=t.queue,c=tS.bind(null,De,i);return i.dispatch=c,[t.memoizedState,c]},useDebugValue:kd,useDeferredValue:function(t,i){var c=Jt();return Bd(c,t,i)},useTransition:function(){var t=Ld(!1);return t=X1.bind(null,De,t.queue,!0,!1),Jt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,c){var m=De,_=Jt();if(He){if(c===void 0)throw Error(s(407));c=c()}else{if(c=i(),ot===null)throw Error(s(349));(ze&127)!==0||S1(m,i,c)}_.memoizedState=c;var S={value:c,getSnapshot:i};return _.queue=S,z1(q1.bind(null,m,S,t),[t]),m.flags|=2048,Oa(9,{destroy:void 0},T1.bind(null,m,S,c,i),null),c},useId:function(){var t=Jt(),i=ot.identifierPrefix;if(He){var c=lr,m=ur;c=(m&~(1<<32-Wt(m)-1)).toString(32)+c,i="_"+i+"R_"+c,c=cc++,0<c&&(i+="H"+c.toString(32)),i+="_"}else c=h3++,i="_"+i+"r_"+c.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:zd,useFormState:I1,useActionState:I1,useOptimistic:function(t){var i=Jt();i.memoizedState=i.baseState=t;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=c,i=Ud.bind(null,De,!0,c),c.dispatch=i,[t,i]},useMemoCache:Md,useCacheRefresh:function(){return Jt().memoizedState=v3.bind(null,De)},useEffectEvent:function(t){var i=Jt(),c={impl:t};return i.memoizedState=c,function(){if((Ze&2)!==0)throw Error(s(440));return c.impl.apply(void 0,arguments)}}},Qd={readContext:Pt,use:hc,useCallback:G1,useContext:Pt,useEffect:Dd,useImperativeHandle:F1,useInsertionEffect:Q1,useLayoutEffect:H1,useMemo:K1,useReducer:dc,useRef:P1,useState:function(){return dc($r)},useDebugValue:kd,useDeferredValue:function(t,i){var c=xt();return Y1(c,it.memoizedState,t,i)},useTransition:function(){var t=dc($r)[0],i=xt().memoizedState;return[typeof t=="boolean"?t:ru(t),i]},useSyncExternalStore:x1,useId:Z1,useHostTransitionStatus:zd,useFormState:D1,useActionState:D1,useOptimistic:function(t,i){var c=xt();return R1(c,it,t,i)},useMemoCache:Md,useCacheRefresh:eS};Qd.useEffectEvent=U1;var sS={readContext:Pt,use:hc,useCallback:G1,useContext:Pt,useEffect:Dd,useImperativeHandle:F1,useInsertionEffect:Q1,useLayoutEffect:H1,useMemo:K1,useReducer:$d,useRef:P1,useState:function(){return $d($r)},useDebugValue:kd,useDeferredValue:function(t,i){var c=xt();return it===null?Bd(c,t,i):Y1(c,it.memoizedState,t,i)},useTransition:function(){var t=$d($r)[0],i=xt().memoizedState;return[typeof t=="boolean"?t:ru(t),i]},useSyncExternalStore:x1,useId:Z1,useHostTransitionStatus:zd,useFormState:B1,useActionState:B1,useOptimistic:function(t,i){var c=xt();return it!==null?R1(c,it,t,i):(c.baseState=t,[t,c.queue.dispatch])},useMemoCache:Md,useCacheRefresh:eS};sS.useEffectEvent=U1;function Hd(t,i,c,m){i=t.memoizedState,c=c(m,i),c=c==null?i:d({},i,c),t.memoizedState=c,t.lanes===0&&(t.updateQueue.baseState=c)}var Vd={enqueueSetState:function(t,i,c){t=t._reactInternals;var m=Cn(),_=mi(m);_.payload=i,c!=null&&(_.callback=c),i=gi(t,_,m),i!==null&&(cn(i,t,m),Zo(i,t,m))},enqueueReplaceState:function(t,i,c){t=t._reactInternals;var m=Cn(),_=mi(m);_.tag=1,_.payload=i,c!=null&&(_.callback=c),i=gi(t,_,m),i!==null&&(cn(i,t,m),Zo(i,t,m))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var c=Cn(),m=mi(c);m.tag=2,i!=null&&(m.callback=i),i=gi(t,m,c),i!==null&&(cn(i,t,c),Zo(i,t,c))}};function aS(t,i,c,m,_,S,L){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(m,S,L):i.prototype&&i.prototype.isPureReactComponent?!Vo(c,m)||!Vo(_,S):!0}function oS(t,i,c,m){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(c,m),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(c,m),i.state!==t&&Vd.enqueueReplaceState(i,i.state,null)}function ys(t,i){var c=i;if("ref"in i){c={};for(var m in i)m!=="ref"&&(c[m]=i[m])}if(t=t.defaultProps){c===i&&(c=d({},c));for(var _ in t)c[_]===void 0&&(c[_]=t[_])}return c}function uS(t){Kl(t)}function lS(t){console.error(t)}function cS(t){Kl(t)}function yc(t,i){try{var c=t.onUncaughtError;c(i.value,{componentStack:i.stack})}catch(m){setTimeout(function(){throw m})}}function fS(t,i,c){try{var m=t.onCaughtError;m(c.value,{componentStack:c.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(_){setTimeout(function(){throw _})}}function Fd(t,i,c){return c=mi(c),c.tag=3,c.payload={element:null},c.callback=function(){yc(t,i)},c}function hS(t){return t=mi(t),t.tag=3,t}function dS(t,i,c,m){var _=c.type.getDerivedStateFromError;if(typeof _=="function"){var S=m.value;t.payload=function(){return _(S)},t.callback=function(){fS(i,c,m)}}var L=c.stateNode;L!==null&&typeof L.componentDidCatch=="function"&&(t.callback=function(){fS(i,c,m),typeof _!="function"&&(Ci===null?Ci=new Set([this]):Ci.add(this));var U=m.stack;this.componentDidCatch(m.value,{componentStack:U!==null?U:""})})}function _3(t,i,c,m,_){if(c.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(i=c.alternate,i!==null&&Ea(i,c,_,!0),c=vn.current,c!==null){switch(c.tag){case 31:case 13:return jn===null?Nc():c.alternate===null&&_t===0&&(_t=3),c.flags&=-257,c.flags|=65536,c.lanes=_,m===ic?c.flags|=16384:(i=c.updateQueue,i===null?c.updateQueue=new Set([m]):i.add(m),yp(t,m,_)),!1;case 22:return c.flags|=65536,m===ic?c.flags|=16384:(i=c.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([m])},c.updateQueue=i):(c=i.retryQueue,c===null?i.retryQueue=new Set([m]):c.add(m)),yp(t,m,_)),!1}throw Error(s(435,c.tag))}return yp(t,m,_),Nc(),!1}if(He)return i=vn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=_,m!==fd&&(t=Error(s(422),{cause:m}),Ko(Nn(t,c)))):(m!==fd&&(i=Error(s(423),{cause:m}),Ko(Nn(i,c))),t=t.current.alternate,t.flags|=65536,_&=-_,t.lanes|=_,m=Nn(m,c),_=Fd(t.stateNode,m,_),Cd(t,_),_t!==4&&(_t=2)),!1;var S=Error(s(520),{cause:m});if(S=Nn(S,c),du===null?du=[S]:du.push(S),_t!==4&&(_t=2),i===null)return!0;m=Nn(m,c),c=i;do{switch(c.tag){case 3:return c.flags|=65536,t=_&-_,c.lanes|=t,t=Fd(c.stateNode,m,t),Cd(c,t),!1;case 1:if(i=c.type,S=c.stateNode,(c.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Ci===null||!Ci.has(S))))return c.flags|=65536,_&=-_,c.lanes|=_,_=hS(_),dS(_,t,c,m),Cd(c,_),!1}c=c.return}while(c!==null);return!1}var Gd=Error(s(461)),Ot=!1;function zt(t,i,c,m){i.child=t===null?y1(i,null,c,m):ms(i,t.child,c,m)}function pS(t,i,c,m,_){c=c.render;var S=i.ref;if("ref"in m){var L={};for(var U in m)U!=="ref"&&(L[U]=m[U])}else L=m;return fs(i),m=Ad(t,i,c,L,S,_),U=Nd(),t!==null&&!Ot?(Rd(t,i,_),Lr(t,i,_)):(He&&U&&ld(i),i.flags|=1,zt(t,i,m,_),i.child)}function mS(t,i,c,m,_){if(t===null){var S=c.type;return typeof S=="function"&&!ad(S)&&S.defaultProps===void 0&&c.compare===null?(i.tag=15,i.type=S,gS(t,i,S,m,_)):(t=Jl(c.type,null,m,i,i.mode,_),t.ref=i.ref,t.return=i,i.child=t)}if(S=t.child,!tp(t,_)){var L=S.memoizedProps;if(c=c.compare,c=c!==null?c:Vo,c(L,m)&&t.ref===i.ref)return Lr(t,i,_)}return i.flags|=1,t=Nr(S,m),t.ref=i.ref,t.return=i,i.child=t}function gS(t,i,c,m,_){if(t!==null){var S=t.memoizedProps;if(Vo(S,m)&&t.ref===i.ref)if(Ot=!1,i.pendingProps=m=S,tp(t,_))(t.flags&131072)!==0&&(Ot=!0);else return i.lanes=t.lanes,Lr(t,i,_)}return Kd(t,i,c,m,_)}function yS(t,i,c,m){var _=m.children,S=t!==null?t.memoizedState:null;if(t===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((i.flags&128)!==0){if(S=S!==null?S.baseLanes|c:c,t!==null){for(m=i.child=t.child,_=0;m!==null;)_=_|m.lanes|m.childLanes,m=m.sibling;m=_&~S}else m=0,i.child=null;return vS(t,i,S,c,m)}if((c&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&nc(i,S!==null?S.cachePool:null),S!==null?_1(i,S):xd(),w1(i);else return m=i.lanes=536870912,vS(t,i,S!==null?S.baseLanes|c:c,c,m)}else S!==null?(nc(i,S.cachePool),_1(i,S),vi(),i.memoizedState=null):(t!==null&&nc(i,null),xd(),vi());return zt(t,i,_,c),i.child}function au(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function vS(t,i,c,m,_){var S=vd();return S=S===null?null:{parent:Nt._currentValue,pool:S},i.memoizedState={baseLanes:c,cachePool:S},t!==null&&nc(i,null),xd(),w1(i),t!==null&&Ea(t,i,m,!0),i.childLanes=_,null}function vc(t,i){return i=_c({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function bS(t,i,c){return ms(i,t.child,null,c),t=vc(i,i.pendingProps),t.flags|=2,bn(i),i.memoizedState=null,t}function w3(t,i,c){var m=i.pendingProps,_=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(He){if(m.mode==="hidden")return t=vc(i,m),i.lanes=536870912,au(null,t);if(Td(i),(t=lt)?(t=OT(t,Mn),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:ci!==null?{id:ur,overflow:lr}:null,retryLane:536870912,hydrationErrors:null},c=n1(t),c.return=i,i.child=c,Bt=i,lt=null)):t=null,t===null)throw hi(i);return i.lanes=536870912,null}return vc(i,m)}var S=t.memoizedState;if(S!==null){var L=S.dehydrated;if(Td(i),_)if(i.flags&256)i.flags&=-257,i=bS(t,i,c);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(s(558));else if(Ot||Ea(t,i,c,!1),_=(c&t.childLanes)!==0,Ot||_){if(m=ot,m!==null&&(L=Rl(m,c),L!==0&&L!==S.retryLane))throw S.retryLane=L,os(t,L),cn(m,t,L),Gd;Nc(),i=bS(t,i,c)}else t=S.treeContext,lt=$n(L.nextSibling),Bt=i,He=!0,fi=null,Mn=!1,t!==null&&s1(i,t),i=vc(i,m),i.flags|=4096;return i}return t=Nr(t.child,{mode:m.mode,children:m.children}),t.ref=i.ref,i.child=t,t.return=i,t}function bc(t,i){var c=i.ref;if(c===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(s(284));(t===null||t.ref!==c)&&(i.flags|=4194816)}}function Kd(t,i,c,m,_){return fs(i),c=Ad(t,i,c,m,void 0,_),m=Nd(),t!==null&&!Ot?(Rd(t,i,_),Lr(t,i,_)):(He&&m&&ld(i),i.flags|=1,zt(t,i,c,_),i.child)}function _S(t,i,c,m,_,S){return fs(i),i.updateQueue=null,c=E1(i,m,c,_),C1(t),m=Nd(),t!==null&&!Ot?(Rd(t,i,S),Lr(t,i,S)):(He&&m&&ld(i),i.flags|=1,zt(t,i,c,S),i.child)}function wS(t,i,c,m,_){if(fs(i),i.stateNode===null){var S=ba,L=c.contextType;typeof L=="object"&&L!==null&&(S=Pt(L)),S=new c(m,S),i.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=Vd,i.stateNode=S,S._reactInternals=i,S=i.stateNode,S.props=m,S.state=i.memoizedState,S.refs={},_d(i),L=c.contextType,S.context=typeof L=="object"&&L!==null?Pt(L):ba,S.state=i.memoizedState,L=c.getDerivedStateFromProps,typeof L=="function"&&(Hd(i,c,L,m),S.state=i.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(L=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),L!==S.state&&Vd.enqueueReplaceState(S,S.state,null),tu(i,m,S,_),eu(),S.state=i.memoizedState),typeof S.componentDidMount=="function"&&(i.flags|=4194308),m=!0}else if(t===null){S=i.stateNode;var U=i.memoizedProps,Z=ys(c,U);S.props=Z;var le=S.context,pe=c.contextType;L=ba,typeof pe=="object"&&pe!==null&&(L=Pt(pe));var ge=c.getDerivedStateFromProps;pe=typeof ge=="function"||typeof S.getSnapshotBeforeUpdate=="function",U=i.pendingProps!==U,pe||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(U||le!==L)&&oS(i,S,m,L),pi=!1;var ce=i.memoizedState;S.state=ce,tu(i,m,S,_),eu(),le=i.memoizedState,U||ce!==le||pi?(typeof ge=="function"&&(Hd(i,c,ge,m),le=i.memoizedState),(Z=pi||aS(i,c,Z,m,ce,le,L))?(pe||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(i.flags|=4194308)):(typeof S.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=m,i.memoizedState=le),S.props=m,S.state=le,S.context=L,m=Z):(typeof S.componentDidMount=="function"&&(i.flags|=4194308),m=!1)}else{S=i.stateNode,wd(t,i),L=i.memoizedProps,pe=ys(c,L),S.props=pe,ge=i.pendingProps,ce=S.context,le=c.contextType,Z=ba,typeof le=="object"&&le!==null&&(Z=Pt(le)),U=c.getDerivedStateFromProps,(le=typeof U=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(L!==ge||ce!==Z)&&oS(i,S,m,Z),pi=!1,ce=i.memoizedState,S.state=ce,tu(i,m,S,_),eu();var he=i.memoizedState;L!==ge||ce!==he||pi||t!==null&&t.dependencies!==null&&ec(t.dependencies)?(typeof U=="function"&&(Hd(i,c,U,m),he=i.memoizedState),(pe=pi||aS(i,c,pe,m,ce,he,Z)||t!==null&&t.dependencies!==null&&ec(t.dependencies))?(le||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(m,he,Z),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(m,he,Z)),typeof S.componentDidUpdate=="function"&&(i.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof S.componentDidUpdate!="function"||L===t.memoizedProps&&ce===t.memoizedState||(i.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||L===t.memoizedProps&&ce===t.memoizedState||(i.flags|=1024),i.memoizedProps=m,i.memoizedState=he),S.props=m,S.state=he,S.context=Z,m=pe):(typeof S.componentDidUpdate!="function"||L===t.memoizedProps&&ce===t.memoizedState||(i.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||L===t.memoizedProps&&ce===t.memoizedState||(i.flags|=1024),m=!1)}return S=m,bc(t,i),m=(i.flags&128)!==0,S||m?(S=i.stateNode,c=m&&typeof c.getDerivedStateFromError!="function"?null:S.render(),i.flags|=1,t!==null&&m?(i.child=ms(i,t.child,null,_),i.child=ms(i,null,c,_)):zt(t,i,c,_),i.memoizedState=S.state,t=i.child):t=Lr(t,i,_),t}function CS(t,i,c,m){return ls(),i.flags|=256,zt(t,i,c,m),i.child}var Yd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xd(t){return{baseLanes:t,cachePool:f1()}}function Wd(t,i,c){return t=t!==null?t.childLanes&~c:0,i&&(t|=wn),t}function ES(t,i,c){var m=i.pendingProps,_=!1,S=(i.flags&128)!==0,L;if((L=S)||(L=t!==null&&t.memoizedState===null?!1:(Et.current&2)!==0),L&&(_=!0,i.flags&=-129),L=(i.flags&32)!==0,i.flags&=-33,t===null){if(He){if(_?yi(i):vi(),(t=lt)?(t=OT(t,Mn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:ci!==null?{id:ur,overflow:lr}:null,retryLane:536870912,hydrationErrors:null},c=n1(t),c.return=i,i.child=c,Bt=i,lt=null)):t=null,t===null)throw hi(i);return jp(t)?i.lanes=32:i.lanes=536870912,null}var U=m.children;return m=m.fallback,_?(vi(),_=i.mode,U=_c({mode:"hidden",children:U},_),m=us(m,_,c,null),U.return=i,m.return=i,U.sibling=m,i.child=U,m=i.child,m.memoizedState=Xd(c),m.childLanes=Wd(t,L,c),i.memoizedState=Yd,au(null,m)):(yi(i),Jd(i,U))}var Z=t.memoizedState;if(Z!==null&&(U=Z.dehydrated,U!==null)){if(S)i.flags&256?(yi(i),i.flags&=-257,i=Zd(t,i,c)):i.memoizedState!==null?(vi(),i.child=t.child,i.flags|=128,i=null):(vi(),U=m.fallback,_=i.mode,m=_c({mode:"visible",children:m.children},_),U=us(U,_,c,null),U.flags|=2,m.return=i,U.return=i,m.sibling=U,i.child=m,ms(i,t.child,null,c),m=i.child,m.memoizedState=Xd(c),m.childLanes=Wd(t,L,c),i.memoizedState=Yd,i=au(null,m));else if(yi(i),jp(U)){if(L=U.nextSibling&&U.nextSibling.dataset,L)var le=L.dgst;L=le,m=Error(s(419)),m.stack="",m.digest=L,Ko({value:m,source:null,stack:null}),i=Zd(t,i,c)}else if(Ot||Ea(t,i,c,!1),L=(c&t.childLanes)!==0,Ot||L){if(L=ot,L!==null&&(m=Rl(L,c),m!==0&&m!==Z.retryLane))throw Z.retryLane=m,os(t,m),cn(L,t,m),Gd;Mp(U)||Nc(),i=Zd(t,i,c)}else Mp(U)?(i.flags|=192,i.child=t.child,i=null):(t=Z.treeContext,lt=$n(U.nextSibling),Bt=i,He=!0,fi=null,Mn=!1,t!==null&&s1(i,t),i=Jd(i,m.children),i.flags|=4096);return i}return _?(vi(),U=m.fallback,_=i.mode,Z=t.child,le=Z.sibling,m=Nr(Z,{mode:"hidden",children:m.children}),m.subtreeFlags=Z.subtreeFlags&65011712,le!==null?U=Nr(le,U):(U=us(U,_,c,null),U.flags|=2),U.return=i,m.return=i,m.sibling=U,i.child=m,au(null,m),m=i.child,U=t.child.memoizedState,U===null?U=Xd(c):(_=U.cachePool,_!==null?(Z=Nt._currentValue,_=_.parent!==Z?{parent:Z,pool:Z}:_):_=f1(),U={baseLanes:U.baseLanes|c,cachePool:_}),m.memoizedState=U,m.childLanes=Wd(t,L,c),i.memoizedState=Yd,au(t.child,m)):(yi(i),c=t.child,t=c.sibling,c=Nr(c,{mode:"visible",children:m.children}),c.return=i,c.sibling=null,t!==null&&(L=i.deletions,L===null?(i.deletions=[t],i.flags|=16):L.push(t)),i.child=c,i.memoizedState=null,c)}function Jd(t,i){return i=_c({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function _c(t,i){return t=yn(22,t,null,i),t.lanes=0,t}function Zd(t,i,c){return ms(i,t.child,null,c),t=Jd(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function xS(t,i,c){t.lanes|=i;var m=t.alternate;m!==null&&(m.lanes|=i),pd(t.return,i,c)}function ep(t,i,c,m,_,S){var L=t.memoizedState;L===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:m,tail:c,tailMode:_,treeForkCount:S}:(L.isBackwards=i,L.rendering=null,L.renderingStartTime=0,L.last=m,L.tail=c,L.tailMode=_,L.treeForkCount=S)}function SS(t,i,c){var m=i.pendingProps,_=m.revealOrder,S=m.tail;m=m.children;var L=Et.current,U=(L&2)!==0;if(U?(L=L&1|2,i.flags|=128):L&=1,te(Et,L),zt(t,i,m,c),m=He?Go:0,!U&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&xS(t,c,i);else if(t.tag===19)xS(t,c,i);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break e;for(;t.sibling===null;){if(t.return===null||t.return===i)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(_){case"forwards":for(c=i.child,_=null;c!==null;)t=c.alternate,t!==null&&uc(t)===null&&(_=c),c=c.sibling;c=_,c===null?(_=i.child,i.child=null):(_=c.sibling,c.sibling=null),ep(i,!1,_,c,S,m);break;case"backwards":case"unstable_legacy-backwards":for(c=null,_=i.child,i.child=null;_!==null;){if(t=_.alternate,t!==null&&uc(t)===null){i.child=_;break}t=_.sibling,_.sibling=c,c=_,_=t}ep(i,!0,c,null,S,m);break;case"together":ep(i,!1,null,null,void 0,m);break;default:i.memoizedState=null}return i.child}function Lr(t,i,c){if(t!==null&&(i.dependencies=t.dependencies),wi|=i.lanes,(c&i.childLanes)===0)if(t!==null){if(Ea(t,i,c,!1),(c&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(s(153));if(i.child!==null){for(t=i.child,c=Nr(t,t.pendingProps),i.child=c,c.return=i;t.sibling!==null;)t=t.sibling,c=c.sibling=Nr(t,t.pendingProps),c.return=i;c.sibling=null}return i.child}function tp(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&ec(t)))}function C3(t,i,c){switch(i.tag){case 3:ee(i,i.stateNode.containerInfo),di(i,Nt,t.memoizedState.cache),ls();break;case 27:case 5:be(i);break;case 4:ee(i,i.stateNode.containerInfo);break;case 10:di(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Td(i),null;break;case 13:var m=i.memoizedState;if(m!==null)return m.dehydrated!==null?(yi(i),i.flags|=128,null):(c&i.child.childLanes)!==0?ES(t,i,c):(yi(i),t=Lr(t,i,c),t!==null?t.sibling:null);yi(i);break;case 19:var _=(t.flags&128)!==0;if(m=(c&i.childLanes)!==0,m||(Ea(t,i,c,!1),m=(c&i.childLanes)!==0),_){if(m)return SS(t,i,c);i.flags|=128}if(_=i.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),te(Et,Et.current),m)break;return null;case 22:return i.lanes=0,yS(t,i,c,i.pendingProps);case 24:di(i,Nt,t.memoizedState.cache)}return Lr(t,i,c)}function TS(t,i,c){if(t!==null)if(t.memoizedProps!==i.pendingProps)Ot=!0;else{if(!tp(t,c)&&(i.flags&128)===0)return Ot=!1,C3(t,i,c);Ot=(t.flags&131072)!==0}else Ot=!1,He&&(i.flags&1048576)!==0&&i1(i,Go,i.index);switch(i.lanes=0,i.tag){case 16:e:{var m=i.pendingProps;if(t=ds(i.elementType),i.type=t,typeof t=="function")ad(t)?(m=ys(t,m),i.tag=1,i=wS(null,i,t,m,c)):(i.tag=0,i=Kd(null,i,t,m,c));else{if(t!=null){var _=t.$$typeof;if(_===q){i.tag=11,i=pS(null,i,t,m,c);break e}else if(_===O){i.tag=14,i=mS(null,i,t,m,c);break e}}throw i=T(t)||t,Error(s(306,i,""))}}return i;case 0:return Kd(t,i,i.type,i.pendingProps,c);case 1:return m=i.type,_=ys(m,i.pendingProps),wS(t,i,m,_,c);case 3:e:{if(ee(i,i.stateNode.containerInfo),t===null)throw Error(s(387));m=i.pendingProps;var S=i.memoizedState;_=S.element,wd(t,i),tu(i,m,null,c);var L=i.memoizedState;if(m=L.cache,di(i,Nt,m),m!==S.cache&&md(i,[Nt],c,!0),eu(),m=L.element,S.isDehydrated)if(S={element:m,isDehydrated:!1,cache:L.cache},i.updateQueue.baseState=S,i.memoizedState=S,i.flags&256){i=CS(t,i,m,c);break e}else if(m!==_){_=Nn(Error(s(424)),i),Ko(_),i=CS(t,i,m,c);break e}else{switch(t=i.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(lt=$n(t.firstChild),Bt=i,He=!0,fi=null,Mn=!0,c=y1(i,null,m,c),i.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(ls(),m===_){i=Lr(t,i,c);break e}zt(t,i,m,c)}i=i.child}return i;case 26:return bc(t,i),t===null?(c=DT(i.type,null,i.pendingProps,null))?i.memoizedState=c:He||(c=i.type,t=i.pendingProps,m=Ic(ie.current).createElement(c),m[$t]=i,m[Gt]=t,Ut(m,c,t),At(m),i.stateNode=m):i.memoizedState=DT(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return be(i),t===null&&He&&(m=i.stateNode=$T(i.type,i.pendingProps,ie.current),Bt=i,Mn=!0,_=lt,Ti(i.type)?($p=_,lt=$n(m.firstChild)):lt=_),zt(t,i,i.pendingProps.children,c),bc(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&He&&((_=m=lt)&&(m=J3(m,i.type,i.pendingProps,Mn),m!==null?(i.stateNode=m,Bt=i,lt=$n(m.firstChild),Mn=!1,_=!0):_=!1),_||hi(i)),be(i),_=i.type,S=i.pendingProps,L=t!==null?t.memoizedProps:null,m=S.children,Np(_,S)?m=null:L!==null&&Np(_,L)&&(i.flags|=32),i.memoizedState!==null&&(_=Ad(t,i,d3,null,null,c),wu._currentValue=_),bc(t,i),zt(t,i,m,c),i.child;case 6:return t===null&&He&&((t=c=lt)&&(c=Z3(c,i.pendingProps,Mn),c!==null?(i.stateNode=c,Bt=i,lt=null,t=!0):t=!1),t||hi(i)),null;case 13:return ES(t,i,c);case 4:return ee(i,i.stateNode.containerInfo),m=i.pendingProps,t===null?i.child=ms(i,null,m,c):zt(t,i,m,c),i.child;case 11:return pS(t,i,i.type,i.pendingProps,c);case 7:return zt(t,i,i.pendingProps,c),i.child;case 8:return zt(t,i,i.pendingProps.children,c),i.child;case 12:return zt(t,i,i.pendingProps.children,c),i.child;case 10:return m=i.pendingProps,di(i,i.type,m.value),zt(t,i,m.children,c),i.child;case 9:return _=i.type._context,m=i.pendingProps.children,fs(i),_=Pt(_),m=m(_),i.flags|=1,zt(t,i,m,c),i.child;case 14:return mS(t,i,i.type,i.pendingProps,c);case 15:return gS(t,i,i.type,i.pendingProps,c);case 19:return SS(t,i,c);case 31:return w3(t,i,c);case 22:return yS(t,i,c,i.pendingProps);case 24:return fs(i),m=Pt(Nt),t===null?(_=vd(),_===null&&(_=ot,S=gd(),_.pooledCache=S,S.refCount++,S!==null&&(_.pooledCacheLanes|=c),_=S),i.memoizedState={parent:m,cache:_},_d(i),di(i,Nt,_)):((t.lanes&c)!==0&&(wd(t,i),tu(i,null,null,c),eu()),_=t.memoizedState,S=i.memoizedState,_.parent!==m?(_={parent:m,cache:m},i.memoizedState=_,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=_),di(i,Nt,m)):(m=S.cache,di(i,Nt,m),m!==_.cache&&md(i,[Nt],c,!0))),zt(t,i,i.pendingProps.children,c),i.child;case 29:throw i.pendingProps}throw Error(s(156,i.tag))}function Ir(t){t.flags|=4}function np(t,i,c,m,_){if((i=(t.mode&32)!==0)&&(i=!1),i){if(t.flags|=16777216,(_&335544128)===_)if(t.stateNode.complete)t.flags|=8192;else if(ZS())t.flags|=8192;else throw ps=ic,bd}else t.flags&=-16777217}function qS(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!UT(i))if(ZS())t.flags|=8192;else throw ps=ic,bd}function wc(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?ql():536870912,t.lanes|=i,La|=i)}function ou(t,i){if(!He)switch(t.tailMode){case"hidden":i=t.tail;for(var c=null;i!==null;)i.alternate!==null&&(c=i),i=i.sibling;c===null?t.tail=null:c.sibling=null;break;case"collapsed":c=t.tail;for(var m=null;c!==null;)c.alternate!==null&&(m=c),c=c.sibling;m===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:m.sibling=null}}function ct(t){var i=t.alternate!==null&&t.alternate.child===t.child,c=0,m=0;if(i)for(var _=t.child;_!==null;)c|=_.lanes|_.childLanes,m|=_.subtreeFlags&65011712,m|=_.flags&65011712,_.return=t,_=_.sibling;else for(_=t.child;_!==null;)c|=_.lanes|_.childLanes,m|=_.subtreeFlags,m|=_.flags,_.return=t,_=_.sibling;return t.subtreeFlags|=m,t.childLanes=c,i}function E3(t,i,c){var m=i.pendingProps;switch(cd(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ct(i),null;case 1:return ct(i),null;case 3:return c=i.stateNode,m=null,t!==null&&(m=t.memoizedState.cache),i.memoizedState.cache!==m&&(i.flags|=2048),Mr(Nt),fe(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(t===null||t.child===null)&&(Ca(i)?Ir(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,hd())),ct(i),null;case 26:var _=i.type,S=i.memoizedState;return t===null?(Ir(i),S!==null?(ct(i),qS(i,S)):(ct(i),np(i,_,null,m,c))):S?S!==t.memoizedState?(Ir(i),ct(i),qS(i,S)):(ct(i),i.flags&=-16777217):(t=t.memoizedProps,t!==m&&Ir(i),ct(i),np(i,_,t,m,c)),null;case 27:if(ve(i),c=ie.current,_=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==m&&Ir(i);else{if(!m){if(i.stateNode===null)throw Error(s(166));return ct(i),null}t=Q.current,Ca(i)?a1(i):(t=$T(_,m,c),i.stateNode=t,Ir(i))}return ct(i),null;case 5:if(ve(i),_=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==m&&Ir(i);else{if(!m){if(i.stateNode===null)throw Error(s(166));return ct(i),null}if(S=Q.current,Ca(i))a1(i);else{var L=Ic(ie.current);switch(S){case 1:S=L.createElementNS("http://www.w3.org/2000/svg",_);break;case 2:S=L.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;default:switch(_){case"svg":S=L.createElementNS("http://www.w3.org/2000/svg",_);break;case"math":S=L.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;case"script":S=L.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof m.is=="string"?L.createElement("select",{is:m.is}):L.createElement("select"),m.multiple?S.multiple=!0:m.size&&(S.size=m.size);break;default:S=typeof m.is=="string"?L.createElement(_,{is:m.is}):L.createElement(_)}}S[$t]=i,S[Gt]=m;e:for(L=i.child;L!==null;){if(L.tag===5||L.tag===6)S.appendChild(L.stateNode);else if(L.tag!==4&&L.tag!==27&&L.child!==null){L.child.return=L,L=L.child;continue}if(L===i)break e;for(;L.sibling===null;){if(L.return===null||L.return===i)break e;L=L.return}L.sibling.return=L.return,L=L.sibling}i.stateNode=S;e:switch(Ut(S,_,m),_){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&Ir(i)}}return ct(i),np(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,c),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==m&&Ir(i);else{if(typeof m!="string"&&i.stateNode===null)throw Error(s(166));if(t=ie.current,Ca(i)){if(t=i.stateNode,c=i.memoizedProps,m=null,_=Bt,_!==null)switch(_.tag){case 27:case 5:m=_.memoizedProps}t[$t]=i,t=!!(t.nodeValue===c||m!==null&&m.suppressHydrationWarning===!0||ET(t.nodeValue,c)),t||hi(i,!0)}else t=Ic(t).createTextNode(m),t[$t]=i,i.stateNode=t}return ct(i),null;case 31:if(c=i.memoizedState,t===null||t.memoizedState!==null){if(m=Ca(i),c!==null){if(t===null){if(!m)throw Error(s(318));if(t=i.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[$t]=i}else ls(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;ct(i),t=!1}else c=hd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=c),t=!0;if(!t)return i.flags&256?(bn(i),i):(bn(i),null);if((i.flags&128)!==0)throw Error(s(558))}return ct(i),null;case 13:if(m=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(_=Ca(i),m!==null&&m.dehydrated!==null){if(t===null){if(!_)throw Error(s(318));if(_=i.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(s(317));_[$t]=i}else ls(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;ct(i),_=!1}else _=hd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=_),_=!0;if(!_)return i.flags&256?(bn(i),i):(bn(i),null)}return bn(i),(i.flags&128)!==0?(i.lanes=c,i):(c=m!==null,t=t!==null&&t.memoizedState!==null,c&&(m=i.child,_=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(_=m.alternate.memoizedState.cachePool.pool),S=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(S=m.memoizedState.cachePool.pool),S!==_&&(m.flags|=2048)),c!==t&&c&&(i.child.flags|=8192),wc(i,i.updateQueue),ct(i),null);case 4:return fe(),t===null&&xp(i.stateNode.containerInfo),ct(i),null;case 10:return Mr(i.type),ct(i),null;case 19:if(K(Et),m=i.memoizedState,m===null)return ct(i),null;if(_=(i.flags&128)!==0,S=m.rendering,S===null)if(_)ou(m,!1);else{if(_t!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(S=uc(t),S!==null){for(i.flags|=128,ou(m,!1),t=S.updateQueue,i.updateQueue=t,wc(i,t),i.subtreeFlags=0,t=c,c=i.child;c!==null;)t1(c,t),c=c.sibling;return te(Et,Et.current&1|2),He&&Rr(i,m.treeForkCount),i.child}t=t.sibling}m.tail!==null&&Oe()>Tc&&(i.flags|=128,_=!0,ou(m,!1),i.lanes=4194304)}else{if(!_)if(t=uc(S),t!==null){if(i.flags|=128,_=!0,t=t.updateQueue,i.updateQueue=t,wc(i,t),ou(m,!0),m.tail===null&&m.tailMode==="hidden"&&!S.alternate&&!He)return ct(i),null}else 2*Oe()-m.renderingStartTime>Tc&&c!==536870912&&(i.flags|=128,_=!0,ou(m,!1),i.lanes=4194304);m.isBackwards?(S.sibling=i.child,i.child=S):(t=m.last,t!==null?t.sibling=S:i.child=S,m.last=S)}return m.tail!==null?(t=m.tail,m.rendering=t,m.tail=t.sibling,m.renderingStartTime=Oe(),t.sibling=null,c=Et.current,te(Et,_?c&1|2:c&1),He&&Rr(i,m.treeForkCount),t):(ct(i),null);case 22:case 23:return bn(i),Sd(),m=i.memoizedState!==null,t!==null?t.memoizedState!==null!==m&&(i.flags|=8192):m&&(i.flags|=8192),m?(c&536870912)!==0&&(i.flags&128)===0&&(ct(i),i.subtreeFlags&6&&(i.flags|=8192)):ct(i),c=i.updateQueue,c!==null&&wc(i,c.retryQueue),c=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(c=t.memoizedState.cachePool.pool),m=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(m=i.memoizedState.cachePool.pool),m!==c&&(i.flags|=2048),t!==null&&K(hs),null;case 24:return c=null,t!==null&&(c=t.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),Mr(Nt),ct(i),null;case 25:return null;case 30:return null}throw Error(s(156,i.tag))}function x3(t,i){switch(cd(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return Mr(Nt),fe(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return ve(i),null;case 31:if(i.memoizedState!==null){if(bn(i),i.alternate===null)throw Error(s(340));ls()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(bn(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(s(340));ls()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return K(Et),null;case 4:return fe(),null;case 10:return Mr(i.type),null;case 22:case 23:return bn(i),Sd(),t!==null&&K(hs),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return Mr(Nt),null;case 25:return null;default:return null}}function AS(t,i){switch(cd(i),i.tag){case 3:Mr(Nt),fe();break;case 26:case 27:case 5:ve(i);break;case 4:fe();break;case 31:i.memoizedState!==null&&bn(i);break;case 13:bn(i);break;case 19:K(Et);break;case 10:Mr(i.type);break;case 22:case 23:bn(i),Sd(),t!==null&&K(hs);break;case 24:Mr(Nt)}}function uu(t,i){try{var c=i.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var _=m.next;c=_;do{if((c.tag&t)===t){m=void 0;var S=c.create,L=c.inst;m=S(),L.destroy=m}c=c.next}while(c!==_)}}catch(U){nt(i,i.return,U)}}function bi(t,i,c){try{var m=i.updateQueue,_=m!==null?m.lastEffect:null;if(_!==null){var S=_.next;m=S;do{if((m.tag&t)===t){var L=m.inst,U=L.destroy;if(U!==void 0){L.destroy=void 0,_=i;var Z=c,le=U;try{le()}catch(pe){nt(_,Z,pe)}}}m=m.next}while(m!==S)}}catch(pe){nt(i,i.return,pe)}}function NS(t){var i=t.updateQueue;if(i!==null){var c=t.stateNode;try{b1(i,c)}catch(m){nt(t,t.return,m)}}}function RS(t,i,c){c.props=ys(t.type,t.memoizedProps),c.state=t.memoizedState;try{c.componentWillUnmount()}catch(m){nt(t,i,m)}}function lu(t,i){try{var c=t.ref;if(c!==null){switch(t.tag){case 26:case 27:case 5:var m=t.stateNode;break;case 30:m=t.stateNode;break;default:m=t.stateNode}typeof c=="function"?t.refCleanup=c(m):c.current=m}}catch(_){nt(t,i,_)}}function cr(t,i){var c=t.ref,m=t.refCleanup;if(c!==null)if(typeof m=="function")try{m()}catch(_){nt(t,i,_)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(_){nt(t,i,_)}else c.current=null}function OS(t){var i=t.type,c=t.memoizedProps,m=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":c.autoFocus&&m.focus();break e;case"img":c.src?m.src=c.src:c.srcSet&&(m.srcset=c.srcSet)}}catch(_){nt(t,t.return,_)}}function rp(t,i,c){try{var m=t.stateNode;F3(m,t.type,c,i),m[Gt]=i}catch(_){nt(t,t.return,_)}}function MS(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Ti(t.type)||t.tag===4}function ip(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||MS(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Ti(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function sp(t,i,c){var m=t.tag;if(m===5||m===6)t=t.stateNode,i?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(t,i):(i=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,i.appendChild(t),c=c._reactRootContainer,c!=null||i.onclick!==null||(i.onclick=qr));else if(m!==4&&(m===27&&Ti(t.type)&&(c=t.stateNode,i=null),t=t.child,t!==null))for(sp(t,i,c),t=t.sibling;t!==null;)sp(t,i,c),t=t.sibling}function Cc(t,i,c){var m=t.tag;if(m===5||m===6)t=t.stateNode,i?c.insertBefore(t,i):c.appendChild(t);else if(m!==4&&(m===27&&Ti(t.type)&&(c=t.stateNode),t=t.child,t!==null))for(Cc(t,i,c),t=t.sibling;t!==null;)Cc(t,i,c),t=t.sibling}function jS(t){var i=t.stateNode,c=t.memoizedProps;try{for(var m=t.type,_=i.attributes;_.length;)i.removeAttributeNode(_[0]);Ut(i,m,c),i[$t]=t,i[Gt]=c}catch(S){nt(t,t.return,S)}}var Dr=!1,Mt=!1,ap=!1,$S=typeof WeakSet=="function"?WeakSet:Set,Dt=null;function S3(t,i){if(t=t.containerInfo,qp=Qc,t=Fx(t),Zh(t)){if("selectionStart"in t)var c={start:t.selectionStart,end:t.selectionEnd};else e:{c=(c=t.ownerDocument)&&c.defaultView||window;var m=c.getSelection&&c.getSelection();if(m&&m.rangeCount!==0){c=m.anchorNode;var _=m.anchorOffset,S=m.focusNode;m=m.focusOffset;try{c.nodeType,S.nodeType}catch{c=null;break e}var L=0,U=-1,Z=-1,le=0,pe=0,ge=t,ce=null;t:for(;;){for(var he;ge!==c||_!==0&&ge.nodeType!==3||(U=L+_),ge!==S||m!==0&&ge.nodeType!==3||(Z=L+m),ge.nodeType===3&&(L+=ge.nodeValue.length),(he=ge.firstChild)!==null;)ce=ge,ge=he;for(;;){if(ge===t)break t;if(ce===c&&++le===_&&(U=L),ce===S&&++pe===m&&(Z=L),(he=ge.nextSibling)!==null)break;ge=ce,ce=ge.parentNode}ge=he}c=U===-1||Z===-1?null:{start:U,end:Z}}else c=null}c=c||{start:0,end:0}}else c=null;for(Ap={focusedElem:t,selectionRange:c},Qc=!1,Dt=i;Dt!==null;)if(i=Dt,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,Dt=t;else for(;Dt!==null;){switch(i=Dt,S=i.alternate,t=i.flags,i.tag){case 0:if((t&4)!==0&&(t=i.updateQueue,t=t!==null?t.events:null,t!==null))for(c=0;c<t.length;c++)_=t[c],_.ref.impl=_.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&S!==null){t=void 0,c=i,_=S.memoizedProps,S=S.memoizedState,m=c.stateNode;try{var Te=ys(c.type,_);t=m.getSnapshotBeforeUpdate(Te,S),m.__reactInternalSnapshotBeforeUpdate=t}catch(je){nt(c,c.return,je)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,c=t.nodeType,c===9)Op(t);else if(c===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Op(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(s(163))}if(t=i.sibling,t!==null){t.return=i.return,Dt=t;break}Dt=i.return}}function LS(t,i,c){var m=c.flags;switch(c.tag){case 0:case 11:case 15:Br(t,c),m&4&&uu(5,c);break;case 1:if(Br(t,c),m&4)if(t=c.stateNode,i===null)try{t.componentDidMount()}catch(L){nt(c,c.return,L)}else{var _=ys(c.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(_,i,t.__reactInternalSnapshotBeforeUpdate)}catch(L){nt(c,c.return,L)}}m&64&&NS(c),m&512&&lu(c,c.return);break;case 3:if(Br(t,c),m&64&&(t=c.updateQueue,t!==null)){if(i=null,c.child!==null)switch(c.child.tag){case 27:case 5:i=c.child.stateNode;break;case 1:i=c.child.stateNode}try{b1(t,i)}catch(L){nt(c,c.return,L)}}break;case 27:i===null&&m&4&&jS(c);case 26:case 5:Br(t,c),i===null&&m&4&&OS(c),m&512&&lu(c,c.return);break;case 12:Br(t,c);break;case 31:Br(t,c),m&4&&kS(t,c);break;case 13:Br(t,c),m&4&&BS(t,c),m&64&&(t=c.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(c=$3.bind(null,c),ez(t,c))));break;case 22:if(m=c.memoizedState!==null||Dr,!m){i=i!==null&&i.memoizedState!==null||Mt,_=Dr;var S=Mt;Dr=m,(Mt=i)&&!S?Pr(t,c,(c.subtreeFlags&8772)!==0):Br(t,c),Dr=_,Mt=S}break;case 30:break;default:Br(t,c)}}function IS(t){var i=t.alternate;i!==null&&(t.alternate=null,IS(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&Lo(i)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var ft=null,an=!1;function kr(t,i,c){for(c=c.child;c!==null;)DS(t,i,c),c=c.sibling}function DS(t,i,c){if(yt&&typeof yt.onCommitFiberUnmount=="function")try{yt.onCommitFiberUnmount(Ft,c)}catch{}switch(c.tag){case 26:Mt||cr(c,i),kr(t,i,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:Mt||cr(c,i);var m=ft,_=an;Ti(c.type)&&(ft=c.stateNode,an=!1),kr(t,i,c),vu(c.stateNode),ft=m,an=_;break;case 5:Mt||cr(c,i);case 6:if(m=ft,_=an,ft=null,kr(t,i,c),ft=m,an=_,ft!==null)if(an)try{(ft.nodeType===9?ft.body:ft.nodeName==="HTML"?ft.ownerDocument.body:ft).removeChild(c.stateNode)}catch(S){nt(c,i,S)}else try{ft.removeChild(c.stateNode)}catch(S){nt(c,i,S)}break;case 18:ft!==null&&(an?(t=ft,NT(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,c.stateNode),Qa(t)):NT(ft,c.stateNode));break;case 4:m=ft,_=an,ft=c.stateNode.containerInfo,an=!0,kr(t,i,c),ft=m,an=_;break;case 0:case 11:case 14:case 15:bi(2,c,i),Mt||bi(4,c,i),kr(t,i,c);break;case 1:Mt||(cr(c,i),m=c.stateNode,typeof m.componentWillUnmount=="function"&&RS(c,i,m)),kr(t,i,c);break;case 21:kr(t,i,c);break;case 22:Mt=(m=Mt)||c.memoizedState!==null,kr(t,i,c),Mt=m;break;default:kr(t,i,c)}}function kS(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Qa(t)}catch(c){nt(i,i.return,c)}}}function BS(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Qa(t)}catch(c){nt(i,i.return,c)}}function T3(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new $S),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new $S),i;default:throw Error(s(435,t.tag))}}function Ec(t,i){var c=T3(t);i.forEach(function(m){if(!c.has(m)){c.add(m);var _=L3.bind(null,t,m);m.then(_,_)}})}function on(t,i){var c=i.deletions;if(c!==null)for(var m=0;m<c.length;m++){var _=c[m],S=t,L=i,U=L;e:for(;U!==null;){switch(U.tag){case 27:if(Ti(U.type)){ft=U.stateNode,an=!1;break e}break;case 5:ft=U.stateNode,an=!1;break e;case 3:case 4:ft=U.stateNode.containerInfo,an=!0;break e}U=U.return}if(ft===null)throw Error(s(160));DS(S,L,_),ft=null,an=!1,S=_.alternate,S!==null&&(S.return=null),_.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)PS(i,t),i=i.sibling}var Qn=null;function PS(t,i){var c=t.alternate,m=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:on(i,t),un(t),m&4&&(bi(3,t,t.return),uu(3,t),bi(5,t,t.return));break;case 1:on(i,t),un(t),m&512&&(Mt||c===null||cr(c,c.return)),m&64&&Dr&&(t=t.updateQueue,t!==null&&(m=t.callbacks,m!==null&&(c=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=c===null?m:c.concat(m))));break;case 26:var _=Qn;if(on(i,t),un(t),m&512&&(Mt||c===null||cr(c,c.return)),m&4){var S=c!==null?c.memoizedState:null;if(m=t.memoizedState,c===null)if(m===null)if(t.stateNode===null){e:{m=t.type,c=t.memoizedProps,_=_.ownerDocument||_;t:switch(m){case"title":S=_.getElementsByTagName("title")[0],(!S||S[ts]||S[$t]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=_.createElement(m),_.head.insertBefore(S,_.querySelector("head > title"))),Ut(S,m,c),S[$t]=t,At(S),m=S;break e;case"link":var L=PT("link","href",_).get(m+(c.href||""));if(L){for(var U=0;U<L.length;U++)if(S=L[U],S.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&S.getAttribute("rel")===(c.rel==null?null:c.rel)&&S.getAttribute("title")===(c.title==null?null:c.title)&&S.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){L.splice(U,1);break t}}S=_.createElement(m),Ut(S,m,c),_.head.appendChild(S);break;case"meta":if(L=PT("meta","content",_).get(m+(c.content||""))){for(U=0;U<L.length;U++)if(S=L[U],S.getAttribute("content")===(c.content==null?null:""+c.content)&&S.getAttribute("name")===(c.name==null?null:c.name)&&S.getAttribute("property")===(c.property==null?null:c.property)&&S.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&S.getAttribute("charset")===(c.charSet==null?null:c.charSet)){L.splice(U,1);break t}}S=_.createElement(m),Ut(S,m,c),_.head.appendChild(S);break;default:throw Error(s(468,m))}S[$t]=t,At(S),m=S}t.stateNode=m}else zT(_,t.type,t.stateNode);else t.stateNode=BT(_,m,t.memoizedProps);else S!==m?(S===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):S.count--,m===null?zT(_,t.type,t.stateNode):BT(_,m,t.memoizedProps)):m===null&&t.stateNode!==null&&rp(t,t.memoizedProps,c.memoizedProps)}break;case 27:on(i,t),un(t),m&512&&(Mt||c===null||cr(c,c.return)),c!==null&&m&4&&rp(t,t.memoizedProps,c.memoizedProps);break;case 5:if(on(i,t),un(t),m&512&&(Mt||c===null||cr(c,c.return)),t.flags&32){_=t.stateNode;try{ha(_,"")}catch(Te){nt(t,t.return,Te)}}m&4&&t.stateNode!=null&&(_=t.memoizedProps,rp(t,_,c!==null?c.memoizedProps:_)),m&1024&&(ap=!0);break;case 6:if(on(i,t),un(t),m&4){if(t.stateNode===null)throw Error(s(162));m=t.memoizedProps,c=t.stateNode;try{c.nodeValue=m}catch(Te){nt(t,t.return,Te)}}break;case 3:if(Bc=null,_=Qn,Qn=Dc(i.containerInfo),on(i,t),Qn=_,un(t),m&4&&c!==null&&c.memoizedState.isDehydrated)try{Qa(i.containerInfo)}catch(Te){nt(t,t.return,Te)}ap&&(ap=!1,zS(t));break;case 4:m=Qn,Qn=Dc(t.stateNode.containerInfo),on(i,t),un(t),Qn=m;break;case 12:on(i,t),un(t);break;case 31:on(i,t),un(t),m&4&&(m=t.updateQueue,m!==null&&(t.updateQueue=null,Ec(t,m)));break;case 13:on(i,t),un(t),t.child.flags&8192&&t.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Sc=Oe()),m&4&&(m=t.updateQueue,m!==null&&(t.updateQueue=null,Ec(t,m)));break;case 22:_=t.memoizedState!==null;var Z=c!==null&&c.memoizedState!==null,le=Dr,pe=Mt;if(Dr=le||_,Mt=pe||Z,on(i,t),Mt=pe,Dr=le,un(t),m&8192)e:for(i=t.stateNode,i._visibility=_?i._visibility&-2:i._visibility|1,_&&(c===null||Z||Dr||Mt||vs(t)),c=null,i=t;;){if(i.tag===5||i.tag===26){if(c===null){Z=c=i;try{if(S=Z.stateNode,_)L=S.style,typeof L.setProperty=="function"?L.setProperty("display","none","important"):L.display="none";else{U=Z.stateNode;var ge=Z.memoizedProps.style,ce=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;U.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(Te){nt(Z,Z.return,Te)}}}else if(i.tag===6){if(c===null){Z=i;try{Z.stateNode.nodeValue=_?"":Z.memoizedProps}catch(Te){nt(Z,Z.return,Te)}}}else if(i.tag===18){if(c===null){Z=i;try{var he=Z.stateNode;_?RT(he,!0):RT(Z.stateNode,!1)}catch(Te){nt(Z,Z.return,Te)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===t)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;c===i&&(c=null),i=i.return}c===i&&(c=null),i.sibling.return=i.return,i=i.sibling}m&4&&(m=t.updateQueue,m!==null&&(c=m.retryQueue,c!==null&&(m.retryQueue=null,Ec(t,c))));break;case 19:on(i,t),un(t),m&4&&(m=t.updateQueue,m!==null&&(t.updateQueue=null,Ec(t,m)));break;case 30:break;case 21:break;default:on(i,t),un(t)}}function un(t){var i=t.flags;if(i&2){try{for(var c,m=t.return;m!==null;){if(MS(m)){c=m;break}m=m.return}if(c==null)throw Error(s(160));switch(c.tag){case 27:var _=c.stateNode,S=ip(t);Cc(t,S,_);break;case 5:var L=c.stateNode;c.flags&32&&(ha(L,""),c.flags&=-33);var U=ip(t);Cc(t,U,L);break;case 3:case 4:var Z=c.stateNode.containerInfo,le=ip(t);sp(t,le,Z);break;default:throw Error(s(161))}}catch(pe){nt(t,t.return,pe)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function zS(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;zS(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function Br(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)LS(t,i.alternate,i),i=i.sibling}function vs(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:bi(4,i,i.return),vs(i);break;case 1:cr(i,i.return);var c=i.stateNode;typeof c.componentWillUnmount=="function"&&RS(i,i.return,c),vs(i);break;case 27:vu(i.stateNode);case 26:case 5:cr(i,i.return),vs(i);break;case 22:i.memoizedState===null&&vs(i);break;case 30:vs(i);break;default:vs(i)}t=t.sibling}}function Pr(t,i,c){for(c=c&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var m=i.alternate,_=t,S=i,L=S.flags;switch(S.tag){case 0:case 11:case 15:Pr(_,S,c),uu(4,S);break;case 1:if(Pr(_,S,c),m=S,_=m.stateNode,typeof _.componentDidMount=="function")try{_.componentDidMount()}catch(le){nt(m,m.return,le)}if(m=S,_=m.updateQueue,_!==null){var U=m.stateNode;try{var Z=_.shared.hiddenCallbacks;if(Z!==null)for(_.shared.hiddenCallbacks=null,_=0;_<Z.length;_++)v1(Z[_],U)}catch(le){nt(m,m.return,le)}}c&&L&64&&NS(S),lu(S,S.return);break;case 27:jS(S);case 26:case 5:Pr(_,S,c),c&&m===null&&L&4&&OS(S),lu(S,S.return);break;case 12:Pr(_,S,c);break;case 31:Pr(_,S,c),c&&L&4&&kS(_,S);break;case 13:Pr(_,S,c),c&&L&4&&BS(_,S);break;case 22:S.memoizedState===null&&Pr(_,S,c),lu(S,S.return);break;case 30:break;default:Pr(_,S,c)}i=i.sibling}}function op(t,i){var c=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(c=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==c&&(t!=null&&t.refCount++,c!=null&&Yo(c))}function up(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Yo(t))}function Hn(t,i,c,m){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)US(t,i,c,m),i=i.sibling}function US(t,i,c,m){var _=i.flags;switch(i.tag){case 0:case 11:case 15:Hn(t,i,c,m),_&2048&&uu(9,i);break;case 1:Hn(t,i,c,m);break;case 3:Hn(t,i,c,m),_&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Yo(t)));break;case 12:if(_&2048){Hn(t,i,c,m),t=i.stateNode;try{var S=i.memoizedProps,L=S.id,U=S.onPostCommit;typeof U=="function"&&U(L,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(Z){nt(i,i.return,Z)}}else Hn(t,i,c,m);break;case 31:Hn(t,i,c,m);break;case 13:Hn(t,i,c,m);break;case 23:break;case 22:S=i.stateNode,L=i.alternate,i.memoizedState!==null?S._visibility&2?Hn(t,i,c,m):cu(t,i):S._visibility&2?Hn(t,i,c,m):(S._visibility|=2,Ma(t,i,c,m,(i.subtreeFlags&10256)!==0||!1)),_&2048&&op(L,i);break;case 24:Hn(t,i,c,m),_&2048&&up(i.alternate,i);break;default:Hn(t,i,c,m)}}function Ma(t,i,c,m,_){for(_=_&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var S=t,L=i,U=c,Z=m,le=L.flags;switch(L.tag){case 0:case 11:case 15:Ma(S,L,U,Z,_),uu(8,L);break;case 23:break;case 22:var pe=L.stateNode;L.memoizedState!==null?pe._visibility&2?Ma(S,L,U,Z,_):cu(S,L):(pe._visibility|=2,Ma(S,L,U,Z,_)),_&&le&2048&&op(L.alternate,L);break;case 24:Ma(S,L,U,Z,_),_&&le&2048&&up(L.alternate,L);break;default:Ma(S,L,U,Z,_)}i=i.sibling}}function cu(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var c=t,m=i,_=m.flags;switch(m.tag){case 22:cu(c,m),_&2048&&op(m.alternate,m);break;case 24:cu(c,m),_&2048&&up(m.alternate,m);break;default:cu(c,m)}i=i.sibling}}var fu=8192;function ja(t,i,c){if(t.subtreeFlags&fu)for(t=t.child;t!==null;)QS(t,i,c),t=t.sibling}function QS(t,i,c){switch(t.tag){case 26:ja(t,i,c),t.flags&fu&&t.memoizedState!==null&&hz(c,Qn,t.memoizedState,t.memoizedProps);break;case 5:ja(t,i,c);break;case 3:case 4:var m=Qn;Qn=Dc(t.stateNode.containerInfo),ja(t,i,c),Qn=m;break;case 22:t.memoizedState===null&&(m=t.alternate,m!==null&&m.memoizedState!==null?(m=fu,fu=16777216,ja(t,i,c),fu=m):ja(t,i,c));break;default:ja(t,i,c)}}function HS(t){var i=t.alternate;if(i!==null&&(t=i.child,t!==null)){i.child=null;do i=t.sibling,t.sibling=null,t=i;while(t!==null)}}function hu(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var c=0;c<i.length;c++){var m=i[c];Dt=m,FS(m,t)}HS(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)VS(t),t=t.sibling}function VS(t){switch(t.tag){case 0:case 11:case 15:hu(t),t.flags&2048&&bi(9,t,t.return);break;case 3:hu(t);break;case 12:hu(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,xc(t)):hu(t);break;default:hu(t)}}function xc(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var c=0;c<i.length;c++){var m=i[c];Dt=m,FS(m,t)}HS(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:bi(8,i,i.return),xc(i);break;case 22:c=i.stateNode,c._visibility&2&&(c._visibility&=-3,xc(i));break;default:xc(i)}t=t.sibling}}function FS(t,i){for(;Dt!==null;){var c=Dt;switch(c.tag){case 0:case 11:case 15:bi(8,c,i);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var m=c.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Yo(c.memoizedState.cache)}if(m=c.child,m!==null)m.return=c,Dt=m;else e:for(c=t;Dt!==null;){m=Dt;var _=m.sibling,S=m.return;if(IS(m),m===c){Dt=null;break e}if(_!==null){_.return=S,Dt=_;break e}Dt=S}}}var q3={getCacheForType:function(t){var i=Pt(Nt),c=i.data.get(t);return c===void 0&&(c=t(),i.data.set(t,c)),c},cacheSignal:function(){return Pt(Nt).controller.signal}},A3=typeof WeakMap=="function"?WeakMap:Map,Ze=0,ot=null,Be=null,ze=0,tt=0,_n=null,_i=!1,$a=!1,lp=!1,zr=0,_t=0,wi=0,bs=0,cp=0,wn=0,La=0,du=null,ln=null,fp=!1,Sc=0,GS=0,Tc=1/0,qc=null,Ci=null,Lt=0,Ei=null,Ia=null,Ur=0,hp=0,dp=null,KS=null,pu=0,pp=null;function Cn(){return(Ze&2)!==0&&ze!==0?ze&-ze:$.T!==null?_p():Ol()}function YS(){if(wn===0)if((ze&536870912)===0||He){var t=aa;aa<<=1,(aa&3932160)===0&&(aa=262144),wn=t}else wn=536870912;return t=vn.current,t!==null&&(t.flags|=32),wn}function cn(t,i,c){(t===ot&&(tt===2||tt===9)||t.cancelPendingCommit!==null)&&(Da(t,0),xi(t,ze,wn,!1)),es(t,c),((Ze&2)===0||t!==ot)&&(t===ot&&((Ze&2)===0&&(bs|=c),_t===4&&xi(t,ze,wn,!1)),fr(t))}function XS(t,i,c){if((Ze&6)!==0)throw Error(s(327));var m=!c&&(i&127)===0&&(i&t.expiredLanes)===0||Zi(t,i),_=m?O3(t,i):gp(t,i,!0),S=m;do{if(_===0){$a&&!m&&xi(t,i,0,!1);break}else{if(c=t.current.alternate,S&&!N3(c)){_=gp(t,i,!1),S=!1;continue}if(_===2){if(S=i,t.errorRecoveryDisabledLanes&S)var L=0;else L=t.pendingLanes&-536870913,L=L!==0?L:L&536870912?536870912:0;if(L!==0){i=L;e:{var U=t;_=du;var Z=U.current.memoizedState.isDehydrated;if(Z&&(Da(U,L).flags|=256),L=gp(U,L,!1),L!==2){if(lp&&!Z){U.errorRecoveryDisabledLanes|=S,bs|=S,_=4;break e}S=ln,ln=_,S!==null&&(ln===null?ln=S:ln.push.apply(ln,S))}_=L}if(S=!1,_!==2)continue}}if(_===1){Da(t,0),xi(t,i,0,!0);break}e:{switch(m=t,S=_,S){case 0:case 1:throw Error(s(345));case 4:if((i&4194048)!==i)break;case 6:xi(m,i,wn,!_i);break e;case 2:ln=null;break;case 3:case 5:break;default:throw Error(s(329))}if((i&62914560)===i&&(_=Sc+300-Oe(),10<_)){if(xi(m,i,wn,!_i),ua(m,0,!0)!==0)break e;Ur=i,m.timeoutHandle=qT(WS.bind(null,m,c,ln,qc,fp,i,wn,bs,La,_i,S,"Throttled",-0,0),_);break e}WS(m,c,ln,qc,fp,i,wn,bs,La,_i,S,null,-0,0)}}break}while(!0);fr(t)}function WS(t,i,c,m,_,S,L,U,Z,le,pe,ge,ce,he){if(t.timeoutHandle=-1,ge=i.subtreeFlags,ge&8192||(ge&16785408)===16785408){ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:qr},QS(i,S,ge);var Te=(S&62914560)===S?Sc-Oe():(S&4194048)===S?GS-Oe():0;if(Te=dz(ge,Te),Te!==null){Ur=S,t.cancelPendingCommit=Te(sT.bind(null,t,i,S,c,m,_,L,U,Z,pe,ge,null,ce,he)),xi(t,S,L,!le);return}}sT(t,i,S,c,m,_,L,U,Z)}function N3(t){for(var i=t;;){var c=i.tag;if((c===0||c===11||c===15)&&i.flags&16384&&(c=i.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var m=0;m<c.length;m++){var _=c[m],S=_.getSnapshot;_=_.value;try{if(!gn(S(),_))return!1}catch{return!1}}if(c=i.child,i.subtreeFlags&16384&&c!==null)c.return=i,i=c;else{if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function xi(t,i,c,m){i&=~cp,i&=~bs,t.suspendedLanes|=i,t.pingedLanes&=~i,m&&(t.warmLanes|=i),m=t.expirationTimes;for(var _=i;0<_;){var S=31-Wt(_),L=1<<S;m[S]=-1,_&=~L}c!==0&&Al(t,c,i)}function Ac(){return(Ze&6)===0?(mu(0),!1):!0}function mp(){if(Be!==null){if(tt===0)var t=Be.return;else t=Be,Or=cs=null,Od(t),qa=null,Wo=0,t=Be;for(;t!==null;)AS(t.alternate,t),t=t.return;Be=null}}function Da(t,i){var c=t.timeoutHandle;c!==-1&&(t.timeoutHandle=-1,Y3(c)),c=t.cancelPendingCommit,c!==null&&(t.cancelPendingCommit=null,c()),Ur=0,mp(),ot=t,Be=c=Nr(t.current,null),ze=i,tt=0,_n=null,_i=!1,$a=Zi(t,i),lp=!1,La=wn=cp=bs=wi=_t=0,ln=du=null,fp=!1,(i&8)!==0&&(i|=i&32);var m=t.entangledLanes;if(m!==0)for(t=t.entanglements,m&=i;0<m;){var _=31-Wt(m),S=1<<_;i|=t[_],m&=~S}return zr=i,Yl(),c}function JS(t,i){De=null,$.H=su,i===Ta||i===rc?(i=p1(),tt=3):i===bd?(i=p1(),tt=4):tt=i===Gd?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,_n=i,Be===null&&(_t=1,yc(t,Nn(i,t.current)))}function ZS(){var t=vn.current;return t===null?!0:(ze&4194048)===ze?jn===null:(ze&62914560)===ze||(ze&536870912)!==0?t===jn:!1}function eT(){var t=$.H;return $.H=su,t===null?su:t}function tT(){var t=$.A;return $.A=q3,t}function Nc(){_t=4,_i||(ze&4194048)!==ze&&vn.current!==null||($a=!0),(wi&134217727)===0&&(bs&134217727)===0||ot===null||xi(ot,ze,wn,!1)}function gp(t,i,c){var m=Ze;Ze|=2;var _=eT(),S=tT();(ot!==t||ze!==i)&&(qc=null,Da(t,i)),i=!1;var L=_t;e:do try{if(tt!==0&&Be!==null){var U=Be,Z=_n;switch(tt){case 8:mp(),L=6;break e;case 3:case 2:case 9:case 6:vn.current===null&&(i=!0);var le=tt;if(tt=0,_n=null,ka(t,U,Z,le),c&&$a){L=0;break e}break;default:le=tt,tt=0,_n=null,ka(t,U,Z,le)}}R3(),L=_t;break}catch(pe){JS(t,pe)}while(!0);return i&&t.shellSuspendCounter++,Or=cs=null,Ze=m,$.H=_,$.A=S,Be===null&&(ot=null,ze=0,Yl()),L}function R3(){for(;Be!==null;)nT(Be)}function O3(t,i){var c=Ze;Ze|=2;var m=eT(),_=tT();ot!==t||ze!==i?(qc=null,Tc=Oe()+500,Da(t,i)):$a=Zi(t,i);e:do try{if(tt!==0&&Be!==null){i=Be;var S=_n;t:switch(tt){case 1:tt=0,_n=null,ka(t,i,S,1);break;case 2:case 9:if(h1(S)){tt=0,_n=null,rT(i);break}i=function(){tt!==2&&tt!==9||ot!==t||(tt=7),fr(t)},S.then(i,i);break e;case 3:tt=7;break e;case 4:tt=5;break e;case 7:h1(S)?(tt=0,_n=null,rT(i)):(tt=0,_n=null,ka(t,i,S,7));break;case 5:var L=null;switch(Be.tag){case 26:L=Be.memoizedState;case 5:case 27:var U=Be;if(L?UT(L):U.stateNode.complete){tt=0,_n=null;var Z=U.sibling;if(Z!==null)Be=Z;else{var le=U.return;le!==null?(Be=le,Rc(le)):Be=null}break t}}tt=0,_n=null,ka(t,i,S,5);break;case 6:tt=0,_n=null,ka(t,i,S,6);break;case 8:mp(),_t=6;break e;default:throw Error(s(462))}}M3();break}catch(pe){JS(t,pe)}while(!0);return Or=cs=null,$.H=m,$.A=_,Ze=c,Be!==null?0:(ot=null,ze=0,Yl(),_t)}function M3(){for(;Be!==null&&!qt();)nT(Be)}function nT(t){var i=TS(t.alternate,t,zr);t.memoizedProps=t.pendingProps,i===null?Rc(t):Be=i}function rT(t){var i=t,c=i.alternate;switch(i.tag){case 15:case 0:i=_S(c,i,i.pendingProps,i.type,void 0,ze);break;case 11:i=_S(c,i,i.pendingProps,i.type.render,i.ref,ze);break;case 5:Od(i);default:AS(c,i),i=Be=t1(i,zr),i=TS(c,i,zr)}t.memoizedProps=t.pendingProps,i===null?Rc(t):Be=i}function ka(t,i,c,m){Or=cs=null,Od(i),qa=null,Wo=0;var _=i.return;try{if(_3(t,_,i,c,ze)){_t=1,yc(t,Nn(c,t.current)),Be=null;return}}catch(S){if(_!==null)throw Be=_,S;_t=1,yc(t,Nn(c,t.current)),Be=null;return}i.flags&32768?(He||m===1?t=!0:$a||(ze&536870912)!==0?t=!1:(_i=t=!0,(m===2||m===9||m===3||m===6)&&(m=vn.current,m!==null&&m.tag===13&&(m.flags|=16384))),iT(i,t)):Rc(i)}function Rc(t){var i=t;do{if((i.flags&32768)!==0){iT(i,_i);return}t=i.return;var c=E3(i.alternate,i,zr);if(c!==null){Be=c;return}if(i=i.sibling,i!==null){Be=i;return}Be=i=t}while(i!==null);_t===0&&(_t=5)}function iT(t,i){do{var c=x3(t.alternate,t);if(c!==null){c.flags&=32767,Be=c;return}if(c=t.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!i&&(t=t.sibling,t!==null)){Be=t;return}Be=t=c}while(t!==null);_t=6,Be=null}function sT(t,i,c,m,_,S,L,U,Z){t.cancelPendingCommit=null;do Oc();while(Lt!==0);if((Ze&6)!==0)throw Error(s(327));if(i!==null){if(i===t.current)throw Error(s(177));if(S=i.lanes|i.childLanes,S|=id,$h(t,c,S,L,U,Z),t===ot&&(Be=ot=null,ze=0),Ia=i,Ei=t,Ur=c,hp=S,dp=_,KS=m,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,I3(de,function(){return cT(),null})):(t.callbackNode=null,t.callbackPriority=0),m=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||m){m=$.T,$.T=null,_=P.p,P.p=2,L=Ze,Ze|=4;try{S3(t,i,c)}finally{Ze=L,P.p=_,$.T=m}}Lt=1,aT(),oT(),uT()}}function aT(){if(Lt===1){Lt=0;var t=Ei,i=Ia,c=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||c){c=$.T,$.T=null;var m=P.p;P.p=2;var _=Ze;Ze|=4;try{PS(i,t);var S=Ap,L=Fx(t.containerInfo),U=S.focusedElem,Z=S.selectionRange;if(L!==U&&U&&U.ownerDocument&&Vx(U.ownerDocument.documentElement,U)){if(Z!==null&&Zh(U)){var le=Z.start,pe=Z.end;if(pe===void 0&&(pe=le),"selectionStart"in U)U.selectionStart=le,U.selectionEnd=Math.min(pe,U.value.length);else{var ge=U.ownerDocument||document,ce=ge&&ge.defaultView||window;if(ce.getSelection){var he=ce.getSelection(),Te=U.textContent.length,je=Math.min(Z.start,Te),at=Z.end===void 0?je:Math.min(Z.end,Te);!he.extend&&je>at&&(L=at,at=je,je=L);var se=Hx(U,je),ne=Hx(U,at);if(se&&ne&&(he.rangeCount!==1||he.anchorNode!==se.node||he.anchorOffset!==se.offset||he.focusNode!==ne.node||he.focusOffset!==ne.offset)){var ue=ge.createRange();ue.setStart(se.node,se.offset),he.removeAllRanges(),je>at?(he.addRange(ue),he.extend(ne.node,ne.offset)):(ue.setEnd(ne.node,ne.offset),he.addRange(ue))}}}}for(ge=[],he=U;he=he.parentNode;)he.nodeType===1&&ge.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof U.focus=="function"&&U.focus(),U=0;U<ge.length;U++){var me=ge[U];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}Qc=!!qp,Ap=qp=null}finally{Ze=_,P.p=m,$.T=c}}t.current=i,Lt=2}}function oT(){if(Lt===2){Lt=0;var t=Ei,i=Ia,c=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||c){c=$.T,$.T=null;var m=P.p;P.p=2;var _=Ze;Ze|=4;try{LS(t,i.alternate,i)}finally{Ze=_,P.p=m,$.T=c}}Lt=3}}function uT(){if(Lt===4||Lt===3){Lt=0,Ge();var t=Ei,i=Ia,c=Ur,m=KS;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Lt=5:(Lt=0,Ia=Ei=null,lT(t,t.pendingLanes));var _=t.pendingLanes;if(_===0&&(Ci=null),$o(c),i=i.stateNode,yt&&typeof yt.onCommitFiberRoot=="function")try{yt.onCommitFiberRoot(Ft,i,void 0,(i.current.flags&128)===128)}catch{}if(m!==null){i=$.T,_=P.p,P.p=2,$.T=null;try{for(var S=t.onRecoverableError,L=0;L<m.length;L++){var U=m[L];S(U.value,{componentStack:U.stack})}}finally{$.T=i,P.p=_}}(Ur&3)!==0&&Oc(),fr(t),_=t.pendingLanes,(c&261930)!==0&&(_&42)!==0?t===pp?pu++:(pu=0,pp=t):pu=0,mu(0)}}function lT(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,Yo(i)))}function Oc(){return aT(),oT(),uT(),cT()}function cT(){if(Lt!==5)return!1;var t=Ei,i=hp;hp=0;var c=$o(Ur),m=$.T,_=P.p;try{P.p=32>c?32:c,$.T=null,c=dp,dp=null;var S=Ei,L=Ur;if(Lt=0,Ia=Ei=null,Ur=0,(Ze&6)!==0)throw Error(s(331));var U=Ze;if(Ze|=4,VS(S.current),US(S,S.current,L,c),Ze=U,mu(0,!1),yt&&typeof yt.onPostCommitFiberRoot=="function")try{yt.onPostCommitFiberRoot(Ft,S)}catch{}return!0}finally{P.p=_,$.T=m,lT(t,i)}}function fT(t,i,c){i=Nn(c,i),i=Fd(t.stateNode,i,2),t=gi(t,i,2),t!==null&&(es(t,2),fr(t))}function nt(t,i,c){if(t.tag===3)fT(t,t,c);else for(;i!==null;){if(i.tag===3){fT(i,t,c);break}else if(i.tag===1){var m=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Ci===null||!Ci.has(m))){t=Nn(c,t),c=hS(2),m=gi(i,c,2),m!==null&&(dS(c,m,i,t),es(m,2),fr(m));break}}i=i.return}}function yp(t,i,c){var m=t.pingCache;if(m===null){m=t.pingCache=new A3;var _=new Set;m.set(i,_)}else _=m.get(i),_===void 0&&(_=new Set,m.set(i,_));_.has(c)||(lp=!0,_.add(c),t=j3.bind(null,t,i,c),i.then(t,t))}function j3(t,i,c){var m=t.pingCache;m!==null&&m.delete(i),t.pingedLanes|=t.suspendedLanes&c,t.warmLanes&=~c,ot===t&&(ze&c)===c&&(_t===4||_t===3&&(ze&62914560)===ze&&300>Oe()-Sc?(Ze&2)===0&&Da(t,0):cp|=c,La===ze&&(La=0)),fr(t)}function hT(t,i){i===0&&(i=ql()),t=os(t,i),t!==null&&(es(t,i),fr(t))}function $3(t){var i=t.memoizedState,c=0;i!==null&&(c=i.retryLane),hT(t,c)}function L3(t,i){var c=0;switch(t.tag){case 31:case 13:var m=t.stateNode,_=t.memoizedState;_!==null&&(c=_.retryLane);break;case 19:m=t.stateNode;break;case 22:m=t.stateNode._retryCache;break;default:throw Error(s(314))}m!==null&&m.delete(i),hT(t,c)}function I3(t,i){return It(t,i)}var Mc=null,Ba=null,vp=!1,jc=!1,bp=!1,Si=0;function fr(t){t!==Ba&&t.next===null&&(Ba===null?Mc=Ba=t:Ba=Ba.next=t),jc=!0,vp||(vp=!0,k3())}function mu(t,i){if(!bp&&jc){bp=!0;do for(var c=!1,m=Mc;m!==null;){if(t!==0){var _=m.pendingLanes;if(_===0)var S=0;else{var L=m.suspendedLanes,U=m.pingedLanes;S=(1<<31-Wt(42|t)+1)-1,S&=_&~(L&~U),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(c=!0,gT(m,S))}else S=ze,S=ua(m,m===ot?S:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(S&3)===0||Zi(m,S)||(c=!0,gT(m,S));m=m.next}while(c);bp=!1}}function D3(){dT()}function dT(){jc=vp=!1;var t=0;Si!==0&&K3()&&(t=Si);for(var i=Oe(),c=null,m=Mc;m!==null;){var _=m.next,S=pT(m,i);S===0?(m.next=null,c===null?Mc=_:c.next=_,_===null&&(Ba=c)):(c=m,(t!==0||(S&3)!==0)&&(jc=!0)),m=_}Lt!==0&&Lt!==5||mu(t),Si!==0&&(Si=0)}function pT(t,i){for(var c=t.suspendedLanes,m=t.pingedLanes,_=t.expirationTimes,S=t.pendingLanes&-62914561;0<S;){var L=31-Wt(S),U=1<<L,Z=_[L];Z===-1?((U&c)===0||(U&m)!==0)&&(_[L]=jh(U,i)):Z<=i&&(t.expiredLanes|=U),S&=~U}if(i=ot,c=ze,c=ua(t,t===i?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),m=t.callbackNode,c===0||t===i&&(tt===2||tt===9)||t.cancelPendingCommit!==null)return m!==null&&m!==null&&Tt(m),t.callbackNode=null,t.callbackPriority=0;if((c&3)===0||Zi(t,c)){if(i=c&-c,i===t.callbackPriority)return i;switch(m!==null&&Tt(m),$o(c)){case 2:case 8:c=rt;break;case 32:c=de;break;case 268435456:c=Me;break;default:c=de}return m=mT.bind(null,t),c=It(c,m),t.callbackPriority=i,t.callbackNode=c,i}return m!==null&&m!==null&&Tt(m),t.callbackPriority=2,t.callbackNode=null,2}function mT(t,i){if(Lt!==0&&Lt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var c=t.callbackNode;if(Oc()&&t.callbackNode!==c)return null;var m=ze;return m=ua(t,t===ot?m:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),m===0?null:(XS(t,m,i),pT(t,Oe()),t.callbackNode!=null&&t.callbackNode===c?mT.bind(null,t):null)}function gT(t,i){if(Oc())return null;XS(t,i,!0)}function k3(){X3(function(){(Ze&6)!==0?It(Je,D3):dT()})}function _p(){if(Si===0){var t=xa;t===0&&(t=sa,sa<<=1,(sa&261888)===0&&(sa=256)),Si=t}return Si}function yT(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:zl(""+t)}function vT(t,i){var c=i.ownerDocument.createElement("input");return c.name=i.name,c.value=i.value,t.id&&c.setAttribute("form",t.id),i.parentNode.insertBefore(c,i),t=new FormData(t),c.parentNode.removeChild(c),t}function B3(t,i,c,m,_){if(i==="submit"&&c&&c.stateNode===_){var S=yT((_[Gt]||null).action),L=m.submitter;L&&(i=(i=L[Gt]||null)?yT(i.formAction):L.getAttribute("formAction"),i!==null&&(S=i,L=null));var U=new Vl("action","action",null,m,_);t.push({event:U,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(Si!==0){var Z=L?vT(_,L):new FormData(_);Pd(c,{pending:!0,data:Z,method:_.method,action:S},null,Z)}}else typeof S=="function"&&(U.preventDefault(),Z=L?vT(_,L):new FormData(_),Pd(c,{pending:!0,data:Z,method:_.method,action:S},S,Z))},currentTarget:_}]})}}for(var wp=0;wp<rd.length;wp++){var Cp=rd[wp],P3=Cp.toLowerCase(),z3=Cp[0].toUpperCase()+Cp.slice(1);Un(P3,"on"+z3)}Un(Yx,"onAnimationEnd"),Un(Xx,"onAnimationIteration"),Un(Wx,"onAnimationStart"),Un("dblclick","onDoubleClick"),Un("focusin","onFocus"),Un("focusout","onBlur"),Un(r3,"onTransitionRun"),Un(i3,"onTransitionStart"),Un(s3,"onTransitionCancel"),Un(Jx,"onTransitionEnd"),oi("onMouseEnter",["mouseout","mouseover"]),oi("onMouseLeave",["mouseout","mouseover"]),oi("onPointerEnter",["pointerout","pointerover"]),oi("onPointerLeave",["pointerout","pointerover"]),Sr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Sr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Sr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Sr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Sr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Sr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var gu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),U3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(gu));function bT(t,i){i=(i&4)!==0;for(var c=0;c<t.length;c++){var m=t[c],_=m.event;m=m.listeners;e:{var S=void 0;if(i)for(var L=m.length-1;0<=L;L--){var U=m[L],Z=U.instance,le=U.currentTarget;if(U=U.listener,Z!==S&&_.isPropagationStopped())break e;S=U,_.currentTarget=le;try{S(_)}catch(pe){Kl(pe)}_.currentTarget=null,S=Z}else for(L=0;L<m.length;L++){if(U=m[L],Z=U.instance,le=U.currentTarget,U=U.listener,Z!==S&&_.isPropagationStopped())break e;S=U,_.currentTarget=le;try{S(_)}catch(pe){Kl(pe)}_.currentTarget=null,S=Z}}}}function Pe(t,i){var c=i[la];c===void 0&&(c=i[la]=new Set);var m=t+"__bubble";c.has(m)||(_T(i,t,2,!1),c.add(m))}function Ep(t,i,c){var m=0;i&&(m|=4),_T(c,t,m,i)}var $c="_reactListening"+Math.random().toString(36).slice(2);function xp(t){if(!t[$c]){t[$c]=!0,Ll.forEach(function(c){c!=="selectionchange"&&(U3.has(c)||Ep(c,!1,t),Ep(c,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[$c]||(i[$c]=!0,Ep("selectionchange",!1,i))}}function _T(t,i,c,m){switch(YT(i)){case 2:var _=gz;break;case 8:_=yz;break;default:_=Bp}c=_.bind(null,i,c,t),_=void 0,!Hh||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(_=!0),m?_!==void 0?t.addEventListener(i,c,{capture:!0,passive:_}):t.addEventListener(i,c,!0):_!==void 0?t.addEventListener(i,c,{passive:_}):t.addEventListener(i,c,!1)}function Sp(t,i,c,m,_){var S=m;if((i&1)===0&&(i&2)===0&&m!==null)e:for(;;){if(m===null)return;var L=m.tag;if(L===3||L===4){var U=m.stateNode.containerInfo;if(U===_)break;if(L===4)for(L=m.return;L!==null;){var Z=L.tag;if((Z===3||Z===4)&&L.stateNode.containerInfo===_)return;L=L.return}for(;U!==null;){if(L=ri(U),L===null)return;if(Z=L.tag,Z===5||Z===6||Z===26||Z===27){m=S=L;continue e}U=U.parentNode}}m=m.return}Sx(function(){var le=S,pe=Uh(c),ge=[];e:{var ce=Zx.get(t);if(ce!==void 0){var he=Vl,Te=t;switch(t){case"keypress":if(Ql(c)===0)break e;case"keydown":case"keyup":he=LP;break;case"focusin":Te="focus",he=Kh;break;case"focusout":Te="blur",he=Kh;break;case"beforeblur":case"afterblur":he=Kh;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=Ax;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=EP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=kP;break;case Yx:case Xx:case Wx:he=TP;break;case Jx:he=PP;break;case"scroll":case"scrollend":he=wP;break;case"wheel":he=UP;break;case"copy":case"cut":case"paste":he=AP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=Rx;break;case"toggle":case"beforetoggle":he=HP}var je=(i&4)!==0,at=!je&&(t==="scroll"||t==="scrollend"),se=je?ce!==null?ce+"Capture":null:ce;je=[];for(var ne=le,ue;ne!==null;){var me=ne;if(ue=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||ue===null||se===null||(me=ko(ne,se),me!=null&&je.push(yu(ne,me,ue))),at)break;ne=ne.return}0<je.length&&(ce=new he(ce,Te,null,c,pe),ge.push({event:ce,listeners:je}))}}if((i&7)===0){e:{if(ce=t==="mouseover"||t==="pointerover",he=t==="mouseout"||t==="pointerout",ce&&c!==zh&&(Te=c.relatedTarget||c.fromElement)&&(ri(Te)||Te[xr]))break e;if((he||ce)&&(ce=pe.window===pe?pe:(ce=pe.ownerDocument)?ce.defaultView||ce.parentWindow:window,he?(Te=c.relatedTarget||c.toElement,he=le,Te=Te?ri(Te):null,Te!==null&&(at=o(Te),je=Te.tag,Te!==at||je!==5&&je!==27&&je!==6)&&(Te=null)):(he=null,Te=le),he!==Te)){if(je=Ax,me="onMouseLeave",se="onMouseEnter",ne="mouse",(t==="pointerout"||t==="pointerover")&&(je=Rx,me="onPointerLeave",se="onPointerEnter",ne="pointer"),at=he==null?ce:si(he),ue=Te==null?ce:si(Te),ce=new je(me,ne+"leave",he,c,pe),ce.target=at,ce.relatedTarget=ue,me=null,ri(pe)===le&&(je=new je(se,ne+"enter",Te,c,pe),je.target=ue,je.relatedTarget=at,me=je),at=me,he&&Te)t:{for(je=Q3,se=he,ne=Te,ue=0,me=se;me;me=je(me))ue++;me=0;for(var Re=ne;Re;Re=je(Re))me++;for(;0<ue-me;)se=je(se),ue--;for(;0<me-ue;)ne=je(ne),me--;for(;ue--;){if(se===ne||ne!==null&&se===ne.alternate){je=se;break t}se=je(se),ne=je(ne)}je=null}else je=null;he!==null&&wT(ge,ce,he,je,!1),Te!==null&&at!==null&&wT(ge,at,Te,je,!0)}}e:{if(ce=le?si(le):window,he=ce.nodeName&&ce.nodeName.toLowerCase(),he==="select"||he==="input"&&ce.type==="file")var Ke=kx;else if(Ix(ce))if(Bx)Ke=e3;else{Ke=JP;var Ae=WP}else he=ce.nodeName,!he||he.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?le&&Ph(le.elementType)&&(Ke=kx):Ke=ZP;if(Ke&&(Ke=Ke(t,le))){Dx(ge,Ke,c,pe);break e}Ae&&Ae(t,ce,le),t==="focusout"&&le&&ce.type==="number"&&le.memoizedProps.value!=null&&Do(ce,"number",ce.value)}switch(Ae=le?si(le):window,t){case"focusin":(Ix(Ae)||Ae.contentEditable==="true")&&(ga=Ae,ed=le,Fo=null);break;case"focusout":Fo=ed=ga=null;break;case"mousedown":td=!0;break;case"contextmenu":case"mouseup":case"dragend":td=!1,Gx(ge,c,pe);break;case"selectionchange":if(n3)break;case"keydown":case"keyup":Gx(ge,c,pe)}var ke;if(Xh)e:{switch(t){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else ma?$x(t,c)&&(Ue="onCompositionEnd"):t==="keydown"&&c.keyCode===229&&(Ue="onCompositionStart");Ue&&(Ox&&c.locale!=="ko"&&(ma||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&ma&&(ke=Tx()):(li=pe,Vh="value"in li?li.value:li.textContent,ma=!0)),Ae=Lc(le,Ue),0<Ae.length&&(Ue=new Nx(Ue,t,null,c,pe),ge.push({event:Ue,listeners:Ae}),ke?Ue.data=ke:(ke=Lx(c),ke!==null&&(Ue.data=ke)))),(ke=FP?GP(t,c):KP(t,c))&&(Ue=Lc(le,"onBeforeInput"),0<Ue.length&&(Ae=new Nx("onBeforeInput","beforeinput",null,c,pe),ge.push({event:Ae,listeners:Ue}),Ae.data=ke)),B3(ge,t,le,c,pe)}bT(ge,i)})}function yu(t,i,c){return{instance:t,listener:i,currentTarget:c}}function Lc(t,i){for(var c=i+"Capture",m=[];t!==null;){var _=t,S=_.stateNode;if(_=_.tag,_!==5&&_!==26&&_!==27||S===null||(_=ko(t,c),_!=null&&m.unshift(yu(t,_,S)),_=ko(t,i),_!=null&&m.push(yu(t,_,S))),t.tag===3)return m;t=t.return}return[]}function Q3(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function wT(t,i,c,m,_){for(var S=i._reactName,L=[];c!==null&&c!==m;){var U=c,Z=U.alternate,le=U.stateNode;if(U=U.tag,Z!==null&&Z===m)break;U!==5&&U!==26&&U!==27||le===null||(Z=le,_?(le=ko(c,S),le!=null&&L.unshift(yu(c,le,Z))):_||(le=ko(c,S),le!=null&&L.push(yu(c,le,Z)))),c=c.return}L.length!==0&&t.push({event:i,listeners:L})}var H3=/\r\n?/g,V3=/\u0000|\uFFFD/g;function CT(t){return(typeof t=="string"?t:""+t).replace(H3,`
49
+ `).replace(V3,"")}function ET(t,i){return i=CT(i),CT(t)===i}function st(t,i,c,m,_,S){switch(c){case"children":typeof m=="string"?i==="body"||i==="textarea"&&m===""||ha(t,m):(typeof m=="number"||typeof m=="bigint")&&i!=="body"&&ha(t,""+m);break;case"className":fa(t,"class",m);break;case"tabIndex":fa(t,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":fa(t,c,m);break;case"style":Ex(t,m,S);break;case"data":if(i!=="object"){fa(t,"data",m);break}case"src":case"href":if(m===""&&(i!=="a"||c!=="href")){t.removeAttribute(c);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){t.removeAttribute(c);break}m=zl(""+m),t.setAttribute(c,m);break;case"action":case"formAction":if(typeof m=="function"){t.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof S=="function"&&(c==="formAction"?(i!=="input"&&st(t,i,"name",_.name,_,null),st(t,i,"formEncType",_.formEncType,_,null),st(t,i,"formMethod",_.formMethod,_,null),st(t,i,"formTarget",_.formTarget,_,null)):(st(t,i,"encType",_.encType,_,null),st(t,i,"method",_.method,_,null),st(t,i,"target",_.target,_,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){t.removeAttribute(c);break}m=zl(""+m),t.setAttribute(c,m);break;case"onClick":m!=null&&(t.onclick=qr);break;case"onScroll":m!=null&&Pe("scroll",t);break;case"onScrollEnd":m!=null&&Pe("scrollend",t);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(s(61));if(c=m.__html,c!=null){if(_.children!=null)throw Error(s(60));t.innerHTML=c}}break;case"multiple":t.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":t.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){t.removeAttribute("xlink:href");break}c=zl(""+m),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?t.setAttribute(c,""+m):t.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?t.setAttribute(c,""):t.removeAttribute(c);break;case"capture":case"download":m===!0?t.setAttribute(c,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?t.setAttribute(c,m):t.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?t.setAttribute(c,m):t.removeAttribute(c);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?t.removeAttribute(c):t.setAttribute(c,m);break;case"popover":Pe("beforetoggle",t),Pe("toggle",t),ca(t,"popover",m);break;case"xlinkActuate":zn(t,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":zn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":zn(t,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":zn(t,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":zn(t,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":zn(t,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":zn(t,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":zn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":zn(t,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":ca(t,"is",m);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=bP.get(c)||c,ca(t,c,m))}}function Tp(t,i,c,m,_,S){switch(c){case"style":Ex(t,m,S);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(s(61));if(c=m.__html,c!=null){if(_.children!=null)throw Error(s(60));t.innerHTML=c}}break;case"children":typeof m=="string"?ha(t,m):(typeof m=="number"||typeof m=="bigint")&&ha(t,""+m);break;case"onScroll":m!=null&&Pe("scroll",t);break;case"onScrollEnd":m!=null&&Pe("scrollend",t);break;case"onClick":m!=null&&(t.onclick=qr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Il.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(_=c.endsWith("Capture"),i=c.slice(2,_?c.length-7:void 0),S=t[Gt]||null,S=S!=null?S[c]:null,typeof S=="function"&&t.removeEventListener(i,S,_),typeof m=="function")){typeof S!="function"&&S!==null&&(c in t?t[c]=null:t.hasAttribute(c)&&t.removeAttribute(c)),t.addEventListener(i,m,_);break e}c in t?t[c]=m:m===!0?t.setAttribute(c,""):ca(t,c,m)}}}function Ut(t,i,c){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Pe("error",t),Pe("load",t);var m=!1,_=!1,S;for(S in c)if(c.hasOwnProperty(S)){var L=c[S];if(L!=null)switch(S){case"src":m=!0;break;case"srcSet":_=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:st(t,i,S,L,c,null)}}_&&st(t,i,"srcSet",c.srcSet,c,null),m&&st(t,i,"src",c.src,c,null);return;case"input":Pe("invalid",t);var U=S=L=_=null,Z=null,le=null;for(m in c)if(c.hasOwnProperty(m)){var pe=c[m];if(pe!=null)switch(m){case"name":_=pe;break;case"type":L=pe;break;case"checked":Z=pe;break;case"defaultChecked":le=pe;break;case"value":S=pe;break;case"defaultValue":U=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(s(137,i));break;default:st(t,i,m,pe,c,null)}}Pl(t,S,U,Z,le,L,_,!1);return;case"select":Pe("invalid",t),m=L=S=null;for(_ in c)if(c.hasOwnProperty(_)&&(U=c[_],U!=null))switch(_){case"value":S=U;break;case"defaultValue":L=U;break;case"multiple":m=U;default:st(t,i,_,U,c,null)}i=S,c=L,t.multiple=!!m,i!=null?Tr(t,!!m,i,!1):c!=null&&Tr(t,!!m,c,!0);return;case"textarea":Pe("invalid",t),S=_=m=null;for(L in c)if(c.hasOwnProperty(L)&&(U=c[L],U!=null))switch(L){case"value":m=U;break;case"defaultValue":_=U;break;case"children":S=U;break;case"dangerouslySetInnerHTML":if(U!=null)throw Error(s(91));break;default:st(t,i,L,U,c,null)}wx(t,m,_,S);return;case"option":for(Z in c)if(c.hasOwnProperty(Z)&&(m=c[Z],m!=null))switch(Z){case"selected":t.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:st(t,i,Z,m,c,null)}return;case"dialog":Pe("beforetoggle",t),Pe("toggle",t),Pe("cancel",t),Pe("close",t);break;case"iframe":case"object":Pe("load",t);break;case"video":case"audio":for(m=0;m<gu.length;m++)Pe(gu[m],t);break;case"image":Pe("error",t),Pe("load",t);break;case"details":Pe("toggle",t);break;case"embed":case"source":case"link":Pe("error",t),Pe("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(le in c)if(c.hasOwnProperty(le)&&(m=c[le],m!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:st(t,i,le,m,c,null)}return;default:if(Ph(i)){for(pe in c)c.hasOwnProperty(pe)&&(m=c[pe],m!==void 0&&Tp(t,i,pe,m,c,void 0));return}}for(U in c)c.hasOwnProperty(U)&&(m=c[U],m!=null&&st(t,i,U,m,c,null))}function F3(t,i,c,m){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var _=null,S=null,L=null,U=null,Z=null,le=null,pe=null;for(he in c){var ge=c[he];if(c.hasOwnProperty(he)&&ge!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":Z=ge;default:m.hasOwnProperty(he)||st(t,i,he,null,m,ge)}}for(var ce in m){var he=m[ce];if(ge=c[ce],m.hasOwnProperty(ce)&&(he!=null||ge!=null))switch(ce){case"type":S=he;break;case"name":_=he;break;case"checked":le=he;break;case"defaultChecked":pe=he;break;case"value":L=he;break;case"defaultValue":U=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(s(137,i));break;default:he!==ge&&st(t,i,ce,he,m,ge)}}rs(t,L,U,Z,le,pe,S,_);return;case"select":he=L=U=ce=null;for(S in c)if(Z=c[S],c.hasOwnProperty(S)&&Z!=null)switch(S){case"value":break;case"multiple":he=Z;default:m.hasOwnProperty(S)||st(t,i,S,null,m,Z)}for(_ in m)if(S=m[_],Z=c[_],m.hasOwnProperty(_)&&(S!=null||Z!=null))switch(_){case"value":ce=S;break;case"defaultValue":U=S;break;case"multiple":L=S;default:S!==Z&&st(t,i,_,S,m,Z)}i=U,c=L,m=he,ce!=null?Tr(t,!!c,ce,!1):!!m!=!!c&&(i!=null?Tr(t,!!c,i,!0):Tr(t,!!c,c?[]:"",!1));return;case"textarea":he=ce=null;for(U in c)if(_=c[U],c.hasOwnProperty(U)&&_!=null&&!m.hasOwnProperty(U))switch(U){case"value":break;case"children":break;default:st(t,i,U,null,m,_)}for(L in m)if(_=m[L],S=c[L],m.hasOwnProperty(L)&&(_!=null||S!=null))switch(L){case"value":ce=_;break;case"defaultValue":he=_;break;case"children":break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(s(91));break;default:_!==S&&st(t,i,L,_,m,S)}_x(t,ce,he);return;case"option":for(var Te in c)if(ce=c[Te],c.hasOwnProperty(Te)&&ce!=null&&!m.hasOwnProperty(Te))switch(Te){case"selected":t.selected=!1;break;default:st(t,i,Te,null,m,ce)}for(Z in m)if(ce=m[Z],he=c[Z],m.hasOwnProperty(Z)&&ce!==he&&(ce!=null||he!=null))switch(Z){case"selected":t.selected=ce&&typeof ce!="function"&&typeof ce!="symbol";break;default:st(t,i,Z,ce,m,he)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var je in c)ce=c[je],c.hasOwnProperty(je)&&ce!=null&&!m.hasOwnProperty(je)&&st(t,i,je,null,m,ce);for(le in m)if(ce=m[le],he=c[le],m.hasOwnProperty(le)&&ce!==he&&(ce!=null||he!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(s(137,i));break;default:st(t,i,le,ce,m,he)}return;default:if(Ph(i)){for(var at in c)ce=c[at],c.hasOwnProperty(at)&&ce!==void 0&&!m.hasOwnProperty(at)&&Tp(t,i,at,void 0,m,ce);for(pe in m)ce=m[pe],he=c[pe],!m.hasOwnProperty(pe)||ce===he||ce===void 0&&he===void 0||Tp(t,i,pe,ce,m,he);return}}for(var se in c)ce=c[se],c.hasOwnProperty(se)&&ce!=null&&!m.hasOwnProperty(se)&&st(t,i,se,null,m,ce);for(ge in m)ce=m[ge],he=c[ge],!m.hasOwnProperty(ge)||ce===he||ce==null&&he==null||st(t,i,ge,ce,m,he)}function xT(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function G3(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,c=performance.getEntriesByType("resource"),m=0;m<c.length;m++){var _=c[m],S=_.transferSize,L=_.initiatorType,U=_.duration;if(S&&U&&xT(L)){for(L=0,U=_.responseEnd,m+=1;m<c.length;m++){var Z=c[m],le=Z.startTime;if(le>U)break;var pe=Z.transferSize,ge=Z.initiatorType;pe&&xT(ge)&&(Z=Z.responseEnd,L+=pe*(Z<U?1:(U-le)/(Z-le)))}if(--m,i+=8*(S+L)/(_.duration/1e3),t++,10<t)break}}if(0<t)return i/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var qp=null,Ap=null;function Ic(t){return t.nodeType===9?t:t.ownerDocument}function ST(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function TT(t,i){if(t===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&i==="foreignObject"?0:t}function Np(t,i){return t==="textarea"||t==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Rp=null;function K3(){var t=window.event;return t&&t.type==="popstate"?t===Rp?!1:(Rp=t,!0):(Rp=null,!1)}var qT=typeof setTimeout=="function"?setTimeout:void 0,Y3=typeof clearTimeout=="function"?clearTimeout:void 0,AT=typeof Promise=="function"?Promise:void 0,X3=typeof queueMicrotask=="function"?queueMicrotask:typeof AT<"u"?function(t){return AT.resolve(null).then(t).catch(W3)}:qT;function W3(t){setTimeout(function(){throw t})}function Ti(t){return t==="head"}function NT(t,i){var c=i,m=0;do{var _=c.nextSibling;if(t.removeChild(c),_&&_.nodeType===8)if(c=_.data,c==="/$"||c==="/&"){if(m===0){t.removeChild(_),Qa(i);return}m--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")m++;else if(c==="html")vu(t.ownerDocument.documentElement);else if(c==="head"){c=t.ownerDocument.head,vu(c);for(var S=c.firstChild;S;){var L=S.nextSibling,U=S.nodeName;S[ts]||U==="SCRIPT"||U==="STYLE"||U==="LINK"&&S.rel.toLowerCase()==="stylesheet"||c.removeChild(S),S=L}}else c==="body"&&vu(t.ownerDocument.body);c=_}while(c);Qa(i)}function RT(t,i){var c=t;t=0;do{var m=c.nextSibling;if(c.nodeType===1?i?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(i?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),m&&m.nodeType===8)if(c=m.data,c==="/$"){if(t===0)break;t--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||t++;c=m}while(c)}function Op(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var c=i;switch(i=i.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Op(c),Lo(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}t.removeChild(c)}}function J3(t,i,c,m){for(;t.nodeType===1;){var _=c;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!m&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(m){if(!t[ts])switch(i){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(S=t.getAttribute("rel"),S==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(S!==_.rel||t.getAttribute("href")!==(_.href==null||_.href===""?null:_.href)||t.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin)||t.getAttribute("title")!==(_.title==null?null:_.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(S=t.getAttribute("src"),(S!==(_.src==null?null:_.src)||t.getAttribute("type")!==(_.type==null?null:_.type)||t.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin))&&S&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var S=_.name==null?null:""+_.name;if(_.type==="hidden"&&t.getAttribute("name")===S)return t}else return t;if(t=$n(t.nextSibling),t===null)break}return null}function Z3(t,i,c){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!c||(t=$n(t.nextSibling),t===null))return null;return t}function OT(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=$n(t.nextSibling),t===null))return null;return t}function Mp(t){return t.data==="$?"||t.data==="$~"}function jp(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function ez(t,i){var c=t.ownerDocument;if(t.data==="$~")t._reactRetry=i;else if(t.data!=="$?"||c.readyState!=="loading")i();else{var m=function(){i(),c.removeEventListener("DOMContentLoaded",m)};c.addEventListener("DOMContentLoaded",m),t._reactRetry=m}}function $n(t){for(;t!=null;t=t.nextSibling){var i=t.nodeType;if(i===1||i===3)break;if(i===8){if(i=t.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return t}var $p=null;function MT(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var c=t.data;if(c==="/$"||c==="/&"){if(i===0)return $n(t.nextSibling);i--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||i++}t=t.nextSibling}return null}function jT(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var c=t.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(i===0)return t;i--}else c!=="/$"&&c!=="/&"||i++}t=t.previousSibling}return null}function $T(t,i,c){switch(i=Ic(c),t){case"html":if(t=i.documentElement,!t)throw Error(s(452));return t;case"head":if(t=i.head,!t)throw Error(s(453));return t;case"body":if(t=i.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function vu(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Lo(t)}var Ln=new Map,LT=new Set;function Dc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Qr=P.d;P.d={f:tz,r:nz,D:rz,C:iz,L:sz,m:az,X:uz,S:oz,M:lz};function tz(){var t=Qr.f(),i=Ac();return t||i}function nz(t){var i=ii(t);i!==null&&i.tag===5&&i.type==="form"?J1(i):Qr.r(t)}var Pa=typeof document>"u"?null:document;function IT(t,i,c){var m=Pa;if(m&&typeof i=="string"&&i){var _=rn(i);_='link[rel="'+t+'"][href="'+_+'"]',typeof c=="string"&&(_+='[crossorigin="'+c+'"]'),LT.has(_)||(LT.add(_),t={rel:t,crossOrigin:c,href:i},m.querySelector(_)===null&&(i=m.createElement("link"),Ut(i,"link",t),At(i),m.head.appendChild(i)))}}function rz(t){Qr.D(t),IT("dns-prefetch",t,null)}function iz(t,i){Qr.C(t,i),IT("preconnect",t,i)}function sz(t,i,c){Qr.L(t,i,c);var m=Pa;if(m&&t&&i){var _='link[rel="preload"][as="'+rn(i)+'"]';i==="image"&&c&&c.imageSrcSet?(_+='[imagesrcset="'+rn(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(_+='[imagesizes="'+rn(c.imageSizes)+'"]')):_+='[href="'+rn(t)+'"]';var S=_;switch(i){case"style":S=za(t);break;case"script":S=Ua(t)}Ln.has(S)||(t=d({rel:"preload",href:i==="image"&&c&&c.imageSrcSet?void 0:t,as:i},c),Ln.set(S,t),m.querySelector(_)!==null||i==="style"&&m.querySelector(bu(S))||i==="script"&&m.querySelector(_u(S))||(i=m.createElement("link"),Ut(i,"link",t),At(i),m.head.appendChild(i)))}}function az(t,i){Qr.m(t,i);var c=Pa;if(c&&t){var m=i&&typeof i.as=="string"?i.as:"script",_='link[rel="modulepreload"][as="'+rn(m)+'"][href="'+rn(t)+'"]',S=_;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=Ua(t)}if(!Ln.has(S)&&(t=d({rel:"modulepreload",href:t},i),Ln.set(S,t),c.querySelector(_)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(_u(S)))return}m=c.createElement("link"),Ut(m,"link",t),At(m),c.head.appendChild(m)}}}function oz(t,i,c){Qr.S(t,i,c);var m=Pa;if(m&&t){var _=ai(m).hoistableStyles,S=za(t);i=i||"default";var L=_.get(S);if(!L){var U={loading:0,preload:null};if(L=m.querySelector(bu(S)))U.loading=5;else{t=d({rel:"stylesheet",href:t,"data-precedence":i},c),(c=Ln.get(S))&&Lp(t,c);var Z=L=m.createElement("link");At(Z),Ut(Z,"link",t),Z._p=new Promise(function(le,pe){Z.onload=le,Z.onerror=pe}),Z.addEventListener("load",function(){U.loading|=1}),Z.addEventListener("error",function(){U.loading|=2}),U.loading|=4,kc(L,i,m)}L={type:"stylesheet",instance:L,count:1,state:U},_.set(S,L)}}}function uz(t,i){Qr.X(t,i);var c=Pa;if(c&&t){var m=ai(c).hoistableScripts,_=Ua(t),S=m.get(_);S||(S=c.querySelector(_u(_)),S||(t=d({src:t,async:!0},i),(i=Ln.get(_))&&Ip(t,i),S=c.createElement("script"),At(S),Ut(S,"link",t),c.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},m.set(_,S))}}function lz(t,i){Qr.M(t,i);var c=Pa;if(c&&t){var m=ai(c).hoistableScripts,_=Ua(t),S=m.get(_);S||(S=c.querySelector(_u(_)),S||(t=d({src:t,async:!0,type:"module"},i),(i=Ln.get(_))&&Ip(t,i),S=c.createElement("script"),At(S),Ut(S,"link",t),c.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},m.set(_,S))}}function DT(t,i,c,m){var _=(_=ie.current)?Dc(_):null;if(!_)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(i=za(c.href),c=ai(_).hoistableStyles,m=c.get(i),m||(m={type:"style",instance:null,count:0,state:null},c.set(i,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){t=za(c.href);var S=ai(_).hoistableStyles,L=S.get(t);if(L||(_=_.ownerDocument||_,L={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(t,L),(S=_.querySelector(bu(t)))&&!S._p&&(L.instance=S,L.state.loading=5),Ln.has(t)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},Ln.set(t,c),S||cz(_,t,c,L.state))),i&&m===null)throw Error(s(528,""));return L}if(i&&m!==null)throw Error(s(529,""));return null;case"script":return i=c.async,c=c.src,typeof c=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Ua(c),c=ai(_).hoistableScripts,m=c.get(i),m||(m={type:"script",instance:null,count:0,state:null},c.set(i,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function za(t){return'href="'+rn(t)+'"'}function bu(t){return'link[rel="stylesheet"]['+t+"]"}function kT(t){return d({},t,{"data-precedence":t.precedence,precedence:null})}function cz(t,i,c,m){t.querySelector('link[rel="preload"][as="style"]['+i+"]")?m.loading=1:(i=t.createElement("link"),m.preload=i,i.addEventListener("load",function(){return m.loading|=1}),i.addEventListener("error",function(){return m.loading|=2}),Ut(i,"link",c),At(i),t.head.appendChild(i))}function Ua(t){return'[src="'+rn(t)+'"]'}function _u(t){return"script[async]"+t}function BT(t,i,c){if(i.count++,i.instance===null)switch(i.type){case"style":var m=t.querySelector('style[data-href~="'+rn(c.href)+'"]');if(m)return i.instance=m,At(m),m;var _=d({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return m=(t.ownerDocument||t).createElement("style"),At(m),Ut(m,"style",_),kc(m,c.precedence,t),i.instance=m;case"stylesheet":_=za(c.href);var S=t.querySelector(bu(_));if(S)return i.state.loading|=4,i.instance=S,At(S),S;m=kT(c),(_=Ln.get(_))&&Lp(m,_),S=(t.ownerDocument||t).createElement("link"),At(S);var L=S;return L._p=new Promise(function(U,Z){L.onload=U,L.onerror=Z}),Ut(S,"link",m),i.state.loading|=4,kc(S,c.precedence,t),i.instance=S;case"script":return S=Ua(c.src),(_=t.querySelector(_u(S)))?(i.instance=_,At(_),_):(m=c,(_=Ln.get(S))&&(m=d({},c),Ip(m,_)),t=t.ownerDocument||t,_=t.createElement("script"),At(_),Ut(_,"link",m),t.head.appendChild(_),i.instance=_);case"void":return null;default:throw Error(s(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(m=i.instance,i.state.loading|=4,kc(m,c.precedence,t));return i.instance}function kc(t,i,c){for(var m=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),_=m.length?m[m.length-1]:null,S=_,L=0;L<m.length;L++){var U=m[L];if(U.dataset.precedence===i)S=U;else if(S!==_)break}S?S.parentNode.insertBefore(t,S.nextSibling):(i=c.nodeType===9?c.head:c,i.insertBefore(t,i.firstChild))}function Lp(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function Ip(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var Bc=null;function PT(t,i,c){if(Bc===null){var m=new Map,_=Bc=new Map;_.set(c,m)}else _=Bc,m=_.get(c),m||(m=new Map,_.set(c,m));if(m.has(t))return m;for(m.set(t,null),c=c.getElementsByTagName(t),_=0;_<c.length;_++){var S=c[_];if(!(S[ts]||S[$t]||t==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var L=S.getAttribute(i)||"";L=t+L;var U=m.get(L);U?U.push(S):m.set(L,[S])}}return m}function zT(t,i,c){t=t.ownerDocument||t,t.head.insertBefore(c,i==="title"?t.querySelector("head > title"):null)}function fz(t,i,c){if(c===1||i.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return t=i.disabled,typeof i.precedence=="string"&&t==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function UT(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function hz(t,i,c,m){if(c.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var _=za(m.href),S=i.querySelector(bu(_));if(S){i=S._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=Pc.bind(t),i.then(t,t)),c.state.loading|=4,c.instance=S,At(S);return}S=i.ownerDocument||i,m=kT(m),(_=Ln.get(_))&&Lp(m,_),S=S.createElement("link"),At(S);var L=S;L._p=new Promise(function(U,Z){L.onload=U,L.onerror=Z}),Ut(S,"link",m),c.instance=S}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(c,i),(i=c.state.preload)&&(c.state.loading&3)===0&&(t.count++,c=Pc.bind(t),i.addEventListener("load",c),i.addEventListener("error",c))}}var Dp=0;function dz(t,i){return t.stylesheets&&t.count===0&&Uc(t,t.stylesheets),0<t.count||0<t.imgCount?function(c){var m=setTimeout(function(){if(t.stylesheets&&Uc(t,t.stylesheets),t.unsuspend){var S=t.unsuspend;t.unsuspend=null,S()}},6e4+i);0<t.imgBytes&&Dp===0&&(Dp=62500*G3());var _=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Uc(t,t.stylesheets),t.unsuspend)){var S=t.unsuspend;t.unsuspend=null,S()}},(t.imgBytes>Dp?50:800)+i);return t.unsuspend=c,function(){t.unsuspend=null,clearTimeout(m),clearTimeout(_)}}:null}function Pc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Uc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var zc=null;function Uc(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,zc=new Map,i.forEach(pz,t),zc=null,Pc.call(t))}function pz(t,i){if(!(i.state.loading&4)){var c=zc.get(t);if(c)var m=c.get(null);else{c=new Map,zc.set(t,c);for(var _=t.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<_.length;S++){var L=_[S];(L.nodeName==="LINK"||L.getAttribute("media")!=="not all")&&(c.set(L.dataset.precedence,L),m=L)}m&&c.set(null,m)}_=i.instance,L=_.getAttribute("data-precedence"),S=c.get(L)||m,S===m&&c.set(null,_),c.set(L,_),this.count++,m=Pc.bind(this),_.addEventListener("load",m),_.addEventListener("error",m),S?S.parentNode.insertBefore(_,S.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(_,t.firstChild)),i.state.loading|=4}}var wu={$$typeof:E,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function mz(t,i,c,m,_,S,L,U,Z){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Mo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Mo(0),this.hiddenUpdates=Mo(null),this.identifierPrefix=m,this.onUncaughtError=_,this.onCaughtError=S,this.onRecoverableError=L,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function QT(t,i,c,m,_,S,L,U,Z,le,pe,ge){return t=new mz(t,i,c,L,Z,le,pe,ge,U),i=1,S===!0&&(i|=24),S=yn(3,null,null,i),t.current=S,S.stateNode=t,i=gd(),i.refCount++,t.pooledCache=i,i.refCount++,S.memoizedState={element:m,isDehydrated:c,cache:i},_d(S),t}function HT(t){return t?(t=ba,t):ba}function VT(t,i,c,m,_,S){_=HT(_),m.context===null?m.context=_:m.pendingContext=_,m=mi(i),m.payload={element:c},S=S===void 0?null:S,S!==null&&(m.callback=S),c=gi(t,m,i),c!==null&&(cn(c,t,i),Zo(c,t,i))}function FT(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var c=t.retryLane;t.retryLane=c!==0&&c<i?c:i}}function kp(t,i){FT(t,i),(t=t.alternate)&&FT(t,i)}function GT(t){if(t.tag===13||t.tag===31){var i=os(t,67108864);i!==null&&cn(i,t,67108864),kp(t,67108864)}}function KT(t){if(t.tag===13||t.tag===31){var i=Cn();i=jo(i);var c=os(t,i);c!==null&&cn(c,t,i),kp(t,i)}}var Qc=!0;function gz(t,i,c,m){var _=$.T;$.T=null;var S=P.p;try{P.p=2,Bp(t,i,c,m)}finally{P.p=S,$.T=_}}function yz(t,i,c,m){var _=$.T;$.T=null;var S=P.p;try{P.p=8,Bp(t,i,c,m)}finally{P.p=S,$.T=_}}function Bp(t,i,c,m){if(Qc){var _=Pp(m);if(_===null)Sp(t,i,m,Hc,c),XT(t,m);else if(bz(_,t,i,c,m))m.stopPropagation();else if(XT(t,m),i&4&&-1<vz.indexOf(t)){for(;_!==null;){var S=ii(_);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var L=Er(S.pendingLanes);if(L!==0){var U=S;for(U.pendingLanes|=2,U.entangledLanes|=2;L;){var Z=1<<31-Wt(L);U.entanglements[1]|=Z,L&=~Z}fr(S),(Ze&6)===0&&(Tc=Oe()+500,mu(0))}}break;case 31:case 13:U=os(S,2),U!==null&&cn(U,S,2),Ac(),kp(S,2)}if(S=Pp(m),S===null&&Sp(t,i,m,Hc,c),S===_)break;_=S}_!==null&&m.stopPropagation()}else Sp(t,i,m,null,c)}}function Pp(t){return t=Uh(t),zp(t)}var Hc=null;function zp(t){if(Hc=null,t=ri(t),t!==null){var i=o(t);if(i===null)t=null;else{var c=i.tag;if(c===13){if(t=l(i),t!==null)return t;t=null}else if(c===31){if(t=u(i),t!==null)return t;t=null}else if(c===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return Hc=t,null}function YT(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(We()){case Je:return 2;case rt:return 8;case de:case X:return 32;case Me:return 268435456;default:return 32}default:return 32}}var Up=!1,qi=null,Ai=null,Ni=null,Cu=new Map,Eu=new Map,Ri=[],vz="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function XT(t,i){switch(t){case"focusin":case"focusout":qi=null;break;case"dragenter":case"dragleave":Ai=null;break;case"mouseover":case"mouseout":Ni=null;break;case"pointerover":case"pointerout":Cu.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Eu.delete(i.pointerId)}}function xu(t,i,c,m,_,S){return t===null||t.nativeEvent!==S?(t={blockedOn:i,domEventName:c,eventSystemFlags:m,nativeEvent:S,targetContainers:[_]},i!==null&&(i=ii(i),i!==null&&GT(i)),t):(t.eventSystemFlags|=m,i=t.targetContainers,_!==null&&i.indexOf(_)===-1&&i.push(_),t)}function bz(t,i,c,m,_){switch(i){case"focusin":return qi=xu(qi,t,i,c,m,_),!0;case"dragenter":return Ai=xu(Ai,t,i,c,m,_),!0;case"mouseover":return Ni=xu(Ni,t,i,c,m,_),!0;case"pointerover":var S=_.pointerId;return Cu.set(S,xu(Cu.get(S)||null,t,i,c,m,_)),!0;case"gotpointercapture":return S=_.pointerId,Eu.set(S,xu(Eu.get(S)||null,t,i,c,m,_)),!0}return!1}function WT(t){var i=ri(t.target);if(i!==null){var c=o(i);if(c!==null){if(i=c.tag,i===13){if(i=l(c),i!==null){t.blockedOn=i,Ml(t.priority,function(){KT(c)});return}}else if(i===31){if(i=u(c),i!==null){t.blockedOn=i,Ml(t.priority,function(){KT(c)});return}}else if(i===3&&c.stateNode.current.memoizedState.isDehydrated){t.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Vc(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var c=Pp(t.nativeEvent);if(c===null){c=t.nativeEvent;var m=new c.constructor(c.type,c);zh=m,c.target.dispatchEvent(m),zh=null}else return i=ii(c),i!==null&&GT(i),t.blockedOn=c,!1;i.shift()}return!0}function JT(t,i,c){Vc(t)&&c.delete(i)}function _z(){Up=!1,qi!==null&&Vc(qi)&&(qi=null),Ai!==null&&Vc(Ai)&&(Ai=null),Ni!==null&&Vc(Ni)&&(Ni=null),Cu.forEach(JT),Eu.forEach(JT)}function Fc(t,i){t.blockedOn===i&&(t.blockedOn=null,Up||(Up=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,_z)))}var Gc=null;function ZT(t){Gc!==t&&(Gc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Gc===t&&(Gc=null);for(var i=0;i<t.length;i+=3){var c=t[i],m=t[i+1],_=t[i+2];if(typeof m!="function"){if(zp(m||c)===null)continue;break}var S=ii(c);S!==null&&(t.splice(i,3),i-=3,Pd(S,{pending:!0,data:_,method:c.method,action:m},m,_))}}))}function Qa(t){function i(Z){return Fc(Z,t)}qi!==null&&Fc(qi,t),Ai!==null&&Fc(Ai,t),Ni!==null&&Fc(Ni,t),Cu.forEach(i),Eu.forEach(i);for(var c=0;c<Ri.length;c++){var m=Ri[c];m.blockedOn===t&&(m.blockedOn=null)}for(;0<Ri.length&&(c=Ri[0],c.blockedOn===null);)WT(c),c.blockedOn===null&&Ri.shift();if(c=(t.ownerDocument||t).$$reactFormReplay,c!=null)for(m=0;m<c.length;m+=3){var _=c[m],S=c[m+1],L=_[Gt]||null;if(typeof S=="function")L||ZT(c);else if(L){var U=null;if(S&&S.hasAttribute("formAction")){if(_=S,L=S[Gt]||null)U=L.formAction;else if(zp(_)!==null)continue}else U=L.action;typeof U=="function"?c[m+1]=U:(c.splice(m,3),m-=3),ZT(c)}}}function eq(){function t(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(L){return _=L})},focusReset:"manual",scroll:"manual"})}function i(){_!==null&&(_(),_=null),m||setTimeout(c,20)}function c(){if(!m&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,_=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(c,100),function(){m=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),_!==null&&(_(),_=null)}}}function Qp(t){this._internalRoot=t}Kc.prototype.render=Qp.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(s(409));var c=i.current,m=Cn();VT(c,m,t,i,null,null)},Kc.prototype.unmount=Qp.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;VT(t.current,2,null,t,null,null),Ac(),i[xr]=null}};function Kc(t){this._internalRoot=t}Kc.prototype.unstable_scheduleHydration=function(t){if(t){var i=Ol();t={blockedOn:null,target:t,priority:i};for(var c=0;c<Ri.length&&i!==0&&i<Ri[c].priority;c++);Ri.splice(c,0,t),c===0&&WT(t)}};var tq=n.version;if(tq!=="19.2.4")throw Error(s(527,tq,"19.2.4"));P.findDOMNode=function(t){var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=f(i),t=t!==null?p(t):null,t=t===null?null:t.stateNode,t};var wz={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yc.isDisabled&&Yc.supportsFiber)try{Ft=Yc.inject(wz),yt=Yc}catch{}}return Tu.createRoot=function(t,i){if(!a(t))throw Error(s(299));var c=!1,m="",_=uS,S=lS,L=cS;return i!=null&&(i.unstable_strictMode===!0&&(c=!0),i.identifierPrefix!==void 0&&(m=i.identifierPrefix),i.onUncaughtError!==void 0&&(_=i.onUncaughtError),i.onCaughtError!==void 0&&(S=i.onCaughtError),i.onRecoverableError!==void 0&&(L=i.onRecoverableError)),i=QT(t,1,!1,null,null,c,m,null,_,S,L,eq),t[xr]=i.current,xp(t),new Qp(i)},Tu.hydrateRoot=function(t,i,c){if(!a(t))throw Error(s(299));var m=!1,_="",S=uS,L=lS,U=cS,Z=null;return c!=null&&(c.unstable_strictMode===!0&&(m=!0),c.identifierPrefix!==void 0&&(_=c.identifierPrefix),c.onUncaughtError!==void 0&&(S=c.onUncaughtError),c.onCaughtError!==void 0&&(L=c.onCaughtError),c.onRecoverableError!==void 0&&(U=c.onRecoverableError),c.formState!==void 0&&(Z=c.formState)),i=QT(t,1,!0,i,c??null,m,_,Z,S,L,U,eq),i.context=HT(null),c=i.current,m=Cn(),m=jo(m),_=mi(m),_.callback=null,gi(c,_,m),c=m,i.current.lanes=c,es(i,c),fr(i),t[xr]=i.current,xp(t),new Kc(i)},Tu.version="19.2.4",Tu}var hq;function jz(){if(hq)return Gp.exports;hq=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Gp.exports=Mz(),Gp.exports}var $z=jz(),Qs=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Lz={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)},Ii,lE,hI,Iz=(hI=class{constructor(){Ee(this,Ii,Lz);Ee(this,lE,!1)}setTimeoutProvider(e){ye(this,Ii,e)}setTimeout(e,n){return Y(this,Ii).setTimeout(e,n)}clearTimeout(e){Y(this,Ii).clearTimeout(e)}setInterval(e,n){return Y(this,Ii).setInterval(e,n)}clearInterval(e){Y(this,Ii).clearInterval(e)}},Ii=new WeakMap,lE=new WeakMap,hI),Cs=new Iz;function Dz(e){setTimeout(e,0)}var Ls=typeof window>"u"||"Deno"in globalThis;function Xt(){}function kz(e,n){return typeof e=="function"?e(n):e}function xC(e){return typeof e=="number"&&e>=0&&e!==1/0}function SI(e,n){return Math.max(e+(n||0)-Date.now(),0)}function Fi(e,n){return typeof e=="function"?e(n):e}function kn(e,n){return typeof e=="function"?e(n):e}function dq(e,n){const{type:r="all",exact:s,fetchStatus:a,predicate:o,queryKey:l,stale:u}=e;if(l){if(s){if(n.queryHash!==fE(l,n.options))return!1}else if(!Pu(n.queryKey,l))return!1}if(r!=="all"){const h=n.isActive();if(r==="active"&&!h||r==="inactive"&&h)return!1}return!(typeof u=="boolean"&&n.isStale()!==u||a&&a!==n.state.fetchStatus||o&&!o(n))}function pq(e,n){const{exact:r,status:s,predicate:a,mutationKey:o}=e;if(o){if(!n.options.mutationKey)return!1;if(r){if(Ki(n.options.mutationKey)!==Ki(o))return!1}else if(!Pu(n.options.mutationKey,o))return!1}return!(s&&n.state.status!==s||a&&!a(n))}function fE(e,n){return((n==null?void 0:n.queryKeyHashFn)||Ki)(e)}function Ki(e){return JSON.stringify(e,(n,r)=>SC(r)?Object.keys(r).sort().reduce((s,a)=>(s[a]=r[a],s),{}):r)}function Pu(e,n){return e===n?!0:typeof e!=typeof n?!1:e&&n&&typeof e=="object"&&typeof n=="object"?Object.keys(n).every(r=>Pu(e[r],n[r])):!1}var Bz=Object.prototype.hasOwnProperty;function hE(e,n,r=0){if(e===n)return e;if(r>500)return n;const s=mq(e)&&mq(n);if(!s&&!(SC(e)&&SC(n)))return n;const o=(s?e:Object.keys(e)).length,l=s?n:Object.keys(n),u=l.length,h=s?new Array(u):{};let f=0;for(let p=0;p<u;p++){const d=s?p:l[p],g=e[d],y=n[d];if(g===y){h[d]=g,(s?p<o:Bz.call(e,d))&&f++;continue}if(g===null||y===null||typeof g!="object"||typeof y!="object"){h[d]=y;continue}const C=hE(g,y,r+1);h[d]=C,C===g&&f++}return o===u&&f===o?e:h}function zu(e,n){if(!n||Object.keys(e).length!==Object.keys(n).length)return!1;for(const r in e)if(e[r]!==n[r])return!1;return!0}function mq(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function SC(e){if(!gq(e))return!1;const n=e.constructor;if(n===void 0)return!0;const r=n.prototype;return!(!gq(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function gq(e){return Object.prototype.toString.call(e)==="[object Object]"}function Pz(e){return new Promise(n=>{Cs.setTimeout(n,e)})}function TC(e,n,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,n):r.structuralSharing!==!1?hE(e,n):n}function zz(e,n,r=0){const s=[...e,n];return r&&s.length>r?s.slice(1):s}function Uz(e,n,r=0){const s=[n,...e];return r&&s.length>r?s.slice(0,-1):s}var xn=Symbol();function TI(e,n){return!e.queryFn&&(n!=null&&n.initialPromise)?()=>n.initialPromise:!e.queryFn||e.queryFn===xn?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function dE(e,n){return typeof e=="function"?e(...n):!!e}function Qz(e,n,r){let s=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=n()),s||(s=!0,a.aborted?r():a.addEventListener("abort",r,{once:!0})),a)}),e}var xs,Di,Wa,dI,Hz=(dI=class extends Qs{constructor(){super();Ee(this,xs);Ee(this,Di);Ee(this,Wa);ye(this,Wa,n=>{if(!Ls&&window.addEventListener){const r=()=>n();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){Y(this,Di)||this.setEventListener(Y(this,Wa))}onUnsubscribe(){var n;this.hasListeners()||((n=Y(this,Di))==null||n.call(this),ye(this,Di,void 0))}setEventListener(n){var r;ye(this,Wa,n),(r=Y(this,Di))==null||r.call(this),ye(this,Di,n(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(n){Y(this,xs)!==n&&(ye(this,xs,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(r=>{r(n)})}isFocused(){var n;return typeof Y(this,xs)=="boolean"?Y(this,xs):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},xs=new WeakMap,Di=new WeakMap,Wa=new WeakMap,dI),pE=new Hz;function qC(){let e,n;const r=new Promise((a,o)=>{e=a,n=o});r.status="pending",r.catch(()=>{});function s(a){Object.assign(r,a),delete r.resolve,delete r.reject}return r.resolve=a=>{s({status:"fulfilled",value:a}),e(a)},r.reject=a=>{s({status:"rejected",reason:a}),n(a)},r}var Vz=Dz;function Fz(){let e=[],n=0,r=u=>{u()},s=u=>{u()},a=Vz;const o=u=>{n?e.push(u):a(()=>{r(u)})},l=()=>{const u=e;e=[],u.length&&a(()=>{s(()=>{u.forEach(h=>{r(h)})})})};return{batch:u=>{let h;n++;try{h=u()}finally{n--,n||l()}return h},batchCalls:u=>(...h)=>{o(()=>{u(...h)})},schedule:o,setNotifyFunction:u=>{r=u},setBatchNotifyFunction:u=>{s=u},setScheduler:u=>{a=u}}}var Ct=Fz(),Ja,ki,Za,pI,Gz=(pI=class extends Qs{constructor(){super();Ee(this,Ja,!0);Ee(this,ki);Ee(this,Za);ye(this,Za,n=>{if(!Ls&&window.addEventListener){const r=()=>n(!0),s=()=>n(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",s)}}})}onSubscribe(){Y(this,ki)||this.setEventListener(Y(this,Za))}onUnsubscribe(){var n;this.hasListeners()||((n=Y(this,ki))==null||n.call(this),ye(this,ki,void 0))}setEventListener(n){var r;ye(this,Za,n),(r=Y(this,ki))==null||r.call(this),ye(this,ki,n(this.setOnline.bind(this)))}setOnline(n){Y(this,Ja)!==n&&(ye(this,Ja,n),this.listeners.forEach(s=>{s(n)}))}isOnline(){return Y(this,Ja)}},Ja=new WeakMap,ki=new WeakMap,Za=new WeakMap,pI),Af=new Gz;function Kz(e){return Math.min(1e3*2**e,3e4)}function qI(e){return(e??"online")==="online"?Af.isOnline():!0}var AC=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function AI(e){let n=!1,r=0,s;const a=qC(),o=()=>a.status!=="pending",l=x=>{var v;if(!o()){const b=new AC(x);g(b),(v=e.onCancel)==null||v.call(e,b)}},u=()=>{n=!0},h=()=>{n=!1},f=()=>pE.isFocused()&&(e.networkMode==="always"||Af.isOnline())&&e.canRun(),p=()=>qI(e.networkMode)&&e.canRun(),d=x=>{o()||(s==null||s(),a.resolve(x))},g=x=>{o()||(s==null||s(),a.reject(x))},y=()=>new Promise(x=>{var v;s=b=>{(o()||f())&&x(b)},(v=e.onPause)==null||v.call(e)}).then(()=>{var x;s=void 0,o()||(x=e.onContinue)==null||x.call(e)}),C=()=>{if(o())return;let x;const v=r===0?e.initialPromise:void 0;try{x=v??e.fn()}catch(b){x=Promise.reject(b)}Promise.resolve(x).then(d).catch(b=>{var R;if(o())return;const w=e.retry??(Ls?0:3),E=e.retryDelay??Kz,q=typeof E=="function"?E(r,b):E,A=w===!0||typeof w=="number"&&r<w||typeof w=="function"&&w(r,b);if(n||!A){g(b);return}r++,(R=e.onFail)==null||R.call(e,r,b),Pz(q).then(()=>f()?void 0:y()).then(()=>{n?g(b):C()})})};return{promise:a,status:()=>a.status,cancel:l,continue:()=>(s==null||s(),a),cancelRetry:u,continueRetry:h,canStart:p,start:()=>(p()?C():y().then(C),a)}}var Ss,mI,NI=(mI=class{constructor(){Ee(this,Ss)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),xC(this.gcTime)&&ye(this,Ss,Cs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ls?1/0:300*1e3))}clearGcTimeout(){Y(this,Ss)&&(Cs.clearTimeout(Y(this,Ss)),ye(this,Ss,void 0))}},Ss=new WeakMap,mI),Ts,eo,In,qs,kt,Wu,As,Fn,Vr,gI,Yz=(gI=class extends NI{constructor(n){super();Ee(this,Fn);Ee(this,Ts);Ee(this,eo);Ee(this,In);Ee(this,qs);Ee(this,kt);Ee(this,Wu);Ee(this,As);ye(this,As,!1),ye(this,Wu,n.defaultOptions),this.setOptions(n.options),this.observers=[],ye(this,qs,n.client),ye(this,In,Y(this,qs).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,ye(this,Ts,vq(this.options)),this.state=n.state??Y(this,Ts),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var n;return(n=Y(this,kt))==null?void 0:n.promise}setOptions(n){if(this.options={...Y(this,Wu),...n},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=vq(this.options);r.data!==void 0&&(this.setState(yq(r.data,r.dataUpdatedAt)),ye(this,Ts,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Y(this,In).remove(this)}setData(n,r){const s=TC(this.state.data,n,this.options);return $e(this,Fn,Vr).call(this,{data:s,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),s}setState(n,r){$e(this,Fn,Vr).call(this,{type:"setState",state:n,setStateOptions:r})}cancel(n){var s,a;const r=(s=Y(this,kt))==null?void 0:s.promise;return(a=Y(this,kt))==null||a.cancel(n),r?r.then(Xt).catch(Xt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Y(this,Ts))}isActive(){return this.observers.some(n=>kn(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===xn||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>Fi(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!SI(this.state.dataUpdatedAt,n)}onFocus(){var r;const n=this.observers.find(s=>s.shouldFetchOnWindowFocus());n==null||n.refetch({cancelRefetch:!1}),(r=Y(this,kt))==null||r.continue()}onOnline(){var r;const n=this.observers.find(s=>s.shouldFetchOnReconnect());n==null||n.refetch({cancelRefetch:!1}),(r=Y(this,kt))==null||r.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),Y(this,In).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(r=>r!==n),this.observers.length||(Y(this,kt)&&(Y(this,As)?Y(this,kt).cancel({revert:!0}):Y(this,kt).cancelRetry()),this.scheduleGc()),Y(this,In).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||$e(this,Fn,Vr).call(this,{type:"invalidate"})}async fetch(n,r){var h,f,p,d,g,y,C,x,v,b,w,E;if(this.state.fetchStatus!=="idle"&&((h=Y(this,kt))==null?void 0:h.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(Y(this,kt))return Y(this,kt).continueRetry(),Y(this,kt).promise}if(n&&this.setOptions(n),!this.options.queryFn){const q=this.observers.find(A=>A.options.queryFn);q&&this.setOptions(q.options)}const s=new AbortController,a=q=>{Object.defineProperty(q,"signal",{enumerable:!0,get:()=>(ye(this,As,!0),s.signal)})},o=()=>{const q=TI(this.options,r),R=(()=>{const O={client:Y(this,qs),queryKey:this.queryKey,meta:this.meta};return a(O),O})();return ye(this,As,!1),this.options.persister?this.options.persister(q,R,this):q(R)},u=(()=>{const q={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:Y(this,qs),state:this.state,fetchFn:o};return a(q),q})();(f=this.options.behavior)==null||f.onFetch(u,this),ye(this,eo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=u.fetchOptions)==null?void 0:p.meta))&&$e(this,Fn,Vr).call(this,{type:"fetch",meta:(d=u.fetchOptions)==null?void 0:d.meta}),ye(this,kt,AI({initialPromise:r==null?void 0:r.initialPromise,fn:u.fetchFn,onCancel:q=>{q instanceof AC&&q.revert&&this.setState({...Y(this,eo),fetchStatus:"idle"}),s.abort()},onFail:(q,A)=>{$e(this,Fn,Vr).call(this,{type:"failed",failureCount:q,error:A})},onPause:()=>{$e(this,Fn,Vr).call(this,{type:"pause"})},onContinue:()=>{$e(this,Fn,Vr).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const q=await Y(this,kt).start();if(q===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(q),(y=(g=Y(this,In).config).onSuccess)==null||y.call(g,q,this),(x=(C=Y(this,In).config).onSettled)==null||x.call(C,q,this.state.error,this),q}catch(q){if(q instanceof AC){if(q.silent)return Y(this,kt).promise;if(q.revert){if(this.state.data===void 0)throw q;return this.state.data}}throw $e(this,Fn,Vr).call(this,{type:"error",error:q}),(b=(v=Y(this,In).config).onError)==null||b.call(v,q,this),(E=(w=Y(this,In).config).onSettled)==null||E.call(w,this.state.data,q,this),q}finally{this.scheduleGc()}}},Ts=new WeakMap,eo=new WeakMap,In=new WeakMap,qs=new WeakMap,kt=new WeakMap,Wu=new WeakMap,As=new WeakMap,Fn=new WeakSet,Vr=function(n){const r=s=>{switch(n.type){case"failed":return{...s,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...RI(s.data,this.options),fetchMeta:n.meta??null};case"success":const a={...s,...yq(n.data,n.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ye(this,eo,n.manual?a:void 0),a;case"error":const o=n.error;return{...s,error:o,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...n.state}}};this.state=r(this.state),Ct.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),Y(this,In).notify({query:this,type:"updated",action:n})})},gI);function RI(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:qI(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function yq(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function vq(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,r=n!==void 0,s=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var fn,Ve,Ju,Zt,Ns,to,Fr,Bi,Zu,no,ro,Rs,Os,Pi,io,et,Ou,NC,RC,OC,MC,jC,$C,LC,OI,yI,ol=(yI=class extends Qs{constructor(n,r){super();Ee(this,et);Ee(this,fn);Ee(this,Ve);Ee(this,Ju);Ee(this,Zt);Ee(this,Ns);Ee(this,to);Ee(this,Fr);Ee(this,Bi);Ee(this,Zu);Ee(this,no);Ee(this,ro);Ee(this,Rs);Ee(this,Os);Ee(this,Pi);Ee(this,io,new Set);this.options=r,ye(this,fn,n),ye(this,Bi,null),ye(this,Fr,qC()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Y(this,Ve).addObserver(this),bq(Y(this,Ve),this.options)?$e(this,et,Ou).call(this):this.updateResult(),$e(this,et,MC).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return IC(Y(this,Ve),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return IC(Y(this,Ve),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,$e(this,et,jC).call(this),$e(this,et,$C).call(this),Y(this,Ve).removeObserver(this)}setOptions(n){const r=this.options,s=Y(this,Ve);if(this.options=Y(this,fn).defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof kn(this.options.enabled,Y(this,Ve))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");$e(this,et,LC).call(this),Y(this,Ve).setOptions(this.options),r._defaulted&&!zu(this.options,r)&&Y(this,fn).getQueryCache().notify({type:"observerOptionsUpdated",query:Y(this,Ve),observer:this});const a=this.hasListeners();a&&_q(Y(this,Ve),s,this.options,r)&&$e(this,et,Ou).call(this),this.updateResult(),a&&(Y(this,Ve)!==s||kn(this.options.enabled,Y(this,Ve))!==kn(r.enabled,Y(this,Ve))||Fi(this.options.staleTime,Y(this,Ve))!==Fi(r.staleTime,Y(this,Ve)))&&$e(this,et,NC).call(this);const o=$e(this,et,RC).call(this);a&&(Y(this,Ve)!==s||kn(this.options.enabled,Y(this,Ve))!==kn(r.enabled,Y(this,Ve))||o!==Y(this,Pi))&&$e(this,et,OC).call(this,o)}getOptimisticResult(n){const r=Y(this,fn).getQueryCache().build(Y(this,fn),n),s=this.createResult(r,n);return Wz(this,s)&&(ye(this,Zt,s),ye(this,to,this.options),ye(this,Ns,Y(this,Ve).state)),s}getCurrentResult(){return Y(this,Zt)}trackResult(n,r){return new Proxy(n,{get:(s,a)=>(this.trackProp(a),r==null||r(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&Y(this,Fr).status==="pending"&&Y(this,Fr).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,a))})}trackProp(n){Y(this,io).add(n)}getCurrentQuery(){return Y(this,Ve)}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const r=Y(this,fn).defaultQueryOptions(n),s=Y(this,fn).getQueryCache().build(Y(this,fn),r);return s.fetch().then(()=>this.createResult(s,r))}fetch(n){return $e(this,et,Ou).call(this,{...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),Y(this,Zt)))}createResult(n,r){var k;const s=Y(this,Ve),a=this.options,o=Y(this,Zt),l=Y(this,Ns),u=Y(this,to),f=n!==s?n.state:Y(this,Ju),{state:p}=n;let d={...p},g=!1,y;if(r._optimisticResults){const N=this.hasListeners(),j=!N&&bq(n,r),D=N&&_q(n,s,r,a);(j||D)&&(d={...d,...RI(p.data,n.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:C,errorUpdatedAt:x,status:v}=d;y=d.data;let b=!1;if(r.placeholderData!==void 0&&y===void 0&&v==="pending"){let N;o!=null&&o.isPlaceholderData&&r.placeholderData===(u==null?void 0:u.placeholderData)?(N=o.data,b=!0):N=typeof r.placeholderData=="function"?r.placeholderData((k=Y(this,ro))==null?void 0:k.state.data,Y(this,ro)):r.placeholderData,N!==void 0&&(v="success",y=TC(o==null?void 0:o.data,N,r),g=!0)}if(r.select&&y!==void 0&&!b)if(o&&y===(l==null?void 0:l.data)&&r.select===Y(this,Zu))y=Y(this,no);else try{ye(this,Zu,r.select),y=r.select(y),y=TC(o==null?void 0:o.data,y,r),ye(this,no,y),ye(this,Bi,null)}catch(N){ye(this,Bi,N)}Y(this,Bi)&&(C=Y(this,Bi),y=Y(this,no),x=Date.now(),v="error");const w=d.fetchStatus==="fetching",E=v==="pending",q=v==="error",A=E&&w,R=y!==void 0,I={status:v,fetchStatus:d.fetchStatus,isPending:E,isSuccess:v==="success",isError:q,isInitialLoading:A,isLoading:A,data:y,dataUpdatedAt:d.dataUpdatedAt,error:C,errorUpdatedAt:x,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>f.dataUpdateCount||d.errorUpdateCount>f.errorUpdateCount,isFetching:w,isRefetching:w&&!E,isLoadingError:q&&!R,isPaused:d.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:q&&R,isStale:mE(n,r),refetch:this.refetch,promise:Y(this,Fr),isEnabled:kn(r.enabled,n)!==!1};if(this.options.experimental_prefetchInRender){const N=I.data!==void 0,j=I.status==="error"&&!N,D=M=>{j?M.reject(I.error):N&&M.resolve(I.data)},z=()=>{const M=ye(this,Fr,I.promise=qC());D(M)},T=Y(this,Fr);switch(T.status){case"pending":n.queryHash===s.queryHash&&D(T);break;case"fulfilled":(j||I.data!==T.value)&&z();break;case"rejected":(!j||I.error!==T.reason)&&z();break}}return I}updateResult(){const n=Y(this,Zt),r=this.createResult(Y(this,Ve),this.options);if(ye(this,Ns,Y(this,Ve).state),ye(this,to,this.options),Y(this,Ns).data!==void 0&&ye(this,ro,Y(this,Ve)),zu(r,n))return;ye(this,Zt,r);const s=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!Y(this,io).size)return!0;const l=new Set(o??Y(this,io));return this.options.throwOnError&&l.add("error"),Object.keys(Y(this,Zt)).some(u=>{const h=u;return Y(this,Zt)[h]!==n[h]&&l.has(h)})};$e(this,et,OI).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&$e(this,et,MC).call(this)}},fn=new WeakMap,Ve=new WeakMap,Ju=new WeakMap,Zt=new WeakMap,Ns=new WeakMap,to=new WeakMap,Fr=new WeakMap,Bi=new WeakMap,Zu=new WeakMap,no=new WeakMap,ro=new WeakMap,Rs=new WeakMap,Os=new WeakMap,Pi=new WeakMap,io=new WeakMap,et=new WeakSet,Ou=function(n){$e(this,et,LC).call(this);let r=Y(this,Ve).fetch(this.options,n);return n!=null&&n.throwOnError||(r=r.catch(Xt)),r},NC=function(){$e(this,et,jC).call(this);const n=Fi(this.options.staleTime,Y(this,Ve));if(Ls||Y(this,Zt).isStale||!xC(n))return;const s=SI(Y(this,Zt).dataUpdatedAt,n)+1;ye(this,Rs,Cs.setTimeout(()=>{Y(this,Zt).isStale||this.updateResult()},s))},RC=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Y(this,Ve)):this.options.refetchInterval)??!1},OC=function(n){$e(this,et,$C).call(this),ye(this,Pi,n),!(Ls||kn(this.options.enabled,Y(this,Ve))===!1||!xC(Y(this,Pi))||Y(this,Pi)===0)&&ye(this,Os,Cs.setInterval(()=>{(this.options.refetchIntervalInBackground||pE.isFocused())&&$e(this,et,Ou).call(this)},Y(this,Pi)))},MC=function(){$e(this,et,NC).call(this),$e(this,et,OC).call(this,$e(this,et,RC).call(this))},jC=function(){Y(this,Rs)&&(Cs.clearTimeout(Y(this,Rs)),ye(this,Rs,void 0))},$C=function(){Y(this,Os)&&(Cs.clearInterval(Y(this,Os)),ye(this,Os,void 0))},LC=function(){const n=Y(this,fn).getQueryCache().build(Y(this,fn),this.options);if(n===Y(this,Ve))return;const r=Y(this,Ve);ye(this,Ve,n),ye(this,Ju,n.state),this.hasListeners()&&(r==null||r.removeObserver(this),n.addObserver(this))},OI=function(n){Ct.batch(()=>{n.listeners&&this.listeners.forEach(r=>{r(Y(this,Zt))}),Y(this,fn).getQueryCache().notify({query:Y(this,Ve),type:"observerResultsUpdated"})})},yI);function Xz(e,n){return kn(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&n.retryOnMount===!1)}function bq(e,n){return Xz(e,n)||e.state.data!==void 0&&IC(e,n,n.refetchOnMount)}function IC(e,n,r){if(kn(n.enabled,e)!==!1&&Fi(n.staleTime,e)!=="static"){const s=typeof r=="function"?r(e):r;return s==="always"||s!==!1&&mE(e,n)}return!1}function _q(e,n,r,s){return(e!==n||kn(s.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&mE(e,r)}function mE(e,n){return kn(n.enabled,e)!==!1&&e.isStaleByTime(Fi(n.staleTime,e))}function Wz(e,n){return!zu(e.getCurrentResult(),n)}function Nf(e){return{onFetch:(n,r)=>{var p,d,g,y,C;const s=n.options,a=(g=(d=(p=n.fetchOptions)==null?void 0:p.meta)==null?void 0:d.fetchMore)==null?void 0:g.direction,o=((y=n.state.data)==null?void 0:y.pages)||[],l=((C=n.state.data)==null?void 0:C.pageParams)||[];let u={pages:[],pageParams:[]},h=0;const f=async()=>{let x=!1;const v=E=>{Qz(E,()=>n.signal,()=>x=!0)},b=TI(n.options,n.fetchOptions),w=async(E,q,A)=>{if(x)return Promise.reject();if(q==null&&E.pages.length)return Promise.resolve(E);const O=(()=>{const j={client:n.client,queryKey:n.queryKey,pageParam:q,direction:A?"backward":"forward",meta:n.options.meta};return v(j),j})(),I=await b(O),{maxPages:k}=n.options,N=A?Uz:zz;return{pages:N(E.pages,I,k),pageParams:N(E.pageParams,q,k)}};if(a&&o.length){const E=a==="backward",q=E?MI:DC,A={pages:o,pageParams:l},R=q(s,A);u=await w(A,R,E)}else{const E=e??o.length;do{const q=h===0?l[0]??s.initialPageParam:DC(s,u);if(h>0&&q==null)break;u=await w(u,q),h++}while(h<E)}return u};n.options.persister?n.fetchFn=()=>{var x,v;return(v=(x=n.options).persister)==null?void 0:v.call(x,f,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},r)}:n.fetchFn=f}}}function DC(e,{pages:n,pageParams:r}){const s=n.length-1;return n.length>0?e.getNextPageParam(n[s],n,r[s],r):void 0}function MI(e,{pages:n,pageParams:r}){var s;return n.length>0?(s=e.getPreviousPageParam)==null?void 0:s.call(e,n[0],n,r[0],r):void 0}function Jz(e,n){return n?DC(e,n)!=null:!1}function Zz(e,n){return!n||!e.getPreviousPageParam?!1:MI(e,n)!=null}var jI=class extends ol{constructor(e,n){super(e,n)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:Nf()})}getOptimisticResult(e){return e.behavior=Nf(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,n){var C,x;const{state:r}=e,s=super.createResult(e,n),{isFetching:a,isRefetching:o,isError:l,isRefetchError:u}=s,h=(x=(C=r.fetchMeta)==null?void 0:C.fetchMore)==null?void 0:x.direction,f=l&&h==="forward",p=a&&h==="forward",d=l&&h==="backward",g=a&&h==="backward";return{...s,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Jz(n,r.data),hasPreviousPage:Zz(n,r.data),isFetchNextPageError:f,isFetchingNextPage:p,isFetchPreviousPageError:d,isFetchingPreviousPage:g,isRefetchError:u&&!f&&!d,isRefetching:o&&!p&&!g}}},el,dr,Yt,Ms,pr,$i,vI,eU=(vI=class extends NI{constructor(n){super();Ee(this,pr);Ee(this,el);Ee(this,dr);Ee(this,Yt);Ee(this,Ms);ye(this,el,n.client),this.mutationId=n.mutationId,ye(this,Yt,n.mutationCache),ye(this,dr,[]),this.state=n.state||$I(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){Y(this,dr).includes(n)||(Y(this,dr).push(n),this.clearGcTimeout(),Y(this,Yt).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){ye(this,dr,Y(this,dr).filter(r=>r!==n)),this.scheduleGc(),Y(this,Yt).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){Y(this,dr).length||(this.state.status==="pending"?this.scheduleGc():Y(this,Yt).remove(this))}continue(){var n;return((n=Y(this,Ms))==null?void 0:n.continue())??this.execute(this.state.variables)}async execute(n){var l,u,h,f,p,d,g,y,C,x,v,b,w,E,q,A,R,O;const r=()=>{$e(this,pr,$i).call(this,{type:"continue"})},s={client:Y(this,el),meta:this.options.meta,mutationKey:this.options.mutationKey};ye(this,Ms,AI({fn:()=>this.options.mutationFn?this.options.mutationFn(n,s):Promise.reject(new Error("No mutationFn found")),onFail:(I,k)=>{$e(this,pr,$i).call(this,{type:"failed",failureCount:I,error:k})},onPause:()=>{$e(this,pr,$i).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Y(this,Yt).canRun(this)}));const a=this.state.status==="pending",o=!Y(this,Ms).canStart();try{if(a)r();else{$e(this,pr,$i).call(this,{type:"pending",variables:n,isPaused:o}),Y(this,Yt).config.onMutate&&await Y(this,Yt).config.onMutate(n,this,s);const k=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,n,s));k!==this.state.context&&$e(this,pr,$i).call(this,{type:"pending",context:k,variables:n,isPaused:o})}const I=await Y(this,Ms).start();return await((f=(h=Y(this,Yt).config).onSuccess)==null?void 0:f.call(h,I,n,this.state.context,this,s)),await((d=(p=this.options).onSuccess)==null?void 0:d.call(p,I,n,this.state.context,s)),await((y=(g=Y(this,Yt).config).onSettled)==null?void 0:y.call(g,I,null,this.state.variables,this.state.context,this,s)),await((x=(C=this.options).onSettled)==null?void 0:x.call(C,I,null,n,this.state.context,s)),$e(this,pr,$i).call(this,{type:"success",data:I}),I}catch(I){try{await((b=(v=Y(this,Yt).config).onError)==null?void 0:b.call(v,I,n,this.state.context,this,s))}catch(k){Promise.reject(k)}try{await((E=(w=this.options).onError)==null?void 0:E.call(w,I,n,this.state.context,s))}catch(k){Promise.reject(k)}try{await((A=(q=Y(this,Yt).config).onSettled)==null?void 0:A.call(q,void 0,I,this.state.variables,this.state.context,this,s))}catch(k){Promise.reject(k)}try{await((O=(R=this.options).onSettled)==null?void 0:O.call(R,void 0,I,n,this.state.context,s))}catch(k){Promise.reject(k)}throw $e(this,pr,$i).call(this,{type:"error",error:I}),I}finally{Y(this,Yt).runNext(this)}}},el=new WeakMap,dr=new WeakMap,Yt=new WeakMap,Ms=new WeakMap,pr=new WeakSet,$i=function(n){const r=s=>{switch(n.type){case"failed":return{...s,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...s,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:n.error,failureCount:s.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Ct.batch(()=>{Y(this,dr).forEach(s=>{s.onMutationUpdate(n)}),Y(this,Yt).notify({mutation:this,type:"updated",action:n})})},vI);function $I(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Gr,Gn,tl,bI,tU=(bI=class extends Qs{constructor(n={}){super();Ee(this,Gr);Ee(this,Gn);Ee(this,tl);this.config=n,ye(this,Gr,new Set),ye(this,Gn,new Map),ye(this,tl,0)}build(n,r,s){const a=new eU({client:n,mutationCache:this,mutationId:++Xc(this,tl)._,options:n.defaultMutationOptions(r),state:s});return this.add(a),a}add(n){Y(this,Gr).add(n);const r=Jc(n);if(typeof r=="string"){const s=Y(this,Gn).get(r);s?s.push(n):Y(this,Gn).set(r,[n])}this.notify({type:"added",mutation:n})}remove(n){if(Y(this,Gr).delete(n)){const r=Jc(n);if(typeof r=="string"){const s=Y(this,Gn).get(r);if(s)if(s.length>1){const a=s.indexOf(n);a!==-1&&s.splice(a,1)}else s[0]===n&&Y(this,Gn).delete(r)}}this.notify({type:"removed",mutation:n})}canRun(n){const r=Jc(n);if(typeof r=="string"){const s=Y(this,Gn).get(r),a=s==null?void 0:s.find(o=>o.state.status==="pending");return!a||a===n}else return!0}runNext(n){var s;const r=Jc(n);if(typeof r=="string"){const a=(s=Y(this,Gn).get(r))==null?void 0:s.find(o=>o!==n&&o.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ct.batch(()=>{Y(this,Gr).forEach(n=>{this.notify({type:"removed",mutation:n})}),Y(this,Gr).clear(),Y(this,Gn).clear()})}getAll(){return Array.from(Y(this,Gr))}find(n){const r={exact:!0,...n};return this.getAll().find(s=>pq(r,s))}findAll(n={}){return this.getAll().filter(r=>pq(n,r))}notify(n){Ct.batch(()=>{this.listeners.forEach(r=>{r(n)})})}resumePausedMutations(){const n=this.getAll().filter(r=>r.state.isPaused);return Ct.batch(()=>Promise.all(n.map(r=>r.continue().catch(Xt))))}},Gr=new WeakMap,Gn=new WeakMap,tl=new WeakMap,bI);function Jc(e){var n;return(n=e.options.scope)==null?void 0:n.id}var Kr,zi,hn,Yr,Wr,_f,kC,_I,nU=(_I=class extends Qs{constructor(r,s){super();Ee(this,Wr);Ee(this,Kr);Ee(this,zi);Ee(this,hn);Ee(this,Yr);ye(this,Kr,r),this.setOptions(s),this.bindMethods(),$e(this,Wr,_f).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var a;const s=this.options;this.options=Y(this,Kr).defaultMutationOptions(r),zu(this.options,s)||Y(this,Kr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Y(this,hn),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&Ki(s.mutationKey)!==Ki(this.options.mutationKey)?this.reset():((a=Y(this,hn))==null?void 0:a.state.status)==="pending"&&Y(this,hn).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=Y(this,hn))==null||r.removeObserver(this)}onMutationUpdate(r){$e(this,Wr,_f).call(this),$e(this,Wr,kC).call(this,r)}getCurrentResult(){return Y(this,zi)}reset(){var r;(r=Y(this,hn))==null||r.removeObserver(this),ye(this,hn,void 0),$e(this,Wr,_f).call(this),$e(this,Wr,kC).call(this)}mutate(r,s){var a;return ye(this,Yr,s),(a=Y(this,hn))==null||a.removeObserver(this),ye(this,hn,Y(this,Kr).getMutationCache().build(Y(this,Kr),this.options)),Y(this,hn).addObserver(this),Y(this,hn).execute(r)}},Kr=new WeakMap,zi=new WeakMap,hn=new WeakMap,Yr=new WeakMap,Wr=new WeakSet,_f=function(){var s;const r=((s=Y(this,hn))==null?void 0:s.state)??$I();ye(this,zi,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},kC=function(r){Ct.batch(()=>{var s,a,o,l,u,h,f,p;if(Y(this,Yr)&&this.hasListeners()){const d=Y(this,zi).variables,g=Y(this,zi).context,y={client:Y(this,Kr),meta:this.options.meta,mutationKey:this.options.mutationKey};if((r==null?void 0:r.type)==="success"){try{(a=(s=Y(this,Yr)).onSuccess)==null||a.call(s,r.data,d,g,y)}catch(C){Promise.reject(C)}try{(l=(o=Y(this,Yr)).onSettled)==null||l.call(o,r.data,null,d,g,y)}catch(C){Promise.reject(C)}}else if((r==null?void 0:r.type)==="error"){try{(h=(u=Y(this,Yr)).onError)==null||h.call(u,r.error,d,g,y)}catch(C){Promise.reject(C)}try{(p=(f=Y(this,Yr)).onSettled)==null||p.call(f,void 0,r.error,d,g,y)}catch(C){Promise.reject(C)}}}this.listeners.forEach(d=>{d(Y(this,zi))})})},_I);function wq(e,n){const r=new Set(n);return e.filter(s=>!r.has(s))}function rU(e,n,r){const s=e.slice(0);return s[n]=r,s}var so,En,ao,oo,Dn,Ui,nl,rl,il,sl,Ht,BC,PC,zC,UC,QC,wI,iU=(wI=class extends Qs{constructor(n,r,s){super();Ee(this,Ht);Ee(this,so);Ee(this,En);Ee(this,ao);Ee(this,oo);Ee(this,Dn);Ee(this,Ui);Ee(this,nl);Ee(this,rl);Ee(this,il);Ee(this,sl,[]);ye(this,so,n),ye(this,oo,s),ye(this,ao,[]),ye(this,Dn,[]),ye(this,En,[]),this.setQueries(r)}onSubscribe(){this.listeners.size===1&&Y(this,Dn).forEach(n=>{n.subscribe(r=>{$e(this,Ht,UC).call(this,n,r)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,Y(this,Dn).forEach(n=>{n.destroy()})}setQueries(n,r){ye(this,ao,n),ye(this,oo,r),Ct.batch(()=>{const s=Y(this,Dn),a=$e(this,Ht,zC).call(this,Y(this,ao));a.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const o=a.map(d=>d.observer),l=o.map(d=>d.getCurrentResult()),u=s.length!==o.length,h=o.some((d,g)=>d!==s[g]),f=u||h,p=f?!0:l.some((d,g)=>{const y=Y(this,En)[g];return!y||!zu(d,y)});!f&&!p||(f&&(ye(this,sl,a),ye(this,Dn,o)),ye(this,En,l),this.hasListeners()&&(f&&(wq(s,o).forEach(d=>{d.destroy()}),wq(o,s).forEach(d=>{d.subscribe(g=>{$e(this,Ht,UC).call(this,d,g)})})),$e(this,Ht,QC).call(this)))})}getCurrentResult(){return Y(this,En)}getQueries(){return Y(this,Dn).map(n=>n.getCurrentQuery())}getObservers(){return Y(this,Dn)}getOptimisticResult(n,r){const s=$e(this,Ht,zC).call(this,n),a=s.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),o=s.map(l=>l.defaultedQueryOptions.queryHash);return[a,l=>$e(this,Ht,PC).call(this,l??a,r,o),()=>$e(this,Ht,BC).call(this,a,s)]}},so=new WeakMap,En=new WeakMap,ao=new WeakMap,oo=new WeakMap,Dn=new WeakMap,Ui=new WeakMap,nl=new WeakMap,rl=new WeakMap,il=new WeakMap,sl=new WeakMap,Ht=new WeakSet,BC=function(n,r){return r.map((s,a)=>{const o=n[a];return s.defaultedQueryOptions.notifyOnChangeProps?o:s.observer.trackResult(o,l=>{r.forEach(u=>{u.observer.trackProp(l)})})})},PC=function(n,r,s){if(r){const a=Y(this,il),o=s!==void 0&&a!==void 0&&(a.length!==s.length||s.some((l,u)=>l!==a[u]));return(!Y(this,Ui)||Y(this,En)!==Y(this,rl)||o||r!==Y(this,nl))&&(ye(this,nl,r),ye(this,rl,Y(this,En)),s!==void 0&&ye(this,il,s),ye(this,Ui,hE(Y(this,Ui),r(n)))),Y(this,Ui)}return n},zC=function(n){const r=new Map;Y(this,Dn).forEach(a=>{const o=a.options.queryHash;if(!o)return;const l=r.get(o);l?l.push(a):r.set(o,[a])});const s=[];return n.forEach(a=>{var h;const o=Y(this,so).defaultQueryOptions(a),u=((h=r.get(o.queryHash))==null?void 0:h.shift())??new ol(Y(this,so),o);s.push({defaultedQueryOptions:o,observer:u})}),s},UC=function(n,r){const s=Y(this,Dn).indexOf(n);s!==-1&&(ye(this,En,rU(Y(this,En),s,r)),$e(this,Ht,QC).call(this))},QC=function(){var n;if(this.hasListeners()){const r=Y(this,Ui),s=$e(this,Ht,BC).call(this,Y(this,En),Y(this,sl)),a=$e(this,Ht,PC).call(this,s,(n=Y(this,oo))==null?void 0:n.combine);r!==a&&Ct.batch(()=>{this.listeners.forEach(o=>{o(Y(this,En))})})}},wI),mr,CI,sU=(CI=class extends Qs{constructor(n={}){super();Ee(this,mr);this.config=n,ye(this,mr,new Map)}build(n,r,s){const a=r.queryKey,o=r.queryHash??fE(a,r);let l=this.get(o);return l||(l=new Yz({client:n,queryKey:a,queryHash:o,options:n.defaultQueryOptions(r),state:s,defaultOptions:n.getQueryDefaults(a)}),this.add(l)),l}add(n){Y(this,mr).has(n.queryHash)||(Y(this,mr).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const r=Y(this,mr).get(n.queryHash);r&&(n.destroy(),r===n&&Y(this,mr).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Ct.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return Y(this,mr).get(n)}getAll(){return[...Y(this,mr).values()]}find(n){const r={exact:!0,...n};return this.getAll().find(s=>dq(r,s))}findAll(n={}){const r=this.getAll();return Object.keys(n).length>0?r.filter(s=>dq(n,s)):r}notify(n){Ct.batch(()=>{this.listeners.forEach(r=>{r(n)})})}onFocus(){Ct.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Ct.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},mr=new WeakMap,CI),wt,Qi,Hi,uo,lo,Vi,co,fo,EI,aU=(EI=class{constructor(e={}){Ee(this,wt);Ee(this,Qi);Ee(this,Hi);Ee(this,uo);Ee(this,lo);Ee(this,Vi);Ee(this,co);Ee(this,fo);ye(this,wt,e.queryCache||new sU),ye(this,Qi,e.mutationCache||new tU),ye(this,Hi,e.defaultOptions||{}),ye(this,uo,new Map),ye(this,lo,new Map),ye(this,Vi,0)}mount(){Xc(this,Vi)._++,Y(this,Vi)===1&&(ye(this,co,pE.subscribe(async e=>{e&&(await this.resumePausedMutations(),Y(this,wt).onFocus())})),ye(this,fo,Af.subscribe(async e=>{e&&(await this.resumePausedMutations(),Y(this,wt).onOnline())})))}unmount(){var e,n;Xc(this,Vi)._--,Y(this,Vi)===0&&((e=Y(this,co))==null||e.call(this),ye(this,co,void 0),(n=Y(this,fo))==null||n.call(this),ye(this,fo,void 0))}isFetching(e){return Y(this,wt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Y(this,Qi).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const n=this.defaultQueryOptions({queryKey:e});return(r=Y(this,wt).get(n.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),r=Y(this,wt).build(this,n),s=r.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Fi(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(s))}getQueriesData(e){return Y(this,wt).findAll(e).map(({queryKey:n,state:r})=>{const s=r.data;return[n,s]})}setQueryData(e,n,r){const s=this.defaultQueryOptions({queryKey:e}),a=Y(this,wt).get(s.queryHash),o=a==null?void 0:a.state.data,l=kz(n,o);if(l!==void 0)return Y(this,wt).build(this,s).setData(l,{...r,manual:!0})}setQueriesData(e,n,r){return Ct.batch(()=>Y(this,wt).findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,n,r)]))}getQueryState(e){var r;const n=this.defaultQueryOptions({queryKey:e});return(r=Y(this,wt).get(n.queryHash))==null?void 0:r.state}removeQueries(e){const n=Y(this,wt);Ct.batch(()=>{n.findAll(e).forEach(r=>{n.remove(r)})})}resetQueries(e,n){const r=Y(this,wt);return Ct.batch(()=>(r.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const r={revert:!0,...n},s=Ct.batch(()=>Y(this,wt).findAll(e).map(a=>a.cancel(r)));return Promise.all(s).then(Xt).catch(Xt)}invalidateQueries(e,n={}){return Ct.batch(()=>(Y(this,wt).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},n)))}refetchQueries(e,n={}){const r={...n,cancelRefetch:n.cancelRefetch??!0},s=Ct.batch(()=>Y(this,wt).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let o=a.fetch(void 0,r);return r.throwOnError||(o=o.catch(Xt)),a.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(s).then(Xt)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const r=Y(this,wt).build(this,n);return r.isStaleByTime(Fi(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Xt).catch(Xt)}fetchInfiniteQuery(e){return e.behavior=Nf(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Xt).catch(Xt)}ensureInfiniteQueryData(e){return e.behavior=Nf(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Af.isOnline()?Y(this,Qi).resumePausedMutations():Promise.resolve()}getQueryCache(){return Y(this,wt)}getMutationCache(){return Y(this,Qi)}getDefaultOptions(){return Y(this,Hi)}setDefaultOptions(e){ye(this,Hi,e)}setQueryDefaults(e,n){Y(this,uo).set(Ki(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...Y(this,uo).values()],r={};return n.forEach(s=>{Pu(e,s.queryKey)&&Object.assign(r,s.defaultOptions)}),r}setMutationDefaults(e,n){Y(this,lo).set(Ki(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...Y(this,lo).values()],r={};return n.forEach(s=>{Pu(e,s.mutationKey)&&Object.assign(r,s.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const n={...Y(this,Hi).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=fE(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===xn&&(n.enabled=!1),n}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Y(this,Hi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Y(this,wt).clear(),Y(this,Qi).clear()}},wt=new WeakMap,Qi=new WeakMap,Hi=new WeakMap,uo=new WeakMap,lo=new WeakMap,Vi=new WeakMap,co=new WeakMap,fo=new WeakMap,EI),LI=re.createContext(void 0),ul=e=>{const n=re.useContext(LI);if(e)return e;if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},oU=({client:e,children:n})=>(re.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),F.jsx(LI.Provider,{value:e,children:n})),II=re.createContext(!1),DI=()=>re.useContext(II);II.Provider;function uU(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var lU=re.createContext(uU()),kI=()=>re.useContext(lU),BI=(e,n,r)=>{const s=r!=null&&r.state.error&&typeof e.throwOnError=="function"?dE(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(n.isReset()||(e.retryOnMount=!1))},PI=e=>{re.useEffect(()=>{e.clearReset()},[e])},zI=({result:e,errorResetBoundary:n,throwOnError:r,query:s,suspense:a})=>e.isError&&!n.isReset()&&!e.isFetching&&s&&(a&&e.data===void 0||dE(r,[e.error,s])),gE=(e,n)=>n.state.data===void 0,UI=e=>{if(e.suspense){const r=a=>a==="static"?a:Math.max(a??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...a)=>r(s(...a)):r(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},QI=(e,n)=>e.isLoading&&e.isFetching&&!n,HC=(e,n)=>(e==null?void 0:e.suspense)&&n.isPending,Rf=(e,n,r)=>n.fetchOptimistic(e).catch(()=>{r.clearReset()});function HI({queries:e,...n},r){const s=ul(r),a=DI(),o=kI(),l=re.useMemo(()=>e.map(x=>{const v=s.defaultQueryOptions(x);return v._optimisticResults=a?"isRestoring":"optimistic",v}),[e,s,a]);l.forEach(x=>{UI(x);const v=s.getQueryCache().get(x.queryHash);BI(x,o,v)}),PI(o);const[u]=re.useState(()=>new iU(s,l,n)),[h,f,p]=u.getOptimisticResult(l,n.combine),d=!a&&n.subscribed!==!1;re.useSyncExternalStore(re.useCallback(x=>d?u.subscribe(Ct.batchCalls(x)):Xt,[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),re.useEffect(()=>{u.setQueries(l,n)},[l,n,u]);const y=h.some((x,v)=>HC(l[v],x))?h.flatMap((x,v)=>{const b=l[v];if(b){const w=new ol(s,b);if(HC(b,x))return Rf(b,w,o);QI(x,a)&&Rf(b,w,o)}return[]}):[];if(y.length>0)throw Promise.all(y);const C=h.find((x,v)=>{const b=l[v];return b&&zI({result:x,errorResetBoundary:o,throwOnError:b.throwOnError,query:s.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(C!=null&&C.error)throw C.error;return f(p())}function Vf(e,n,r){var g,y,C,x;const s=DI(),a=kI(),o=ul(r),l=o.defaultQueryOptions(e);(y=(g=o.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||y.call(g,l);const u=o.getQueryCache().get(l.queryHash);l._optimisticResults=s?"isRestoring":"optimistic",UI(l),BI(l,a,u),PI(a);const h=!o.getQueryCache().get(l.queryHash),[f]=re.useState(()=>new n(o,l)),p=f.getOptimisticResult(l),d=!s&&e.subscribed!==!1;if(re.useSyncExternalStore(re.useCallback(v=>{const b=d?f.subscribe(Ct.batchCalls(v)):Xt;return f.updateResult(),b},[f,d]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),re.useEffect(()=>{f.setOptions(l)},[l,f]),HC(l,p))throw Rf(l,f,a);if(zI({result:p,errorResetBoundary:a,throwOnError:l.throwOnError,query:u,suspense:l.suspense}))throw p.error;if((x=(C=o.getDefaultOptions().queries)==null?void 0:C._experimental_afterQuery)==null||x.call(C,l,p),l.experimental_prefetchInRender&&!Ls&&QI(p,s)){const v=h?Rf(l,f,a):u==null?void 0:u.promise;v==null||v.catch(Xt).finally(()=>{f.updateResult()})}return l.notifyOnChangeProps?p:f.trackResult(p)}function cU(e,n){return Vf(e,ol,n)}function fU(e,n){return Vf({...e,enabled:!0,suspense:!0,throwOnError:gE,placeholderData:void 0},ol,n)}function hU(e,n){return Vf({...e,enabled:!0,suspense:!0,throwOnError:gE},jI,n)}function dU(e,n){return HI({...e,queries:e.queries.map(r=>({...r,suspense:!0,throwOnError:gE,enabled:!0,placeholderData:void 0}))},n)}function pU(e,n){const r=ul(n);r.getQueryState(e.queryKey)||r.prefetchQuery(e)}function mU(e,n){const r=ul(n);r.getQueryState(e.queryKey)||r.prefetchInfiniteQuery(e)}function gU(e,n){const r=ul(n),[s]=re.useState(()=>new nU(r,e));re.useEffect(()=>{s.setOptions(e)},[s,e]);const a=re.useSyncExternalStore(re.useCallback(l=>s.subscribe(Ct.batchCalls(l)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),o=re.useCallback((l,u)=>{s.mutate(l,u).catch(Xt)},[s]);if(a.error&&dE(s.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}function yU(e,n){return Vf(e,jI,n)}function Is(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function vU(){return Object.create(null)}const bU=typeof Symbol=="function"&&!!Symbol.asyncIterator;function VI(e){return bU&&Is(e)&&Symbol.asyncIterator in e}var _U=Object.create,FI=Object.defineProperty,wU=Object.getOwnPropertyDescriptor,GI=Object.getOwnPropertyNames,CU=Object.getPrototypeOf,EU=Object.prototype.hasOwnProperty,ll=(e,n)=>function(){return n||(0,e[GI(e)[0]])((n={exports:{}}).exports,n),n.exports},xU=(e,n,r,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(var a=GI(n),o=0,l=a.length,u;o<l;o++)u=a[o],!EU.call(e,u)&&u!==r&&FI(e,u,{get:(h=>n[h]).bind(null,u),enumerable:!(s=wU(n,u))||s.enumerable});return e},Ff=(e,n,r)=>(r=e!=null?_U(CU(e)):{},xU(FI(r,"default",{value:e,enumerable:!0}),e));const KI=()=>{},Cq=e=>{Object.freeze&&Object.freeze(e)};function YI(e,n,r){var s;const a=n.join(".");return(s=r[a])!==null&&s!==void 0||(r[a]=new Proxy(KI,{get(o,l){if(!(typeof l!="string"||l==="then"))return YI(e,[...n,l],r)},apply(o,l,u){const h=n[n.length-1];let f={args:u,path:n};return h==="call"?f={args:u.length>=2?[u[1]]:[],path:n.slice(0,-1)}:h==="apply"&&(f={args:u.length>=2?u[1]:[],path:n.slice(0,-1)}),Cq(f.args),Cq(f.path),e(f)}})),r[a]}const Gf=e=>YI(e,[],vU()),yE=e=>new Proxy(KI,{get(n,r){if(r!=="then")return e(r)}});var XI=ll({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,n){function r(s){"@babel/helpers - typeof";return n.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},n.exports.__esModule=!0,n.exports.default=n.exports,r(s)}n.exports=r,n.exports.__esModule=!0,n.exports.default=n.exports}}),SU=ll({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,n){var r=XI().default;function s(a,o){if(r(a)!="object"||!a)return a;var l=a[Symbol.toPrimitive];if(l!==void 0){var u=l.call(a,o||"default");if(r(u)!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(a)}n.exports=s,n.exports.__esModule=!0,n.exports.default=n.exports}}),TU=ll({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,n){var r=XI().default,s=SU();function a(o){var l=s(o,"string");return r(l)=="symbol"?l:l+""}n.exports=a,n.exports.__esModule=!0,n.exports.default=n.exports}}),WI=ll({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,n){var r=TU();function s(a,o,l){return(o=r(o))in a?Object.defineProperty(a,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[o]=l,a}n.exports=s,n.exports.__esModule=!0,n.exports.default=n.exports}}),vE=ll({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,n){var r=WI();function s(o,l){var u=Object.keys(o);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(o);l&&(h=h.filter(function(f){return Object.getOwnPropertyDescriptor(o,f).enumerable})),u.push.apply(u,h)}return u}function a(o){for(var l=1;l<arguments.length;l++){var u=arguments[l]!=null?arguments[l]:{};l%2?s(Object(u),!0).forEach(function(h){r(o,h,u[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(u)):s(Object(u)).forEach(function(h){Object.defineProperty(o,h,Object.getOwnPropertyDescriptor(u,h))})}return o}n.exports=a,n.exports.__esModule=!0,n.exports.default=n.exports}});Ff(vE());Ff(WI());var Zc=Ff(vE());function qU(e,n){if("error"in e){const s=n.deserialize(e.error);return{ok:!1,error:(0,Zc.default)((0,Zc.default)({},e),{},{error:s})}}return{ok:!0,result:(0,Zc.default)((0,Zc.default)({},e.result),(!e.result.type||e.result.type==="data")&&{type:"data",data:n.deserialize(e.result.data)})}}var Wp=class extends Error{constructor(){super("Unable to transform response from server")}};function AU(e,n){let r;try{r=qU(e,n)}catch{throw new Wp}if(!r.ok&&(!Is(r.error.error)||typeof r.error.error.code!="number"))throw new Wp;if(r.ok&&!Is(r.result))throw new Wp;return r}Ff(vE());function Kf(e){const n={subscribe(r){let s=null,a=!1,o=!1,l=!1;function u(){if(s===null){l=!0;return}o||(o=!0,typeof s=="function"?s():s&&s.unsubscribe())}return s=e({next(h){var f;a||(f=r.next)===null||f===void 0||f.call(r,h)},error(h){var f;a||(a=!0,(f=r.error)===null||f===void 0||f.call(r,h),u())},complete(){var h;a||(a=!0,(h=r.complete)===null||h===void 0||h.call(r),u())}}),l&&u(),{unsubscribe:u}},pipe(...r){return r.reduce(NU,n)}};return n}function NU(e,n){return n(e)}function RU(e){const n=new AbortController;return new Promise((s,a)=>{let o=!1;function l(){o||(o=!0,u.unsubscribe())}n.signal.addEventListener("abort",()=>{a(n.signal.reason)});const u=e.subscribe({next(h){o=!0,s(h),l()},error(h){a(h)},complete(){n.abort(),l()}})})}var OU=Object.create,JI=Object.defineProperty,MU=Object.getOwnPropertyDescriptor,ZI=Object.getOwnPropertyNames,jU=Object.getPrototypeOf,$U=Object.prototype.hasOwnProperty,Yi=(e,n)=>function(){return n||(0,e[ZI(e)[0]])((n={exports:{}}).exports,n),n.exports},LU=(e,n,r,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(var a=ZI(n),o=0,l=a.length,u;o<l;o++)u=a[o],!$U.call(e,u)&&u!==r&&JI(e,u,{get:(h=>n[h]).bind(null,u),enumerable:!(s=MU(n,u))||s.enumerable});return e},Hs=(e,n,r)=>(r=e!=null?OU(jU(e)):{},LU(n||!e||!e.__esModule?JI(r,"default",{value:e,enumerable:!0}):r,e)),IU=Yi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js"(e,n){function r(s,a){if(s==null)return{};var o={};for(var l in s)if({}.hasOwnProperty.call(s,l)){if(a.includes(l))continue;o[l]=s[l]}return o}n.exports=r,n.exports.__esModule=!0,n.exports.default=n.exports}}),DU=Yi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js"(e,n){var r=IU();function s(a,o){if(a==null)return{};var l,u,h=r(a,o);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(u=0;u<f.length;u++)l=f[u],o.includes(l)||{}.propertyIsEnumerable.call(a,l)&&(h[l]=a[l])}return h}n.exports=s,n.exports.__esModule=!0,n.exports.default=n.exports}}),eD=Yi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,n){function r(s){"@babel/helpers - typeof";return n.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},n.exports.__esModule=!0,n.exports.default=n.exports,r(s)}n.exports=r,n.exports.__esModule=!0,n.exports.default=n.exports}}),kU=Yi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,n){var r=eD().default;function s(a,o){if(r(a)!="object"||!a)return a;var l=a[Symbol.toPrimitive];if(l!==void 0){var u=l.call(a,o||"default");if(r(u)!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(a)}n.exports=s,n.exports.__esModule=!0,n.exports.default=n.exports}}),BU=Yi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,n){var r=eD().default,s=kU();function a(o){var l=s(o,"string");return r(l)=="symbol"?l:l+""}n.exports=a,n.exports.__esModule=!0,n.exports.default=n.exports}}),PU=Yi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,n){var r=BU();function s(a,o,l){return(o=r(o))in a?Object.defineProperty(a,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[o]=l,a}n.exports=s,n.exports.__esModule=!0,n.exports.default=n.exports}}),cl=Yi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,n){var r=PU();function s(o,l){var u=Object.keys(o);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(o);l&&(h=h.filter(function(f){return Object.getOwnPropertyDescriptor(o,f).enumerable})),u.push.apply(u,h)}return u}function a(o){for(var l=1;l<arguments.length;l++){var u=arguments[l]!=null?arguments[l]:{};l%2?s(Object(u),!0).forEach(function(h){r(o,h,u[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(u)):s(Object(u)).forEach(function(h){Object.defineProperty(o,h,Object.getOwnPropertyDescriptor(u,h))})}return o}n.exports=a,n.exports.__esModule=!0,n.exports.default=n.exports}}),zU=Hs(DU(),1),Eq=Hs(cl(),1);const UU=["cursor","direction"];function hr(e,n,r){const s=e.flatMap(a=>a.split("."));if(!n&&(!r||r==="any"))return s.length?[s]:[];if(r==="infinite"&&Is(n)&&("direction"in n||"cursor"in n)){const{cursor:a,direction:o}=n,l=(0,zU.default)(n,UU);return[s,{input:l,type:"infinite"}]}return[s,(0,Eq.default)((0,Eq.default)({},typeof n<"u"&&n!==xn&&{input:n}),r&&r!=="any"&&{type:r})]}function wf(e){return hr(e,void 0,"any")}var QU=Object.create,tD=Object.defineProperty,HU=Object.getOwnPropertyDescriptor,nD=Object.getOwnPropertyNames,VU=Object.getPrototypeOf,FU=Object.prototype.hasOwnProperty,_r=(e,n)=>function(){return n||(0,e[nD(e)[0]])((n={exports:{}}).exports,n),n.exports},GU=(e,n,r,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(var a=nD(n),o=0,l=a.length,u;o<l;o++)u=a[o],!FU.call(e,u)&&u!==r&&tD(e,u,{get:(h=>n[h]).bind(null,u),enumerable:!(s=HU(n,u))||s.enumerable});return e},St=(e,n,r)=>(r=e!=null?QU(VU(e)):{},GU(tD(r,"default",{value:e,enumerable:!0}),e)),rD=_r({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,n){function r(s){"@babel/helpers - typeof";return n.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},n.exports.__esModule=!0,n.exports.default=n.exports,r(s)}n.exports=r,n.exports.__esModule=!0,n.exports.default=n.exports}}),KU=_r({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,n){var r=rD().default;function s(a,o){if(r(a)!="object"||!a)return a;var l=a[Symbol.toPrimitive];if(l!==void 0){var u=l.call(a,o||"default");if(r(u)!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(a)}n.exports=s,n.exports.__esModule=!0,n.exports.default=n.exports}}),YU=_r({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,n){var r=rD().default,s=KU();function a(o){var l=s(o,"string");return r(l)=="symbol"?l:l+""}n.exports=a,n.exports.__esModule=!0,n.exports.default=n.exports}}),Vs=_r({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,n){var r=YU();function s(a,o,l){return(o=r(o))in a?Object.defineProperty(a,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[o]=l,a}n.exports=s,n.exports.__esModule=!0,n.exports.default=n.exports}}),nr=_r({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,n){var r=Vs();function s(o,l){var u=Object.keys(o);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(o);l&&(h=h.filter(function(f){return Object.getOwnPropertyDescriptor(o,f).enumerable})),u.push.apply(u,h)}return u}function a(o){for(var l=1;l<arguments.length;l++){var u=arguments[l]!=null?arguments[l]:{};l%2?s(Object(u),!0).forEach(function(h){r(o,h,u[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(u)):s(Object(u)).forEach(function(h){Object.defineProperty(o,h,Object.getOwnPropertyDescriptor(u,h))})}return o}n.exports=a,n.exports.__esModule=!0,n.exports.default=n.exports}});function XU(e){return n=>{let r=0,s=null;const a=[];function o(){s||(s=n.subscribe({next(u){for(const f of a){var h;(h=f.next)===null||h===void 0||h.call(f,u)}},error(u){for(const f of a){var h;(h=f.error)===null||h===void 0||h.call(f,u)}},complete(){for(const h of a){var u;(u=h.complete)===null||u===void 0||u.call(h)}}}))}function l(){if(r===0&&s){const u=s;s=null,u.unsubscribe()}}return Kf(u=>(r++,a.push(u),o(),{unsubscribe(){r--,l();const h=a.findIndex(f=>f===u);h>-1&&a.splice(h,1)}}))}}function WU(e){let n=e;const r=[],s=l=>{n!==void 0&&l.next(n),r.push(l)},a=l=>{r.splice(r.indexOf(l),1)},o=Kf(l=>(s(l),()=>{a(l)}));return o.next=l=>{if(n!==l){n=l;for(const u of r)u.next(l)}},o.get=()=>n,o}function JU(e){return Kf(n=>{function r(a=0,o=e.op){const l=e.links[a];if(!l)throw new Error("No more links to execute - did you forget to add an ending link?");return l({op:o,next(h){return r(a+1,h)}})}return r().subscribe(n)})}var ef=St(Vs()),Ha=St(nr());function ZU(e){return e instanceof Of}function eQ(e){return Is(e)&&Is(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function tQ(e,n){return typeof e=="string"?e:Is(e)&&typeof e.message=="string"?e.message:n}var Of=class Cf extends Error{constructor(n,r){var s,a;const o=r==null?void 0:r.cause;super(n,{cause:o}),(0,ef.default)(this,"cause",void 0),(0,ef.default)(this,"shape",void 0),(0,ef.default)(this,"data",void 0),(0,ef.default)(this,"meta",void 0),this.meta=r==null?void 0:r.meta,this.cause=o,this.shape=r==null||(s=r.result)===null||s===void 0?void 0:s.error,this.data=r==null||(a=r.result)===null||a===void 0?void 0:a.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,Cf.prototype)}static from(n,r={}){const s=n;return ZU(s)?(r.meta&&(s.meta=(0,Ha.default)((0,Ha.default)({},s.meta),r.meta)),s):eQ(s)?new Cf(s.error.message,(0,Ha.default)((0,Ha.default)({},r),{},{result:s})):new Cf(tQ(s,"Unknown error"),(0,Ha.default)((0,Ha.default)({},r),{},{cause:s}))}};function nQ(e){const n=e;return n?"input"in n?n:{input:n,output:n}:{input:{serialize:r=>r,deserialize:r=>r},output:{serialize:r=>r,deserialize:r=>r}}}const xq=e=>typeof e=="function";function rQ(e){if(e)return e;if(typeof window<"u"&&xq(window.fetch))return window.fetch;if(typeof globalThis<"u"&&xq(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var Du=St(nr());function iQ(e){return{url:e.url.toString(),fetch:e.fetch,transformer:nQ(e.transformer),methodOverride:e.methodOverride}}function sQ(e){const n={};for(let r=0;r<e.length;r++){const s=e[r];n[r]=s}return n}const aQ={query:"GET",mutation:"POST",subscription:"PATCH"};function iD(e){return"input"in e?e.transformer.input.serialize(e.input):sQ(e.inputs.map(n=>e.transformer.input.serialize(n)))}const sD=e=>{const n=e.url.split("?");let s=n[0].replace(/\/$/,"")+"/"+e.path;const a=[];if(n[1]&&a.push(n[1]),"inputs"in e&&a.push("batch=1"),e.type==="query"||e.type==="subscription"){const o=iD(e);o!==void 0&&e.methodOverride!=="POST"&&a.push(`input=${encodeURIComponent(JSON.stringify(o))}`)}return a.length&&(s+="?"+a.join("&")),s},oQ=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const n=iD(e);return n!==void 0?JSON.stringify(n):void 0},uQ=e=>hQ((0,Du.default)((0,Du.default)({},e),{},{contentTypeHeader:"application/json",getUrl:sD,getBody:oQ}));var lQ=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const cQ=e=>{var n;if(e!=null&&e.aborted)throw(n=e.throwIfAborted)===null||n===void 0||n.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new lQ};async function fQ(e){var n;cQ(e.signal);const r=e.getUrl(e),s=e.getBody(e),a=(n=e.methodOverride)!==null&&n!==void 0?n:aQ[e.type],o=await(async()=>{const u=await e.headers();return Symbol.iterator in u?Object.fromEntries(u):u})(),l=(0,Du.default)((0,Du.default)((0,Du.default)({},e.contentTypeHeader&&a!=="GET"?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{"trpc-accept":e.trpcAcceptHeader}:void 0),o);return rQ(e.fetch)(r,{method:a,signal:e.signal,body:s,headers:l})}async function hQ(e){const n={},r=await fQ(e);n.response=r;const s=await r.json();return n.responseJSON=s,{json:s,meta:n}}St(nr());const Sq=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function Tq(e){let n=null,r=null;const s=()=>{clearTimeout(r),r=null,n=null};function a(u){const h=[[]];let f=0;for(;;){const g=u[f];if(!g)break;const y=h[h.length-1];if(g.aborted){var p;(p=g.reject)===null||p===void 0||p.call(g,new Error("Aborted")),f++;continue}if(e.validate(y.concat(g).map(x=>x.key))){y.push(g),f++;continue}if(y.length===0){var d;(d=g.reject)===null||d===void 0||d.call(g,new Error("Input is too big for a single dispatch")),f++;continue}h.push([])}return h}function o(){const u=a(n);s();for(const h of u){if(!h.length)continue;const f={items:h};for(const d of h)d.batch=f;e.fetch(f.items.map(d=>d.key)).then(async d=>{await Promise.all(d.map(async(y,C)=>{const x=f.items[C];try{var v;const w=await Promise.resolve(y);(v=x.resolve)===null||v===void 0||v.call(x,w)}catch(w){var b;(b=x.reject)===null||b===void 0||b.call(x,w)}x.batch=null,x.reject=null,x.resolve=null}));for(const y of f.items){var g;(g=y.reject)===null||g===void 0||g.call(y,new Error("Missing result")),y.batch=null}}).catch(d=>{for(const y of f.items){var g;(g=y.reject)===null||g===void 0||g.call(y,d),y.batch=null}})}}function l(u){var h;const f={aborted:!1,key:u,batch:null,resolve:Sq,reject:Sq},p=new Promise((d,g)=>{var y;f.reject=g,f.resolve=d,(y=n)!==null&&y!==void 0||(n=[]),n.push(f)});return(h=r)!==null&&h!==void 0||(r=setTimeout(o)),p}return{load:l}}function dQ(...e){const n=new AbortController,r=e.length;let s=0;const a=()=>{++s===r&&n.abort()};for(const o of e)o!=null&&o.aborted?a():o==null||o.addEventListener("abort",a,{once:!0});return n.signal}var tf=St(nr());function pQ(e){var n,r;const s=iQ(e),a=(n=e.maxURLLength)!==null&&n!==void 0?n:1/0,o=(r=e.maxItems)!==null&&r!==void 0?r:1/0;return()=>{const l=p=>({validate(d){if(a===1/0&&o===1/0)return!0;if(d.length>o)return!1;const g=d.map(x=>x.path).join(","),y=d.map(x=>x.input);return sD((0,tf.default)((0,tf.default)({},s),{},{type:p,path:g,inputs:y,signal:null})).length<=a},async fetch(d){const g=d.map(w=>w.path).join(","),y=d.map(w=>w.input),C=dQ(...d.map(w=>w.signal)),x=await uQ((0,tf.default)((0,tf.default)({},s),{},{path:g,inputs:y,type:p,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:d}):e.headers:{}},signal:C}));return(Array.isArray(x.json)?x.json:d.map(()=>x.json)).map(w=>({meta:x.meta,json:w}))}}),u=Tq(l("query")),h=Tq(l("mutation")),f={query:u,mutation:h};return({op:p})=>Kf(d=>{/* istanbul ignore if -- @preserve */if(p.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const y=f[p.type].load(p);let C;return y.then(x=>{C=x;const v=AU(x.json,s.transformer.output);if(!v.ok){d.error(Of.from(v.error,{meta:x.meta}));return}d.next({context:x.meta,result:v.result}),d.complete()}).catch(x=>{d.error(Of.from(x,{meta:C==null?void 0:C.meta}))}),()=>{}})}}St(nr());const aD=(e,...n)=>typeof e=="function"?e(...n):e;St(Vs());function mQ(){let e,n;return{promise:new Promise((s,a)=>{e=s,n=a}),resolve:e,reject:n}}async function gQ(e){const n=await aD(e.url);if(!e.connectionParams)return n;const s=`${n.includes("?")?"&":"?"}connectionParams=1`;return n+s}async function yQ(e){const n={method:"connectionParams",data:await aD(e)};return JSON.stringify(n)}St(Vs());var _s=St(Vs());function vQ(e){const{promise:n,resolve:r,reject:s}=mQ();return e.addEventListener("open",()=>{e.removeEventListener("error",s),r()}),e.addEventListener("error",s),n}function bQ(e,{intervalMs:n,pongTimeoutMs:r}){let s,a;function o(){s=setTimeout(()=>{e.send("PING"),a=setTimeout(()=>{e.close()},r)},n)}function l(){clearTimeout(s),o()}function u(){clearTimeout(a),l()}e.addEventListener("open",o),e.addEventListener("message",({data:h})=>{clearTimeout(s),o(),h==="PONG"&&u()}),e.addEventListener("close",()=>{clearTimeout(s),clearTimeout(a)})}var _Q=class VC{constructor(n){var r;if((0,_s.default)(this,"id",++VC.connectCount),(0,_s.default)(this,"WebSocketPonyfill",void 0),(0,_s.default)(this,"urlOptions",void 0),(0,_s.default)(this,"keepAliveOpts",void 0),(0,_s.default)(this,"wsObservable",WU(null)),(0,_s.default)(this,"openPromise",null),this.WebSocketPonyfill=(r=n.WebSocketPonyfill)!==null&&r!==void 0?r:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=n.urlOptions,this.keepAliveOpts=n.keepAlive}get ws(){return this.wsObservable.get()}set ws(n){this.wsObservable.next(n)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var n=this;if(n.openPromise)return n.openPromise;n.id=++VC.connectCount;const r=gQ(n.urlOptions).then(s=>new n.WebSocketPonyfill(s));n.openPromise=r.then(async s=>{n.ws=s,s.binaryType="arraybuffer",s.addEventListener("message",function({data:a}){a==="PING"&&this.send("PONG")}),n.keepAliveOpts.enabled&&bQ(s,n.keepAliveOpts),s.addEventListener("close",()=>{n.ws===s&&(n.ws=null)}),await vQ(s),n.urlOptions.connectionParams&&s.send(await yQ(n.urlOptions.connectionParams))});try{await n.openPromise}finally{n.openPromise=null}}async close(){var n=this;try{await n.openPromise}finally{var r;(r=n.ws)===null||r===void 0||r.close()}}};(0,_s.default)(_Q,"connectCount",0);St(Vs());St(nr());var Jp=St(Vs()),qq=St(nr()),Yf=class{constructor(e){(0,Jp.default)(this,"links",void 0),(0,Jp.default)(this,"runtime",void 0),(0,Jp.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(n=>n(this.runtime))}$request(e){var n;return JU({links:this.links,op:(0,qq.default)((0,qq.default)({},e),{},{context:(n=e.context)!==null&&n!==void 0?n:{},id:++this.requestId})}).pipe(XU())}async requestAsPromise(e){var n=this;try{const r=n.$request(e);return(await RU(r)).result.data}catch(r){throw Of.from(r)}}query(e,n,r){return this.requestAsPromise({type:"query",path:e,input:n,context:r==null?void 0:r.context,signal:r==null?void 0:r.signal})}mutation(e,n,r){return this.requestAsPromise({type:"mutation",path:e,input:n,context:r==null?void 0:r.context,signal:r==null?void 0:r.signal})}subscription(e,n,r){return this.$request({type:"subscription",path:e,input:n,context:r.context,signal:r.signal}).subscribe({next(a){switch(a.result.type){case"state":{var o;(o=r.onConnectionStateChange)===null||o===void 0||o.call(r,a.result);break}case"started":{var l;(l=r.onStarted)===null||l===void 0||l.call(r,{context:a.context});break}case"stopped":{var u;(u=r.onStopped)===null||u===void 0||u.call(r);break}case"data":case void 0:{var h;(h=r.onData)===null||h===void 0||h.call(r,a.result.data);break}}},error(a){var o;(o=r.onError)===null||o===void 0||o.call(r,a)},complete(){var a;(a=r.onComplete)===null||a===void 0||a.call(r)}})}};const oD=Symbol.for("trpc_untypedClient"),wQ={query:"query",mutate:"mutation",subscribe:"subscription"},CQ=e=>wQ[e];function uD(e){const n=Gf(({path:r,args:s})=>{const a=[...r],o=CQ(a.pop()),l=a.join(".");return e[o](l,...s)});return yE(r=>r===oD?e:n[r])}function EQ(e){const n=new Yf(e);return uD(n)}function bE(e){return e[oD]}St(nr());St(nr());var xQ=_r({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,n){function r(a){var o,l,u,h=2;for(typeof Symbol<"u"&&(l=Symbol.asyncIterator,u=Symbol.iterator);h--;){if(l&&(o=a[l])!=null)return o.call(a);if(u&&(o=a[u])!=null)return new s(o.call(a));l="@@asyncIterator",u="@@iterator"}throw new TypeError("Object is not async iterable")}function s(a){function o(l){if(Object(l)!==l)return Promise.reject(new TypeError(l+" is not an object."));var u=l.done;return Promise.resolve(l.value).then(function(h){return{value:h,done:u}})}return s=function(u){this.s=u,this.n=u.next},s.prototype={s:null,n:null,next:function(){return o(this.n.apply(this.s,arguments))},return:function(u){var h=this.s.return;return h===void 0?Promise.resolve({value:u,done:!0}):o(h.apply(this.s,arguments))},throw:function(u){var h=this.s.return;return h===void 0?Promise.reject(u):o(h.apply(this.s,arguments))}},new s(a)}n.exports=r,n.exports.__esModule=!0,n.exports.default=n.exports}});St(xQ());St(nr());var SQ=_r({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e,n){function r(){var s=typeof SuppressedError=="function"?SuppressedError:function(u,h){var f=Error();return f.name="SuppressedError",f.error=u,f.suppressed=h,f},a={},o=[];function l(u,h){if(h!=null){if(Object(h)!==h)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(u)var f=h[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(f===void 0&&(f=h[Symbol.dispose||Symbol.for("Symbol.dispose")],u))var p=f;if(typeof f!="function")throw new TypeError("Object is not disposable.");p&&(f=function(){try{p.call(h)}catch(g){return Promise.reject(g)}}),o.push({v:h,d:f,a:u})}else u&&o.push({d:h,a:u});return h}return{e:a,u:l.bind(null,!1),a:l.bind(null,!0),d:function(){var h,f=this.e,p=0;function d(){for(;h=o.pop();)try{if(!h.a&&p===1)return p=0,o.push(h),Promise.resolve().then(d);if(h.d){var y=h.d.call(h.v);if(h.a)return p|=2,Promise.resolve(y).then(d,g)}else p|=1}catch(C){return g(C)}if(p===1)return f!==a?Promise.reject(f):Promise.resolve();if(f!==a)throw f}function g(y){return f=f!==a?new s(y,f):y,d()}return d()}}}n.exports=r,n.exports.__esModule=!0,n.exports.default=n.exports}}),lD=_r({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(e,n){function r(s,a){this.v=s,this.k=a}n.exports=r,n.exports.__esModule=!0,n.exports.default=n.exports}}),TQ=_r({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e,n){var r=lD();function s(a){return new r(a,0)}n.exports=s,n.exports.__esModule=!0,n.exports.default=n.exports}}),qQ=_r({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e,n){var r=lD();function s(o){return function(){return new a(o.apply(this,arguments))}}function a(o){var l,u;function h(p,d){try{var g=o[p](d),y=g.value,C=y instanceof r;Promise.resolve(C?y.v:y).then(function(x){if(C){var v=p==="return"?"return":"next";if(!y.k||x.done)return h(v,x);x=o[v](x).value}f(g.done?"return":"normal",x)},function(x){h("throw",x)})}catch(x){f("throw",x)}}function f(p,d){switch(p){case"return":l.resolve({value:d,done:!0});break;case"throw":l.reject(d);break;default:l.resolve({value:d,done:!1})}(l=l.next)?h(l.key,l.arg):u=null}this._invoke=function(p,d){return new Promise(function(g,y){var C={key:p,arg:d,resolve:g,reject:y,next:null};u?u=u.next=C:(l=u=C,h(p,d))})},typeof o.return!="function"&&(this.return=void 0)}a.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},a.prototype.next=function(o){return this._invoke("next",o)},a.prototype.throw=function(o){return this._invoke("throw",o)},a.prototype.return=function(o){return this._invoke("return",o)},n.exports=s,n.exports.__esModule=!0,n.exports.default=n.exports}});St(SQ());St(TQ());St(qQ());St(nr());function AQ(e){return Gf(({path:n,args:r})=>{var s;const a=[...n],o=a.pop();if(o==="useMutation")return e[o](a,...r);if(o==="_def")return{path:a};const[l,...u]=r,h=(s=u[0])!==null&&s!==void 0?s:{};return e[o](a,l,h)})}var Zp;const NQ=["client","ssrContext","ssrState","abortOnUnmount"],RQ=(Zp=re.createContext)===null||Zp===void 0?void 0:Zp.call(Az,null),OQ=e=>{switch(e){case"queryOptions":case"fetch":case"ensureData":case"prefetch":case"getData":case"setData":case"setQueriesData":return"query";case"infiniteQueryOptions":case"fetchInfinite":case"prefetchInfinite":case"getInfiniteData":case"setInfiniteData":return"infinite";case"setMutationDefaults":case"getMutationDefaults":case"isMutating":case"cancel":case"invalidate":case"refetch":case"reset":return"any"}};function MQ(e){return Gf(n=>{const r=[...n.path],s=r.pop(),a=[...n.args],o=a.shift(),l=OQ(s),u=hr(r,o,l);return{infiniteQueryOptions:()=>e.infiniteQueryOptions(r,u,a[0]),queryOptions:()=>e.queryOptions(r,u,...a),fetch:()=>e.fetchQuery(u,...a),fetchInfinite:()=>e.fetchInfiniteQuery(u,a[0]),prefetch:()=>e.prefetchQuery(u,...a),prefetchInfinite:()=>e.prefetchInfiniteQuery(u,a[0]),ensureData:()=>e.ensureQueryData(u,...a),invalidate:()=>e.invalidateQueries(u,...a),reset:()=>e.resetQueries(u,...a),refetch:()=>e.refetchQueries(u,...a),cancel:()=>e.cancelQuery(u,...a),setData:()=>{e.setQueryData(u,a[0],a[1])},setQueriesData:()=>e.setQueriesData(u,a[0],a[1],a[2]),setInfiniteData:()=>{e.setInfiniteQueryData(u,a[0],a[1])},getData:()=>e.getQueryData(u),getInfiniteData:()=>e.getInfiniteQueryData(u),setMutationDefaults:()=>e.setMutationDefaults(wf(r),o),getMutationDefaults:()=>e.getMutationDefaults(wf(r)),isMutating:()=>e.isMutating({mutationKey:wf(r)})}[s]()})}function jQ(e){const n=uD(e.client),r=MQ(e);return yE(s=>{const a=s;return a==="client"?n:NQ.includes(a)?e[a]:r[s]})}var $Q=Hs(cl(),1);function Aq(e){const n=e instanceof Yf?e:bE(e);return Gf(r=>{const s=r.path,a=s.join("."),[o,l]=r.args;return(0,$Q.default)({queryKey:hr(s,o,"query"),queryFn:()=>n.query(a,o,l==null?void 0:l.trpc)},l)})}var em=Hs(cl(),1);function en(e,n,r){var s;const a=e[0];let o=(s=e[1])===null||s===void 0?void 0:s.input;if(r){var l;o=(0,em.default)((0,em.default)((0,em.default)({},(l=o)!==null&&l!==void 0?l:{}),r.pageParam?{cursor:r.pageParam}:{}),{},{direction:r.direction})}return[a.join("."),o,n==null?void 0:n.trpc]}var LQ=Yi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,n){function r(a){var o,l,u,h=2;for(typeof Symbol<"u"&&(l=Symbol.asyncIterator,u=Symbol.iterator);h--;){if(l&&(o=a[l])!=null)return o.call(a);if(u&&(o=a[u])!=null)return new s(o.call(a));l="@@asyncIterator",u="@@iterator"}throw new TypeError("Object is not async iterable")}function s(a){function o(l){if(Object(l)!==l)return Promise.reject(new TypeError(l+" is not an object."));var u=l.done;return Promise.resolve(l.value).then(function(h){return{value:h,done:u}})}return s=function(u){this.s=u,this.n=u.next},s.prototype={s:null,n:null,next:function(){return o(this.n.apply(this.s,arguments))},return:function(u){var h=this.s.return;return h===void 0?Promise.resolve({value:u,done:!0}):o(h.apply(this.s,arguments))},throw:function(u){var h=this.s.return;return h===void 0?Promise.reject(u):o(h.apply(this.s,arguments))}},new s(a)}n.exports=r,n.exports.__esModule=!0,n.exports.default=n.exports}}),IQ=Hs(LQ(),1);function FC(e){return{path:e.path.join(".")}}function qu(e){const n=FC(e);return re.useMemo(()=>n,[n])}async function cD(e,n,r){const a=n.getQueryCache().build(n,{queryKey:r});a.setState({data:[],status:"success"});const o=[];var l=!1,u=!1,h;try{for(var f=(0,IQ.default)(e),p;l=!(p=await f.next()).done;l=!1){const d=p.value;o.push(d),a.setState({data:[...o]})}}catch(d){u=!0,h=d}finally{try{l&&f.return!=null&&await f.return()}finally{if(u)throw h}}return o}var Xe=Hs(cl(),1);function DQ(e){const{client:n,queryClient:r}=e,s=n instanceof Yf?n:bE(n);return{infiniteQueryOptions:(a,o,l)=>{var u,h;const f=((u=o[1])===null||u===void 0?void 0:u.input)===xn,p=async d=>{var g;const y=(0,Xe.default)((0,Xe.default)({},l),{},{trpc:(0,Xe.default)((0,Xe.default)({},l==null?void 0:l.trpc),!(l==null||(g=l.trpc)===null||g===void 0)&&g.abortOnUnmount?{signal:d.signal}:{signal:null})});return await s.query(...en(o,y,{direction:d.direction,pageParam:d.pageParam}))};return Object.assign((0,Xe.default)((0,Xe.default)({},l),{},{initialData:l==null?void 0:l.initialData,queryKey:o,queryFn:f?xn:p,initialPageParam:(h=l==null?void 0:l.initialCursor)!==null&&h!==void 0?h:null}),{trpc:FC({path:a})})},queryOptions:(a,o,l)=>{var u;const h=((u=o[1])===null||u===void 0?void 0:u.input)===xn,f=async p=>{var d;const g=(0,Xe.default)((0,Xe.default)({},l),{},{trpc:(0,Xe.default)((0,Xe.default)({},l==null?void 0:l.trpc),!(l==null||(d=l.trpc)===null||d===void 0)&&d.abortOnUnmount?{signal:p.signal}:{signal:null})}),y=await s.query(...en(o,g));return VI(y)?cD(y,r,o):y};return Object.assign((0,Xe.default)((0,Xe.default)({},l),{},{initialData:l==null?void 0:l.initialData,queryKey:o,queryFn:h?xn:f}),{trpc:FC({path:a})})},fetchQuery:(a,o)=>r.fetchQuery((0,Xe.default)((0,Xe.default)({},o),{},{queryKey:a,queryFn:()=>s.query(...en(a,o))})),fetchInfiniteQuery:(a,o)=>{var l;return r.fetchInfiniteQuery((0,Xe.default)((0,Xe.default)({},o),{},{queryKey:a,queryFn:({pageParam:u,direction:h})=>s.query(...en(a,o,{pageParam:u,direction:h})),initialPageParam:(l=o==null?void 0:o.initialCursor)!==null&&l!==void 0?l:null}))},prefetchQuery:(a,o)=>r.prefetchQuery((0,Xe.default)((0,Xe.default)({},o),{},{queryKey:a,queryFn:()=>s.query(...en(a,o))})),prefetchInfiniteQuery:(a,o)=>{var l;return r.prefetchInfiniteQuery((0,Xe.default)((0,Xe.default)({},o),{},{queryKey:a,queryFn:({pageParam:u,direction:h})=>s.query(...en(a,o,{pageParam:u,direction:h})),initialPageParam:(l=o==null?void 0:o.initialCursor)!==null&&l!==void 0?l:null}))},ensureQueryData:(a,o)=>r.ensureQueryData((0,Xe.default)((0,Xe.default)({},o),{},{queryKey:a,queryFn:()=>s.query(...en(a,o))})),invalidateQueries:(a,o,l)=>r.invalidateQueries((0,Xe.default)((0,Xe.default)({},o),{},{queryKey:a}),l),resetQueries:(a,o,l)=>r.resetQueries((0,Xe.default)((0,Xe.default)({},o),{},{queryKey:a}),l),refetchQueries:(a,o,l)=>r.refetchQueries((0,Xe.default)((0,Xe.default)({},o),{},{queryKey:a}),l),cancelQuery:(a,o)=>r.cancelQueries({queryKey:a},o),setQueryData:(a,o,l)=>r.setQueryData(a,o,l),setQueriesData:(a,o,l,u)=>r.setQueriesData((0,Xe.default)((0,Xe.default)({},o),{},{queryKey:a}),l,u),getQueryData:a=>r.getQueryData(a),setInfiniteQueryData:(a,o,l)=>r.setQueryData(a,o,l),getInfiniteQueryData:a=>r.getQueryData(a),setMutationDefaults:(a,o)=>{const l=a[0],u=h=>s.mutation(...en([l,{input:h}],e));return r.setMutationDefaults(a,typeof o=="function"?o({canonicalMutationFn:u}):o)},getMutationDefaults:a=>r.getMutationDefaults(a),isMutating:a=>r.isMutating((0,Xe.default)((0,Xe.default)({},a),{},{exact:!0}))}}var Ce=Hs(cl());const Nq=(e,n)=>new Proxy(e,{get(s,a){return n(a),s[a]}});function kQ(e){var n,r;const s=(n=void 0)!==null&&n!==void 0?n:A=>A.originalFn(),a=(r=void 0)!==null&&r!==void 0?r:RQ,o=EQ,l=A=>{var R;const{abortOnUnmount:O=!1,queryClient:I,ssrContext:k}=A,[N,j]=re.useState((R=A.ssrState)!==null&&R!==void 0?R:!1),D=A.client instanceof Yf?A.client:bE(A.client),z=re.useMemo(()=>DQ({client:D,queryClient:I}),[D,I]),T=re.useMemo(()=>(0,Ce.default)({abortOnUnmount:O,queryClient:I,client:D,ssrContext:k??null,ssrState:N},z),[O,D,z,I,k,N]);return re.useEffect(()=>{j(M=>M?"mounted":!1)},[]),F.jsx(a.Provider,{value:T,children:A.children})};function u(){const A=re.useContext(a);if(!A)throw new Error("Unable to find tRPC Context. Did you forget to wrap your App inside `withTRPC` HoC?");return A}function h(A,R){var O;const{queryClient:I,ssrState:k}=u();return k&&k!=="mounted"&&((O=I.getQueryCache().find({queryKey:A}))===null||O===void 0?void 0:O.state.status)==="error"?(0,Ce.default)({retryOnMount:!1},R):R}function f(A,R,O){var I,k,N,j,D;const z=u(),{abortOnUnmount:T,client:M,ssrState:$,queryClient:P,prefetchQuery:H}=z,G=hr(A,R,"query"),V=P.getQueryDefaults(G),B=R===xn;typeof window>"u"&&$==="prepass"&&(O==null||(I=O.trpc)===null||I===void 0?void 0:I.ssr)!==!1&&((k=O==null?void 0:O.enabled)!==null&&k!==void 0?k:V==null?void 0:V.enabled)!==!1&&!B&&!P.getQueryCache().find({queryKey:G})&&H(G,O);const K=h(G,(0,Ce.default)((0,Ce.default)({},V),O)),te=(N=(j=O==null||(D=O.trpc)===null||D===void 0?void 0:D.abortOnUnmount)!==null&&j!==void 0?j:void 0)!==null&&N!==void 0?N:T,Q=cU((0,Ce.default)((0,Ce.default)({},K),{},{queryKey:G,queryFn:B?R:async J=>{const ie=(0,Ce.default)((0,Ce.default)({},K),{},{trpc:(0,Ce.default)((0,Ce.default)({},K==null?void 0:K.trpc),te?{signal:J.signal}:{signal:null})}),oe=await M.query(...en(G,ie));return VI(oe)?cD(oe,P,G):oe}}),P);return Q.trpc=qu({path:A}),Q}function p(A,R,O){var I,k,N;const j=u(),D=hr(A,R,"query"),z=R===xn,T=(I=(k=O==null||(N=O.trpc)===null||N===void 0?void 0:N.abortOnUnmount)!==null&&k!==void 0?k:void 0)!==null&&I!==void 0?I:j.abortOnUnmount;pU((0,Ce.default)((0,Ce.default)({},O),{},{queryKey:D,queryFn:z?R:M=>{const $={trpc:(0,Ce.default)((0,Ce.default)({},O==null?void 0:O.trpc),T?{signal:M.signal}:{})};return j.client.query(...en(D,$))}}))}function d(A,R,O){var I,k,N;const j=u(),D=hr(A,R,"query"),z=(I=(k=O==null||(N=O.trpc)===null||N===void 0?void 0:N.abortOnUnmount)!==null&&k!==void 0?k:void 0)!==null&&I!==void 0?I:j.abortOnUnmount,T=fU((0,Ce.default)((0,Ce.default)({},O),{},{queryKey:D,queryFn:M=>{const $=(0,Ce.default)((0,Ce.default)({},O),{},{trpc:(0,Ce.default)((0,Ce.default)({},O==null?void 0:O.trpc),z?{signal:M.signal}:{signal:null})});return j.client.query(...en(D,$))}}),j.queryClient);return T.trpc=qu({path:A}),[T.data,T]}function g(A,R){const{client:O,queryClient:I}=u(),k=wf(A),N=I.defaultMutationOptions(I.getMutationDefaults(k)),j=gU((0,Ce.default)((0,Ce.default)({},R),{},{mutationKey:k,mutationFn:D=>O.mutation(...en([A,{input:D}],R)),onSuccess(...D){var z,T;return s({originalFn:()=>{var $,P,H;return($=R==null||(P=R.onSuccess)===null||P===void 0?void 0:P.call(R,...D))!==null&&$!==void 0?$:N==null||(H=N.onSuccess)===null||H===void 0?void 0:H.call(N,...D)},queryClient:I,meta:(z=(T=R==null?void 0:R.meta)!==null&&T!==void 0?T:N==null?void 0:N.meta)!==null&&z!==void 0?z:{}})}}),I);return j.trpc=qu({path:A}),j}const y={data:void 0,error:null,status:"idle"},C={data:void 0,error:null,status:"connecting"};/* istanbul ignore next -- @preserve */function x(A,R,O){var I;const k=(I=O==null?void 0:O.enabled)!==null&&I!==void 0?I:R!==xn,N=Ki(hr(A,R,"any")),{client:j}=u(),D=re.useRef(O);re.useEffect(()=>{D.current=O});const[z]=re.useState(new Set([])),T=re.useCallback(B=>{z.add(B)},[z]),M=re.useRef(null),$=re.useCallback(B=>{const K=H.current,te=H.current=B(K);let Q=!1;for(const J of z)if(K[J]!==te[J]){Q=!0;break}Q&&V(Nq(te,T))},[T,z]),P=re.useCallback(()=>{var B;if((B=M.current)===null||B===void 0||B.unsubscribe(),!k){$(()=>(0,Ce.default)((0,Ce.default)({},y),{},{reset:P}));return}$(()=>(0,Ce.default)((0,Ce.default)({},C),{},{reset:P}));const K=j.subscription(A.join("."),R??void 0,{onStarted:()=>{var te,Q;(te=(Q=D.current).onStarted)===null||te===void 0||te.call(Q),$(J=>(0,Ce.default)((0,Ce.default)({},J),{},{status:"pending",error:null}))},onData:te=>{var Q,J;(Q=(J=D.current).onData)===null||Q===void 0||Q.call(J,te),$(ie=>(0,Ce.default)((0,Ce.default)({},ie),{},{status:"pending",data:te,error:null}))},onError:te=>{var Q,J;(Q=(J=D.current).onError)===null||Q===void 0||Q.call(J,te),$(ie=>(0,Ce.default)((0,Ce.default)({},ie),{},{status:"error",error:te}))},onConnectionStateChange:te=>{$(Q=>{switch(te.state){case"idle":return(0,Ce.default)((0,Ce.default)({},Q),{},{status:te.state,error:null,data:void 0});case"connecting":return(0,Ce.default)((0,Ce.default)({},Q),{},{error:te.error,status:te.state});case"pending":return Q}})},onComplete:()=>{var te,Q;(te=(Q=D.current).onComplete)===null||te===void 0||te.call(Q),$(J=>(0,Ce.default)((0,Ce.default)({},J),{},{status:"idle",error:null,data:void 0}))}});M.current=K},[j,N,k,$]);re.useEffect(()=>(P(),()=>{var B;(B=M.current)===null||B===void 0||B.unsubscribe()}),[P]);const H=re.useRef(k?(0,Ce.default)((0,Ce.default)({},C),{},{reset:P}):(0,Ce.default)((0,Ce.default)({},y),{},{reset:P})),[G,V]=re.useState(Nq(H.current,T));return G}function v(A,R,O){var I,k,N,j,D;const{client:z,ssrState:T,prefetchInfiniteQuery:M,queryClient:$,abortOnUnmount:P}=u(),H=hr(A,R,"infinite"),G=$.getQueryDefaults(H),V=R===xn;typeof window>"u"&&T==="prepass"&&(O==null||(I=O.trpc)===null||I===void 0?void 0:I.ssr)!==!1&&((k=O==null?void 0:O.enabled)!==null&&k!==void 0?k:G==null?void 0:G.enabled)!==!1&&!V&&!$.getQueryCache().find({queryKey:H})&&M(H,(0,Ce.default)((0,Ce.default)({},G),O));const B=h(H,(0,Ce.default)((0,Ce.default)({},G),O)),K=(N=O==null||(j=O.trpc)===null||j===void 0?void 0:j.abortOnUnmount)!==null&&N!==void 0?N:P,te=yU((0,Ce.default)((0,Ce.default)({},B),{},{initialPageParam:(D=O.initialCursor)!==null&&D!==void 0?D:null,persister:O.persister,queryKey:H,queryFn:V?R:Q=>{var J;const ie=(0,Ce.default)((0,Ce.default)({},B),{},{trpc:(0,Ce.default)((0,Ce.default)({},B==null?void 0:B.trpc),K?{signal:Q.signal}:{signal:null})});return z.query(...en(H,ie,{pageParam:(J=Q.pageParam)!==null&&J!==void 0?J:O.initialCursor,direction:Q.direction}))}}),$);return te.trpc=qu({path:A}),te}function b(A,R,O){var I,k,N;const j=u(),D=hr(A,R,"infinite"),z=j.queryClient.getQueryDefaults(D),T=R===xn,M=h(D,(0,Ce.default)((0,Ce.default)({},z),O)),$=(I=O==null||(k=O.trpc)===null||k===void 0?void 0:k.abortOnUnmount)!==null&&I!==void 0?I:j.abortOnUnmount;mU((0,Ce.default)((0,Ce.default)({},O),{},{initialPageParam:(N=O.initialCursor)!==null&&N!==void 0?N:null,queryKey:D,queryFn:T?R:P=>{var H;const G=(0,Ce.default)((0,Ce.default)({},M),{},{trpc:(0,Ce.default)((0,Ce.default)({},M==null?void 0:M.trpc),$?{signal:P.signal}:{})});return j.client.query(...en(D,G,{pageParam:(H=P.pageParam)!==null&&H!==void 0?H:O.initialCursor,direction:P.direction}))}}))}function w(A,R,O){var I,k,N;const j=u(),D=hr(A,R,"infinite"),z=j.queryClient.getQueryDefaults(D),T=h(D,(0,Ce.default)((0,Ce.default)({},z),O)),M=(I=O==null||(k=O.trpc)===null||k===void 0?void 0:k.abortOnUnmount)!==null&&I!==void 0?I:j.abortOnUnmount,$=hU((0,Ce.default)((0,Ce.default)({},O),{},{initialPageParam:(N=O.initialCursor)!==null&&N!==void 0?N:null,queryKey:D,queryFn:P=>{var H;const G=(0,Ce.default)((0,Ce.default)({},T),{},{trpc:(0,Ce.default)((0,Ce.default)({},T==null?void 0:T.trpc),M?{signal:P.signal}:{})});return j.client.query(...en(D,G,{pageParam:(H=P.pageParam)!==null&&H!==void 0?H:O.initialCursor,direction:P.direction}))}}),j.queryClient);return $.trpc=qu({path:A}),[$.data,$]}return{Provider:l,createClient:o,useContext:u,useUtils:u,useQuery:f,usePrefetchQuery:p,useSuspenseQuery:d,useQueries:(A,R)=>{const{ssrState:O,queryClient:I,prefetchQuery:k,client:N}=u(),j=Aq(N),D=A(j);if(typeof window>"u"&&O==="prepass")for(const T of D){var z;const M=T;((z=M.trpc)===null||z===void 0?void 0:z.ssr)!==!1&&!I.getQueryCache().find({queryKey:M.queryKey})&&k(M.queryKey,M)}return HI({queries:D.map(T=>(0,Ce.default)((0,Ce.default)({},T),{},{queryKey:T.queryKey})),combine:R==null?void 0:R.combine},I)},useSuspenseQueries:A=>{const{queryClient:R,client:O}=u(),I=Aq(O),k=A(I),N=dU({queries:k.map(j=>(0,Ce.default)((0,Ce.default)({},j),{},{queryFn:j.queryFn,queryKey:j.queryKey}))},R);return[N.map(j=>j.data),N]},useMutation:g,useSubscription:x,useInfiniteQuery:v,usePrefetchInfiniteQuery:b,useSuspenseInfiniteQuery:w}}function BQ(e){const n=AQ(e);return yE(r=>r==="useContext"||r==="useUtils"?()=>{const s=e.useUtils();return re.useMemo(()=>jQ(s),[s])}:e.hasOwnProperty(r)?e[r]:n[r])}function PQ(e){const n=kQ();return BQ(n)}const Xn=PQ(),Rq=new aU({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}}),zQ=Xn.createClient({links:[pQ({url:"/trpc"})]}),Oq=e=>{let n;const r=new Set,s=(f,p)=>{const d=typeof f=="function"?f(n):f;if(!Object.is(d,n)){const g=n;n=p??(typeof d!="object"||d===null)?d:Object.assign({},n,d),r.forEach(y=>y(n,g))}},a=()=>n,u={setState:s,getState:a,getInitialState:()=>h,subscribe:f=>(r.add(f),()=>r.delete(f))},h=n=e(s,a,u);return u},UQ=(e=>e?Oq(e):Oq),QQ=e=>e;function HQ(e,n=QQ){const r=Fa.useSyncExternalStore(e.subscribe,Fa.useCallback(()=>n(e.getState()),[e,n]),Fa.useCallback(()=>n(e.getInitialState()),[e,n]));return Fa.useDebugValue(r),r}const Mq=e=>{const n=UQ(e),r=s=>HQ(n,s);return Object.assign(r,n),r},VQ=(e=>e?Mq(e):Mq);function Zn(e,n){return e?`${e}.${n}`:n}const qe=VQ(e=>({connectionId:null,dialect:null,tables:[],crawlResult:null,currentWorkspaceId:null,currentWorkspaceName:null,databaseLabel:null,nodePositions:new Map,collapsedNodes:new Set,nodeWidths:new Map,colorAssignments:{},nodeColorGroups:new Map,crossSchemaExpansion:!0,schemaDiff:null,schemaBaseline:null,pollingEnabled:!0,setConnection:(n,r)=>e({connectionId:n,dialect:r}),clearConnection:()=>e({connectionId:null,dialect:null,tables:[],crawlResult:null,currentWorkspaceId:null,currentWorkspaceName:null,databaseLabel:null,nodePositions:new Map,collapsedNodes:new Set,nodeWidths:new Map,colorAssignments:{},nodeColorGroups:new Map,crossSchemaExpansion:!0,schemaDiff:null,schemaBaseline:null,pollingEnabled:!0}),setTables:n=>e({tables:n}),setCrawlResult:n=>e({crawlResult:n}),addExpandedTable:(n,r,s)=>e(a=>{if(!a.crawlResult)return a;const o=new Set(a.crawlResult.tables.map(h=>h.name));o.add(n.name);const l=a.crawlResult.ghostNodes.filter(h=>h.tableName!==s),u=r.filter(h=>!o.has(h.tableName)&&!l.some(f=>f.tableName===h.tableName));return{crawlResult:{...a.crawlResult,tables:[...a.crawlResult.tables,n],ghostNodes:[...l,...u]}}}),setWorkspace:(n,r)=>e({currentWorkspaceId:n,currentWorkspaceName:r}),clearWorkspace:()=>e({currentWorkspaceId:null,currentWorkspaceName:null,nodePositions:new Map,collapsedNodes:new Set,nodeWidths:new Map,colorAssignments:{},nodeColorGroups:new Map,crossSchemaExpansion:!0}),setDatabaseLabel:n=>e({databaseLabel:n}),updateNodePosition:(n,r)=>e(s=>{const a=new Map(s.nodePositions);return a.set(n,r),{nodePositions:a}}),toggleNodeCollapsed:n=>e(r=>{const s=new Set(r.collapsedNodes);return s.has(n)?s.delete(n):s.add(n),{collapsedNodes:s}}),updateNodeWidth:(n,r)=>e(s=>{const a=new Map(s.nodeWidths);return a.set(n,r),{nodeWidths:a}}),setColorAssignment:(n,r)=>e(s=>({colorAssignments:{...s.colorAssignments,[n]:r}})),setNodeColorGroup:(n,r)=>e(s=>{const a=new Map(s.nodeColorGroups);return a.set(n,r),{nodeColorGroups:a}}),setColorAssignments:n=>e({colorAssignments:n}),setAllNodeColorGroups:n=>e({nodeColorGroups:n}),setCrossSchemaExpansion:n=>e({crossSchemaExpansion:n}),setSchemaDiff:n=>e({schemaDiff:n}),setSchemaBaseline:n=>e({schemaBaseline:n}),setPollingEnabled:n=>e({pollingEnabled:n}),acceptSchemaChanges:()=>e(n=>{var r;return{schemaDiff:null,schemaBaseline:((r=n.crawlResult)==null?void 0:r.tables)??n.schemaBaseline}})}));function FQ(){const[e,n]=re.useState("postgres"),[r,s]=re.useState("localhost"),[a,o]=re.useState("5432"),[l,u]=re.useState(""),[h,f]=re.useState(""),[p,d]=re.useState(""),[g,y]=re.useState(""),[C,x]=re.useState(null),v=qe(R=>R.setConnection),b=qe(R=>R.setTables),w=qe(R=>R.setDatabaseLabel),E=Xn.connection.connect.useMutation(),q=Xn.useUtils(),A=async()=>{x(null);try{const R=e==="postgres"?{dialect:"postgres",host:r,port:Number(a),database:l,user:h,password:p}:{dialect:"sqlite",filePath:g},{connectionId:O}=await E.mutateAsync(R);v(O,e);const I=e==="postgres"?`${l}@${r}:${a}`:g.split("/").pop()??g;w(I);const k=await q.schema.getTables.fetch({connectionId:O});b(k)}catch(R){x(R instanceof Error?R.message:String(R))}};return F.jsxs("div",{className:"connection-form",children:[F.jsx("h2",{children:"Connect to Database"}),F.jsxs("div",{className:"form-group",children:[F.jsx("label",{children:"Dialect"}),F.jsxs("select",{value:e,onChange:R=>n(R.target.value),children:[F.jsx("option",{value:"postgres",children:"PostgreSQL"}),F.jsx("option",{value:"sqlite",children:"SQLite"})]})]}),e==="postgres"?F.jsxs(F.Fragment,{children:[F.jsxs("div",{className:"form-group",children:[F.jsx("label",{children:"Host"}),F.jsx("input",{value:r,onChange:R=>s(R.target.value)})]}),F.jsxs("div",{className:"form-group",children:[F.jsx("label",{children:"Port"}),F.jsx("input",{value:a,onChange:R=>o(R.target.value),type:"number"})]}),F.jsxs("div",{className:"form-group",children:[F.jsx("label",{children:"Database"}),F.jsx("input",{value:l,onChange:R=>u(R.target.value)})]}),F.jsxs("div",{className:"form-group",children:[F.jsx("label",{children:"User"}),F.jsx("input",{value:h,onChange:R=>f(R.target.value)})]}),F.jsxs("div",{className:"form-group",children:[F.jsx("label",{children:"Password"}),F.jsx("input",{value:p,onChange:R=>d(R.target.value),type:"password"})]})]}):F.jsxs("div",{className:"form-group",children:[F.jsx("label",{children:"File Path"}),F.jsx("input",{value:g,onChange:R=>y(R.target.value),placeholder:"/path/to/database.sqlite"})]}),C&&F.jsx("div",{className:"error",children:C}),F.jsx("button",{onClick:A,disabled:E.isPending,children:E.isPending?"Connecting...":"Connect"})]})}function jq(){const e=qe(g=>g.connectionId),n=qe(g=>g.tables),r=qe(g=>g.setCrawlResult),[s,a]=re.useState(""),[o,l]=re.useState(2),[u,h]=re.useState(!1),f=Xn.useUtils(),p=async()=>{if(!(!e||!s)){h(!0);try{const g=await f.schema.crawlFrom.fetch({connectionId:e,tableName:s,maxDepth:o});r(g)}finally{h(!1)}}},d=async()=>{if(e){h(!0);try{const g=await f.schema.crawlSchema.fetch({connectionId:e,schema:null});r(g)}finally{h(!1)}}};return F.jsxs("div",{className:"table-picker",children:[F.jsx("h3",{children:"Explore Schema"}),F.jsxs("div",{className:"form-group",children:[F.jsx("label",{children:"Starting Table"}),F.jsxs("select",{value:s,onChange:g=>a(g.target.value),children:[F.jsx("option",{value:"",children:"Select a table..."}),n.map(g=>F.jsx("option",{value:g.name,children:g.schema?`${g.schema}.${g.name}`:g.name},g.schema?`${g.schema}.${g.name}`:g.name))]})]}),F.jsxs("div",{className:"form-group",children:[F.jsx("label",{children:"Depth"}),F.jsx("input",{type:"number",min:0,max:10,value:o,onChange:g=>l(Number(g.target.value))})]}),F.jsxs("div",{className:"picker-actions",children:[F.jsx("button",{onClick:p,disabled:!s||u,children:u?"Loading...":"Crawl from Table"}),F.jsx("button",{onClick:d,disabled:u,className:"secondary",children:"Load Entire Schema"})]})]})}function jt(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let r=0,s;r<e.length;r++)(s=jt(e[r]))!==""&&(n+=(n&&" ")+s);else for(let r in e)e[r]&&(n+=(n&&" ")+r);return n}var GQ={value:()=>{}};function Xf(){for(var e=0,n=arguments.length,r={},s;e<n;++e){if(!(s=arguments[e]+"")||s in r||/[\s.]/.test(s))throw new Error("illegal type: "+s);r[s]=[]}return new Ef(r)}function Ef(e){this._=e}function KQ(e,n){return e.trim().split(/^|\s+/).map(function(r){var s="",a=r.indexOf(".");if(a>=0&&(s=r.slice(a+1),r=r.slice(0,a)),r&&!n.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:s}})}Ef.prototype=Xf.prototype={constructor:Ef,on:function(e,n){var r=this._,s=KQ(e+"",r),a,o=-1,l=s.length;if(arguments.length<2){for(;++o<l;)if((a=(e=s[o]).type)&&(a=YQ(r[a],e.name)))return a;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++o<l;)if(a=(e=s[o]).type)r[a]=$q(r[a],e.name,n);else if(n==null)for(a in r)r[a]=$q(r[a],e.name,null);return this},copy:function(){var e={},n=this._;for(var r in n)e[r]=n[r].slice();return new Ef(e)},call:function(e,n){if((a=arguments.length-2)>0)for(var r=new Array(a),s=0,a,o;s<a;++s)r[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],s=0,a=o.length;s<a;++s)o[s].value.apply(n,r)},apply:function(e,n,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],a=0,o=s.length;a<o;++a)s[a].value.apply(n,r)}};function YQ(e,n){for(var r=0,s=e.length,a;r<s;++r)if((a=e[r]).name===n)return a.value}function $q(e,n,r){for(var s=0,a=e.length;s<a;++s)if(e[s].name===n){e[s]=GQ,e=e.slice(0,s).concat(e.slice(s+1));break}return r!=null&&e.push({name:n,value:r}),e}var GC="http://www.w3.org/1999/xhtml";const Lq={svg:"http://www.w3.org/2000/svg",xhtml:GC,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Wf(e){var n=e+="",r=n.indexOf(":");return r>=0&&(n=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Lq.hasOwnProperty(n)?{space:Lq[n],local:e}:e}function XQ(e){return function(){var n=this.ownerDocument,r=this.namespaceURI;return r===GC&&n.documentElement.namespaceURI===GC?n.createElement(e):n.createElementNS(r,e)}}function WQ(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function fD(e){var n=Wf(e);return(n.local?WQ:XQ)(n)}function JQ(){}function _E(e){return e==null?JQ:function(){return this.querySelector(e)}}function ZQ(e){typeof e!="function"&&(e=_E(e));for(var n=this._groups,r=n.length,s=new Array(r),a=0;a<r;++a)for(var o=n[a],l=o.length,u=s[a]=new Array(l),h,f,p=0;p<l;++p)(h=o[p])&&(f=e.call(h,h.__data__,p,o))&&("__data__"in h&&(f.__data__=h.__data__),u[p]=f);return new Tn(s,this._parents)}function eH(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function tH(){return[]}function hD(e){return e==null?tH:function(){return this.querySelectorAll(e)}}function nH(e){return function(){return eH(e.apply(this,arguments))}}function rH(e){typeof e=="function"?e=nH(e):e=hD(e);for(var n=this._groups,r=n.length,s=[],a=[],o=0;o<r;++o)for(var l=n[o],u=l.length,h,f=0;f<u;++f)(h=l[f])&&(s.push(e.call(h,h.__data__,f,l)),a.push(h));return new Tn(s,a)}function dD(e){return function(){return this.matches(e)}}function pD(e){return function(n){return n.matches(e)}}var iH=Array.prototype.find;function sH(e){return function(){return iH.call(this.children,e)}}function aH(){return this.firstElementChild}function oH(e){return this.select(e==null?aH:sH(typeof e=="function"?e:pD(e)))}var uH=Array.prototype.filter;function lH(){return Array.from(this.children)}function cH(e){return function(){return uH.call(this.children,e)}}function fH(e){return this.selectAll(e==null?lH:cH(typeof e=="function"?e:pD(e)))}function hH(e){typeof e!="function"&&(e=dD(e));for(var n=this._groups,r=n.length,s=new Array(r),a=0;a<r;++a)for(var o=n[a],l=o.length,u=s[a]=[],h,f=0;f<l;++f)(h=o[f])&&e.call(h,h.__data__,f,o)&&u.push(h);return new Tn(s,this._parents)}function mD(e){return new Array(e.length)}function dH(){return new Tn(this._enter||this._groups.map(mD),this._parents)}function Mf(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Mf.prototype={constructor:Mf,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function pH(e){return function(){return e}}function mH(e,n,r,s,a,o){for(var l=0,u,h=n.length,f=o.length;l<f;++l)(u=n[l])?(u.__data__=o[l],s[l]=u):r[l]=new Mf(e,o[l]);for(;l<h;++l)(u=n[l])&&(a[l]=u)}function gH(e,n,r,s,a,o,l){var u,h,f=new Map,p=n.length,d=o.length,g=new Array(p),y;for(u=0;u<p;++u)(h=n[u])&&(g[u]=y=l.call(h,h.__data__,u,n)+"",f.has(y)?a[u]=h:f.set(y,h));for(u=0;u<d;++u)y=l.call(e,o[u],u,o)+"",(h=f.get(y))?(s[u]=h,h.__data__=o[u],f.delete(y)):r[u]=new Mf(e,o[u]);for(u=0;u<p;++u)(h=n[u])&&f.get(g[u])===h&&(a[u]=h)}function yH(e){return e.__data__}function vH(e,n){if(!arguments.length)return Array.from(this,yH);var r=n?gH:mH,s=this._parents,a=this._groups;typeof e!="function"&&(e=pH(e));for(var o=a.length,l=new Array(o),u=new Array(o),h=new Array(o),f=0;f<o;++f){var p=s[f],d=a[f],g=d.length,y=bH(e.call(p,p&&p.__data__,f,s)),C=y.length,x=u[f]=new Array(C),v=l[f]=new Array(C),b=h[f]=new Array(g);r(p,d,x,v,b,y,n);for(var w=0,E=0,q,A;w<C;++w)if(q=x[w]){for(w>=E&&(E=w+1);!(A=v[E])&&++E<C;);q._next=A||null}}return l=new Tn(l,s),l._enter=u,l._exit=h,l}function bH(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function _H(){return new Tn(this._exit||this._groups.map(mD),this._parents)}function wH(e,n,r){var s=this.enter(),a=this,o=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),n!=null&&(a=n(a),a&&(a=a.selection())),r==null?o.remove():r(o),s&&a?s.merge(a).order():a}function CH(e){for(var n=e.selection?e.selection():e,r=this._groups,s=n._groups,a=r.length,o=s.length,l=Math.min(a,o),u=new Array(a),h=0;h<l;++h)for(var f=r[h],p=s[h],d=f.length,g=u[h]=new Array(d),y,C=0;C<d;++C)(y=f[C]||p[C])&&(g[C]=y);for(;h<a;++h)u[h]=r[h];return new Tn(u,this._parents)}function EH(){for(var e=this._groups,n=-1,r=e.length;++n<r;)for(var s=e[n],a=s.length-1,o=s[a],l;--a>=0;)(l=s[a])&&(o&&l.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(l,o),o=l);return this}function xH(e){e||(e=SH);function n(d,g){return d&&g?e(d.__data__,g.__data__):!d-!g}for(var r=this._groups,s=r.length,a=new Array(s),o=0;o<s;++o){for(var l=r[o],u=l.length,h=a[o]=new Array(u),f,p=0;p<u;++p)(f=l[p])&&(h[p]=f);h.sort(n)}return new Tn(a,this._parents).order()}function SH(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function TH(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function qH(){return Array.from(this)}function AH(){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var s=e[n],a=0,o=s.length;a<o;++a){var l=s[a];if(l)return l}return null}function NH(){let e=0;for(const n of this)++e;return e}function RH(){return!this.node()}function OH(e){for(var n=this._groups,r=0,s=n.length;r<s;++r)for(var a=n[r],o=0,l=a.length,u;o<l;++o)(u=a[o])&&e.call(u,u.__data__,o,a);return this}function MH(e){return function(){this.removeAttribute(e)}}function jH(e){return function(){this.removeAttributeNS(e.space,e.local)}}function $H(e,n){return function(){this.setAttribute(e,n)}}function LH(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function IH(e,n){return function(){var r=n.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function DH(e,n){return function(){var r=n.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function kH(e,n){var r=Wf(e);if(arguments.length<2){var s=this.node();return r.local?s.getAttributeNS(r.space,r.local):s.getAttribute(r)}return this.each((n==null?r.local?jH:MH:typeof n=="function"?r.local?DH:IH:r.local?LH:$H)(r,n))}function gD(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function BH(e){return function(){this.style.removeProperty(e)}}function PH(e,n,r){return function(){this.style.setProperty(e,n,r)}}function zH(e,n,r){return function(){var s=n.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,r)}}function UH(e,n,r){return arguments.length>1?this.each((n==null?BH:typeof n=="function"?zH:PH)(e,n,r??"")):ho(this.node(),e)}function ho(e,n){return e.style.getPropertyValue(n)||gD(e).getComputedStyle(e,null).getPropertyValue(n)}function QH(e){return function(){delete this[e]}}function HH(e,n){return function(){this[e]=n}}function VH(e,n){return function(){var r=n.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function FH(e,n){return arguments.length>1?this.each((n==null?QH:typeof n=="function"?VH:HH)(e,n)):this.node()[e]}function yD(e){return e.trim().split(/^|\s+/)}function wE(e){return e.classList||new vD(e)}function vD(e){this._node=e,this._names=yD(e.getAttribute("class")||"")}vD.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function bD(e,n){for(var r=wE(e),s=-1,a=n.length;++s<a;)r.add(n[s])}function _D(e,n){for(var r=wE(e),s=-1,a=n.length;++s<a;)r.remove(n[s])}function GH(e){return function(){bD(this,e)}}function KH(e){return function(){_D(this,e)}}function YH(e,n){return function(){(n.apply(this,arguments)?bD:_D)(this,e)}}function XH(e,n){var r=yD(e+"");if(arguments.length<2){for(var s=wE(this.node()),a=-1,o=r.length;++a<o;)if(!s.contains(r[a]))return!1;return!0}return this.each((typeof n=="function"?YH:n?GH:KH)(r,n))}function WH(){this.textContent=""}function JH(e){return function(){this.textContent=e}}function ZH(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function e4(e){return arguments.length?this.each(e==null?WH:(typeof e=="function"?ZH:JH)(e)):this.node().textContent}function t4(){this.innerHTML=""}function n4(e){return function(){this.innerHTML=e}}function r4(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function i4(e){return arguments.length?this.each(e==null?t4:(typeof e=="function"?r4:n4)(e)):this.node().innerHTML}function s4(){this.nextSibling&&this.parentNode.appendChild(this)}function a4(){return this.each(s4)}function o4(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function u4(){return this.each(o4)}function l4(e){var n=typeof e=="function"?e:fD(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function c4(){return null}function f4(e,n){var r=typeof e=="function"?e:fD(e),s=n==null?c4:typeof n=="function"?n:_E(n);return this.select(function(){return this.insertBefore(r.apply(this,arguments),s.apply(this,arguments)||null)})}function h4(){var e=this.parentNode;e&&e.removeChild(this)}function d4(){return this.each(h4)}function p4(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function m4(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function g4(e){return this.select(e?m4:p4)}function y4(e){return arguments.length?this.property("__data__",e):this.node().__data__}function v4(e){return function(n){e.call(this,n,this.__data__)}}function b4(e){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");return s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),{type:n,name:r}})}function _4(e){return function(){var n=this.__on;if(n){for(var r=0,s=-1,a=n.length,o;r<a;++r)o=n[r],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):n[++s]=o;++s?n.length=s:delete this.__on}}}function w4(e,n,r){return function(){var s=this.__on,a,o=v4(n);if(s){for(var l=0,u=s.length;l<u;++l)if((a=s[l]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=o,a.options=r),a.value=n;return}}this.addEventListener(e.type,o,r),a={type:e.type,name:e.name,value:n,listener:o,options:r},s?s.push(a):this.__on=[a]}}function C4(e,n,r){var s=b4(e+""),a,o=s.length,l;if(arguments.length<2){var u=this.node().__on;if(u){for(var h=0,f=u.length,p;h<f;++h)for(a=0,p=u[h];a<o;++a)if((l=s[a]).type===p.type&&l.name===p.name)return p.value}return}for(u=n?w4:_4,a=0;a<o;++a)this.each(u(s[a],n,r));return this}function wD(e,n,r){var s=gD(e),a=s.CustomEvent;typeof a=="function"?a=new a(n,r):(a=s.document.createEvent("Event"),r?(a.initEvent(n,r.bubbles,r.cancelable),a.detail=r.detail):a.initEvent(n,!1,!1)),e.dispatchEvent(a)}function E4(e,n){return function(){return wD(this,e,n)}}function x4(e,n){return function(){return wD(this,e,n.apply(this,arguments))}}function S4(e,n){return this.each((typeof n=="function"?x4:E4)(e,n))}function*T4(){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var s=e[n],a=0,o=s.length,l;a<o;++a)(l=s[a])&&(yield l)}var CD=[null];function Tn(e,n){this._groups=e,this._parents=n}function fl(){return new Tn([[document.documentElement]],CD)}function q4(){return this}Tn.prototype=fl.prototype={constructor:Tn,select:ZQ,selectAll:rH,selectChild:oH,selectChildren:fH,filter:hH,data:vH,enter:dH,exit:_H,join:wH,merge:CH,selection:q4,order:EH,sort:xH,call:TH,nodes:qH,node:AH,size:NH,empty:RH,each:OH,attr:kH,style:UH,property:FH,classed:XH,text:e4,html:i4,raise:a4,lower:u4,append:l4,insert:f4,remove:d4,clone:g4,datum:y4,on:C4,dispatch:S4,[Symbol.iterator]:T4};function Sn(e){return typeof e=="string"?new Tn([[document.querySelector(e)]],[document.documentElement]):new Tn([[e]],CD)}function A4(e){let n;for(;n=e.sourceEvent;)e=n;return e}function Kn(e,n){if(e=A4(e),n===void 0&&(n=e.currentTarget),n){var r=n.ownerSVGElement||n;if(r.createSVGPoint){var s=r.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(n.getScreenCTM().inverse()),[s.x,s.y]}if(n.getBoundingClientRect){var a=n.getBoundingClientRect();return[e.clientX-a.left-n.clientLeft,e.clientY-a.top-n.clientTop]}}return[e.pageX,e.pageY]}const N4={passive:!1},Uu={capture:!0,passive:!1};function tm(e){e.stopImmediatePropagation()}function Ya(e){e.preventDefault(),e.stopImmediatePropagation()}function ED(e){var n=e.document.documentElement,r=Sn(e).on("dragstart.drag",Ya,Uu);"onselectstart"in n?r.on("selectstart.drag",Ya,Uu):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function xD(e,n){var r=e.document.documentElement,s=Sn(e).on("dragstart.drag",null);n&&(s.on("click.drag",Ya,Uu),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in r?s.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const nf=e=>()=>e;function KC(e,{sourceEvent:n,subject:r,target:s,identifier:a,active:o,x:l,y:u,dx:h,dy:f,dispatch:p}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:p}})}KC.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function R4(e){return!e.ctrlKey&&!e.button}function O4(){return this.parentNode}function M4(e,n){return n??{x:e.x,y:e.y}}function j4(){return navigator.maxTouchPoints||"ontouchstart"in this}function SD(){var e=R4,n=O4,r=M4,s=j4,a={},o=Xf("start","drag","end"),l=0,u,h,f,p,d=0;function g(q){q.on("mousedown.drag",y).filter(s).on("touchstart.drag",v).on("touchmove.drag",b,N4).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(q,A){if(!(p||!e.call(this,q,A))){var R=E(this,n.call(this,q,A),q,A,"mouse");R&&(Sn(q.view).on("mousemove.drag",C,Uu).on("mouseup.drag",x,Uu),ED(q.view),tm(q),f=!1,u=q.clientX,h=q.clientY,R("start",q))}}function C(q){if(Ya(q),!f){var A=q.clientX-u,R=q.clientY-h;f=A*A+R*R>d}a.mouse("drag",q)}function x(q){Sn(q.view).on("mousemove.drag mouseup.drag",null),xD(q.view,f),Ya(q),a.mouse("end",q)}function v(q,A){if(e.call(this,q,A)){var R=q.changedTouches,O=n.call(this,q,A),I=R.length,k,N;for(k=0;k<I;++k)(N=E(this,O,q,A,R[k].identifier,R[k]))&&(tm(q),N("start",q,R[k]))}}function b(q){var A=q.changedTouches,R=A.length,O,I;for(O=0;O<R;++O)(I=a[A[O].identifier])&&(Ya(q),I("drag",q,A[O]))}function w(q){var A=q.changedTouches,R=A.length,O,I;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),O=0;O<R;++O)(I=a[A[O].identifier])&&(tm(q),I("end",q,A[O]))}function E(q,A,R,O,I,k){var N=o.copy(),j=Kn(k||R,A),D,z,T;if((T=r.call(q,new KC("beforestart",{sourceEvent:R,target:g,identifier:I,active:l,x:j[0],y:j[1],dx:0,dy:0,dispatch:N}),O))!=null)return D=T.x-j[0]||0,z=T.y-j[1]||0,function M($,P,H){var G=j,V;switch($){case"start":a[I]=M,V=l++;break;case"end":delete a[I],--l;case"drag":j=Kn(H||P,A),V=l;break}N.call($,q,new KC($,{sourceEvent:P,subject:T,target:g,identifier:I,active:V,x:j[0]+D,y:j[1]+z,dx:j[0]-G[0],dy:j[1]-G[1],dispatch:N}),O)}}return g.filter=function(q){return arguments.length?(e=typeof q=="function"?q:nf(!!q),g):e},g.container=function(q){return arguments.length?(n=typeof q=="function"?q:nf(q),g):n},g.subject=function(q){return arguments.length?(r=typeof q=="function"?q:nf(q),g):r},g.touchable=function(q){return arguments.length?(s=typeof q=="function"?q:nf(!!q),g):s},g.on=function(){var q=o.on.apply(o,arguments);return q===o?g:q},g.clickDistance=function(q){return arguments.length?(d=(q=+q)*q,g):Math.sqrt(d)},g}function CE(e,n,r){e.prototype=n.prototype=r,r.constructor=e}function TD(e,n){var r=Object.create(e.prototype);for(var s in n)r[s]=n[s];return r}function hl(){}var Qu=.7,jf=1/Qu,Xa="\\s*([+-]?\\d+)\\s*",Hu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",yr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",$4=/^#([0-9a-f]{3,8})$/,L4=new RegExp(`^rgb\\(${Xa},${Xa},${Xa}\\)$`),I4=new RegExp(`^rgb\\(${yr},${yr},${yr}\\)$`),D4=new RegExp(`^rgba\\(${Xa},${Xa},${Xa},${Hu}\\)$`),k4=new RegExp(`^rgba\\(${yr},${yr},${yr},${Hu}\\)$`),B4=new RegExp(`^hsl\\(${Hu},${yr},${yr}\\)$`),P4=new RegExp(`^hsla\\(${Hu},${yr},${yr},${Hu}\\)$`),Iq={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};CE(hl,Ds,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Dq,formatHex:Dq,formatHex8:z4,formatHsl:U4,formatRgb:kq,toString:kq});function Dq(){return this.rgb().formatHex()}function z4(){return this.rgb().formatHex8()}function U4(){return qD(this).formatHsl()}function kq(){return this.rgb().formatRgb()}function Ds(e){var n,r;return e=(e+"").trim().toLowerCase(),(n=$4.exec(e))?(r=n[1].length,n=parseInt(n[1],16),r===6?Bq(n):r===3?new dn(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):r===8?rf(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):r===4?rf(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=L4.exec(e))?new dn(n[1],n[2],n[3],1):(n=I4.exec(e))?new dn(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=D4.exec(e))?rf(n[1],n[2],n[3],n[4]):(n=k4.exec(e))?rf(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=B4.exec(e))?Uq(n[1],n[2]/100,n[3]/100,1):(n=P4.exec(e))?Uq(n[1],n[2]/100,n[3]/100,n[4]):Iq.hasOwnProperty(e)?Bq(Iq[e]):e==="transparent"?new dn(NaN,NaN,NaN,0):null}function Bq(e){return new dn(e>>16&255,e>>8&255,e&255,1)}function rf(e,n,r,s){return s<=0&&(e=n=r=NaN),new dn(e,n,r,s)}function Q4(e){return e instanceof hl||(e=Ds(e)),e?(e=e.rgb(),new dn(e.r,e.g,e.b,e.opacity)):new dn}function YC(e,n,r,s){return arguments.length===1?Q4(e):new dn(e,n,r,s??1)}function dn(e,n,r,s){this.r=+e,this.g=+n,this.b=+r,this.opacity=+s}CE(dn,YC,TD(hl,{brighter(e){return e=e==null?jf:Math.pow(jf,e),new dn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Qu:Math.pow(Qu,e),new dn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new dn(js(this.r),js(this.g),js(this.b),$f(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Pq,formatHex:Pq,formatHex8:H4,formatRgb:zq,toString:zq}));function Pq(){return`#${Es(this.r)}${Es(this.g)}${Es(this.b)}`}function H4(){return`#${Es(this.r)}${Es(this.g)}${Es(this.b)}${Es((isNaN(this.opacity)?1:this.opacity)*255)}`}function zq(){const e=$f(this.opacity);return`${e===1?"rgb(":"rgba("}${js(this.r)}, ${js(this.g)}, ${js(this.b)}${e===1?")":`, ${e})`}`}function $f(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function js(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Es(e){return e=js(e),(e<16?"0":"")+e.toString(16)}function Uq(e,n,r,s){return s<=0?e=n=r=NaN:r<=0||r>=1?e=n=NaN:n<=0&&(e=NaN),new Yn(e,n,r,s)}function qD(e){if(e instanceof Yn)return new Yn(e.h,e.s,e.l,e.opacity);if(e instanceof hl||(e=Ds(e)),!e)return new Yn;if(e instanceof Yn)return e;e=e.rgb();var n=e.r/255,r=e.g/255,s=e.b/255,a=Math.min(n,r,s),o=Math.max(n,r,s),l=NaN,u=o-a,h=(o+a)/2;return u?(n===o?l=(r-s)/u+(r<s)*6:r===o?l=(s-n)/u+2:l=(n-r)/u+4,u/=h<.5?o+a:2-o-a,l*=60):u=h>0&&h<1?0:l,new Yn(l,u,h,e.opacity)}function V4(e,n,r,s){return arguments.length===1?qD(e):new Yn(e,n,r,s??1)}function Yn(e,n,r,s){this.h=+e,this.s=+n,this.l=+r,this.opacity=+s}CE(Yn,V4,TD(hl,{brighter(e){return e=e==null?jf:Math.pow(jf,e),new Yn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Qu:Math.pow(Qu,e),new Yn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,s=r+(r<.5?r:1-r)*n,a=2*r-s;return new dn(nm(e>=240?e-240:e+120,a,s),nm(e,a,s),nm(e<120?e+240:e-120,a,s),this.opacity)},clamp(){return new Yn(Qq(this.h),sf(this.s),sf(this.l),$f(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=$f(this.opacity);return`${e===1?"hsl(":"hsla("}${Qq(this.h)}, ${sf(this.s)*100}%, ${sf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Qq(e){return e=(e||0)%360,e<0?e+360:e}function sf(e){return Math.max(0,Math.min(1,e||0))}function nm(e,n,r){return(e<60?n+(r-n)*e/60:e<180?r:e<240?n+(r-n)*(240-e)/60:n)*255}const EE=e=>()=>e;function F4(e,n){return function(r){return e+r*n}}function G4(e,n,r){return e=Math.pow(e,r),n=Math.pow(n,r)-e,r=1/r,function(s){return Math.pow(e+s*n,r)}}function K4(e){return(e=+e)==1?AD:function(n,r){return r-n?G4(n,r,e):EE(isNaN(n)?r:n)}}function AD(e,n){var r=n-e;return r?F4(e,r):EE(isNaN(e)?n:e)}const Lf=(function e(n){var r=K4(n);function s(a,o){var l=r((a=YC(a)).r,(o=YC(o)).r),u=r(a.g,o.g),h=r(a.b,o.b),f=AD(a.opacity,o.opacity);return function(p){return a.r=l(p),a.g=u(p),a.b=h(p),a.opacity=f(p),a+""}}return s.gamma=e,s})(1);function Y4(e,n){n||(n=[]);var r=e?Math.min(n.length,e.length):0,s=n.slice(),a;return function(o){for(a=0;a<r;++a)s[a]=e[a]*(1-o)+n[a]*o;return s}}function X4(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function W4(e,n){var r=n?n.length:0,s=e?Math.min(r,e.length):0,a=new Array(s),o=new Array(r),l;for(l=0;l<s;++l)a[l]=ku(e[l],n[l]);for(;l<r;++l)o[l]=n[l];return function(u){for(l=0;l<s;++l)o[l]=a[l](u);return o}}function J4(e,n){var r=new Date;return e=+e,n=+n,function(s){return r.setTime(e*(1-s)+n*s),r}}function gr(e,n){return e=+e,n=+n,function(r){return e*(1-r)+n*r}}function Z4(e,n){var r={},s={},a;(e===null||typeof e!="object")&&(e={}),(n===null||typeof n!="object")&&(n={});for(a in n)a in e?r[a]=ku(e[a],n[a]):s[a]=n[a];return function(o){for(a in r)s[a]=r[a](o);return s}}var XC=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,rm=new RegExp(XC.source,"g");function e6(e){return function(){return e}}function t6(e){return function(n){return e(n)+""}}function ND(e,n){var r=XC.lastIndex=rm.lastIndex=0,s,a,o,l=-1,u=[],h=[];for(e=e+"",n=n+"";(s=XC.exec(e))&&(a=rm.exec(n));)(o=a.index)>r&&(o=n.slice(r,o),u[l]?u[l]+=o:u[++l]=o),(s=s[0])===(a=a[0])?u[l]?u[l]+=a:u[++l]=a:(u[++l]=null,h.push({i:l,x:gr(s,a)})),r=rm.lastIndex;return r<n.length&&(o=n.slice(r),u[l]?u[l]+=o:u[++l]=o),u.length<2?h[0]?t6(h[0].x):e6(n):(n=h.length,function(f){for(var p=0,d;p<n;++p)u[(d=h[p]).i]=d.x(f);return u.join("")})}function ku(e,n){var r=typeof n,s;return n==null||r==="boolean"?EE(n):(r==="number"?gr:r==="string"?(s=Ds(n))?(n=s,Lf):ND:n instanceof Ds?Lf:n instanceof Date?J4:X4(n)?Y4:Array.isArray(n)?W4:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?Z4:gr)(e,n)}var Hq=180/Math.PI,WC={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function RD(e,n,r,s,a,o){var l,u,h;return(l=Math.sqrt(e*e+n*n))&&(e/=l,n/=l),(h=e*r+n*s)&&(r-=e*h,s-=n*h),(u=Math.sqrt(r*r+s*s))&&(r/=u,s/=u,h/=u),e*s<n*r&&(e=-e,n=-n,h=-h,l=-l),{translateX:a,translateY:o,rotate:Math.atan2(n,e)*Hq,skewX:Math.atan(h)*Hq,scaleX:l,scaleY:u}}var af;function n6(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?WC:RD(n.a,n.b,n.c,n.d,n.e,n.f)}function r6(e){return e==null||(af||(af=document.createElementNS("http://www.w3.org/2000/svg","g")),af.setAttribute("transform",e),!(e=af.transform.baseVal.consolidate()))?WC:(e=e.matrix,RD(e.a,e.b,e.c,e.d,e.e,e.f))}function OD(e,n,r,s){function a(f){return f.length?f.pop()+" ":""}function o(f,p,d,g,y,C){if(f!==d||p!==g){var x=y.push("translate(",null,n,null,r);C.push({i:x-4,x:gr(f,d)},{i:x-2,x:gr(p,g)})}else(d||g)&&y.push("translate("+d+n+g+r)}function l(f,p,d,g){f!==p?(f-p>180?p+=360:p-f>180&&(f+=360),g.push({i:d.push(a(d)+"rotate(",null,s)-2,x:gr(f,p)})):p&&d.push(a(d)+"rotate("+p+s)}function u(f,p,d,g){f!==p?g.push({i:d.push(a(d)+"skewX(",null,s)-2,x:gr(f,p)}):p&&d.push(a(d)+"skewX("+p+s)}function h(f,p,d,g,y,C){if(f!==d||p!==g){var x=y.push(a(y)+"scale(",null,",",null,")");C.push({i:x-4,x:gr(f,d)},{i:x-2,x:gr(p,g)})}else(d!==1||g!==1)&&y.push(a(y)+"scale("+d+","+g+")")}return function(f,p){var d=[],g=[];return f=e(f),p=e(p),o(f.translateX,f.translateY,p.translateX,p.translateY,d,g),l(f.rotate,p.rotate,d,g),u(f.skewX,p.skewX,d,g),h(f.scaleX,f.scaleY,p.scaleX,p.scaleY,d,g),f=p=null,function(y){for(var C=-1,x=g.length,v;++C<x;)d[(v=g[C]).i]=v.x(y);return d.join("")}}}var i6=OD(n6,"px, ","px)","deg)"),s6=OD(r6,", ",")",")"),a6=1e-12;function Vq(e){return((e=Math.exp(e))+1/e)/2}function o6(e){return((e=Math.exp(e))-1/e)/2}function u6(e){return((e=Math.exp(2*e))-1)/(e+1)}const xf=(function e(n,r,s){function a(o,l){var u=o[0],h=o[1],f=o[2],p=l[0],d=l[1],g=l[2],y=p-u,C=d-h,x=y*y+C*C,v,b;if(x<a6)b=Math.log(g/f)/n,v=function(O){return[u+O*y,h+O*C,f*Math.exp(n*O*b)]};else{var w=Math.sqrt(x),E=(g*g-f*f+s*x)/(2*f*r*w),q=(g*g-f*f-s*x)/(2*g*r*w),A=Math.log(Math.sqrt(E*E+1)-E),R=Math.log(Math.sqrt(q*q+1)-q);b=(R-A)/n,v=function(O){var I=O*b,k=Vq(A),N=f/(r*w)*(k*u6(n*I+A)-o6(A));return[u+N*y,h+N*C,f*k/Vq(n*I+A)]}}return v.duration=b*1e3*n/Math.SQRT2,v}return a.rho=function(o){var l=Math.max(.001,+o),u=l*l,h=u*u;return e(l,u,h)},a})(Math.SQRT2,2,4);var po=0,Mu=0,Au=0,MD=1e3,If,ju,Df=0,ks=0,Jf=0,Vu=typeof performance=="object"&&performance.now?performance:Date,jD=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function xE(){return ks||(jD(l6),ks=Vu.now()+Jf)}function l6(){ks=0}function kf(){this._call=this._time=this._next=null}kf.prototype=$D.prototype={constructor:kf,restart:function(e,n,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?xE():+r)+(n==null?0:+n),!this._next&&ju!==this&&(ju?ju._next=this:If=this,ju=this),this._call=e,this._time=r,JC()},stop:function(){this._call&&(this._call=null,this._time=1/0,JC())}};function $D(e,n,r){var s=new kf;return s.restart(e,n,r),s}function c6(){xE(),++po;for(var e=If,n;e;)(n=ks-e._time)>=0&&e._call.call(void 0,n),e=e._next;--po}function Fq(){ks=(Df=Vu.now())+Jf,po=Mu=0;try{c6()}finally{po=0,h6(),ks=0}}function f6(){var e=Vu.now(),n=e-Df;n>MD&&(Jf-=n,Df=e)}function h6(){for(var e,n=If,r,s=1/0;n;)n._call?(s>n._time&&(s=n._time),e=n,n=n._next):(r=n._next,n._next=null,n=e?e._next=r:If=r);ju=e,JC(s)}function JC(e){if(!po){Mu&&(Mu=clearTimeout(Mu));var n=e-ks;n>24?(e<1/0&&(Mu=setTimeout(Fq,e-Vu.now()-Jf)),Au&&(Au=clearInterval(Au))):(Au||(Df=Vu.now(),Au=setInterval(f6,MD)),po=1,jD(Fq))}}function Gq(e,n,r){var s=new kf;return n=n==null?0:+n,s.restart(a=>{s.stop(),e(a+n)},n,r),s}var d6=Xf("start","end","cancel","interrupt"),p6=[],LD=0,Kq=1,ZC=2,Sf=3,Yq=4,eE=5,Tf=6;function Zf(e,n,r,s,a,o){var l=e.__transition;if(!l)e.__transition={};else if(r in l)return;m6(e,r,{name:n,index:s,group:a,on:d6,tween:p6,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:LD})}function SE(e,n){var r=rr(e,n);if(r.state>LD)throw new Error("too late; already scheduled");return r}function wr(e,n){var r=rr(e,n);if(r.state>Sf)throw new Error("too late; already running");return r}function rr(e,n){var r=e.__transition;if(!r||!(r=r[n]))throw new Error("transition not found");return r}function m6(e,n,r){var s=e.__transition,a;s[n]=r,r.timer=$D(o,0,r.time);function o(f){r.state=Kq,r.timer.restart(l,r.delay,r.time),r.delay<=f&&l(f-r.delay)}function l(f){var p,d,g,y;if(r.state!==Kq)return h();for(p in s)if(y=s[p],y.name===r.name){if(y.state===Sf)return Gq(l);y.state===Yq?(y.state=Tf,y.timer.stop(),y.on.call("interrupt",e,e.__data__,y.index,y.group),delete s[p]):+p<n&&(y.state=Tf,y.timer.stop(),y.on.call("cancel",e,e.__data__,y.index,y.group),delete s[p])}if(Gq(function(){r.state===Sf&&(r.state=Yq,r.timer.restart(u,r.delay,r.time),u(f))}),r.state=ZC,r.on.call("start",e,e.__data__,r.index,r.group),r.state===ZC){for(r.state=Sf,a=new Array(g=r.tween.length),p=0,d=-1;p<g;++p)(y=r.tween[p].value.call(e,e.__data__,r.index,r.group))&&(a[++d]=y);a.length=d+1}}function u(f){for(var p=f<r.duration?r.ease.call(null,f/r.duration):(r.timer.restart(h),r.state=eE,1),d=-1,g=a.length;++d<g;)a[d].call(e,p);r.state===eE&&(r.on.call("end",e,e.__data__,r.index,r.group),h())}function h(){r.state=Tf,r.timer.stop(),delete s[n];for(var f in s)return;delete e.__transition}}function qf(e,n){var r=e.__transition,s,a,o=!0,l;if(r){n=n==null?null:n+"";for(l in r){if((s=r[l]).name!==n){o=!1;continue}a=s.state>ZC&&s.state<eE,s.state=Tf,s.timer.stop(),s.on.call(a?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete r[l]}o&&delete e.__transition}}function g6(e){return this.each(function(){qf(this,e)})}function y6(e,n){var r,s;return function(){var a=wr(this,e),o=a.tween;if(o!==r){s=r=o;for(var l=0,u=s.length;l<u;++l)if(s[l].name===n){s=s.slice(),s.splice(l,1);break}}a.tween=s}}function v6(e,n,r){var s,a;if(typeof r!="function")throw new Error;return function(){var o=wr(this,e),l=o.tween;if(l!==s){a=(s=l).slice();for(var u={name:n,value:r},h=0,f=a.length;h<f;++h)if(a[h].name===n){a[h]=u;break}h===f&&a.push(u)}o.tween=a}}function b6(e,n){var r=this._id;if(e+="",arguments.length<2){for(var s=rr(this.node(),r).tween,a=0,o=s.length,l;a<o;++a)if((l=s[a]).name===e)return l.value;return null}return this.each((n==null?y6:v6)(r,e,n))}function TE(e,n,r){var s=e._id;return e.each(function(){var a=wr(this,s);(a.value||(a.value={}))[n]=r.apply(this,arguments)}),function(a){return rr(a,s).value[n]}}function ID(e,n){var r;return(typeof n=="number"?gr:n instanceof Ds?Lf:(r=Ds(n))?(n=r,Lf):ND)(e,n)}function _6(e){return function(){this.removeAttribute(e)}}function w6(e){return function(){this.removeAttributeNS(e.space,e.local)}}function C6(e,n,r){var s,a=r+"",o;return function(){var l=this.getAttribute(e);return l===a?null:l===s?o:o=n(s=l,r)}}function E6(e,n,r){var s,a=r+"",o;return function(){var l=this.getAttributeNS(e.space,e.local);return l===a?null:l===s?o:o=n(s=l,r)}}function x6(e,n,r){var s,a,o;return function(){var l,u=r(this),h;return u==null?void this.removeAttribute(e):(l=this.getAttribute(e),h=u+"",l===h?null:l===s&&h===a?o:(a=h,o=n(s=l,u)))}}function S6(e,n,r){var s,a,o;return function(){var l,u=r(this),h;return u==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),h=u+"",l===h?null:l===s&&h===a?o:(a=h,o=n(s=l,u)))}}function T6(e,n){var r=Wf(e),s=r==="transform"?s6:ID;return this.attrTween(e,typeof n=="function"?(r.local?S6:x6)(r,s,TE(this,"attr."+e,n)):n==null?(r.local?w6:_6)(r):(r.local?E6:C6)(r,s,n))}function q6(e,n){return function(r){this.setAttribute(e,n.call(this,r))}}function A6(e,n){return function(r){this.setAttributeNS(e.space,e.local,n.call(this,r))}}function N6(e,n){var r,s;function a(){var o=n.apply(this,arguments);return o!==s&&(r=(s=o)&&A6(e,o)),r}return a._value=n,a}function R6(e,n){var r,s;function a(){var o=n.apply(this,arguments);return o!==s&&(r=(s=o)&&q6(e,o)),r}return a._value=n,a}function O6(e,n){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(n==null)return this.tween(r,null);if(typeof n!="function")throw new Error;var s=Wf(e);return this.tween(r,(s.local?N6:R6)(s,n))}function M6(e,n){return function(){SE(this,e).delay=+n.apply(this,arguments)}}function j6(e,n){return n=+n,function(){SE(this,e).delay=n}}function $6(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?M6:j6)(n,e)):rr(this.node(),n).delay}function L6(e,n){return function(){wr(this,e).duration=+n.apply(this,arguments)}}function I6(e,n){return n=+n,function(){wr(this,e).duration=n}}function D6(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?L6:I6)(n,e)):rr(this.node(),n).duration}function k6(e,n){if(typeof n!="function")throw new Error;return function(){wr(this,e).ease=n}}function B6(e){var n=this._id;return arguments.length?this.each(k6(n,e)):rr(this.node(),n).ease}function P6(e,n){return function(){var r=n.apply(this,arguments);if(typeof r!="function")throw new Error;wr(this,e).ease=r}}function z6(e){if(typeof e!="function")throw new Error;return this.each(P6(this._id,e))}function U6(e){typeof e!="function"&&(e=dD(e));for(var n=this._groups,r=n.length,s=new Array(r),a=0;a<r;++a)for(var o=n[a],l=o.length,u=s[a]=[],h,f=0;f<l;++f)(h=o[f])&&e.call(h,h.__data__,f,o)&&u.push(h);return new Jr(s,this._parents,this._name,this._id)}function Q6(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,r=e._groups,s=n.length,a=r.length,o=Math.min(s,a),l=new Array(s),u=0;u<o;++u)for(var h=n[u],f=r[u],p=h.length,d=l[u]=new Array(p),g,y=0;y<p;++y)(g=h[y]||f[y])&&(d[y]=g);for(;u<s;++u)l[u]=n[u];return new Jr(l,this._parents,this._name,this._id)}function H6(e){return(e+"").trim().split(/^|\s+/).every(function(n){var r=n.indexOf(".");return r>=0&&(n=n.slice(0,r)),!n||n==="start"})}function V6(e,n,r){var s,a,o=H6(n)?SE:wr;return function(){var l=o(this,e),u=l.on;u!==s&&(a=(s=u).copy()).on(n,r),l.on=a}}function F6(e,n){var r=this._id;return arguments.length<2?rr(this.node(),r).on.on(e):this.each(V6(r,e,n))}function G6(e){return function(){var n=this.parentNode;for(var r in this.__transition)if(+r!==e)return;n&&n.removeChild(this)}}function K6(){return this.on("end.remove",G6(this._id))}function Y6(e){var n=this._name,r=this._id;typeof e!="function"&&(e=_E(e));for(var s=this._groups,a=s.length,o=new Array(a),l=0;l<a;++l)for(var u=s[l],h=u.length,f=o[l]=new Array(h),p,d,g=0;g<h;++g)(p=u[g])&&(d=e.call(p,p.__data__,g,u))&&("__data__"in p&&(d.__data__=p.__data__),f[g]=d,Zf(f[g],n,r,g,f,rr(p,r)));return new Jr(o,this._parents,n,r)}function X6(e){var n=this._name,r=this._id;typeof e!="function"&&(e=hD(e));for(var s=this._groups,a=s.length,o=[],l=[],u=0;u<a;++u)for(var h=s[u],f=h.length,p,d=0;d<f;++d)if(p=h[d]){for(var g=e.call(p,p.__data__,d,h),y,C=rr(p,r),x=0,v=g.length;x<v;++x)(y=g[x])&&Zf(y,n,r,x,g,C);o.push(g),l.push(p)}return new Jr(o,l,n,r)}var W6=fl.prototype.constructor;function J6(){return new W6(this._groups,this._parents)}function Z6(e,n){var r,s,a;return function(){var o=ho(this,e),l=(this.style.removeProperty(e),ho(this,e));return o===l?null:o===r&&l===s?a:a=n(r=o,s=l)}}function DD(e){return function(){this.style.removeProperty(e)}}function e5(e,n,r){var s,a=r+"",o;return function(){var l=ho(this,e);return l===a?null:l===s?o:o=n(s=l,r)}}function t5(e,n,r){var s,a,o;return function(){var l=ho(this,e),u=r(this),h=u+"";return u==null&&(h=u=(this.style.removeProperty(e),ho(this,e))),l===h?null:l===s&&h===a?o:(a=h,o=n(s=l,u))}}function n5(e,n){var r,s,a,o="style."+n,l="end."+o,u;return function(){var h=wr(this,e),f=h.on,p=h.value[o]==null?u||(u=DD(n)):void 0;(f!==r||a!==p)&&(s=(r=f).copy()).on(l,a=p),h.on=s}}function r5(e,n,r){var s=(e+="")=="transform"?i6:ID;return n==null?this.styleTween(e,Z6(e,s)).on("end.style."+e,DD(e)):typeof n=="function"?this.styleTween(e,t5(e,s,TE(this,"style."+e,n))).each(n5(this._id,e)):this.styleTween(e,e5(e,s,n),r).on("end.style."+e,null)}function i5(e,n,r){return function(s){this.style.setProperty(e,n.call(this,s),r)}}function s5(e,n,r){var s,a;function o(){var l=n.apply(this,arguments);return l!==a&&(s=(a=l)&&i5(e,l,r)),s}return o._value=n,o}function a5(e,n,r){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(n==null)return this.tween(s,null);if(typeof n!="function")throw new Error;return this.tween(s,s5(e,n,r??""))}function o5(e){return function(){this.textContent=e}}function u5(e){return function(){var n=e(this);this.textContent=n??""}}function l5(e){return this.tween("text",typeof e=="function"?u5(TE(this,"text",e)):o5(e==null?"":e+""))}function c5(e){return function(n){this.textContent=e.call(this,n)}}function f5(e){var n,r;function s(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&c5(a)),n}return s._value=e,s}function h5(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,f5(e))}function d5(){for(var e=this._name,n=this._id,r=kD(),s=this._groups,a=s.length,o=0;o<a;++o)for(var l=s[o],u=l.length,h,f=0;f<u;++f)if(h=l[f]){var p=rr(h,n);Zf(h,e,r,f,l,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new Jr(s,this._parents,e,r)}function p5(){var e,n,r=this,s=r._id,a=r.size();return new Promise(function(o,l){var u={value:l},h={value:function(){--a===0&&o()}};r.each(function(){var f=wr(this,s),p=f.on;p!==e&&(n=(e=p).copy(),n._.cancel.push(u),n._.interrupt.push(u),n._.end.push(h)),f.on=n}),a===0&&o()})}var m5=0;function Jr(e,n,r,s){this._groups=e,this._parents=n,this._name=r,this._id=s}function kD(){return++m5}var Hr=fl.prototype;Jr.prototype={constructor:Jr,select:Y6,selectAll:X6,selectChild:Hr.selectChild,selectChildren:Hr.selectChildren,filter:U6,merge:Q6,selection:J6,transition:d5,call:Hr.call,nodes:Hr.nodes,node:Hr.node,size:Hr.size,empty:Hr.empty,each:Hr.each,on:F6,attr:T6,attrTween:O6,style:r5,styleTween:a5,text:l5,textTween:h5,remove:K6,tween:b6,delay:$6,duration:D6,ease:B6,easeVarying:z6,end:p5,[Symbol.iterator]:Hr[Symbol.iterator]};function g5(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var y5={time:null,delay:0,duration:250,ease:g5};function v5(e,n){for(var r;!(r=e.__transition)||!(r=r[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return r}function b5(e){var n,r;e instanceof Jr?(n=e._id,e=e._name):(n=kD(),(r=y5).time=xE(),e=e==null?null:e+"");for(var s=this._groups,a=s.length,o=0;o<a;++o)for(var l=s[o],u=l.length,h,f=0;f<u;++f)(h=l[f])&&Zf(h,e,n,f,l,r||v5(h,n));return new Jr(s,this._parents,e,n)}fl.prototype.interrupt=g6;fl.prototype.transition=b5;const of=e=>()=>e;function _5(e,{sourceEvent:n,target:r,transform:s,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:a}})}function Xr(e,n,r){this.k=e,this.x=n,this.y=r}Xr.prototype={constructor:Xr,scale:function(e){return e===1?this:new Xr(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Xr(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var eh=new Xr(1,0,0);BD.prototype=Xr.prototype;function BD(e){for(;!e.__zoom;)if(!(e=e.parentNode))return eh;return e.__zoom}function im(e){e.stopImmediatePropagation()}function Nu(e){e.preventDefault(),e.stopImmediatePropagation()}function w5(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function C5(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Xq(){return this.__zoom||eh}function E5(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function x5(){return navigator.maxTouchPoints||"ontouchstart"in this}function S5(e,n,r){var s=e.invertX(n[0][0])-r[0][0],a=e.invertX(n[1][0])-r[1][0],o=e.invertY(n[0][1])-r[0][1],l=e.invertY(n[1][1])-r[1][1];return e.translate(a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a),l>o?(o+l)/2:Math.min(0,o)||Math.max(0,l))}function PD(){var e=w5,n=C5,r=S5,s=E5,a=x5,o=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],u=250,h=xf,f=Xf("start","zoom","end"),p,d,g,y=500,C=150,x=0,v=10;function b(T){T.property("__zoom",Xq).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",N).filter(a).on("touchstart.zoom",j).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(T,M,$,P){var H=T.selection?T.selection():T;H.property("__zoom",Xq),T!==H?A(T,M,$,P):H.interrupt().each(function(){R(this,arguments).event(P).start().zoom(null,typeof M=="function"?M.apply(this,arguments):M).end()})},b.scaleBy=function(T,M,$,P){b.scaleTo(T,function(){var H=this.__zoom.k,G=typeof M=="function"?M.apply(this,arguments):M;return H*G},$,P)},b.scaleTo=function(T,M,$,P){b.transform(T,function(){var H=n.apply(this,arguments),G=this.__zoom,V=$==null?q(H):typeof $=="function"?$.apply(this,arguments):$,B=G.invert(V),K=typeof M=="function"?M.apply(this,arguments):M;return r(E(w(G,K),V,B),H,l)},$,P)},b.translateBy=function(T,M,$,P){b.transform(T,function(){return r(this.__zoom.translate(typeof M=="function"?M.apply(this,arguments):M,typeof $=="function"?$.apply(this,arguments):$),n.apply(this,arguments),l)},null,P)},b.translateTo=function(T,M,$,P,H){b.transform(T,function(){var G=n.apply(this,arguments),V=this.__zoom,B=P==null?q(G):typeof P=="function"?P.apply(this,arguments):P;return r(eh.translate(B[0],B[1]).scale(V.k).translate(typeof M=="function"?-M.apply(this,arguments):-M,typeof $=="function"?-$.apply(this,arguments):-$),G,l)},P,H)};function w(T,M){return M=Math.max(o[0],Math.min(o[1],M)),M===T.k?T:new Xr(M,T.x,T.y)}function E(T,M,$){var P=M[0]-$[0]*T.k,H=M[1]-$[1]*T.k;return P===T.x&&H===T.y?T:new Xr(T.k,P,H)}function q(T){return[(+T[0][0]+ +T[1][0])/2,(+T[0][1]+ +T[1][1])/2]}function A(T,M,$,P){T.on("start.zoom",function(){R(this,arguments).event(P).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event(P).end()}).tween("zoom",function(){var H=this,G=arguments,V=R(H,G).event(P),B=n.apply(H,G),K=$==null?q(B):typeof $=="function"?$.apply(H,G):$,te=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),Q=H.__zoom,J=typeof M=="function"?M.apply(H,G):M,ie=h(Q.invert(K).concat(te/Q.k),J.invert(K).concat(te/J.k));return function(oe){if(oe===1)oe=J;else{var ee=ie(oe),fe=te/ee[2];oe=new Xr(fe,K[0]-ee[0]*fe,K[1]-ee[1]*fe)}V.zoom(null,oe)}})}function R(T,M,$){return!$&&T.__zooming||new O(T,M)}function O(T,M){this.that=T,this.args=M,this.active=0,this.sourceEvent=null,this.extent=n.apply(T,M),this.taps=0}O.prototype={event:function(T){return T&&(this.sourceEvent=T),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(T,M){return this.mouse&&T!=="mouse"&&(this.mouse[1]=M.invert(this.mouse[0])),this.touch0&&T!=="touch"&&(this.touch0[1]=M.invert(this.touch0[0])),this.touch1&&T!=="touch"&&(this.touch1[1]=M.invert(this.touch1[0])),this.that.__zoom=M,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(T){var M=Sn(this.that).datum();f.call(T,this.that,new _5(T,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:f}),M)}};function I(T,...M){if(!e.apply(this,arguments))return;var $=R(this,M).event(T),P=this.__zoom,H=Math.max(o[0],Math.min(o[1],P.k*Math.pow(2,s.apply(this,arguments)))),G=Kn(T);if($.wheel)($.mouse[0][0]!==G[0]||$.mouse[0][1]!==G[1])&&($.mouse[1]=P.invert($.mouse[0]=G)),clearTimeout($.wheel);else{if(P.k===H)return;$.mouse=[G,P.invert(G)],qf(this),$.start()}Nu(T),$.wheel=setTimeout(V,C),$.zoom("mouse",r(E(w(P,H),$.mouse[0],$.mouse[1]),$.extent,l));function V(){$.wheel=null,$.end()}}function k(T,...M){if(g||!e.apply(this,arguments))return;var $=T.currentTarget,P=R(this,M,!0).event(T),H=Sn(T.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",te,!0),G=Kn(T,$),V=T.clientX,B=T.clientY;ED(T.view),im(T),P.mouse=[G,this.__zoom.invert(G)],qf(this),P.start();function K(Q){if(Nu(Q),!P.moved){var J=Q.clientX-V,ie=Q.clientY-B;P.moved=J*J+ie*ie>x}P.event(Q).zoom("mouse",r(E(P.that.__zoom,P.mouse[0]=Kn(Q,$),P.mouse[1]),P.extent,l))}function te(Q){H.on("mousemove.zoom mouseup.zoom",null),xD(Q.view,P.moved),Nu(Q),P.event(Q).end()}}function N(T,...M){if(e.apply(this,arguments)){var $=this.__zoom,P=Kn(T.changedTouches?T.changedTouches[0]:T,this),H=$.invert(P),G=$.k*(T.shiftKey?.5:2),V=r(E(w($,G),P,H),n.apply(this,M),l);Nu(T),u>0?Sn(this).transition().duration(u).call(A,V,P,T):Sn(this).call(b.transform,V,P,T)}}function j(T,...M){if(e.apply(this,arguments)){var $=T.touches,P=$.length,H=R(this,M,T.changedTouches.length===P).event(T),G,V,B,K;for(im(T),V=0;V<P;++V)B=$[V],K=Kn(B,this),K=[K,this.__zoom.invert(K),B.identifier],H.touch0?!H.touch1&&H.touch0[2]!==K[2]&&(H.touch1=K,H.taps=0):(H.touch0=K,G=!0,H.taps=1+!!p);p&&(p=clearTimeout(p)),G&&(H.taps<2&&(d=K[0],p=setTimeout(function(){p=null},y)),qf(this),H.start())}}function D(T,...M){if(this.__zooming){var $=R(this,M).event(T),P=T.changedTouches,H=P.length,G,V,B,K;for(Nu(T),G=0;G<H;++G)V=P[G],B=Kn(V,this),$.touch0&&$.touch0[2]===V.identifier?$.touch0[0]=B:$.touch1&&$.touch1[2]===V.identifier&&($.touch1[0]=B);if(V=$.that.__zoom,$.touch1){var te=$.touch0[0],Q=$.touch0[1],J=$.touch1[0],ie=$.touch1[1],oe=(oe=J[0]-te[0])*oe+(oe=J[1]-te[1])*oe,ee=(ee=ie[0]-Q[0])*ee+(ee=ie[1]-Q[1])*ee;V=w(V,Math.sqrt(oe/ee)),B=[(te[0]+J[0])/2,(te[1]+J[1])/2],K=[(Q[0]+ie[0])/2,(Q[1]+ie[1])/2]}else if($.touch0)B=$.touch0[0],K=$.touch0[1];else return;$.zoom("touch",r(E(V,B,K),$.extent,l))}}function z(T,...M){if(this.__zooming){var $=R(this,M).event(T),P=T.changedTouches,H=P.length,G,V;for(im(T),g&&clearTimeout(g),g=setTimeout(function(){g=null},y),G=0;G<H;++G)V=P[G],$.touch0&&$.touch0[2]===V.identifier?delete $.touch0:$.touch1&&$.touch1[2]===V.identifier&&delete $.touch1;if($.touch1&&!$.touch0&&($.touch0=$.touch1,delete $.touch1),$.touch0)$.touch0[1]=this.__zoom.invert($.touch0[0]);else if($.end(),$.taps===2&&(V=Kn(V,this),Math.hypot(d[0]-V[0],d[1]-V[1])<v)){var B=Sn(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return b.wheelDelta=function(T){return arguments.length?(s=typeof T=="function"?T:of(+T),b):s},b.filter=function(T){return arguments.length?(e=typeof T=="function"?T:of(!!T),b):e},b.touchable=function(T){return arguments.length?(a=typeof T=="function"?T:of(!!T),b):a},b.extent=function(T){return arguments.length?(n=typeof T=="function"?T:of([[+T[0][0],+T[0][1]],[+T[1][0],+T[1][1]]]),b):n},b.scaleExtent=function(T){return arguments.length?(o[0]=+T[0],o[1]=+T[1],b):[o[0],o[1]]},b.translateExtent=function(T){return arguments.length?(l[0][0]=+T[0][0],l[1][0]=+T[1][0],l[0][1]=+T[0][1],l[1][1]=+T[1][1],b):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},b.constrain=function(T){return arguments.length?(r=T,b):r},b.duration=function(T){return arguments.length?(u=+T,b):u},b.interpolate=function(T){return arguments.length?(h=T,b):h},b.on=function(){var T=f.on.apply(f,arguments);return T===f?b:T},b.clickDistance=function(T){return arguments.length?(x=(T=+T)*T,b):Math.sqrt(x)},b.tapDistance=function(T){return arguments.length?(v=+T,b):v},b}const vr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:n,sourceHandle:r,targetHandle:s})=>`Couldn't create edge for ${e} handle id: "${e==="source"?r:s}", edge id: ${n}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Fu=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],zD=["Enter"," ","Escape"],UD={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:n,y:r})=>`Moved selected node ${e}. New position, x: ${n}, y: ${r}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var mo;(function(e){e.Strict="strict",e.Loose="loose"})(mo||(mo={}));var $s;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})($s||($s={}));var Gu;(function(e){e.Partial="partial",e.Full="full"})(Gu||(Gu={}));const QD={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Li;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Li||(Li={}));var Bf;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Bf||(Bf={}));var Ne;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ne||(Ne={}));const Wq={[Ne.Left]:Ne.Right,[Ne.Right]:Ne.Left,[Ne.Top]:Ne.Bottom,[Ne.Bottom]:Ne.Top};function HD(e){return e===null?null:e?"valid":"invalid"}const VD=e=>"id"in e&&"source"in e&&"target"in e,T5=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),qE=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),dl=(e,n=[0,0])=>{const{width:r,height:s}=Zr(e),a=e.origin??n,o=r*a[0],l=s*a[1];return{x:e.position.x-o,y:e.position.y-l}},q5=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const r=e.reduce((s,a)=>{const o=typeof a=="string";let l=!n.nodeLookup&&!o?a:void 0;n.nodeLookup&&(l=o?n.nodeLookup.get(a):qE(a)?a:n.nodeLookup.get(a.id));const u=l?Pf(l,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return th(s,u)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return nh(r)},pl=(e,n={})=>{let r={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return e.forEach(a=>{(n.filter===void 0||n.filter(a))&&(r=th(r,Pf(a)),s=!0)}),s?nh(r):{x:0,y:0,width:0,height:0}},AE=(e,n,[r,s,a]=[0,0,1],o=!1,l=!1)=>{const u={...gl(n,[r,s,a]),width:n.width/a,height:n.height/a},h=[];for(const f of e.values()){const{measured:p,selectable:d=!0,hidden:g=!1}=f;if(l&&!d||g)continue;const y=p.width??f.width??f.initialWidth??null,C=p.height??f.height??f.initialHeight??null,x=Ku(u,yo(f)),v=(y??0)*(C??0),b=o&&x>0;(!f.internals.handleBounds||b||x>=v||f.dragging)&&h.push(f)}return h},A5=(e,n)=>{const r=new Set;return e.forEach(s=>{r.add(s.id)}),n.filter(s=>r.has(s.source)||r.has(s.target))};function N5(e,n){const r=new Map,s=n!=null&&n.nodes?new Set(n.nodes.map(a=>a.id)):null;return e.forEach(a=>{a.measured.width&&a.measured.height&&((n==null?void 0:n.includeHiddenNodes)||!a.hidden)&&(!s||s.has(a.id))&&r.set(a.id,a)}),r}async function R5({nodes:e,width:n,height:r,panZoom:s,minZoom:a,maxZoom:o},l){if(e.size===0)return Promise.resolve(!0);const u=N5(e,l),h=pl(u),f=NE(h,n,r,(l==null?void 0:l.minZoom)??a,(l==null?void 0:l.maxZoom)??o,(l==null?void 0:l.padding)??.1);return await s.setViewport(f,{duration:l==null?void 0:l.duration,ease:l==null?void 0:l.ease,interpolate:l==null?void 0:l.interpolate}),Promise.resolve(!0)}function FD({nodeId:e,nextPosition:n,nodeLookup:r,nodeOrigin:s=[0,0],nodeExtent:a,onError:o}){const l=r.get(e),u=l.parentId?r.get(l.parentId):void 0,{x:h,y:f}=u?u.internals.positionAbsolute:{x:0,y:0},p=l.origin??s;let d=l.extent||a;if(l.extent==="parent"&&!l.expandParent)if(!u)o==null||o("005",vr.error005());else{const y=u.measured.width,C=u.measured.height;y&&C&&(d=[[h,f],[h+y,f+C]])}else u&&vo(l.extent)&&(d=[[l.extent[0][0]+h,l.extent[0][1]+f],[l.extent[1][0]+h,l.extent[1][1]+f]]);const g=vo(d)?Bs(n,d,l.measured):n;return(l.measured.width===void 0||l.measured.height===void 0)&&(o==null||o("015",vr.error015())),{position:{x:g.x-h+(l.measured.width??0)*p[0],y:g.y-f+(l.measured.height??0)*p[1]},positionAbsolute:g}}async function O5({nodesToRemove:e=[],edgesToRemove:n=[],nodes:r,edges:s,onBeforeDelete:a}){const o=new Set(e.map(g=>g.id)),l=[];for(const g of r){if(g.deletable===!1)continue;const y=o.has(g.id),C=!y&&g.parentId&&l.find(x=>x.id===g.parentId);(y||C)&&l.push(g)}const u=new Set(n.map(g=>g.id)),h=s.filter(g=>g.deletable!==!1),p=A5(l,h);for(const g of h)u.has(g.id)&&!p.find(C=>C.id===g.id)&&p.push(g);if(!a)return{edges:p,nodes:l};const d=await a({nodes:l,edges:p});return typeof d=="boolean"?d?{edges:p,nodes:l}:{edges:[],nodes:[]}:d}const go=(e,n=0,r=1)=>Math.min(Math.max(e,n),r),Bs=(e={x:0,y:0},n,r)=>({x:go(e.x,n[0][0],n[1][0]-((r==null?void 0:r.width)??0)),y:go(e.y,n[0][1],n[1][1]-((r==null?void 0:r.height)??0))});function GD(e,n,r){const{width:s,height:a}=Zr(r),{x:o,y:l}=r.internals.positionAbsolute;return Bs(e,[[o,l],[o+s,l+a]],n)}const Jq=(e,n,r)=>e<n?go(Math.abs(e-n),1,n)/n:e>r?-go(Math.abs(e-r),1,n)/n:0,KD=(e,n,r=15,s=40)=>{const a=Jq(e.x,s,n.width-s)*r,o=Jq(e.y,s,n.height-s)*r;return[a,o]},th=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),tE=({x:e,y:n,width:r,height:s})=>({x:e,y:n,x2:e+r,y2:n+s}),nh=({x:e,y:n,x2:r,y2:s})=>({x:e,y:n,width:r-e,height:s-n}),yo=(e,n=[0,0])=>{var a,o;const{x:r,y:s}=qE(e)?e.internals.positionAbsolute:dl(e,n);return{x:r,y:s,width:((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},Pf=(e,n=[0,0])=>{var a,o;const{x:r,y:s}=qE(e)?e.internals.positionAbsolute:dl(e,n);return{x:r,y:s,x2:r+(((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0),y2:s+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},YD=(e,n)=>nh(th(tE(e),tE(n))),Ku=(e,n)=>{const r=Math.max(0,Math.min(e.x+e.width,n.x+n.width)-Math.max(e.x,n.x)),s=Math.max(0,Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y));return Math.ceil(r*s)},Zq=e=>Wn(e.width)&&Wn(e.height)&&Wn(e.x)&&Wn(e.y),Wn=e=>!isNaN(e)&&isFinite(e),M5=(e,n)=>{},ml=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),gl=({x:e,y:n},[r,s,a],o=!1,l=[1,1])=>{const u={x:(e-r)/a,y:(n-s)/a};return o?ml(u,l):u},zf=({x:e,y:n},[r,s,a])=>({x:e*a+r,y:n*a+s});function Va(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(r)}if(typeof e=="string"&&e.endsWith("%")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(n*r*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function j5(e,n,r){if(typeof e=="string"||typeof e=="number"){const s=Va(e,r),a=Va(e,n);return{top:s,right:a,bottom:s,left:a,x:a*2,y:s*2}}if(typeof e=="object"){const s=Va(e.top??e.y??0,r),a=Va(e.bottom??e.y??0,r),o=Va(e.left??e.x??0,n),l=Va(e.right??e.x??0,n);return{top:s,right:l,bottom:a,left:o,x:o+l,y:s+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function $5(e,n,r,s,a,o){const{x:l,y:u}=zf(e,[n,r,s]),{x:h,y:f}=zf({x:e.x+e.width,y:e.y+e.height},[n,r,s]),p=a-h,d=o-f;return{left:Math.floor(l),top:Math.floor(u),right:Math.floor(p),bottom:Math.floor(d)}}const NE=(e,n,r,s,a,o)=>{const l=j5(o,n,r),u=(n-l.x)/e.width,h=(r-l.y)/e.height,f=Math.min(u,h),p=go(f,s,a),d=e.x+e.width/2,g=e.y+e.height/2,y=n/2-d*p,C=r/2-g*p,x=$5(e,y,C,p,n,r),v={left:Math.min(x.left-l.left,0),top:Math.min(x.top-l.top,0),right:Math.min(x.right-l.right,0),bottom:Math.min(x.bottom-l.bottom,0)};return{x:y-v.left+v.right,y:C-v.top+v.bottom,zoom:p}},Yu=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function vo(e){return e!=null&&e!=="parent"}function Zr(e){var n,r;return{width:((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth??0,height:((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight??0}}function XD(e){var n,r;return(((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth)!==void 0&&(((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight)!==void 0}function WD(e,n={width:0,height:0},r,s,a){const o={...e},l=s.get(r);if(l){const u=l.origin||a;o.x+=l.internals.positionAbsolute.x-(n.width??0)*u[0],o.y+=l.internals.positionAbsolute.y-(n.height??0)*u[1]}return o}function eA(e,n){if(e.size!==n.size)return!1;for(const r of e)if(!n.has(r))return!1;return!0}function L5(){let e,n;return{promise:new Promise((s,a)=>{e=s,n=a}),resolve:e,reject:n}}function I5(e){return{...UD,...e||{}}}function Bu(e,{snapGrid:n=[0,0],snapToGrid:r=!1,transform:s,containerBounds:a}){const{x:o,y:l}=Jn(e),u=gl({x:o-((a==null?void 0:a.left)??0),y:l-((a==null?void 0:a.top)??0)},s),{x:h,y:f}=r?ml(u,n):u;return{xSnapped:h,ySnapped:f,...u}}const RE=e=>({width:e.offsetWidth,height:e.offsetHeight}),JD=e=>{var n;return((n=e==null?void 0:e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},D5=["INPUT","SELECT","TEXTAREA"];function ZD(e){var s,a;const n=((a=(s=e.composedPath)==null?void 0:s.call(e))==null?void 0:a[0])||e.target;return(n==null?void 0:n.nodeType)!==1?!1:D5.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const ek=e=>"clientX"in e,Jn=(e,n)=>{var o,l;const r=ek(e),s=r?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,a=r?e.clientY:(l=e.touches)==null?void 0:l[0].clientY;return{x:s-((n==null?void 0:n.left)??0),y:a-((n==null?void 0:n.top)??0)}},tA=(e,n,r,s,a)=>{const o=n.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(l=>{const u=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:a,position:l.getAttribute("data-handlepos"),x:(u.left-r.left)/s,y:(u.top-r.top)/s,...RE(l)}})};function tk({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:l,targetControlY:u}){const h=e*.125+a*.375+l*.375+r*.125,f=n*.125+o*.375+u*.375+s*.125,p=Math.abs(h-e),d=Math.abs(f-n);return[h,f,p,d]}function uf(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function nA({pos:e,x1:n,y1:r,x2:s,y2:a,c:o}){switch(e){case Ne.Left:return[n-uf(n-s,o),r];case Ne.Right:return[n+uf(s-n,o),r];case Ne.Top:return[n,r-uf(r-a,o)];case Ne.Bottom:return[n,r+uf(a-r,o)]}}function nk({sourceX:e,sourceY:n,sourcePosition:r=Ne.Bottom,targetX:s,targetY:a,targetPosition:o=Ne.Top,curvature:l=.25}){const[u,h]=nA({pos:r,x1:e,y1:n,x2:s,y2:a,c:l}),[f,p]=nA({pos:o,x1:s,y1:a,x2:e,y2:n,c:l}),[d,g,y,C]=tk({sourceX:e,sourceY:n,targetX:s,targetY:a,sourceControlX:u,sourceControlY:h,targetControlX:f,targetControlY:p});return[`M${e},${n} C${u},${h} ${f},${p} ${s},${a}`,d,g,y,C]}function rk({sourceX:e,sourceY:n,targetX:r,targetY:s}){const a=Math.abs(r-e)/2,o=r<e?r+a:r-a,l=Math.abs(s-n)/2,u=s<n?s+l:s-l;return[o,u,a,l]}function k5({sourceNode:e,targetNode:n,selected:r=!1,zIndex:s=0,elevateOnSelect:a=!1,zIndexMode:o="basic"}){if(o==="manual")return s;const l=a&&r?s+1e3:s,u=Math.max(e.parentId||a&&e.selected?e.internals.z:0,n.parentId||a&&n.selected?n.internals.z:0);return l+u}function B5({sourceNode:e,targetNode:n,width:r,height:s,transform:a}){const o=th(Pf(e),Pf(n));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const l={x:-a[0]/a[2],y:-a[1]/a[2],width:r/a[2],height:s/a[2]};return Ku(l,nh(o))>0}const P5=({source:e,sourceHandle:n,target:r,targetHandle:s})=>`xy-edge__${e}${n||""}-${r}${s||""}`,z5=(e,n)=>n.some(r=>r.source===e.source&&r.target===e.target&&(r.sourceHandle===e.sourceHandle||!r.sourceHandle&&!e.sourceHandle)&&(r.targetHandle===e.targetHandle||!r.targetHandle&&!e.targetHandle)),U5=(e,n,r={})=>{if(!e.source||!e.target)return n;const s=r.getEdgeId||P5;let a;return VD(e)?a={...e}:a={...e,id:s(e)},z5(a,n)?n:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,n.concat(a))};function ik({sourceX:e,sourceY:n,targetX:r,targetY:s}){const[a,o,l,u]=rk({sourceX:e,sourceY:n,targetX:r,targetY:s});return[`M ${e},${n}L ${r},${s}`,a,o,l,u]}const rA={[Ne.Left]:{x:-1,y:0},[Ne.Right]:{x:1,y:0},[Ne.Top]:{x:0,y:-1},[Ne.Bottom]:{x:0,y:1}},Q5=({source:e,sourcePosition:n=Ne.Bottom,target:r})=>n===Ne.Left||n===Ne.Right?e.x<r.x?{x:1,y:0}:{x:-1,y:0}:e.y<r.y?{x:0,y:1}:{x:0,y:-1},iA=(e,n)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function H5({source:e,sourcePosition:n=Ne.Bottom,target:r,targetPosition:s=Ne.Top,center:a,offset:o,stepPosition:l}){const u=rA[n],h=rA[s],f={x:e.x+u.x*o,y:e.y+u.y*o},p={x:r.x+h.x*o,y:r.y+h.y*o},d=Q5({source:f,sourcePosition:n,target:p}),g=d.x!==0?"x":"y",y=d[g];let C=[],x,v;const b={x:0,y:0},w={x:0,y:0},[,,E,q]=rk({sourceX:e.x,sourceY:e.y,targetX:r.x,targetY:r.y});if(u[g]*h[g]===-1){g==="x"?(x=a.x??f.x+(p.x-f.x)*l,v=a.y??(f.y+p.y)/2):(x=a.x??(f.x+p.x)/2,v=a.y??f.y+(p.y-f.y)*l);const R=[{x,y:f.y},{x,y:p.y}],O=[{x:f.x,y:v},{x:p.x,y:v}];u[g]===y?C=g==="x"?R:O:C=g==="x"?O:R}else{const R=[{x:f.x,y:p.y}],O=[{x:p.x,y:f.y}];if(g==="x"?C=u.x===y?O:R:C=u.y===y?R:O,n===s){const D=Math.abs(e[g]-r[g]);if(D<=o){const z=Math.min(o-1,o-D);u[g]===y?b[g]=(f[g]>e[g]?-1:1)*z:w[g]=(p[g]>r[g]?-1:1)*z}}if(n!==s){const D=g==="x"?"y":"x",z=u[g]===h[D],T=f[D]>p[D],M=f[D]<p[D];(u[g]===1&&(!z&&T||z&&M)||u[g]!==1&&(!z&&M||z&&T))&&(C=g==="x"?R:O)}const I={x:f.x+b.x,y:f.y+b.y},k={x:p.x+w.x,y:p.y+w.y},N=Math.max(Math.abs(I.x-C[0].x),Math.abs(k.x-C[0].x)),j=Math.max(Math.abs(I.y-C[0].y),Math.abs(k.y-C[0].y));N>=j?(x=(I.x+k.x)/2,v=C[0].y):(x=C[0].x,v=(I.y+k.y)/2)}return[[e,{x:f.x+b.x,y:f.y+b.y},...C,{x:p.x+w.x,y:p.y+w.y},r],x,v,E,q]}function V5(e,n,r,s){const a=Math.min(iA(e,n)/2,iA(n,r)/2,s),{x:o,y:l}=n;if(e.x===o&&o===r.x||e.y===l&&l===r.y)return`L${o} ${l}`;if(e.y===l){const f=e.x<r.x?-1:1,p=e.y<r.y?1:-1;return`L ${o+a*f},${l}Q ${o},${l} ${o},${l+a*p}`}const u=e.x<r.x?1:-1,h=e.y<r.y?-1:1;return`L ${o},${l+a*h}Q ${o},${l} ${o+a*u},${l}`}function nE({sourceX:e,sourceY:n,sourcePosition:r=Ne.Bottom,targetX:s,targetY:a,targetPosition:o=Ne.Top,borderRadius:l=5,centerX:u,centerY:h,offset:f=20,stepPosition:p=.5}){const[d,g,y,C,x]=H5({source:{x:e,y:n},sourcePosition:r,target:{x:s,y:a},targetPosition:o,center:{x:u,y:h},offset:f,stepPosition:p});return[d.reduce((b,w,E)=>{let q="";return E>0&&E<d.length-1?q=V5(d[E-1],w,d[E+1],l):q=`${E===0?"M":"L"}${w.x} ${w.y}`,b+=q,b},""),g,y,C,x]}function sA(e){var n;return e&&!!(e.internals.handleBounds||(n=e.handles)!=null&&n.length)&&!!(e.measured.width||e.width||e.initialWidth)}function F5(e){var d;const{sourceNode:n,targetNode:r}=e;if(!sA(n)||!sA(r))return null;const s=n.internals.handleBounds||aA(n.handles),a=r.internals.handleBounds||aA(r.handles),o=oA((s==null?void 0:s.source)??[],e.sourceHandle),l=oA(e.connectionMode===mo.Strict?(a==null?void 0:a.target)??[]:((a==null?void 0:a.target)??[]).concat((a==null?void 0:a.source)??[]),e.targetHandle);if(!o||!l)return(d=e.onError)==null||d.call(e,"008",vr.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const u=(o==null?void 0:o.position)||Ne.Bottom,h=(l==null?void 0:l.position)||Ne.Top,f=Ps(n,o,u),p=Ps(r,l,h);return{sourceX:f.x,sourceY:f.y,targetX:p.x,targetY:p.y,sourcePosition:u,targetPosition:h}}function aA(e){if(!e)return null;const n=[],r=[];for(const s of e)s.width=s.width??1,s.height=s.height??1,s.type==="source"?n.push(s):s.type==="target"&&r.push(s);return{source:n,target:r}}function Ps(e,n,r=Ne.Left,s=!1){const a=((n==null?void 0:n.x)??0)+e.internals.positionAbsolute.x,o=((n==null?void 0:n.y)??0)+e.internals.positionAbsolute.y,{width:l,height:u}=n??Zr(e);if(s)return{x:a+l/2,y:o+u/2};switch((n==null?void 0:n.position)??r){case Ne.Top:return{x:a+l/2,y:o};case Ne.Right:return{x:a+l,y:o+u/2};case Ne.Bottom:return{x:a+l/2,y:o+u};case Ne.Left:return{x:a,y:o+u/2}}}function oA(e,n){return e&&(n?e.find(r=>r.id===n):e[0])||null}function rE(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function G5(e,{id:n,defaultColor:r,defaultMarkerStart:s,defaultMarkerEnd:a}){const o=new Set;return e.reduce((l,u)=>([u.markerStart||s,u.markerEnd||a].forEach(h=>{if(h&&typeof h=="object"){const f=rE(h,n);o.has(f)||(l.push({id:f,color:h.color||r,...h}),o.add(f))}}),l),[]).sort((l,u)=>l.id.localeCompare(u.id))}const sk=1e3,K5=10,OE={nodeOrigin:[0,0],nodeExtent:Fu,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Y5={...OE,checkEquality:!0};function ME(e,n){const r={...e};for(const s in n)n[s]!==void 0&&(r[s]=n[s]);return r}function X5(e,n,r){const s=ME(OE,r);for(const a of e.values())if(a.parentId)$E(a,e,n,s);else{const o=dl(a,s.nodeOrigin),l=vo(a.extent)?a.extent:s.nodeExtent,u=Bs(o,l,Zr(a));a.internals.positionAbsolute=u}}function W5(e,n){if(!e.handles)return e.measured?n==null?void 0:n.internals.handleBounds:void 0;const r=[],s=[];for(const a of e.handles){const o={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?r.push(o):a.type==="target"&&s.push(o)}return{source:r,target:s}}function jE(e){return e==="manual"}function iE(e,n,r,s={}){var f,p;const a=ME(Y5,s),o={i:0},l=new Map(n),u=a!=null&&a.elevateNodesOnSelect&&!jE(a.zIndexMode)?sk:0;let h=e.length>0;n.clear(),r.clear();for(const d of e){let g=l.get(d.id);if(a.checkEquality&&d===(g==null?void 0:g.internals.userNode))n.set(d.id,g);else{const y=dl(d,a.nodeOrigin),C=vo(d.extent)?d.extent:a.nodeExtent,x=Bs(y,C,Zr(d));g={...a.defaults,...d,measured:{width:(f=d.measured)==null?void 0:f.width,height:(p=d.measured)==null?void 0:p.height},internals:{positionAbsolute:x,handleBounds:W5(d,g),z:ak(d,u,a.zIndexMode),userNode:d}},n.set(d.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(h=!1),d.parentId&&$E(g,n,r,s,o)}return h}function J5(e,n){if(!e.parentId)return;const r=n.get(e.parentId);r?r.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function $E(e,n,r,s,a){const{elevateNodesOnSelect:o,nodeOrigin:l,nodeExtent:u,zIndexMode:h}=ME(OE,s),f=e.parentId,p=n.get(f);if(!p){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}J5(e,r),a&&!p.parentId&&p.internals.rootParentIndex===void 0&&h==="auto"&&(p.internals.rootParentIndex=++a.i,p.internals.z=p.internals.z+a.i*K5),a&&p.internals.rootParentIndex!==void 0&&(a.i=p.internals.rootParentIndex);const d=o&&!jE(h)?sk:0,{x:g,y,z:C}=Z5(e,p,l,u,d,h),{positionAbsolute:x}=e.internals,v=g!==x.x||y!==x.y;(v||C!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:g,y}:x,z:C}})}function ak(e,n,r){const s=Wn(e.zIndex)?e.zIndex:0;return jE(r)?s:s+(e.selected?n:0)}function Z5(e,n,r,s,a,o){const{x:l,y:u}=n.internals.positionAbsolute,h=Zr(e),f=dl(e,r),p=vo(e.extent)?Bs(f,e.extent,h):f;let d=Bs({x:l+p.x,y:u+p.y},s,h);e.extent==="parent"&&(d=GD(d,h,n));const g=ak(e,a,o),y=n.internals.z??0;return{x:d.x,y:d.y,z:y>=g?y+1:g}}function LE(e,n,r,s=[0,0]){var l;const a=[],o=new Map;for(const u of e){const h=n.get(u.parentId);if(!h)continue;const f=((l=o.get(u.parentId))==null?void 0:l.expandedRect)??yo(h),p=YD(f,u.rect);o.set(u.parentId,{expandedRect:p,parent:h})}return o.size>0&&o.forEach(({expandedRect:u,parent:h},f)=>{var E;const p=h.internals.positionAbsolute,d=Zr(h),g=h.origin??s,y=u.x<p.x?Math.round(Math.abs(p.x-u.x)):0,C=u.y<p.y?Math.round(Math.abs(p.y-u.y)):0,x=Math.max(d.width,Math.round(u.width)),v=Math.max(d.height,Math.round(u.height)),b=(x-d.width)*g[0],w=(v-d.height)*g[1];(y>0||C>0||b||w)&&(a.push({id:f,type:"position",position:{x:h.position.x-y+b,y:h.position.y-C+w}}),(E=r.get(f))==null||E.forEach(q=>{e.some(A=>A.id===q.id)||a.push({id:q.id,type:"position",position:{x:q.position.x+y,y:q.position.y+C}})})),(d.width<u.width||d.height<u.height||y||C)&&a.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:x+(y?g[0]*y-b:0),height:v+(C?g[1]*C-w:0)}})}),a}function e8(e,n,r,s,a,o,l){const u=s==null?void 0:s.querySelector(".xyflow__viewport");let h=!1;if(!u)return{changes:[],updatedInternals:h};const f=[],p=window.getComputedStyle(u),{m22:d}=new window.DOMMatrixReadOnly(p.transform),g=[];for(const y of e.values()){const C=n.get(y.id);if(!C)continue;if(C.hidden){n.set(C.id,{...C,internals:{...C.internals,handleBounds:void 0}}),h=!0;continue}const x=RE(y.nodeElement),v=C.measured.width!==x.width||C.measured.height!==x.height;if(!!(x.width&&x.height&&(v||!C.internals.handleBounds||y.force))){const w=y.nodeElement.getBoundingClientRect(),E=vo(C.extent)?C.extent:o;let{positionAbsolute:q}=C.internals;C.parentId&&C.extent==="parent"?q=GD(q,x,n.get(C.parentId)):E&&(q=Bs(q,E,x));const A={...C,measured:x,internals:{...C.internals,positionAbsolute:q,handleBounds:{source:tA("source",y.nodeElement,w,d,C.id),target:tA("target",y.nodeElement,w,d,C.id)}}};n.set(C.id,A),C.parentId&&$E(A,n,r,{nodeOrigin:a,zIndexMode:l}),h=!0,v&&(f.push({id:C.id,type:"dimensions",dimensions:x}),C.expandParent&&C.parentId&&g.push({id:C.id,parentId:C.parentId,rect:yo(A,a)}))}}if(g.length>0){const y=LE(g,n,r,a);f.push(...y)}return{changes:f,updatedInternals:h}}async function t8({delta:e,panZoom:n,transform:r,translateExtent:s,width:a,height:o}){if(!n||!e.x&&!e.y)return Promise.resolve(!1);const l=await n.setViewportConstrained({x:r[0]+e.x,y:r[1]+e.y,zoom:r[2]},[[0,0],[a,o]],s),u=!!l&&(l.x!==r[0]||l.y!==r[1]||l.k!==r[2]);return Promise.resolve(u)}function uA(e,n,r,s,a,o){let l=a;const u=s.get(l)||new Map;s.set(l,u.set(r,n)),l=`${a}-${e}`;const h=s.get(l)||new Map;if(s.set(l,h.set(r,n)),o){l=`${a}-${e}-${o}`;const f=s.get(l)||new Map;s.set(l,f.set(r,n))}}function ok(e,n,r){e.clear(),n.clear();for(const s of r){const{source:a,target:o,sourceHandle:l=null,targetHandle:u=null}=s,h={edgeId:s.id,source:a,target:o,sourceHandle:l,targetHandle:u},f=`${a}-${l}--${o}-${u}`,p=`${o}-${u}--${a}-${l}`;uA("source",h,p,e,a,l),uA("target",h,f,e,o,u),n.set(s.id,s)}}function uk(e,n){if(!e.parentId)return!1;const r=n.get(e.parentId);return r?r.selected?!0:uk(r,n):!1}function lA(e,n,r){var a;let s=e;do{if((a=s==null?void 0:s.matches)!=null&&a.call(s,n))return!0;if(s===r)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function n8(e,n,r,s){const a=new Map;for(const[o,l]of e)if((l.selected||l.id===s)&&(!l.parentId||!uk(l,e))&&(l.draggable||n&&typeof l.draggable>"u")){const u=e.get(o);u&&a.set(o,{id:o,position:u.position||{x:0,y:0},distance:{x:r.x-u.internals.positionAbsolute.x,y:r.y-u.internals.positionAbsolute.y},extent:u.extent,parentId:u.parentId,origin:u.origin,expandParent:u.expandParent,internals:{positionAbsolute:u.internals.positionAbsolute||{x:0,y:0}},measured:{width:u.measured.width??0,height:u.measured.height??0}})}return a}function sm({nodeId:e,dragItems:n,nodeLookup:r,dragging:s=!0}){var l,u,h;const a=[];for(const[f,p]of n){const d=(l=r.get(f))==null?void 0:l.internals.userNode;d&&a.push({...d,position:p.position,dragging:s})}if(!e)return[a[0],a];const o=(u=r.get(e))==null?void 0:u.internals.userNode;return[o?{...o,position:((h=n.get(e))==null?void 0:h.position)||o.position,dragging:s}:a[0],a]}function r8({dragItems:e,snapGrid:n,x:r,y:s}){const a=e.values().next().value;if(!a)return null;const o={x:r-a.distance.x,y:s-a.distance.y},l=ml(o,n);return{x:l.x-o.x,y:l.y-o.y}}function i8({onNodeMouseDown:e,getStoreItems:n,onDragStart:r,onDrag:s,onDragStop:a}){let o={x:null,y:null},l=0,u=new Map,h=!1,f={x:0,y:0},p=null,d=!1,g=null,y=!1,C=!1,x=null;function v({noDragClassName:w,handleSelector:E,domNode:q,isSelectable:A,nodeId:R,nodeClickDistance:O=0}){g=Sn(q);function I({x:D,y:z}){const{nodeLookup:T,nodeExtent:M,snapGrid:$,snapToGrid:P,nodeOrigin:H,onNodeDrag:G,onSelectionDrag:V,onError:B,updateNodePositions:K}=n();o={x:D,y:z};let te=!1;const Q=u.size>1,J=Q&&M?tE(pl(u)):null,ie=Q&&P?r8({dragItems:u,snapGrid:$,x:D,y:z}):null;for(const[oe,ee]of u){if(!T.has(oe))continue;let fe={x:D-ee.distance.x,y:z-ee.distance.y};P&&(fe=ie?{x:Math.round(fe.x+ie.x),y:Math.round(fe.y+ie.y)}:ml(fe,$));let be=null;if(Q&&M&&!ee.extent&&J){const{positionAbsolute:we}=ee.internals,W=we.x-J.x+M[0][0],ae=we.x+ee.measured.width-J.x2+M[1][0],xe=we.y-J.y+M[0][1],Se=we.y+ee.measured.height-J.y2+M[1][1];be=[[W,xe],[ae,Se]]}const{position:ve,positionAbsolute:_e}=FD({nodeId:oe,nextPosition:fe,nodeLookup:T,nodeExtent:be||M,nodeOrigin:H,onError:B});te=te||ee.position.x!==ve.x||ee.position.y!==ve.y,ee.position=ve,ee.internals.positionAbsolute=_e}if(C=C||te,!!te&&(K(u,!0),x&&(s||G||!R&&V))){const[oe,ee]=sm({nodeId:R,dragItems:u,nodeLookup:T});s==null||s(x,u,oe,ee),G==null||G(x,oe,ee),R||V==null||V(x,ee)}}async function k(){if(!p)return;const{transform:D,panBy:z,autoPanSpeed:T,autoPanOnNodeDrag:M}=n();if(!M){h=!1,cancelAnimationFrame(l);return}const[$,P]=KD(f,p,T);($!==0||P!==0)&&(o.x=(o.x??0)-$/D[2],o.y=(o.y??0)-P/D[2],await z({x:$,y:P})&&I(o)),l=requestAnimationFrame(k)}function N(D){var Q;const{nodeLookup:z,multiSelectionActive:T,nodesDraggable:M,transform:$,snapGrid:P,snapToGrid:H,selectNodesOnDrag:G,onNodeDragStart:V,onSelectionDragStart:B,unselectNodesAndEdges:K}=n();d=!0,(!G||!A)&&!T&&R&&((Q=z.get(R))!=null&&Q.selected||K()),A&&G&&R&&(e==null||e(R));const te=Bu(D.sourceEvent,{transform:$,snapGrid:P,snapToGrid:H,containerBounds:p});if(o=te,u=n8(z,M,te,R),u.size>0&&(r||V||!R&&B)){const[J,ie]=sm({nodeId:R,dragItems:u,nodeLookup:z});r==null||r(D.sourceEvent,u,J,ie),V==null||V(D.sourceEvent,J,ie),R||B==null||B(D.sourceEvent,ie)}}const j=SD().clickDistance(O).on("start",D=>{const{domNode:z,nodeDragThreshold:T,transform:M,snapGrid:$,snapToGrid:P}=n();p=(z==null?void 0:z.getBoundingClientRect())||null,y=!1,C=!1,x=D.sourceEvent,T===0&&N(D),o=Bu(D.sourceEvent,{transform:M,snapGrid:$,snapToGrid:P,containerBounds:p}),f=Jn(D.sourceEvent,p)}).on("drag",D=>{const{autoPanOnNodeDrag:z,transform:T,snapGrid:M,snapToGrid:$,nodeDragThreshold:P,nodeLookup:H}=n(),G=Bu(D.sourceEvent,{transform:T,snapGrid:M,snapToGrid:$,containerBounds:p});if(x=D.sourceEvent,(D.sourceEvent.type==="touchmove"&&D.sourceEvent.touches.length>1||R&&!H.has(R))&&(y=!0),!y){if(!h&&z&&d&&(h=!0,k()),!d){const V=Jn(D.sourceEvent,p),B=V.x-f.x,K=V.y-f.y;Math.sqrt(B*B+K*K)>P&&N(D)}(o.x!==G.xSnapped||o.y!==G.ySnapped)&&u&&d&&(f=Jn(D.sourceEvent,p),I(G))}}).on("end",D=>{if(!(!d||y)&&(h=!1,d=!1,cancelAnimationFrame(l),u.size>0)){const{nodeLookup:z,updateNodePositions:T,onNodeDragStop:M,onSelectionDragStop:$}=n();if(C&&(T(u,!1),C=!1),a||M||!R&&$){const[P,H]=sm({nodeId:R,dragItems:u,nodeLookup:z,dragging:!1});a==null||a(D.sourceEvent,u,P,H),M==null||M(D.sourceEvent,P,H),R||$==null||$(D.sourceEvent,H)}}}).filter(D=>{const z=D.target;return!D.button&&(!w||!lA(z,`.${w}`,q))&&(!E||lA(z,E,q))});g.call(j)}function b(){g==null||g.on(".drag",null)}return{update:v,destroy:b}}function s8(e,n,r){const s=[],a={x:e.x-r,y:e.y-r,width:r*2,height:r*2};for(const o of n.values())Ku(a,yo(o))>0&&s.push(o);return s}const a8=250;function o8(e,n,r,s){var u,h;let a=[],o=1/0;const l=s8(e,r,n+a8);for(const f of l){const p=[...((u=f.internals.handleBounds)==null?void 0:u.source)??[],...((h=f.internals.handleBounds)==null?void 0:h.target)??[]];for(const d of p){if(s.nodeId===d.nodeId&&s.type===d.type&&s.id===d.id)continue;const{x:g,y}=Ps(f,d,d.position,!0),C=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(y-e.y,2));C>n||(C<o?(a=[{...d,x:g,y}],o=C):C===o&&a.push({...d,x:g,y}))}}if(!a.length)return null;if(a.length>1){const f=s.type==="source"?"target":"source";return a.find(p=>p.type===f)??a[0]}return a[0]}function lk(e,n,r,s,a,o=!1){var f,p,d;const l=s.get(e);if(!l)return null;const u=a==="strict"?(f=l.internals.handleBounds)==null?void 0:f[n]:[...((p=l.internals.handleBounds)==null?void 0:p.source)??[],...((d=l.internals.handleBounds)==null?void 0:d.target)??[]],h=(r?u==null?void 0:u.find(g=>g.id===r):u==null?void 0:u[0])??null;return h&&o?{...h,...Ps(l,h,h.position,!0)}:h}function ck(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function u8(e,n){let r=null;return n?r=!0:e&&!n&&(r=!1),r}const fk=()=>!0;function l8(e,{connectionMode:n,connectionRadius:r,handleId:s,nodeId:a,edgeUpdaterType:o,isTarget:l,domNode:u,nodeLookup:h,lib:f,autoPanOnConnect:p,flowId:d,panBy:g,cancelConnection:y,onConnectStart:C,onConnect:x,onConnectEnd:v,isValidConnection:b=fk,onReconnectEnd:w,updateConnection:E,getTransform:q,getFromHandle:A,autoPanSpeed:R,dragThreshold:O=1,handleDomNode:I}){const k=JD(e.target);let N=0,j;const{x:D,y:z}=Jn(e),T=ck(o,I),M=u==null?void 0:u.getBoundingClientRect();let $=!1;if(!M||!T)return;const P=lk(a,T,s,h,n);if(!P)return;let H=Jn(e,M),G=!1,V=null,B=!1,K=null;function te(){if(!p||!M)return;const[ve,_e]=KD(H,M,R);g({x:ve,y:_e}),N=requestAnimationFrame(te)}const Q={...P,nodeId:a,type:T,position:P.position},J=h.get(a);let oe={inProgress:!0,isValid:null,from:Ps(J,Q,Ne.Left,!0),fromHandle:Q,fromPosition:Q.position,fromNode:J,to:H,toHandle:null,toPosition:Wq[Q.position],toNode:null,pointer:H};function ee(){$=!0,E(oe),C==null||C(e,{nodeId:a,handleId:s,handleType:T})}O===0&&ee();function fe(ve){if(!$){const{x:Se,y:gt}=Jn(ve),ut=Se-D,It=gt-z;if(!(ut*ut+It*It>O*O))return;ee()}if(!A()||!Q){be(ve);return}const _e=q();H=Jn(ve,M),j=o8(gl(H,_e,!1,[1,1]),r,h,Q),G||(te(),G=!0);const we=hk(ve,{handle:j,connectionMode:n,fromNodeId:a,fromHandleId:s,fromType:l?"target":"source",isValidConnection:b,doc:k,lib:f,flowId:d,nodeLookup:h});K=we.handleDomNode,V=we.connection,B=u8(!!j,we.isValid);const W=h.get(a),ae=W?Ps(W,Q,Ne.Left,!0):oe.from,xe={...oe,from:ae,isValid:B,to:we.toHandle&&B?zf({x:we.toHandle.x,y:we.toHandle.y},_e):H,toHandle:we.toHandle,toPosition:B&&we.toHandle?we.toHandle.position:Wq[Q.position],toNode:we.toHandle?h.get(we.toHandle.nodeId):null,pointer:H};E(xe),oe=xe}function be(ve){if(!("touches"in ve&&ve.touches.length>0)){if($){(j||K)&&V&&B&&(x==null||x(V));const{inProgress:_e,...we}=oe,W={...we,toPosition:oe.toHandle?oe.toPosition:null};v==null||v(ve,W),o&&(w==null||w(ve,W))}y(),cancelAnimationFrame(N),G=!1,B=!1,V=null,K=null,k.removeEventListener("mousemove",fe),k.removeEventListener("mouseup",be),k.removeEventListener("touchmove",fe),k.removeEventListener("touchend",be)}}k.addEventListener("mousemove",fe),k.addEventListener("mouseup",be),k.addEventListener("touchmove",fe),k.addEventListener("touchend",be)}function hk(e,{handle:n,connectionMode:r,fromNodeId:s,fromHandleId:a,fromType:o,doc:l,lib:u,flowId:h,isValidConnection:f=fk,nodeLookup:p}){const d=o==="target",g=n?l.querySelector(`.${u}-flow__handle[data-id="${h}-${n==null?void 0:n.nodeId}-${n==null?void 0:n.id}-${n==null?void 0:n.type}"]`):null,{x:y,y:C}=Jn(e),x=l.elementFromPoint(y,C),v=x!=null&&x.classList.contains(`${u}-flow__handle`)?x:g,b={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const w=ck(void 0,v),E=v.getAttribute("data-nodeid"),q=v.getAttribute("data-handleid"),A=v.classList.contains("connectable"),R=v.classList.contains("connectableend");if(!E||!w)return b;const O={source:d?E:s,sourceHandle:d?q:a,target:d?s:E,targetHandle:d?a:q};b.connection=O;const k=A&&R&&(r===mo.Strict?d&&w==="source"||!d&&w==="target":E!==s||q!==a);b.isValid=k&&f(O),b.toHandle=lk(E,w,q,p,r,!0)}return b}const sE={onPointerDown:l8,isValid:hk};function c8({domNode:e,panZoom:n,getTransform:r,getViewScale:s}){const a=Sn(e);function o({translateExtent:u,width:h,height:f,zoomStep:p=1,pannable:d=!0,zoomable:g=!0,inversePan:y=!1}){const C=E=>{if(E.sourceEvent.type!=="wheel"||!n)return;const q=r(),A=E.sourceEvent.ctrlKey&&Yu()?10:1,R=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*p,O=q[2]*Math.pow(2,R*A);n.scaleTo(O)};let x=[0,0];const v=E=>{(E.sourceEvent.type==="mousedown"||E.sourceEvent.type==="touchstart")&&(x=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY])},b=E=>{const q=r();if(E.sourceEvent.type!=="mousemove"&&E.sourceEvent.type!=="touchmove"||!n)return;const A=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY],R=[A[0]-x[0],A[1]-x[1]];x=A;const O=s()*Math.max(q[2],Math.log(q[2]))*(y?-1:1),I={x:q[0]-R[0]*O,y:q[1]-R[1]*O},k=[[0,0],[h,f]];n.setViewportConstrained({x:I.x,y:I.y,zoom:q[2]},k,u)},w=PD().on("start",v).on("zoom",d?b:null).on("zoom.wheel",g?C:null);a.call(w,{})}function l(){a.on("zoom",null)}return{update:o,destroy:l,pointer:Kn}}const rh=e=>({x:e.x,y:e.y,zoom:e.k}),am=({x:e,y:n,zoom:r})=>eh.translate(e,n).scale(r),Ga=(e,n)=>e.target.closest(`.${n}`),dk=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),f8=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,om=(e,n=0,r=f8,s=()=>{})=>{const a=typeof n=="number"&&n>0;return a||s(),a?e.transition().duration(n).ease(r).on("end",s):e},pk=e=>{const n=e.ctrlKey&&Yu()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function h8({zoomPanValues:e,noWheelClassName:n,d3Selection:r,d3Zoom:s,panOnScrollMode:a,panOnScrollSpeed:o,zoomOnPinch:l,onPanZoomStart:u,onPanZoom:h,onPanZoomEnd:f}){return p=>{if(Ga(p,n))return p.ctrlKey&&p.preventDefault(),!1;p.preventDefault(),p.stopImmediatePropagation();const d=r.property("__zoom").k||1;if(p.ctrlKey&&l){const v=Kn(p),b=pk(p),w=d*Math.pow(2,b);s.scaleTo(r,w,v,p);return}const g=p.deltaMode===1?20:1;let y=a===$s.Vertical?0:p.deltaX*g,C=a===$s.Horizontal?0:p.deltaY*g;!Yu()&&p.shiftKey&&a!==$s.Vertical&&(y=p.deltaY*g,C=0),s.translateBy(r,-(y/d)*o,-(C/d)*o,{internal:!0});const x=rh(r.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(h==null||h(p,x),e.panScrollTimeout=setTimeout(()=>{f==null||f(p,x),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,u==null||u(p,x))}}function d8({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:r}){return function(s,a){const o=s.type==="wheel",l=!n&&o&&!s.ctrlKey,u=Ga(s,e);if(s.ctrlKey&&o&&u&&s.preventDefault(),l||u)return null;s.preventDefault(),r.call(this,s,a)}}function p8({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:r}){return s=>{var o,l,u;if((o=s.sourceEvent)!=null&&o.internal)return;const a=rh(s.transform);e.mouseButton=((l=s.sourceEvent)==null?void 0:l.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,((u=s.sourceEvent)==null?void 0:u.type)==="mousedown"&&n(!0),r&&(r==null||r(s.sourceEvent,a))}}function m8({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:r,onTransformChange:s,onPanZoom:a}){return o=>{var l,u;e.usedRightMouseButton=!!(r&&dk(n,e.mouseButton??0)),(l=o.sourceEvent)!=null&&l.sync||s([o.transform.x,o.transform.y,o.transform.k]),a&&!((u=o.sourceEvent)!=null&&u.internal)&&(a==null||a(o.sourceEvent,rh(o.transform)))}}function g8({zoomPanValues:e,panOnDrag:n,panOnScroll:r,onDraggingChange:s,onPanZoomEnd:a,onPaneContextMenu:o}){return l=>{var u;if(!((u=l.sourceEvent)!=null&&u.internal)&&(e.isZoomingOrPanning=!1,o&&dk(n,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&o(l.sourceEvent),e.usedRightMouseButton=!1,s(!1),a)){const h=rh(l.transform);e.prevViewport=h,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(l.sourceEvent,h)},r?150:0)}}}function y8({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:s,panOnScroll:a,zoomOnDoubleClick:o,userSelectionActive:l,noWheelClassName:u,noPanClassName:h,lib:f,connectionInProgress:p}){return d=>{var v;const g=e||n,y=r&&d.ctrlKey,C=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Ga(d,`${f}-flow__node`)||Ga(d,`${f}-flow__edge`)))return!0;if(!s&&!g&&!a&&!o&&!r||l||p&&!C||Ga(d,u)&&C||Ga(d,h)&&(!C||a&&C&&!e)||!r&&d.ctrlKey&&C)return!1;if(!r&&d.type==="touchstart"&&((v=d.touches)==null?void 0:v.length)>1)return d.preventDefault(),!1;if(!g&&!a&&!y&&C||!s&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(s)&&!s.includes(d.button)&&d.type==="mousedown")return!1;const x=Array.isArray(s)&&s.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||C)&&x}}function v8({domNode:e,minZoom:n,maxZoom:r,translateExtent:s,viewport:a,onPanZoom:o,onPanZoomStart:l,onPanZoomEnd:u,onDraggingChange:h}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect(),d=PD().scaleExtent([n,r]).translateExtent(s),g=Sn(e).call(d);w({x:a.x,y:a.y,zoom:go(a.zoom,n,r)},[[0,0],[p.width,p.height]],s);const y=g.on("wheel.zoom"),C=g.on("dblclick.zoom");d.wheelDelta(pk);function x(j,D){return g?new Promise(z=>{d==null||d.interpolate((D==null?void 0:D.interpolate)==="linear"?ku:xf).transform(om(g,D==null?void 0:D.duration,D==null?void 0:D.ease,()=>z(!0)),j)}):Promise.resolve(!1)}function v({noWheelClassName:j,noPanClassName:D,onPaneContextMenu:z,userSelectionActive:T,panOnScroll:M,panOnDrag:$,panOnScrollMode:P,panOnScrollSpeed:H,preventScrolling:G,zoomOnPinch:V,zoomOnScroll:B,zoomOnDoubleClick:K,zoomActivationKeyPressed:te,lib:Q,onTransformChange:J,connectionInProgress:ie,paneClickDistance:oe,selectionOnDrag:ee}){T&&!f.isZoomingOrPanning&&b();const fe=M&&!te&&!T;d.clickDistance(ee?1/0:!Wn(oe)||oe<0?0:oe);const be=fe?h8({zoomPanValues:f,noWheelClassName:j,d3Selection:g,d3Zoom:d,panOnScrollMode:P,panOnScrollSpeed:H,zoomOnPinch:V,onPanZoomStart:l,onPanZoom:o,onPanZoomEnd:u}):d8({noWheelClassName:j,preventScrolling:G,d3ZoomHandler:y});if(g.on("wheel.zoom",be,{passive:!1}),!T){const _e=p8({zoomPanValues:f,onDraggingChange:h,onPanZoomStart:l});d.on("start",_e);const we=m8({zoomPanValues:f,panOnDrag:$,onPaneContextMenu:!!z,onPanZoom:o,onTransformChange:J});d.on("zoom",we);const W=g8({zoomPanValues:f,panOnDrag:$,panOnScroll:M,onPaneContextMenu:z,onPanZoomEnd:u,onDraggingChange:h});d.on("end",W)}const ve=y8({zoomActivationKeyPressed:te,panOnDrag:$,zoomOnScroll:B,panOnScroll:M,zoomOnDoubleClick:K,zoomOnPinch:V,userSelectionActive:T,noPanClassName:D,noWheelClassName:j,lib:Q,connectionInProgress:ie});d.filter(ve),K?g.on("dblclick.zoom",C):g.on("dblclick.zoom",null)}function b(){d.on("zoom",null)}async function w(j,D,z){const T=am(j),M=d==null?void 0:d.constrain()(T,D,z);return M&&await x(M),new Promise($=>$(M))}async function E(j,D){const z=am(j);return await x(z,D),new Promise(T=>T(z))}function q(j){if(g){const D=am(j),z=g.property("__zoom");(z.k!==j.zoom||z.x!==j.x||z.y!==j.y)&&(d==null||d.transform(g,D,null,{sync:!0}))}}function A(){const j=g?BD(g.node()):{x:0,y:0,k:1};return{x:j.x,y:j.y,zoom:j.k}}function R(j,D){return g?new Promise(z=>{d==null||d.interpolate((D==null?void 0:D.interpolate)==="linear"?ku:xf).scaleTo(om(g,D==null?void 0:D.duration,D==null?void 0:D.ease,()=>z(!0)),j)}):Promise.resolve(!1)}function O(j,D){return g?new Promise(z=>{d==null||d.interpolate((D==null?void 0:D.interpolate)==="linear"?ku:xf).scaleBy(om(g,D==null?void 0:D.duration,D==null?void 0:D.ease,()=>z(!0)),j)}):Promise.resolve(!1)}function I(j){d==null||d.scaleExtent(j)}function k(j){d==null||d.translateExtent(j)}function N(j){const D=!Wn(j)||j<0?0:j;d==null||d.clickDistance(D)}return{update:v,destroy:b,setViewport:E,setViewportConstrained:w,getViewport:A,scaleTo:R,scaleBy:O,setScaleExtent:I,setTranslateExtent:k,syncViewport:q,setClickDistance:N}}var zs;(function(e){e.Line="line",e.Handle="handle"})(zs||(zs={}));const b8=["top-left","top-right","bottom-left","bottom-right"],_8=["top","right","bottom","left"];function w8({width:e,prevWidth:n,height:r,prevHeight:s,affectsX:a,affectsY:o}){const l=e-n,u=r-s,h=[l>0?1:l<0?-1:0,u>0?1:u<0?-1:0];return l&&a&&(h[0]=h[0]*-1),u&&o&&(h[1]=h[1]*-1),h}function cA(e){const n=e.includes("right")||e.includes("left"),r=e.includes("bottom")||e.includes("top"),s=e.includes("left"),a=e.includes("top");return{isHorizontal:n,isVertical:r,affectsX:s,affectsY:a}}function Mi(e,n){return Math.max(0,n-e)}function ji(e,n){return Math.max(0,e-n)}function lf(e,n,r){return Math.max(0,n-e,e-r)}function fA(e,n){return e?!n:n}function C8(e,n,r,s,a,o,l,u){let{affectsX:h,affectsY:f}=n;const{isHorizontal:p,isVertical:d}=n,g=p&&d,{xSnapped:y,ySnapped:C}=r,{minWidth:x,maxWidth:v,minHeight:b,maxHeight:w}=s,{x:E,y:q,width:A,height:R,aspectRatio:O}=e;let I=Math.floor(p?y-e.pointerX:0),k=Math.floor(d?C-e.pointerY:0);const N=A+(h?-I:I),j=R+(f?-k:k),D=-o[0]*A,z=-o[1]*R;let T=lf(N,x,v),M=lf(j,b,w);if(l){let H=0,G=0;h&&I<0?H=Mi(E+I+D,l[0][0]):!h&&I>0&&(H=ji(E+N+D,l[1][0])),f&&k<0?G=Mi(q+k+z,l[0][1]):!f&&k>0&&(G=ji(q+j+z,l[1][1])),T=Math.max(T,H),M=Math.max(M,G)}if(u){let H=0,G=0;h&&I>0?H=ji(E+I,u[0][0]):!h&&I<0&&(H=Mi(E+N,u[1][0])),f&&k>0?G=ji(q+k,u[0][1]):!f&&k<0&&(G=Mi(q+j,u[1][1])),T=Math.max(T,H),M=Math.max(M,G)}if(a){if(p){const H=lf(N/O,b,w)*O;if(T=Math.max(T,H),l){let G=0;!h&&!f||h&&!f&&g?G=ji(q+z+N/O,l[1][1])*O:G=Mi(q+z+(h?I:-I)/O,l[0][1])*O,T=Math.max(T,G)}if(u){let G=0;!h&&!f||h&&!f&&g?G=Mi(q+N/O,u[1][1])*O:G=ji(q+(h?I:-I)/O,u[0][1])*O,T=Math.max(T,G)}}if(d){const H=lf(j*O,x,v)/O;if(M=Math.max(M,H),l){let G=0;!h&&!f||f&&!h&&g?G=ji(E+j*O+D,l[1][0])/O:G=Mi(E+(f?k:-k)*O+D,l[0][0])/O,M=Math.max(M,G)}if(u){let G=0;!h&&!f||f&&!h&&g?G=Mi(E+j*O,u[1][0])/O:G=ji(E+(f?k:-k)*O,u[0][0])/O,M=Math.max(M,G)}}}k=k+(k<0?M:-M),I=I+(I<0?T:-T),a&&(g?N>j*O?k=(fA(h,f)?-I:I)/O:I=(fA(h,f)?-k:k)*O:p?(k=I/O,f=h):(I=k*O,h=f));const $=h?E+I:E,P=f?q+k:q;return{width:A+(h?-I:I),height:R+(f?-k:k),x:o[0]*I*(h?-1:1)+$,y:o[1]*k*(f?-1:1)+P}}const mk={width:0,height:0,x:0,y:0},E8={...mk,pointerX:0,pointerY:0,aspectRatio:1};function x8(e){return[[0,0],[e.measured.width,e.measured.height]]}function S8(e,n,r){const s=n.position.x+e.position.x,a=n.position.y+e.position.y,o=e.measured.width??0,l=e.measured.height??0,u=r[0]*o,h=r[1]*l;return[[s-u,a-h],[s+o-u,a+l-h]]}function T8({domNode:e,nodeId:n,getStoreItems:r,onChange:s,onEnd:a}){const o=Sn(e);let l={controlDirection:cA("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function u({controlPosition:f,boundaries:p,keepAspectRatio:d,resizeDirection:g,onResizeStart:y,onResize:C,onResizeEnd:x,shouldResize:v}){let b={...mk},w={...E8};l={boundaries:p,resizeDirection:g,keepAspectRatio:d,controlDirection:cA(f)};let E,q=null,A=[],R,O,I,k=!1;const N=SD().on("start",j=>{const{nodeLookup:D,transform:z,snapGrid:T,snapToGrid:M,nodeOrigin:$,paneDomNode:P}=r();if(E=D.get(n),!E)return;q=(P==null?void 0:P.getBoundingClientRect())??null;const{xSnapped:H,ySnapped:G}=Bu(j.sourceEvent,{transform:z,snapGrid:T,snapToGrid:M,containerBounds:q});b={width:E.measured.width??0,height:E.measured.height??0,x:E.position.x??0,y:E.position.y??0},w={...b,pointerX:H,pointerY:G,aspectRatio:b.width/b.height},R=void 0,E.parentId&&(E.extent==="parent"||E.expandParent)&&(R=D.get(E.parentId),O=R&&E.extent==="parent"?x8(R):void 0),A=[],I=void 0;for(const[V,B]of D)if(B.parentId===n&&(A.push({id:V,position:{...B.position},extent:B.extent}),B.extent==="parent"||B.expandParent)){const K=S8(B,E,B.origin??$);I?I=[[Math.min(K[0][0],I[0][0]),Math.min(K[0][1],I[0][1])],[Math.max(K[1][0],I[1][0]),Math.max(K[1][1],I[1][1])]]:I=K}y==null||y(j,{...b})}).on("drag",j=>{const{transform:D,snapGrid:z,snapToGrid:T,nodeOrigin:M}=r(),$=Bu(j.sourceEvent,{transform:D,snapGrid:z,snapToGrid:T,containerBounds:q}),P=[];if(!E)return;const{x:H,y:G,width:V,height:B}=b,K={},te=E.origin??M,{width:Q,height:J,x:ie,y:oe}=C8(w,l.controlDirection,$,l.boundaries,l.keepAspectRatio,te,O,I),ee=Q!==V,fe=J!==B,be=ie!==H&&ee,ve=oe!==G&&fe;if(!be&&!ve&&!ee&&!fe)return;if((be||ve||te[0]===1||te[1]===1)&&(K.x=be?ie:b.x,K.y=ve?oe:b.y,b.x=K.x,b.y=K.y,A.length>0)){const ae=ie-H,xe=oe-G;for(const Se of A)Se.position={x:Se.position.x-ae+te[0]*(Q-V),y:Se.position.y-xe+te[1]*(J-B)},P.push(Se)}if((ee||fe)&&(K.width=ee&&(!l.resizeDirection||l.resizeDirection==="horizontal")?Q:b.width,K.height=fe&&(!l.resizeDirection||l.resizeDirection==="vertical")?J:b.height,b.width=K.width,b.height=K.height),R&&E.expandParent){const ae=te[0]*(K.width??0);K.x&&K.x<ae&&(b.x=ae,w.x=w.x-(K.x-ae));const xe=te[1]*(K.height??0);K.y&&K.y<xe&&(b.y=xe,w.y=w.y-(K.y-xe))}const _e=w8({width:b.width,prevWidth:V,height:b.height,prevHeight:B,affectsX:l.controlDirection.affectsX,affectsY:l.controlDirection.affectsY}),we={...b,direction:_e};(v==null?void 0:v(j,we))!==!1&&(k=!0,C==null||C(j,we),s(K,P))}).on("end",j=>{k&&(x==null||x(j,{...b}),a==null||a({...b}),k=!1)});o.call(N)}function h(){o.on(".drag",null)}return{update:u,destroy:h}}var um={exports:{}},lm={},cm={exports:{}},fm={};/**
50
+ * @license React
51
+ * use-sync-external-store-shim.production.js
52
+ *
53
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
54
+ *
55
+ * This source code is licensed under the MIT license found in the
56
+ * LICENSE file in the root directory of this source tree.
57
+ */var hA;function q8(){if(hA)return fm;hA=1;var e=al();function n(d,g){return d===g&&(d!==0||1/d===1/g)||d!==d&&g!==g}var r=typeof Object.is=="function"?Object.is:n,s=e.useState,a=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function u(d,g){var y=g(),C=s({inst:{value:y,getSnapshot:g}}),x=C[0].inst,v=C[1];return o(function(){x.value=y,x.getSnapshot=g,h(x)&&v({inst:x})},[d,y,g]),a(function(){return h(x)&&v({inst:x}),d(function(){h(x)&&v({inst:x})})},[d]),l(y),y}function h(d){var g=d.getSnapshot;d=d.value;try{var y=g();return!r(d,y)}catch{return!0}}function f(d,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return fm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,fm}var dA;function A8(){return dA||(dA=1,cm.exports=q8()),cm.exports}/**
58
+ * @license React
59
+ * use-sync-external-store-shim/with-selector.production.js
60
+ *
61
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
62
+ *
63
+ * This source code is licensed under the MIT license found in the
64
+ * LICENSE file in the root directory of this source tree.
65
+ */var pA;function N8(){if(pA)return lm;pA=1;var e=al(),n=A8();function r(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var s=typeof Object.is=="function"?Object.is:r,a=n.useSyncExternalStore,o=e.useRef,l=e.useEffect,u=e.useMemo,h=e.useDebugValue;return lm.useSyncExternalStoreWithSelector=function(f,p,d,g,y){var C=o(null);if(C.current===null){var x={hasValue:!1,value:null};C.current=x}else x=C.current;C=u(function(){function b(R){if(!w){if(w=!0,E=R,R=g(R),y!==void 0&&x.hasValue){var O=x.value;if(y(O,R))return q=O}return q=R}if(O=q,s(E,R))return O;var I=g(R);return y!==void 0&&y(O,I)?(E=R,O):(E=R,q=I)}var w=!1,E,q,A=d===void 0?null:d;return[function(){return b(p())},A===null?void 0:function(){return b(A())}]},[p,d,g,y]);var v=a(f,C[0],C[1]);return l(function(){x.hasValue=!0,x.value=v},[v]),h(v),v},lm}var mA;function R8(){return mA||(mA=1,um.exports=N8()),um.exports}var O8=R8();const M8=cE(O8),j8={},gA=e=>{let n;const r=new Set,s=(p,d)=>{const g=typeof p=="function"?p(n):p;if(!Object.is(g,n)){const y=n;n=d??(typeof g!="object"||g===null)?g:Object.assign({},n,g),r.forEach(C=>C(n,y))}},a=()=>n,h={setState:s,getState:a,getInitialState:()=>f,subscribe:p=>(r.add(p),()=>r.delete(p)),destroy:()=>{(j8?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},f=n=e(s,a,h);return h},$8=e=>e?gA(e):gA,{useDebugValue:L8}=Fa,{useSyncExternalStoreWithSelector:I8}=M8,D8=e=>e;function gk(e,n=D8,r){const s=I8(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,r);return L8(s),s}const yA=(e,n)=>{const r=$8(e),s=(a,o=n)=>gk(r,a,o);return Object.assign(s,r),s},k8=(e,n)=>e?yA(e,n):yA;function ht(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[s,a]of e)if(!Object.is(a,n.get(s)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const s of e)if(!n.has(s))return!1;return!0}const r=Object.keys(e);if(r.length!==Object.keys(n).length)return!1;for(const s of r)if(!Object.prototype.hasOwnProperty.call(n,s)||!Object.is(e[s],n[s]))return!1;return!0}xI();const ih=re.createContext(null),B8=ih.Provider,yk=vr.error001();function Fe(e,n){const r=re.useContext(ih);if(r===null)throw new Error(yk);return gk(r,e,n)}function dt(){const e=re.useContext(ih);if(e===null)throw new Error(yk);return re.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const vA={display:"none"},P8={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},vk="react-flow__node-desc",bk="react-flow__edge-desc",z8="react-flow__aria-live",U8=e=>e.ariaLiveMessage,Q8=e=>e.ariaLabelConfig;function H8({rfId:e}){const n=Fe(U8);return F.jsx("div",{id:`${z8}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:P8,children:n})}function V8({rfId:e,disableKeyboardA11y:n}){const r=Fe(Q8);return F.jsxs(F.Fragment,{children:[F.jsx("div",{id:`${vk}-${e}`,style:vA,children:n?r["node.a11yDescription.default"]:r["node.a11yDescription.keyboardDisabled"]}),F.jsx("div",{id:`${bk}-${e}`,style:vA,children:r["edge.a11yDescription.default"]}),!n&&F.jsx(H8,{rfId:e})]})}const sh=re.forwardRef(({position:e="top-left",children:n,className:r,style:s,...a},o)=>{const l=`${e}`.split("-");return F.jsx("div",{className:jt(["react-flow__panel",r,...l]),style:s,ref:o,...a,children:n})});sh.displayName="Panel";function F8({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:F.jsx(sh,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:F.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const G8=e=>{const n=[],r=[];for(const[,s]of e.nodeLookup)s.selected&&n.push(s.internals.userNode);for(const[,s]of e.edgeLookup)s.selected&&r.push(s);return{selectedNodes:n,selectedEdges:r}},cf=e=>e.id;function K8(e,n){return ht(e.selectedNodes.map(cf),n.selectedNodes.map(cf))&&ht(e.selectedEdges.map(cf),n.selectedEdges.map(cf))}function Y8({onSelectionChange:e}){const n=dt(),{selectedNodes:r,selectedEdges:s}=Fe(G8,K8);return re.useEffect(()=>{const a={nodes:r,edges:s};e==null||e(a),n.getState().onSelectionChangeHandlers.forEach(o=>o(a))},[r,s,e]),null}const X8=e=>!!e.onSelectionChangeHandlers;function W8({onSelectionChange:e}){const n=Fe(X8);return e||n?F.jsx(Y8,{onSelectionChange:e}):null}const _k=[0,0],J8={x:0,y:0,zoom:1},Z8=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],bA=[...Z8,"rfId"],eV=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),_A={translateExtent:Fu,nodeOrigin:_k,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function tV(e){const{setNodes:n,setEdges:r,setMinZoom:s,setMaxZoom:a,setTranslateExtent:o,setNodeExtent:l,reset:u,setDefaultNodesAndEdges:h}=Fe(eV,ht),f=dt();re.useEffect(()=>(h(e.defaultNodes,e.defaultEdges),()=>{p.current=_A,u()}),[]);const p=re.useRef(_A);return re.useEffect(()=>{for(const d of bA){const g=e[d],y=p.current[d];g!==y&&(typeof e[d]>"u"||(d==="nodes"?n(g):d==="edges"?r(g):d==="minZoom"?s(g):d==="maxZoom"?a(g):d==="translateExtent"?o(g):d==="nodeExtent"?l(g):d==="ariaLabelConfig"?f.setState({ariaLabelConfig:I5(g)}):d==="fitView"?f.setState({fitViewQueued:g}):d==="fitViewOptions"?f.setState({fitViewOptions:g}):f.setState({[d]:g})))}p.current=e},bA.map(d=>e[d])),null}function wA(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function nV(e){var s;const[n,r]=re.useState(e==="system"?null:e);return re.useEffect(()=>{if(e!=="system"){r(e);return}const a=wA(),o=()=>r(a!=null&&a.matches?"dark":"light");return o(),a==null||a.addEventListener("change",o),()=>{a==null||a.removeEventListener("change",o)}},[e]),n!==null?n:(s=wA())!=null&&s.matches?"dark":"light"}const CA=typeof document<"u"?document:null;function Xu(e=null,n={target:CA,actInsideInputWithModifier:!0}){const[r,s]=re.useState(!1),a=re.useRef(!1),o=re.useRef(new Set([])),[l,u]=re.useMemo(()=>{if(e!==null){const f=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
66
+ `).replace(`
67
+
68
+ `,`
69
+ +`).split(`
70
+ `)),p=f.reduce((d,g)=>d.concat(...g),[]);return[f,p]}return[[],[]]},[e]);return re.useEffect(()=>{const h=(n==null?void 0:n.target)??CA,f=(n==null?void 0:n.actInsideInputWithModifier)??!0;if(e!==null){const p=y=>{var v,b;if(a.current=y.ctrlKey||y.metaKey||y.shiftKey||y.altKey,(!a.current||a.current&&!f)&&ZD(y))return!1;const x=xA(y.code,u);if(o.current.add(y[x]),EA(l,o.current,!1)){const w=((b=(v=y.composedPath)==null?void 0:v.call(y))==null?void 0:b[0])||y.target,E=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";n.preventDefault!==!1&&(a.current||!E)&&y.preventDefault(),s(!0)}},d=y=>{const C=xA(y.code,u);EA(l,o.current,!0)?(s(!1),o.current.clear()):o.current.delete(y[C]),y.key==="Meta"&&o.current.clear(),a.current=!1},g=()=>{o.current.clear(),s(!1)};return h==null||h.addEventListener("keydown",p),h==null||h.addEventListener("keyup",d),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{h==null||h.removeEventListener("keydown",p),h==null||h.removeEventListener("keyup",d),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,s]),r}function EA(e,n,r){return e.filter(s=>r||s.length===n.size).some(s=>s.every(a=>n.has(a)))}function xA(e,n){return n.includes(e)?"code":"key"}const rV=()=>{const e=dt();return re.useMemo(()=>({zoomIn:n=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1.2,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},zoomOut:n=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1/1.2,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},zoomTo:(n,r)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(n,{duration:r==null?void 0:r.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(n,r)=>{const{transform:[s,a,o],panZoom:l}=e.getState();return l?(await l.setViewport({x:n.x??s,y:n.y??a,zoom:n.zoom??o},r),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[n,r,s]=e.getState().transform;return{x:n,y:r,zoom:s}},setCenter:async(n,r,s)=>e.getState().setCenter(n,r,s),fitBounds:async(n,r)=>{const{width:s,height:a,minZoom:o,maxZoom:l,panZoom:u}=e.getState(),h=NE(n,s,a,o,l,(r==null?void 0:r.padding)??.1);return u?(await u.setViewport(h,{duration:r==null?void 0:r.duration,ease:r==null?void 0:r.ease,interpolate:r==null?void 0:r.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(n,r={})=>{const{transform:s,snapGrid:a,snapToGrid:o,domNode:l}=e.getState();if(!l)return n;const{x:u,y:h}=l.getBoundingClientRect(),f={x:n.x-u,y:n.y-h},p=r.snapGrid??a,d=r.snapToGrid??o;return gl(f,s,d,p)},flowToScreenPosition:n=>{const{transform:r,domNode:s}=e.getState();if(!s)return n;const{x:a,y:o}=s.getBoundingClientRect(),l=zf(n,r);return{x:l.x+a,y:l.y+o}}}),[])};function wk(e,n){const r=[],s=new Map,a=[];for(const o of e)if(o.type==="add"){a.push(o);continue}else if(o.type==="remove"||o.type==="replace")s.set(o.id,[o]);else{const l=s.get(o.id);l?l.push(o):s.set(o.id,[o])}for(const o of n){const l=s.get(o.id);if(!l){r.push(o);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){r.push({...l[0].item});continue}const u={...o};for(const h of l)iV(h,u);r.push(u)}return a.length&&a.forEach(o=>{o.index!==void 0?r.splice(o.index,0,{...o.item}):r.push({...o.item})}),r}function iV(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function Ck(e,n){return wk(e,n)}function Ek(e,n){return wk(e,n)}function ws(e,n){return{id:e,type:"select",selected:n}}function Ka(e,n=new Set,r=!1){const s=[];for(const[a,o]of e){const l=n.has(a);!(o.selected===void 0&&!l)&&o.selected!==l&&(r&&(o.selected=l),s.push(ws(o.id,l)))}return s}function SA({items:e=[],lookup:n}){var a;const r=[],s=new Map(e.map(o=>[o.id,o]));for(const[o,l]of e.entries()){const u=n.get(l.id),h=((a=u==null?void 0:u.internals)==null?void 0:a.userNode)??u;h!==void 0&&h!==l&&r.push({id:l.id,item:l,type:"replace"}),h===void 0&&r.push({item:l,type:"add",index:o})}for(const[o]of n)s.get(o)===void 0&&r.push({id:o,type:"remove"});return r}function TA(e){return{id:e.id,type:"remove"}}const qA=e=>T5(e),sV=e=>VD(e);function xk(e){return re.forwardRef(e)}const aV=typeof window<"u"?re.useLayoutEffect:re.useEffect;function AA(e){const[n,r]=re.useState(BigInt(0)),[s]=re.useState(()=>oV(()=>r(a=>a+BigInt(1))));return aV(()=>{const a=s.get();a.length&&(e(a),s.reset())},[n]),s}function oV(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:r=>{n.push(r),e()}}}const Sk=re.createContext(null);function uV({children:e}){const n=dt(),r=re.useCallback(u=>{const{nodes:h=[],setNodes:f,hasDefaultNodes:p,onNodesChange:d,nodeLookup:g,fitViewQueued:y,onNodesChangeMiddlewareMap:C}=n.getState();let x=h;for(const b of u)x=typeof b=="function"?b(x):b;let v=SA({items:x,lookup:g});for(const b of C.values())v=b(v);p&&f(x),v.length>0?d==null||d(v):y&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:w,setNodes:E}=n.getState();b&&E(w)})},[]),s=AA(r),a=re.useCallback(u=>{const{edges:h=[],setEdges:f,hasDefaultEdges:p,onEdgesChange:d,edgeLookup:g}=n.getState();let y=h;for(const C of u)y=typeof C=="function"?C(y):C;p?f(y):d&&d(SA({items:y,lookup:g}))},[]),o=AA(a),l=re.useMemo(()=>({nodeQueue:s,edgeQueue:o}),[]);return F.jsx(Sk.Provider,{value:l,children:e})}function lV(){const e=re.useContext(Sk);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const cV=e=>!!e.panZoom;function IE(){const e=rV(),n=dt(),r=lV(),s=Fe(cV),a=re.useMemo(()=>{const o=d=>n.getState().nodeLookup.get(d),l=d=>{r.nodeQueue.push(d)},u=d=>{r.edgeQueue.push(d)},h=d=>{var b,w;const{nodeLookup:g,nodeOrigin:y}=n.getState(),C=qA(d)?d:g.get(d.id),x=C.parentId?WD(C.position,C.measured,C.parentId,g,y):C.position,v={...C,position:x,width:((b=C.measured)==null?void 0:b.width)??C.width,height:((w=C.measured)==null?void 0:w.height)??C.height};return yo(v)},f=(d,g,y={replace:!1})=>{l(C=>C.map(x=>{if(x.id===d){const v=typeof g=="function"?g(x):g;return y.replace&&qA(v)?v:{...x,...v}}return x}))},p=(d,g,y={replace:!1})=>{u(C=>C.map(x=>{if(x.id===d){const v=typeof g=="function"?g(x):g;return y.replace&&sV(v)?v:{...x,...v}}return x}))};return{getNodes:()=>n.getState().nodes.map(d=>({...d})),getNode:d=>{var g;return(g=o(d))==null?void 0:g.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:d=[]}=n.getState();return d.map(g=>({...g}))},getEdge:d=>n.getState().edgeLookup.get(d),setNodes:l,setEdges:u,addNodes:d=>{const g=Array.isArray(d)?d:[d];r.nodeQueue.push(y=>[...y,...g])},addEdges:d=>{const g=Array.isArray(d)?d:[d];r.edgeQueue.push(y=>[...y,...g])},toObject:()=>{const{nodes:d=[],edges:g=[],transform:y}=n.getState(),[C,x,v]=y;return{nodes:d.map(b=>({...b})),edges:g.map(b=>({...b})),viewport:{x:C,y:x,zoom:v}}},deleteElements:async({nodes:d=[],edges:g=[]})=>{const{nodes:y,edges:C,onNodesDelete:x,onEdgesDelete:v,triggerNodeChanges:b,triggerEdgeChanges:w,onDelete:E,onBeforeDelete:q}=n.getState(),{nodes:A,edges:R}=await O5({nodesToRemove:d,edgesToRemove:g,nodes:y,edges:C,onBeforeDelete:q}),O=R.length>0,I=A.length>0;if(O){const k=R.map(TA);v==null||v(R),w(k)}if(I){const k=A.map(TA);x==null||x(A),b(k)}return(I||O)&&(E==null||E({nodes:A,edges:R})),{deletedNodes:A,deletedEdges:R}},getIntersectingNodes:(d,g=!0,y)=>{const C=Zq(d),x=C?d:h(d),v=y!==void 0;return x?(y||n.getState().nodes).filter(b=>{const w=n.getState().nodeLookup.get(b.id);if(w&&!C&&(b.id===d.id||!w.internals.positionAbsolute))return!1;const E=yo(v?b:w),q=Ku(E,x);return g&&q>0||q>=E.width*E.height||q>=x.width*x.height}):[]},isNodeIntersecting:(d,g,y=!0)=>{const x=Zq(d)?d:h(d);if(!x)return!1;const v=Ku(x,g);return y&&v>0||v>=g.width*g.height||v>=x.width*x.height},updateNode:f,updateNodeData:(d,g,y={replace:!1})=>{f(d,C=>{const x=typeof g=="function"?g(C):g;return y.replace?{...C,data:x}:{...C,data:{...C.data,...x}}},y)},updateEdge:p,updateEdgeData:(d,g,y={replace:!1})=>{p(d,C=>{const x=typeof g=="function"?g(C):g;return y.replace?{...C,data:x}:{...C,data:{...C.data,...x}}},y)},getNodesBounds:d=>{const{nodeLookup:g,nodeOrigin:y}=n.getState();return q5(d,{nodeLookup:g,nodeOrigin:y})},getHandleConnections:({type:d,id:g,nodeId:y})=>{var C;return Array.from(((C=n.getState().connectionLookup.get(`${y}-${d}${g?`-${g}`:""}`))==null?void 0:C.values())??[])},getNodeConnections:({type:d,handleId:g,nodeId:y})=>{var C;return Array.from(((C=n.getState().connectionLookup.get(`${y}${d?g?`-${d}-${g}`:`-${d}`:""}`))==null?void 0:C.values())??[])},fitView:async d=>{const g=n.getState().fitViewResolver??L5();return n.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:g}),r.nodeQueue.push(y=>[...y]),g.promise}}},[]);return re.useMemo(()=>({...a,...e,viewportInitialized:s}),[s])}const NA=e=>e.selected,fV=typeof window<"u"?window:void 0;function hV({deleteKeyCode:e,multiSelectionKeyCode:n}){const r=dt(),{deleteElements:s}=IE(),a=Xu(e,{actInsideInputWithModifier:!1}),o=Xu(n,{target:fV});re.useEffect(()=>{if(a){const{edges:l,nodes:u}=r.getState();s({nodes:u.filter(NA),edges:l.filter(NA)}),r.setState({nodesSelectionActive:!1})}},[a]),re.useEffect(()=>{r.setState({multiSelectionActive:o})},[o])}function dV(e){const n=dt();re.useEffect(()=>{const r=()=>{var a,o,l,u;if(!e.current||!(((o=(a=e.current).checkVisibility)==null?void 0:o.call(a))??!0))return!1;const s=RE(e.current);(s.height===0||s.width===0)&&((u=(l=n.getState()).onError)==null||u.call(l,"004",vr.error004())),n.setState({width:s.width||500,height:s.height||500})};if(e.current){r(),window.addEventListener("resize",r);const s=new ResizeObserver(()=>r());return s.observe(e.current),()=>{window.removeEventListener("resize",r),s&&e.current&&s.unobserve(e.current)}}},[])}const ah={position:"absolute",width:"100%",height:"100%",top:0,left:0},pV=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function mV({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:r=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:o=$s.Free,zoomOnDoubleClick:l=!0,panOnDrag:u=!0,defaultViewport:h,translateExtent:f,minZoom:p,maxZoom:d,zoomActivationKeyCode:g,preventScrolling:y=!0,children:C,noWheelClassName:x,noPanClassName:v,onViewportChange:b,isControlledViewport:w,paneClickDistance:E,selectionOnDrag:q}){const A=dt(),R=re.useRef(null),{userSelectionActive:O,lib:I,connectionInProgress:k}=Fe(pV,ht),N=Xu(g),j=re.useRef();dV(R);const D=re.useCallback(z=>{b==null||b({x:z[0],y:z[1],zoom:z[2]}),w||A.setState({transform:z})},[b,w]);return re.useEffect(()=>{if(R.current){j.current=v8({domNode:R.current,minZoom:p,maxZoom:d,translateExtent:f,viewport:h,onDraggingChange:$=>A.setState({paneDragging:$}),onPanZoomStart:($,P)=>{const{onViewportChangeStart:H,onMoveStart:G}=A.getState();G==null||G($,P),H==null||H(P)},onPanZoom:($,P)=>{const{onViewportChange:H,onMove:G}=A.getState();G==null||G($,P),H==null||H(P)},onPanZoomEnd:($,P)=>{const{onViewportChangeEnd:H,onMoveEnd:G}=A.getState();G==null||G($,P),H==null||H(P)}});const{x:z,y:T,zoom:M}=j.current.getViewport();return A.setState({panZoom:j.current,transform:[z,T,M],domNode:R.current.closest(".react-flow")}),()=>{var $;($=j.current)==null||$.destroy()}}},[]),re.useEffect(()=>{var z;(z=j.current)==null||z.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:r,panOnScroll:s,panOnScrollSpeed:a,panOnScrollMode:o,zoomOnDoubleClick:l,panOnDrag:u,zoomActivationKeyPressed:N,preventScrolling:y,noPanClassName:v,userSelectionActive:O,noWheelClassName:x,lib:I,onTransformChange:D,connectionInProgress:k,selectionOnDrag:q,paneClickDistance:E})},[e,n,r,s,a,o,l,u,N,y,v,O,x,I,D,k,q,E]),F.jsx("div",{className:"react-flow__renderer",ref:R,style:ah,children:C})}const gV=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function yV(){const{userSelectionActive:e,userSelectionRect:n}=Fe(gV,ht);return e&&n?F.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const hm=(e,n)=>r=>{r.target===n.current&&(e==null||e(r))},vV=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function bV({isSelecting:e,selectionKeyPressed:n,selectionMode:r=Gu.Full,panOnDrag:s,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:l,onSelectionEnd:u,onPaneClick:h,onPaneContextMenu:f,onPaneScroll:p,onPaneMouseEnter:d,onPaneMouseMove:g,onPaneMouseLeave:y,children:C}){const x=dt(),{userSelectionActive:v,elementsSelectable:b,dragging:w,connectionInProgress:E}=Fe(vV,ht),q=b&&(e||v),A=re.useRef(null),R=re.useRef(),O=re.useRef(new Set),I=re.useRef(new Set),k=re.useRef(!1),N=H=>{if(k.current||E){k.current=!1;return}h==null||h(H),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},j=H=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){H.preventDefault();return}f==null||f(H)},D=p?H=>p(H):void 0,z=H=>{k.current&&(H.stopPropagation(),k.current=!1)},T=H=>{var J,ie;const{domNode:G}=x.getState();if(R.current=G==null?void 0:G.getBoundingClientRect(),!R.current)return;const V=H.target===A.current;if(!V&&!!H.target.closest(".nokey")||!e||!(o&&V||n)||H.button!==0||!H.isPrimary)return;(ie=(J=H.target)==null?void 0:J.setPointerCapture)==null||ie.call(J,H.pointerId),k.current=!1;const{x:te,y:Q}=Jn(H.nativeEvent,R.current);x.setState({userSelectionRect:{width:0,height:0,startX:te,startY:Q,x:te,y:Q}}),V||(H.stopPropagation(),H.preventDefault())},M=H=>{const{userSelectionRect:G,transform:V,nodeLookup:B,edgeLookup:K,connectionLookup:te,triggerNodeChanges:Q,triggerEdgeChanges:J,defaultEdgeOptions:ie,resetSelectedElements:oe}=x.getState();if(!R.current||!G)return;const{x:ee,y:fe}=Jn(H.nativeEvent,R.current),{startX:be,startY:ve}=G;if(!k.current){const xe=n?0:a;if(Math.hypot(ee-be,fe-ve)<=xe)return;oe(),l==null||l(H)}k.current=!0;const _e={startX:be,startY:ve,x:ee<be?ee:be,y:fe<ve?fe:ve,width:Math.abs(ee-be),height:Math.abs(fe-ve)},we=O.current,W=I.current;O.current=new Set(AE(B,_e,V,r===Gu.Partial,!0).map(xe=>xe.id)),I.current=new Set;const ae=(ie==null?void 0:ie.selectable)??!0;for(const xe of O.current){const Se=te.get(xe);if(Se)for(const{edgeId:gt}of Se.values()){const ut=K.get(gt);ut&&(ut.selectable??ae)&&I.current.add(gt)}}if(!eA(we,O.current)){const xe=Ka(B,O.current,!0);Q(xe)}if(!eA(W,I.current)){const xe=Ka(K,I.current);J(xe)}x.setState({userSelectionRect:_e,userSelectionActive:!0,nodesSelectionActive:!1})},$=H=>{var G,V;H.button===0&&((V=(G=H.target)==null?void 0:G.releasePointerCapture)==null||V.call(G,H.pointerId),!v&&H.target===A.current&&x.getState().userSelectionRect&&(N==null||N(H)),x.setState({userSelectionActive:!1,userSelectionRect:null}),k.current&&(u==null||u(H),x.setState({nodesSelectionActive:O.current.size>0})))},P=s===!0||Array.isArray(s)&&s.includes(0);return F.jsxs("div",{className:jt(["react-flow__pane",{draggable:P,dragging:w,selection:e}]),onClick:q?void 0:hm(N,A),onContextMenu:hm(j,A),onWheel:hm(D,A),onPointerEnter:q?void 0:d,onPointerMove:q?M:g,onPointerUp:q?$:void 0,onPointerDownCapture:q?T:void 0,onClickCapture:q?z:void 0,onPointerLeave:y,ref:A,style:ah,children:[C,F.jsx(yV,{})]})}function aE({id:e,store:n,unselect:r=!1,nodeRef:s}){const{addSelectedNodes:a,unselectNodesAndEdges:o,multiSelectionActive:l,nodeLookup:u,onError:h}=n.getState(),f=u.get(e);if(!f){h==null||h("012",vr.error012(e));return}n.setState({nodesSelectionActive:!1}),f.selected?(r||f.selected&&l)&&(o({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var p;return(p=s==null?void 0:s.current)==null?void 0:p.blur()})):a([e])}function Tk({nodeRef:e,disabled:n=!1,noDragClassName:r,handleSelector:s,nodeId:a,isSelectable:o,nodeClickDistance:l}){const u=dt(),[h,f]=re.useState(!1),p=re.useRef();return re.useEffect(()=>{p.current=i8({getStoreItems:()=>u.getState(),onNodeMouseDown:d=>{aE({id:d,store:u,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),re.useEffect(()=>{var d,g;if(n)(d=p.current)==null||d.destroy();else if(e.current)return(g=p.current)==null||g.update({noDragClassName:r,handleSelector:s,domNode:e.current,isSelectable:o,nodeId:a,nodeClickDistance:l}),()=>{var y;(y=p.current)==null||y.destroy()}},[r,s,n,o,e,a]),h}const _V=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function qk(){const e=dt();return re.useCallback(r=>{const{nodeExtent:s,snapToGrid:a,snapGrid:o,nodesDraggable:l,onError:u,updateNodePositions:h,nodeLookup:f,nodeOrigin:p}=e.getState(),d=new Map,g=_V(l),y=a?o[0]:5,C=a?o[1]:5,x=r.direction.x*y*r.factor,v=r.direction.y*C*r.factor;for(const[,b]of f){if(!g(b))continue;let w={x:b.internals.positionAbsolute.x+x,y:b.internals.positionAbsolute.y+v};a&&(w=ml(w,o));const{position:E,positionAbsolute:q}=FD({nodeId:b.id,nextPosition:w,nodeLookup:f,nodeExtent:s,nodeOrigin:p,onError:u});b.position=E,b.internals.positionAbsolute=q,d.set(b.id,b)}h(d)},[])}const DE=re.createContext(null),wV=DE.Provider;DE.Consumer;const Ak=()=>re.useContext(DE),CV=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),EV=(e,n,r)=>s=>{const{connectionClickStartHandle:a,connectionMode:o,connection:l}=s,{fromHandle:u,toHandle:h,isValid:f}=l,p=(h==null?void 0:h.nodeId)===e&&(h==null?void 0:h.id)===n&&(h==null?void 0:h.type)===r;return{connectingFrom:(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===n&&(u==null?void 0:u.type)===r,connectingTo:p,clickConnecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===n&&(a==null?void 0:a.type)===r,isPossibleEndHandle:o===mo.Strict?(u==null?void 0:u.type)!==r:e!==(u==null?void 0:u.nodeId)||n!==(u==null?void 0:u.id),connectionInProcess:!!u,clickConnectionInProcess:!!a,valid:p&&f}};function xV({type:e="source",position:n=Ne.Top,isValidConnection:r,isConnectable:s=!0,isConnectableStart:a=!0,isConnectableEnd:o=!0,id:l,onConnect:u,children:h,className:f,onMouseDown:p,onTouchStart:d,...g},y){var M,$;const C=l||null,x=e==="target",v=dt(),b=Ak(),{connectOnClick:w,noPanClassName:E,rfId:q}=Fe(CV,ht),{connectingFrom:A,connectingTo:R,clickConnecting:O,isPossibleEndHandle:I,connectionInProcess:k,clickConnectionInProcess:N,valid:j}=Fe(EV(b,C,e),ht);b||($=(M=v.getState()).onError)==null||$.call(M,"010",vr.error010());const D=P=>{const{defaultEdgeOptions:H,onConnect:G,hasDefaultEdges:V}=v.getState(),B={...H,...P};if(V){const{edges:K,setEdges:te}=v.getState();te(U5(B,K))}G==null||G(B),u==null||u(B)},z=P=>{if(!b)return;const H=ek(P.nativeEvent);if(a&&(H&&P.button===0||!H)){const G=v.getState();sE.onPointerDown(P.nativeEvent,{handleDomNode:P.currentTarget,autoPanOnConnect:G.autoPanOnConnect,connectionMode:G.connectionMode,connectionRadius:G.connectionRadius,domNode:G.domNode,nodeLookup:G.nodeLookup,lib:G.lib,isTarget:x,handleId:C,nodeId:b,flowId:G.rfId,panBy:G.panBy,cancelConnection:G.cancelConnection,onConnectStart:G.onConnectStart,onConnectEnd:G.onConnectEnd,updateConnection:G.updateConnection,onConnect:D,isValidConnection:r||G.isValidConnection,getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:G.autoPanSpeed,dragThreshold:G.connectionDragThreshold})}H?p==null||p(P):d==null||d(P)},T=P=>{const{onClickConnectStart:H,onClickConnectEnd:G,connectionClickStartHandle:V,connectionMode:B,isValidConnection:K,lib:te,rfId:Q,nodeLookup:J,connection:ie}=v.getState();if(!b||!V&&!a)return;if(!V){H==null||H(P.nativeEvent,{nodeId:b,handleId:C,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:b,type:e,id:C}});return}const oe=JD(P.target),ee=r||K,{connection:fe,isValid:be}=sE.isValid(P.nativeEvent,{handle:{nodeId:b,id:C,type:e},connectionMode:B,fromNodeId:V.nodeId,fromHandleId:V.id||null,fromType:V.type,isValidConnection:ee,flowId:Q,doc:oe,lib:te,nodeLookup:J});be&&fe&&D(fe);const ve=structuredClone(ie);delete ve.inProgress,ve.toPosition=ve.toHandle?ve.toHandle.position:null,G==null||G(P,ve),v.setState({connectionClickStartHandle:null})};return F.jsx("div",{"data-handleid":C,"data-nodeid":b,"data-handlepos":n,"data-id":`${q}-${b}-${C}-${e}`,className:jt(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",E,f,{source:!x,target:x,connectable:s,connectablestart:a,connectableend:o,clickconnecting:O,connectingfrom:A,connectingto:R,valid:j,connectionindicator:s&&(!k||I)&&(k||N?o:a)}]),onMouseDown:z,onTouchStart:z,onClick:w?T:void 0,ref:y,...g,children:h})}const br=re.memo(xk(xV));function SV({data:e,isConnectable:n,sourcePosition:r=Ne.Bottom}){return F.jsxs(F.Fragment,{children:[e==null?void 0:e.label,F.jsx(br,{type:"source",position:r,isConnectable:n})]})}function TV({data:e,isConnectable:n,targetPosition:r=Ne.Top,sourcePosition:s=Ne.Bottom}){return F.jsxs(F.Fragment,{children:[F.jsx(br,{type:"target",position:r,isConnectable:n}),e==null?void 0:e.label,F.jsx(br,{type:"source",position:s,isConnectable:n})]})}function qV(){return null}function AV({data:e,isConnectable:n,targetPosition:r=Ne.Top}){return F.jsxs(F.Fragment,{children:[F.jsx(br,{type:"target",position:r,isConnectable:n}),e==null?void 0:e.label]})}const Uf={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},RA={input:SV,default:TV,output:AV,group:qV};function NV(e){var n,r,s,a;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((n=e.style)==null?void 0:n.width),height:e.height??e.initialHeight??((r=e.style)==null?void 0:r.height)}:{width:e.width??((s=e.style)==null?void 0:s.width),height:e.height??((a=e.style)==null?void 0:a.height)}}const RV=e=>{const{width:n,height:r,x:s,y:a}=pl(e.nodeLookup,{filter:o=>!!o.selected});return{width:Wn(n)?n:null,height:Wn(r)?r:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${a}px)`}};function OV({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:r}){const s=dt(),{width:a,height:o,transformString:l,userSelectionActive:u}=Fe(RV,ht),h=qk(),f=re.useRef(null);if(re.useEffect(()=>{var g;r||(g=f.current)==null||g.focus({preventScroll:!0})},[r]),Tk({nodeRef:f}),u||!a||!o)return null;const p=e?g=>{const y=s.getState().nodes.filter(C=>C.selected);e(g,y)}:void 0,d=g=>{Object.prototype.hasOwnProperty.call(Uf,g.key)&&(g.preventDefault(),h({direction:Uf[g.key],factor:g.shiftKey?4:1}))};return F.jsx("div",{className:jt(["react-flow__nodesselection","react-flow__container",n]),style:{transform:l},children:F.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:r?void 0:-1,onKeyDown:r?void 0:d,style:{width:a,height:o}})})}const OA=typeof window<"u"?window:void 0,MV=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Nk({children:e,onPaneClick:n,onPaneMouseEnter:r,onPaneMouseMove:s,onPaneMouseLeave:a,onPaneContextMenu:o,onPaneScroll:l,paneClickDistance:u,deleteKeyCode:h,selectionKeyCode:f,selectionOnDrag:p,selectionMode:d,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:C,panActivationKeyCode:x,zoomActivationKeyCode:v,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:E,panOnScroll:q,panOnScrollSpeed:A,panOnScrollMode:R,zoomOnDoubleClick:O,panOnDrag:I,defaultViewport:k,translateExtent:N,minZoom:j,maxZoom:D,preventScrolling:z,onSelectionContextMenu:T,noWheelClassName:M,noPanClassName:$,disableKeyboardA11y:P,onViewportChange:H,isControlledViewport:G}){const{nodesSelectionActive:V,userSelectionActive:B}=Fe(MV,ht),K=Xu(f,{target:OA}),te=Xu(x,{target:OA}),Q=te||I,J=te||q,ie=p&&Q!==!0,oe=K||B||ie;return hV({deleteKeyCode:h,multiSelectionKeyCode:C}),F.jsx(mV,{onPaneContextMenu:o,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:E,panOnScroll:J,panOnScrollSpeed:A,panOnScrollMode:R,zoomOnDoubleClick:O,panOnDrag:!K&&Q,defaultViewport:k,translateExtent:N,minZoom:j,maxZoom:D,zoomActivationKeyCode:v,preventScrolling:z,noWheelClassName:M,noPanClassName:$,onViewportChange:H,isControlledViewport:G,paneClickDistance:u,selectionOnDrag:ie,children:F.jsxs(bV,{onSelectionStart:g,onSelectionEnd:y,onPaneClick:n,onPaneMouseEnter:r,onPaneMouseMove:s,onPaneMouseLeave:a,onPaneContextMenu:o,onPaneScroll:l,panOnDrag:Q,isSelecting:!!oe,selectionMode:d,selectionKeyPressed:K,paneClickDistance:u,selectionOnDrag:ie,children:[e,V&&F.jsx(OV,{onSelectionContextMenu:T,noPanClassName:$,disableKeyboardA11y:P})]})})}Nk.displayName="FlowRenderer";const jV=re.memo(Nk),$V=e=>n=>e?AE(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(r=>r.id):Array.from(n.nodeLookup.keys());function LV(e){return Fe(re.useCallback($V(e),[e]),ht)}const IV=e=>e.updateNodeInternals;function DV(){const e=Fe(IV),[n]=re.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(r=>{const s=new Map;r.forEach(a=>{const o=a.target.getAttribute("data-id");s.set(o,{id:o,nodeElement:a.target,force:!0})}),e(s)}));return re.useEffect(()=>()=>{n==null||n.disconnect()},[n]),n}function kV({node:e,nodeType:n,hasDimensions:r,resizeObserver:s}){const a=dt(),o=re.useRef(null),l=re.useRef(null),u=re.useRef(e.sourcePosition),h=re.useRef(e.targetPosition),f=re.useRef(n),p=r&&!!e.internals.handleBounds;return re.useEffect(()=>{o.current&&!e.hidden&&(!p||l.current!==o.current)&&(l.current&&(s==null||s.unobserve(l.current)),s==null||s.observe(o.current),l.current=o.current)},[p,e.hidden]),re.useEffect(()=>()=>{l.current&&(s==null||s.unobserve(l.current),l.current=null)},[]),re.useEffect(()=>{if(o.current){const d=f.current!==n,g=u.current!==e.sourcePosition,y=h.current!==e.targetPosition;(d||g||y)&&(f.current=n,u.current=e.sourcePosition,h.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),o}function BV({id:e,onClick:n,onMouseEnter:r,onMouseMove:s,onMouseLeave:a,onContextMenu:o,onDoubleClick:l,nodesDraggable:u,elementsSelectable:h,nodesConnectable:f,nodesFocusable:p,resizeObserver:d,noDragClassName:g,noPanClassName:y,disableKeyboardA11y:C,rfId:x,nodeTypes:v,nodeClickDistance:b,onError:w}){const{node:E,internals:q,isParent:A}=Fe(ee=>{const fe=ee.nodeLookup.get(e),be=ee.parentLookup.has(e);return{node:fe,internals:fe.internals,isParent:be}},ht);let R=E.type||"default",O=(v==null?void 0:v[R])||RA[R];O===void 0&&(w==null||w("003",vr.error003(R)),R="default",O=(v==null?void 0:v.default)||RA.default);const I=!!(E.draggable||u&&typeof E.draggable>"u"),k=!!(E.selectable||h&&typeof E.selectable>"u"),N=!!(E.connectable||f&&typeof E.connectable>"u"),j=!!(E.focusable||p&&typeof E.focusable>"u"),D=dt(),z=XD(E),T=kV({node:E,nodeType:R,hasDimensions:z,resizeObserver:d}),M=Tk({nodeRef:T,disabled:E.hidden||!I,noDragClassName:g,handleSelector:E.dragHandle,nodeId:e,isSelectable:k,nodeClickDistance:b}),$=qk();if(E.hidden)return null;const P=Zr(E),H=NV(E),G=k||I||n||r||s||a,V=r?ee=>r(ee,{...q.userNode}):void 0,B=s?ee=>s(ee,{...q.userNode}):void 0,K=a?ee=>a(ee,{...q.userNode}):void 0,te=o?ee=>o(ee,{...q.userNode}):void 0,Q=l?ee=>l(ee,{...q.userNode}):void 0,J=ee=>{const{selectNodesOnDrag:fe,nodeDragThreshold:be}=D.getState();k&&(!fe||!I||be>0)&&aE({id:e,store:D,nodeRef:T}),n&&n(ee,{...q.userNode})},ie=ee=>{if(!(ZD(ee.nativeEvent)||C)){if(zD.includes(ee.key)&&k){const fe=ee.key==="Escape";aE({id:e,store:D,unselect:fe,nodeRef:T})}else if(I&&E.selected&&Object.prototype.hasOwnProperty.call(Uf,ee.key)){ee.preventDefault();const{ariaLabelConfig:fe}=D.getState();D.setState({ariaLiveMessage:fe["node.a11yDescription.ariaLiveMessage"]({direction:ee.key.replace("Arrow","").toLowerCase(),x:~~q.positionAbsolute.x,y:~~q.positionAbsolute.y})}),$({direction:Uf[ee.key],factor:ee.shiftKey?4:1})}}},oe=()=>{var W;if(C||!((W=T.current)!=null&&W.matches(":focus-visible")))return;const{transform:ee,width:fe,height:be,autoPanOnNodeFocus:ve,setCenter:_e}=D.getState();if(!ve)return;AE(new Map([[e,E]]),{x:0,y:0,width:fe,height:be},ee,!0).length>0||_e(E.position.x+P.width/2,E.position.y+P.height/2,{zoom:ee[2]})};return F.jsx("div",{className:jt(["react-flow__node",`react-flow__node-${R}`,{[y]:I},E.className,{selected:E.selected,selectable:k,parent:A,draggable:I,dragging:M}]),ref:T,style:{zIndex:q.z,transform:`translate(${q.positionAbsolute.x}px,${q.positionAbsolute.y}px)`,pointerEvents:G?"all":"none",visibility:z?"visible":"hidden",...E.style,...H},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:V,onMouseMove:B,onMouseLeave:K,onContextMenu:te,onClick:J,onDoubleClick:Q,onKeyDown:j?ie:void 0,tabIndex:j?0:void 0,onFocus:j?oe:void 0,role:E.ariaRole??(j?"group":void 0),"aria-roledescription":"node","aria-describedby":C?void 0:`${vk}-${x}`,"aria-label":E.ariaLabel,...E.domAttributes,children:F.jsx(wV,{value:e,children:F.jsx(O,{id:e,data:E.data,type:R,positionAbsoluteX:q.positionAbsolute.x,positionAbsoluteY:q.positionAbsolute.y,selected:E.selected??!1,selectable:k,draggable:I,deletable:E.deletable??!0,isConnectable:N,sourcePosition:E.sourcePosition,targetPosition:E.targetPosition,dragging:M,dragHandle:E.dragHandle,zIndex:q.z,parentId:E.parentId,...P})})})}var PV=re.memo(BV);const zV=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Rk(e){const{nodesDraggable:n,nodesConnectable:r,nodesFocusable:s,elementsSelectable:a,onError:o}=Fe(zV,ht),l=LV(e.onlyRenderVisibleElements),u=DV();return F.jsx("div",{className:"react-flow__nodes",style:ah,children:l.map(h=>F.jsx(PV,{id:h,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:u,nodesDraggable:n,nodesConnectable:r,nodesFocusable:s,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:o},h))})}Rk.displayName="NodeRenderer";const UV=re.memo(Rk);function QV(e){return Fe(re.useCallback(r=>{if(!e)return r.edges.map(a=>a.id);const s=[];if(r.width&&r.height)for(const a of r.edges){const o=r.nodeLookup.get(a.source),l=r.nodeLookup.get(a.target);o&&l&&B5({sourceNode:o,targetNode:l,width:r.width,height:r.height,transform:r.transform})&&s.push(a.id)}return s},[e]),ht)}const HV=({color:e="none",strokeWidth:n=1})=>{const r={strokeWidth:n,...e&&{stroke:e}};return F.jsx("polyline",{className:"arrow",style:r,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},VV=({color:e="none",strokeWidth:n=1})=>{const r={strokeWidth:n,...e&&{stroke:e,fill:e}};return F.jsx("polyline",{className:"arrowclosed",style:r,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},MA={[Bf.Arrow]:HV,[Bf.ArrowClosed]:VV};function FV(e){const n=dt();return re.useMemo(()=>{var a,o;return Object.prototype.hasOwnProperty.call(MA,e)?MA[e]:((o=(a=n.getState()).onError)==null||o.call(a,"009",vr.error009(e)),null)},[e])}const GV=({id:e,type:n,color:r,width:s=12.5,height:a=12.5,markerUnits:o="strokeWidth",strokeWidth:l,orient:u="auto-start-reverse"})=>{const h=FV(n);return h?F.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:u,refX:"0",refY:"0",children:F.jsx(h,{color:r,strokeWidth:l})}):null},Ok=({defaultColor:e,rfId:n})=>{const r=Fe(o=>o.edges),s=Fe(o=>o.defaultEdgeOptions),a=re.useMemo(()=>G5(r,{id:n,defaultColor:e,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[r,s,n,e]);return a.length?F.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:F.jsx("defs",{children:a.map(o=>F.jsx(GV,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};Ok.displayName="MarkerDefinitions";var KV=re.memo(Ok);function Mk({x:e,y:n,label:r,labelStyle:s,labelShowBg:a=!0,labelBgStyle:o,labelBgPadding:l=[2,4],labelBgBorderRadius:u=2,children:h,className:f,...p}){const[d,g]=re.useState({x:1,y:0,width:0,height:0}),y=jt(["react-flow__edge-textwrapper",f]),C=re.useRef(null);return re.useEffect(()=>{if(C.current){const x=C.current.getBBox();g({x:x.x,y:x.y,width:x.width,height:x.height})}},[r]),r?F.jsxs("g",{transform:`translate(${e-d.width/2} ${n-d.height/2})`,className:y,visibility:d.width?"visible":"hidden",...p,children:[a&&F.jsx("rect",{width:d.width+2*l[0],x:-l[0],y:-l[1],height:d.height+2*l[1],className:"react-flow__edge-textbg",style:o,rx:u,ry:u}),F.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:C,style:s,children:r}),h]}):null}Mk.displayName="EdgeText";const YV=re.memo(Mk);function oh({path:e,labelX:n,labelY:r,label:s,labelStyle:a,labelShowBg:o,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:h,interactionWidth:f=20,...p}){return F.jsxs(F.Fragment,{children:[F.jsx("path",{...p,d:e,fill:"none",className:jt(["react-flow__edge-path",p.className])}),f?F.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,s&&Wn(n)&&Wn(r)?F.jsx(YV,{x:n,y:r,label:s,labelStyle:a,labelShowBg:o,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:h}):null]})}function jA({pos:e,x1:n,y1:r,x2:s,y2:a}){return e===Ne.Left||e===Ne.Right?[.5*(n+s),r]:[n,.5*(r+a)]}function jk({sourceX:e,sourceY:n,sourcePosition:r=Ne.Bottom,targetX:s,targetY:a,targetPosition:o=Ne.Top}){const[l,u]=jA({pos:r,x1:e,y1:n,x2:s,y2:a}),[h,f]=jA({pos:o,x1:s,y1:a,x2:e,y2:n}),[p,d,g,y]=tk({sourceX:e,sourceY:n,targetX:s,targetY:a,sourceControlX:l,sourceControlY:u,targetControlX:h,targetControlY:f});return[`M${e},${n} C${l},${u} ${h},${f} ${s},${a}`,p,d,g,y]}function $k(e){return re.memo(({id:n,sourceX:r,sourceY:s,targetX:a,targetY:o,sourcePosition:l,targetPosition:u,label:h,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:y,style:C,markerEnd:x,markerStart:v,interactionWidth:b})=>{const[w,E,q]=jk({sourceX:r,sourceY:s,sourcePosition:l,targetX:a,targetY:o,targetPosition:u}),A=e.isInternal?void 0:n;return F.jsx(oh,{id:A,path:w,labelX:E,labelY:q,label:h,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:y,style:C,markerEnd:x,markerStart:v,interactionWidth:b})})}const XV=$k({isInternal:!1}),Lk=$k({isInternal:!0});XV.displayName="SimpleBezierEdge";Lk.displayName="SimpleBezierEdgeInternal";function Ik(e){return re.memo(({id:n,sourceX:r,sourceY:s,targetX:a,targetY:o,label:l,labelStyle:u,labelShowBg:h,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:g,sourcePosition:y=Ne.Bottom,targetPosition:C=Ne.Top,markerEnd:x,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[E,q,A]=nE({sourceX:r,sourceY:s,sourcePosition:y,targetX:a,targetY:o,targetPosition:C,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset,stepPosition:b==null?void 0:b.stepPosition}),R=e.isInternal?void 0:n;return F.jsx(oh,{id:R,path:E,labelX:q,labelY:A,label:l,labelStyle:u,labelShowBg:h,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:g,markerEnd:x,markerStart:v,interactionWidth:w})})}const Dk=Ik({isInternal:!1}),kk=Ik({isInternal:!0});Dk.displayName="SmoothStepEdge";kk.displayName="SmoothStepEdgeInternal";function Bk(e){return re.memo(({id:n,...r})=>{var a;const s=e.isInternal?void 0:n;return F.jsx(Dk,{...r,id:s,pathOptions:re.useMemo(()=>{var o;return{borderRadius:0,offset:(o=r.pathOptions)==null?void 0:o.offset}},[(a=r.pathOptions)==null?void 0:a.offset])})})}const WV=Bk({isInternal:!1}),Pk=Bk({isInternal:!0});WV.displayName="StepEdge";Pk.displayName="StepEdgeInternal";function zk(e){return re.memo(({id:n,sourceX:r,sourceY:s,targetX:a,targetY:o,label:l,labelStyle:u,labelShowBg:h,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:g,markerEnd:y,markerStart:C,interactionWidth:x})=>{const[v,b,w]=ik({sourceX:r,sourceY:s,targetX:a,targetY:o}),E=e.isInternal?void 0:n;return F.jsx(oh,{id:E,path:v,labelX:b,labelY:w,label:l,labelStyle:u,labelShowBg:h,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:g,markerEnd:y,markerStart:C,interactionWidth:x})})}const JV=zk({isInternal:!1}),Uk=zk({isInternal:!0});JV.displayName="StraightEdge";Uk.displayName="StraightEdgeInternal";function Qk(e){return re.memo(({id:n,sourceX:r,sourceY:s,targetX:a,targetY:o,sourcePosition:l=Ne.Bottom,targetPosition:u=Ne.Top,label:h,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:y,style:C,markerEnd:x,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[E,q,A]=nk({sourceX:r,sourceY:s,sourcePosition:l,targetX:a,targetY:o,targetPosition:u,curvature:b==null?void 0:b.curvature}),R=e.isInternal?void 0:n;return F.jsx(oh,{id:R,path:E,labelX:q,labelY:A,label:h,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:y,style:C,markerEnd:x,markerStart:v,interactionWidth:w})})}const ZV=Qk({isInternal:!1}),Hk=Qk({isInternal:!0});ZV.displayName="BezierEdge";Hk.displayName="BezierEdgeInternal";const $A={default:Hk,straight:Uk,step:Pk,smoothstep:kk,simplebezier:Lk},LA={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},eF=(e,n,r)=>r===Ne.Left?e-n:r===Ne.Right?e+n:e,tF=(e,n,r)=>r===Ne.Top?e-n:r===Ne.Bottom?e+n:e,IA="react-flow__edgeupdater";function DA({position:e,centerX:n,centerY:r,radius:s=10,onMouseDown:a,onMouseEnter:o,onMouseOut:l,type:u}){return F.jsx("circle",{onMouseDown:a,onMouseEnter:o,onMouseOut:l,className:jt([IA,`${IA}-${u}`]),cx:eF(n,s,e),cy:tF(r,s,e),r:s,stroke:"transparent",fill:"transparent"})}function nF({isReconnectable:e,reconnectRadius:n,edge:r,sourceX:s,sourceY:a,targetX:o,targetY:l,sourcePosition:u,targetPosition:h,onReconnect:f,onReconnectStart:p,onReconnectEnd:d,setReconnecting:g,setUpdateHover:y}){const C=dt(),x=(q,A)=>{if(q.button!==0)return;const{autoPanOnConnect:R,domNode:O,isValidConnection:I,connectionMode:k,connectionRadius:N,lib:j,onConnectStart:D,onConnectEnd:z,cancelConnection:T,nodeLookup:M,rfId:$,panBy:P,updateConnection:H}=C.getState(),G=A.type==="target",V=(te,Q)=>{g(!1),d==null||d(te,r,A.type,Q)},B=te=>f==null?void 0:f(r,te),K=(te,Q)=>{g(!0),p==null||p(q,r,A.type),D==null||D(te,Q)};sE.onPointerDown(q.nativeEvent,{autoPanOnConnect:R,connectionMode:k,connectionRadius:N,domNode:O,handleId:A.id,nodeId:A.nodeId,nodeLookup:M,isTarget:G,edgeUpdaterType:A.type,lib:j,flowId:$,cancelConnection:T,panBy:P,isValidConnection:I,onConnect:B,onConnectStart:K,onConnectEnd:z,onReconnectEnd:V,updateConnection:H,getTransform:()=>C.getState().transform,getFromHandle:()=>C.getState().connection.fromHandle,dragThreshold:C.getState().connectionDragThreshold,handleDomNode:q.currentTarget})},v=q=>x(q,{nodeId:r.target,id:r.targetHandle??null,type:"target"}),b=q=>x(q,{nodeId:r.source,id:r.sourceHandle??null,type:"source"}),w=()=>y(!0),E=()=>y(!1);return F.jsxs(F.Fragment,{children:[(e===!0||e==="source")&&F.jsx(DA,{position:u,centerX:s,centerY:a,radius:n,onMouseDown:v,onMouseEnter:w,onMouseOut:E,type:"source"}),(e===!0||e==="target")&&F.jsx(DA,{position:h,centerX:o,centerY:l,radius:n,onMouseDown:b,onMouseEnter:w,onMouseOut:E,type:"target"})]})}function rF({id:e,edgesFocusable:n,edgesReconnectable:r,elementsSelectable:s,onClick:a,onDoubleClick:o,onContextMenu:l,onMouseEnter:u,onMouseMove:h,onMouseLeave:f,reconnectRadius:p,onReconnect:d,onReconnectStart:g,onReconnectEnd:y,rfId:C,edgeTypes:x,noPanClassName:v,onError:b,disableKeyboardA11y:w}){let E=Fe(_e=>_e.edgeLookup.get(e));const q=Fe(_e=>_e.defaultEdgeOptions);E=q?{...q,...E}:E;let A=E.type||"default",R=(x==null?void 0:x[A])||$A[A];R===void 0&&(b==null||b("011",vr.error011(A)),A="default",R=(x==null?void 0:x.default)||$A.default);const O=!!(E.focusable||n&&typeof E.focusable>"u"),I=typeof d<"u"&&(E.reconnectable||r&&typeof E.reconnectable>"u"),k=!!(E.selectable||s&&typeof E.selectable>"u"),N=re.useRef(null),[j,D]=re.useState(!1),[z,T]=re.useState(!1),M=dt(),{zIndex:$,sourceX:P,sourceY:H,targetX:G,targetY:V,sourcePosition:B,targetPosition:K}=Fe(re.useCallback(_e=>{const we=_e.nodeLookup.get(E.source),W=_e.nodeLookup.get(E.target);if(!we||!W)return{zIndex:E.zIndex,...LA};const ae=F5({id:e,sourceNode:we,targetNode:W,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:_e.connectionMode,onError:b});return{zIndex:k5({selected:E.selected,zIndex:E.zIndex,sourceNode:we,targetNode:W,elevateOnSelect:_e.elevateEdgesOnSelect,zIndexMode:_e.zIndexMode}),...ae||LA}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex]),ht),te=re.useMemo(()=>E.markerStart?`url('#${rE(E.markerStart,C)}')`:void 0,[E.markerStart,C]),Q=re.useMemo(()=>E.markerEnd?`url('#${rE(E.markerEnd,C)}')`:void 0,[E.markerEnd,C]);if(E.hidden||P===null||H===null||G===null||V===null)return null;const J=_e=>{var xe;const{addSelectedEdges:we,unselectNodesAndEdges:W,multiSelectionActive:ae}=M.getState();k&&(M.setState({nodesSelectionActive:!1}),E.selected&&ae?(W({nodes:[],edges:[E]}),(xe=N.current)==null||xe.blur()):we([e])),a&&a(_e,E)},ie=o?_e=>{o(_e,{...E})}:void 0,oe=l?_e=>{l(_e,{...E})}:void 0,ee=u?_e=>{u(_e,{...E})}:void 0,fe=h?_e=>{h(_e,{...E})}:void 0,be=f?_e=>{f(_e,{...E})}:void 0,ve=_e=>{var we;if(!w&&zD.includes(_e.key)&&k){const{unselectNodesAndEdges:W,addSelectedEdges:ae}=M.getState();_e.key==="Escape"?((we=N.current)==null||we.blur(),W({edges:[E]})):ae([e])}};return F.jsx("svg",{style:{zIndex:$},children:F.jsxs("g",{className:jt(["react-flow__edge",`react-flow__edge-${A}`,E.className,v,{selected:E.selected,animated:E.animated,inactive:!k&&!a,updating:j,selectable:k}]),onClick:J,onDoubleClick:ie,onContextMenu:oe,onMouseEnter:ee,onMouseMove:fe,onMouseLeave:be,onKeyDown:O?ve:void 0,tabIndex:O?0:void 0,role:E.ariaRole??(O?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":E.ariaLabel===null?void 0:E.ariaLabel||`Edge from ${E.source} to ${E.target}`,"aria-describedby":O?`${bk}-${C}`:void 0,ref:N,...E.domAttributes,children:[!z&&F.jsx(R,{id:e,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:k,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:P,sourceY:H,targetX:G,targetY:V,sourcePosition:B,targetPosition:K,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:te,markerEnd:Q,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),I&&F.jsx(nF,{edge:E,isReconnectable:I,reconnectRadius:p,onReconnect:d,onReconnectStart:g,onReconnectEnd:y,sourceX:P,sourceY:H,targetX:G,targetY:V,sourcePosition:B,targetPosition:K,setUpdateHover:D,setReconnecting:T})]})})}var iF=re.memo(rF);const sF=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Vk({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:r,edgeTypes:s,noPanClassName:a,onReconnect:o,onEdgeContextMenu:l,onEdgeMouseEnter:u,onEdgeMouseMove:h,onEdgeMouseLeave:f,onEdgeClick:p,reconnectRadius:d,onEdgeDoubleClick:g,onReconnectStart:y,onReconnectEnd:C,disableKeyboardA11y:x}){const{edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,onError:E}=Fe(sF,ht),q=QV(n);return F.jsxs("div",{className:"react-flow__edges",children:[F.jsx(KV,{defaultColor:e,rfId:r}),q.map(A=>F.jsx(iF,{id:A,edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,noPanClassName:a,onReconnect:o,onContextMenu:l,onMouseEnter:u,onMouseMove:h,onMouseLeave:f,onClick:p,reconnectRadius:d,onDoubleClick:g,onReconnectStart:y,onReconnectEnd:C,rfId:r,onError:E,edgeTypes:s,disableKeyboardA11y:x},A))]})}Vk.displayName="EdgeRenderer";const aF=re.memo(Vk),oF=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function uF({children:e}){const n=Fe(oF);return F.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function lF(e){const n=IE(),r=re.useRef(!1);re.useEffect(()=>{!r.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),r.current=!0)},[e,n.viewportInitialized])}const cF=e=>{var n;return(n=e.panZoom)==null?void 0:n.syncViewport};function fF(e){const n=Fe(cF),r=dt();return re.useEffect(()=>{e&&(n==null||n(e),r.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function hF(e){return e.connection.inProgress?{...e.connection,to:gl(e.connection.to,e.transform)}:{...e.connection}}function dF(e){return hF}function pF(e){const n=dF();return Fe(n,ht)}const mF=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function gF({containerStyle:e,style:n,type:r,component:s}){const{nodesConnectable:a,width:o,height:l,isValid:u,inProgress:h}=Fe(mF,ht);return!(o&&a&&h)?null:F.jsx("svg",{style:e,width:o,height:l,className:"react-flow__connectionline react-flow__container",children:F.jsx("g",{className:jt(["react-flow__connection",HD(u)]),children:F.jsx(Fk,{style:n,type:r,CustomComponent:s,isValid:u})})})}const Fk=({style:e,type:n=Li.Bezier,CustomComponent:r,isValid:s})=>{const{inProgress:a,from:o,fromNode:l,fromHandle:u,fromPosition:h,to:f,toNode:p,toHandle:d,toPosition:g,pointer:y}=pF();if(!a)return;if(r)return F.jsx(r,{connectionLineType:n,connectionLineStyle:e,fromNode:l,fromHandle:u,fromX:o.x,fromY:o.y,toX:f.x,toY:f.y,fromPosition:h,toPosition:g,connectionStatus:HD(s),toNode:p,toHandle:d,pointer:y});let C="";const x={sourceX:o.x,sourceY:o.y,sourcePosition:h,targetX:f.x,targetY:f.y,targetPosition:g};switch(n){case Li.Bezier:[C]=nk(x);break;case Li.SimpleBezier:[C]=jk(x);break;case Li.Step:[C]=nE({...x,borderRadius:0});break;case Li.SmoothStep:[C]=nE(x);break;default:[C]=ik(x)}return F.jsx("path",{d:C,fill:"none",className:"react-flow__connection-path",style:e})};Fk.displayName="ConnectionLine";const yF={};function kA(e=yF){re.useRef(e),dt(),re.useEffect(()=>{},[e])}function vF(){dt(),re.useRef(!1),re.useEffect(()=>{},[])}function Gk({nodeTypes:e,edgeTypes:n,onInit:r,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:o,onEdgeDoubleClick:l,onNodeMouseEnter:u,onNodeMouseMove:h,onNodeMouseLeave:f,onNodeContextMenu:p,onSelectionContextMenu:d,onSelectionStart:g,onSelectionEnd:y,connectionLineType:C,connectionLineStyle:x,connectionLineComponent:v,connectionLineContainerStyle:b,selectionKeyCode:w,selectionOnDrag:E,selectionMode:q,multiSelectionKeyCode:A,panActivationKeyCode:R,zoomActivationKeyCode:O,deleteKeyCode:I,onlyRenderVisibleElements:k,elementsSelectable:N,defaultViewport:j,translateExtent:D,minZoom:z,maxZoom:T,preventScrolling:M,defaultMarkerColor:$,zoomOnScroll:P,zoomOnPinch:H,panOnScroll:G,panOnScrollSpeed:V,panOnScrollMode:B,zoomOnDoubleClick:K,panOnDrag:te,onPaneClick:Q,onPaneMouseEnter:J,onPaneMouseMove:ie,onPaneMouseLeave:oe,onPaneScroll:ee,onPaneContextMenu:fe,paneClickDistance:be,nodeClickDistance:ve,onEdgeContextMenu:_e,onEdgeMouseEnter:we,onEdgeMouseMove:W,onEdgeMouseLeave:ae,reconnectRadius:xe,onReconnect:Se,onReconnectStart:gt,onReconnectEnd:ut,noDragClassName:It,noWheelClassName:Tt,noPanClassName:qt,disableKeyboardA11y:Ge,nodeExtent:Oe,rfId:We,viewport:Je,onViewportChange:rt}){return kA(e),kA(n),vF(),lF(r),fF(Je),F.jsx(jV,{onPaneClick:Q,onPaneMouseEnter:J,onPaneMouseMove:ie,onPaneMouseLeave:oe,onPaneContextMenu:fe,onPaneScroll:ee,paneClickDistance:be,deleteKeyCode:I,selectionKeyCode:w,selectionOnDrag:E,selectionMode:q,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:A,panActivationKeyCode:R,zoomActivationKeyCode:O,elementsSelectable:N,zoomOnScroll:P,zoomOnPinch:H,zoomOnDoubleClick:K,panOnScroll:G,panOnScrollSpeed:V,panOnScrollMode:B,panOnDrag:te,defaultViewport:j,translateExtent:D,minZoom:z,maxZoom:T,onSelectionContextMenu:d,preventScrolling:M,noDragClassName:It,noWheelClassName:Tt,noPanClassName:qt,disableKeyboardA11y:Ge,onViewportChange:rt,isControlledViewport:!!Je,children:F.jsxs(uF,{children:[F.jsx(aF,{edgeTypes:n,onEdgeClick:a,onEdgeDoubleClick:l,onReconnect:Se,onReconnectStart:gt,onReconnectEnd:ut,onlyRenderVisibleElements:k,onEdgeContextMenu:_e,onEdgeMouseEnter:we,onEdgeMouseMove:W,onEdgeMouseLeave:ae,reconnectRadius:xe,defaultMarkerColor:$,noPanClassName:qt,disableKeyboardA11y:Ge,rfId:We}),F.jsx(gF,{style:x,type:C,component:v,containerStyle:b}),F.jsx("div",{className:"react-flow__edgelabel-renderer"}),F.jsx(UV,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:o,onNodeMouseEnter:u,onNodeMouseMove:h,onNodeMouseLeave:f,onNodeContextMenu:p,nodeClickDistance:ve,onlyRenderVisibleElements:k,noPanClassName:qt,noDragClassName:It,disableKeyboardA11y:Ge,nodeExtent:Oe,rfId:We}),F.jsx("div",{className:"react-flow__viewport-portal"})]})})}Gk.displayName="GraphView";const bF=re.memo(Gk),BA=({nodes:e,edges:n,defaultNodes:r,defaultEdges:s,width:a,height:o,fitView:l,fitViewOptions:u,minZoom:h=.5,maxZoom:f=2,nodeOrigin:p,nodeExtent:d,zIndexMode:g="basic"}={})=>{const y=new Map,C=new Map,x=new Map,v=new Map,b=s??n??[],w=r??e??[],E=p??[0,0],q=d??Fu;ok(x,v,b);const A=iE(w,y,C,{nodeOrigin:E,nodeExtent:q,zIndexMode:g});let R=[0,0,1];if(l&&a&&o){const O=pl(y,{filter:j=>!!((j.width||j.initialWidth)&&(j.height||j.initialHeight))}),{x:I,y:k,zoom:N}=NE(O,a,o,h,f,(u==null?void 0:u.padding)??.1);R=[I,k,N]}return{rfId:"1",width:a??0,height:o??0,transform:R,nodes:w,nodesInitialized:A,nodeLookup:y,parentLookup:C,edges:b,edgeLookup:v,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:r!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:h,maxZoom:f,translateExtent:Fu,nodeExtent:q,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:mo.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:E,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:l??!1,fitViewOptions:u,fitViewResolver:null,connection:{...QD},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:M5,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:UD,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},_F=({nodes:e,edges:n,defaultNodes:r,defaultEdges:s,width:a,height:o,fitView:l,fitViewOptions:u,minZoom:h,maxZoom:f,nodeOrigin:p,nodeExtent:d,zIndexMode:g})=>k8((y,C)=>{async function x(){const{nodeLookup:v,panZoom:b,fitViewOptions:w,fitViewResolver:E,width:q,height:A,minZoom:R,maxZoom:O}=C();b&&(await R5({nodes:v,width:q,height:A,panZoom:b,minZoom:R,maxZoom:O},w),E==null||E.resolve(!0),y({fitViewResolver:null}))}return{...BA({nodes:e,edges:n,width:a,height:o,fitView:l,fitViewOptions:u,minZoom:h,maxZoom:f,nodeOrigin:p,nodeExtent:d,defaultNodes:r,defaultEdges:s,zIndexMode:g}),setNodes:v=>{const{nodeLookup:b,parentLookup:w,nodeOrigin:E,elevateNodesOnSelect:q,fitViewQueued:A,zIndexMode:R}=C(),O=iE(v,b,w,{nodeOrigin:E,nodeExtent:d,elevateNodesOnSelect:q,checkEquality:!0,zIndexMode:R});A&&O?(x(),y({nodes:v,nodesInitialized:O,fitViewQueued:!1,fitViewOptions:void 0})):y({nodes:v,nodesInitialized:O})},setEdges:v=>{const{connectionLookup:b,edgeLookup:w}=C();ok(b,w,v),y({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:w}=C();w(v),y({hasDefaultNodes:!0})}if(b){const{setEdges:w}=C();w(b),y({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:w,parentLookup:E,domNode:q,nodeOrigin:A,nodeExtent:R,debug:O,fitViewQueued:I,zIndexMode:k}=C(),{changes:N,updatedInternals:j}=e8(v,w,E,q,A,R,k);j&&(X5(w,E,{nodeOrigin:A,nodeExtent:R,zIndexMode:k}),I?(x(),y({fitViewQueued:!1,fitViewOptions:void 0})):y({}),(N==null?void 0:N.length)>0&&(O&&console.log("React Flow: trigger node changes",N),b==null||b(N)))},updateNodePositions:(v,b=!1)=>{const w=[];let E=[];const{nodeLookup:q,triggerNodeChanges:A,connection:R,updateConnection:O,onNodesChangeMiddlewareMap:I}=C();for(const[k,N]of v){const j=q.get(k),D=!!(j!=null&&j.expandParent&&(j!=null&&j.parentId)&&(N!=null&&N.position)),z={id:k,type:"position",position:D?{x:Math.max(0,N.position.x),y:Math.max(0,N.position.y)}:N.position,dragging:b};if(j&&R.inProgress&&R.fromNode.id===j.id){const T=Ps(j,R.fromHandle,Ne.Left,!0);O({...R,from:T})}D&&j.parentId&&w.push({id:k,parentId:j.parentId,rect:{...N.internals.positionAbsolute,width:N.measured.width??0,height:N.measured.height??0}}),E.push(z)}if(w.length>0){const{parentLookup:k,nodeOrigin:N}=C(),j=LE(w,q,k,N);E.push(...j)}for(const k of I.values())E=k(E);A(E)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:w,nodes:E,hasDefaultNodes:q,debug:A}=C();if(v!=null&&v.length){if(q){const R=Ck(v,E);w(R)}A&&console.log("React Flow: trigger node changes",v),b==null||b(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:w,edges:E,hasDefaultEdges:q,debug:A}=C();if(v!=null&&v.length){if(q){const R=Ek(v,E);w(R)}A&&console.log("React Flow: trigger edge changes",v),b==null||b(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:E,triggerNodeChanges:q,triggerEdgeChanges:A}=C();if(b){const R=v.map(O=>ws(O,!0));q(R);return}q(Ka(E,new Set([...v]),!0)),A(Ka(w))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:E,triggerNodeChanges:q,triggerEdgeChanges:A}=C();if(b){const R=v.map(O=>ws(O,!0));A(R);return}A(Ka(w,new Set([...v]))),q(Ka(E,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:w,nodes:E,nodeLookup:q,triggerNodeChanges:A,triggerEdgeChanges:R}=C(),O=v||E,I=b||w,k=O.map(j=>{const D=q.get(j.id);return D&&(D.selected=!1),ws(j.id,!1)}),N=I.map(j=>ws(j.id,!1));A(k),R(N)},setMinZoom:v=>{const{panZoom:b,maxZoom:w}=C();b==null||b.setScaleExtent([v,w]),y({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:w}=C();b==null||b.setScaleExtent([w,v]),y({maxZoom:v})},setTranslateExtent:v=>{var b;(b=C().panZoom)==null||b.setTranslateExtent(v),y({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:w,triggerEdgeChanges:E,elementsSelectable:q}=C();if(!q)return;const A=b.reduce((O,I)=>I.selected?[...O,ws(I.id,!1)]:O,[]),R=v.reduce((O,I)=>I.selected?[...O,ws(I.id,!1)]:O,[]);w(A),E(R)},setNodeExtent:v=>{const{nodes:b,nodeLookup:w,parentLookup:E,nodeOrigin:q,elevateNodesOnSelect:A,nodeExtent:R,zIndexMode:O}=C();v[0][0]===R[0][0]&&v[0][1]===R[0][1]&&v[1][0]===R[1][0]&&v[1][1]===R[1][1]||(iE(b,w,E,{nodeOrigin:q,nodeExtent:v,elevateNodesOnSelect:A,checkEquality:!1,zIndexMode:O}),y({nodeExtent:v}))},panBy:v=>{const{transform:b,width:w,height:E,panZoom:q,translateExtent:A}=C();return t8({delta:v,panZoom:q,transform:b,translateExtent:A,width:w,height:E})},setCenter:async(v,b,w)=>{const{width:E,height:q,maxZoom:A,panZoom:R}=C();if(!R)return Promise.resolve(!1);const O=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:A;return await R.setViewport({x:E/2-v*O,y:q/2-b*O,zoom:O},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{y({connection:{...QD}})},updateConnection:v=>{y({connection:v})},reset:()=>y({...BA()})}},Object.is);function wF({initialNodes:e,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:a,initialHeight:o,initialMinZoom:l,initialMaxZoom:u,initialFitViewOptions:h,fitView:f,nodeOrigin:p,nodeExtent:d,zIndexMode:g,children:y}){const[C]=re.useState(()=>_F({nodes:e,edges:n,defaultNodes:r,defaultEdges:s,width:a,height:o,fitView:f,minZoom:l,maxZoom:u,fitViewOptions:h,nodeOrigin:p,nodeExtent:d,zIndexMode:g}));return F.jsx(B8,{value:C,children:F.jsx(uV,{children:y})})}function CF({children:e,nodes:n,edges:r,defaultNodes:s,defaultEdges:a,width:o,height:l,fitView:u,fitViewOptions:h,minZoom:f,maxZoom:p,nodeOrigin:d,nodeExtent:g,zIndexMode:y}){return re.useContext(ih)?F.jsx(F.Fragment,{children:e}):F.jsx(wF,{initialNodes:n,initialEdges:r,defaultNodes:s,defaultEdges:a,initialWidth:o,initialHeight:l,fitView:u,initialFitViewOptions:h,initialMinZoom:f,initialMaxZoom:p,nodeOrigin:d,nodeExtent:g,zIndexMode:y,children:e})}const EF={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function xF({nodes:e,edges:n,defaultNodes:r,defaultEdges:s,className:a,nodeTypes:o,edgeTypes:l,onNodeClick:u,onEdgeClick:h,onInit:f,onMove:p,onMoveStart:d,onMoveEnd:g,onConnect:y,onConnectStart:C,onConnectEnd:x,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:w,onNodeMouseMove:E,onNodeMouseLeave:q,onNodeContextMenu:A,onNodeDoubleClick:R,onNodeDragStart:O,onNodeDrag:I,onNodeDragStop:k,onNodesDelete:N,onEdgesDelete:j,onDelete:D,onSelectionChange:z,onSelectionDragStart:T,onSelectionDrag:M,onSelectionDragStop:$,onSelectionContextMenu:P,onSelectionStart:H,onSelectionEnd:G,onBeforeDelete:V,connectionMode:B,connectionLineType:K=Li.Bezier,connectionLineStyle:te,connectionLineComponent:Q,connectionLineContainerStyle:J,deleteKeyCode:ie="Backspace",selectionKeyCode:oe="Shift",selectionOnDrag:ee=!1,selectionMode:fe=Gu.Full,panActivationKeyCode:be="Space",multiSelectionKeyCode:ve=Yu()?"Meta":"Control",zoomActivationKeyCode:_e=Yu()?"Meta":"Control",snapToGrid:we,snapGrid:W,onlyRenderVisibleElements:ae=!1,selectNodesOnDrag:xe,nodesDraggable:Se,autoPanOnNodeFocus:gt,nodesConnectable:ut,nodesFocusable:It,nodeOrigin:Tt=_k,edgesFocusable:qt,edgesReconnectable:Ge,elementsSelectable:Oe=!0,defaultViewport:We=J8,minZoom:Je=.5,maxZoom:rt=2,translateExtent:de=Fu,preventScrolling:X=!0,nodeExtent:Me,defaultMarkerColor:Oo="#b1b1b7",zoomOnScroll:ia=!0,zoomOnPinch:Ft=!0,panOnScroll:yt=!1,panOnScrollSpeed:ar=.5,panOnScrollMode:Wt=$s.Free,zoomOnDoubleClick:Rh=!0,panOnDrag:Oh=!0,onPaneClick:Mh,onPaneMouseEnter:sa,onPaneMouseMove:aa,onPaneMouseLeave:oa,onPaneScroll:Er,onPaneContextMenu:ua,paneClickDistance:Zi=1,nodeClickDistance:jh=0,children:ql,onReconnect:Mo,onReconnectStart:es,onReconnectEnd:$h,onEdgeContextMenu:Al,onEdgeDoubleClick:Nl,onEdgeMouseEnter:Rl,onEdgeMouseMove:jo,onEdgeMouseLeave:$o,reconnectRadius:Ol=10,onNodesChange:Ml,onEdgesChange:or,noDragClassName:$t="nodrag",noWheelClassName:Gt="nowheel",noPanClassName:xr="nopan",fitView:la,fitViewOptions:jl,connectOnClick:Lh,attributionPosition:$l,proOptions:ts,defaultEdgeOptions:Lo,elevateNodesOnSelect:ri=!0,elevateEdgesOnSelect:ii=!1,disableKeyboardA11y:si=!1,autoPanOnConnect:ai,autoPanOnNodeDrag:At,autoPanSpeed:Ll,connectionRadius:Il,isValidConnection:Sr,onError:oi,style:Ih,id:Io,nodeDragThreshold:Dl,connectionDragThreshold:Dh,viewport:ca,onViewportChange:fa,width:zn,height:nn,colorMode:kl="light",debug:kh,onScroll:ui,ariaLabelConfig:Bl,zIndexMode:ns="basic",...Bh},rn){const rs=Io||"1",Pl=nV(kl),Do=re.useCallback(Tr=>{Tr.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ui==null||ui(Tr)},[ui]);return F.jsx("div",{"data-testid":"rf__wrapper",...Bh,onScroll:Do,style:{...Ih,...EF},ref:rn,className:jt(["react-flow",a,Pl]),id:Io,role:"application",children:F.jsxs(CF,{nodes:e,edges:n,width:zn,height:nn,fitView:la,fitViewOptions:jl,minZoom:Je,maxZoom:rt,nodeOrigin:Tt,nodeExtent:Me,zIndexMode:ns,children:[F.jsx(bF,{onInit:f,onNodeClick:u,onEdgeClick:h,onNodeMouseEnter:w,onNodeMouseMove:E,onNodeMouseLeave:q,onNodeContextMenu:A,onNodeDoubleClick:R,nodeTypes:o,edgeTypes:l,connectionLineType:K,connectionLineStyle:te,connectionLineComponent:Q,connectionLineContainerStyle:J,selectionKeyCode:oe,selectionOnDrag:ee,selectionMode:fe,deleteKeyCode:ie,multiSelectionKeyCode:ve,panActivationKeyCode:be,zoomActivationKeyCode:_e,onlyRenderVisibleElements:ae,defaultViewport:We,translateExtent:de,minZoom:Je,maxZoom:rt,preventScrolling:X,zoomOnScroll:ia,zoomOnPinch:Ft,zoomOnDoubleClick:Rh,panOnScroll:yt,panOnScrollSpeed:ar,panOnScrollMode:Wt,panOnDrag:Oh,onPaneClick:Mh,onPaneMouseEnter:sa,onPaneMouseMove:aa,onPaneMouseLeave:oa,onPaneScroll:Er,onPaneContextMenu:ua,paneClickDistance:Zi,nodeClickDistance:jh,onSelectionContextMenu:P,onSelectionStart:H,onSelectionEnd:G,onReconnect:Mo,onReconnectStart:es,onReconnectEnd:$h,onEdgeContextMenu:Al,onEdgeDoubleClick:Nl,onEdgeMouseEnter:Rl,onEdgeMouseMove:jo,onEdgeMouseLeave:$o,reconnectRadius:Ol,defaultMarkerColor:Oo,noDragClassName:$t,noWheelClassName:Gt,noPanClassName:xr,rfId:rs,disableKeyboardA11y:si,nodeExtent:Me,viewport:ca,onViewportChange:fa}),F.jsx(tV,{nodes:e,edges:n,defaultNodes:r,defaultEdges:s,onConnect:y,onConnectStart:C,onConnectEnd:x,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:Se,autoPanOnNodeFocus:gt,nodesConnectable:ut,nodesFocusable:It,edgesFocusable:qt,edgesReconnectable:Ge,elementsSelectable:Oe,elevateNodesOnSelect:ri,elevateEdgesOnSelect:ii,minZoom:Je,maxZoom:rt,nodeExtent:Me,onNodesChange:Ml,onEdgesChange:or,snapToGrid:we,snapGrid:W,connectionMode:B,translateExtent:de,connectOnClick:Lh,defaultEdgeOptions:Lo,fitView:la,fitViewOptions:jl,onNodesDelete:N,onEdgesDelete:j,onDelete:D,onNodeDragStart:O,onNodeDrag:I,onNodeDragStop:k,onSelectionDrag:M,onSelectionDragStart:T,onSelectionDragStop:$,onMove:p,onMoveStart:d,onMoveEnd:g,noPanClassName:xr,nodeOrigin:Tt,rfId:rs,autoPanOnConnect:ai,autoPanOnNodeDrag:At,autoPanSpeed:Ll,onError:oi,connectionRadius:Il,isValidConnection:Sr,selectNodesOnDrag:xe,nodeDragThreshold:Dl,connectionDragThreshold:Dh,onBeforeDelete:V,debug:kh,ariaLabelConfig:Bl,zIndexMode:ns}),F.jsx(W8,{onSelectionChange:z}),ql,F.jsx(F8,{proOptions:ts,position:$l}),F.jsx(V8,{rfId:rs,disableKeyboardA11y:si})]})})}var SF=xk(xF);function TF(e){const[n,r]=re.useState(e),s=re.useCallback(a=>r(o=>Ck(a,o)),[]);return[n,r,s]}function qF(e){const[n,r]=re.useState(e),s=re.useCallback(a=>r(o=>Ek(a,o)),[]);return[n,r,s]}function AF({dimensions:e,lineWidth:n,variant:r,className:s}){return F.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:jt(["react-flow__background-pattern",r,s])})}function NF({radius:e,className:n}){return F.jsx("circle",{cx:e,cy:e,r:e,className:jt(["react-flow__background-pattern","dots",n])})}var Gi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Gi||(Gi={}));const RF={[Gi.Dots]:1,[Gi.Lines]:1,[Gi.Cross]:6},OF=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Kk({id:e,variant:n=Gi.Dots,gap:r=20,size:s,lineWidth:a=1,offset:o=0,color:l,bgColor:u,style:h,className:f,patternClassName:p}){const d=re.useRef(null),{transform:g,patternId:y}=Fe(OF,ht),C=s||RF[n],x=n===Gi.Dots,v=n===Gi.Cross,b=Array.isArray(r)?r:[r,r],w=[b[0]*g[2]||1,b[1]*g[2]||1],E=C*g[2],q=Array.isArray(o)?o:[o,o],A=v?[E,E]:w,R=[q[0]*g[2]||1+A[0]/2,q[1]*g[2]||1+A[1]/2],O=`${y}${e||""}`;return F.jsxs("svg",{className:jt(["react-flow__background",f]),style:{...h,...ah,"--xy-background-color-props":u,"--xy-background-pattern-color-props":l},ref:d,"data-testid":"rf__background",children:[F.jsx("pattern",{id:O,x:g[0]%w[0],y:g[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${R[0]},-${R[1]})`,children:x?F.jsx(NF,{radius:E/2,className:p}):F.jsx(AF,{dimensions:A,lineWidth:a,variant:n,className:p})}),F.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${O})`})]})}Kk.displayName="Background";const MF=re.memo(Kk);function jF(){return F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:F.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function $F(){return F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:F.jsx("path",{d:"M0 0h32v4.2H0z"})})}function LF(){return F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:F.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function IF(){return F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:F.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function DF(){return F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:F.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function ff({children:e,className:n,...r}){return F.jsx("button",{type:"button",className:jt(["react-flow__controls-button",n]),...r,children:e})}const kF=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Yk({style:e,showZoom:n=!0,showFitView:r=!0,showInteractive:s=!0,fitViewOptions:a,onZoomIn:o,onZoomOut:l,onFitView:u,onInteractiveChange:h,className:f,children:p,position:d="bottom-left",orientation:g="vertical","aria-label":y}){const C=dt(),{isInteractive:x,minZoomReached:v,maxZoomReached:b,ariaLabelConfig:w}=Fe(kF,ht),{zoomIn:E,zoomOut:q,fitView:A}=IE(),R=()=>{E(),o==null||o()},O=()=>{q(),l==null||l()},I=()=>{A(a),u==null||u()},k=()=>{C.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),h==null||h(!x)},N=g==="horizontal"?"horizontal":"vertical";return F.jsxs(sh,{className:jt(["react-flow__controls",N,f]),position:d,style:e,"data-testid":"rf__controls","aria-label":y??w["controls.ariaLabel"],children:[n&&F.jsxs(F.Fragment,{children:[F.jsx(ff,{onClick:R,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:b,children:F.jsx(jF,{})}),F.jsx(ff,{onClick:O,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:F.jsx($F,{})})]}),r&&F.jsx(ff,{className:"react-flow__controls-fitview",onClick:I,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:F.jsx(LF,{})}),s&&F.jsx(ff,{className:"react-flow__controls-interactive",onClick:k,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:x?F.jsx(DF,{}):F.jsx(IF,{})}),p]})}Yk.displayName="Controls";const BF=re.memo(Yk);function PF({id:e,x:n,y:r,width:s,height:a,style:o,color:l,strokeColor:u,strokeWidth:h,className:f,borderRadius:p,shapeRendering:d,selected:g,onClick:y}){const{background:C,backgroundColor:x}=o||{},v=l||C||x;return F.jsx("rect",{className:jt(["react-flow__minimap-node",{selected:g},f]),x:n,y:r,rx:p,ry:p,width:s,height:a,style:{fill:v,stroke:u,strokeWidth:h},shapeRendering:d,onClick:y?b=>y(b,e):void 0})}const zF=re.memo(PF),UF=e=>e.nodes.map(n=>n.id),dm=e=>e instanceof Function?e:()=>e;function QF({nodeStrokeColor:e,nodeColor:n,nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:a,nodeComponent:o=zF,onClick:l}){const u=Fe(UF,ht),h=dm(n),f=dm(e),p=dm(r),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return F.jsx(F.Fragment,{children:u.map(g=>F.jsx(VF,{id:g,nodeColorFunc:h,nodeStrokeColorFunc:f,nodeClassNameFunc:p,nodeBorderRadius:s,nodeStrokeWidth:a,NodeComponent:o,onClick:l,shapeRendering:d},g))})}function HF({id:e,nodeColorFunc:n,nodeStrokeColorFunc:r,nodeClassNameFunc:s,nodeBorderRadius:a,nodeStrokeWidth:o,shapeRendering:l,NodeComponent:u,onClick:h}){const{node:f,x:p,y:d,width:g,height:y}=Fe(C=>{const{internals:x}=C.nodeLookup.get(e),v=x.userNode,{x:b,y:w}=x.positionAbsolute,{width:E,height:q}=Zr(v);return{node:v,x:b,y:w,width:E,height:q}},ht);return!f||f.hidden||!XD(f)?null:F.jsx(u,{x:p,y:d,width:g,height:y,style:f.style,selected:!!f.selected,className:s(f),color:n(f),borderRadius:a,strokeColor:r(f),strokeWidth:o,shapeRendering:l,onClick:h,id:f.id})}const VF=re.memo(HF);var FF=re.memo(QF);const GF=200,KF=150,YF=e=>!e.hidden,XF=e=>{const n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:e.nodeLookup.size>0?YD(pl(e.nodeLookup,{filter:YF}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},WF="react-flow__minimap-desc";function Xk({style:e,className:n,nodeStrokeColor:r,nodeColor:s,nodeClassName:a="",nodeBorderRadius:o=5,nodeStrokeWidth:l,nodeComponent:u,bgColor:h,maskColor:f,maskStrokeColor:p,maskStrokeWidth:d,position:g="bottom-right",onClick:y,onNodeClick:C,pannable:x=!1,zoomable:v=!1,ariaLabel:b,inversePan:w,zoomStep:E=1,offsetScale:q=5}){const A=dt(),R=re.useRef(null),{boundingRect:O,viewBB:I,rfId:k,panZoom:N,translateExtent:j,flowWidth:D,flowHeight:z,ariaLabelConfig:T}=Fe(XF,ht),M=(e==null?void 0:e.width)??GF,$=(e==null?void 0:e.height)??KF,P=O.width/M,H=O.height/$,G=Math.max(P,H),V=G*M,B=G*$,K=q*G,te=O.x-(V-O.width)/2-K,Q=O.y-(B-O.height)/2-K,J=V+K*2,ie=B+K*2,oe=`${WF}-${k}`,ee=re.useRef(0),fe=re.useRef();ee.current=G,re.useEffect(()=>{if(R.current&&N)return fe.current=c8({domNode:R.current,panZoom:N,getTransform:()=>A.getState().transform,getViewScale:()=>ee.current}),()=>{var we;(we=fe.current)==null||we.destroy()}},[N]),re.useEffect(()=>{var we;(we=fe.current)==null||we.update({translateExtent:j,width:D,height:z,inversePan:w,pannable:x,zoomStep:E,zoomable:v})},[x,v,w,E,j,D,z]);const be=y?we=>{var xe;const[W,ae]=((xe=fe.current)==null?void 0:xe.pointer(we))||[0,0];y(we,{x:W,y:ae})}:void 0,ve=C?re.useCallback((we,W)=>{const ae=A.getState().nodeLookup.get(W).internals.userNode;C(we,ae)},[]):void 0,_e=b??T["minimap.ariaLabel"];return F.jsx(sh,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*G:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="number"?l:void 0},className:jt(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:F.jsxs("svg",{width:M,height:$,viewBox:`${te} ${Q} ${J} ${ie}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":oe,ref:R,onClick:be,children:[_e&&F.jsx("title",{id:oe,children:_e}),F.jsx(FF,{onClick:ve,nodeColor:s,nodeStrokeColor:r,nodeBorderRadius:o,nodeClassName:a,nodeStrokeWidth:l,nodeComponent:u}),F.jsx("path",{className:"react-flow__minimap-mask",d:`M${te-K},${Q-K}h${J+K*2}v${ie+K*2}h${-J-K*2}z
71
+ M${I.x},${I.y}h${I.width}v${I.height}h${-I.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Xk.displayName="MiniMap";re.memo(Xk);const JF=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,ZF={[zs.Line]:"right",[zs.Handle]:"bottom-right"};function eG({nodeId:e,position:n,variant:r=zs.Handle,className:s,style:a=void 0,children:o,color:l,minWidth:u=10,minHeight:h=10,maxWidth:f=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:g,autoScale:y=!0,shouldResize:C,onResizeStart:x,onResize:v,onResizeEnd:b}){const w=Ak(),E=typeof e=="string"?e:w,q=dt(),A=re.useRef(null),R=r===zs.Handle,O=Fe(re.useCallback(JF(R&&y),[R,y]),ht),I=re.useRef(null),k=n??ZF[r];re.useEffect(()=>{if(!(!A.current||!E))return I.current||(I.current=T8({domNode:A.current,nodeId:E,getStoreItems:()=>{const{nodeLookup:j,transform:D,snapGrid:z,snapToGrid:T,nodeOrigin:M,domNode:$}=q.getState();return{nodeLookup:j,transform:D,snapGrid:z,snapToGrid:T,nodeOrigin:M,paneDomNode:$}},onChange:(j,D)=>{const{triggerNodeChanges:z,nodeLookup:T,parentLookup:M,nodeOrigin:$}=q.getState(),P=[],H={x:j.x,y:j.y},G=T.get(E);if(G&&G.expandParent&&G.parentId){const V=G.origin??$,B=j.width??G.measured.width??0,K=j.height??G.measured.height??0,te={id:G.id,parentId:G.parentId,rect:{width:B,height:K,...WD({x:j.x??G.position.x,y:j.y??G.position.y},{width:B,height:K},G.parentId,T,V)}},Q=LE([te],T,M,$);P.push(...Q),H.x=j.x?Math.max(V[0]*B,j.x):void 0,H.y=j.y?Math.max(V[1]*K,j.y):void 0}if(H.x!==void 0&&H.y!==void 0){const V={id:E,type:"position",position:{...H}};P.push(V)}if(j.width!==void 0&&j.height!==void 0){const B={id:E,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:j.width,height:j.height}};P.push(B)}for(const V of D){const B={...V,type:"position"};P.push(B)}z(P)},onEnd:({width:j,height:D})=>{const z={id:E,type:"dimensions",resizing:!1,dimensions:{width:j,height:D}};q.getState().triggerNodeChanges([z])}})),I.current.update({controlPosition:k,boundaries:{minWidth:u,minHeight:h,maxWidth:f,maxHeight:p},keepAspectRatio:d,resizeDirection:g,onResizeStart:x,onResize:v,onResizeEnd:b,shouldResize:C}),()=>{var j;(j=I.current)==null||j.destroy()}},[k,u,h,f,p,d,x,v,b,C]);const N=k.split("-");return F.jsx("div",{className:jt(["react-flow__resize-control","nodrag",...N,r,s]),ref:A,style:{...a,scale:O,...l&&{[R?"backgroundColor":"borderColor"]:l}},children:o})}const PA=re.memo(eG);function tG({nodeId:e,isVisible:n=!0,handleClassName:r,handleStyle:s,lineClassName:a,lineStyle:o,color:l,minWidth:u=10,minHeight:h=10,maxWidth:f=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:d=!1,autoScale:g=!0,shouldResize:y,onResizeStart:C,onResize:x,onResizeEnd:v}){return n?F.jsxs(F.Fragment,{children:[_8.map(b=>F.jsx(PA,{className:a,style:o,nodeId:e,position:b,variant:zs.Line,color:l,minWidth:u,minHeight:h,maxWidth:f,maxHeight:p,onResizeStart:C,keepAspectRatio:d,autoScale:g,shouldResize:y,onResize:x,onResizeEnd:v},b)),b8.map(b=>F.jsx(PA,{className:r,style:s,nodeId:e,position:b,color:l,minWidth:u,minHeight:h,maxWidth:f,maxHeight:p,onResizeStart:C,keepAspectRatio:d,autoScale:g,shouldResize:y,onResize:x,onResizeEnd:v},b))]}):null}const nG=re.memo(function({data:n,selected:r}){const{table:s,visibleTableNames:a,columnChanges:o,removedColumns:l,collapsed:u,onToggleCollapse:h,nodeKey:f,headerColor:p}=n,d=re.useCallback(()=>{h&&f&&h(f)},[h,f]);return F.jsxs("div",{className:"table-node",children:[F.jsx(tG,{minWidth:220,minHeight:40,isVisible:r??!1,lineClassName:"table-node-resize-line",handleClassName:"table-node-resize-handle"}),F.jsx(br,{type:"target",position:Ne.Top}),F.jsxs("div",{className:"table-node-header",style:p?{background:p}:void 0,children:[F.jsx("span",{className:"table-node-header-toggle",onClick:d,children:u?"▶":"▼"}),F.jsx("span",{children:s.schema?`${s.schema}.${s.name}`:s.name})]}),u?F.jsxs("div",{className:"table-node-collapsed-summary",children:[s.columns.length," column",s.columns.length!==1?"s":""]}):F.jsxs("div",{className:"table-node-columns",children:[s.columns.map(g=>{const y=s.foreignKeys.find(v=>v.columnName===g.name),C=y?a.has(y.referencedTable):!1,x=o==null?void 0:o.get(g.name);return F.jsxs("div",{className:`table-node-column ${C?"fk-visible":""}`,children:[F.jsxs("span",{className:"col-indicators",children:[g.isPrimaryKey&&F.jsx("span",{className:"pk-badge",title:"Primary Key",children:"PK"}),y&&F.jsx("span",{className:"fk-badge",title:`FK → ${y.referencedTable}`,children:"FK"})]}),F.jsx("span",{className:"col-name",children:g.name}),F.jsx("span",{className:"col-type",children:g.dataType}),x==="added"&&F.jsx("span",{className:"diff-badge diff-badge-new",children:"NEW"}),x==="type-changed"&&F.jsx("span",{className:"diff-badge diff-badge-changed",children:"CHANGED"}),x==="nullability-changed"&&F.jsx("span",{className:"diff-badge diff-badge-changed",children:"CHANGED"})]},g.name)}),l==null?void 0:l.map(g=>F.jsxs("div",{className:"table-node-column diff-removed",children:[F.jsx("span",{className:"col-indicators"}),F.jsx("span",{className:"col-name diff-strikethrough",children:g.name}),F.jsx("span",{className:"col-type diff-strikethrough",children:g.dataType}),F.jsx("span",{className:"diff-badge diff-badge-removed",children:"REMOVED"})]},`removed-${g.name}`))]}),F.jsx(br,{type:"source",position:Ne.Bottom})]})}),rG=re.memo(function({data:n}){const{ghost:r,onExpand:s,blocked:a}=n;return F.jsxs("div",{className:`ghost-node ${a?"ghost-node-blocked":""}`,onClick:()=>!a&&s(r),children:[F.jsx(br,{type:"target",position:Ne.Top}),F.jsxs("div",{className:"ghost-node-name",children:[a&&F.jsx("span",{className:"ghost-node-lock",title:"Cross-schema expansion disabled",children:"🔒 "}),r.schema?`${r.schema}.${r.tableName}`:r.tableName]}),F.jsxs("div",{className:"ghost-node-count",children:[r.referencingEdges.length," reference",r.referencingEdges.length!==1?"s":""]}),F.jsx("div",{className:"ghost-node-hint",children:a?"Cross-schema expansion off":"Click to expand"}),F.jsx(br,{type:"source",position:Ne.Bottom})]})}),iG=re.memo(function({data:n}){const{tableName:r,schema:s,onAcknowledge:a}=n,o=s?`${s}.${r}`:r;return F.jsxs("div",{className:"deleted-table-node",children:[F.jsx(br,{type:"target",position:Ne.Top}),F.jsx("div",{className:"deleted-table-node-header",children:o}),F.jsxs("div",{className:"deleted-table-node-body",children:[F.jsx("p",{children:"Table removed from database"}),F.jsx("button",{className:"deleted-table-acknowledge",onClick:()=>a(r,s),children:"Acknowledge"})]}),F.jsx(br,{type:"source",position:Ne.Bottom})]})});function kE(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pm,zA;function sG(){if(zA)return pm;zA=1;function e(){this.__data__=[],this.size=0}return pm=e,pm}var mm,UA;function _o(){if(UA)return mm;UA=1;function e(n,r){return n===r||n!==n&&r!==r}return mm=e,mm}var gm,QA;function uh(){if(QA)return gm;QA=1;var e=_o();function n(r,s){for(var a=r.length;a--;)if(e(r[a][0],s))return a;return-1}return gm=n,gm}var ym,HA;function aG(){if(HA)return ym;HA=1;var e=uh(),n=Array.prototype,r=n.splice;function s(a){var o=this.__data__,l=e(o,a);if(l<0)return!1;var u=o.length-1;return l==u?o.pop():r.call(o,l,1),--this.size,!0}return ym=s,ym}var vm,VA;function oG(){if(VA)return vm;VA=1;var e=uh();function n(r){var s=this.__data__,a=e(s,r);return a<0?void 0:s[a][1]}return vm=n,vm}var bm,FA;function uG(){if(FA)return bm;FA=1;var e=uh();function n(r){return e(this.__data__,r)>-1}return bm=n,bm}var _m,GA;function lG(){if(GA)return _m;GA=1;var e=uh();function n(r,s){var a=this.__data__,o=e(a,r);return o<0?(++this.size,a.push([r,s])):a[o][1]=s,this}return _m=n,_m}var wm,KA;function lh(){if(KA)return wm;KA=1;var e=sG(),n=aG(),r=oG(),s=uG(),a=lG();function o(l){var u=-1,h=l==null?0:l.length;for(this.clear();++u<h;){var f=l[u];this.set(f[0],f[1])}}return o.prototype.clear=e,o.prototype.delete=n,o.prototype.get=r,o.prototype.has=s,o.prototype.set=a,wm=o,wm}var Cm,YA;function cG(){if(YA)return Cm;YA=1;var e=lh();function n(){this.__data__=new e,this.size=0}return Cm=n,Cm}var Em,XA;function fG(){if(XA)return Em;XA=1;function e(n){var r=this.__data__,s=r.delete(n);return this.size=r.size,s}return Em=e,Em}var xm,WA;function hG(){if(WA)return xm;WA=1;function e(n){return this.__data__.get(n)}return xm=e,xm}var Sm,JA;function dG(){if(JA)return Sm;JA=1;function e(n){return this.__data__.has(n)}return Sm=e,Sm}var Tm,ZA;function Wk(){if(ZA)return Tm;ZA=1;var e=typeof Wc=="object"&&Wc&&Wc.Object===Object&&Wc;return Tm=e,Tm}var qm,eN;function ir(){if(eN)return qm;eN=1;var e=Wk(),n=typeof self=="object"&&self&&self.Object===Object&&self,r=e||n||Function("return this")();return qm=r,qm}var Am,tN;function Fs(){if(tN)return Am;tN=1;var e=ir(),n=e.Symbol;return Am=n,Am}var Nm,nN;function pG(){if(nN)return Nm;nN=1;var e=Fs(),n=Object.prototype,r=n.hasOwnProperty,s=n.toString,a=e?e.toStringTag:void 0;function o(l){var u=r.call(l,a),h=l[a];try{l[a]=void 0;var f=!0}catch{}var p=s.call(l);return f&&(u?l[a]=h:delete l[a]),p}return Nm=o,Nm}var Rm,rN;function mG(){if(rN)return Rm;rN=1;var e=Object.prototype,n=e.toString;function r(s){return n.call(s)}return Rm=r,Rm}var Om,iN;function Gs(){if(iN)return Om;iN=1;var e=Fs(),n=pG(),r=mG(),s="[object Null]",a="[object Undefined]",o=e?e.toStringTag:void 0;function l(u){return u==null?u===void 0?a:s:o&&o in Object(u)?n(u):r(u)}return Om=l,Om}var Mm,sN;function Bn(){if(sN)return Mm;sN=1;function e(n){var r=typeof n;return n!=null&&(r=="object"||r=="function")}return Mm=e,Mm}var jm,aN;function yl(){if(aN)return jm;aN=1;var e=Gs(),n=Bn(),r="[object AsyncFunction]",s="[object Function]",a="[object GeneratorFunction]",o="[object Proxy]";function l(u){if(!n(u))return!1;var h=e(u);return h==s||h==a||h==r||h==o}return jm=l,jm}var $m,oN;function gG(){if(oN)return $m;oN=1;var e=ir(),n=e["__core-js_shared__"];return $m=n,$m}var Lm,uN;function yG(){if(uN)return Lm;uN=1;var e=gG(),n=(function(){var s=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""})();function r(s){return!!n&&n in s}return Lm=r,Lm}var Im,lN;function Jk(){if(lN)return Im;lN=1;var e=Function.prototype,n=e.toString;function r(s){if(s!=null){try{return n.call(s)}catch{}try{return s+""}catch{}}return""}return Im=r,Im}var Dm,cN;function vG(){if(cN)return Dm;cN=1;var e=yl(),n=yG(),r=Bn(),s=Jk(),a=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,h=l.toString,f=u.hasOwnProperty,p=RegExp("^"+h.call(f).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(g){if(!r(g)||n(g))return!1;var y=e(g)?p:o;return y.test(s(g))}return Dm=d,Dm}var km,fN;function bG(){if(fN)return km;fN=1;function e(n,r){return n==null?void 0:n[r]}return km=e,km}var Bm,hN;function Ks(){if(hN)return Bm;hN=1;var e=vG(),n=bG();function r(s,a){var o=n(s,a);return e(o)?o:void 0}return Bm=r,Bm}var Pm,dN;function BE(){if(dN)return Pm;dN=1;var e=Ks(),n=ir(),r=e(n,"Map");return Pm=r,Pm}var zm,pN;function ch(){if(pN)return zm;pN=1;var e=Ks(),n=e(Object,"create");return zm=n,zm}var Um,mN;function _G(){if(mN)return Um;mN=1;var e=ch();function n(){this.__data__=e?e(null):{},this.size=0}return Um=n,Um}var Qm,gN;function wG(){if(gN)return Qm;gN=1;function e(n){var r=this.has(n)&&delete this.__data__[n];return this.size-=r?1:0,r}return Qm=e,Qm}var Hm,yN;function CG(){if(yN)return Hm;yN=1;var e=ch(),n="__lodash_hash_undefined__",r=Object.prototype,s=r.hasOwnProperty;function a(o){var l=this.__data__;if(e){var u=l[o];return u===n?void 0:u}return s.call(l,o)?l[o]:void 0}return Hm=a,Hm}var Vm,vN;function EG(){if(vN)return Vm;vN=1;var e=ch(),n=Object.prototype,r=n.hasOwnProperty;function s(a){var o=this.__data__;return e?o[a]!==void 0:r.call(o,a)}return Vm=s,Vm}var Fm,bN;function xG(){if(bN)return Fm;bN=1;var e=ch(),n="__lodash_hash_undefined__";function r(s,a){var o=this.__data__;return this.size+=this.has(s)?0:1,o[s]=e&&a===void 0?n:a,this}return Fm=r,Fm}var Gm,_N;function SG(){if(_N)return Gm;_N=1;var e=_G(),n=wG(),r=CG(),s=EG(),a=xG();function o(l){var u=-1,h=l==null?0:l.length;for(this.clear();++u<h;){var f=l[u];this.set(f[0],f[1])}}return o.prototype.clear=e,o.prototype.delete=n,o.prototype.get=r,o.prototype.has=s,o.prototype.set=a,Gm=o,Gm}var Km,wN;function TG(){if(wN)return Km;wN=1;var e=SG(),n=lh(),r=BE();function s(){this.size=0,this.__data__={hash:new e,map:new(r||n),string:new e}}return Km=s,Km}var Ym,CN;function qG(){if(CN)return Ym;CN=1;function e(n){var r=typeof n;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?n!=="__proto__":n===null}return Ym=e,Ym}var Xm,EN;function fh(){if(EN)return Xm;EN=1;var e=qG();function n(r,s){var a=r.__data__;return e(s)?a[typeof s=="string"?"string":"hash"]:a.map}return Xm=n,Xm}var Wm,xN;function AG(){if(xN)return Wm;xN=1;var e=fh();function n(r){var s=e(this,r).delete(r);return this.size-=s?1:0,s}return Wm=n,Wm}var Jm,SN;function NG(){if(SN)return Jm;SN=1;var e=fh();function n(r){return e(this,r).get(r)}return Jm=n,Jm}var Zm,TN;function RG(){if(TN)return Zm;TN=1;var e=fh();function n(r){return e(this,r).has(r)}return Zm=n,Zm}var eg,qN;function OG(){if(qN)return eg;qN=1;var e=fh();function n(r,s){var a=e(this,r),o=a.size;return a.set(r,s),this.size+=a.size==o?0:1,this}return eg=n,eg}var tg,AN;function PE(){if(AN)return tg;AN=1;var e=TG(),n=AG(),r=NG(),s=RG(),a=OG();function o(l){var u=-1,h=l==null?0:l.length;for(this.clear();++u<h;){var f=l[u];this.set(f[0],f[1])}}return o.prototype.clear=e,o.prototype.delete=n,o.prototype.get=r,o.prototype.has=s,o.prototype.set=a,tg=o,tg}var ng,NN;function MG(){if(NN)return ng;NN=1;var e=lh(),n=BE(),r=PE(),s=200;function a(o,l){var u=this.__data__;if(u instanceof e){var h=u.__data__;if(!n||h.length<s-1)return h.push([o,l]),this.size=++u.size,this;u=this.__data__=new r(h)}return u.set(o,l),this.size=u.size,this}return ng=a,ng}var rg,RN;function hh(){if(RN)return rg;RN=1;var e=lh(),n=cG(),r=fG(),s=hG(),a=dG(),o=MG();function l(u){var h=this.__data__=new e(u);this.size=h.size}return l.prototype.clear=n,l.prototype.delete=r,l.prototype.get=s,l.prototype.has=a,l.prototype.set=o,rg=l,rg}var ig,ON;function zE(){if(ON)return ig;ON=1;function e(n,r){for(var s=-1,a=n==null?0:n.length;++s<a&&r(n[s],s,n)!==!1;);return n}return ig=e,ig}var sg,MN;function Zk(){if(MN)return sg;MN=1;var e=Ks(),n=(function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}})();return sg=n,sg}var ag,jN;function vl(){if(jN)return ag;jN=1;var e=Zk();function n(r,s,a){s=="__proto__"&&e?e(r,s,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[s]=a}return ag=n,ag}var og,$N;function bl(){if($N)return og;$N=1;var e=vl(),n=_o(),r=Object.prototype,s=r.hasOwnProperty;function a(o,l,u){var h=o[l];(!(s.call(o,l)&&n(h,u))||u===void 0&&!(l in o))&&e(o,l,u)}return og=a,og}var ug,LN;function Ys(){if(LN)return ug;LN=1;var e=bl(),n=vl();function r(s,a,o,l){var u=!o;o||(o={});for(var h=-1,f=a.length;++h<f;){var p=a[h],d=l?l(o[p],s[p],p,o,s):void 0;d===void 0&&(d=s[p]),u?n(o,p,d):e(o,p,d)}return o}return ug=r,ug}var lg,IN;function jG(){if(IN)return lg;IN=1;function e(n,r){for(var s=-1,a=Array(n);++s<n;)a[s]=r(s);return a}return lg=e,lg}var cg,DN;function Cr(){if(DN)return cg;DN=1;function e(n){return n!=null&&typeof n=="object"}return cg=e,cg}var fg,kN;function $G(){if(kN)return fg;kN=1;var e=Gs(),n=Cr(),r="[object Arguments]";function s(a){return n(a)&&e(a)==r}return fg=s,fg}var hg,BN;function _l(){if(BN)return hg;BN=1;var e=$G(),n=Cr(),r=Object.prototype,s=r.hasOwnProperty,a=r.propertyIsEnumerable,o=e((function(){return arguments})())?e:function(l){return n(l)&&s.call(l,"callee")&&!a.call(l,"callee")};return hg=o,hg}var dg,PN;function vt(){if(PN)return dg;PN=1;var e=Array.isArray;return dg=e,dg}var $u={exports:{}},pg,zN;function LG(){if(zN)return pg;zN=1;function e(){return!1}return pg=e,pg}$u.exports;var UN;function wo(){return UN||(UN=1,(function(e,n){var r=ir(),s=LG(),a=n&&!n.nodeType&&n,o=a&&!0&&e&&!e.nodeType&&e,l=o&&o.exports===a,u=l?r.Buffer:void 0,h=u?u.isBuffer:void 0,f=h||s;e.exports=f})($u,$u.exports)),$u.exports}var mg,QN;function dh(){if(QN)return mg;QN=1;var e=9007199254740991,n=/^(?:0|[1-9]\d*)$/;function r(s,a){var o=typeof s;return a=a??e,!!a&&(o=="number"||o!="symbol"&&n.test(s))&&s>-1&&s%1==0&&s<a}return mg=r,mg}var gg,HN;function UE(){if(HN)return gg;HN=1;var e=9007199254740991;function n(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=e}return gg=n,gg}var yg,VN;function IG(){if(VN)return yg;VN=1;var e=Gs(),n=UE(),r=Cr(),s="[object Arguments]",a="[object Array]",o="[object Boolean]",l="[object Date]",u="[object Error]",h="[object Function]",f="[object Map]",p="[object Number]",d="[object Object]",g="[object RegExp]",y="[object Set]",C="[object String]",x="[object WeakMap]",v="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",E="[object Float64Array]",q="[object Int8Array]",A="[object Int16Array]",R="[object Int32Array]",O="[object Uint8Array]",I="[object Uint8ClampedArray]",k="[object Uint16Array]",N="[object Uint32Array]",j={};j[w]=j[E]=j[q]=j[A]=j[R]=j[O]=j[I]=j[k]=j[N]=!0,j[s]=j[a]=j[v]=j[o]=j[b]=j[l]=j[u]=j[h]=j[f]=j[p]=j[d]=j[g]=j[y]=j[C]=j[x]=!1;function D(z){return r(z)&&n(z.length)&&!!j[e(z)]}return yg=D,yg}var vg,FN;function ph(){if(FN)return vg;FN=1;function e(n){return function(r){return n(r)}}return vg=e,vg}var Lu={exports:{}};Lu.exports;var GN;function QE(){return GN||(GN=1,(function(e,n){var r=Wk(),s=n&&!n.nodeType&&n,a=s&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===s,l=o&&r.process,u=(function(){try{var h=a&&a.require&&a.require("util").types;return h||l&&l.binding&&l.binding("util")}catch{}})();e.exports=u})(Lu,Lu.exports)),Lu.exports}var bg,KN;function Co(){if(KN)return bg;KN=1;var e=IG(),n=ph(),r=QE(),s=r&&r.isTypedArray,a=s?n(s):e;return bg=a,bg}var _g,YN;function eB(){if(YN)return _g;YN=1;var e=jG(),n=_l(),r=vt(),s=wo(),a=dh(),o=Co(),l=Object.prototype,u=l.hasOwnProperty;function h(f,p){var d=r(f),g=!d&&n(f),y=!d&&!g&&s(f),C=!d&&!g&&!y&&o(f),x=d||g||y||C,v=x?e(f.length,String):[],b=v.length;for(var w in f)(p||u.call(f,w))&&!(x&&(w=="length"||y&&(w=="offset"||w=="parent")||C&&(w=="buffer"||w=="byteLength"||w=="byteOffset")||a(w,b)))&&v.push(w);return v}return _g=h,_g}var wg,XN;function wl(){if(XN)return wg;XN=1;var e=Object.prototype;function n(r){var s=r&&r.constructor,a=typeof s=="function"&&s.prototype||e;return r===a}return wg=n,wg}var Cg,WN;function tB(){if(WN)return Cg;WN=1;function e(n,r){return function(s){return n(r(s))}}return Cg=e,Cg}var Eg,JN;function DG(){if(JN)return Eg;JN=1;var e=tB(),n=e(Object.keys,Object);return Eg=n,Eg}var xg,ZN;function HE(){if(ZN)return xg;ZN=1;var e=wl(),n=DG(),r=Object.prototype,s=r.hasOwnProperty;function a(o){if(!e(o))return n(o);var l=[];for(var u in Object(o))s.call(o,u)&&u!="constructor"&&l.push(u);return l}return xg=a,xg}var Sg,eR;function sr(){if(eR)return Sg;eR=1;var e=yl(),n=UE();function r(s){return s!=null&&n(s.length)&&!e(s)}return Sg=r,Sg}var Tg,tR;function ei(){if(tR)return Tg;tR=1;var e=eB(),n=HE(),r=sr();function s(a){return r(a)?e(a):n(a)}return Tg=s,Tg}var qg,nR;function kG(){if(nR)return qg;nR=1;var e=Ys(),n=ei();function r(s,a){return s&&e(a,n(a),s)}return qg=r,qg}var Ag,rR;function BG(){if(rR)return Ag;rR=1;function e(n){var r=[];if(n!=null)for(var s in Object(n))r.push(s);return r}return Ag=e,Ag}var Ng,iR;function PG(){if(iR)return Ng;iR=1;var e=Bn(),n=wl(),r=BG(),s=Object.prototype,a=s.hasOwnProperty;function o(l){if(!e(l))return r(l);var u=n(l),h=[];for(var f in l)f=="constructor"&&(u||!a.call(l,f))||h.push(f);return h}return Ng=o,Ng}var Rg,sR;function Xi(){if(sR)return Rg;sR=1;var e=eB(),n=PG(),r=sr();function s(a){return r(a)?e(a,!0):n(a)}return Rg=s,Rg}var Og,aR;function zG(){if(aR)return Og;aR=1;var e=Ys(),n=Xi();function r(s,a){return s&&e(a,n(a),s)}return Og=r,Og}var Iu={exports:{}};Iu.exports;var oR;function nB(){return oR||(oR=1,(function(e,n){var r=ir(),s=n&&!n.nodeType&&n,a=s&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===s,l=o?r.Buffer:void 0,u=l?l.allocUnsafe:void 0;function h(f,p){if(p)return f.slice();var d=f.length,g=u?u(d):new f.constructor(d);return f.copy(g),g}e.exports=h})(Iu,Iu.exports)),Iu.exports}var Mg,uR;function VE(){if(uR)return Mg;uR=1;function e(n,r){var s=-1,a=n.length;for(r||(r=Array(a));++s<a;)r[s]=n[s];return r}return Mg=e,Mg}var jg,lR;function FE(){if(lR)return jg;lR=1;function e(n,r){for(var s=-1,a=n==null?0:n.length,o=0,l=[];++s<a;){var u=n[s];r(u,s,n)&&(l[o++]=u)}return l}return jg=e,jg}var $g,cR;function rB(){if(cR)return $g;cR=1;function e(){return[]}return $g=e,$g}var Lg,fR;function GE(){if(fR)return Lg;fR=1;var e=FE(),n=rB(),r=Object.prototype,s=r.propertyIsEnumerable,a=Object.getOwnPropertySymbols,o=a?function(l){return l==null?[]:(l=Object(l),e(a(l),function(u){return s.call(l,u)}))}:n;return Lg=o,Lg}var Ig,hR;function UG(){if(hR)return Ig;hR=1;var e=Ys(),n=GE();function r(s,a){return e(s,n(s),a)}return Ig=r,Ig}var Dg,dR;function KE(){if(dR)return Dg;dR=1;function e(n,r){for(var s=-1,a=r.length,o=n.length;++s<a;)n[o+s]=r[s];return n}return Dg=e,Dg}var kg,pR;function mh(){if(pR)return kg;pR=1;var e=tB(),n=e(Object.getPrototypeOf,Object);return kg=n,kg}var Bg,mR;function iB(){if(mR)return Bg;mR=1;var e=KE(),n=mh(),r=GE(),s=rB(),a=Object.getOwnPropertySymbols,o=a?function(l){for(var u=[];l;)e(u,r(l)),l=n(l);return u}:s;return Bg=o,Bg}var Pg,gR;function QG(){if(gR)return Pg;gR=1;var e=Ys(),n=iB();function r(s,a){return e(s,n(s),a)}return Pg=r,Pg}var zg,yR;function sB(){if(yR)return zg;yR=1;var e=KE(),n=vt();function r(s,a,o){var l=a(s);return n(s)?l:e(l,o(s))}return zg=r,zg}var Ug,vR;function aB(){if(vR)return Ug;vR=1;var e=sB(),n=GE(),r=ei();function s(a){return e(a,r,n)}return Ug=s,Ug}var Qg,bR;function oB(){if(bR)return Qg;bR=1;var e=sB(),n=iB(),r=Xi();function s(a){return e(a,r,n)}return Qg=s,Qg}var Hg,_R;function HG(){if(_R)return Hg;_R=1;var e=Ks(),n=ir(),r=e(n,"DataView");return Hg=r,Hg}var Vg,wR;function VG(){if(wR)return Vg;wR=1;var e=Ks(),n=ir(),r=e(n,"Promise");return Vg=r,Vg}var Fg,CR;function uB(){if(CR)return Fg;CR=1;var e=Ks(),n=ir(),r=e(n,"Set");return Fg=r,Fg}var Gg,ER;function FG(){if(ER)return Gg;ER=1;var e=Ks(),n=ir(),r=e(n,"WeakMap");return Gg=r,Gg}var Kg,xR;function Xs(){if(xR)return Kg;xR=1;var e=HG(),n=BE(),r=VG(),s=uB(),a=FG(),o=Gs(),l=Jk(),u="[object Map]",h="[object Object]",f="[object Promise]",p="[object Set]",d="[object WeakMap]",g="[object DataView]",y=l(e),C=l(n),x=l(r),v=l(s),b=l(a),w=o;return(e&&w(new e(new ArrayBuffer(1)))!=g||n&&w(new n)!=u||r&&w(r.resolve())!=f||s&&w(new s)!=p||a&&w(new a)!=d)&&(w=function(E){var q=o(E),A=q==h?E.constructor:void 0,R=A?l(A):"";if(R)switch(R){case y:return g;case C:return u;case x:return f;case v:return p;case b:return d}return q}),Kg=w,Kg}var Yg,SR;function GG(){if(SR)return Yg;SR=1;var e=Object.prototype,n=e.hasOwnProperty;function r(s){var a=s.length,o=new s.constructor(a);return a&&typeof s[0]=="string"&&n.call(s,"index")&&(o.index=s.index,o.input=s.input),o}return Yg=r,Yg}var Xg,TR;function lB(){if(TR)return Xg;TR=1;var e=ir(),n=e.Uint8Array;return Xg=n,Xg}var Wg,qR;function YE(){if(qR)return Wg;qR=1;var e=lB();function n(r){var s=new r.constructor(r.byteLength);return new e(s).set(new e(r)),s}return Wg=n,Wg}var Jg,AR;function KG(){if(AR)return Jg;AR=1;var e=YE();function n(r,s){var a=s?e(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.byteLength)}return Jg=n,Jg}var Zg,NR;function YG(){if(NR)return Zg;NR=1;var e=/\w*$/;function n(r){var s=new r.constructor(r.source,e.exec(r));return s.lastIndex=r.lastIndex,s}return Zg=n,Zg}var ey,RR;function XG(){if(RR)return ey;RR=1;var e=Fs(),n=e?e.prototype:void 0,r=n?n.valueOf:void 0;function s(a){return r?Object(r.call(a)):{}}return ey=s,ey}var ty,OR;function cB(){if(OR)return ty;OR=1;var e=YE();function n(r,s){var a=s?e(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.length)}return ty=n,ty}var ny,MR;function WG(){if(MR)return ny;MR=1;var e=YE(),n=KG(),r=YG(),s=XG(),a=cB(),o="[object Boolean]",l="[object Date]",u="[object Map]",h="[object Number]",f="[object RegExp]",p="[object Set]",d="[object String]",g="[object Symbol]",y="[object ArrayBuffer]",C="[object DataView]",x="[object Float32Array]",v="[object Float64Array]",b="[object Int8Array]",w="[object Int16Array]",E="[object Int32Array]",q="[object Uint8Array]",A="[object Uint8ClampedArray]",R="[object Uint16Array]",O="[object Uint32Array]";function I(k,N,j){var D=k.constructor;switch(N){case y:return e(k);case o:case l:return new D(+k);case C:return n(k,j);case x:case v:case b:case w:case E:case q:case A:case R:case O:return a(k,j);case u:return new D;case h:case d:return new D(k);case f:return r(k);case p:return new D;case g:return s(k)}}return ny=I,ny}var ry,jR;function fB(){if(jR)return ry;jR=1;var e=Bn(),n=Object.create,r=(function(){function s(){}return function(a){if(!e(a))return{};if(n)return n(a);s.prototype=a;var o=new s;return s.prototype=void 0,o}})();return ry=r,ry}var iy,$R;function hB(){if($R)return iy;$R=1;var e=fB(),n=mh(),r=wl();function s(a){return typeof a.constructor=="function"&&!r(a)?e(n(a)):{}}return iy=s,iy}var sy,LR;function JG(){if(LR)return sy;LR=1;var e=Xs(),n=Cr(),r="[object Map]";function s(a){return n(a)&&e(a)==r}return sy=s,sy}var ay,IR;function ZG(){if(IR)return ay;IR=1;var e=JG(),n=ph(),r=QE(),s=r&&r.isMap,a=s?n(s):e;return ay=a,ay}var oy,DR;function e9(){if(DR)return oy;DR=1;var e=Xs(),n=Cr(),r="[object Set]";function s(a){return n(a)&&e(a)==r}return oy=s,oy}var uy,kR;function t9(){if(kR)return uy;kR=1;var e=e9(),n=ph(),r=QE(),s=r&&r.isSet,a=s?n(s):e;return uy=a,uy}var ly,BR;function dB(){if(BR)return ly;BR=1;var e=hh(),n=zE(),r=bl(),s=kG(),a=zG(),o=nB(),l=VE(),u=UG(),h=QG(),f=aB(),p=oB(),d=Xs(),g=GG(),y=WG(),C=hB(),x=vt(),v=wo(),b=ZG(),w=Bn(),E=t9(),q=ei(),A=Xi(),R=1,O=2,I=4,k="[object Arguments]",N="[object Array]",j="[object Boolean]",D="[object Date]",z="[object Error]",T="[object Function]",M="[object GeneratorFunction]",$="[object Map]",P="[object Number]",H="[object Object]",G="[object RegExp]",V="[object Set]",B="[object String]",K="[object Symbol]",te="[object WeakMap]",Q="[object ArrayBuffer]",J="[object DataView]",ie="[object Float32Array]",oe="[object Float64Array]",ee="[object Int8Array]",fe="[object Int16Array]",be="[object Int32Array]",ve="[object Uint8Array]",_e="[object Uint8ClampedArray]",we="[object Uint16Array]",W="[object Uint32Array]",ae={};ae[k]=ae[N]=ae[Q]=ae[J]=ae[j]=ae[D]=ae[ie]=ae[oe]=ae[ee]=ae[fe]=ae[be]=ae[$]=ae[P]=ae[H]=ae[G]=ae[V]=ae[B]=ae[K]=ae[ve]=ae[_e]=ae[we]=ae[W]=!0,ae[z]=ae[T]=ae[te]=!1;function xe(Se,gt,ut,It,Tt,qt){var Ge,Oe=gt&R,We=gt&O,Je=gt&I;if(ut&&(Ge=Tt?ut(Se,It,Tt,qt):ut(Se)),Ge!==void 0)return Ge;if(!w(Se))return Se;var rt=x(Se);if(rt){if(Ge=g(Se),!Oe)return l(Se,Ge)}else{var de=d(Se),X=de==T||de==M;if(v(Se))return o(Se,Oe);if(de==H||de==k||X&&!Tt){if(Ge=We||X?{}:C(Se),!Oe)return We?h(Se,a(Ge,Se)):u(Se,s(Ge,Se))}else{if(!ae[de])return Tt?Se:{};Ge=y(Se,de,Oe)}}qt||(qt=new e);var Me=qt.get(Se);if(Me)return Me;qt.set(Se,Ge),E(Se)?Se.forEach(function(Ft){Ge.add(xe(Ft,gt,ut,Ft,Se,qt))}):b(Se)&&Se.forEach(function(Ft,yt){Ge.set(yt,xe(Ft,gt,ut,yt,Se,qt))});var Oo=Je?We?p:f:We?A:q,ia=rt?void 0:Oo(Se);return n(ia||Se,function(Ft,yt){ia&&(yt=Ft,Ft=Se[yt]),r(Ge,yt,xe(Ft,gt,ut,yt,Se,qt))}),Ge}return ly=xe,ly}var cy,PR;function gh(){if(PR)return cy;PR=1;var e=dB(),n=4;function r(s){return e(s,n)}return cy=r,cy}var fy,zR;function yh(){if(zR)return fy;zR=1;function e(n){return function(){return n}}return fy=e,fy}var hy,UR;function n9(){if(UR)return hy;UR=1;function e(n){return function(r,s,a){for(var o=-1,l=Object(r),u=a(r),h=u.length;h--;){var f=u[n?h:++o];if(s(l[f],f,l)===!1)break}return r}}return hy=e,hy}var dy,QR;function XE(){if(QR)return dy;QR=1;var e=n9(),n=e();return dy=n,dy}var py,HR;function WE(){if(HR)return py;HR=1;var e=XE(),n=ei();function r(s,a){return s&&e(s,a,n)}return py=r,py}var my,VR;function r9(){if(VR)return my;VR=1;var e=sr();function n(r,s){return function(a,o){if(a==null)return a;if(!e(a))return r(a,o);for(var l=a.length,u=s?l:-1,h=Object(a);(s?u--:++u<l)&&o(h[u],u,h)!==!1;);return a}}return my=n,my}var gy,FR;function Eo(){if(FR)return gy;FR=1;var e=WE(),n=r9(),r=n(e);return gy=r,gy}var yy,GR;function tn(){if(GR)return yy;GR=1;function e(n){return n}return yy=e,yy}var vy,KR;function pB(){if(KR)return vy;KR=1;var e=tn();function n(r){return typeof r=="function"?r:e}return vy=n,vy}var by,YR;function mB(){if(YR)return by;YR=1;var e=zE(),n=Eo(),r=pB(),s=vt();function a(o,l){var u=s(o)?e:n;return u(o,r(l))}return by=a,by}var _y,XR;function Ws(){return XR||(XR=1,_y=mB()),_y}var wy,WR;function gB(){if(WR)return wy;WR=1;var e=Eo();function n(r,s){var a=[];return e(r,function(o,l,u){s(o,l,u)&&a.push(o)}),a}return wy=n,wy}var Cy,JR;function i9(){if(JR)return Cy;JR=1;var e="__lodash_hash_undefined__";function n(r){return this.__data__.set(r,e),this}return Cy=n,Cy}var Ey,ZR;function s9(){if(ZR)return Ey;ZR=1;function e(n){return this.__data__.has(n)}return Ey=e,Ey}var xy,eO;function yB(){if(eO)return xy;eO=1;var e=PE(),n=i9(),r=s9();function s(a){var o=-1,l=a==null?0:a.length;for(this.__data__=new e;++o<l;)this.add(a[o])}return s.prototype.add=s.prototype.push=n,s.prototype.has=r,xy=s,xy}var Sy,tO;function vB(){if(tO)return Sy;tO=1;function e(n,r){for(var s=-1,a=n==null?0:n.length;++s<a;)if(r(n[s],s,n))return!0;return!1}return Sy=e,Sy}var Ty,nO;function bB(){if(nO)return Ty;nO=1;function e(n,r){return n.has(r)}return Ty=e,Ty}var qy,rO;function _B(){if(rO)return qy;rO=1;var e=yB(),n=vB(),r=bB(),s=1,a=2;function o(l,u,h,f,p,d){var g=h&s,y=l.length,C=u.length;if(y!=C&&!(g&&C>y))return!1;var x=d.get(l),v=d.get(u);if(x&&v)return x==u&&v==l;var b=-1,w=!0,E=h&a?new e:void 0;for(d.set(l,u),d.set(u,l);++b<y;){var q=l[b],A=u[b];if(f)var R=g?f(A,q,b,u,l,d):f(q,A,b,l,u,d);if(R!==void 0){if(R)continue;w=!1;break}if(E){if(!n(u,function(O,I){if(!r(E,I)&&(q===O||p(q,O,h,f,d)))return E.push(I)})){w=!1;break}}else if(!(q===A||p(q,A,h,f,d))){w=!1;break}}return d.delete(l),d.delete(u),w}return qy=o,qy}var Ay,iO;function wB(){if(iO)return Ay;iO=1;function e(n){var r=-1,s=Array(n.size);return n.forEach(function(a,o){s[++r]=[o,a]}),s}return Ay=e,Ay}var Ny,sO;function vh(){if(sO)return Ny;sO=1;function e(n){var r=-1,s=Array(n.size);return n.forEach(function(a){s[++r]=a}),s}return Ny=e,Ny}var Ry,aO;function a9(){if(aO)return Ry;aO=1;var e=Fs(),n=lB(),r=_o(),s=_B(),a=wB(),o=vh(),l=1,u=2,h="[object Boolean]",f="[object Date]",p="[object Error]",d="[object Map]",g="[object Number]",y="[object RegExp]",C="[object Set]",x="[object String]",v="[object Symbol]",b="[object ArrayBuffer]",w="[object DataView]",E=e?e.prototype:void 0,q=E?E.valueOf:void 0;function A(R,O,I,k,N,j,D){switch(I){case w:if(R.byteLength!=O.byteLength||R.byteOffset!=O.byteOffset)return!1;R=R.buffer,O=O.buffer;case b:return!(R.byteLength!=O.byteLength||!j(new n(R),new n(O)));case h:case f:case g:return r(+R,+O);case p:return R.name==O.name&&R.message==O.message;case y:case x:return R==O+"";case d:var z=a;case C:var T=k&l;if(z||(z=o),R.size!=O.size&&!T)return!1;var M=D.get(R);if(M)return M==O;k|=u,D.set(R,O);var $=s(z(R),z(O),k,N,j,D);return D.delete(R),$;case v:if(q)return q.call(R)==q.call(O)}return!1}return Ry=A,Ry}var Oy,oO;function o9(){if(oO)return Oy;oO=1;var e=aB(),n=1,r=Object.prototype,s=r.hasOwnProperty;function a(o,l,u,h,f,p){var d=u&n,g=e(o),y=g.length,C=e(l),x=C.length;if(y!=x&&!d)return!1;for(var v=y;v--;){var b=g[v];if(!(d?b in l:s.call(l,b)))return!1}var w=p.get(o),E=p.get(l);if(w&&E)return w==l&&E==o;var q=!0;p.set(o,l),p.set(l,o);for(var A=d;++v<y;){b=g[v];var R=o[b],O=l[b];if(h)var I=d?h(O,R,b,l,o,p):h(R,O,b,o,l,p);if(!(I===void 0?R===O||f(R,O,u,h,p):I)){q=!1;break}A||(A=b=="constructor")}if(q&&!A){var k=o.constructor,N=l.constructor;k!=N&&"constructor"in o&&"constructor"in l&&!(typeof k=="function"&&k instanceof k&&typeof N=="function"&&N instanceof N)&&(q=!1)}return p.delete(o),p.delete(l),q}return Oy=a,Oy}var My,uO;function u9(){if(uO)return My;uO=1;var e=hh(),n=_B(),r=a9(),s=o9(),a=Xs(),o=vt(),l=wo(),u=Co(),h=1,f="[object Arguments]",p="[object Array]",d="[object Object]",g=Object.prototype,y=g.hasOwnProperty;function C(x,v,b,w,E,q){var A=o(x),R=o(v),O=A?p:a(x),I=R?p:a(v);O=O==f?d:O,I=I==f?d:I;var k=O==d,N=I==d,j=O==I;if(j&&l(x)){if(!l(v))return!1;A=!0,k=!1}if(j&&!k)return q||(q=new e),A||u(x)?n(x,v,b,w,E,q):r(x,v,O,b,w,E,q);if(!(b&h)){var D=k&&y.call(x,"__wrapped__"),z=N&&y.call(v,"__wrapped__");if(D||z){var T=D?x.value():x,M=z?v.value():v;return q||(q=new e),E(T,M,b,w,q)}}return j?(q||(q=new e),s(x,v,b,w,E,q)):!1}return My=C,My}var jy,lO;function CB(){if(lO)return jy;lO=1;var e=u9(),n=Cr();function r(s,a,o,l,u){return s===a?!0:s==null||a==null||!n(s)&&!n(a)?s!==s&&a!==a:e(s,a,o,l,r,u)}return jy=r,jy}var $y,cO;function l9(){if(cO)return $y;cO=1;var e=hh(),n=CB(),r=1,s=2;function a(o,l,u,h){var f=u.length,p=f,d=!h;if(o==null)return!p;for(o=Object(o);f--;){var g=u[f];if(d&&g[2]?g[1]!==o[g[0]]:!(g[0]in o))return!1}for(;++f<p;){g=u[f];var y=g[0],C=o[y],x=g[1];if(d&&g[2]){if(C===void 0&&!(y in o))return!1}else{var v=new e;if(h)var b=h(C,x,y,o,l,v);if(!(b===void 0?n(x,C,r|s,h,v):b))return!1}}return!0}return $y=a,$y}var Ly,fO;function EB(){if(fO)return Ly;fO=1;var e=Bn();function n(r){return r===r&&!e(r)}return Ly=n,Ly}var Iy,hO;function c9(){if(hO)return Iy;hO=1;var e=EB(),n=ei();function r(s){for(var a=n(s),o=a.length;o--;){var l=a[o],u=s[l];a[o]=[l,u,e(u)]}return a}return Iy=r,Iy}var Dy,dO;function xB(){if(dO)return Dy;dO=1;function e(n,r){return function(s){return s==null?!1:s[n]===r&&(r!==void 0||n in Object(s))}}return Dy=e,Dy}var ky,pO;function f9(){if(pO)return ky;pO=1;var e=l9(),n=c9(),r=xB();function s(a){var o=n(a);return o.length==1&&o[0][2]?r(o[0][0],o[0][1]):function(l){return l===a||e(l,a,o)}}return ky=s,ky}var By,mO;function xo(){if(mO)return By;mO=1;var e=Gs(),n=Cr(),r="[object Symbol]";function s(a){return typeof a=="symbol"||n(a)&&e(a)==r}return By=s,By}var Py,gO;function JE(){if(gO)return Py;gO=1;var e=vt(),n=xo(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;function a(o,l){if(e(o))return!1;var u=typeof o;return u=="number"||u=="symbol"||u=="boolean"||o==null||n(o)?!0:s.test(o)||!r.test(o)||l!=null&&o in Object(l)}return Py=a,Py}var zy,yO;function h9(){if(yO)return zy;yO=1;var e=PE(),n="Expected a function";function r(s,a){if(typeof s!="function"||a!=null&&typeof a!="function")throw new TypeError(n);var o=function(){var l=arguments,u=a?a.apply(this,l):l[0],h=o.cache;if(h.has(u))return h.get(u);var f=s.apply(this,l);return o.cache=h.set(u,f)||h,f};return o.cache=new(r.Cache||e),o}return r.Cache=e,zy=r,zy}var Uy,vO;function d9(){if(vO)return Uy;vO=1;var e=h9(),n=500;function r(s){var a=e(s,function(l){return o.size===n&&o.clear(),l}),o=a.cache;return a}return Uy=r,Uy}var Qy,bO;function p9(){if(bO)return Qy;bO=1;var e=d9(),n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,s=e(function(a){var o=[];return a.charCodeAt(0)===46&&o.push(""),a.replace(n,function(l,u,h,f){o.push(h?f.replace(r,"$1"):u||l)}),o});return Qy=s,Qy}var Hy,_O;function Cl(){if(_O)return Hy;_O=1;function e(n,r){for(var s=-1,a=n==null?0:n.length,o=Array(a);++s<a;)o[s]=r(n[s],s,n);return o}return Hy=e,Hy}var Vy,wO;function m9(){if(wO)return Vy;wO=1;var e=Fs(),n=Cl(),r=vt(),s=xo(),a=e?e.prototype:void 0,o=a?a.toString:void 0;function l(u){if(typeof u=="string")return u;if(r(u))return n(u,l)+"";if(s(u))return o?o.call(u):"";var h=u+"";return h=="0"&&1/u==-1/0?"-0":h}return Vy=l,Vy}var Fy,CO;function SB(){if(CO)return Fy;CO=1;var e=m9();function n(r){return r==null?"":e(r)}return Fy=n,Fy}var Gy,EO;function bh(){if(EO)return Gy;EO=1;var e=vt(),n=JE(),r=p9(),s=SB();function a(o,l){return e(o)?o:n(o,l)?[o]:r(s(o))}return Gy=a,Gy}var Ky,xO;function El(){if(xO)return Ky;xO=1;var e=xo();function n(r){if(typeof r=="string"||e(r))return r;var s=r+"";return s=="0"&&1/r==-1/0?"-0":s}return Ky=n,Ky}var Yy,SO;function _h(){if(SO)return Yy;SO=1;var e=bh(),n=El();function r(s,a){a=e(a,s);for(var o=0,l=a.length;s!=null&&o<l;)s=s[n(a[o++])];return o&&o==l?s:void 0}return Yy=r,Yy}var Xy,TO;function g9(){if(TO)return Xy;TO=1;var e=_h();function n(r,s,a){var o=r==null?void 0:e(r,s);return o===void 0?a:o}return Xy=n,Xy}var Wy,qO;function y9(){if(qO)return Wy;qO=1;function e(n,r){return n!=null&&r in Object(n)}return Wy=e,Wy}var Jy,AO;function TB(){if(AO)return Jy;AO=1;var e=bh(),n=_l(),r=vt(),s=dh(),a=UE(),o=El();function l(u,h,f){h=e(h,u);for(var p=-1,d=h.length,g=!1;++p<d;){var y=o(h[p]);if(!(g=u!=null&&f(u,y)))break;u=u[y]}return g||++p!=d?g:(d=u==null?0:u.length,!!d&&a(d)&&s(y,d)&&(r(u)||n(u)))}return Jy=l,Jy}var Zy,NO;function qB(){if(NO)return Zy;NO=1;var e=y9(),n=TB();function r(s,a){return s!=null&&n(s,a,e)}return Zy=r,Zy}var ev,RO;function v9(){if(RO)return ev;RO=1;var e=CB(),n=g9(),r=qB(),s=JE(),a=EB(),o=xB(),l=El(),u=1,h=2;function f(p,d){return s(p)&&a(d)?o(l(p),d):function(g){var y=n(g,p);return y===void 0&&y===d?r(g,p):e(d,y,u|h)}}return ev=f,ev}var tv,OO;function AB(){if(OO)return tv;OO=1;function e(n){return function(r){return r==null?void 0:r[n]}}return tv=e,tv}var nv,MO;function b9(){if(MO)return nv;MO=1;var e=_h();function n(r){return function(s){return e(s,r)}}return nv=n,nv}var rv,jO;function _9(){if(jO)return rv;jO=1;var e=AB(),n=b9(),r=JE(),s=El();function a(o){return r(o)?e(s(o)):n(o)}return rv=a,rv}var iv,$O;function mn(){if($O)return iv;$O=1;var e=f9(),n=v9(),r=tn(),s=vt(),a=_9();function o(l){return typeof l=="function"?l:l==null?r:typeof l=="object"?s(l)?n(l[0],l[1]):e(l):a(l)}return iv=o,iv}var sv,LO;function ZE(){if(LO)return sv;LO=1;var e=FE(),n=gB(),r=mn(),s=vt();function a(o,l){var u=s(o)?e:n;return u(o,r(l,3))}return sv=a,sv}var av,IO;function w9(){if(IO)return av;IO=1;var e=Object.prototype,n=e.hasOwnProperty;function r(s,a){return s!=null&&n.call(s,a)}return av=r,av}var ov,DO;function So(){if(DO)return ov;DO=1;var e=w9(),n=TB();function r(s,a){return s!=null&&n(s,a,e)}return ov=r,ov}var uv,kO;function qn(){if(kO)return uv;kO=1;var e=HE(),n=Xs(),r=_l(),s=vt(),a=sr(),o=wo(),l=wl(),u=Co(),h="[object Map]",f="[object Set]",p=Object.prototype,d=p.hasOwnProperty;function g(y){if(y==null)return!0;if(a(y)&&(s(y)||typeof y=="string"||typeof y.splice=="function"||o(y)||u(y)||r(y)))return!y.length;var C=n(y);if(C==h||C==f)return!y.size;if(l(y))return!e(y).length;for(var x in y)if(d.call(y,x))return!1;return!0}return uv=g,uv}var lv,BO;function NB(){if(BO)return lv;BO=1;function e(n){return n===void 0}return lv=e,lv}var cv,PO;function RB(){if(PO)return cv;PO=1;var e=Eo(),n=sr();function r(s,a){var o=-1,l=n(s)?Array(s.length):[];return e(s,function(u,h,f){l[++o]=a(u,h,f)}),l}return cv=r,cv}var fv,zO;function ti(){if(zO)return fv;zO=1;var e=Cl(),n=mn(),r=RB(),s=vt();function a(o,l){var u=s(o)?e:r;return u(o,n(l,3))}return fv=a,fv}var hv,UO;function C9(){if(UO)return hv;UO=1;function e(n,r,s,a){var o=-1,l=n==null?0:n.length;for(a&&l&&(s=n[++o]);++o<l;)s=r(s,n[o],o,n);return s}return hv=e,hv}var dv,QO;function E9(){if(QO)return dv;QO=1;function e(n,r,s,a,o){return o(n,function(l,u,h){s=a?(a=!1,l):r(s,l,u,h)}),s}return dv=e,dv}var pv,HO;function Js(){if(HO)return pv;HO=1;var e=C9(),n=Eo(),r=mn(),s=E9(),a=vt();function o(l,u,h){var f=a(l)?e:s,p=arguments.length<3;return f(l,r(u,4),h,p,n)}return pv=o,pv}var mv,VO;function OB(){if(VO)return mv;VO=1;var e=Gs(),n=vt(),r=Cr(),s="[object String]";function a(o){return typeof o=="string"||!n(o)&&r(o)&&e(o)==s}return mv=a,mv}var gv,FO;function x9(){if(FO)return gv;FO=1;var e=AB(),n=e("length");return gv=n,gv}var yv,GO;function MB(){if(GO)return yv;GO=1;var e="\\ud800-\\udfff",n="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",s="\\u20d0-\\u20ff",a=n+r+s,o="\\ufe0e\\ufe0f",l="\\u200d",u=RegExp("["+l+e+a+o+"]");function h(f){return u.test(f)}return yv=h,yv}var vv,KO;function S9(){if(KO)return vv;KO=1;var e="\\ud800-\\udfff",n="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",s="\\u20d0-\\u20ff",a=n+r+s,o="\\ufe0e\\ufe0f",l="["+e+"]",u="["+a+"]",h="\\ud83c[\\udffb-\\udfff]",f="(?:"+u+"|"+h+")",p="[^"+e+"]",d="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",y="\\u200d",C=f+"?",x="["+o+"]?",v="(?:"+y+"(?:"+[p,d,g].join("|")+")"+x+C+")*",b=x+C+v,w="(?:"+[p+u+"?",u,d,g,l].join("|")+")",E=RegExp(h+"(?="+h+")|"+w+b,"g");function q(A){for(var R=E.lastIndex=0;E.test(A);)++R;return R}return vv=q,vv}var bv,YO;function T9(){if(YO)return bv;YO=1;var e=x9(),n=MB(),r=S9();function s(a){return n(a)?r(a):e(a)}return bv=s,bv}var _v,XO;function q9(){if(XO)return _v;XO=1;var e=HE(),n=Xs(),r=sr(),s=OB(),a=T9(),o="[object Map]",l="[object Set]";function u(h){if(h==null)return 0;if(r(h))return s(h)?a(h):h.length;var f=n(h);return f==o||f==l?h.size:e(h).length}return _v=u,_v}var wv,WO;function jB(){if(WO)return wv;WO=1;var e=zE(),n=fB(),r=WE(),s=mn(),a=mh(),o=vt(),l=wo(),u=yl(),h=Bn(),f=Co();function p(d,g,y){var C=o(d),x=C||l(d)||f(d);if(g=s(g,4),y==null){var v=d&&d.constructor;x?y=C?new v:[]:h(d)?y=u(v)?n(a(d)):{}:y={}}return(x?e:r)(d,function(b,w,E){return g(y,b,w,E)}),y}return wv=p,wv}var Cv,JO;function A9(){if(JO)return Cv;JO=1;var e=Fs(),n=_l(),r=vt(),s=e?e.isConcatSpreadable:void 0;function a(o){return r(o)||n(o)||!!(s&&o&&o[s])}return Cv=a,Cv}var Ev,ZO;function ex(){if(ZO)return Ev;ZO=1;var e=KE(),n=A9();function r(s,a,o,l,u){var h=-1,f=s.length;for(o||(o=n),u||(u=[]);++h<f;){var p=s[h];a>0&&o(p)?a>1?r(p,a-1,o,l,u):e(u,p):l||(u[u.length]=p)}return u}return Ev=r,Ev}var xv,eM;function N9(){if(eM)return xv;eM=1;function e(n,r,s){switch(s.length){case 0:return n.call(r);case 1:return n.call(r,s[0]);case 2:return n.call(r,s[0],s[1]);case 3:return n.call(r,s[0],s[1],s[2])}return n.apply(r,s)}return xv=e,xv}var Sv,tM;function $B(){if(tM)return Sv;tM=1;var e=N9(),n=Math.max;function r(s,a,o){return a=n(a===void 0?s.length-1:a,0),function(){for(var l=arguments,u=-1,h=n(l.length-a,0),f=Array(h);++u<h;)f[u]=l[a+u];u=-1;for(var p=Array(a+1);++u<a;)p[u]=l[u];return p[a]=o(f),e(s,this,p)}}return Sv=r,Sv}var Tv,nM;function R9(){if(nM)return Tv;nM=1;var e=yh(),n=Zk(),r=tn(),s=n?function(a,o){return n(a,"toString",{configurable:!0,enumerable:!1,value:e(o),writable:!0})}:r;return Tv=s,Tv}var qv,rM;function O9(){if(rM)return qv;rM=1;var e=800,n=16,r=Date.now;function s(a){var o=0,l=0;return function(){var u=r(),h=n-(u-l);if(l=u,h>0){if(++o>=e)return arguments[0]}else o=0;return a.apply(void 0,arguments)}}return qv=s,qv}var Av,iM;function LB(){if(iM)return Av;iM=1;var e=R9(),n=O9(),r=n(e);return Av=r,Av}var Nv,sM;function xl(){if(sM)return Nv;sM=1;var e=tn(),n=$B(),r=LB();function s(a,o){return r(n(a,o,e),a+"")}return Nv=s,Nv}var Rv,aM;function IB(){if(aM)return Rv;aM=1;function e(n,r,s,a){for(var o=n.length,l=s+(a?1:-1);a?l--:++l<o;)if(r(n[l],l,n))return l;return-1}return Rv=e,Rv}var Ov,oM;function M9(){if(oM)return Ov;oM=1;function e(n){return n!==n}return Ov=e,Ov}var Mv,uM;function j9(){if(uM)return Mv;uM=1;function e(n,r,s){for(var a=s-1,o=n.length;++a<o;)if(n[a]===r)return a;return-1}return Mv=e,Mv}var jv,lM;function DB(){if(lM)return jv;lM=1;var e=IB(),n=M9(),r=j9();function s(a,o,l){return o===o?r(a,o,l):e(a,n,l)}return jv=s,jv}var $v,cM;function $9(){if(cM)return $v;cM=1;var e=DB();function n(r,s){var a=r==null?0:r.length;return!!a&&e(r,s,0)>-1}return $v=n,$v}var Lv,fM;function L9(){if(fM)return Lv;fM=1;function e(n,r,s){for(var a=-1,o=n==null?0:n.length;++a<o;)if(s(r,n[a]))return!0;return!1}return Lv=e,Lv}var Iv,hM;function I9(){if(hM)return Iv;hM=1;function e(){}return Iv=e,Iv}var Dv,dM;function D9(){if(dM)return Dv;dM=1;var e=uB(),n=I9(),r=vh(),s=1/0,a=e&&1/r(new e([,-0]))[1]==s?function(o){return new e(o)}:n;return Dv=a,Dv}var kv,pM;function kB(){if(pM)return kv;pM=1;var e=yB(),n=$9(),r=L9(),s=bB(),a=D9(),o=vh(),l=200;function u(h,f,p){var d=-1,g=n,y=h.length,C=!0,x=[],v=x;if(p)C=!1,g=r;else if(y>=l){var b=f?null:a(h);if(b)return o(b);C=!1,g=s,v=new e}else v=f?[]:x;e:for(;++d<y;){var w=h[d],E=f?f(w):w;if(w=p||w!==0?w:0,C&&E===E){for(var q=v.length;q--;)if(v[q]===E)continue e;f&&v.push(E),x.push(w)}else g(v,E,p)||(v!==x&&v.push(E),x.push(w))}return x}return kv=u,kv}var Bv,mM;function BB(){if(mM)return Bv;mM=1;var e=sr(),n=Cr();function r(s){return n(s)&&e(s)}return Bv=r,Bv}var Pv,gM;function k9(){if(gM)return Pv;gM=1;var e=ex(),n=xl(),r=kB(),s=BB(),a=n(function(o){return r(e(o,1,s,!0))});return Pv=a,Pv}var zv,yM;function B9(){if(yM)return zv;yM=1;var e=Cl();function n(r,s){return e(s,function(a){return r[a]})}return zv=n,zv}var Uv,vM;function wh(){if(vM)return Uv;vM=1;var e=B9(),n=ei();function r(s){return s==null?[]:e(s,n(s))}return Uv=r,Uv}var Qv,bM;function Pn(){if(bM)return Qv;bM=1;var e;if(typeof kE=="function")try{e={clone:gh(),constant:yh(),each:Ws(),filter:ZE(),has:So(),isArray:vt(),isEmpty:qn(),isFunction:yl(),isUndefined:NB(),keys:ei(),map:ti(),reduce:Js(),size:q9(),transform:jB(),union:k9(),values:wh()}}catch{}return e||(e=window._),Qv=e,Qv}var Hv,_M;function tx(){if(_M)return Hv;_M=1;var e=Pn();Hv=a;var n="\0",r="\0",s="";function a(p){this._isDirected=e.has(p,"directed")?p.directed:!0,this._isMultigraph=e.has(p,"multigraph")?p.multigraph:!1,this._isCompound=e.has(p,"compound")?p.compound:!1,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[r]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}a.prototype._nodeCount=0,a.prototype._edgeCount=0,a.prototype.isDirected=function(){return this._isDirected},a.prototype.isMultigraph=function(){return this._isMultigraph},a.prototype.isCompound=function(){return this._isCompound},a.prototype.setGraph=function(p){return this._label=p,this},a.prototype.graph=function(){return this._label},a.prototype.setDefaultNodeLabel=function(p){return e.isFunction(p)||(p=e.constant(p)),this._defaultNodeLabelFn=p,this},a.prototype.nodeCount=function(){return this._nodeCount},a.prototype.nodes=function(){return e.keys(this._nodes)},a.prototype.sources=function(){var p=this;return e.filter(this.nodes(),function(d){return e.isEmpty(p._in[d])})},a.prototype.sinks=function(){var p=this;return e.filter(this.nodes(),function(d){return e.isEmpty(p._out[d])})},a.prototype.setNodes=function(p,d){var g=arguments,y=this;return e.each(p,function(C){g.length>1?y.setNode(C,d):y.setNode(C)}),this},a.prototype.setNode=function(p,d){return e.has(this._nodes,p)?(arguments.length>1&&(this._nodes[p]=d),this):(this._nodes[p]=arguments.length>1?d:this._defaultNodeLabelFn(p),this._isCompound&&(this._parent[p]=r,this._children[p]={},this._children[r][p]=!0),this._in[p]={},this._preds[p]={},this._out[p]={},this._sucs[p]={},++this._nodeCount,this)},a.prototype.node=function(p){return this._nodes[p]},a.prototype.hasNode=function(p){return e.has(this._nodes,p)},a.prototype.removeNode=function(p){var d=this;if(e.has(this._nodes,p)){var g=function(y){d.removeEdge(d._edgeObjs[y])};delete this._nodes[p],this._isCompound&&(this._removeFromParentsChildList(p),delete this._parent[p],e.each(this.children(p),function(y){d.setParent(y)}),delete this._children[p]),e.each(e.keys(this._in[p]),g),delete this._in[p],delete this._preds[p],e.each(e.keys(this._out[p]),g),delete this._out[p],delete this._sucs[p],--this._nodeCount}return this},a.prototype.setParent=function(p,d){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(d))d=r;else{d+="";for(var g=d;!e.isUndefined(g);g=this.parent(g))if(g===p)throw new Error("Setting "+d+" as parent of "+p+" would create a cycle");this.setNode(d)}return this.setNode(p),this._removeFromParentsChildList(p),this._parent[p]=d,this._children[d][p]=!0,this},a.prototype._removeFromParentsChildList=function(p){delete this._children[this._parent[p]][p]},a.prototype.parent=function(p){if(this._isCompound){var d=this._parent[p];if(d!==r)return d}},a.prototype.children=function(p){if(e.isUndefined(p)&&(p=r),this._isCompound){var d=this._children[p];if(d)return e.keys(d)}else{if(p===r)return this.nodes();if(this.hasNode(p))return[]}},a.prototype.predecessors=function(p){var d=this._preds[p];if(d)return e.keys(d)},a.prototype.successors=function(p){var d=this._sucs[p];if(d)return e.keys(d)},a.prototype.neighbors=function(p){var d=this.predecessors(p);if(d)return e.union(d,this.successors(p))},a.prototype.isLeaf=function(p){var d;return this.isDirected()?d=this.successors(p):d=this.neighbors(p),d.length===0},a.prototype.filterNodes=function(p){var d=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});d.setGraph(this.graph());var g=this;e.each(this._nodes,function(x,v){p(v)&&d.setNode(v,x)}),e.each(this._edgeObjs,function(x){d.hasNode(x.v)&&d.hasNode(x.w)&&d.setEdge(x,g.edge(x))});var y={};function C(x){var v=g.parent(x);return v===void 0||d.hasNode(v)?(y[x]=v,v):v in y?y[v]:C(v)}return this._isCompound&&e.each(d.nodes(),function(x){d.setParent(x,C(x))}),d},a.prototype.setDefaultEdgeLabel=function(p){return e.isFunction(p)||(p=e.constant(p)),this._defaultEdgeLabelFn=p,this},a.prototype.edgeCount=function(){return this._edgeCount},a.prototype.edges=function(){return e.values(this._edgeObjs)},a.prototype.setPath=function(p,d){var g=this,y=arguments;return e.reduce(p,function(C,x){return y.length>1?g.setEdge(C,x,d):g.setEdge(C,x),x}),this},a.prototype.setEdge=function(){var p,d,g,y,C=!1,x=arguments[0];typeof x=="object"&&x!==null&&"v"in x?(p=x.v,d=x.w,g=x.name,arguments.length===2&&(y=arguments[1],C=!0)):(p=x,d=arguments[1],g=arguments[3],arguments.length>2&&(y=arguments[2],C=!0)),p=""+p,d=""+d,e.isUndefined(g)||(g=""+g);var v=u(this._isDirected,p,d,g);if(e.has(this._edgeLabels,v))return C&&(this._edgeLabels[v]=y),this;if(!e.isUndefined(g)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(p),this.setNode(d),this._edgeLabels[v]=C?y:this._defaultEdgeLabelFn(p,d,g);var b=h(this._isDirected,p,d,g);return p=b.v,d=b.w,Object.freeze(b),this._edgeObjs[v]=b,o(this._preds[d],p),o(this._sucs[p],d),this._in[d][v]=b,this._out[p][v]=b,this._edgeCount++,this},a.prototype.edge=function(p,d,g){var y=arguments.length===1?f(this._isDirected,arguments[0]):u(this._isDirected,p,d,g);return this._edgeLabels[y]},a.prototype.hasEdge=function(p,d,g){var y=arguments.length===1?f(this._isDirected,arguments[0]):u(this._isDirected,p,d,g);return e.has(this._edgeLabels,y)},a.prototype.removeEdge=function(p,d,g){var y=arguments.length===1?f(this._isDirected,arguments[0]):u(this._isDirected,p,d,g),C=this._edgeObjs[y];return C&&(p=C.v,d=C.w,delete this._edgeLabels[y],delete this._edgeObjs[y],l(this._preds[d],p),l(this._sucs[p],d),delete this._in[d][y],delete this._out[p][y],this._edgeCount--),this},a.prototype.inEdges=function(p,d){var g=this._in[p];if(g){var y=e.values(g);return d?e.filter(y,function(C){return C.v===d}):y}},a.prototype.outEdges=function(p,d){var g=this._out[p];if(g){var y=e.values(g);return d?e.filter(y,function(C){return C.w===d}):y}},a.prototype.nodeEdges=function(p,d){var g=this.inEdges(p,d);if(g)return g.concat(this.outEdges(p,d))};function o(p,d){p[d]?p[d]++:p[d]=1}function l(p,d){--p[d]||delete p[d]}function u(p,d,g,y){var C=""+d,x=""+g;if(!p&&C>x){var v=C;C=x,x=v}return C+s+x+s+(e.isUndefined(y)?n:y)}function h(p,d,g,y){var C=""+d,x=""+g;if(!p&&C>x){var v=C;C=x,x=v}var b={v:C,w:x};return y&&(b.name=y),b}function f(p,d){return u(p,d.v,d.w,d.name)}return Hv}var Vv,wM;function P9(){return wM||(wM=1,Vv="2.1.8"),Vv}var Fv,CM;function z9(){return CM||(CM=1,Fv={Graph:tx(),version:P9()}),Fv}var Gv,EM;function U9(){if(EM)return Gv;EM=1;var e=Pn(),n=tx();Gv={write:r,read:o};function r(l){var u={options:{directed:l.isDirected(),multigraph:l.isMultigraph(),compound:l.isCompound()},nodes:s(l),edges:a(l)};return e.isUndefined(l.graph())||(u.value=e.clone(l.graph())),u}function s(l){return e.map(l.nodes(),function(u){var h=l.node(u),f=l.parent(u),p={v:u};return e.isUndefined(h)||(p.value=h),e.isUndefined(f)||(p.parent=f),p})}function a(l){return e.map(l.edges(),function(u){var h=l.edge(u),f={v:u.v,w:u.w};return e.isUndefined(u.name)||(f.name=u.name),e.isUndefined(h)||(f.value=h),f})}function o(l){var u=new n(l.options).setGraph(l.value);return e.each(l.nodes,function(h){u.setNode(h.v,h.value),h.parent&&u.setParent(h.v,h.parent)}),e.each(l.edges,function(h){u.setEdge({v:h.v,w:h.w,name:h.name},h.value)}),u}return Gv}var Kv,xM;function Q9(){if(xM)return Kv;xM=1;var e=Pn();Kv=n;function n(r){var s={},a=[],o;function l(u){e.has(s,u)||(s[u]=!0,o.push(u),e.each(r.successors(u),l),e.each(r.predecessors(u),l))}return e.each(r.nodes(),function(u){o=[],l(u),o.length&&a.push(o)}),a}return Kv}var Yv,SM;function PB(){if(SM)return Yv;SM=1;var e=Pn();Yv=n;function n(){this._arr=[],this._keyIndices={}}return n.prototype.size=function(){return this._arr.length},n.prototype.keys=function(){return this._arr.map(function(r){return r.key})},n.prototype.has=function(r){return e.has(this._keyIndices,r)},n.prototype.priority=function(r){var s=this._keyIndices[r];if(s!==void 0)return this._arr[s].priority},n.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},n.prototype.add=function(r,s){var a=this._keyIndices;if(r=String(r),!e.has(a,r)){var o=this._arr,l=o.length;return a[r]=l,o.push({key:r,priority:s}),this._decrease(l),!0}return!1},n.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key},n.prototype.decrease=function(r,s){var a=this._keyIndices[r];if(s>this._arr[a].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[a].priority+" New: "+s);this._arr[a].priority=s,this._decrease(a)},n.prototype._heapify=function(r){var s=this._arr,a=2*r,o=a+1,l=r;a<s.length&&(l=s[a].priority<s[l].priority?a:l,o<s.length&&(l=s[o].priority<s[l].priority?o:l),l!==r&&(this._swap(r,l),this._heapify(l)))},n.prototype._decrease=function(r){for(var s=this._arr,a=s[r].priority,o;r!==0&&(o=r>>1,!(s[o].priority<a));)this._swap(r,o),r=o},n.prototype._swap=function(r,s){var a=this._arr,o=this._keyIndices,l=a[r],u=a[s];a[r]=u,a[s]=l,o[u.key]=r,o[l.key]=s},Yv}var Xv,TM;function zB(){if(TM)return Xv;TM=1;var e=Pn(),n=PB();Xv=s;var r=e.constant(1);function s(o,l,u,h){return a(o,String(l),u||r,h||function(f){return o.outEdges(f)})}function a(o,l,u,h){var f={},p=new n,d,g,y=function(C){var x=C.v!==d?C.v:C.w,v=f[x],b=u(C),w=g.distance+b;if(b<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+C+" Weight: "+b);w<v.distance&&(v.distance=w,v.predecessor=d,p.decrease(x,w))};for(o.nodes().forEach(function(C){var x=C===l?0:Number.POSITIVE_INFINITY;f[C]={distance:x},p.add(C,x)});p.size()>0&&(d=p.removeMin(),g=f[d],g.distance!==Number.POSITIVE_INFINITY);)h(d).forEach(y);return f}return Xv}var Wv,qM;function H9(){if(qM)return Wv;qM=1;var e=zB(),n=Pn();Wv=r;function r(s,a,o){return n.transform(s.nodes(),function(l,u){l[u]=e(s,u,a,o)},{})}return Wv}var Jv,AM;function UB(){if(AM)return Jv;AM=1;var e=Pn();Jv=n;function n(r){var s=0,a=[],o={},l=[];function u(h){var f=o[h]={onStack:!0,lowlink:s,index:s++};if(a.push(h),r.successors(h).forEach(function(g){e.has(o,g)?o[g].onStack&&(f.lowlink=Math.min(f.lowlink,o[g].index)):(u(g),f.lowlink=Math.min(f.lowlink,o[g].lowlink))}),f.lowlink===f.index){var p=[],d;do d=a.pop(),o[d].onStack=!1,p.push(d);while(h!==d);l.push(p)}}return r.nodes().forEach(function(h){e.has(o,h)||u(h)}),l}return Jv}var Zv,NM;function V9(){if(NM)return Zv;NM=1;var e=Pn(),n=UB();Zv=r;function r(s){return e.filter(n(s),function(a){return a.length>1||a.length===1&&s.hasEdge(a[0],a[0])})}return Zv}var eb,RM;function F9(){if(RM)return eb;RM=1;var e=Pn();eb=r;var n=e.constant(1);function r(a,o,l){return s(a,o||n,l||function(u){return a.outEdges(u)})}function s(a,o,l){var u={},h=a.nodes();return h.forEach(function(f){u[f]={},u[f][f]={distance:0},h.forEach(function(p){f!==p&&(u[f][p]={distance:Number.POSITIVE_INFINITY})}),l(f).forEach(function(p){var d=p.v===f?p.w:p.v,g=o(p);u[f][d]={distance:g,predecessor:f}})}),h.forEach(function(f){var p=u[f];h.forEach(function(d){var g=u[d];h.forEach(function(y){var C=g[f],x=p[y],v=g[y],b=C.distance+x.distance;b<v.distance&&(v.distance=b,v.predecessor=x.predecessor)})})}),u}return eb}var tb,OM;function QB(){if(OM)return tb;OM=1;var e=Pn();tb=n,n.CycleException=r;function n(s){var a={},o={},l=[];function u(h){if(e.has(o,h))throw new r;e.has(a,h)||(o[h]=!0,a[h]=!0,e.each(s.predecessors(h),u),delete o[h],l.push(h))}if(e.each(s.sinks(),u),e.size(a)!==s.nodeCount())throw new r;return l}function r(){}return r.prototype=new Error,tb}var nb,MM;function G9(){if(MM)return nb;MM=1;var e=QB();nb=n;function n(r){try{e(r)}catch(s){if(s instanceof e.CycleException)return!1;throw s}return!0}return nb}var rb,jM;function HB(){if(jM)return rb;jM=1;var e=Pn();rb=n;function n(s,a,o){e.isArray(a)||(a=[a]);var l=(s.isDirected()?s.successors:s.neighbors).bind(s),u=[],h={};return e.each(a,function(f){if(!s.hasNode(f))throw new Error("Graph does not have node: "+f);r(s,f,o==="post",h,l,u)}),u}function r(s,a,o,l,u,h){e.has(l,a)||(l[a]=!0,o||h.push(a),e.each(u(a),function(f){r(s,f,o,l,u,h)}),o&&h.push(a))}return rb}var ib,$M;function K9(){if($M)return ib;$M=1;var e=HB();ib=n;function n(r,s){return e(r,s,"post")}return ib}var sb,LM;function Y9(){if(LM)return sb;LM=1;var e=HB();sb=n;function n(r,s){return e(r,s,"pre")}return sb}var ab,IM;function X9(){if(IM)return ab;IM=1;var e=Pn(),n=tx(),r=PB();ab=s;function s(a,o){var l=new n,u={},h=new r,f;function p(g){var y=g.v===f?g.w:g.v,C=h.priority(y);if(C!==void 0){var x=o(g);x<C&&(u[y]=f,h.decrease(y,x))}}if(a.nodeCount()===0)return l;e.each(a.nodes(),function(g){h.add(g,Number.POSITIVE_INFINITY),l.setNode(g)}),h.decrease(a.nodes()[0],0);for(var d=!1;h.size()>0;){if(f=h.removeMin(),e.has(u,f))l.setEdge(f,u[f]);else{if(d)throw new Error("Input graph is not connected: "+a);d=!0}a.nodeEdges(f).forEach(p)}return l}return ab}var ob,DM;function W9(){return DM||(DM=1,ob={components:Q9(),dijkstra:zB(),dijkstraAll:H9(),findCycles:V9(),floydWarshall:F9(),isAcyclic:G9(),postorder:K9(),preorder:Y9(),prim:X9(),tarjan:UB(),topsort:QB()}),ob}var ub,kM;function J9(){if(kM)return ub;kM=1;var e=z9();return ub={Graph:e.Graph,json:U9(),alg:W9(),version:e.version},ub}var lb,BM;function er(){if(BM)return lb;BM=1;var e;if(typeof kE=="function")try{e=J9()}catch{}return e||(e=window.graphlib),lb=e,lb}var cb,PM;function VB(){if(PM)return cb;PM=1;var e=dB(),n=1,r=4;function s(a){return e(a,n|r)}return cb=s,cb}var fb,zM;function To(){if(zM)return fb;zM=1;var e=_o(),n=sr(),r=dh(),s=Bn();function a(o,l,u){if(!s(u))return!1;var h=typeof l;return(h=="number"?n(u)&&r(l,u.length):h=="string"&&l in u)?e(u[l],o):!1}return fb=a,fb}var hb,UM;function nx(){if(UM)return hb;UM=1;var e=xl(),n=_o(),r=To(),s=Xi(),a=Object.prototype,o=a.hasOwnProperty,l=e(function(u,h){u=Object(u);var f=-1,p=h.length,d=p>2?h[2]:void 0;for(d&&r(h[0],h[1],d)&&(p=1);++f<p;)for(var g=h[f],y=s(g),C=-1,x=y.length;++C<x;){var v=y[C],b=u[v];(b===void 0||n(b,a[v])&&!o.call(u,v))&&(u[v]=g[v])}return u});return hb=l,hb}var db,QM;function Z9(){if(QM)return db;QM=1;var e=mn(),n=sr(),r=ei();function s(a){return function(o,l,u){var h=Object(o);if(!n(o)){var f=e(l,3);o=r(o),l=function(d){return f(h[d],d,h)}}var p=a(o,l,u);return p>-1?h[f?o[p]:p]:void 0}}return db=s,db}var pb,HM;function e7(){if(HM)return pb;HM=1;var e=/\s/;function n(r){for(var s=r.length;s--&&e.test(r.charAt(s)););return s}return pb=n,pb}var mb,VM;function t7(){if(VM)return mb;VM=1;var e=e7(),n=/^\s+/;function r(s){return s&&s.slice(0,e(s)+1).replace(n,"")}return mb=r,mb}var gb,FM;function n7(){if(FM)return gb;FM=1;var e=t7(),n=Bn(),r=xo(),s=NaN,a=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;function h(f){if(typeof f=="number")return f;if(r(f))return s;if(n(f)){var p=typeof f.valueOf=="function"?f.valueOf():f;f=n(p)?p+"":p}if(typeof f!="string")return f===0?f:+f;f=e(f);var d=o.test(f);return d||l.test(f)?u(f.slice(2),d?2:8):a.test(f)?s:+f}return gb=h,gb}var yb,GM;function FB(){if(GM)return yb;GM=1;var e=n7(),n=1/0,r=17976931348623157e292;function s(a){if(!a)return a===0?a:0;if(a=e(a),a===n||a===-n){var o=a<0?-1:1;return o*r}return a===a?a:0}return yb=s,yb}var vb,KM;function rx(){if(KM)return vb;KM=1;var e=FB();function n(r){var s=e(r),a=s%1;return s===s?a?s-a:s:0}return vb=n,vb}var bb,YM;function r7(){if(YM)return bb;YM=1;var e=IB(),n=mn(),r=rx(),s=Math.max;function a(o,l,u){var h=o==null?0:o.length;if(!h)return-1;var f=u==null?0:r(u);return f<0&&(f=s(h+f,0)),e(o,n(l,3),f)}return bb=a,bb}var _b,XM;function i7(){if(XM)return _b;XM=1;var e=Z9(),n=r7(),r=e(n);return _b=r,_b}var wb,WM;function Ch(){if(WM)return wb;WM=1;var e=ex();function n(r){var s=r==null?0:r.length;return s?e(r,1):[]}return wb=n,wb}var Cb,JM;function s7(){if(JM)return Cb;JM=1;var e=XE(),n=pB(),r=Xi();function s(a,o){return a==null?a:e(a,n(o),r)}return Cb=s,Cb}var Eb,ZM;function GB(){if(ZM)return Eb;ZM=1;function e(n){var r=n==null?0:n.length;return r?n[r-1]:void 0}return Eb=e,Eb}var xb,e2;function a7(){if(e2)return xb;e2=1;var e=vl(),n=WE(),r=mn();function s(a,o){var l={};return o=r(o,3),n(a,function(u,h,f){e(l,h,o(u,h,f))}),l}return xb=s,xb}var Sb,t2;function ix(){if(t2)return Sb;t2=1;var e=xo();function n(r,s,a){for(var o=-1,l=r.length;++o<l;){var u=r[o],h=s(u);if(h!=null&&(f===void 0?h===h&&!e(h):a(h,f)))var f=h,p=u}return p}return Sb=n,Sb}var Tb,n2;function o7(){if(n2)return Tb;n2=1;function e(n,r){return n>r}return Tb=e,Tb}var qb,r2;function u7(){if(r2)return qb;r2=1;var e=ix(),n=o7(),r=tn();function s(a){return a&&a.length?e(a,r,n):void 0}return qb=s,qb}var Ab,i2;function KB(){if(i2)return Ab;i2=1;var e=vl(),n=_o();function r(s,a,o){(o!==void 0&&!n(s[a],o)||o===void 0&&!(a in s))&&e(s,a,o)}return Ab=r,Ab}var Nb,s2;function Wi(){if(s2)return Nb;s2=1;var e=Gs(),n=mh(),r=Cr(),s="[object Object]",a=Function.prototype,o=Object.prototype,l=a.toString,u=o.hasOwnProperty,h=l.call(Object);function f(p){if(!r(p)||e(p)!=s)return!1;var d=n(p);if(d===null)return!0;var g=u.call(d,"constructor")&&d.constructor;return typeof g=="function"&&g instanceof g&&l.call(g)==h}return Nb=f,Nb}var Rb,a2;function YB(){if(a2)return Rb;a2=1;function e(n,r){if(!(r==="constructor"&&typeof n[r]=="function")&&r!="__proto__")return n[r]}return Rb=e,Rb}var Ob,o2;function l7(){if(o2)return Ob;o2=1;var e=Ys(),n=Xi();function r(s){return e(s,n(s))}return Ob=r,Ob}var Mb,u2;function c7(){if(u2)return Mb;u2=1;var e=KB(),n=nB(),r=cB(),s=VE(),a=hB(),o=_l(),l=vt(),u=BB(),h=wo(),f=yl(),p=Bn(),d=Wi(),g=Co(),y=YB(),C=l7();function x(v,b,w,E,q,A,R){var O=y(v,w),I=y(b,w),k=R.get(I);if(k){e(v,w,k);return}var N=A?A(O,I,w+"",v,b,R):void 0,j=N===void 0;if(j){var D=l(I),z=!D&&h(I),T=!D&&!z&&g(I);N=I,D||z||T?l(O)?N=O:u(O)?N=s(O):z?(j=!1,N=n(I,!0)):T?(j=!1,N=r(I,!0)):N=[]:d(I)||o(I)?(N=O,o(O)?N=C(O):(!p(O)||f(O))&&(N=a(I))):j=!1}j&&(R.set(I,N),q(N,I,E,A,R),R.delete(I)),e(v,w,N)}return Mb=x,Mb}var jb,l2;function f7(){if(l2)return jb;l2=1;var e=hh(),n=KB(),r=XE(),s=c7(),a=Bn(),o=Xi(),l=YB();function u(h,f,p,d,g){h!==f&&r(f,function(y,C){if(g||(g=new e),a(y))s(h,f,C,p,u,d,g);else{var x=d?d(l(h,C),y,C+"",h,f,g):void 0;x===void 0&&(x=y),n(h,C,x)}},o)}return jb=u,jb}var $b,c2;function sx(){if(c2)return $b;c2=1;var e=xl(),n=To();function r(s){return e(function(a,o){var l=-1,u=o.length,h=u>1?o[u-1]:void 0,f=u>2?o[2]:void 0;for(h=s.length>3&&typeof h=="function"?(u--,h):void 0,f&&n(o[0],o[1],f)&&(h=u<3?void 0:h,u=1),a=Object(a);++l<u;){var p=o[l];p&&s(a,p,l,h)}return a})}return $b=r,$b}var Lb,f2;function XB(){if(f2)return Lb;f2=1;var e=f7(),n=sx(),r=n(function(s,a,o){e(s,a,o)});return Lb=r,Lb}var Ib,h2;function WB(){if(h2)return Ib;h2=1;function e(n,r){return n<r}return Ib=e,Ib}var Db,d2;function h7(){if(d2)return Db;d2=1;var e=ix(),n=WB(),r=tn();function s(a){return a&&a.length?e(a,r,n):void 0}return Db=s,Db}var kb,p2;function d7(){if(p2)return kb;p2=1;var e=ix(),n=mn(),r=WB();function s(a,o){return a&&a.length?e(a,n(o,2),r):void 0}return kb=s,kb}var Bb,m2;function p7(){if(m2)return Bb;m2=1;var e=ir(),n=function(){return e.Date.now()};return Bb=n,Bb}var Pb,g2;function m7(){if(g2)return Pb;g2=1;var e=bl(),n=bh(),r=dh(),s=Bn(),a=El();function o(l,u,h,f){if(!s(l))return l;u=n(u,l);for(var p=-1,d=u.length,g=d-1,y=l;y!=null&&++p<d;){var C=a(u[p]),x=h;if(C==="__proto__"||C==="constructor"||C==="prototype")return l;if(p!=g){var v=y[C];x=f?f(v,C,y):void 0,x===void 0&&(x=s(v)?v:r(u[p+1])?[]:{})}e(y,C,x),y=y[C]}return l}return Pb=o,Pb}var zb,y2;function JB(){if(y2)return zb;y2=1;var e=_h(),n=m7(),r=bh();function s(a,o,l){for(var u=-1,h=o.length,f={};++u<h;){var p=o[u],d=e(a,p);l(d,p)&&n(f,r(p,a),d)}return f}return zb=s,zb}var Ub,v2;function g7(){if(v2)return Ub;v2=1;var e=JB(),n=qB();function r(s,a){return e(s,a,function(o,l){return n(s,l)})}return Ub=r,Ub}var Qb,b2;function y7(){if(b2)return Qb;b2=1;var e=Ch(),n=$B(),r=LB();function s(a){return r(n(a,void 0,e),a+"")}return Qb=s,Qb}var Hb,_2;function v7(){if(_2)return Hb;_2=1;var e=g7(),n=y7(),r=n(function(s,a){return s==null?{}:e(s,a)});return Hb=r,Hb}var Vb,w2;function b7(){if(w2)return Vb;w2=1;var e=Math.ceil,n=Math.max;function r(s,a,o,l){for(var u=-1,h=n(e((a-s)/(o||1)),0),f=Array(h);h--;)f[l?h:++u]=s,s+=o;return f}return Vb=r,Vb}var Fb,C2;function _7(){if(C2)return Fb;C2=1;var e=b7(),n=To(),r=FB();function s(a){return function(o,l,u){return u&&typeof u!="number"&&n(o,l,u)&&(l=u=void 0),o=r(o),l===void 0?(l=o,o=0):l=r(l),u=u===void 0?o<l?1:-1:r(u),e(o,l,u,a)}}return Fb=s,Fb}var Gb,E2;function w7(){if(E2)return Gb;E2=1;var e=_7(),n=e();return Gb=n,Gb}var Kb,x2;function C7(){if(x2)return Kb;x2=1;function e(n,r){var s=n.length;for(n.sort(r);s--;)n[s]=n[s].value;return n}return Kb=e,Kb}var Yb,S2;function E7(){if(S2)return Yb;S2=1;var e=xo();function n(r,s){if(r!==s){var a=r!==void 0,o=r===null,l=r===r,u=e(r),h=s!==void 0,f=s===null,p=s===s,d=e(s);if(!f&&!d&&!u&&r>s||u&&h&&p&&!f&&!d||o&&h&&p||!a&&p||!l)return 1;if(!o&&!u&&!d&&r<s||d&&a&&l&&!o&&!u||f&&a&&l||!h&&l||!p)return-1}return 0}return Yb=n,Yb}var Xb,T2;function x7(){if(T2)return Xb;T2=1;var e=E7();function n(r,s,a){for(var o=-1,l=r.criteria,u=s.criteria,h=l.length,f=a.length;++o<h;){var p=e(l[o],u[o]);if(p){if(o>=f)return p;var d=a[o];return p*(d=="desc"?-1:1)}}return r.index-s.index}return Xb=n,Xb}var Wb,q2;function S7(){if(q2)return Wb;q2=1;var e=Cl(),n=_h(),r=mn(),s=RB(),a=C7(),o=ph(),l=x7(),u=tn(),h=vt();function f(p,d,g){d.length?d=e(d,function(x){return h(x)?function(v){return n(v,x.length===1?x[0]:x)}:x}):d=[u];var y=-1;d=e(d,o(r));var C=s(p,function(x,v,b){var w=e(d,function(E){return E(x)});return{criteria:w,index:++y,value:x}});return a(C,function(x,v){return l(x,v,g)})}return Wb=f,Wb}var Jb,A2;function T7(){if(A2)return Jb;A2=1;var e=ex(),n=S7(),r=xl(),s=To(),a=r(function(o,l){if(o==null)return[];var u=l.length;return u>1&&s(o,l[0],l[1])?l=[]:u>2&&s(l[0],l[1],l[2])&&(l=[l[0]]),n(o,e(l,1),[])});return Jb=a,Jb}var Zb,N2;function ax(){if(N2)return Zb;N2=1;var e=SB(),n=0;function r(s){var a=++n;return e(s)+a}return Zb=r,Zb}var e_,R2;function q7(){if(R2)return e_;R2=1;function e(n,r,s){for(var a=-1,o=n.length,l=r.length,u={};++a<o;){var h=a<l?r[a]:void 0;s(u,n[a],h)}return u}return e_=e,e_}var t_,O2;function A7(){if(O2)return t_;O2=1;var e=bl(),n=q7();function r(s,a){return n(s||[],a||[],e)}return t_=r,t_}var n_,M2;function pt(){if(M2)return n_;M2=1;var e;if(typeof kE=="function")try{e={cloneDeep:VB(),constant:yh(),defaults:nx(),each:Ws(),filter:ZE(),find:i7(),flatten:Ch(),forEach:mB(),forIn:s7(),has:So(),isUndefined:NB(),last:GB(),map:ti(),mapValues:a7(),max:u7(),merge:XB(),min:h7(),minBy:d7(),now:p7(),pick:v7(),range:w7(),reduce:Js(),sortBy:T7(),uniqueId:ax(),values:wh(),zipObject:A7()}}catch{}return e||(e=window._),n_=e,n_}var r_,j2;function N7(){if(j2)return r_;j2=1,r_=e;function e(){var s={};s._next=s._prev=s,this._sentinel=s}e.prototype.dequeue=function(){var s=this._sentinel,a=s._prev;if(a!==s)return n(a),a},e.prototype.enqueue=function(s){var a=this._sentinel;s._prev&&s._next&&n(s),s._next=a._next,a._next._prev=s,a._next=s,s._prev=a},e.prototype.toString=function(){for(var s=[],a=this._sentinel,o=a._prev;o!==a;)s.push(JSON.stringify(o,r)),o=o._prev;return"["+s.join(", ")+"]"};function n(s){s._prev._next=s._next,s._next._prev=s._prev,delete s._next,delete s._prev}function r(s,a){if(s!=="_next"&&s!=="_prev")return a}return r_}var i_,$2;function R7(){if($2)return i_;$2=1;var e=pt(),n=er().Graph,r=N7();i_=a;var s=e.constant(1);function a(f,p){if(f.nodeCount()<=1)return[];var d=u(f,p||s),g=o(d.graph,d.buckets,d.zeroIdx);return e.flatten(e.map(g,function(y){return f.outEdges(y.v,y.w)}),!0)}function o(f,p,d){for(var g=[],y=p[p.length-1],C=p[0],x;f.nodeCount();){for(;x=C.dequeue();)l(f,p,d,x);for(;x=y.dequeue();)l(f,p,d,x);if(f.nodeCount()){for(var v=p.length-2;v>0;--v)if(x=p[v].dequeue(),x){g=g.concat(l(f,p,d,x,!0));break}}}return g}function l(f,p,d,g,y){var C=y?[]:void 0;return e.forEach(f.inEdges(g.v),function(x){var v=f.edge(x),b=f.node(x.v);y&&C.push({v:x.v,w:x.w}),b.out-=v,h(p,d,b)}),e.forEach(f.outEdges(g.v),function(x){var v=f.edge(x),b=x.w,w=f.node(b);w.in-=v,h(p,d,w)}),f.removeNode(g.v),C}function u(f,p){var d=new n,g=0,y=0;e.forEach(f.nodes(),function(v){d.setNode(v,{v,in:0,out:0})}),e.forEach(f.edges(),function(v){var b=d.edge(v.v,v.w)||0,w=p(v),E=b+w;d.setEdge(v.v,v.w,E),y=Math.max(y,d.node(v.v).out+=w),g=Math.max(g,d.node(v.w).in+=w)});var C=e.range(y+g+3).map(function(){return new r}),x=g+1;return e.forEach(d.nodes(),function(v){h(C,x,d.node(v))}),{graph:d,buckets:C,zeroIdx:x}}function h(f,p,d){d.out?d.in?f[d.out-d.in+p].enqueue(d):f[f.length-1].enqueue(d):f[0].enqueue(d)}return i_}var s_,L2;function O7(){if(L2)return s_;L2=1;var e=pt(),n=R7();s_={run:r,undo:a};function r(o){var l=o.graph().acyclicer==="greedy"?n(o,u(o)):s(o);e.forEach(l,function(h){var f=o.edge(h);o.removeEdge(h),f.forwardName=h.name,f.reversed=!0,o.setEdge(h.w,h.v,f,e.uniqueId("rev"))});function u(h){return function(f){return h.edge(f).weight}}}function s(o){var l=[],u={},h={};function f(p){e.has(h,p)||(h[p]=!0,u[p]=!0,e.forEach(o.outEdges(p),function(d){e.has(u,d.w)?l.push(d):f(d.w)}),delete u[p])}return e.forEach(o.nodes(),f),l}function a(o){e.forEach(o.edges(),function(l){var u=o.edge(l);if(u.reversed){o.removeEdge(l);var h=u.forwardName;delete u.reversed,delete u.forwardName,o.setEdge(l.w,l.v,u,h)}})}return s_}var a_,I2;function pn(){if(I2)return a_;I2=1;var e=pt(),n=er().Graph;a_={addDummyNode:r,simplify:s,asNonCompoundGraph:a,successorWeights:o,predecessorWeights:l,intersectRect:u,buildLayerMatrix:h,normalizeRanks:f,removeEmptyRanks:p,addBorderNode:d,maxRank:g,partition:y,time:C,notime:x};function r(v,b,w,E){var q;do q=e.uniqueId(E);while(v.hasNode(q));return w.dummy=b,v.setNode(q,w),q}function s(v){var b=new n().setGraph(v.graph());return e.forEach(v.nodes(),function(w){b.setNode(w,v.node(w))}),e.forEach(v.edges(),function(w){var E=b.edge(w.v,w.w)||{weight:0,minlen:1},q=v.edge(w);b.setEdge(w.v,w.w,{weight:E.weight+q.weight,minlen:Math.max(E.minlen,q.minlen)})}),b}function a(v){var b=new n({multigraph:v.isMultigraph()}).setGraph(v.graph());return e.forEach(v.nodes(),function(w){v.children(w).length||b.setNode(w,v.node(w))}),e.forEach(v.edges(),function(w){b.setEdge(w,v.edge(w))}),b}function o(v){var b=e.map(v.nodes(),function(w){var E={};return e.forEach(v.outEdges(w),function(q){E[q.w]=(E[q.w]||0)+v.edge(q).weight}),E});return e.zipObject(v.nodes(),b)}function l(v){var b=e.map(v.nodes(),function(w){var E={};return e.forEach(v.inEdges(w),function(q){E[q.v]=(E[q.v]||0)+v.edge(q).weight}),E});return e.zipObject(v.nodes(),b)}function u(v,b){var w=v.x,E=v.y,q=b.x-w,A=b.y-E,R=v.width/2,O=v.height/2;if(!q&&!A)throw new Error("Not possible to find intersection inside of the rectangle");var I,k;return Math.abs(A)*R>Math.abs(q)*O?(A<0&&(O=-O),I=O*q/A,k=O):(q<0&&(R=-R),I=R,k=R*A/q),{x:w+I,y:E+k}}function h(v){var b=e.map(e.range(g(v)+1),function(){return[]});return e.forEach(v.nodes(),function(w){var E=v.node(w),q=E.rank;e.isUndefined(q)||(b[q][E.order]=w)}),b}function f(v){var b=e.min(e.map(v.nodes(),function(w){return v.node(w).rank}));e.forEach(v.nodes(),function(w){var E=v.node(w);e.has(E,"rank")&&(E.rank-=b)})}function p(v){var b=e.min(e.map(v.nodes(),function(A){return v.node(A).rank})),w=[];e.forEach(v.nodes(),function(A){var R=v.node(A).rank-b;w[R]||(w[R]=[]),w[R].push(A)});var E=0,q=v.graph().nodeRankFactor;e.forEach(w,function(A,R){e.isUndefined(A)&&R%q!==0?--E:E&&e.forEach(A,function(O){v.node(O).rank+=E})})}function d(v,b,w,E){var q={width:0,height:0};return arguments.length>=4&&(q.rank=w,q.order=E),r(v,"border",q,b)}function g(v){return e.max(e.map(v.nodes(),function(b){var w=v.node(b).rank;if(!e.isUndefined(w))return w}))}function y(v,b){var w={lhs:[],rhs:[]};return e.forEach(v,function(E){b(E)?w.lhs.push(E):w.rhs.push(E)}),w}function C(v,b){var w=e.now();try{return b()}finally{console.log(v+" time: "+(e.now()-w)+"ms")}}function x(v,b){return b()}return a_}var o_,D2;function M7(){if(D2)return o_;D2=1;var e=pt(),n=pn();o_={run:r,undo:a};function r(o){o.graph().dummyChains=[],e.forEach(o.edges(),function(l){s(o,l)})}function s(o,l){var u=l.v,h=o.node(u).rank,f=l.w,p=o.node(f).rank,d=l.name,g=o.edge(l),y=g.labelRank;if(p!==h+1){o.removeEdge(l);var C,x,v;for(v=0,++h;h<p;++v,++h)g.points=[],x={width:0,height:0,edgeLabel:g,edgeObj:l,rank:h},C=n.addDummyNode(o,"edge",x,"_d"),h===y&&(x.width=g.width,x.height=g.height,x.dummy="edge-label",x.labelpos=g.labelpos),o.setEdge(u,C,{weight:g.weight},d),v===0&&o.graph().dummyChains.push(C),u=C;o.setEdge(u,f,{weight:g.weight},d)}}function a(o){e.forEach(o.graph().dummyChains,function(l){var u=o.node(l),h=u.edgeLabel,f;for(o.setEdge(u.edgeObj,h);u.dummy;)f=o.successors(l)[0],o.removeNode(l),h.points.push({x:u.x,y:u.y}),u.dummy==="edge-label"&&(h.x=u.x,h.y=u.y,h.width=u.width,h.height=u.height),l=f,u=o.node(l)})}return o_}var u_,k2;function Qf(){if(k2)return u_;k2=1;var e=pt();u_={longestPath:n,slack:r};function n(s){var a={};function o(l){var u=s.node(l);if(e.has(a,l))return u.rank;a[l]=!0;var h=e.min(e.map(s.outEdges(l),function(f){return o(f.w)-s.edge(f).minlen}));return(h===Number.POSITIVE_INFINITY||h===void 0||h===null)&&(h=0),u.rank=h}e.forEach(s.sources(),o)}function r(s,a){return s.node(a.w).rank-s.node(a.v).rank-s.edge(a).minlen}return u_}var l_,B2;function ZB(){if(B2)return l_;B2=1;var e=pt(),n=er().Graph,r=Qf().slack;l_=s;function s(u){var h=new n({directed:!1}),f=u.nodes()[0],p=u.nodeCount();h.setNode(f,{});for(var d,g;a(h,u)<p;)d=o(h,u),g=h.hasNode(d.v)?r(u,d):-r(u,d),l(h,u,g);return h}function a(u,h){function f(p){e.forEach(h.nodeEdges(p),function(d){var g=d.v,y=p===g?d.w:g;!u.hasNode(y)&&!r(h,d)&&(u.setNode(y,{}),u.setEdge(p,y,{}),f(y))})}return e.forEach(u.nodes(),f),u.nodeCount()}function o(u,h){return e.minBy(h.edges(),function(f){if(u.hasNode(f.v)!==u.hasNode(f.w))return r(h,f)})}function l(u,h,f){e.forEach(u.nodes(),function(p){h.node(p).rank+=f})}return l_}var c_,P2;function j7(){if(P2)return c_;P2=1;var e=pt(),n=ZB(),r=Qf().slack,s=Qf().longestPath,a=er().alg.preorder,o=er().alg.postorder,l=pn().simplify;c_=u,u.initLowLimValues=d,u.initCutValues=h,u.calcCutValue=p,u.leaveEdge=y,u.enterEdge=C,u.exchangeEdges=x;function u(E){E=l(E),s(E);var q=n(E);d(q),h(q,E);for(var A,R;A=y(q);)R=C(q,E,A),x(q,E,A,R)}function h(E,q){var A=o(E,E.nodes());A=A.slice(0,A.length-1),e.forEach(A,function(R){f(E,q,R)})}function f(E,q,A){var R=E.node(A),O=R.parent;E.edge(A,O).cutvalue=p(E,q,A)}function p(E,q,A){var R=E.node(A),O=R.parent,I=!0,k=q.edge(A,O),N=0;return k||(I=!1,k=q.edge(O,A)),N=k.weight,e.forEach(q.nodeEdges(A),function(j){var D=j.v===A,z=D?j.w:j.v;if(z!==O){var T=D===I,M=q.edge(j).weight;if(N+=T?M:-M,b(E,A,z)){var $=E.edge(A,z).cutvalue;N+=T?-$:$}}}),N}function d(E,q){arguments.length<2&&(q=E.nodes()[0]),g(E,{},1,q)}function g(E,q,A,R,O){var I=A,k=E.node(R);return q[R]=!0,e.forEach(E.neighbors(R),function(N){e.has(q,N)||(A=g(E,q,A,N,R))}),k.low=I,k.lim=A++,O?k.parent=O:delete k.parent,A}function y(E){return e.find(E.edges(),function(q){return E.edge(q).cutvalue<0})}function C(E,q,A){var R=A.v,O=A.w;q.hasEdge(R,O)||(R=A.w,O=A.v);var I=E.node(R),k=E.node(O),N=I,j=!1;I.lim>k.lim&&(N=k,j=!0);var D=e.filter(q.edges(),function(z){return j===w(E,E.node(z.v),N)&&j!==w(E,E.node(z.w),N)});return e.minBy(D,function(z){return r(q,z)})}function x(E,q,A,R){var O=A.v,I=A.w;E.removeEdge(O,I),E.setEdge(R.v,R.w,{}),d(E),h(E,q),v(E,q)}function v(E,q){var A=e.find(E.nodes(),function(O){return!q.node(O).parent}),R=a(E,A);R=R.slice(1),e.forEach(R,function(O){var I=E.node(O).parent,k=q.edge(O,I),N=!1;k||(k=q.edge(I,O),N=!0),q.node(O).rank=q.node(I).rank+(N?k.minlen:-k.minlen)})}function b(E,q,A){return E.hasEdge(q,A)}function w(E,q,A){return A.low<=q.lim&&q.lim<=A.lim}return c_}var f_,z2;function $7(){if(z2)return f_;z2=1;var e=Qf(),n=e.longestPath,r=ZB(),s=j7();f_=a;function a(h){switch(h.graph().ranker){case"network-simplex":u(h);break;case"tight-tree":l(h);break;case"longest-path":o(h);break;default:u(h)}}var o=n;function l(h){n(h),r(h)}function u(h){s(h)}return f_}var h_,U2;function L7(){if(U2)return h_;U2=1;var e=pt();h_=n;function n(a){var o=s(a);e.forEach(a.graph().dummyChains,function(l){for(var u=a.node(l),h=u.edgeObj,f=r(a,o,h.v,h.w),p=f.path,d=f.lca,g=0,y=p[g],C=!0;l!==h.w;){if(u=a.node(l),C){for(;(y=p[g])!==d&&a.node(y).maxRank<u.rank;)g++;y===d&&(C=!1)}if(!C){for(;g<p.length-1&&a.node(y=p[g+1]).minRank<=u.rank;)g++;y=p[g]}a.setParent(l,y),l=a.successors(l)[0]}})}function r(a,o,l,u){var h=[],f=[],p=Math.min(o[l].low,o[u].low),d=Math.max(o[l].lim,o[u].lim),g,y;g=l;do g=a.parent(g),h.push(g);while(g&&(o[g].low>p||d>o[g].lim));for(y=g,g=u;(g=a.parent(g))!==y;)f.push(g);return{path:h.concat(f.reverse()),lca:y}}function s(a){var o={},l=0;function u(h){var f=l;e.forEach(a.children(h),u),o[h]={low:f,lim:l++}}return e.forEach(a.children(),u),o}return h_}var d_,Q2;function I7(){if(Q2)return d_;Q2=1;var e=pt(),n=pn();d_={run:r,cleanup:l};function r(u){var h=n.addDummyNode(u,"root",{},"_root"),f=a(u),p=e.max(e.values(f))-1,d=2*p+1;u.graph().nestingRoot=h,e.forEach(u.edges(),function(y){u.edge(y).minlen*=d});var g=o(u)+1;e.forEach(u.children(),function(y){s(u,h,d,g,p,f,y)}),u.graph().nodeRankFactor=d}function s(u,h,f,p,d,g,y){var C=u.children(y);if(!C.length){y!==h&&u.setEdge(h,y,{weight:0,minlen:f});return}var x=n.addBorderNode(u,"_bt"),v=n.addBorderNode(u,"_bb"),b=u.node(y);u.setParent(x,y),b.borderTop=x,u.setParent(v,y),b.borderBottom=v,e.forEach(C,function(w){s(u,h,f,p,d,g,w);var E=u.node(w),q=E.borderTop?E.borderTop:w,A=E.borderBottom?E.borderBottom:w,R=E.borderTop?p:2*p,O=q!==A?1:d-g[y]+1;u.setEdge(x,q,{weight:R,minlen:O,nestingEdge:!0}),u.setEdge(A,v,{weight:R,minlen:O,nestingEdge:!0})}),u.parent(y)||u.setEdge(h,x,{weight:0,minlen:d+g[y]})}function a(u){var h={};function f(p,d){var g=u.children(p);g&&g.length&&e.forEach(g,function(y){f(y,d+1)}),h[p]=d}return e.forEach(u.children(),function(p){f(p,1)}),h}function o(u){return e.reduce(u.edges(),function(h,f){return h+u.edge(f).weight},0)}function l(u){var h=u.graph();u.removeNode(h.nestingRoot),delete h.nestingRoot,e.forEach(u.edges(),function(f){var p=u.edge(f);p.nestingEdge&&u.removeEdge(f)})}return d_}var p_,H2;function D7(){if(H2)return p_;H2=1;var e=pt(),n=pn();p_=r;function r(a){function o(l){var u=a.children(l),h=a.node(l);if(u.length&&e.forEach(u,o),e.has(h,"minRank")){h.borderLeft=[],h.borderRight=[];for(var f=h.minRank,p=h.maxRank+1;f<p;++f)s(a,"borderLeft","_bl",l,h,f),s(a,"borderRight","_br",l,h,f)}}e.forEach(a.children(),o)}function s(a,o,l,u,h,f){var p={width:0,height:0,rank:f,borderType:o},d=h[o][f-1],g=n.addDummyNode(a,"border",p,l);h[o][f]=g,a.setParent(g,u),d&&a.setEdge(d,g,{weight:1})}return p_}var m_,V2;function k7(){if(V2)return m_;V2=1;var e=pt();m_={adjust:n,undo:r};function n(f){var p=f.graph().rankdir.toLowerCase();(p==="lr"||p==="rl")&&s(f)}function r(f){var p=f.graph().rankdir.toLowerCase();(p==="bt"||p==="rl")&&o(f),(p==="lr"||p==="rl")&&(u(f),s(f))}function s(f){e.forEach(f.nodes(),function(p){a(f.node(p))}),e.forEach(f.edges(),function(p){a(f.edge(p))})}function a(f){var p=f.width;f.width=f.height,f.height=p}function o(f){e.forEach(f.nodes(),function(p){l(f.node(p))}),e.forEach(f.edges(),function(p){var d=f.edge(p);e.forEach(d.points,l),e.has(d,"y")&&l(d)})}function l(f){f.y=-f.y}function u(f){e.forEach(f.nodes(),function(p){h(f.node(p))}),e.forEach(f.edges(),function(p){var d=f.edge(p);e.forEach(d.points,h),e.has(d,"x")&&h(d)})}function h(f){var p=f.x;f.x=f.y,f.y=p}return m_}var g_,F2;function B7(){if(F2)return g_;F2=1;var e=pt();g_=n;function n(r){var s={},a=e.filter(r.nodes(),function(f){return!r.children(f).length}),o=e.max(e.map(a,function(f){return r.node(f).rank})),l=e.map(e.range(o+1),function(){return[]});function u(f){if(!e.has(s,f)){s[f]=!0;var p=r.node(f);l[p.rank].push(f),e.forEach(r.successors(f),u)}}var h=e.sortBy(a,function(f){return r.node(f).rank});return e.forEach(h,u),l}return g_}var y_,G2;function P7(){if(G2)return y_;G2=1;var e=pt();y_=n;function n(s,a){for(var o=0,l=1;l<a.length;++l)o+=r(s,a[l-1],a[l]);return o}function r(s,a,o){for(var l=e.zipObject(o,e.map(o,function(g,y){return y})),u=e.flatten(e.map(a,function(g){return e.sortBy(e.map(s.outEdges(g),function(y){return{pos:l[y.w],weight:s.edge(y).weight}}),"pos")}),!0),h=1;h<o.length;)h<<=1;var f=2*h-1;h-=1;var p=e.map(new Array(f),function(){return 0}),d=0;return e.forEach(u.forEach(function(g){var y=g.pos+h;p[y]+=g.weight;for(var C=0;y>0;)y%2&&(C+=p[y+1]),y=y-1>>1,p[y]+=g.weight;d+=g.weight*C})),d}return y_}var v_,K2;function z7(){if(K2)return v_;K2=1;var e=pt();v_=n;function n(r,s){return e.map(s,function(a){var o=r.inEdges(a);if(o.length){var l=e.reduce(o,function(u,h){var f=r.edge(h),p=r.node(h.v);return{sum:u.sum+f.weight*p.order,weight:u.weight+f.weight}},{sum:0,weight:0});return{v:a,barycenter:l.sum/l.weight,weight:l.weight}}else return{v:a}})}return v_}var b_,Y2;function U7(){if(Y2)return b_;Y2=1;var e=pt();b_=n;function n(a,o){var l={};e.forEach(a,function(h,f){var p=l[h.v]={indegree:0,in:[],out:[],vs:[h.v],i:f};e.isUndefined(h.barycenter)||(p.barycenter=h.barycenter,p.weight=h.weight)}),e.forEach(o.edges(),function(h){var f=l[h.v],p=l[h.w];!e.isUndefined(f)&&!e.isUndefined(p)&&(p.indegree++,f.out.push(l[h.w]))});var u=e.filter(l,function(h){return!h.indegree});return r(u)}function r(a){var o=[];function l(f){return function(p){p.merged||(e.isUndefined(p.barycenter)||e.isUndefined(f.barycenter)||p.barycenter>=f.barycenter)&&s(f,p)}}function u(f){return function(p){p.in.push(f),--p.indegree===0&&a.push(p)}}for(;a.length;){var h=a.pop();o.push(h),e.forEach(h.in.reverse(),l(h)),e.forEach(h.out,u(h))}return e.map(e.filter(o,function(f){return!f.merged}),function(f){return e.pick(f,["vs","i","barycenter","weight"])})}function s(a,o){var l=0,u=0;a.weight&&(l+=a.barycenter*a.weight,u+=a.weight),o.weight&&(l+=o.barycenter*o.weight,u+=o.weight),a.vs=o.vs.concat(a.vs),a.barycenter=l/u,a.weight=u,a.i=Math.min(o.i,a.i),o.merged=!0}return b_}var __,X2;function Q7(){if(X2)return __;X2=1;var e=pt(),n=pn();__=r;function r(o,l){var u=n.partition(o,function(x){return e.has(x,"barycenter")}),h=u.lhs,f=e.sortBy(u.rhs,function(x){return-x.i}),p=[],d=0,g=0,y=0;h.sort(a(!!l)),y=s(p,f,y),e.forEach(h,function(x){y+=x.vs.length,p.push(x.vs),d+=x.barycenter*x.weight,g+=x.weight,y=s(p,f,y)});var C={vs:e.flatten(p,!0)};return g&&(C.barycenter=d/g,C.weight=g),C}function s(o,l,u){for(var h;l.length&&(h=e.last(l)).i<=u;)l.pop(),o.push(h.vs),u++;return u}function a(o){return function(l,u){return l.barycenter<u.barycenter?-1:l.barycenter>u.barycenter?1:o?u.i-l.i:l.i-u.i}}return __}var w_,W2;function H7(){if(W2)return w_;W2=1;var e=pt(),n=z7(),r=U7(),s=Q7();w_=a;function a(u,h,f,p){var d=u.children(h),g=u.node(h),y=g?g.borderLeft:void 0,C=g?g.borderRight:void 0,x={};y&&(d=e.filter(d,function(A){return A!==y&&A!==C}));var v=n(u,d);e.forEach(v,function(A){if(u.children(A.v).length){var R=a(u,A.v,f,p);x[A.v]=R,e.has(R,"barycenter")&&l(A,R)}});var b=r(v,f);o(b,x);var w=s(b,p);if(y&&(w.vs=e.flatten([y,w.vs,C],!0),u.predecessors(y).length)){var E=u.node(u.predecessors(y)[0]),q=u.node(u.predecessors(C)[0]);e.has(w,"barycenter")||(w.barycenter=0,w.weight=0),w.barycenter=(w.barycenter*w.weight+E.order+q.order)/(w.weight+2),w.weight+=2}return w}function o(u,h){e.forEach(u,function(f){f.vs=e.flatten(f.vs.map(function(p){return h[p]?h[p].vs:p}),!0)})}function l(u,h){e.isUndefined(u.barycenter)?(u.barycenter=h.barycenter,u.weight=h.weight):(u.barycenter=(u.barycenter*u.weight+h.barycenter*h.weight)/(u.weight+h.weight),u.weight+=h.weight)}return w_}var C_,J2;function V7(){if(J2)return C_;J2=1;var e=pt(),n=er().Graph;C_=r;function r(a,o,l){var u=s(a),h=new n({compound:!0}).setGraph({root:u}).setDefaultNodeLabel(function(f){return a.node(f)});return e.forEach(a.nodes(),function(f){var p=a.node(f),d=a.parent(f);(p.rank===o||p.minRank<=o&&o<=p.maxRank)&&(h.setNode(f),h.setParent(f,d||u),e.forEach(a[l](f),function(g){var y=g.v===f?g.w:g.v,C=h.edge(y,f),x=e.isUndefined(C)?0:C.weight;h.setEdge(y,f,{weight:a.edge(g).weight+x})}),e.has(p,"minRank")&&h.setNode(f,{borderLeft:p.borderLeft[o],borderRight:p.borderRight[o]}))}),h}function s(a){for(var o;a.hasNode(o=e.uniqueId("_root")););return o}return C_}var E_,Z2;function F7(){if(Z2)return E_;Z2=1;var e=pt();E_=n;function n(r,s,a){var o={},l;e.forEach(a,function(u){for(var h=r.parent(u),f,p;h;){if(f=r.parent(h),f?(p=o[f],o[f]=h):(p=l,l=h),p&&p!==h){s.setEdge(p,h);return}h=f}})}return E_}var x_,ej;function G7(){if(ej)return x_;ej=1;var e=pt(),n=B7(),r=P7(),s=H7(),a=V7(),o=F7(),l=er().Graph,u=pn();x_=h;function h(g){var y=u.maxRank(g),C=f(g,e.range(1,y+1),"inEdges"),x=f(g,e.range(y-1,-1,-1),"outEdges"),v=n(g);d(g,v);for(var b=Number.POSITIVE_INFINITY,w,E=0,q=0;q<4;++E,++q){p(E%2?C:x,E%4>=2),v=u.buildLayerMatrix(g);var A=r(g,v);A<b&&(q=0,w=e.cloneDeep(v),b=A)}d(g,w)}function f(g,y,C){return e.map(y,function(x){return a(g,x,C)})}function p(g,y){var C=new l;e.forEach(g,function(x){var v=x.graph().root,b=s(x,v,C,y);e.forEach(b.vs,function(w,E){x.node(w).order=E}),o(x,C,b.vs)})}function d(g,y){e.forEach(y,function(C){e.forEach(C,function(x,v){g.node(x).order=v})})}return x_}var S_,tj;function K7(){if(tj)return S_;tj=1;var e=pt(),n=er().Graph,r=pn();S_={positionX:C,findType1Conflicts:s,findType2Conflicts:a,addConflict:l,hasConflict:u,verticalAlignment:h,horizontalCompaction:f,alignCoordinates:g,findSmallestWidthAlignment:d,balance:y};function s(b,w){var E={};function q(A,R){var O=0,I=0,k=A.length,N=e.last(R);return e.forEach(R,function(j,D){var z=o(b,j),T=z?b.node(z).order:k;(z||j===N)&&(e.forEach(R.slice(I,D+1),function(M){e.forEach(b.predecessors(M),function($){var P=b.node($),H=P.order;(H<O||T<H)&&!(P.dummy&&b.node(M).dummy)&&l(E,$,M)})}),I=D+1,O=T)}),R}return e.reduce(w,q),E}function a(b,w){var E={};function q(R,O,I,k,N){var j;e.forEach(e.range(O,I),function(D){j=R[D],b.node(j).dummy&&e.forEach(b.predecessors(j),function(z){var T=b.node(z);T.dummy&&(T.order<k||T.order>N)&&l(E,z,j)})})}function A(R,O){var I=-1,k,N=0;return e.forEach(O,function(j,D){if(b.node(j).dummy==="border"){var z=b.predecessors(j);z.length&&(k=b.node(z[0]).order,q(O,N,D,I,k),N=D,I=k)}q(O,N,O.length,k,R.length)}),O}return e.reduce(w,A),E}function o(b,w){if(b.node(w).dummy)return e.find(b.predecessors(w),function(E){return b.node(E).dummy})}function l(b,w,E){if(w>E){var q=w;w=E,E=q}var A=b[w];A||(b[w]=A={}),A[E]=!0}function u(b,w,E){if(w>E){var q=w;w=E,E=q}return e.has(b[w],E)}function h(b,w,E,q){var A={},R={},O={};return e.forEach(w,function(I){e.forEach(I,function(k,N){A[k]=k,R[k]=k,O[k]=N})}),e.forEach(w,function(I){var k=-1;e.forEach(I,function(N){var j=q(N);if(j.length){j=e.sortBy(j,function($){return O[$]});for(var D=(j.length-1)/2,z=Math.floor(D),T=Math.ceil(D);z<=T;++z){var M=j[z];R[N]===N&&k<O[M]&&!u(E,N,M)&&(R[M]=N,R[N]=A[N]=A[M],k=O[M])}}})}),{root:A,align:R}}function f(b,w,E,q,A){var R={},O=p(b,w,E,A),I=A?"borderLeft":"borderRight";function k(D,z){for(var T=O.nodes(),M=T.pop(),$={};M;)$[M]?D(M):($[M]=!0,T.push(M),T=T.concat(z(M))),M=T.pop()}function N(D){R[D]=O.inEdges(D).reduce(function(z,T){return Math.max(z,R[T.v]+O.edge(T))},0)}function j(D){var z=O.outEdges(D).reduce(function(M,$){return Math.min(M,R[$.w]-O.edge($))},Number.POSITIVE_INFINITY),T=b.node(D);z!==Number.POSITIVE_INFINITY&&T.borderType!==I&&(R[D]=Math.max(R[D],z))}return k(N,O.predecessors.bind(O)),k(j,O.successors.bind(O)),e.forEach(q,function(D){R[D]=R[E[D]]}),R}function p(b,w,E,q){var A=new n,R=b.graph(),O=x(R.nodesep,R.edgesep,q);return e.forEach(w,function(I){var k;e.forEach(I,function(N){var j=E[N];if(A.setNode(j),k){var D=E[k],z=A.edge(D,j);A.setEdge(D,j,Math.max(O(b,N,k),z||0))}k=N})}),A}function d(b,w){return e.minBy(e.values(w),function(E){var q=Number.NEGATIVE_INFINITY,A=Number.POSITIVE_INFINITY;return e.forIn(E,function(R,O){var I=v(b,O)/2;q=Math.max(R+I,q),A=Math.min(R-I,A)}),q-A})}function g(b,w){var E=e.values(w),q=e.min(E),A=e.max(E);e.forEach(["u","d"],function(R){e.forEach(["l","r"],function(O){var I=R+O,k=b[I],N;if(k!==w){var j=e.values(k);N=O==="l"?q-e.min(j):A-e.max(j),N&&(b[I]=e.mapValues(k,function(D){return D+N}))}})})}function y(b,w){return e.mapValues(b.ul,function(E,q){if(w)return b[w.toLowerCase()][q];var A=e.sortBy(e.map(b,q));return(A[1]+A[2])/2})}function C(b){var w=r.buildLayerMatrix(b),E=e.merge(s(b,w),a(b,w)),q={},A;e.forEach(["u","d"],function(O){A=O==="u"?w:e.values(w).reverse(),e.forEach(["l","r"],function(I){I==="r"&&(A=e.map(A,function(D){return e.values(D).reverse()}));var k=(O==="u"?b.predecessors:b.successors).bind(b),N=h(b,A,E,k),j=f(b,A,N.root,N.align,I==="r");I==="r"&&(j=e.mapValues(j,function(D){return-D})),q[O+I]=j})});var R=d(b,q);return g(q,R),y(q,b.graph().align)}function x(b,w,E){return function(q,A,R){var O=q.node(A),I=q.node(R),k=0,N;if(k+=O.width/2,e.has(O,"labelpos"))switch(O.labelpos.toLowerCase()){case"l":N=-O.width/2;break;case"r":N=O.width/2;break}if(N&&(k+=E?N:-N),N=0,k+=(O.dummy?w:b)/2,k+=(I.dummy?w:b)/2,k+=I.width/2,e.has(I,"labelpos"))switch(I.labelpos.toLowerCase()){case"l":N=I.width/2;break;case"r":N=-I.width/2;break}return N&&(k+=E?N:-N),N=0,k}}function v(b,w){return b.node(w).width}return S_}var T_,nj;function Y7(){if(nj)return T_;nj=1;var e=pt(),n=pn(),r=K7().positionX;T_=s;function s(o){o=n.asNonCompoundGraph(o),a(o),e.forEach(r(o),function(l,u){o.node(u).x=l})}function a(o){var l=n.buildLayerMatrix(o),u=o.graph().ranksep,h=0;e.forEach(l,function(f){var p=e.max(e.map(f,function(d){return o.node(d).height}));e.forEach(f,function(d){o.node(d).y=h+p/2}),h+=p+u})}return T_}var q_,rj;function X7(){if(rj)return q_;rj=1;var e=pt(),n=O7(),r=M7(),s=$7(),a=pn().normalizeRanks,o=L7(),l=pn().removeEmptyRanks,u=I7(),h=D7(),f=k7(),p=G7(),d=Y7(),g=pn(),y=er().Graph;q_=C;function C(Q,J){var ie=J&&J.debugTiming?g.time:g.notime;ie("layout",function(){var oe=ie(" buildLayoutGraph",function(){return k(Q)});ie(" runLayout",function(){x(oe,ie)}),ie(" updateInputGraph",function(){v(Q,oe)})})}function x(Q,J){J(" makeSpaceForEdgeLabels",function(){N(Q)}),J(" removeSelfEdges",function(){G(Q)}),J(" acyclic",function(){n.run(Q)}),J(" nestingGraph.run",function(){u.run(Q)}),J(" rank",function(){s(g.asNonCompoundGraph(Q))}),J(" injectEdgeLabelProxies",function(){j(Q)}),J(" removeEmptyRanks",function(){l(Q)}),J(" nestingGraph.cleanup",function(){u.cleanup(Q)}),J(" normalizeRanks",function(){a(Q)}),J(" assignRankMinMax",function(){D(Q)}),J(" removeEdgeLabelProxies",function(){z(Q)}),J(" normalize.run",function(){r.run(Q)}),J(" parentDummyChains",function(){o(Q)}),J(" addBorderSegments",function(){h(Q)}),J(" order",function(){p(Q)}),J(" insertSelfEdges",function(){V(Q)}),J(" adjustCoordinateSystem",function(){f.adjust(Q)}),J(" position",function(){d(Q)}),J(" positionSelfEdges",function(){B(Q)}),J(" removeBorderNodes",function(){H(Q)}),J(" normalize.undo",function(){r.undo(Q)}),J(" fixupEdgeLabelCoords",function(){$(Q)}),J(" undoCoordinateSystem",function(){f.undo(Q)}),J(" translateGraph",function(){T(Q)}),J(" assignNodeIntersects",function(){M(Q)}),J(" reversePoints",function(){P(Q)}),J(" acyclic.undo",function(){n.undo(Q)})}function v(Q,J){e.forEach(Q.nodes(),function(ie){var oe=Q.node(ie),ee=J.node(ie);oe&&(oe.x=ee.x,oe.y=ee.y,J.children(ie).length&&(oe.width=ee.width,oe.height=ee.height))}),e.forEach(Q.edges(),function(ie){var oe=Q.edge(ie),ee=J.edge(ie);oe.points=ee.points,e.has(ee,"x")&&(oe.x=ee.x,oe.y=ee.y)}),Q.graph().width=J.graph().width,Q.graph().height=J.graph().height}var b=["nodesep","edgesep","ranksep","marginx","marginy"],w={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},E=["acyclicer","ranker","rankdir","align"],q=["width","height"],A={width:0,height:0},R=["minlen","weight","width","height","labeloffset"],O={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},I=["labelpos"];function k(Q){var J=new y({multigraph:!0,compound:!0}),ie=te(Q.graph());return J.setGraph(e.merge({},w,K(ie,b),e.pick(ie,E))),e.forEach(Q.nodes(),function(oe){var ee=te(Q.node(oe));J.setNode(oe,e.defaults(K(ee,q),A)),J.setParent(oe,Q.parent(oe))}),e.forEach(Q.edges(),function(oe){var ee=te(Q.edge(oe));J.setEdge(oe,e.merge({},O,K(ee,R),e.pick(ee,I)))}),J}function N(Q){var J=Q.graph();J.ranksep/=2,e.forEach(Q.edges(),function(ie){var oe=Q.edge(ie);oe.minlen*=2,oe.labelpos.toLowerCase()!=="c"&&(J.rankdir==="TB"||J.rankdir==="BT"?oe.width+=oe.labeloffset:oe.height+=oe.labeloffset)})}function j(Q){e.forEach(Q.edges(),function(J){var ie=Q.edge(J);if(ie.width&&ie.height){var oe=Q.node(J.v),ee=Q.node(J.w),fe={rank:(ee.rank-oe.rank)/2+oe.rank,e:J};g.addDummyNode(Q,"edge-proxy",fe,"_ep")}})}function D(Q){var J=0;e.forEach(Q.nodes(),function(ie){var oe=Q.node(ie);oe.borderTop&&(oe.minRank=Q.node(oe.borderTop).rank,oe.maxRank=Q.node(oe.borderBottom).rank,J=e.max(J,oe.maxRank))}),Q.graph().maxRank=J}function z(Q){e.forEach(Q.nodes(),function(J){var ie=Q.node(J);ie.dummy==="edge-proxy"&&(Q.edge(ie.e).labelRank=ie.rank,Q.removeNode(J))})}function T(Q){var J=Number.POSITIVE_INFINITY,ie=0,oe=Number.POSITIVE_INFINITY,ee=0,fe=Q.graph(),be=fe.marginx||0,ve=fe.marginy||0;function _e(we){var W=we.x,ae=we.y,xe=we.width,Se=we.height;J=Math.min(J,W-xe/2),ie=Math.max(ie,W+xe/2),oe=Math.min(oe,ae-Se/2),ee=Math.max(ee,ae+Se/2)}e.forEach(Q.nodes(),function(we){_e(Q.node(we))}),e.forEach(Q.edges(),function(we){var W=Q.edge(we);e.has(W,"x")&&_e(W)}),J-=be,oe-=ve,e.forEach(Q.nodes(),function(we){var W=Q.node(we);W.x-=J,W.y-=oe}),e.forEach(Q.edges(),function(we){var W=Q.edge(we);e.forEach(W.points,function(ae){ae.x-=J,ae.y-=oe}),e.has(W,"x")&&(W.x-=J),e.has(W,"y")&&(W.y-=oe)}),fe.width=ie-J+be,fe.height=ee-oe+ve}function M(Q){e.forEach(Q.edges(),function(J){var ie=Q.edge(J),oe=Q.node(J.v),ee=Q.node(J.w),fe,be;ie.points?(fe=ie.points[0],be=ie.points[ie.points.length-1]):(ie.points=[],fe=ee,be=oe),ie.points.unshift(g.intersectRect(oe,fe)),ie.points.push(g.intersectRect(ee,be))})}function $(Q){e.forEach(Q.edges(),function(J){var ie=Q.edge(J);if(e.has(ie,"x"))switch((ie.labelpos==="l"||ie.labelpos==="r")&&(ie.width-=ie.labeloffset),ie.labelpos){case"l":ie.x-=ie.width/2+ie.labeloffset;break;case"r":ie.x+=ie.width/2+ie.labeloffset;break}})}function P(Q){e.forEach(Q.edges(),function(J){var ie=Q.edge(J);ie.reversed&&ie.points.reverse()})}function H(Q){e.forEach(Q.nodes(),function(J){if(Q.children(J).length){var ie=Q.node(J),oe=Q.node(ie.borderTop),ee=Q.node(ie.borderBottom),fe=Q.node(e.last(ie.borderLeft)),be=Q.node(e.last(ie.borderRight));ie.width=Math.abs(be.x-fe.x),ie.height=Math.abs(ee.y-oe.y),ie.x=fe.x+ie.width/2,ie.y=oe.y+ie.height/2}}),e.forEach(Q.nodes(),function(J){Q.node(J).dummy==="border"&&Q.removeNode(J)})}function G(Q){e.forEach(Q.edges(),function(J){if(J.v===J.w){var ie=Q.node(J.v);ie.selfEdges||(ie.selfEdges=[]),ie.selfEdges.push({e:J,label:Q.edge(J)}),Q.removeEdge(J)}})}function V(Q){var J=g.buildLayerMatrix(Q);e.forEach(J,function(ie){var oe=0;e.forEach(ie,function(ee,fe){var be=Q.node(ee);be.order=fe+oe,e.forEach(be.selfEdges,function(ve){g.addDummyNode(Q,"selfedge",{width:ve.label.width,height:ve.label.height,rank:be.rank,order:fe+ ++oe,e:ve.e,label:ve.label},"_se")}),delete be.selfEdges})})}function B(Q){e.forEach(Q.nodes(),function(J){var ie=Q.node(J);if(ie.dummy==="selfedge"){var oe=Q.node(ie.e.v),ee=oe.x+oe.width/2,fe=oe.y,be=ie.x-ee,ve=oe.height/2;Q.setEdge(ie.e,ie.label),Q.removeNode(J),ie.label.points=[{x:ee+2*be/3,y:fe-ve},{x:ee+5*be/6,y:fe-ve},{x:ee+be,y:fe},{x:ee+5*be/6,y:fe+ve},{x:ee+2*be/3,y:fe+ve}],ie.label.x=ie.x,ie.label.y=ie.y}})}function K(Q,J){return e.mapValues(e.pick(Q,J),Number)}function te(Q){var J={};return e.forEach(Q,function(ie,oe){J[oe.toLowerCase()]=ie}),J}return q_}var A_,ij;function W7(){if(ij)return A_;ij=1;var e=pt(),n=pn(),r=er().Graph;A_={debugOrdering:s};function s(a){var o=n.buildLayerMatrix(a),l=new r({compound:!0,multigraph:!0}).setGraph({});return e.forEach(a.nodes(),function(u){l.setNode(u,{label:u}),l.setParent(u,"layer"+a.node(u).rank)}),e.forEach(a.edges(),function(u){l.setEdge(u.v,u.w,{},u.name)}),e.forEach(o,function(u,h){var f="layer"+h;l.setNode(f,{rank:"same"}),e.reduce(u,function(p,d){return l.setEdge(p,d,{style:"invis"}),d})}),l}return A_}var N_,sj;function J7(){return sj||(sj=1,N_="0.8.5"),N_}var R_,aj;function Z7(){return aj||(aj=1,R_={graphlib:er(),layout:X7(),debug:W7(),util:{time:pn().time,notime:pn().notime},version:J7()}),R_}var eK=Z7();const oj=cE(eK),oE=250,tK=60,nK=24,rK=80,iK=60;function sK(e,n,r){var a,o,l;const s=new oj.graphlib.Graph;s.setDefaultEdgeLabel(()=>({})),s.setGraph({rankdir:"TB",nodesep:60,ranksep:80});for(const u of e){const h=(a=u.data)==null?void 0:a.nodeKey,f=h?(o=r==null?void 0:r.collapsedNodes)==null?void 0:o.has(h):!1,p=(h?(l=r==null?void 0:r.nodeWidths)==null?void 0:l.get(h):void 0)??oE,d=u.type==="ghostNode"?rK:f?iK:tK+u.data.table.columns.length*nK;s.setNode(u.id,{width:p,height:d})}for(const u of n)s.setEdge(u.source,u.target);return oj.layout(s),e.map(u=>{var d,g;const h=s.node(u.id),f=(d=u.data)==null?void 0:d.nodeKey,p=(f?(g=r==null?void 0:r.nodeWidths)==null?void 0:g.get(f):void 0)??oE;return{...u,position:{x:h.x-p/2,y:h.y-h.height/2},style:{...u.style,width:p}}})}function aK(e){const n=new Map,r=new Map;if(!e)return{changesByTable:n,removedByTable:r};for(const s of e.changes)if(s.type==="column-added"){let a=n.get(s.table);a||(a=new Map,n.set(s.table,a)),a.set(s.column,"added")}else if(s.type==="column-removed"){let a=r.get(s.table);a||(a=[],r.set(s.table,a)),a.push({name:s.column,dataType:s.dataType})}else if(s.type==="column-type-changed"){let a=n.get(s.table);a||(a=new Map,n.set(s.table,a)),a.set(s.column,"type-changed")}else if(s.type==="column-nullability-changed"){let a=n.get(s.table);a||(a=new Map,n.set(s.table,a)),a.set(s.column,"nullability-changed")}return{changesByTable:n,removedByTable:r}}function oK(e,n,r){if(!n||!r)return;const s=r.get(e);if(s)return n[s]}function uK(e,n,r,s,a,o){const l=new Set(e.tables.map(w=>w.name)),{changesByTable:u,removedByTable:h}=aK(s??null),f=e.tables.map(w=>{var A,R;const E=Zn(w.schema,w.name),q=((A=o==null?void 0:o.nodeWidths)==null?void 0:A.get(E))??oE;return{id:`table-${w.name}`,type:"tableNode",position:{x:0,y:0},style:{width:q},data:{table:w,visibleTableNames:l,columnChanges:u.get(w.name),removedColumns:h.get(w.name),collapsed:((R=o==null?void 0:o.collapsedNodes)==null?void 0:R.has(E))??!1,onToggleCollapse:o==null?void 0:o.onToggleCollapse,nodeKey:E,headerColor:oK(E,o==null?void 0:o.colorAssignments,o==null?void 0:o.nodeColorGroups)}}}),p=(o==null?void 0:o.crossSchemaExpansion)===!1,d=(o==null?void 0:o.startSchema)??null,g=e.ghostNodes.map(w=>{const E=p&&w.schema!==d;return{id:`ghost-${w.tableName}`,type:"ghostNode",position:{x:0,y:0},data:{ghost:w,onExpand:E?()=>{}:n,blocked:E}}}),y=[];for(const w of e.tables)for(const E of w.foreignKeys){const q=l.has(E.referencedTable)?`table-${E.referencedTable}`:`ghost-${E.referencedTable}`;y.push({id:`fk-${w.name}-${E.columnName}-${E.referencedTable}`,source:`table-${w.name}`,target:q,label:E.constraintName,type:"default"})}for(const w of e.ghostNodes)for(const E of w.referencingEdges)if(l.has(E.fromTable)){const q=`ghost-ref-${E.fromTable}-${E.fromColumn}-${w.tableName}`;y.some(A=>A.id===q)||y.push({id:q,source:`table-${E.fromTable}`,target:`ghost-${w.tableName}`,style:{strokeDasharray:"5 5"},type:"default"})}const C=[];if(s){for(const w of s.changes)if(w.type==="table-removed"){const E=w.schema?`${w.schema}.${w.table}`:w.table;C.push({id:`deleted-${w.table}`,type:"deletedTableNode",position:r.get(E)??{x:0,y:0},data:{tableName:w.table,schema:w.schema,onAcknowledge:a??(()=>{})}})}}const x=[...f,...g];return{nodes:[...sK(x,y,o).map(w=>{let E;if(w.type==="tableNode"){const q=w.data.table;E=Zn(q.schema,q.name)}else if(w.type==="ghostNode"){const q=w.data.ghost;E=Zn(q.schema,q.tableName)}return E&&r.has(E)?{...w,position:r.get(E)}:w}),...C],edges:y}}const lK={tableNode:nG,ghostNode:rG,deletedTableNode:iG};function cK(){const e=qe(D=>D.crawlResult),n=qe(D=>D.connectionId),r=qe(D=>D.addExpandedTable),s=qe(D=>D.nodePositions),a=qe(D=>D.updateNodePosition),o=qe(D=>D.updateNodeWidth),l=qe(D=>D.schemaDiff),u=qe(D=>D.setSchemaBaseline),h=qe(D=>D.setSchemaDiff),f=qe(D=>D.collapsedNodes),p=qe(D=>D.toggleNodeCollapsed),d=qe(D=>D.nodeWidths),g=qe(D=>D.colorAssignments),y=qe(D=>D.nodeColorGroups),C=qe(D=>D.crossSchemaExpansion),x=re.useCallback((D,z)=>{const T=qe.getState().schemaDiff;if(!T)return;const M=T.changes.filter(H=>!(H.type==="table-removed"&&H.table===D)),$=M.filter(H=>H.type==="table-removed").map(H=>H.table);h({...T,changes:M,hasChanges:M.length>0,tablesRemoved:$});const P=qe.getState().schemaBaseline;P&&u(P.filter(H=>H.name!==D))},[h,u]),v=Xn.useUtils(),b=re.useCallback(async D=>{if(!n)return;const z=await v.schema.expandGhostNode.fetch({connectionId:n,tableName:D.tableName,schema:D.schema});if(!z)return;const T=qe.getState().crawlResult;if(!T)return;const M=new Set(T.tables.map(P=>P.name));M.add(z.name);const $=[];for(const P of z.foreignKeys)!M.has(P.referencedTable)&&!T.ghostNodes.some(H=>H.tableName===P.referencedTable)&&$.push({tableName:P.referencedTable,schema:P.referencedSchema,referencingEdges:[{fromTable:z.name,fromColumn:P.columnName,toColumn:P.referencedColumn}]});r(z,$,D.tableName)},[n,v,r]),w=re.useMemo(()=>({collapsedNodes:f,nodeWidths:d,colorAssignments:g,nodeColorGroups:y,onToggleCollapse:p,crossSchemaExpansion:C,startSchema:(e==null?void 0:e.startSchema)??null}),[f,d,g,y,p,C,e==null?void 0:e.startSchema]),{initialNodes:E,initialEdges:q}=re.useMemo(()=>{if(!e)return{initialNodes:[],initialEdges:[]};const{nodes:D,edges:z}=uK(e,b,s,l,x,w);return{initialNodes:D,initialEdges:z}},[e,b,s,l,x,w]),[A,R,O]=TF(E),[I,k,N]=qF(q);re.useEffect(()=>{R(E),k(q)},[E,q,R,k]);const j=re.useCallback(D=>{O(D);for(const z of D){if(z.type==="position"&&z.position&&!z.dragging){const T=z.id,M=qe.getState().crawlResult;if(!M)continue;if(T.startsWith("table-")){const $=T.slice(6),P=M.tables.find(H=>H.name===$);P&&a(Zn(P.schema,P.name),z.position)}else if(T.startsWith("ghost-")){const $=T.slice(6),P=M.ghostNodes.find(H=>H.tableName===$);P&&a(Zn(P.schema,P.tableName),z.position)}}if(z.type==="dimensions"&&z.dimensions&&z.resizing===!1){const T=z.id,M=qe.getState().crawlResult;if(!M)continue;if(T.startsWith("table-")){const $=T.slice(6),P=M.tables.find(H=>H.name===$);P&&o(Zn(P.schema,P.name),z.dimensions.width)}}}},[O,a,o]);return e?F.jsx("div",{className:"canvas-container",children:F.jsxs(SF,{nodes:A,edges:I,onNodesChange:j,onEdgesChange:N,nodeTypes:lK,fitView:!0,minZoom:.1,maxZoom:2,children:[F.jsx(MF,{}),F.jsx(BF,{})]})}):null}const O_=["#58a6ff","#3fb950","#f0883e","#bc8cff","#f778ba","#79c0ff","#56d364","#e3b341"];function M_(e,n){const r=qe.getState(),{crawlResult:s,nodePositions:a,databaseLabel:o,dialect:l,collapsedNodes:u,nodeWidths:h,colorAssignments:f,nodeColorGroups:p,crossSchemaExpansion:d}=r;if(!s||!o||!l)return null;const g=s.tables.map(C=>{const x=Zn(C.schema,C.name),v=a.get(x)??{x:0,y:0};return{tableName:C.name,schema:C.schema,position:v,collapsed:u.has(x),width:h.get(x),colorGroup:p.get(x)}}),y=s.ghostNodes.map(C=>{const x=Zn(C.schema,C.tableName),v=a.get(x)??{x:0,y:0};return{tableName:C.tableName,schema:C.schema,position:v}});return{...n?{id:n}:{},name:e,databaseLabel:o,dialect:l,startTable:s.startTable??"",startSchema:s.startSchema??null,depth:s.depth,nodes:g,ghostNodes:y,schemaSnapshot:s.tables,colorAssignments:Object.keys(f).length>0?f:void 0,crossSchemaExpansion:d}}function fK(){const e=qe(ee=>ee.currentWorkspaceId),n=qe(ee=>ee.currentWorkspaceName),r=qe(ee=>ee.setWorkspace),s=qe(ee=>ee.clearWorkspace),a=qe(ee=>ee.connectionId),o=qe(ee=>ee.setCrawlResult),l=qe(ee=>ee.updateNodePosition),u=qe(ee=>ee.setSchemaBaseline),h=qe(ee=>ee.toggleNodeCollapsed),f=qe(ee=>ee.updateNodeWidth),p=qe(ee=>ee.setColorAssignments),d=qe(ee=>ee.setAllNodeColorGroups),g=qe(ee=>ee.setCrossSchemaExpansion),y=qe(ee=>ee.crossSchemaExpansion),C=qe(ee=>ee.colorAssignments),x=qe(ee=>ee.setColorAssignment),[v,b]=re.useState(""),[w,E]=re.useState(!1),[q,A]=re.useState(!1),[R,O]=re.useState(null),[I,k]=re.useState(null),N=Xn.workspace.list.useQuery(),j=Xn.workspace.save.useMutation(),D=Xn.workspace.delete.useMutation(),z=Xn.useUtils(),T=re.useRef(null),M=qe(ee=>ee.nodePositions),$=qe(ee=>ee.collapsedNodes),P=qe(ee=>ee.nodeWidths),H=qe(ee=>ee.nodeColorGroups);re.useEffect(()=>{if(!(!e||!n))return T.current&&clearTimeout(T.current),T.current=setTimeout(async()=>{const ee=M_(n,e);ee&&(await j.mutateAsync(ee),z.workspace.list.invalidate())},2e3),()=>{T.current&&clearTimeout(T.current)}},[M,$,P,C,H,y,e,n]);const G=qe(ee=>ee.crawlResult),V=re.useRef(!1);re.useEffect(()=>{if(!G||V.current||Object.keys(qe.getState().colorAssignments).length>0)return;const ee=new Set;for(const _e of G.tables)ee.add(_e.schema??"__default__");if(ee.size<=1)return;const fe={},be=new Map;let ve=0;for(const _e of ee)fe[_e]=O_[ve%O_.length],ve++;for(const _e of G.tables){const we=Zn(_e.schema,_e.name);be.set(we,_e.schema??"__default__")}p(fe),d(be),V.current=!0},[G,p,d]);const B=re.useCallback(async()=>{if(e&&n){const ee=M_(n,e);if(!ee)return;await j.mutateAsync(ee),z.workspace.list.invalidate()}else E(!0),A(!1)},[e,n,j,z]),K=re.useCallback(()=>{E(!0),A(!0)},[]),te=re.useCallback(async()=>{if(!v.trim())return;const ee=q?void 0:e??void 0,fe=M_(v.trim(),ee);if(!fe)return;const be=await j.mutateAsync(fe);r(be.id,be.name),E(!1),b(""),z.workspace.list.invalidate()},[v,q,e,j,r,z]),Q=re.useCallback(async ee=>{if(!a)return;const fe=await z.workspace.get.fetch({id:ee.id});if(fe.startTable){const ve=await z.schema.crawlFrom.fetch({connectionId:a,tableName:fe.startTable,schema:fe.startSchema,maxDepth:fe.depth});o(ve)}fe.schemaSnapshot&&u(fe.schemaSnapshot),s(),r(fe.id,fe.name);const be=new Map;for(const ve of fe.nodes){const _e=Zn(ve.schema,ve.tableName);l(_e,ve.position),ve.collapsed&&h(_e),ve.width&&f(_e,ve.width),ve.colorGroup&&be.set(_e,ve.colorGroup)}for(const ve of fe.ghostNodes)l(Zn(ve.schema,ve.tableName),ve.position);fe.colorAssignments&&p(fe.colorAssignments),be.size>0&&d(be),fe.crossSchemaExpansion!==void 0&&g(fe.crossSchemaExpansion)},[a,z,o,r,s,l,u,h,f,p,d,g]),J=re.useCallback(async ee=>{await D.mutateAsync({id:ee}),e===ee&&s(),O(null),z.workspace.list.invalidate()},[D,e,s,z]),ie=Object.keys(C),oe=N.data??[];return F.jsxs("div",{className:"workspace-panel",children:[F.jsx("h3",{children:"Workspaces"}),n&&F.jsxs("div",{className:"workspace-current",children:["Active: ",F.jsx("strong",{children:n})]}),F.jsxs("div",{className:"workspace-actions",children:[F.jsx("button",{onClick:B,disabled:j.isPending,children:j.isPending?"Saving...":"Save"}),F.jsx("button",{onClick:K,children:"Save As..."})]}),w&&F.jsxs("div",{className:"workspace-name-prompt",children:[F.jsx("input",{value:v,onChange:ee=>b(ee.target.value),placeholder:"Workspace name",onKeyDown:ee=>ee.key==="Enter"&&te(),autoFocus:!0}),F.jsx("button",{onClick:te,children:"OK"}),F.jsx("button",{onClick:()=>E(!1),children:"Cancel"})]}),F.jsx("div",{className:"workspace-option",children:F.jsxs("label",{className:"workspace-checkbox",children:[F.jsx("input",{type:"checkbox",checked:y,onChange:ee=>g(ee.target.checked)}),"Allow cross-schema expansion"]})}),ie.length>0&&F.jsxs("div",{className:"workspace-colors",children:[F.jsx("h4",{children:"Schema Colors"}),ie.map(ee=>F.jsxs("div",{className:"workspace-color-row",children:[F.jsx("span",{className:"workspace-color-label",children:ee==="__default__"?"(default)":ee}),F.jsxs("div",{className:"workspace-color-swatch-wrapper",children:[F.jsx("div",{className:"workspace-color-swatch",style:{background:C[ee]},onClick:()=>k(I===ee?null:ee)}),I===ee&&F.jsx("div",{className:"workspace-color-picker",children:O_.map(fe=>F.jsx("div",{className:`workspace-color-option ${fe===C[ee]?"selected":""}`,style:{background:fe},onClick:()=>{x(ee,fe),k(null)}},fe))})]})]},ee))]}),F.jsxs("div",{className:"workspace-list",children:[oe.map(ee=>F.jsxs("div",{className:`workspace-item ${ee.id===e?"active":""}`,children:[F.jsxs("div",{className:"workspace-item-info",onClick:()=>Q(ee),children:[F.jsx("div",{className:"workspace-item-name",children:ee.name}),F.jsxs("div",{className:"workspace-item-meta",children:[ee.databaseLabel," · ",new Date(ee.updatedAt).toLocaleDateString()]})]}),R===ee.id?F.jsxs("div",{className:"workspace-delete-confirm",children:[F.jsx("button",{onClick:()=>J(ee.id),children:"Confirm"}),F.jsx("button",{onClick:()=>O(null),children:"Cancel"})]}):F.jsx("button",{className:"workspace-delete-btn",onClick:()=>O(ee.id),children:"×"})]},ee.id)),oe.length===0&&F.jsx("div",{className:"workspace-empty",children:"No saved workspaces"})]})]})}function hK(){const e=qe(o=>o.schemaDiff),n=qe(o=>o.pollingEnabled),r=qe(o=>o.setPollingEnabled),s=qe(o=>o.acceptSchemaChanges),a=(e==null?void 0:e.changes.length)??0;return F.jsxs("div",{className:"diff-summary",children:[F.jsx("h3",{children:"Schema Sync"}),F.jsx("div",{className:"diff-summary-status",children:e!=null&&e.hasChanges?F.jsxs("span",{className:"diff-summary-changes",children:[a," change",a!==1?"s":""," detected"]}):F.jsx("span",{className:"diff-summary-synced",children:"Schema in sync"})}),F.jsxs("div",{className:"diff-summary-actions",children:[F.jsx("button",{className:"secondary",onClick:()=>r(!n),children:n?"Pause Polling":"Resume Polling"}),(e==null?void 0:e.hasChanges)&&F.jsx("button",{onClick:s,children:"Accept All Changes"})]})]})}var hf={exports:{}},df={},pf={},mf={},uj;function eP(){if(uj)return mf;uj=1,Object.defineProperty(mf,"__esModule",{value:!0});let e=class extends Error{};return mf.TimeoutError=e,mf}var Vn={},gf={},lj;function dK(){if(lj)return gf;lj=1,Object.defineProperty(gf,"__esModule",{value:!0});let e=class{constructor(r){this._value=r.value,this._error=r.error}value(){return this._value}reason(){return this._error}isRejected(){return!!this._error}isFulfilled(){return!!this._value}};return gf.PromiseInspection=e,gf}var cj;function ox(){if(cj)return Vn;cj=1,Object.defineProperty(Vn,"__esModule",{value:!0});const e=dK();function n(){let f=null,p=null;return{promise:new Promise((g,y)=>{f=g,p=y}),resolve:f,reject:p}}Vn.defer=n;function r(){return Date.now()}Vn.now=r;function s(f,p){return Math.abs(p-f)}Vn.duration=s;function a(f){return typeof f>"u"?!0:o(f)}Vn.checkOptionalTime=a;function o(f){return typeof f=="number"&&f===Math.round(f)&&f>0}Vn.checkRequiredTime=o;function l(f){return new Promise(p=>setTimeout(p,f))}Vn.delay=l;function u(f){return f.then(p=>new e.PromiseInspection({value:p})).catch(p=>new e.PromiseInspection({error:p}))}Vn.reflect=u;function h(f){try{const p=f();return Promise.resolve(p)}catch(p){return Promise.reject(p)}}return Vn.tryPromise=h,Vn}var fj;function pK(){if(fj)return pf;fj=1,Object.defineProperty(pf,"__esModule",{value:!0});const e=eP(),n=ox();let r=class{constructor(o){this.timeoutMillis=o,this.deferred=n.defer(),this.possibleTimeoutCause=null,this.isRejected=!1,this.promise=s(this.deferred.promise,o).catch(l=>(l instanceof e.TimeoutError&&(this.possibleTimeoutCause?l=new e.TimeoutError(this.possibleTimeoutCause.message):l=new e.TimeoutError("operation timed out for an unknown reason")),this.isRejected=!0,Promise.reject(l)))}abort(){this.reject(new Error("aborted"))}reject(o){this.deferred.reject(o)}resolve(o){this.deferred.resolve(o)}};pf.PendingOperation=r;function s(a,o){return new Promise((l,u)=>{const h=setTimeout(()=>u(new e.TimeoutError),o);a.then(f=>{clearTimeout(h),l(f)}).catch(f=>{clearTimeout(h),u(f)})})}return pf}var yf={},hj;function mK(){if(hj)return yf;hj=1,Object.defineProperty(yf,"__esModule",{value:!0});const e=ox();let n=class tP{constructor(s){this.resource=s,this.resource=s,this.timestamp=e.now(),this.deferred=e.defer()}get promise(){return this.deferred.promise}resolve(){return this.deferred.resolve(void 0),new tP(this.resource)}};return yf.Resource=n,yf}const gK={},yK=Object.freeze(Object.defineProperty({__proto__:null,default:gK},Symbol.toStringTag,{value:"Module"})),Qe=xz(yK);var dj;function vK(){if(dj)return df;dj=1,Object.defineProperty(df,"__esModule",{value:!0});const e=pK(),n=mK(),r=ox(),s=Qe,a=Qe;let o=class{constructor(f){if(this.destroyed=!1,this.emitter=new s.EventEmitter,f=f||{},!f.create)throw new Error("Tarn: opt.create function most be provided");if(!f.destroy)throw new Error("Tarn: opt.destroy function most be provided");if(typeof f.min!="number"||f.min<0||f.min!==Math.round(f.min))throw new Error("Tarn: opt.min must be an integer >= 0");if(typeof f.max!="number"||f.max<=0||f.max!==Math.round(f.max))throw new Error("Tarn: opt.max must be an integer > 0");if(f.min>f.max)throw new Error("Tarn: opt.max is smaller than opt.min");if(!r.checkOptionalTime(f.acquireTimeoutMillis))throw new Error("Tarn: invalid opt.acquireTimeoutMillis "+JSON.stringify(f.acquireTimeoutMillis));if(!r.checkOptionalTime(f.createTimeoutMillis))throw new Error("Tarn: invalid opt.createTimeoutMillis "+JSON.stringify(f.createTimeoutMillis));if(!r.checkOptionalTime(f.destroyTimeoutMillis))throw new Error("Tarn: invalid opt.destroyTimeoutMillis "+JSON.stringify(f.destroyTimeoutMillis));if(!r.checkOptionalTime(f.idleTimeoutMillis))throw new Error("Tarn: invalid opt.idleTimeoutMillis "+JSON.stringify(f.idleTimeoutMillis));if(!r.checkOptionalTime(f.reapIntervalMillis))throw new Error("Tarn: invalid opt.reapIntervalMillis "+JSON.stringify(f.reapIntervalMillis));if(!r.checkOptionalTime(f.createRetryIntervalMillis))throw new Error("Tarn: invalid opt.createRetryIntervalMillis "+JSON.stringify(f.createRetryIntervalMillis));const p={create:!0,validate:!0,destroy:!0,log:!0,min:!0,max:!0,acquireTimeoutMillis:!0,createTimeoutMillis:!0,destroyTimeoutMillis:!0,idleTimeoutMillis:!0,reapIntervalMillis:!0,createRetryIntervalMillis:!0,propagateCreateError:!0};for(const d of Object.keys(f))if(!p[d])throw new Error(`Tarn: unsupported option opt.${d}`);this.creator=f.create,this.destroyer=f.destroy,this.validate=typeof f.validate=="function"?f.validate:()=>!0,this.log=f.log||(()=>{}),this.acquireTimeoutMillis=f.acquireTimeoutMillis||3e4,this.createTimeoutMillis=f.createTimeoutMillis||3e4,this.destroyTimeoutMillis=f.destroyTimeoutMillis||5e3,this.idleTimeoutMillis=f.idleTimeoutMillis||3e4,this.reapIntervalMillis=f.reapIntervalMillis||1e3,this.createRetryIntervalMillis=f.createRetryIntervalMillis||200,this.propagateCreateError=!!f.propagateCreateError,this.min=f.min,this.max=f.max,this.used=[],this.free=[],this.pendingCreates=[],this.pendingAcquires=[],this.pendingDestroys=[],this.pendingValidations=[],this.destroyed=!1,this.interval=null,this.eventId=1}numUsed(){return this.used.length}numFree(){return this.free.length}numPendingAcquires(){return this.pendingAcquires.length}numPendingValidations(){return this.pendingValidations.length}numPendingCreates(){return this.pendingCreates.length}acquire(){const f=this.eventId++;this._executeEventHandlers("acquireRequest",f);const p=new e.PendingOperation(this.acquireTimeoutMillis);return this.pendingAcquires.push(p),p.promise=p.promise.then(d=>(this._executeEventHandlers("acquireSuccess",f,d),d)).catch(d=>(this._executeEventHandlers("acquireFail",f,d),l(this.pendingAcquires,p),Promise.reject(d))),this._tryAcquireOrCreate(),p}release(f){this._executeEventHandlers("release",f);for(let p=0,d=this.used.length;p<d;++p){const g=this.used[p];if(g.resource===f)return this.used.splice(p,1),this.free.push(g.resolve()),this._tryAcquireOrCreate(),!0}return!1}isEmpty(){return[this.numFree(),this.numUsed(),this.numPendingAcquires(),this.numPendingValidations(),this.numPendingCreates()].reduce((f,p)=>f+p)===0}check(){const f=r.now(),p=[],d=this.min-this.used.length,g=this.free.length-d;let y=0;this.free.forEach(C=>{r.duration(f,C.timestamp)>=this.idleTimeoutMillis&&y<g?(y++,this._destroy(C.resource)):p.push(C)}),this.free=p,this.isEmpty()&&this._stopReaping()}destroy(){const f=this.eventId++;return this._executeEventHandlers("poolDestroyRequest",f),this._stopReaping(),this.destroyed=!0,r.reflect(Promise.all(this.pendingCreates.map(p=>r.reflect(p.promise))).then(()=>new Promise((p,d)=>{if(this.numPendingValidations()===0){p();return}const g=setInterval(()=>{this.numPendingValidations()===0&&(a.clearInterval(g),p())},100)})).then(()=>Promise.all(this.used.map(p=>r.reflect(p.promise)))).then(()=>Promise.all(this.pendingAcquires.map(p=>(p.abort(),r.reflect(p.promise))))).then(()=>Promise.all(this.free.map(p=>r.reflect(this._destroy(p.resource))))).then(()=>Promise.all(this.pendingDestroys.map(p=>p.promise))).then(()=>{this.free=[],this.pendingAcquires=[]})).then(p=>(this._executeEventHandlers("poolDestroySuccess",f),this.emitter.removeAllListeners(),p))}on(f,p){this.emitter.on(f,p)}removeListener(f,p){this.emitter.removeListener(f,p)}removeAllListeners(f){this.emitter.removeAllListeners(f)}_tryAcquireOrCreate(){this.destroyed||(this._hasFreeResources()?this._doAcquire():this._shouldCreateMoreResources()&&this._doCreate())}_hasFreeResources(){return this.free.length>0}_doAcquire(){for(;this._canAcquire();){const f=this.pendingAcquires.shift(),p=this.free.pop();if(p===void 0||f===void 0){const g="this.free was empty while trying to acquire resource";throw this.log(`Tarn: ${g}`,"warn"),new Error(`Internal error, should never happen. ${g}`)}this.pendingValidations.push(f),this.used.push(p);const d=new e.PendingOperation(this.acquireTimeoutMillis);f.promise.catch(g=>{d.abort()}),d.promise.catch(g=>(this.log("Tarn: resource validator threw an exception "+g.stack,"warn"),!1)).then(g=>{try{g&&!f.isRejected?(this._startReaping(),f.resolve(p.resource)):(l(this.used,p),g?this.free.push(p):(this._destroy(p.resource),setTimeout(()=>{this._tryAcquireOrCreate()},0)),f.isRejected||this.pendingAcquires.unshift(f))}finally{l(this.pendingValidations,f)}}),this._validateResource(p.resource).then(g=>{d.resolve(g)}).catch(g=>{d.reject(g)})}}_canAcquire(){return this.free.length>0&&this.pendingAcquires.length>0}_validateResource(f){try{return Promise.resolve(this.validate(f))}catch(p){return Promise.reject(p)}}_shouldCreateMoreResources(){return this.used.length+this.pendingCreates.length<this.max&&this.pendingCreates.length<this.pendingAcquires.length}_doCreate(){const f=this.pendingAcquires.slice();this._create().promise.then(()=>(this._tryAcquireOrCreate(),null)).catch(d=>{this.propagateCreateError&&this.pendingAcquires.length!==0&&this.pendingAcquires[0].reject(d),f.forEach(g=>{g.possibleTimeoutCause=d}),r.delay(this.createRetryIntervalMillis).then(()=>this._tryAcquireOrCreate())})}_create(){const f=this.eventId++;this._executeEventHandlers("createRequest",f);const p=new e.PendingOperation(this.createTimeoutMillis);return p.promise=p.promise.catch(d=>{throw l(this.pendingCreates,p)&&this._executeEventHandlers("createFail",f,d),d}),this.pendingCreates.push(p),u(this.creator).then(d=>p.isRejected?(this.destroyer(d),null):(l(this.pendingCreates,p),this.free.push(new n.Resource(d)),p.resolve(d),this._executeEventHandlers("createSuccess",f,d),null)).catch(d=>(p.isRejected||(l(this.pendingCreates,p)&&this._executeEventHandlers("createFail",f,d),p.reject(d)),null)),p}_destroy(f){const p=this.eventId++;this._executeEventHandlers("destroyRequest",p,f);const d=new e.PendingOperation(this.destroyTimeoutMillis);return Promise.resolve().then(()=>this.destroyer(f)).then(()=>{d.resolve(f)}).catch(y=>{d.reject(y)}),this.pendingDestroys.push(d),d.promise.then(y=>(this._executeEventHandlers("destroySuccess",p,f),y)).catch(y=>this._logDestroyerError(p,f,y)).then(y=>{const C=this.pendingDestroys.findIndex(x=>x===d);return this.pendingDestroys.splice(C,1),y})}_logDestroyerError(f,p,d){this._executeEventHandlers("destroyFail",f,p,d),this.log("Tarn: resource destroyer threw an exception "+d.stack,"warn")}_startReaping(){this.interval||(this._executeEventHandlers("startReaping"),this.interval=setInterval(()=>this.check(),this.reapIntervalMillis))}_stopReaping(){this.interval!==null&&(this._executeEventHandlers("stopReaping"),a.clearInterval(this.interval)),this.interval=null}_executeEventHandlers(f,...p){this.emitter.listeners(f).forEach(g=>{try{g(...p)}catch(y){this.log(`Tarn: event handler "${f}" threw an exception ${y.stack}`,"warn")}})}};df.Pool=o;function l(h,f){const p=h.indexOf(f);return p===-1?!1:(h.splice(p,1),!0)}function u(h){return new Promise((f,p)=>{const d=(g,y)=>{g?p(g):f(y)};r.tryPromise(()=>h(d)).then(g=>{g&&f(g)}).catch(g=>{p(g)})})}return df}var pj;function bK(){return pj||(pj=1,(function(e,n){Object.defineProperty(n,"__esModule",{value:!0});const r=vK();n.Pool=r.Pool;const s=eP();n.TimeoutError=s.TimeoutError,e.exports={Pool:r.Pool,TimeoutError:s.TimeoutError}})(hf,hf.exports)),hf.exports}var j_,mj;function ux(){if(mj)return j_;mj=1;const e=/[\0\b\t\n\r\x1a"'\\]/g,n={"\0":"\\0","\b":"\\b"," ":"\\t","\n":"\\n","\r":"\\r","":"\\Z",'"':'\\"',"'":"\\'","\\":"\\\\"};function r(d){return function g(y,C={}){return d(y,g,C)}}function s(d={}){const g=d.escapeDate||h,y=d.escapeArray||o,C=d.escapeBuffer||l,x=d.escapeString||u,v=d.escapeObject||a,b=d.wrap||r;function w(E,q,A){if(E==null)return"NULL";switch(typeof E){case"boolean":return E?"true":"false";case"number":return E+"";case"object":if(E instanceof Date)E=g(E,q,A);else return Array.isArray(E)?y(E,q,A):Buffer.isBuffer(E)?C(E,q,A):v(E,q,A)}return x(E,q,A)}return b?b(w):w}function a(d,g,y){return d&&typeof d.toSQL=="function"?d.toSQL(y):JSON.stringify(d)}function o(d,g,y){let C="";for(let x=0;x<d.length;x++){const v=d[x];Array.isArray(v)?C+=(x===0?"":", ")+"("+o(v,g,y)+")":C+=(x===0?"":", ")+g(v,y)}return C}function l(d){return"X"+u(d.toString("hex"))}function u(d,g,y){let C=e.lastIndex=0,x="",v;for(;v=e.exec(d);)x+=d.slice(C,v.index)+n[v[0]],C=e.lastIndex;return C===0?"'"+d+"'":C<d.length?"'"+x+d.slice(C)+"'":"'"+x+"'"}function h(d,g,y={}){const C=y.timeZone||"local",x=new Date(d);let v,b,w,E,q,A,R;if(C==="local")v=x.getFullYear(),b=x.getMonth()+1,w=x.getDate(),E=x.getHours(),q=x.getMinutes(),A=x.getSeconds(),R=x.getMilliseconds();else{const O=p(C);O!==!1&&O!==0&&x.setTime(x.getTime()+O*6e4),v=x.getUTCFullYear(),b=x.getUTCMonth()+1,w=x.getUTCDate(),E=x.getUTCHours(),q=x.getUTCMinutes(),A=x.getUTCSeconds(),R=x.getUTCMilliseconds()}return f(v,4)+"-"+f(b,2)+"-"+f(w,2)+" "+f(E,2)+":"+f(q,2)+":"+f(A,2)+"."+f(R,3)}function f(d,g){for(d=d.toString();d.length<g;)d="0"+d;return d}function p(d){if(d==="Z")return 0;const g=d.match(/([+\-\s])(\d\d):?(\d\d)?/);return g?(g[1]=="-"?-1:1)*(parseInt(g[2],10)+(g[3]?parseInt(g[3],10):0)/60)*60:!1}return j_={arrayToList:o,bufferToString:l,dateToString:h,escapeString:u,charsRegex:e,charsMap:n,escapeObject:a,makeEscape:s},j_}var vf={},gj;function bo(){if(gj)return vf;gj=1;class e extends Error{constructor(s){super(s),this.name="KnexTimeoutError"}}function n(r,s){return new Promise(function(a,o){const l=setTimeout(function(){o(new e("operation timed out"))},s);function u(f){clearTimeout(l),a(f)}function h(f){clearTimeout(l),o(f)}r.then(u,h)})}return vf.KnexTimeoutError=e,vf.timeout=n,vf}var $_,yj;function _K(){if(yj)return $_;yj=1;function e(r){r.client.emit("start",r.builder),r.builder.emit("start",r.builder);const s=r.builder.toSQL();return r.builder._debug&&r.client.logger.debug(s),Array.isArray(s)?r.queryArray(s):r.query(s)}function n(r,s){try{const a=r.builder.toSQL();if(Array.isArray(a)&&s.hasHandler)throw new Error("The stream may only be used with a single query statement.");return r.client.stream(r.connection,a,s.stream,s.options)}catch(a){throw s.stream.emit("error",a),a}}return $_={ensureConnectionCallback:e,ensureConnectionStreamCallback:n},$_}var L_,vj;function wK(){if(vj)return L_;vj=1;const{KnexTimeoutError:e}=bo(),{timeout:n}=bo(),{ensureConnectionCallback:r,ensureConnectionStreamCallback:s}=_K();let a;class o{constructor(u,h){this.client=u,this.builder=h,this.queries=[],this.connection=void 0}async run(){const u=this;try{const h=await this.ensureConnection(r);return u.builder.emit("end"),h}catch(h){throw u.builder._events&&u.builder._events.error&&u.builder.emit("error",h),h}}stream(u,h){const f=typeof u=="function"&&arguments.length===1,p=f?{}:u,d=f?u:h,g=typeof d=="function";a=a||Qe.Transform;const y=this.builder.queryContext(),C=new a({objectMode:!0,transform:(v,b,w)=>{w(null,this.client.postProcessResponse(v,y))}});C.on("close",()=>{this.client.releaseConnection(this.connection)}),C.on("pipe",v=>{const b=()=>{v.closed||v.destroy()};C.closed?b():C.on("close",b)});const x=this.ensureConnection(s,{options:p,hasHandler:g,stream:C}).catch(v=>{this.connection||C.emit("error",v)});return g?(d(C),x):C}pipe(u,h){return this.stream(h).pipe(u)}async query(u){const{__knexUid:h,__knexTxId:f}=this.connection;this.builder.emit("query",Object.assign({__knexUid:h,__knexTxId:f},u));const p=this,d=this.builder.queryContext();u!==null&&typeof u=="object"&&(u.queryContext=d);let g=this.client.query(this.connection,u);return u.timeout&&(g=n(g,u.timeout)),g.then(y=>this.client.processResponse(y,p)).then(y=>{const C=this.client.postProcessResponse(y,d);return this.builder.emit("query-response",C,Object.assign({__knexUid:h,__knexTxId:f},u),this.builder),this.client.emit("query-response",C,Object.assign({__knexUid:h,__knexTxId:f},u),this.builder),C}).catch(y=>{if(!(y instanceof e))return Promise.reject(y);const{timeout:C,sql:x,bindings:v}=u;let b;return u.cancelOnTimeout?b=this.client.cancelQuery(this.connection):(this.connection.__knex__disposed=y,b=Promise.resolve()),b.catch(w=>{throw this.connection.__knex__disposed=y,Object.assign(w,{message:`After query timeout of ${C}ms exceeded, cancelling of query failed.`,sql:x,bindings:v,timeout:C})}).then(()=>{throw Object.assign(y,{message:`Defined query timeout of ${C}ms exceeded when running query.`,sql:x,bindings:v,timeout:C})})}).catch(y=>{throw this.builder.emit("query-error",y,Object.assign({__knexUid:h,__knexTxId:f,queryContext:d},u)),y})}async queryArray(u){if(u.length===1){const f=u[0];if(!f.statementsProducer)return this.query(f);const p=await f.statementsProducer(void 0,this.connection),d=p.sql.map(x=>({sql:x,bindings:f.bindings})),g=p.pre.map(x=>({sql:x,bindings:f.bindings})),y=p.post.map(x=>({sql:x,bindings:f.bindings}));let C=[];await this.queryArray(g);try{await this.client.transaction(async x=>{const v=new o(x.client,this.builder);if(v.connection=this.connection,C=await v.queryArray(d),p.check&&(await x.raw(p.check)).length>0)throw new Error("FOREIGN KEY constraint failed")},{connection:this.connection})}finally{await this.queryArray(y)}return C}const h=[];for(const f of u)h.push(await this.queryArray([f]));return h}async ensureConnection(u,h){if(this.builder._connection&&(this.connection=this.builder._connection),this.connection)return u(this,h);let f;try{f=await this.client.acquireConnection()}catch(p){if(!(p instanceof e))return Promise.reject(p);throw this.builder&&(p.sql=this.builder.sql,p.bindings=this.builder.bindings),p}try{return this.connection=f,await u(this,h)}finally{await this.client.releaseConnection(f)}}}return L_=o,L_}var bf={exports:{}},I_,bj;function CK(){if(bj)return I_;bj=1;var e=1e3,n=e*60,r=n*60,s=r*24,a=s*7,o=s*365.25;I_=function(p,d){d=d||{};var g=typeof p;if(g==="string"&&p.length>0)return l(p);if(g==="number"&&isFinite(p))return d.long?h(p):u(p);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))};function l(p){if(p=String(p),!(p.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(p);if(d){var g=parseFloat(d[1]),y=(d[2]||"ms").toLowerCase();switch(y){case"years":case"year":case"yrs":case"yr":case"y":return g*o;case"weeks":case"week":case"w":return g*a;case"days":case"day":case"d":return g*s;case"hours":case"hour":case"hrs":case"hr":case"h":return g*r;case"minutes":case"minute":case"mins":case"min":case"m":return g*n;case"seconds":case"second":case"secs":case"sec":case"s":return g*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return g;default:return}}}}function u(p){var d=Math.abs(p);return d>=s?Math.round(p/s)+"d":d>=r?Math.round(p/r)+"h":d>=n?Math.round(p/n)+"m":d>=e?Math.round(p/e)+"s":p+"ms"}function h(p){var d=Math.abs(p);return d>=s?f(p,d,s,"day"):d>=r?f(p,d,r,"hour"):d>=n?f(p,d,n,"minute"):d>=e?f(p,d,e,"second"):p+" ms"}function f(p,d,g,y){var C=d>=g*1.5;return Math.round(p/g)+" "+y+(C?"s":"")}return I_}var D_,_j;function EK(){if(_j)return D_;_j=1;function e(n){s.debug=s,s.default=s,s.coerce=f,s.disable=l,s.enable=o,s.enabled=u,s.humanize=CK(),s.destroy=p,Object.keys(n).forEach(d=>{s[d]=n[d]}),s.names=[],s.skips=[],s.formatters={};function r(d){let g=0;for(let y=0;y<d.length;y++)g=(g<<5)-g+d.charCodeAt(y),g|=0;return s.colors[Math.abs(g)%s.colors.length]}s.selectColor=r;function s(d){let g,y=null,C,x;function v(...b){if(!v.enabled)return;const w=v,E=Number(new Date),q=E-(g||E);w.diff=q,w.prev=g,w.curr=E,g=E,b[0]=s.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let A=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(O,I)=>{if(O==="%%")return"%";A++;const k=s.formatters[I];if(typeof k=="function"){const N=b[A];O=k.call(w,N),b.splice(A,1),A--}return O}),s.formatArgs.call(w,b),(w.log||s.log).apply(w,b)}return v.namespace=d,v.useColors=s.useColors(),v.color=s.selectColor(d),v.extend=a,v.destroy=s.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>y!==null?y:(C!==s.namespaces&&(C=s.namespaces,x=s.enabled(d)),x),set:b=>{y=b}}),typeof s.init=="function"&&s.init(v),v}function a(d,g){const y=s(this.namespace+(typeof g>"u"?":":g)+d);return y.log=this.log,y}function o(d){s.save(d),s.namespaces=d,s.names=[],s.skips=[];let g;const y=(typeof d=="string"?d:"").split(/[\s,]+/),C=y.length;for(g=0;g<C;g++)y[g]&&(d=y[g].replace(/\*/g,".*?"),d[0]==="-"?s.skips.push(new RegExp("^"+d.slice(1)+"$")):s.names.push(new RegExp("^"+d+"$")))}function l(){const d=[...s.names.map(h),...s.skips.map(h).map(g=>"-"+g)].join(",");return s.enable(""),d}function u(d){if(d[d.length-1]==="*")return!0;let g,y;for(g=0,y=s.skips.length;g<y;g++)if(s.skips[g].test(d))return!1;for(g=0,y=s.names.length;g<y;g++)if(s.names[g].test(d))return!0;return!1}function h(d){return d.toString().substring(2,d.toString().length-2).replace(/\.\*\?$/,"*")}function f(d){return d instanceof Error?d.stack||d.message:d}function p(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return s.enable(s.load()),s}return D_=e,D_}var wj;function tr(){return wj||(wj=1,(function(e,n){var r={};n.formatArgs=a,n.save=o,n.load=l,n.useColors=s,n.storage=u(),n.destroy=(()=>{let f=!1;return()=>{f||(f=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function s(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(f){if(f[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+f[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const p="color: "+this.color;f.splice(1,0,p,"color: inherit");let d=0,g=0;f[0].replace(/%[a-zA-Z%]/g,y=>{y!=="%%"&&(d++,y==="%c"&&(g=d))}),f.splice(g,0,p)}n.log=console.debug||console.log||(()=>{});function o(f){try{f?n.storage.setItem("debug",f):n.storage.removeItem("debug")}catch{}}function l(){let f;try{f=n.storage.getItem("debug")}catch{}return!f&&typeof process<"u"&&"env"in process&&(f=r.DEBUG),f}function u(){try{return localStorage}catch{}}e.exports=EK()(n);const{formatters:h}=e.exports;h.j=function(f){try{return JSON.stringify(f)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}})(bf,bf.exports)),bf.exports}var k_,Cj;function Hf(){return Cj||(Cj=1,k_=function(){}),k_}var B_,Ej;function xK(){if(Ej)return B_;Ej=1;class e{constructor(r){this.client=r}now(r){return typeof r=="number"?this.client.raw(`CURRENT_TIMESTAMP(${r})`):this.client.raw("CURRENT_TIMESTAMP")}uuid(){switch(this.client.driverName){case"sqlite3":case"better-sqlite3":return this.client.raw("(lower(hex(randomblob(4))) || '-' || lower(hex(randomblob(2))) || '-4' || substr(lower(hex(randomblob(2))),2) || '-' || substr('89ab',abs(random()) % 4 + 1, 1) || substr(lower(hex(randomblob(2))),2) || '-' || lower(hex(randomblob(6))))");case"mssql":return this.client.raw("(NEWID())");case"pg":case"pgnative":case"cockroachdb":return this.client.raw("(gen_random_uuid())");case"oracle":case"oracledb":return this.client.raw("(random_uuid())");case"mysql":case"mysql2":return this.client.raw("(UUID())");default:throw new Error(`${this.client.driverName} does not have a uuid function`)}}uuidToBin(r,s=!0){const a=Buffer.from(r.replace(/-/g,""),"hex");return s?Buffer.concat([a.slice(6,8),a.slice(4,6),a.slice(0,4),a.slice(8,16)]):Buffer.concat([a.slice(0,4),a.slice(4,6),a.slice(6,8),a.slice(8,16)])}binToUuid(r,s=!0){const a=Buffer.from(r,"hex");return s?[a.toString("hex",4,8),a.toString("hex",2,4),a.toString("hex",0,2),a.toString("hex",8,10),a.toString("hex",10,16)].join("-"):[a.toString("hex",0,4),a.toString("hex",4,6),a.toString("hex",6,8),a.toString("hex",8,10),a.toString("hex",10,16)].join("-")}}return B_=e,B_}var P_,xj;function nP(){return xj||(xj=1,P_=["with","withRecursive","withMaterialized","withNotMaterialized","select","as","columns","column","from","fromJS","fromRaw","into","withSchema","table","distinct","join","joinRaw","innerJoin","leftJoin","leftOuterJoin","rightJoin","rightOuterJoin","outerJoin","fullOuterJoin","crossJoin","where","andWhere","orWhere","whereNot","orWhereNot","whereLike","andWhereLike","orWhereLike","whereILike","andWhereILike","orWhereILike","whereRaw","whereWrapped","havingWrapped","orWhereRaw","whereExists","orWhereExists","whereNotExists","orWhereNotExists","whereIn","orWhereIn","whereNotIn","orWhereNotIn","whereNull","orWhereNull","whereNotNull","orWhereNotNull","whereBetween","whereNotBetween","andWhereBetween","andWhereNotBetween","orWhereBetween","orWhereNotBetween","groupBy","groupByRaw","orderBy","orderByRaw","union","unionAll","intersect","except","having","havingRaw","orHaving","orHavingRaw","offset","limit","count","countDistinct","min","max","sum","sumDistinct","avg","avgDistinct","increment","decrement","first","debug","pluck","clearSelect","clearWhere","clearGroup","clearOrder","clearHaving","insert","update","returning","del","delete","truncate","transacting","connection","jsonExtract","jsonSet","jsonInsert","jsonRemove","whereJsonObject","orWhereJsonObject","andWhereJsonObject","whereNotJsonObject","orWhereNotJsonObject","andWhereNotJsonObject","whereJsonPath","orWhereJsonPath","andWhereJsonPath","whereJsonSupersetOf","orWhereJsonSupersetOf","andWhereJsonSupersetOf","whereJsonNotSupersetOf","orWhereJsonNotSupersetOf","andWhereJsonNotSupersetOf","whereJsonSubsetOf","orWhereJsonSubsetOf","andWhereJsonSubsetOf","whereJsonNotSubsetOf","orWhereJsonNotSubsetOf","andWhereJsonNotSubsetOf"]),P_}var z_,Sj;function rP(){if(Sj)return z_;Sj=1;function e(n,r,s){var a=-1,o=n.length;r<0&&(r=-r>o?0:o+r),s=s>o?o:s,s<0&&(s+=o),o=r>s?0:s-r>>>0,r>>>=0;for(var l=Array(o);++a<o;)l[a]=n[a+r];return l}return z_=e,z_}var U_,Tj;function SK(){if(Tj)return U_;Tj=1;var e=rP(),n=To(),r=rx(),s=Math.ceil,a=Math.max;function o(l,u,h){(h?n(l,u,h):u===void 0)?u=1:u=a(r(u),0);var f=l==null?0:l.length;if(!f||u<1)return[];for(var p=0,d=0,g=Array(s(f/u));p<f;)g[d++]=e(l,p,p+=u);return g}return U_=o,U_}var Q_,qj;function TK(){return qj||(qj=1,Q_=e=>new Promise(n=>setTimeout(n,e))),Q_}var H_,Aj;function mt(){if(Aj)return H_;Aj=1;function e(l){return typeof l=="string"}function n(l){return typeof l=="number"}function r(l){return typeof l=="boolean"}function s(l){return typeof l>"u"}function a(l){return typeof l=="object"&&l!==null}function o(l){return typeof l=="function"}return H_={isString:e,isNumber:n,isBoolean:r,isUndefined:s,isObject:a,isFunction:o},H_}var V_,Nj;function qK(){if(Nj)return V_;Nj=1;const e=SK(),n=Ch(),r=TK(),{isNumber:s}=mt();function a(o,l,u,h=1e3){let f,p=null;if(!s(h)||h<1)throw new TypeError(`Invalid chunkSize: ${h}`);if(!Array.isArray(u))throw new TypeError(`Invalid batch: Expected array, got ${typeof u}`);const d=e(u,h),g=y=>p?y(p):o.transaction(y);return Object.assign(Promise.resolve().then(async()=>(await r(1),g(async y=>{const C=[];for(const x of d)C.push(await y(l).insert(x,f));return n(C)}))),{returning(y){return f=y,this},transacting(y){return p=y,this}})}return V_=a,V_}var F_,Rj;function lx(){if(Rj)return F_;Rj=1;function e(n,r,s="password"){r||(r=n),Object.defineProperty(n,s,{enumerable:!1,value:r[s]})}return F_={setHiddenProperty:e},F_}var G_,Oj;function iP(){if(Oj)return G_;Oj=1;const{EventEmitter:e}=Qe,{Migrator:n}=Hf(),r=Hf(),s=xK(),a=nP(),o=XB(),l=qK(),{isObject:u}=mt(),{setHiddenProperty:h}=lx(),f={client:{get(){return this.context.client},set(w){this.context.client=w},configurable:!0},userParams:{get(){return this.context.userParams},set(w){this.context.userParams=w},configurable:!0},schema:{get(){return this.client.schemaBuilder()},configurable:!0},migrate:{get(){return new n(this)},configurable:!0},seed:{get(){return new r(this)},configurable:!0},fn:{get(){return new s(this.client)},configurable:!0}},p=["raw","batchInsert","transaction","transactionProvider","initialize","destroy","ref","withUserParams","queryBuilder","disableProcessing","enableProcessing"];for(const w of p)f[w]={value:function(...E){return this.context[w](...E)},configurable:!0};function d(w){function E(q,A){return v(E.context,q,A)}return C(E,w),E}function g(w){const E=w.context||{};Object.assign(E,{queryBuilder(){return this.client.queryBuilder()},raw(){return this.client.raw.apply(this.client,arguments)},batchInsert(q,A,R=1e3){return l(this,q,A,R)},transaction(q,A){!A&&u(q)&&(A=q,q=null);const R=Object.assign({},A);return R.userParams=this.userParams||{},R.doNotRejectOnRollback===void 0&&(R.doNotRejectOnRollback=!0),this._transaction(q,R)},_transaction(q,A,R=null){return q?this.client.transaction(q,A,R):new Promise((O,I)=>{this.client.transaction(O,A,R).catch(I)})},transactionProvider(q){let A;return()=>(A||(A=this.transaction(void 0,q)),A)},initialize(q){return this.client.initializePool(q)},destroy(q){return this.client.destroy(q)},ref(q){return this.client.ref(q)},disableProcessing(){this.userParams.isProcessingDisabled||(this.userParams.wrapIdentifier=this.client.config.wrapIdentifier,this.userParams.postProcessResponse=this.client.config.postProcessResponse,this.client.config.wrapIdentifier=null,this.client.config.postProcessResponse=null,this.userParams.isProcessingDisabled=!0)},enableProcessing(){this.userParams.isProcessingDisabled&&(this.client.config.wrapIdentifier=this.userParams.wrapIdentifier,this.client.config.postProcessResponse=this.userParams.postProcessResponse,this.userParams.isProcessingDisabled=!1)},withUserParams(q){const A=b(w);return this.client&&(A.client=Object.create(this.client.constructor.prototype),o(A.client,this.client),A.client.config=Object.assign({},this.client.config),this.client.config.password&&h(A.client.config,this.client.config)),C(A,A.client),y("query",w,A),y("query-error",w,A),y("query-response",w,A),y("start",w,A),A.userParams=q,A}}),w.context||(w.context=E)}function y(w,E,q){E.listeners(w).forEach(R=>{q.on(w,R)})}function C(w,E){for(let A=0;A<a.length;A++){const R=a[A];w[R]=function(){const O=this.queryBuilder();return O[R].apply(O,arguments)}}Object.defineProperties(w,f),g(w),w.client=E,w.userParams={};const q=new e;for(const A in q)w[A]=q[A];w._internalListeners&&w._internalListeners.forEach(({eventName:A,listener:R})=>{w.client.removeListener(A,R)}),w._internalListeners=[],x(w,"start",A=>{w.emit("start",A)}),x(w,"query",A=>{w.emit("query",A)}),x(w,"query-error",(A,R)=>{w.emit("query-error",A,R)}),x(w,"query-response",(A,R,O)=>{w.emit("query-response",A,R,O)})}function x(w,E,q){w.client.on(E,q),w._internalListeners.push({eventName:E,listener:q})}function v(w,E,q){const A=w.queryBuilder();return E||w.client.logger.warn("calling knex without a tableName is deprecated. Use knex.queryBuilder() instead."),E?A.table(E,q):A}function b(w){const E=Object.create(Object.getPrototypeOf(w),Object.getOwnPropertyDescriptors(w)),q={},R=((O,I)=>v(q,O,I)).bind(E);return Object.assign(R,w),R.context=q,R}return G_=d,G_}var K_,Mj;function sP(){if(Mj)return K_;Mj=1;const e=Hf(),n=r=>Object.assign(r,{finally(s){return this.then().finally(s)}});return K_=Promise.prototype.finally?n:e,K_}var Y_,jj;function Ji(){if(jj)return Y_;jj=1;const{EventEmitter:e}=Qe,n=tr(),r=ax(),{callbackify:s}=Qe,a=iP(),{timeout:o,KnexTimeoutError:l}=bo(),u=sP(),h=n("knex:tx");function f(){return{userParams:{},doNotRejectOnRollback:!0}}const p=["read uncommitted","read committed","snapshot","repeatable read","serializable"];class d extends e{constructor(v,b,w=f(),E=null){super(),this.userParams=w.userParams,this.doNotRejectOnRollback=w.doNotRejectOnRollback;const q=this.txid=r("trx");this.client=v,this.logger=v.logger,this.outerTx=E,this.trxClient=void 0,this._completed=!1,this._debug=v.config&&v.config.debug,this.readOnly=w.readOnly,w.isolationLevel&&this.setIsolationLevel(w.isolationLevel),h("%s: Starting %s transaction",q,E?"nested":"top level"),this._lastChild=Promise.resolve();const R=(E?E._lastChild:Promise.resolve()).then(()=>this._evaluateContainer(w,b));this._promise=R.then(O=>O),E&&(E._lastChild=R.catch(()=>{}))}isCompleted(){return this._completed||this.outerTx&&this.outerTx.isCompleted()||!1}begin(v){const b=[this.isolationLevel?`ISOLATION LEVEL ${this.isolationLevel}`:"",this.readOnly?"READ ONLY":""].join(" ").trim();return b.length===0?this.query(v,"BEGIN;"):this.query(v,`SET TRANSACTION ${b};`).then(()=>this.query(v,"BEGIN;"))}savepoint(v){return this.query(v,`SAVEPOINT ${this.txid};`)}commit(v,b){return this.query(v,"COMMIT;",1,b)}release(v,b){return this.query(v,`RELEASE SAVEPOINT ${this.txid};`,1,b)}setIsolationLevel(v){if(!p.includes(v))throw new Error(`Invalid isolationLevel, supported isolation levels are: ${JSON.stringify(p)}`);return this.isolationLevel=v,this}rollback(v,b){return o(this.query(v,"ROLLBACK",2,b),5e3).catch(w=>{if(!(w instanceof l))return Promise.reject(w);this._rejecter(b)})}rollbackTo(v,b){return o(this.query(v,`ROLLBACK TO SAVEPOINT ${this.txid}`,2,b),5e3).catch(w=>{if(!(w instanceof l))return Promise.reject(w);this._rejecter(b)})}query(v,b,w,E){const q=this.trxClient.query(v,b).catch(A=>{w=2,E=A,this._completed=!0,h("%s error running transaction query",this.txid)}).then(A=>{if(w===1&&this._resolver(E),w===2){if(E===void 0){if(this.doNotRejectOnRollback&&/^ROLLBACK\b/i.test(b)){this._resolver();return}E=new Error(`Transaction rejected with non-error: ${E}`)}this._rejecter(E)}return A});return(w===1||w===2)&&(this._completed=!0),q}debug(v){return this._debug=arguments.length?v:!0,this}async _evaluateContainer(v,b){return this.acquireConnection(v,w=>{const E=this.trxClient=y(this,this.client,w),q=this.client.transacting?this.savepoint(w):this.begin(w),A=new Promise((R,O)=>{this._resolver=R,this._rejecter=O});return q.then(()=>g(this,w,E)).then(R=>{this.transactor=R,this.outerTx&&(R.parentTransaction=this.outerTx.transactor),R.executionPromise=A;let O;try{O=b(R)}catch(I){O=Promise.reject(I)}return O&&O.then&&typeof O.then=="function"&&O.then(I=>R.commit(I)).catch(I=>R.rollback(I)),null}).catch(R=>this._rejecter(R)),A})}async acquireConnection(v,b){const w=v&&v.connection,E=w||await this.client.acquireConnection();try{return E.__knexTxId=this.txid,await b(E)}finally{w?h("%s: not releasing external connection",this.txid):(h("%s: releasing connection",this.txid),this.client.releaseConnection(E))}}then(v,b){return this._promise.then(v,b)}catch(...v){return this._promise.catch(...v)}asCallback(v){return s(()=>this._promise)(v),this._promise}}u(d.prototype);function g(x,v,b){const w=a(b);return w.context.withUserParams=()=>{throw new Error("Cannot set user params on a transaction - it can only inherit params from main knex instance")},w.isTransaction=!0,w.userParams=x.userParams||{},w.context.transaction=function(E,q){return q?q.doNotRejectOnRollback===void 0&&(q.doNotRejectOnRollback=!0):q={doNotRejectOnRollback:!0},this._transaction(E,q,x)},w.savepoint=function(E,q){return w.transaction(E,q)},x.client.transacting?(w.commit=E=>x.release(v,E),w.rollback=E=>x.rollbackTo(v,E)):(w.commit=E=>x.commit(v,E),w.rollback=E=>x.rollback(v,E)),w.isCompleted=()=>x.isCompleted(),w}function y(x,v,b){const w=Object.create(v.constructor.prototype);w.version=v.version,w.config=v.config,w.driver=v.driver,w.connectionSettings=v.connectionSettings,w.transacting=!0,w.valueForUndefined=v.valueForUndefined,w.logger=v.logger,w.on("start",function(A){x.emit("start",A),v.emit("start",A)}),w.on("query",function(A){x.emit("query",A),v.emit("query",A)}),w.on("query-error",function(A,R){x.emit("query-error",A,R),v.emit("query-error",A,R)}),w.on("query-response",function(A,R,O){x.emit("query-response",A,R,O),v.emit("query-response",A,R,O)});const E=w.query;w.query=function(A,R){const O=x.isCompleted();return new Promise(function(I,k){try{if(A!==b)throw new Error("Invalid connection for transaction query.");O&&C(x,R),I(E.call(w,A,R))}catch(N){k(N)}})};const q=w.stream;return w.stream=function(A,R,O,I){const k=x.isCompleted();return new Promise(function(N,j){try{if(A!==b)throw new Error("Invalid connection for transaction query.");k&&C(x,R),N(q.call(w,A,R,O,I))}catch(D){j(D)}})},w.acquireConnection=function(){return Promise.resolve(b)},w.releaseConnection=function(){return Promise.resolve()},w}function C(x,v){const b=typeof v=="string"?v:v&&v.sql;throw h("%s: Transaction completed: %s",x.txid,b),new Error("Transaction query already complete, run with DEBUG=knex:tx for more info")}return Y_=d,Y_}var X_,$j;function aP(){if($j)return X_;$j=1;const e=tr()("knex:query"),n=tr()("knex:bindings"),r=(u,h)=>e(u.replace(/%/g,"%%"),h),{isString:s}=mt();function a(u,h,f,p){h=h==null?[]:[].concat(h);let d=0;return u.replace(/\\?\?/g,g=>{if(g==="\\?")return"?";if(d===h.length)return g;const y=h[d++];return p._escapeBinding(y,{timeZone:f})})}function o(u,h,f){const p=s(h)?{sql:h}:h;p.bindings=f.prepBindings(p.bindings),p.sql=f.positionBindings(p.sql);const{__knexUid:d,__knexTxId:g}=u;return f.emit("query",Object.assign({__knexUid:d,__knexTxId:g},p)),r(p.sql,g),n(p.bindings,g),p}function l(u,h,f){return f._query(u,h).catch(p=>{throw f.config&&f.config.compileSqlOnError===!1?p.message=h.sql+" - "+p.message:p.message=a(h.sql,h.bindings,void 0,f)+" - "+p.message,f.emit("query-error",p,Object.assign({__knexUid:u.__knexUid,__knexTxId:u.__knexUid},h)),p})}return X_={enrichQueryObject:o,executeQuery:l,formatQuery:a},X_}var W_,Lj;function Zs(){if(Lj)return W_;Lj=1;var e=bl(),n=Ys(),r=sx(),s=sr(),a=wl(),o=ei(),l=Object.prototype,u=l.hasOwnProperty,h=r(function(f,p){if(a(p)||s(p)){n(p,o(p),f);return}for(var d in p)u.call(p,d)&&e(f,d,p[d])});return W_=h,W_}var J_,Ij;function oP(){if(Ij)return J_;Ij=1;var e="Expected a function";function n(r){if(typeof r!="function")throw new TypeError(e);return function(){var s=arguments;switch(s.length){case 0:return!r.call(this);case 1:return!r.call(this,s[0]);case 2:return!r.call(this,s[0],s[1]);case 3:return!r.call(this,s[0],s[1],s[2])}return!r.apply(this,s)}}return J_=n,J_}var Z_,Dj;function AK(){if(Dj)return Z_;Dj=1;var e=FE(),n=gB(),r=mn(),s=vt(),a=oP();function o(l,u){var h=s(l)?e:n;return h(l,a(r(u,3)))}return Z_=o,Z_}var e0,kj;function Eh(){if(kj)return e0;kj=1;var e=rP();function n(r){var s=r==null?0:r.length;return s?e(r,1,s):[]}return e0=n,e0}var t0,Bj;function NK(){if(Bj)return t0;Bj=1;function e(n){for(var r,s=[];!(r=n.next()).done;)s.push(r.value);return s}return t0=e,t0}var n0,Pj;function RK(){if(Pj)return n0;Pj=1;function e(n){return n.split("")}return n0=e,n0}var r0,zj;function OK(){if(zj)return r0;zj=1;var e="\\ud800-\\udfff",n="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",s="\\u20d0-\\u20ff",a=n+r+s,o="\\ufe0e\\ufe0f",l="["+e+"]",u="["+a+"]",h="\\ud83c[\\udffb-\\udfff]",f="(?:"+u+"|"+h+")",p="[^"+e+"]",d="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",y="\\u200d",C=f+"?",x="["+o+"]?",v="(?:"+y+"(?:"+[p,d,g].join("|")+")"+x+C+")*",b=x+C+v,w="(?:"+[p+u+"?",u,d,g,l].join("|")+")",E=RegExp(h+"(?="+h+")|"+w+b,"g");function q(A){return A.match(E)||[]}return r0=q,r0}var i0,Uj;function MK(){if(Uj)return i0;Uj=1;var e=RK(),n=MB(),r=OK();function s(a){return n(a)?r(a):e(a)}return i0=s,i0}var s0,Qj;function Sl(){if(Qj)return s0;Qj=1;var e=Fs(),n=VE(),r=Xs(),s=sr(),a=OB(),o=NK(),l=wB(),u=vh(),h=MK(),f=wh(),p="[object Map]",d="[object Set]",g=e?e.iterator:void 0;function y(C){if(!C)return[];if(s(C))return a(C)?h(C):n(C);if(g&&C[g])return o(C[g]());var x=r(C),v=x==p?l:x==d?u:f;return v(C)}return s0=y,s0}var a0,Hj;function cx(){if(Hj)return a0;Hj=1;const e=Object.freeze({pg:"postgres",postgresql:"postgres",sqlite:"sqlite3"}),n=Object.freeze(["mssql","mysql","mysql2","oracledb","postgres","pgnative","redshift","sqlite3","cockroachdb","better-sqlite3"].concat(Object.keys(e))),r=Object.freeze({MsSQL:"mssql",MySQL:"mysql",MySQL2:"mysql2",Oracle:"oracledb",PostgreSQL:"pg",PgNative:"pgnative",Redshift:"pg-redshift",SQLite:"sqlite3",CockroachDB:"cockroachdb",BetterSQLite3:"better-sqlite3"}),s=Object.freeze(["maxWaitingClients","testOnBorrow","fifo","priorityRange","autostart","evictionRunIntervalMillis","numTestsPerRun","softIdleTimeoutMillis","Promise"]);return a0={CLIENT_ALIASES:e,SUPPORTED_CLIENTS:n,POOL_CONFIG_OPTIONS:s,COMMA_NO_PAREN_REGEX:/,[\s](?![^(]*\))/g,DRIVER_NAMES:r},a0}var o0,Vj;function Qt(){if(Vj)return o0;Vj=1;const e=Wi(),n=Co(),{CLIENT_ALIASES:r}=cx(),{isFunction:s}=mt();function a(...p){return Array.isArray(p[0])?p[0]:p}function o(p){let d=!1;if(n(p))return!1;if(p&&s(p.toSQL))return d;if(Array.isArray(p))for(let g=0;g<p.length&&!d;g++)d=o(p[g]);else e(p)?Object.keys(p).forEach(g=>{d||(d=o(p[g]))}):d=p===void 0;return d}function l(p){const d=[];return Array.isArray(p)?p.forEach((g,y)=>{o(g)&&d.push(y)}):e(p)?Object.keys(p).forEach(g=>{o(p[g])&&d.push(g)}):d.push(0),d}function u(p){p.prototype.queryContext=function(d){return d===void 0?this._queryContext:(this._queryContext=d,this)}}function h(p){return r[p]||p}function f(p,d){if(p==null)return d;const g=parseInt(p,10);return isNaN(g)?d:g}return o0={addQueryContext:u,containsUndefined:o,getUndefinedIndices:l,normalizeArr:a,resolveClientNameWithAliases:h,toNumber:f},o0}var u0,Fj;function uP(){if(Fj)return u0;Fj=1;const e=Qe;function n(s,a,o,l,u){if(typeof o=="function")return{type:"onWrapped",value:o,bool:a};switch(arguments.length){case 3:return{type:"onRaw",value:o,bool:a};case 4:return{type:s,column:o,operator:"=",value:l,bool:a};default:return{type:s,column:o,operator:l,value:u,bool:a}}}class r{constructor(a,o,l){this.schema=l,this.table=a,this.joinType=o,this.and=this,this.clauses=[]}get or(){return this._bool("or")}on(a){if(typeof a=="object"&&typeof a.toSQL!="function"){const l=Object.keys(a);let u=-1;const h=this._bool()==="or"?"orOn":"on";for(;++u<l.length;)this[h](l[u],a[l[u]]);return this}const o=n("onBasic",this._bool(),...arguments);return o&&this.clauses.push(o),this}orOn(a,o,l){return this._bool("or").on.apply(this,arguments)}onJsonPathEquals(a,o,l,u){return this.clauses.push({type:"onJsonPathEquals",columnFirst:a,jsonPathFirst:o,columnSecond:l,jsonPathSecond:u,bool:this._bool(),not:this._not()}),this}orOnJsonPathEquals(a,o,l,u){return this._bool("or").onJsonPathEquals.apply(this,arguments)}using(a){return this.clauses.push({type:"onUsing",column:a,bool:this._bool()})}onVal(a){if(typeof a=="object"&&typeof a.toSQL!="function"){const l=Object.keys(a);let u=-1;const h=this._bool()==="or"?"orOnVal":"onVal";for(;++u<l.length;)this[h](l[u],a[l[u]]);return this}const o=n("onVal",this._bool(),...arguments);return o&&this.clauses.push(o),this}andOnVal(){return this.onVal(...arguments)}orOnVal(){return this._bool("or").onVal(...arguments)}onBetween(a,o){return e(Array.isArray(o),"The second argument to onBetween must be an array."),e(o.length===2,"You must specify 2 values for the onBetween clause"),this.clauses.push({type:"onBetween",column:a,value:o,bool:this._bool(),not:this._not()}),this}onNotBetween(a,o){return this._not(!0).onBetween(a,o)}orOnBetween(a,o){return this._bool("or").onBetween(a,o)}orOnNotBetween(a,o){return this._bool("or")._not(!0).onBetween(a,o)}onIn(a,o){return Array.isArray(o)&&o.length===0?this.on(1,"=",0):(this.clauses.push({type:"onIn",column:a,value:o,not:this._not(),bool:this._bool()}),this)}onNotIn(a,o){return this._not(!0).onIn(a,o)}orOnIn(a,o){return this._bool("or").onIn(a,o)}orOnNotIn(a,o){return this._bool("or")._not(!0).onIn(a,o)}onNull(a){return this.clauses.push({type:"onNull",column:a,not:this._not(),bool:this._bool()}),this}orOnNull(a){return this._bool("or").onNull(a)}onNotNull(a){return this._not(!0).onNull(a)}orOnNotNull(a){return this._not(!0)._bool("or").onNull(a)}onExists(a){return this.clauses.push({type:"onExists",value:a,not:this._not(),bool:this._bool()}),this}orOnExists(a){return this._bool("or").onExists(a)}onNotExists(a){return this._not(!0).onExists(a)}orOnNotExists(a){return this._not(!0)._bool("or").onExists(a)}type(a){return this.joinType=a,this}_bool(a){if(arguments.length===1)return this._boolFlag=a,this;const o=this._boolFlag||"and";return this._boolFlag="and",o}_not(a){if(arguments.length===1)return this._notFlag=a,this;const o=this._notFlag;return this._notFlag=!1,o}}return Object.assign(r.prototype,{grouping:"join"}),r.prototype.andOn=r.prototype.on,r.prototype.andOnIn=r.prototype.onIn,r.prototype.andOnNotIn=r.prototype.onNotIn,r.prototype.andOnNull=r.prototype.onNull,r.prototype.andOnNotNull=r.prototype.onNotNull,r.prototype.andOnExists=r.prototype.onExists,r.prototype.andOnNotExists=r.prototype.onNotExists,r.prototype.andOnBetween=r.prototype.onBetween,r.prototype.andOnNotBetween=r.prototype.onNotBetween,r.prototype.andOnJsonPathEquals=r.prototype.onJsonPathEquals,u0=r,u0}var l0,Gj;function jK(){if(Gj)return l0;Gj=1;const e=Qe;class n{constructor(s,a,o,l,u){this.schema=a,this.type="analytic",this.method=s,this.order=l||[],this.partitions=u||[],this.alias=o,this.and=this,this.grouping="columns"}partitionBy(s,a){return e(Array.isArray(s)||typeof s=="string",`The argument to an analytic partitionBy function must be either a string
72
+ or an array of string.`),Array.isArray(s)?this.partitions=this.partitions.concat(s):this.partitions.push({column:s,order:a}),this}orderBy(s,a){return e(Array.isArray(s)||typeof s=="string",`The argument to an analytic orderBy function must be either a string
73
+ or an array of string.`),Array.isArray(s)?this.order=this.order.concat(s):this.order.push({column:s,order:a}),this}}return l0=n,l0}var c0,Kj;function fx(){return Kj||(Kj=1,c0=function(n,r){n.client.config.asyncStackTraces&&(n._asyncStack={error:new Error,lines:r})}),c0}var f0,Yj;function $K(){return Yj||(Yj=1,f0={lockMode:{forShare:"forShare",forUpdate:"forUpdate",forNoKeyUpdate:"forNoKeyUpdate",forKeyShare:"forKeyShare"},waitMode:{skipLocked:"skipLocked",noWait:"noWait"}}),f0}var h0,Xj;function hx(){if(Xj)return h0;Xj=1;const e=gh(),n=qn(),{callbackify:r}=Qe,s=sP(),{formatQuery:a}=aP();function o(l){l.prototype.toQuery=function(u){let h=this.toSQL(this._method,u);return Array.isArray(h)||(h=[h]),h.length?h.map(f=>a(f.sql,f.bindings,u,this.client)).reduce((f,p)=>f.concat(f.endsWith(";")?`
74
+ `:`;
75
+ `,p)):""},l.prototype.then=function(){let u=this.client.runner(this).run();return this.client.config.asyncStackTraces&&(u=u.catch(h=>{h.originalStack=h.stack;const f=h.stack.split(`
76
+ `)[0],{error:p,lines:d}=this._asyncStack,y=p.stack.split(`
77
+ `).slice(d);throw y.unshift(f),h.stack=y.join(`
78
+ `),h})),u.then.apply(u,arguments)},l.prototype.options=function(u){return this._options=this._options||[],this._options.push(e(u)||{}),this},l.prototype.connection=function(u){return this._connection=u,this.client.processPassedConnection(u),this},l.prototype.debug=function(u){return this._debug=arguments.length?u:!0,this},l.prototype.transacting=function(u){if(u&&u.client&&(u.client.transacting?this.client=u.client:u.client.logger.warn(`Invalid transaction value: ${u.client}`)),n(u))throw this.client.logger.error("Invalid value on transacting call, potential bug"),Error("Invalid transacting value (null, undefined or empty object)");return this},l.prototype.stream=function(u){return this.client.runner(this).stream(u)},l.prototype.pipe=function(u,h){return this.client.runner(this).pipe(u,h)},l.prototype.asCallback=function(u){const h=this.then();return r(()=>h)(u),h},l.prototype.catch=function(u){return this.then().catch(u)},Object.defineProperty(l.prototype,Symbol.toStringTag,{get:()=>"object"}),s(l.prototype)}return h0={augmentWithBuilderInterface:o},h0}var d0,Wj;function ni(){if(Wj)return d0;Wj=1;const e=Qe,{EventEmitter:n}=Qe,r=Zs(),s=gh(),a=Ws(),o=qn(),l=Wi(),u=GB(),h=AK(),f=Eh(),p=Sl(),{addQueryContext:d,normalizeArr:g}=Qt(),y=uP(),C=jK(),x=fx(),{isBoolean:v,isNumber:b,isObject:w,isString:E,isFunction:q}=mt(),{lockMode:A,waitMode:R}=$K(),{augmentWithBuilderInterface:O}=hx(),I=new Set(["pluck","first","select"]),k=new Set(["with","select","columns","hintComments","where","union","join","group","order","having","limit","offset","counter","counters"]),N=new Set([A.forShare,A.forUpdate,A.forNoKeyUpdate,A.forKeyShare]);class j extends n{constructor(T){super(),this.client=T,this.and=this,this._single={},this._comments=[],this._statements=[],this._method="select",T.config&&(x(this,5),this._debug=T.config.debug),this._joinFlag="inner",this._boolFlag="and",this._notFlag=!1,this._asColumnFlag=!1}toString(){return this.toQuery()}toSQL(T,M){return this.client.queryCompiler(this).toSQL(T||this._method,M)}clone(){const T=new this.constructor(this.client);return T._method=this._method,T._single=s(this._single),T._comments=s(this._comments),T._statements=s(this._statements),T._debug=this._debug,this._options!==void 0&&(T._options=s(this._options)),this._queryContext!==void 0&&(T._queryContext=s(this._queryContext)),this._connection!==void 0&&(T._connection=this._connection),T}timeout(T,{cancel:M}={}){return b(T)&&T>0&&(this._timeout=T,M&&(this.client.assertCanCancelQuery(),this._cancelOnTimeout=!0)),this}isValidStatementArg(T){return typeof T=="function"||T instanceof j||T&&T.isRawInstance}_validateWithArgs(T,M,$,P){const[H,G]=typeof $>"u"?[M,void 0]:[$,M];if(typeof T!="string")throw new Error(`${P}() first argument must be a string`);if(this.isValidStatementArg(H)&&typeof G>"u")return;if(!(Array.isArray(G)&&G.length>0&&G.every(B=>typeof B=="string")))throw new Error(`${P}() second argument must be a statement or non-empty column name list.`);if(!this.isValidStatementArg(H))throw new Error(`${P}() third argument must be a function / QueryBuilder or a raw when its second argument is a column name list`)}with(T,M,$){return this._validateWithArgs(T,M,$,"with"),this.withWrapped(T,M,$)}withMaterialized(T,M,$){throw new Error("With materialized is not supported by this dialect")}withNotMaterialized(T,M,$){throw new Error("With materialized is not supported by this dialect")}withWrapped(T,M,$,P){const[H,G]=typeof $>"u"?[M,void 0]:[$,M],V={grouping:"with",type:"withWrapped",alias:T,columnList:G,value:H};return P!==void 0&&(V.materialized=P),this._statements.push(V),this}withRecursive(T,M,$){return this._validateWithArgs(T,M,$,"withRecursive"),this.withRecursiveWrapped(T,M,$)}withRecursiveWrapped(T,M,$){return this.withWrapped(T,M,$),this._statements[this._statements.length-1].recursive=!0,this}columns(T){return!T&&T!==0?this:(this._statements.push({grouping:"columns",value:g(...arguments)}),this)}comment(T){if(!E(T))throw new Error("Comment must be a string");const M=["/*","*/","?"];if(M.some($=>T.includes($)))throw new Error(`Cannot include ${M.join(", ")} in comment`);return this._comments.push({comment:T}),this}as(T){return this._single.as=T,this}hintComment(T){if(T=Array.isArray(T)?T:[T],T.some(M=>!E(M)))throw new Error("Hint comment must be a string");if(T.some(M=>M.includes("/*")||M.includes("*/")))throw new Error('Hint comment cannot include "/*" or "*/"');if(T.some(M=>M.includes("?")))throw new Error('Hint comment cannot include "?"');return this._statements.push({grouping:"hintComments",value:T}),this}withSchema(T){return this._single.schema=T,this}table(T,M={}){return this._single.table=T,this._single.only=M.only===!0,this}distinct(...T){return this._statements.push({grouping:"columns",value:g(...T),distinct:!0}),this}distinctOn(...T){if(o(T))throw new Error("distinctOn requires at least on argument");return this._statements.push({grouping:"columns",value:g(...T),distinctOn:!0}),this}join(T,M,...$){let P;const H=T instanceof j||typeof T=="function"?void 0:this._single.schema,G=this._joinType();return typeof M=="function"?(P=new y(T,G,H),M.call(P,P)):G==="raw"?P=new y(this.client.raw(T,M),"raw"):(P=new y(T,G,H),M&&P.on(M,...$)),this._statements.push(P),this}using(T){throw new Error("'using' function is only available in PostgreSQL dialect with Delete statements.")}innerJoin(...T){return this._joinType("inner").join(...T)}leftJoin(...T){return this._joinType("left").join(...T)}leftOuterJoin(...T){return this._joinType("left outer").join(...T)}rightJoin(...T){return this._joinType("right").join(...T)}rightOuterJoin(...T){return this._joinType("right outer").join(...T)}outerJoin(...T){return this._joinType("outer").join(...T)}fullOuterJoin(...T){return this._joinType("full outer").join(...T)}crossJoin(...T){return this._joinType("cross").join(...T)}joinRaw(...T){return this._joinType("raw").join(...T)}get or(){return this._bool("or")}get not(){return this._not(!0)}where(T,M,$){const P=arguments.length;if(T===!1||T===!0)return this.where(1,"=",T?1:0);if(typeof T=="function")return this.whereWrapped(T);if(w(T)&&!T.isRawInstance)return this._objectWhere(T);if(T&&T.isRawInstance&&P===1)return this.whereRaw(T);if(P===2&&($=M,M="=",$===null))return this.whereNull(T);const H=`${M}`.toLowerCase().trim();if(P===3){if(H==="in"||H==="not in")return this._not(H==="not in").whereIn(T,$);if(H==="between"||H==="not between")return this._not(H==="not between").whereBetween(T,$)}return $===null&&(H==="is"||H==="is not")?this._not(H==="is not").whereNull(T):(this._statements.push({grouping:"where",type:"whereBasic",column:T,operator:M,value:$,not:this._not(),bool:this._bool(),asColumn:this._asColumnFlag}),this)}whereColumn(...T){return this._asColumnFlag=!0,this.where(...T),this._asColumnFlag=!1,this}orWhere(T,...M){this._bool("or");const $=T;return w($)&&!$.isRawInstance?this.whereWrapped(function(){for(const P in $)this.andWhere(P,$[P])}):this.where(T,...M)}orWhereColumn(T,...M){this._bool("or");const $=T;return w($)&&!$.isRawInstance?this.whereWrapped(function(){for(const P in $)this.andWhereColumn(P,"=",$[P])}):this.whereColumn(T,...M)}whereNot(T,...M){return M.length>=2&&(M[0]==="in"||M[0]==="between")&&this.client.logger.warn('whereNot is not suitable for "in" and "between" type subqueries. You should use "not in" and "not between" instead.'),this._not(!0).where(T,...M)}whereNotColumn(...T){return this._not(!0).whereColumn(...T)}orWhereNot(...T){return this._bool("or").whereNot(...T)}orWhereNotColumn(...T){return this._bool("or").whereNotColumn(...T)}_objectWhere(T){const M=this._bool(),$=this._not()?"Not":"";for(const P in T)this[M+"Where"+$](P,T[P]);return this}whereRaw(T,M){const $=T.isRawInstance?T:this.client.raw(T,M);return this._statements.push({grouping:"where",type:"whereRaw",value:$,not:this._not(),bool:this._bool()}),this}orWhereRaw(T,M){return this._bool("or").whereRaw(T,M)}whereWrapped(T){return this._statements.push({grouping:"where",type:"whereWrapped",value:T,not:this._not(),bool:this._bool()}),this}whereExists(T){return this._statements.push({grouping:"where",type:"whereExists",value:T,not:this._not(),bool:this._bool()}),this}orWhereExists(T){return this._bool("or").whereExists(T)}whereNotExists(T){return this._not(!0).whereExists(T)}orWhereNotExists(T){return this._bool("or").whereNotExists(T)}whereIn(T,M){return Array.isArray(M)&&o(M)?this.where(this._not()):(this._statements.push({grouping:"where",type:"whereIn",column:T,value:M,not:this._not(),bool:this._bool()}),this)}orWhereIn(T,M){return this._bool("or").whereIn(T,M)}whereNotIn(T,M){return this._not(!0).whereIn(T,M)}orWhereNotIn(T,M){return this._bool("or")._not(!0).whereIn(T,M)}whereNull(T){return this._statements.push({grouping:"where",type:"whereNull",column:T,not:this._not(),bool:this._bool()}),this}orWhereNull(T){return this._bool("or").whereNull(T)}whereNotNull(T){return this._not(!0).whereNull(T)}orWhereNotNull(T){return this._bool("or").whereNotNull(T)}whereBetween(T,M){return e(Array.isArray(M),"The second argument to whereBetween must be an array."),e(M.length===2,"You must specify 2 values for the whereBetween clause"),this._statements.push({grouping:"where",type:"whereBetween",column:T,value:M,not:this._not(),bool:this._bool()}),this}whereNotBetween(T,M){return this._not(!0).whereBetween(T,M)}orWhereBetween(T,M){return this._bool("or").whereBetween(T,M)}orWhereNotBetween(T,M){return this._bool("or").whereNotBetween(T,M)}_whereLike(T,M,$){return this._statements.push({grouping:"where",type:T,column:M,value:$,not:this._not(),bool:this._bool(),asColumn:this._asColumnFlag}),this}whereLike(T,M){return this._whereLike("whereLike",T,M)}orWhereLike(T,M){return this._bool("or")._whereLike("whereLike",T,M)}whereILike(T,M){return this._whereLike("whereILike",T,M)}orWhereILike(T,M){return this._bool("or")._whereLike("whereILike",T,M)}groupBy(T){return T&&T.isRawInstance?this.groupByRaw.apply(this,arguments):(this._statements.push({grouping:"group",type:"groupByBasic",value:g(...arguments)}),this)}groupByRaw(T,M){const $=T.isRawInstance?T:this.client.raw(T,M);return this._statements.push({grouping:"group",type:"groupByRaw",value:$}),this}orderBy(T,M,$=""){return Array.isArray(T)?this._orderByArray(T):(this._statements.push({grouping:"order",type:"orderByBasic",value:T,direction:M,nulls:$}),this)}_orderByArray(T){for(let M=0;M<T.length;M++){const $=T[M];w($)?this._statements.push({grouping:"order",type:"orderByBasic",value:$.column,direction:$.order,nulls:$.nulls}):(E($)||b($))&&this._statements.push({grouping:"order",type:"orderByBasic",value:$})}return this}orderByRaw(T,M){const $=T.isRawInstance?T:this.client.raw(T,M);return this._statements.push({grouping:"order",type:"orderByRaw",value:$}),this}_union(T,M){let $=M[0],P=M[1];if(M.length===1||M.length===2&&v(P)){Array.isArray($)||($=[$]);for(let H=0,G=$.length;H<G;H++)this._statements.push({grouping:"union",clause:T,value:$[H],wrap:P||!1})}else $=p(M).slice(0,M.length-1),P=M[M.length-1],v(P)||($.push(P),P=!1),this._union(T,[$,P]);return this}union(...T){return this._union("union",T)}unionAll(...T){return this._union("union all",T)}intersect(...T){return this._union("intersect",T)}except(...T){return this._union("except",T)}having(T,M,$){return T.isRawInstance&&arguments.length===1?this.havingRaw(T):typeof T=="function"?this.havingWrapped(T):(this._statements.push({grouping:"having",type:"havingBasic",column:T,operator:M,value:$,bool:this._bool(),not:this._not()}),this)}orHaving(T,...M){this._bool("or");const $=T;return w($)&&!$.isRawInstance?this.havingWrapped(function(){for(const P in $)this.andHaving(P,$[P])}):this.having(T,...M)}havingWrapped(T){return this._statements.push({grouping:"having",type:"havingWrapped",value:T,bool:this._bool(),not:this._not()}),this}havingNull(T){return this._statements.push({grouping:"having",type:"havingNull",column:T,not:this._not(),bool:this._bool()}),this}orHavingNull(T){return this._bool("or").havingNull(T)}havingNotNull(T){return this._not(!0).havingNull(T)}orHavingNotNull(T){return this._not(!0)._bool("or").havingNull(T)}havingExists(T){return this._statements.push({grouping:"having",type:"havingExists",value:T,not:this._not(),bool:this._bool()}),this}orHavingExists(T){return this._bool("or").havingExists(T)}havingNotExists(T){return this._not(!0).havingExists(T)}orHavingNotExists(T){return this._not(!0)._bool("or").havingExists(T)}havingBetween(T,M){return e(Array.isArray(M),"The second argument to havingBetween must be an array."),e(M.length===2,"You must specify 2 values for the havingBetween clause"),this._statements.push({grouping:"having",type:"havingBetween",column:T,value:M,not:this._not(),bool:this._bool()}),this}orHavingBetween(T,M){return this._bool("or").havingBetween(T,M)}havingNotBetween(T,M){return this._not(!0).havingBetween(T,M)}orHavingNotBetween(T,M){return this._not(!0)._bool("or").havingBetween(T,M)}havingIn(T,M){return Array.isArray(M)&&o(M)?this.where(this._not()):(this._statements.push({grouping:"having",type:"havingIn",column:T,value:M,not:this._not(),bool:this._bool()}),this)}orHavingIn(T,M){return this._bool("or").havingIn(T,M)}havingNotIn(T,M){return this._not(!0).havingIn(T,M)}orHavingNotIn(T,M){return this._bool("or")._not(!0).havingIn(T,M)}havingRaw(T,M){const $=T.isRawInstance?T:this.client.raw(T,M);return this._statements.push({grouping:"having",type:"havingRaw",value:$,bool:this._bool(),not:this._not()}),this}orHavingRaw(T,M){return this._bool("or").havingRaw(T,M)}_setSkipBinding(T,M){let $=M;w(M)&&($=M.skipBinding),this._single.skipBinding=this._single.skipBinding||{},this._single.skipBinding[T]=$}offset(T,M){if(T==null||T.isRawInstance||T instanceof j)this._single.offset=T;else{const $=parseInt(T,10);if(isNaN($))this.client.logger.warn("A valid integer must be provided to offset");else{if($<0)throw new Error("A non-negative integer must be provided to offset.");this._single.offset=$}}return this._setSkipBinding("offset",M),this}limit(T,M){const $=parseInt(T,10);return isNaN($)?this.client.logger.warn("A valid integer must be provided to limit"):(this._single.limit=$,this._setSkipBinding("limit",M)),this}count(T,M){return this._aggregate("count",T||"*",M)}min(T,M){return this._aggregate("min",T,M)}max(T,M){return this._aggregate("max",T,M)}sum(T,M){return this._aggregate("sum",T,M)}avg(T,M){return this._aggregate("avg",T,M)}countDistinct(...T){let M;return T.length>1&&l(u(T))&&([M]=T.splice(T.length-1,1)),T.length?T.length===1&&(T=T[0]):T="*",this._aggregate("count",T,{...M,distinct:!0})}sumDistinct(T,M){return this._aggregate("sum",T,{...M,distinct:!0})}avgDistinct(T,M){return this._aggregate("avg",T,{...M,distinct:!0})}increment(T,M=1){if(w(T)){for(const $ in T)this._counter($,T[$]);return this}return this._counter(T,M)}decrement(T,M=1){if(w(T)){for(const $ in T)this._counter($,-T[$]);return this}return this._counter(T,-M)}clearCounters(){return this._single.counter={},this}first(...T){if(this._method&&this._method!=="select")throw new Error(`Cannot chain .first() on "${this._method}" query`);return this.select(g(...T)),this._method="first",this.limit(1),this}connection(T){return this._connection=T,this.client.processPassedConnection(T),this}pluck(T){if(this._method&&this._method!=="select")throw new Error(`Cannot chain .pluck() on "${this._method}" query`);return this._method="pluck",this._single.pluck=T,this._statements.push({grouping:"columns",type:"pluck",value:T}),this}clearSelect(){return this._clearGrouping("columns"),this}clearWhere(){return this._clearGrouping("where"),this}clearGroup(){return this._clearGrouping("group"),this}clearOrder(){return this._clearGrouping("order"),this}clearHaving(){return this._clearGrouping("having"),this}clear(T){if(!k.has(T))throw new Error(`Knex Error: unknown statement '${T}'`);return T.startsWith("counter")?this.clearCounters():(T==="select"&&(T="columns"),this._clearGrouping(T),this)}insert(T,M,$){return this._method="insert",o(M)||this.returning(M,$),this._single.insert=T,this}update(T,M,$){let P;const H=this._single.update||{};if(this._method="update",E(T))l(M)?H[T]=JSON.stringify(M):H[T]=M,arguments.length>2&&(P=arguments[2]);else{const G=Object.keys(T);this._single.update&&this.client.logger.warn("Update called multiple times with objects.");let V=-1;for(;++V<G.length;)H[G[V]]=T[G[V]];P=arguments[1]}return o(P)||this.returning(P,$),this._single.update=H,this}returning(T,M){return this._single.returning=T,this._single.options=M,this}onConflict(T){return typeof T=="string"&&(T=[T]),new D(this,T||!0)}delete(T,M){return this._method="del",o(T)||this.returning(T,M),this}truncate(T){return this._method="truncate",T&&(this._single.table=T),this}columnInfo(T){return this._method="columnInfo",this._single.columnInfo=T,this}forUpdate(...T){return this._single.lock=A.forUpdate,T.length===1&&Array.isArray(T[0])?this._single.lockTables=T[0]:this._single.lockTables=T,this}forShare(...T){return this._single.lock=A.forShare,this._single.lockTables=T,this}forNoKeyUpdate(...T){return this._single.lock=A.forNoKeyUpdate,this._single.lockTables=T,this}forKeyShare(...T){return this._single.lock=A.forKeyShare,this._single.lockTables=T,this}skipLocked(){if(!this._isSelectQuery())throw new Error(`Cannot chain .skipLocked() on "${this._method}" query!`);if(!this._hasLockMode())throw new Error(".skipLocked() can only be used after a call to .forShare() or .forUpdate()!");if(this._single.waitMode===R.noWait)throw new Error(".skipLocked() cannot be used together with .noWait()!");return this._single.waitMode=R.skipLocked,this}noWait(){if(!this._isSelectQuery())throw new Error(`Cannot chain .noWait() on "${this._method}" query!`);if(!this._hasLockMode())throw new Error(".noWait() can only be used after a call to .forShare() or .forUpdate()!");if(this._single.waitMode===R.skipLocked)throw new Error(".noWait() cannot be used together with .skipLocked()!");return this._single.waitMode=R.noWait,this}fromJS(T){return a(T,(M,$)=>{typeof this[$]!="function"&&this.client.logger.warn(`Knex Error: unknown key ${$}`),Array.isArray(M)?this[$].apply(this,M):this[$](M)}),this}fromRaw(T,M){const $=T.isRawInstance?T:this.client.raw(T,M);return this.from($)}modify(T){return T.apply(this,[this].concat(f(arguments))),this}upsert(T,M,$){throw new Error(`Upsert is not yet supported for dialect ${this.client.dialect}`)}_json(T,M){return this._statements.push({grouping:"columns",type:"json",method:T,params:M}),this}jsonExtract(){const T=arguments[0];let M,$,P=!0;return arguments.length>=2&&(M=arguments[1]),arguments.length>=3&&($=arguments[2]),arguments.length===4&&(P=arguments[3]),arguments.length===2&&Array.isArray(arguments[0])&&v(arguments[1])&&(P=arguments[1]),this._json("jsonExtract",{column:T,path:M,alias:$,singleValue:P})}jsonSet(T,M,$,P){return this._json("jsonSet",{column:T,path:M,value:$,alias:P})}jsonInsert(T,M,$,P){return this._json("jsonInsert",{column:T,path:M,value:$,alias:P})}jsonRemove(T,M,$){return this._json("jsonRemove",{column:T,path:M,alias:$})}_isJsonObject(T){return w(T)&&!(T instanceof j)}_whereJsonWrappedValue(T,M,$){const P={grouping:"where",type:T,column:M,value:$,not:this._not(),bool:this._bool(),asColumn:this._asColumnFlag};arguments[3]&&(P.operator=arguments[3]),arguments[4]&&(P.jsonPath=arguments[4]),this._statements.push(P)}whereJsonObject(T,M){return this._whereJsonWrappedValue("whereJsonObject",T,M),this}orWhereJsonObject(T,M){return this._bool("or").whereJsonObject(T,M)}whereNotJsonObject(T,M){return this._not(!0).whereJsonObject(T,M)}orWhereNotJsonObject(T,M){return this._bool("or").whereNotJsonObject(T,M)}whereJsonPath(T,M,$,P){return this._whereJsonWrappedValue("whereJsonPath",T,P,$,M),this}orWhereJsonPath(T,M,$,P){return this._bool("or").whereJsonPath(T,M,$,P)}whereJsonSupersetOf(T,M){return this._whereJsonWrappedValue("whereJsonSupersetOf",T,M),this}whereJsonNotSupersetOf(T,M){return this._not(!0).whereJsonSupersetOf(T,M)}orWhereJsonSupersetOf(T,M){return this._bool("or").whereJsonSupersetOf(T,M)}orWhereJsonNotSupersetOf(T,M){return this._bool("or").whereJsonNotSupersetOf(T,M)}whereJsonSubsetOf(T,M){return this._whereJsonWrappedValue("whereJsonSubsetOf",T,M),this}whereJsonNotSubsetOf(T,M){return this._not(!0).whereJsonSubsetOf(T,M)}orWhereJsonSubsetOf(T,M){return this._bool("or").whereJsonSubsetOf(T,M)}orWhereJsonNotSubsetOf(T,M){return this._bool("or").whereJsonNotSubsetOf(T,M)}whereJsonHasNone(T,M){return this._not(!0).whereJsonHasAll(T,M),this}_analytic(T,M,$){let P;const{schema:H}=this._single,G=this._analyticMethod();if(T=typeof T=="string"?T:null,e(typeof M=="function"||M.isRawInstance||Array.isArray(M)||typeof M=="string"||typeof M=="object",`The second argument to an analytic function must be either a function, a raw,
79
+ an array of string or object, an object or a single string.`),$&&e(Array.isArray($)||typeof $=="string"||typeof $=="object","The third argument to an analytic function must be either a string, an array of string or object or an object."),q(M))P=new C(G,H,T),M.call(P,P);else if(M.isRawInstance)P={grouping:"columns",type:"analytic",method:G,raw:M,alias:T};else{const V=Array.isArray(M)?M:[M];let B=$||[];B=Array.isArray(B)?B:[B],P={grouping:"columns",type:"analytic",method:G,order:V,alias:T,partitions:B}}return this._statements.push(P),this}rank(...T){return this._analyticMethod("rank")._analytic(...T)}denseRank(...T){return this._analyticMethod("dense_rank")._analytic(...T)}rowNumber(...T){return this._analyticMethod("row_number")._analytic(...T)}_counter(T,M){return M=parseFloat(M),this._method="update",this._single.counter=this._single.counter||{},this._single.counter[T]=M,this}_bool(T){if(arguments.length===1)return this._boolFlag=T,this;const M=this._boolFlag;return this._boolFlag="and",M}_not(T){if(arguments.length===1)return this._notFlag=T,this;const M=this._notFlag;return this._notFlag=!1,M}_joinType(T){if(arguments.length===1)return this._joinFlag=T,this;const M=this._joinFlag||"inner";return this._joinFlag="inner",M}_analyticMethod(T){return arguments.length===1?(this._analyticFlag=T,this):this._analyticFlag||"row_number"}_aggregate(T,M,$={}){return this._statements.push({grouping:"columns",type:M.isRawInstance?"aggregateRaw":"aggregate",method:T,value:M,aggregateDistinct:$.distinct||!1,alias:$.as}),this}_clearGrouping(T){T in this._single?this._single[T]=void 0:this._statements=h(this._statements,{grouping:T})}_isSelectQuery(){return I.has(this._method)}_hasLockMode(){return N.has(this._single.lock)}}j.prototype.select=j.prototype.columns,j.prototype.column=j.prototype.columns,j.prototype.andWhereNot=j.prototype.whereNot,j.prototype.andWhereNotColumn=j.prototype.whereNotColumn,j.prototype.andWhere=j.prototype.where,j.prototype.andWhereColumn=j.prototype.whereColumn,j.prototype.andWhereRaw=j.prototype.whereRaw,j.prototype.andWhereBetween=j.prototype.whereBetween,j.prototype.andWhereNotBetween=j.prototype.whereNotBetween,j.prototype.andWhereJsonObject=j.prototype.whereJsonObject,j.prototype.andWhereNotJsonObject=j.prototype.whereNotJsonObject,j.prototype.andWhereJsonPath=j.prototype.whereJsonPath,j.prototype.andWhereLike=j.prototype.whereLike,j.prototype.andWhereILike=j.prototype.whereILike,j.prototype.andHaving=j.prototype.having,j.prototype.andHavingIn=j.prototype.havingIn,j.prototype.andHavingNotIn=j.prototype.havingNotIn,j.prototype.andHavingNull=j.prototype.havingNull,j.prototype.andHavingNotNull=j.prototype.havingNotNull,j.prototype.andHavingExists=j.prototype.havingExists,j.prototype.andHavingNotExists=j.prototype.havingNotExists,j.prototype.andHavingBetween=j.prototype.havingBetween,j.prototype.andHavingNotBetween=j.prototype.havingNotBetween,j.prototype.from=j.prototype.table,j.prototype.into=j.prototype.table,j.prototype.del=j.prototype.delete,O(j),d(j),j.extend=(z,T)=>{if(Object.prototype.hasOwnProperty.call(j.prototype,z))throw new Error(`Can't extend QueryBuilder with existing method ('${z}').`);r(j.prototype,{[z]:T})};class D{constructor(T,M){this.builder=T,this._columns=M}ignore(){return this.builder._single.onConflict=this._columns,this.builder._single.ignore=!0,this.builder}merge(T){return this.builder._single.onConflict=this._columns,this.builder._single.merge={updates:T},this.builder}then(){throw new Error("Incomplete onConflict clause. .onConflict() must be directly followed by either .merge() or .ignore()")}}return d0=j,d0}var p0,Jj;function ea(){if(Jj)return p0;Jj=1;const{isObject:e}=mt();function n(a,o,l,u){const h=l.queryBuilder();return a.call(h,h),l.queryCompiler(h,u.bindings).toSQL(o||h._method||"select")}function r(a,o,l){const u=o.queryContext();return l.wrapIdentifier((a||"").trim(),u)}function s(a,o,l){return a===void 0?"":a===null?"null":a&&a.isRawInstance?a.toQuery():o==="bool"?(a==="false"&&(a=0),`'${a?1:0}'`):(o==="json"||o==="jsonb")&&e(a)?`'${JSON.stringify(a)}'`:l._escapeBinding(a.toString())}return p0={compileCallback:n,wrapAsIdentifier:r,formatDefault:s},p0}var m0,Zj;function Vt(){if(Zj)return m0;Zj=1;const e=jB(),n=ni(),{compileCallback:r,wrapAsIdentifier:s}=ea(),a=["asc","desc"],o=e(["=","<",">","<=",">=","<>","!=","like","not like","between","not between","ilike","not ilike","exists","not exist","rlike","not rlike","regexp","not regexp","match","&","|","^","<<",">>","~","~=","~*","!~","!~*","#","&&","@>","<@","||","&<","&>","-|-","@@","!!",["?","\\?"],["?|","\\?|"],["?&","\\?&"]],(x,v)=>{Array.isArray(v)?x[v[0]]=v[1]:x[v]=v},{});function l(x,v,b,w){const E=Array.isArray(x)?x:[x];let q="",A=-1;for(;++A<E.length;)A>0&&(q+=", "),q+=u(E[A],void 0,v,b,w);return q}function u(x,v,b,w,E){const q=h(x,v,b,w,E);if(q)return q;switch(typeof x){case"function":return g(r(x,void 0,w,E),!0,b,w);case"object":return d(x,b,w,E);case"number":return x;default:return p(x+"",b,w)}}function h(x,v,b,w,E){let q;if(x instanceof n)return q=w.queryCompiler(x).toSQL(),q.bindings&&E.bindings.push(...q.bindings),g(q,v,b,w);if(x&&x.isRawInstance)return x.client=w,b._queryContext&&(x.queryContext=()=>b._queryContext),q=x.toSQL(),q.bindings&&E.bindings.push(...q.bindings),q.sql;v&&E.bindings.push(x)}function f(x,v,b,w){const E=h(x,void 0,v,b,w);if(E)return E;const q=o[(x||"").toLowerCase()];if(!q)throw new TypeError(`The operator "${x}" is not permitted`);return q}function p(x,v,b){const w=x.toLowerCase().indexOf(" as ");if(w!==-1){const R=x.slice(0,w),O=x.slice(w+4);return b.alias(p(R,v,b),s(O,v,b))}const E=[];let q=-1;const A=x.split(".");for(;++q<A.length;)x=A[q],q===0&&A.length>1?E.push(p((x||"").trim(),v,b)):E.push(s(x,v,b));return E.join(".")}function d(x,v,b,w){const E=[];for(const q in x){const A=x[q];if(typeof A=="function"){const R=r(A,void 0,b,w);R.as=q,E.push(g(R,!0,v,b))}else A instanceof n?E.push(b.alias(`(${u(A,void 0,v,b,w)})`,s(q,v,b))):E.push(b.alias(u(A,void 0,v,b,w),s(q,v,b)))}return E.join(", ")}function g(x,v,b,w){let E=x.sql||"";return E&&(x.method==="select"||x.method==="first")&&(v||x.as)&&(E=`(${E})`,x.as)?w.alias(E,p(x.as,b,w)):E}function y(x,v,b,w,E){return typeof x=="function"?g(r(x,v,w,E),void 0,b,w):h(x,void 0,b,w,E)||""}function C(x,v,b,w){const E=h(x,void 0,v,b,w);return E||(a.indexOf((x||"").toLowerCase())!==-1?x:"asc")}return m0={columnize:l,direction:C,operator:f,outputQuery:g,rawOrFn:y,unwrapRaw:h,wrap:u,wrapString:p},m0}var g0,e$;function LK(){if(e$)return g0;e$=1;const{columnize:e}=Vt();function n(s,a){const o={bindings:[]},l=s,u=s.bindings.length,h=s.bindings;let f=0;const p=s.sql.replace(/\\?\?\??/g,function(d){if(d==="\\?")return d;const g=h[f++];return d==="??"?e(g,l,a,o):a.parameter(g,l,o)});if(u!==f)throw new Error(`Expected ${u} bindings, saw ${f}`);return{method:"raw",sql:p,bindings:o.bindings}}function r(s,a){const o={bindings:[]},l=s,u=s.bindings,h=/\\?(:(\w+):(?=::)|:(\w+):(?!:)|:(\w+))/g;return{method:"raw",sql:s.sql.replace(h,function(p,d,g,y,C){if(p!==d)return d;const x=g||y||C,v=p.trim(),b=v[v.length-1]===":",w=u[x];return w===void 0?(Object.prototype.hasOwnProperty.call(u,x)&&o.bindings.push(w),p):b?p.replace(d,e(w,l,a,o)):p.replace(d,a.parameter(w,l,o))}),bindings:o.bindings}}return g0={replaceKeyBindings:r,replaceRawArrBindings:n},g0}var y0,t$;function dx(){if(t$)return y0;t$=1;const e="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",n="0123456789";function r(a=21){let o="",l=a;for(;l--;)o+=e[Math.random()*64|0];return o}function s(a=21){let o="",l=a;for(;l--;)o+=n[Math.random()*10|0];return o}return y0={nanoid:r,nanonum:s},y0}var v0,n$;function qo(){if(n$)return v0;n$=1;const{EventEmitter:e}=Qe,n=tr(),r=Zs(),s=Wi(),a=Js(),{replaceRawArrBindings:o,replaceKeyBindings:l}=LK(),u=Qt(),h=fx(),{nanoid:f}=dx(),{isNumber:p,isObject:d}=mt(),{augmentWithBuilderInterface:g}=hx(),y=n("knex:bindings");class C extends e{constructor(v){super(),this.client=v,this.sql="",this.bindings=[],this._wrappedBefore=void 0,this._wrappedAfter=void 0,v&&v.config&&(this._debug=v.config.debug,h(this,4))}set(v,b){return this.sql=v,this.bindings=d(b)&&!b.toSQL||b===void 0?b:[b],this}timeout(v,{cancel:b}={}){return p(v)&&v>0&&(this._timeout=v,b&&(this.client.assertCanCancelQuery(),this._cancelOnTimeout=!0)),this}wrap(v,b){return this._wrappedBefore=v,this._wrappedAfter=b,this}toString(){return this.toQuery()}toSQL(v,b){let w;if(Array.isArray(this.bindings)?w=o(this,this.client):this.bindings&&s(this.bindings)?w=l(this,this.client):w={method:"raw",sql:this.sql,bindings:this.bindings===void 0?[]:[this.bindings]},this._wrappedBefore&&(w.sql=this._wrappedBefore+w.sql),this._wrappedAfter&&(w.sql=w.sql+this._wrappedAfter),w.options=a(this._options,r,{}),this._timeout&&(w.timeout=this._timeout,this._cancelOnTimeout&&(w.cancelOnTimeout=this._cancelOnTimeout)),w.bindings=w.bindings||[],u.containsUndefined(w.bindings)){const E=u.getUndefinedIndices(this.bindings);throw y(w.bindings),new Error(`Undefined binding(s) detected for keys [${E}] when compiling RAW query: ${w.sql}`)}return w.__knexQueryUid=f(),Object.defineProperties(w,{toNative:{value:()=>({sql:this.client.positionBindings(w.sql),bindings:this.client.prepBindings(w.bindings)}),enumerable:!1}}),w}}return C.prototype.isRawInstance=!0,g(C),u.addQueryContext(C),v0=C,v0}var b0,r$;function px(){if(r$)return b0;r$=1;function e(n){for(var r=-1,s=n==null?0:n.length,a=0,o=[];++r<s;){var l=n[r];l&&(o[a++]=l)}return o}return b0=e,b0}var _0,i$;function IK(){if(i$)return _0;i$=1;function e(n,r,s,a){for(var o=-1,l=n==null?0:n.length;++o<l;){var u=n[o];r(a,u,s(u),n)}return a}return _0=e,_0}var w0,s$;function DK(){if(s$)return w0;s$=1;var e=Eo();function n(r,s,a,o){return e(r,function(l,u,h){s(o,l,a(l),h)}),o}return w0=n,w0}var C0,a$;function kK(){if(a$)return C0;a$=1;var e=IK(),n=DK(),r=mn(),s=vt();function a(o,l){return function(u,h){var f=s(u)?e:n,p=l?l():{};return f(u,o,r(h,2),p)}}return C0=a,C0}var E0,o$;function xh(){if(o$)return E0;o$=1;var e=vl(),n=kK(),r=Object.prototype,s=r.hasOwnProperty,a=n(function(o,l,u){s.call(o,u)?o[u].push(l):e(o,u,[l])});return E0=a,E0}var x0,u$;function BK(){if(u$)return x0;u$=1;var e=Cl(),n=mn(),r=JB(),s=oB();function a(o,l){if(o==null)return{};var u=e(s(o),function(h){return[h]});return l=n(l),r(o,u,function(h,f){return l(h,f[0])})}return x0=a,x0}var S0,l$;function PK(){if(l$)return S0;l$=1;var e=mn(),n=oP(),r=BK();function s(a,o){return r(a,n(e(o)))}return S0=s,S0}var T0,c$;function ta(){if(c$)return T0;c$=1;const e=Qt(),n=qo(),r=ni(),s=uP(),a=tr(),o=Zs(),l=px(),u=xh(),h=So(),f=qn(),p=ti(),d=PK(),g=Js(),{nanoid:y}=dx(),{isString:C,isUndefined:x}=mt(),{columnize:v,direction:b,operator:w,wrap:E,unwrapRaw:q,rawOrFn:A}=Vt(),R=a("knex:bindings"),O=["comments","columns","join","where","union","group","having","order","limit","offset","lock","waitMode"];class I{constructor(N,j,D){this.client=N,this.method=j._method||"select",this.options=j._options,this.single=j._single,this.queryComments=j._comments,this.timeout=j._timeout||!1,this.cancelOnTimeout=j._cancelOnTimeout||!1,this.grouped=u(j._statements,"grouping"),this.formatter=N.formatter(j),this._emptyInsertValue="default values",this.first=this.select,this.bindings=D||[],this.formatter.bindings=this.bindings,this.bindingsHolder=this,this.builder=this.formatter.builder}toSQL(N,j){this._undefinedInWhereClause=!1,this.undefinedBindingsInfo=[],N=N||this.method;const D=this[N]()||"",z={method:N,options:g(this.options,o,{}),timeout:this.timeout,cancelOnTimeout:this.cancelOnTimeout,bindings:this.bindingsHolder.bindings||[],__knexQueryUid:y()};if(Object.defineProperties(z,{toNative:{value:()=>({sql:this.client.positionBindings(z.sql),bindings:this.client.prepBindings(z.bindings)}),enumerable:!1}}),C(D)?z.sql=D:o(z,D),(N==="select"||N==="first")&&this.single.as&&(z.as=this.single.as),this._undefinedInWhereClause)throw R(z.bindings),new Error(`Undefined binding(s) detected when compiling ${N.toUpperCase()}. Undefined column(s): [${this.undefinedBindingsInfo.join(", ")}] query: ${z.sql}`);return z}select(){let N=this.with(),j="";const D=[],z=[];O.forEach(M=>{const $=this[M](this);switch(M){case"union":j=$;break;case"comments":case"columns":case"join":case"where":D.push($);break;default:z.push($);break}});const T=this.grouped.union&&this.grouped.union.map(M=>M.wrap).some(M=>M);if(this.onlyUnions()){const M=l(D.concat(z)).join(" ");N+=j+(M?" "+M:"")}else{const M=(T?"(":"")+l(D).join(" ")+(T?")":""),$=l(z).join(" ");N+=M+(j?" "+j:"")+($&&" "+$)}return N}pluck(){let N=this.single.pluck;return N.indexOf(".")!==-1&&(N=N.split(".").slice(-1)[0]),{sql:this.select(),pluck:N}}insert(){const N=this.single.insert||[],j=this.with()+`insert into ${this.tableName} `,D=this._insertBody(N);return D===""?"":j+D}_onConflictClause(N){return N instanceof n?this.formatter.wrap(N):`(${this.formatter.columnize(N)})`}_buildInsertValues(N){let j="",D=-1;for(;++D<N.values.length;)D!==0&&(j+="), ("),j+=this.client.parameterize(N.values[D],this.client.valueForUndefined,this.builder,this.bindingsHolder);return j}_insertBody(N){let j="";if(Array.isArray(N)){if(N.length===0)return""}else if(typeof N=="object"&&f(N))return j+this._emptyInsertValue;const D=this._prepInsert(N);return typeof D=="string"?j+=D:D.columns.length?(j+=`(${v(D.columns,this.builder,this.client,this.bindingsHolder)}`,j+=") values ("+this._buildInsertValues(D)+")"):N.length===1&&N[0]?j+=this._emptyInsertValue:j="",j}update(){const N=this.with(),{tableName:j}=this,D=this._prepUpdate(this.single.update),z=this.where();return N+`update ${this.single.only?"only ":""}${j} set `+D.join(", ")+(z?` ${z}`:"")}_hintComments(){let N=this.grouped.hintComments||[];return N=N.map(j=>l(j.value).join(" ")),N=l(N).join(" "),N?`/*+ ${N} */ `:""}columns(){let N="";if(this.onlyUnions())return"";const j=this._hintComments(),D=this.grouped.columns||[];let z=-1,T=[];if(D)for(;++z<D.length;){const $=D[z];if($.distinct&&(N="distinct "),$.distinctOn){N=this.distinctOn($.value);continue}$.type==="aggregate"?T.push(...this.aggregate($)):$.type==="aggregateRaw"?T.push(this.aggregateRaw($)):$.type==="analytic"?T.push(this.analytic($)):$.type==="json"?T.push(this.json($)):$.value&&$.value.length>0&&T.push(v($.value,this.builder,this.client,this.bindingsHolder))}return T.length===0&&(T=["*"]),`${this.onlyJson()?"":"select "}${j}${N}`+T.join(", ")+(this.tableName?` from ${this.single.only?"only ":""}${this.tableName}`:"")}comments(){return this.queryComments.length?this.queryComments.map(N=>`/* ${N.comment} */`).join(" "):""}_aggregate(N,{aliasSeparator:j=" as ",distinctParentheses:D}={}){const z=N.value,T=N.method,M=N.aggregateDistinct?"distinct ":"",$=te=>E(te,void 0,this.builder,this.client,this.bindingsHolder),P=(te,Q)=>Q?te+j+$(Q):te,H=(te,Q)=>{let J=te.map($).join(", ");if(M){const oe=D?"(":" ",ee=D?")":"";J=M.trim()+oe+J+ee}const ie=`${T}(${J})`;return P(ie,Q)},G=(te,Q)=>{const J=`${T}(${M+$(te)})`;return P(J,Q)};if(Array.isArray(z))return[H(z)];if(typeof z=="object"){if(N.alias)throw new Error("When using an object explicit alias can not be used");return Object.entries(z).map(([te,Q])=>Array.isArray(Q)?H(Q,te):G(Q,te))}const V=z.toLowerCase().indexOf(" as ");let B=z,{alias:K}=N;if(V!==-1){if(B=z.slice(0,V),K)throw new Error(`Found multiple aliases for same column: ${B}`);K=z.slice(V+4)}return[G(B,K)]}aggregate(N){return this._aggregate(N)}aggregateRaw(N){const j=N.aggregateDistinct?"distinct ":"";return`${N.method}(${j+q(N.value,void 0,this.builder,this.client,this.bindingsHolder)})`}_joinTable(N){return N.schema&&!(N.table instanceof n)?`${N.schema}.${N.table}`:N.table}join(){let N="",j=-1;const D=this.grouped.join;if(!D)return"";for(;++j<D.length;){const z=D[j],T=this._joinTable(z);if(j>0&&(N+=" "),z.joinType==="raw")N+=q(z.table,void 0,this.builder,this.client,this.bindingsHolder);else{N+=z.joinType+" join "+E(T,void 0,this.builder,this.client,this.bindingsHolder);let M=-1;for(;++M<z.clauses.length;){const $=z.clauses[M];M>0?N+=` ${$.bool} `:N+=` ${$.type==="onUsing"?"using":"on"} `;const P=this[$.type]($);P&&(N+=P)}}}return N}onBetween(N){return E(N.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+this._not(N,"between")+" "+N.value.map(j=>this.client.parameter(j,this.builder,this.bindingsHolder)).join(" and ")}onNull(N){return E(N.column,void 0,this.builder,this.client,this.bindingsHolder)+" is "+this._not(N,"null")}onExists(N){return this._not(N,"exists")+" ("+A(N.value,void 0,this.builder,this.client,this.bindingsHolder)+")"}onIn(N){if(Array.isArray(N.column))return this.multiOnIn(N);let j;return N.value instanceof n?j=this.client.parameter(N.value,this.builder,this.formatter):j=this.client.parameterize(N.value,void 0,this.builder,this.bindingsHolder),E(N.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+this._not(N,"in ")+this.wrap(j)}multiOnIn(N){let j=-1,D=`(${v(N.column,this.builder,this.client,this.bindingsHolder)}) `;for(D+=this._not(N,"in ")+"((";++j<N.value.length;)j!==0&&(D+="),("),D+=this.client.parameterize(N.value[j],void 0,this.builder,this.bindingsHolder);return D+"))"}where(){const N=this.grouped.where;if(!N)return;const j=[];let D=-1;for(;++D<N.length;){const z=N[D];Object.prototype.hasOwnProperty.call(z,"value")&&e.containsUndefined(z.value)&&(this.undefinedBindingsInfo.push(z.column),this._undefinedInWhereClause=!0);const T=this[z.type](z);T&&(j.length===0?j[0]="where":j.push(z.bool),j.push(T))}return j.length>1?j.join(" "):""}group(){return this._groupsOrders("group")}order(){return this._groupsOrders("order")}having(){const N=this.grouped.having;if(!N)return"";const j=["having"];for(let D=0,z=N.length;D<z;D++){const T=N[D],M=this[T.type](T);M&&(j.length===0&&(j[0]="where"),(j.length>1||j.length===1&&j[0]!=="having")&&j.push(T.bool),j.push(M))}return j.length>1?j.join(" "):""}havingRaw(N){return this._not(N,"")+q(N.value,void 0,this.builder,this.client,this.bindingsHolder)}havingWrapped(N){const j=A(N.value,"where",this.builder,this.client,this.bindingsHolder);return j&&this._not(N,"")+"("+j.slice(6)+")"||""}havingBasic(N){return this._not(N,"")+E(N.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+w(N.operator,this.builder,this.client,this.bindingsHolder)+" "+this.client.parameter(N.value,this.builder,this.bindingsHolder)}havingNull(N){return E(N.column,void 0,this.builder,this.client,this.bindingsHolder)+" is "+this._not(N,"null")}havingExists(N){return this._not(N,"exists")+" ("+A(N.value,void 0,this.builder,this.client,this.bindingsHolder)+")"}havingBetween(N){return E(N.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+this._not(N,"between")+" "+N.value.map(j=>this.client.parameter(j,this.builder,this.bindingsHolder)).join(" and ")}havingIn(N){return Array.isArray(N.column)?this.multiHavingIn(N):E(N.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+this._not(N,"in ")+this.wrap(this.client.parameterize(N.value,void 0,this.builder,this.bindingsHolder))}multiHavingIn(N){return this.multiOnIn(N)}union(){const N=this.onlyUnions(),j=this.grouped.union;if(!j)return"";let D="";for(let z=0,T=j.length;z<T;z++){const M=j[z];z>0&&(D+=" "),(z>0||!N)&&(D+=M.clause+" ");const $=A(M.value,void 0,this.builder,this.client,this.bindingsHolder);if($){const P=M.wrap;P&&(D+="("),D+=$,P&&(D+=")")}}return D}onlyUnions(){return(!this.grouped.columns||!!this.grouped.columns[0].value)&&this.grouped.union&&!this.tableName}_getValueOrParameterFromAttribute(N,j){return this.single.skipBinding[N]===!0?j??this.single[N]:this.client.parameter(this.single[N],this.builder,this.bindingsHolder)}onlyJson(){return!this.tableName&&this.grouped.columns&&this.grouped.columns.length===1&&this.grouped.columns[0].type==="json"}limit(){return!this.single.limit&&this.single.limit!==0?"":`limit ${this._getValueOrParameterFromAttribute("limit")}`}offset(){return this.single.offset?`offset ${this._getValueOrParameterFromAttribute("offset")}`:""}del(){const{tableName:N}=this,j=this.with(),D=this.where(),z=this.join(),T=z?N+" ":"";return j+`delete ${T}from ${this.single.only?"only ":""}${N}`+(z?` ${z}`:"")+(D?` ${D}`:"")}truncate(){return`truncate ${this.tableName}`}lock(){if(this.single.lock)return this[this.single.lock]()}waitMode(){if(this.single.waitMode)return this[this.single.waitMode]()}skipLocked(){throw new Error(".skipLocked() is currently only supported on MySQL 8.0+ and PostgreSQL 9.5+")}noWait(){throw new Error(".noWait() is currently only supported on MySQL 8.0+, MariaDB 10.3.0+ and PostgreSQL 9.5+")}distinctOn(N){throw new Error(".distinctOn() is currently only supported on PostgreSQL")}onWrapped(N){const j=this,D=new s;N.value.call(D,D);let z="";for(let T=0;T<D.clauses.length;T++){const M=D.clauses[T];T>0&&(z+=` ${M.bool} `);const $=j[M.type](M);$&&(z+=$)}return z.length?`(${z})`:""}onBasic(N){const j=N.value instanceof r;return E(N.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+w(N.operator,this.builder,this.client,this.bindingsHolder)+" "+(j?"(":"")+E(N.value,void 0,this.builder,this.client,this.bindingsHolder)+(j?")":"")}onVal(N){return E(N.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+w(N.operator,this.builder,this.client,this.bindingsHolder)+" "+this.client.parameter(N.value,this.builder,this.bindingsHolder)}onRaw(N){return q(N.value,void 0,this.builder,this.client,this.bindingsHolder)}onUsing(N){return"("+v(N.column,this.builder,this.client,this.bindingsHolder)+")"}_valueClause(N){return N.asColumn?E(N.value,void 0,this.builder,this.client,this.bindingsHolder):this.client.parameter(N.value,this.builder,this.bindingsHolder)}_columnClause(N){let j;return Array.isArray(N.column)?j=`(${v(N.column,this.builder,this.client,this.bindingsHolder)})`:j=E(N.column,void 0,this.builder,this.client,this.bindingsHolder),j}whereIn(N){const j=this.client.values(N.value,this.builder,this.bindingsHolder);return`${this._columnClause(N)} ${this._not(N,"in ")}${j}`}whereLike(N){return`${this._columnClause(N)} ${this._not(N,"like ")}${this._valueClause(N)}`}whereILike(N){return`${this._columnClause(N)} ${this._not(N,"ilike ")}${this._valueClause(N)}`}whereNull(N){return E(N.column,void 0,this.builder,this.client,this.bindingsHolder)+" is "+this._not(N,"null")}whereBasic(N){return this._not(N,"")+E(N.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+w(N.operator,this.builder,this.client,this.bindingsHolder)+" "+this._valueClause(N)}whereExists(N){return this._not(N,"exists")+" ("+A(N.value,void 0,this.builder,this.client,this.bindingsHolder)+")"}whereWrapped(N){const j=A(N.value,"where",this.builder,this.client,this.bindingsHolder);return j&&this._not(N,"")+"("+j.slice(6)+")"||""}whereBetween(N){return E(N.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+this._not(N,"between")+" "+N.value.map(j=>this.client.parameter(j,this.builder,this.bindingsHolder)).join(" and ")}whereRaw(N){return this._not(N,"")+q(N.value,void 0,this.builder,this.client,this.bindingsHolder)}_jsonWrapValue(N){if(!this.builder._isJsonObject(N))try{return JSON.stringify(JSON.parse(N.replace(/\n|\t/g,"")))}catch{return N}return JSON.stringify(N)}_jsonValueClause(N){return N.value=this._jsonWrapValue(N.value),this._valueClause(N)}whereJsonObject(N){return`${this._columnClause(N)} ${N.not?"!=":"="} ${this._jsonValueClause(N)}`}wrap(N){return N.charAt(0)!=="("?`(${N})`:N}json(N){return this[N.method](N.params)}analytic(N){let j="";const D=this;return j+=N.method+"() over (",N.raw?j+=N.raw:(N.partitions.length&&(j+="partition by ",j+=p(N.partitions,function(z){return C(z)?D.formatter.columnize(z):D.formatter.columnize(z.column)+(z.order?" "+z.order:"")}).join(", ")+" "),j+="order by ",j+=p(N.order,function(z){return C(z)?D.formatter.columnize(z):D.formatter.columnize(z.column)+(z.order?" "+z.order:"")}).join(", ")),j+=")",N.alias&&(j+=" as "+N.alias),j}with(){if(!this.grouped.with||!this.grouped.with.length)return"";const N=this.grouped.with;if(!N)return;const j=[];let D=-1,z=!1;for(;++D<N.length;){const T=N[D];T.recursive&&(z=!0);const M=this[T.type](T);j.push(M)}return`with ${z?"recursive ":""}${j.join(", ")} `}withWrapped(N){const j=A(N.value,void 0,this.builder,this.client,this.bindingsHolder),D=N.columnList?"("+v(N.columnList,this.builder,this.client,this.bindingsHolder)+")":"",z=N.materialized===void 0?"":N.materialized?"materialized ":"not materialized ";return j&&v(N.alias,this.builder,this.client,this.bindingsHolder)+D+" as "+z+"("+j+")"||""}_not(N,j){return N.not?`not ${j}`:j}_prepInsert(N){const j=A(N,void 0,this.builder,this.client,this.bindingsHolder);if(j)return j;let D=[];const z=[];Array.isArray(N)||(N=N?[N]:[]);let T=-1;for(;++T<N.length&&N[T]!=null;){T===0&&(D=Object.keys(N[T]).sort());const M=new Array(D.length),$=Object.keys(N[T]);let P=-1;for(;++P<$.length;){const H=$[P];let G=D.indexOf(H);if(G===-1){D=D.concat(H).sort(),G=D.indexOf(H);let V=-1;for(;++V<z.length;)z[V].splice(G,0,void 0);M.splice(G,0,void 0)}M[G]=N[T][H]}z.push(M)}return{columns:D,values:z}}_prepUpdate(N={}){const{counter:j={}}=this.single;for(const M of Object.keys(j)){if(h(N,M)){this.client.logger.warn("increment/decrement called for a column that has already been specified in main .update() call. Ignoring increment/decrement and using value from .update() call.");continue}let $=j[M];const P=$<0?"-":"+";P==="-"&&($=-$),N[M]=this.client.raw(`?? ${P} ?`,[M,$])}N=d(N,x);const D=[],z=Object.keys(N);let T=-1;for(;++T<z.length;)D.push(E(z[T],void 0,this.builder,this.client,this.bindingsHolder)+" = "+this.client.parameter(N[z[T]],this.builder,this.bindingsHolder));if(f(D))throw new Error(["Empty .update() call detected!","Update data does not contain any values to update.","This will result in a faulty query.",this.single.table?`Table: ${this.single.table}.`:"",this.single.update?`Columns: ${Object.keys(this.single.update)}.`:""].join(" "));return D}_formatGroupsItemValue(N,j){const{formatter:D}=this;let z="";j==="last"?z=" is null":j==="first"&&(z=" is not null");let T;return N instanceof n?T=q(N,void 0,this.builder,this.client,this.bindingsHolder):N instanceof r||j?T="("+D.columnize(N)+z+")":T=D.columnize(N),T}_basicGroupOrder(N,j){const D=this._formatGroupsItemValue(N.value,N.nulls),z=j==="order"&&N.type!=="orderByRaw"?` ${b(N.direction,this.builder,this.client,this.bindingsHolder)}`:"";return D+z}_groupOrder(N,j){return this._basicGroupOrder(N,j)}_groupOrderNulls(N,j){const D=this._formatGroupsItemValue(N.value),z=j==="order"&&N.type!=="orderByRaw"?` ${b(N.direction,this.builder,this.client,this.bindingsHolder)}`:"";return N.nulls&&!(N.value instanceof n)?`${D}${z||""} nulls ${N.nulls}`:D+z}_groupsOrders(N){const j=this.grouped[N];if(!j)return"";const D=j.map(z=>this._groupOrder(z,N));return D.length?N+" by "+D.join(", "):""}get tableName(){if(!this._tableName){let N=this.single.table;const j=this.single.schema;if(N&&j){const D=N instanceof r,z=N instanceof n;!D&&!z&&!(typeof N=="function")&&(N=`${j}.${N}`)}this._tableName=N?E(N,N instanceof r,this.builder,this.client,this.bindingsHolder):""}return this._tableName}_jsonPathWrap(N){return this.client.parameter(N.path||N[1],this.builder,this.bindingsHolder)}_jsonExtract(N,j){let D;return Array.isArray(j.column)?D=j.column:D=[j],Array.isArray(N)||(N=[N]),D.map(z=>{let T=`${v(z.column||z[0],this.builder,this.client,this.bindingsHolder)}, ${this._jsonPathWrap(z)}`;N.forEach($=>{T=$+"("+T+")"});const M=z.alias||z[2];return M?this.client.alias(T,this.formatter.wrap(M)):T}).join(", ")}_jsonSet(N,j){const D=`${N}(${v(j.column,this.builder,this.client,this.bindingsHolder)}, ${this.client.parameter(j.path,this.builder,this.bindingsHolder)}, ${this.client.parameter(j.value,this.builder,this.bindingsHolder)})`;return j.alias?this.client.alias(D,this.formatter.wrap(j.alias)):D}_whereJsonPath(N,j){return`${N}(${this._columnClause(j)}, ${this._jsonPathWrap({path:j.jsonPath})}) ${w(j.operator,this.builder,this.client,this.bindingsHolder)} ${this._jsonValueClause(j)}`}_onJsonPathEquals(N,j){return N+"("+E(j.columnFirst,void 0,this.builder,this.client,this.bindingsHolder)+", "+this.client.parameter(j.jsonPathFirst,this.builder,this.bindingsHolder)+") = "+N+"("+E(j.columnSecond,void 0,this.builder,this.client,this.bindingsHolder)+", "+this.client.parameter(j.jsonPathSecond,this.builder,this.bindingsHolder)+")"}}return T0=I,T0}var q0,f$;function lP(){if(f$)return q0;f$=1;const{EventEmitter:e}=Qe,n=Sl(),r=Zs(),{addQueryContext:s}=Qt(),a=fx(),{augmentWithBuilderInterface:o}=hx();class l extends e{constructor(h){super(),this.client=h,this._sequence=[],h.config&&(this._debug=h.config.debug,a(this,4))}withSchema(h){return this._schema=h,this}toString(){return this.toQuery()}toSQL(){return this.client.schemaCompiler(this).toSQL()}async generateDdlCommands(){return await this.client.schemaCompiler(this).generateDdlCommands()}}return["createTable","createTableIfNotExists","createTableLike","createView","createViewOrReplace","createMaterializedView","refreshMaterializedView","dropView","dropViewIfExists","dropMaterializedView","dropMaterializedViewIfExists","createSchema","createSchemaIfNotExists","dropSchema","dropSchemaIfExists","createExtension","createExtensionIfNotExists","dropExtension","dropExtensionIfExists","table","alterTable","view","alterView","hasTable","hasColumn","dropTable","renameTable","renameView","dropTableIfExists","raw"].forEach(function(u){l.prototype[u]=function(){return u==="createTableIfNotExists"&&this.client.logger.warn(["Use async .hasTable to check if table exists and then use plain .createTable. Since ",'.createTableIfNotExists actually just generates plain "CREATE TABLE IF NOT EXIST..." ',"query it will not work correctly if there are any alter table queries generated for ","columns afterwards. To not break old migrations this function is left untouched for now",", but it should not be used when writing new code and it is removed from documentation."].join("")),u==="table"&&(u="alterTable"),u==="view"&&(u="alterView"),this._sequence.push({method:u,args:n(arguments)}),this}}),l.extend=(u,h)=>{if(Object.prototype.hasOwnProperty.call(l.prototype,u))throw new Error(`Can't extend SchemaBuilder with existing method ('${u}').`);r(l.prototype,{[u]:h})},o(l),s(l),q0=l,q0}var A0,h$;function Sh(){if(h$)return A0;h$=1;const e=Eh(),{isString:n}=mt();function r(o){o&&(n(o)&&(o={sql:o}),o.bindings||(o.bindings=this.bindingsHolder.bindings),this.sequence.push(o),this.formatter=this.client.formatter(this._commonBuilder),this.bindings=[],this.formatter.bindings=this.bindings)}function s(o){const l=new this.constructor(this.client,this.tableCompiler,this.columnBuilder);o.call(l,e(arguments)),this.sequence.additional=(this.sequence.additional||[]).concat(l.sequence)}function a(o){o&&(n(o)&&(o={sql:o}),o.bindings||(o.bindings=this.bindingsHolder.bindings),this.sequence.unshift(o),this.formatter=this.client.formatter(this._commonBuilder),this.bindings=[],this.formatter.bindings=this.bindings)}return A0={pushAdditional:s,pushQuery:r,unshiftQuery:a},A0}var N0,d$;function Ao(){if(d$)return N0;d$=1;const{pushQuery:e,pushAdditional:n,unshiftQuery:r}=Sh();class s{constructor(p,d){this.builder=d,this._commonBuilder=this.builder,this.client=p,this.schema=d._schema,this.bindings=[],this.bindingsHolder=this,this.formatter=p.formatter(d),this.formatter.bindings=this.bindings,this.sequence=[]}createSchema(){h("createSchema")}createSchemaIfNotExists(){h("createSchemaIfNotExists")}dropSchema(){h("dropSchema")}dropSchemaIfExists(){h("dropSchemaIfExists")}dropTable(p){this.pushQuery(this.dropTablePrefix+this.formatter.wrap(u(this.schema,p)))}dropTableIfExists(p){this.pushQuery(this.dropTablePrefix+"if exists "+this.formatter.wrap(u(this.schema,p)))}dropView(p){this._dropView(p,!1,!1)}dropViewIfExists(p){this._dropView(p,!0,!1)}dropMaterializedView(p){throw new Error("materialized views are not supported by this dialect.")}dropMaterializedViewIfExists(p){throw new Error("materialized views are not supported by this dialect.")}renameView(p,d){throw new Error("rename view is not supported by this dialect (instead drop then create another view).")}refreshMaterializedView(){throw new Error("materialized views are not supported by this dialect.")}_dropView(p,d,g){this.pushQuery((g?this.dropMaterializedViewPrefix:this.dropViewPrefix)+(d?"if exists ":"")+this.formatter.wrap(u(this.schema,p)))}raw(p,d){this.sequence.push(this.client.raw(p,d).toSQL())}toSQL(){const p=this.builder._sequence;for(let d=0,g=p.length;d<g;d++){const y=p[d];this[y.method].apply(this,y.args)}return this.sequence}async generateDdlCommands(){const p=this.toSQL();return{pre:[],sql:Array.isArray(p)?p:[p],check:null,post:[]}}}s.prototype.dropTablePrefix="drop table ",s.prototype.dropViewPrefix="drop view ",s.prototype.dropMaterializedViewPrefix="drop materialized view ",s.prototype.alterViewPrefix="alter view ",s.prototype.alterTable=o("alter"),s.prototype.createTable=o("create"),s.prototype.createTableIfNotExists=o("createIfNot"),s.prototype.createTableLike=o("createLike"),s.prototype.createView=l("create"),s.prototype.createViewOrReplace=l("createOrReplace"),s.prototype.createMaterializedView=l("createMaterializedView"),s.prototype.alterView=l("alter"),s.prototype.pushQuery=e,s.prototype.pushAdditional=n,s.prototype.unshiftQuery=r;function a(f){const p=this.builder.queryContext();p!==void 0&&f.queryContext()===void 0&&f.queryContext(p),f.setSchema(this.schema);const d=f.toSQL();for(let g=0,y=d.length;g<y;g++)this.sequence.push(d[g])}function o(f){return f==="createLike"?function(p,d,g){const y=this.client.tableBuilder(f,p,d,g);a.call(this,y)}:function(p,d){const g=this.client.tableBuilder(f,p,null,d);a.call(this,g)}}function l(f){return function(p,d){const g=this.client.viewBuilder(f,p,d);a.call(this,g)}}function u(f,p){return f?`${f}.${p}`:p}function h(f){throw new Error(`${f} is not supported for this dialect (only PostgreSQL supports it currently).`)}return N0=s,N0}var R0,p$;function zK(){if(p$)return R0;p$=1;var e=Ys(),n=sx(),r=Xi(),s=n(function(a,o){e(o,r(o),a)});return R0=s,R0}var O0,m$;function Th(){return m$||(m$=1,O0=zK()),O0}var M0,g$;function cP(){if(g$)return M0;g$=1;const e=Ws(),n=Th(),r=Zs(),s=Sl(),a=Qt(),{isString:o,isFunction:l,isObject:u}=mt();class h{constructor(y,C,x,v,b){if(this.client=y,this._fn=b,this._method=C,this._schemaName=void 0,this._tableName=x,this._tableNameLike=v,this._statements=[],this._single={},!v&&!l(this._fn))throw new TypeError("A callback function must be supplied to calls against `.createTable` and `.table`")}setSchema(y){this._schemaName=y}toSQL(){return this._method==="alter"&&n(this,d),this._fn&&this._fn.call(this,this),this.client.tableCompiler(this).toSQL()}timestamps(y,C,x){u(y)&&({useTimestamps:y,defaultToNow:C,useCamelCase:x}=y);const v=y===!0?"timestamp":"datetime",b=this[v](x?"createdAt":"created_at"),w=this[v](x?"updatedAt":"updated_at");if(C===!0){const E=this.client.raw("CURRENT_TIMESTAMP");b.notNullable().defaultTo(E),w.notNullable().defaultTo(E)}}comment(y){if(typeof y!="string")throw new TypeError("Table comment must be string");this._single.comment=y}foreign(y,C){const x={column:y,keyName:C};this._statements.push({grouping:"alterTable",method:"foreign",args:[x]});let v={references(b){let w;return o(b)&&(w=b.split(".")),!w||w.length===1?(x.references=w?w[0]:b,{on(E){if(typeof E!="string")throw new TypeError(`Expected tableName to be a string, got: ${typeof E}`);return x.inTable=E,v},inTable(){return this.on.apply(this,arguments)}}):(x.inTable=w[0],x.references=w[1],v)},withKeyName(b){return x.keyName=b,v},onUpdate(b){return x.onUpdate=b,v},onDelete(b){return x.onDelete=b,v},deferrable:b=>{if(["mysql","mssql","redshift","mysql2","oracledb"].indexOf(this.client.dialect)!==-1)throw new Error(`${this.client.dialect} does not support deferrable`);return x.deferrable=b,v},_columnBuilder(b){return n(b,v),v=b,b}};return v}check(y,C,x){return this._statements.push({grouping:"checks",args:[y,C,x]}),this}}["index","primary","unique","dropPrimary","dropUnique","dropIndex","dropForeign"].forEach(g=>{h.prototype[g]=function(){return this._statements.push({grouping:"alterTable",method:g,args:s(arguments)}),this}}),e({mysql:["engine","charset","collate"],postgresql:["inherits"]},function(g,y){g.forEach(function(C){h.prototype[C]=function(x){if(this.client.dialect!==y)throw new Error(`Knex only supports ${C} statement with ${y}.`);if(this._method==="alter")throw new Error(`Knex does not support altering the ${C} outside of create table, please use knex.raw statement.`);this._single[C]=x}})}),a.addQueryContext(h),["tinyint","smallint","mediumint","int","bigint","decimal","float","double","real","bit","boolean","serial","date","datetime","timestamp","time","year","geometry","geography","point","char","varchar","tinytext","tinyText","text","mediumtext","mediumText","longtext","longText","binary","varbinary","tinyblob","tinyBlob","mediumblob","mediumBlob","blob","longblob","longBlob","enum","set","bool","dateTime","increments","bigincrements","bigIncrements","integer","biginteger","bigInteger","string","json","jsonb","uuid","enu","specificType"].forEach(g=>{h.prototype[g]=function(){const y=s(arguments),C=this.client.columnBuilder(this,g,y);return this._statements.push({grouping:"columns",builder:C}),C}});const d={renameColumn(g,y){return this._statements.push({grouping:"alterTable",method:"renameColumn",args:[g,y]}),this},dropTimestamps(){return this.dropColumns(arguments[0]===!0?["createdAt","updatedAt"]:["created_at","updated_at"])},setNullable(g){return this._statements.push({grouping:"alterTable",method:"setNullable",args:[g]}),this},check(g,y,C){this._statements.push({grouping:"alterTable",method:"check",args:[g,y,C]})},dropChecks(){this._statements.push({grouping:"alterTable",method:"dropChecks",args:s(arguments)})},dropNullable(g){return this._statements.push({grouping:"alterTable",method:"dropNullable",args:[g]}),this}};return d.dropColumn=d.dropColumns=function(){return this._statements.push({grouping:"alterTable",method:"dropColumn",args:s(arguments)}),this},h.extend=(g,y)=>{if(Object.prototype.hasOwnProperty.call(h.prototype,g))throw new Error(`Can't extend TableBuilder with existing method ('${g}').`);r(h.prototype,{[g]:y})},M0=h,M0}var j0,y$;function UK(){if(y$)return j0;y$=1;var e=DB(),n=rx(),r=Math.max;function s(a,o,l){var u=a==null?0:a.length;if(!u)return-1;var h=l==null?0:n(l);return h<0&&(h=r(u+h,0)),e(a,o,h)}return j0=s,j0}var $0,v$;function No(){if(v$)return $0;v$=1;const{pushAdditional:e,pushQuery:n,unshiftQuery:r}=Sh(),s=Qt(),a=xh(),o=UK(),l=qn(),u=Eh(),{normalizeArr:h}=Qt();class f{constructor(d,g){this.client=d,this.tableBuilder=g,this._commonBuilder=this.tableBuilder,this.method=g._method,this.schemaNameRaw=g._schemaName,this.tableNameRaw=g._tableName,this.tableNameLikeRaw=g._tableNameLike,this.single=g._single,this.grouped=a(g._statements,"grouping"),this.formatter=d.formatter(g),this.bindings=[],this.formatter.bindings=this.bindings,this.bindingsHolder=this,this.sequence=[],this._formatting=d.config&&d.config.formatting,this.checksCount=0}toSQL(){return this[this.method](),this.sequence}create(d,g){const C=this.getColumns().map(v=>v.toSQL()),x=this.getColumnTypes(C);this.createAlterTableMethods&&this.alterTableForCreate(x),this.createQuery(x,d,g),this.columnQueries(C),delete this.single.comment,this.alterTable()}createIfNot(){this.create(!0)}createLike(){this.create(!1,!0)}createLikeIfNot(){this.create(!0,!0)}alter(){const g=this.getColumns().map(b=>b.toSQL()),y=this.getColumns("alter"),C=y.map(b=>b.toSQL()),x=this.getColumnTypes(g),v=this.getColumnTypes(C);this.addColumns(x),this.alterColumns(v,y),this.columnQueries(g),this.columnQueries(C),this.alterTable()}foreign(d){if(d.inTable&&d.references){const g=d.keyName?this.formatter.wrap(d.keyName):this._indexCommand("foreign",this.tableNameRaw,d.column),y=this.formatter.columnize(d.column),C=this.formatter.columnize(d.references),x=this.formatter.wrap(d.inTable),v=d.onUpdate?(this.lowerCase?" on update ":" ON UPDATE ")+d.onUpdate:"",b=d.onDelete?(this.lowerCase?" on delete ":" ON DELETE ")+d.onDelete:"",w=d.deferrable?this.lowerCase?` deferrable initially ${d.deferrable.toLowerCase()} `:` DEFERRABLE INITIALLY ${d.deferrable.toUpperCase()} `:"";this.lowerCase?this.pushQuery((this.forCreate?"":`alter table ${this.tableName()} add `)+"constraint "+g+" foreign key ("+y+") references "+x+" ("+C+")"+v+b+w):this.pushQuery((this.forCreate?"":`ALTER TABLE ${this.tableName()} ADD `)+"CONSTRAINT "+g+" FOREIGN KEY ("+y+") REFERENCES "+x+" ("+C+")"+v+b+w)}}getColumnTypes(d){return d.reduce(function(g,y){const C=y[0];return g.sql.push(C.sql),g.bindings.concat(C.bindings),g},{sql:[],bindings:[]})}columnQueries(d){const g=d.reduce(function(y,C){const x=u(C);return l(x)?y:y.concat(x)},[]);for(const y of g)this.pushQuery(y)}addColumns(d,g){if(g=g||this.addColumnsPrefix,d.sql.length>0){const y=d.sql.map(C=>g+C);this.pushQuery({sql:(this.lowerCase?"alter table ":"ALTER TABLE ")+this.tableName()+" "+y.join(", "),bindings:d.bindings})}}alterColumns(d,g){d.sql.length>0&&this.addColumns(d,this.alterColumnsPrefix,g)}getColumns(d){const g=this.grouped.columns||[];d=d||"add";const y=this.tableBuilder.queryContext();return g.filter(C=>C.builder._method===d).map(C=>(y!==void 0&&C.builder.queryContext()===void 0&&C.builder.queryContext(y),this.client.columnCompiler(this,C.builder)))}tableName(){const d=this.schemaNameRaw?`${this.schemaNameRaw}.${this.tableNameRaw}`:this.tableNameRaw;return this.formatter.wrap(d)}tableNameLike(){const d=this.schemaNameRaw?`${this.schemaNameRaw}.${this.tableNameLikeRaw}`:this.tableNameLikeRaw;return this.formatter.wrap(d)}alterTable(){const d=this.grouped.alterTable||[];for(let g=0,y=d.length;g<y;g++){const C=d[g];this[C.method]?this[C.method].apply(this,C.args):this.client.logger.error(`Debug: ${C.method} does not exist`)}for(const g in this.single)typeof this[g]=="function"&&this[g](this.single[g])}alterTableForCreate(d){this.forCreate=!0;const g=this.sequence,y=this.grouped.alterTable||[];this.grouped.alterTable=[];for(let C=0,x=y.length;C<x;C++){const v=y[C];if(o(this.createAlterTableMethods,v.method)<0){this.grouped.alterTable.push(v);continue}this[v.method]?(this.sequence=[],this[v.method].apply(this,v.args),d.sql.push(this.sequence[0].sql)):this.client.logger.error(`Debug: ${v.method} does not exist`)}this.sequence=g,this.forCreate=!1}dropIndex(d){this.pushQuery(`drop index${d}`)}dropUnique(){throw new Error("Method implemented in the dialect driver")}dropForeign(){throw new Error("Method implemented in the dialect driver")}dropColumn(){const d=s.normalizeArr.apply(null,arguments),g=(Array.isArray(d)?d:[d]).map(y=>this.dropColumnPrefix+this.formatter.wrap(y));this.pushQuery((this.lowerCase?"alter table ":"ALTER TABLE ")+this.tableName()+" "+g.join(", "))}_setNullableState(d,g){const y=this.tableName(),C=this.formatter.columnize(d),x=this.alterColumnsPrefix;return this.pushQuery({sql:"SELECT 1",output:()=>this.client.queryBuilder().from(this.tableNameRaw).columnInfo(d).then(v=>{if(l(v))throw new Error(`.setNullable: Column ${C} does not exist in table ${y}.`);const b=g?"null":"not null",w=v.type+(v.maxLength?`(${v.maxLength})`:""),E=v.defaultValue!==null&&v.defaultValue!==void 0?`default '${v.defaultValue}'`:"",q=`alter table ${y} ${x} ${C} ${w} ${b} ${E}`;return this.client.raw(q)})})}setNullable(d){return this._setNullableState(d,!0)}dropNullable(d){return this._setNullableState(d,!1)}dropChecks(d){if(d===void 0)return"";d=h(d);const y=`alter table ${this.tableName()} ${d.map(C=>`drop constraint ${C}`).join(", ")}`;this.pushQuery(y)}check(d,g,y){const C=this.tableName();let x=y;x||(this.checksCount++,x=C+"_"+this.checksCount);const v=`alter table ${C} add constraint ${x} check(${d})`;this.pushQuery(v)}_addChecks(){return this.grouped.checks?", "+this.grouped.checks.map(d=>`${d.args[2]?"constraint "+d.args[2]+" ":""}check (${this.client.raw(d.args[0],d.args[1])})`).join(", "):""}_indexCommand(d,g,y){Array.isArray(y)||(y=y?[y]:[]);const x=(g.replace(/\.|-/g,"_")+"_"+y.join("_")+"_"+d).toLowerCase();return this.formatter.wrap(x)}_getPrimaryKeys(){return(this.grouped.alterTable||[]).filter(d=>d.method==="primary").flatMap(d=>d.args).flat()}_canBeAddPrimaryKey(d){return d.primaryKey&&this._getPrimaryKeys().length===0}_getIncrementsColumnNames(){return this.grouped.columns.filter(d=>d.builder._type==="increments").map(d=>d.builder._args[0])}_getBigIncrementsColumnNames(){return this.grouped.columns.filter(d=>d.builder._type==="bigincrements").map(d=>d.builder._args[0])}}return f.prototype.pushQuery=n,f.prototype.pushAdditional=e,f.prototype.unshiftQuery=r,f.prototype.lowerCase=!0,f.prototype.createAlterTableMethods=null,f.prototype.addColumnsPrefix="add column ",f.prototype.alterColumnsPrefix="alter column ",f.prototype.modifyColumnPrefix="modify column ",f.prototype.dropColumnPrefix="drop column ",$0=f,$0}var L0,b$;function qh(){if(b$)return L0;b$=1;const e=Th(),n=Zs(),r=Sl(),{addQueryContext:s}=Qt();class a{constructor(p,d,g,y){this.client=p,this._method="add",this._single={},this._modifiers={},this._statements=[],this._type=h[g]||g,this._args=y,this._tableBuilder=d,d._method==="alter"&&e(this,u)}references(p){return this._tableBuilder.foreign.call(this._tableBuilder,this._args[0],void 0,this)._columnBuilder(this).references(p)}}const o=["default","defaultsTo","defaultTo","unsigned","nullable","first","after","comment","collate","check","checkPositive","checkNegative","checkIn","checkNotIn","checkBetween","checkLength","checkRegex"],l={default:"defaultTo",defaultsTo:"defaultTo"};o.forEach(function(f){const p=l[f]||f;a.prototype[f]=function(){return this._modifiers[p]=r(arguments),this}}),s(a),a.prototype.notNull=a.prototype.notNullable=function(){return this.nullable(!1)},["index","primary","unique"].forEach(function(f){a.prototype[f]=function(){return this._type.toLowerCase().indexOf("increments")===-1&&this._tableBuilder[f].apply(this._tableBuilder,[this._args[0]].concat(r(arguments))),this}}),a.extend=(f,p)=>{if(Object.prototype.hasOwnProperty.call(a.prototype,f))throw new Error(`Can't extend ColumnBuilder with existing method ('${f}').`);n(a.prototype,{[f]:p})};const u={};u.drop=function(){return this._single.drop=!0,this},u.alterType=function(f){return this._statements.push({grouping:"alterType",value:f}),this},u.alter=function({alterNullable:f=!0,alterType:p=!0}={}){return this._method="alter",this.alterNullable=f,this.alterType=p,this};const h={float:"floating",enum:"enu",boolean:"bool",string:"varchar",bigint:"bigInteger"};return L0=a,L0}var I0,_$;function QK(){if(_$)return I0;_$=1;function e(n){return n&&n.length?n[0]:void 0}return I0=e,I0}var D0,w$;function HK(){return w$||(w$=1,D0=QK()),D0}var k0,C$;function na(){if(C$)return k0;C$=1;const e=Sh(),n=xh(),r=HK(),s=So(),a=Eh(),{toNumber:o}=Qt(),{formatDefault:l}=ea(),{operator:u}=Vt();class h{constructor(p,d,g){this.client=p,this.tableCompiler=d,this.columnBuilder=g,this._commonBuilder=this.columnBuilder,this.args=g._args,this.type=g._type.toLowerCase(),this.grouped=n(g._statements,"grouping"),this.modified=g._modifiers,this.isIncrements=this.type.indexOf("increments")!==-1,this.formatter=p.formatter(g),this.bindings=[],this.formatter.bindings=this.bindings,this.bindingsHolder=this,this.sequence=[],this.modifiers=[],this.checksCount=0}_addCheckModifiers(){this.modifiers.push("check","checkPositive","checkNegative","checkIn","checkNotIn","checkBetween","checkLength","checkRegex")}defaults(p){if(Object.prototype.hasOwnProperty.call(this._defaultMap,p))return this._defaultMap[p].bind(this)();throw new Error(`There is no default for the specified identifier ${p}`)}toSQL(){return this.pushQuery(this.compileColumn()),this.sequence.additional&&(this.sequence=this.sequence.concat(this.sequence.additional)),this.sequence}compileColumn(){return this.formatter.wrap(this.getColumnName())+" "+this.getColumnType()+this.getModifiers()}getColumnName(){return r(this.args)||this.defaults("columnName")}getColumnType(){if(!this._columnType){const p=this[this.type];this._columnType=typeof p=="function"?p.apply(this,a(this.args)):p}return this._columnType}getModifiers(){const p=[];for(let d=0,g=this.modifiers.length;d<g;d++){const y=this.modifiers[d];if((!this.isIncrements||this.isIncrements&&y==="comment")&&s(this.modified,y)){const C=this[y].apply(this,this.modified[y]);C&&p.push(C)}}return p.length>0?` ${p.join(" ")}`:""}varchar(p){return`varchar(${o(p,255)})`}floating(p,d){return`float(${o(p,8)}, ${o(d,2)})`}decimal(p,d){if(p===null)throw new Error("Specifying no precision on decimal columns is not supported for that SQL dialect.");return`decimal(${o(p,8)}, ${o(d,2)})`}specifictype(p){return p}nullable(p){return p===!1?"not null":"null"}notNullable(){return this.nullable(!1)}defaultTo(p){return`default ${l(p,this.type,this.client)}`}increments(p={primaryKey:!0}){return"integer not null"+(this.tableCompiler._canBeAddPrimaryKey(p)?" primary key":"")+" autoincrement"}bigincrements(p={primaryKey:!0}){return this.increments(p)}_pushAlterCheckQuery(p,d){let g=d;g||(this.checksCount++,g=this.tableCompiler.tableNameRaw+"_"+this.getColumnName()+"_"+this.checksCount),this.pushAdditional(function(){this.pushQuery(`alter table ${this.tableCompiler.tableName()} add constraint ${g} check(${p})`)})}_checkConstraintName(p){return p?`constraint ${p} `:""}_check(p,d){return this.columnBuilder._method==="alter"?(this._pushAlterCheckQuery(p,d),""):`${this._checkConstraintName(d)}check (${p})`}checkPositive(p){return this._check(`${this.formatter.wrap(this.getColumnName())} ${u(">",this.columnBuilder,this.bindingsHolder)} 0`,p)}checkNegative(p){return this._check(`${this.formatter.wrap(this.getColumnName())} ${u("<",this.columnBuilder,this.bindingsHolder)} 0`,p)}_checkIn(p,d,g){return this._check(`${this.formatter.wrap(this.getColumnName())} ${g?"not ":""}in (${p.map(y=>this.client._escapeBinding(y)).join(",")})`,d)}checkIn(p,d){return this._checkIn(p,d)}checkNotIn(p,d){return this._checkIn(p,d,!0)}checkBetween(p,d){p.length===2&&!Array.isArray(p[0])&&!Array.isArray(p[1])&&(p=[p]);const g=p.map(y=>`${this.formatter.wrap(this.getColumnName())} between ${this.client._escapeBinding(y[0])} and ${this.client._escapeBinding(y[1])}`).join(" or ");return this._check(g,d)}checkLength(p,d,g){return this._check(`length(${this.formatter.wrap(this.getColumnName())}) ${u(p,this.columnBuilder,this.bindingsHolder)} ${o(d)}`,g)}}return h.prototype.binary="blob",h.prototype.bool="boolean",h.prototype.date="date",h.prototype.datetime="datetime",h.prototype.time="time",h.prototype.timestamp="timestamp",h.prototype.geometry="geometry",h.prototype.geography="geography",h.prototype.point="point",h.prototype.enu="varchar",h.prototype.bit=h.prototype.json="text",h.prototype.uuid=({useBinaryUuid:f=!1,primaryKey:p=!1}={})=>f?"binary(16)":"char(36)",h.prototype.integer=h.prototype.smallint=h.prototype.mediumint="integer",h.prototype.biginteger="bigint",h.prototype.text="text",h.prototype.tinyint="tinyint",h.prototype.pushQuery=e.pushQuery,h.prototype.pushAdditional=e.pushAdditional,h.prototype.unshiftQuery=e.unshiftQuery,h.prototype._defaultMap={columnName:function(){if(!this.isIncrements)throw new Error(`You did not specify a column name for the ${this.type} column.`);return"id"}},k0=h,k0}var B0,E$;function VK(){if(E$)return B0;E$=1;const e=qo();class n extends e{constructor(s,a){super(s),this.ref=a,this._schema=null,this._alias=null}withSchema(s){return this._schema=s,this}as(s){return this._alias=s,this}toSQL(){const s=this._schema?`${this._schema}.${this.ref}`:this.ref,a=this.client.formatter(this),o=a.columnize(s),l=this._alias?`${o} as ${a.wrap(this._alias)}`:o;return this.set(l,[]),super.toSQL(...arguments)}}return B0=n,B0}var P0,x$;function Ah(){if(x$)return P0;x$=1;const{columnize:e,wrap:n}=Vt();class r{constructor(a,o){this.client=a,this.builder=o,this.bindings=[]}columnize(a){return e(a,this.builder,this.client,this)}wrap(a,o){return n(a,o,this.builder,this.client,this)}}return P0=r,P0}var Le={},S$;function FK(){if(S$)return Le;S$=1,Object.defineProperty(Le,"__esModule",{value:!0});var e=Qe;function n(Oe){if(Oe&&Oe.__esModule)return Oe;var We=Object.create(null);return Oe&&Object.keys(Oe).forEach(function(Je){if(Je!=="default"){var rt=Object.getOwnPropertyDescriptor(Oe,Je);Object.defineProperty(We,Je,rt.get?rt:{enumerable:!0,get:function(){return Oe[Je]}})}}),We.default=Oe,Object.freeze(We)}var r=n(e);const{env:s={},argv:a=[],platform:o=""}=typeof process>"u"?{}:process,l="NO_COLOR"in s||a.includes("--no-color"),u="FORCE_COLOR"in s||a.includes("--color"),h=o==="win32",f=s.TERM==="dumb",p=r&&r.isatty&&r.isatty(1)&&s.TERM&&!f,d="CI"in s&&("GITHUB_ACTIONS"in s||"GITLAB_CI"in s||"CIRCLECI"in s),g=!l&&(u||h&&!f||p||d),y=(Oe,We,Je,rt,de=We.substring(0,Oe)+rt,X=We.substring(Oe+Je.length),Me=X.indexOf(Je))=>de+(Me<0?X:y(Me,X,Je,rt)),C=(Oe,We,Je,rt,de)=>Oe<0?Je+We+rt:Je+y(Oe,We,rt,de)+rt,x=(Oe,We,Je=Oe,rt=Oe.length+1)=>de=>de||!(de===""||de===void 0)?C((""+de).indexOf(We,rt),de,Oe,We,Je):"",v=(Oe,We,Je)=>x(`\x1B[${Oe}m`,`\x1B[${We}m`,Je),b={reset:v(0,0),bold:v(1,22,"\x1B[22m\x1B[1m"),dim:v(2,22,"\x1B[22m\x1B[2m"),italic:v(3,23),underline:v(4,24),inverse:v(7,27),hidden:v(8,28),strikethrough:v(9,29),black:v(30,39),red:v(31,39),green:v(32,39),yellow:v(33,39),blue:v(34,39),magenta:v(35,39),cyan:v(36,39),white:v(37,39),gray:v(90,39),bgBlack:v(40,49),bgRed:v(41,49),bgGreen:v(42,49),bgYellow:v(43,49),bgBlue:v(44,49),bgMagenta:v(45,49),bgCyan:v(46,49),bgWhite:v(47,49),blackBright:v(90,39),redBright:v(91,39),greenBright:v(92,39),yellowBright:v(93,39),blueBright:v(94,39),magentaBright:v(95,39),cyanBright:v(96,39),whiteBright:v(97,39),bgBlackBright:v(100,49),bgRedBright:v(101,49),bgGreenBright:v(102,49),bgYellowBright:v(103,49),bgBlueBright:v(104,49),bgMagentaBright:v(105,49),bgCyanBright:v(106,49),bgWhiteBright:v(107,49)},w=({useColor:Oe=g}={})=>Oe?b:Object.keys(b).reduce((We,Je)=>({...We,[Je]:String}),{}),{reset:E,bold:q,dim:A,italic:R,underline:O,inverse:I,hidden:k,strikethrough:N,black:j,red:D,green:z,yellow:T,blue:M,magenta:$,cyan:P,white:H,gray:G,bgBlack:V,bgRed:B,bgGreen:K,bgYellow:te,bgBlue:Q,bgMagenta:J,bgCyan:ie,bgWhite:oe,blackBright:ee,redBright:fe,greenBright:be,yellowBright:ve,blueBright:_e,magentaBright:we,cyanBright:W,whiteBright:ae,bgBlackBright:xe,bgRedBright:Se,bgGreenBright:gt,bgYellowBright:ut,bgBlueBright:It,bgMagentaBright:Tt,bgCyanBright:qt,bgWhiteBright:Ge}=w();return Le.bgBlack=V,Le.bgBlackBright=xe,Le.bgBlue=Q,Le.bgBlueBright=It,Le.bgCyan=ie,Le.bgCyanBright=qt,Le.bgGreen=K,Le.bgGreenBright=gt,Le.bgMagenta=J,Le.bgMagentaBright=Tt,Le.bgRed=B,Le.bgRedBright=Se,Le.bgWhite=oe,Le.bgWhiteBright=Ge,Le.bgYellow=te,Le.bgYellowBright=ut,Le.black=j,Le.blackBright=ee,Le.blue=M,Le.blueBright=_e,Le.bold=q,Le.createColors=w,Le.cyan=P,Le.cyanBright=W,Le.dim=A,Le.gray=G,Le.green=z,Le.greenBright=be,Le.hidden=k,Le.inverse=I,Le.isColorSupported=g,Le.italic=R,Le.magenta=$,Le.magentaBright=we,Le.red=D,Le.redBright=fe,Le.reset=E,Le.strikethrough=N,Le.underline=O,Le.white=H,Le.whiteBright=ae,Le.yellow=T,Le.yellowBright=ve,Le}var z0,T$;function GK(){if(T$)return z0;T$=1;const e=FK(),{inspect:n}=Qe,{isString:r,isFunction:s}=mt();class a{constructor(u={}){const{log:{debug:h,warn:f,error:p,deprecate:d,inspectionDepth:g,enableColors:y}={}}=u;this._inspectionDepth=g||5,this._enableColors=o(y),this._debug=h,this._warn=f,this._error=p,this._deprecate=d}_log(u,h,f){if(h!=null&&!s(h))throw new TypeError("Extensions to knex logger must be functions!");if(s(h)){h(u);return}r(u)||(u=n(u,{depth:this._inspectionDepth,colors:this._enableColors})),console.log(f?f(u):u)}debug(u){this._log(u,this._debug)}warn(u){this._log(u,this._warn,e.yellow)}error(u){this._log(u,this._error,e.red)}deprecate(u,h){const f=`${u} is deprecated, please use ${h}`;this._log(f,this._deprecate,e.yellow)}}function o(l){return l??(process&&process.stdout?process.stdout.isTTY:!1)}return z0=a,z0}var U0,q$;function Tl(){if(q$)return U0;q$=1;const e=Qt(),n=Th(),r=Zs();class s{constructor(l,u,h,f){this.client=l,this._method=u,this._schemaName=void 0,this._columns=void 0,this._fn=f,this._viewName=h,this._statements=[],this._single={}}setSchema(l){this._schemaName=l}columns(l){this._columns=l}as(l){this._selectQuery=l}checkOption(){throw new Error("check option definition is not supported by this dialect.")}localCheckOption(){throw new Error("check option definition is not supported by this dialect.")}cascadedCheckOption(){throw new Error("check option definition is not supported by this dialect.")}toSQL(){return this._method==="alter"&&n(this,a),this._fn.call(this,this),this.client.viewCompiler(this).toSQL()}}const a={column(o){const l=this;return{rename:function(u){return l._statements.push({grouping:"alterView",method:"renameColumn",args:[o,u]}),this},defaultTo:function(u){return l._statements.push({grouping:"alterView",method:"defaultTo",args:[o,u]}),this}}}};return e.addQueryContext(s),s.extend=(o,l)=>{if(Object.prototype.hasOwnProperty.call(s.prototype,o))throw new Error(`Can't extend ViewBuilder with existing method ('${o}').`);r(s.prototype,{[o]:l})},U0=s,U0}var Q0,A$;function Ro(){if(A$)return Q0;A$=1;const{pushQuery:e}=Sh(),n=xh(),{columnize:r}=Vt();class s{constructor(o,l){this.client=o,this.viewBuilder=l,this._commonBuilder=this.viewBuilder,this.method=l._method,this.schemaNameRaw=l._schemaName,this.viewNameRaw=l._viewName,this.single=l._single,this.selectQuery=l._selectQuery,this.columns=l._columns,this.grouped=n(l._statements,"grouping"),this.formatter=o.formatter(l),this.bindings=[],this.formatter.bindings=this.bindings,this.bindingsHolder=this,this.sequence=[]}toSQL(){return this[this.method](),this.sequence}create(){this.createQuery(this.columns,this.selectQuery)}createOrReplace(){throw new Error("replace views is not supported by this dialect.")}createMaterializedView(){throw new Error("materialized views are not supported by this dialect.")}createQuery(o,l,u,h){const f="create "+(u?"materialized ":"")+(h?"or replace ":"")+"view ",p=o?" ("+r(o,this.viewBuilder,this.client,this.bindingsHolder)+")":"";let d=f+this.viewName()+p;switch(d+=" as ",d+=l.toString(),this.single.checkOption){case"default_option":d+=" with check option";break;case"local":d+=" with local check option";break;case"cascaded":d+=" with cascaded check option";break}this.pushQuery({sql:d})}renameView(o,l){throw new Error("rename view is not supported by this dialect (instead drop, then create another view).")}refreshMaterializedView(){throw new Error("materialized views are not supported by this dialect.")}alter(){this.alterView()}alterView(){const o=this.grouped.alterView||[];for(let l=0,u=o.length;l<u;l++){const h=o[l];this[h.method]?this[h.method].apply(this,h.args):this.client.logger.error(`Debug: ${h.method} does not exist`)}for(const l in this.single)typeof this[l]=="function"&&this[l](this.single[l])}renameColumn(o,l){throw new Error("rename column of views is not supported by this dialect.")}defaultTo(o,l){throw new Error("change default values of views is not supported by this dialect.")}viewName(){const o=this.schemaNameRaw?`${this.schemaNameRaw}.${this.viewNameRaw}`:this.viewNameRaw;return this.formatter.wrap(o)}}return s.prototype.pushQuery=e,Q0=s,Q0}var H0,N$;function ra(){if(N$)return H0;N$=1;const{Pool:e,TimeoutError:n}=bK(),{EventEmitter:r}=Qe,{promisify:s}=Qe,{makeEscape:a}=ux(),o=VB(),l=nx(),u=ax(),h=wK(),f=Ji(),{executeQuery:p,enrichQueryObject:d}=aP(),g=ni(),y=ta(),C=lP(),x=Ao(),v=cP(),b=No(),w=qh(),E=na(),{KnexTimeoutError:q}=bo(),{outputQuery:A,unwrapRaw:R}=Vt(),{compileCallback:O}=ea(),I=qo(),k=VK(),N=Ah(),j=GK(),{POOL_CONFIG_OPTIONS:D}=cx(),z=Tl(),T=Ro(),M=Wi(),{setHiddenProperty:$}=lx(),P=tr()("knex:client");class H extends r{constructor(V={}){if(super(),this.config=V,this.logger=new j(V),this.config.connection&&this.config.connection.password&&$(this.config.connection),this.dialect&&!this.config.client&&this.logger.warn("Using 'this.dialect' to identify the client is deprecated and support for it will be removed in the future. Please use configuration option 'client' instead."),!(this.config.client||this.dialect))throw new Error("knex: Required configuration option 'client' is missing.");V.version&&(this.version=V.version),V.connection&&V.connection instanceof Function?(this.connectionConfigProvider=V.connection,this.connectionConfigExpirationChecker=()=>!0):(this.connectionSettings=o(V.connection||{}),V.connection&&V.connection.password&&$(this.connectionSettings,V.connection),this.connectionConfigExpirationChecker=null),this.driverName&&V.connection&&(this.initializeDriver(),(!V.pool||V.pool&&V.pool.max!==0)&&this.initializePool(V)),this.valueForUndefined=this.raw("DEFAULT"),V.useNullAsDefault&&(this.valueForUndefined=null)}formatter(V){return new N(this,V)}queryBuilder(){return new g(this)}queryCompiler(V,B){return new y(this,V,B)}schemaBuilder(){return new C(this)}schemaCompiler(V){return new x(this,V)}tableBuilder(V,B,K,te){return new v(this,V,B,K,te)}viewBuilder(V,B,K){return new z(this,V,B,K)}tableCompiler(V){return new b(this,V)}viewCompiler(V){return new T(this,V)}columnBuilder(V,B,K){return new w(this,V,B,K)}columnCompiler(V,B){return new E(this,V,B)}runner(V){return new h(this,V)}transaction(V,B,K){return new f(this,V,B,K)}raw(){return new I(this).set(...arguments)}ref(){return new k(this,...arguments)}query(V,B){const K=d(V,B,this);return p(V,K,this)}stream(V,B,K,te){const Q=d(V,B,this);return this._stream(V,Q,K,te)}prepBindings(V){return V}positionBindings(V){return V}postProcessResponse(V,B){return this.config.postProcessResponse?this.config.postProcessResponse(V,B):V}wrapIdentifier(V,B){return this.customWrapIdentifier(V,this.wrapIdentifierImpl,B)}customWrapIdentifier(V,B,K){return this.config.wrapIdentifier?this.config.wrapIdentifier(V,B,K):B(V)}wrapIdentifierImpl(V){return V!=="*"?`"${V.replace(/"/g,'""')}"`:"*"}initializeDriver(){try{this.driver=this._driver()}catch(V){const B=`Knex: run
80
+ $ npm install ${this.driverName} --save`;throw this.logger.error(`${B}
81
+ ${V.message}
82
+ ${V.stack}`),new Error(`${B}
83
+ ${V.message}`)}}poolDefaults(){return{min:2,max:10,propagateCreateError:!0}}getPoolSettings(V){V=l({},V,this.poolDefaults()),D.forEach(Q=>{Q in V&&this.logger.warn([`Pool config option "${Q}" is no longer supported.`,"See https://github.com/Vincit/tarn.js for possible pool config options."].join(" "))});const B=6e4,K=[this.config.acquireConnectionTimeout,V.acquireTimeoutMillis].filter(Q=>Q!==void 0);K.length||K.push(B),V.acquireTimeoutMillis=Math.min(...K);const te=async()=>{if(!this.connectionConfigProvider||!this.connectionConfigExpirationChecker||!this.connectionConfigExpirationChecker())return;const Q=await this.connectionConfigProvider();Q.expirationChecker?(this.connectionConfigExpirationChecker=Q.expirationChecker,delete Q.expirationChecker):this.connectionConfigExpirationChecker=null,this.connectionSettings=Q};return Object.assign(V,{create:async()=>{await te();const Q=await this.acquireRawConnection();return Q.__knexUid=u("__knexUid"),V.afterCreate&&await s(V.afterCreate)(Q),Q},destroy:Q=>{if(Q!==void 0)return this.destroyRawConnection(Q)},validate:Q=>Q.__knex__disposed?(this.logger.warn(`Connection Error: ${Q.__knex__disposed}`),!1):this.validateConnection(Q)})}initializePool(V=this.config){if(this.pool){this.logger.warn("The pool has already been initialized");return}const B={...this.getPoolSettings(V.pool)};B.afterCreate&&delete B.afterCreate,this.pool=new e(B)}validateConnection(V){return!0}async acquireConnection(){if(!this.pool)throw new Error("Unable to acquire a connection");try{const V=await this.pool.acquire().promise;return P("acquired connection from pool: %s",V.__knexUid),V.config&&(V.config.password&&$(V.config),V.config.authentication&&V.config.authentication.options&&V.config.authentication.options.password&&$(V.config.authentication.options)),V}catch(V){let B=V;throw V instanceof n&&(B=new q("Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?")),B}}releaseConnection(V){return P("releasing connection to pool: %s",V.__knexUid),this.pool.release(V)||P("pool refused connection: %s",V.__knexUid),Promise.resolve()}async destroy(V){try{this.pool&&this.pool.destroy&&await this.pool.destroy(),this.pool=void 0,typeof V=="function"&&V()}catch(B){if(typeof V=="function")return V(B);throw B}}database(){return this.connectionSettings.database}toString(){return"[object KnexClient]"}assertCanCancelQuery(){if(!this.canCancelQuery)throw new Error("Query cancelling not supported for this dialect")}cancelQuery(){throw new Error("Query cancelling not supported for this dialect")}alias(V,B){return V+" as "+B}parameter(V,B,K){return typeof V=="function"?A(O(V,void 0,this,K),!0,B,this):R(V,!0,B,this,K)||"?"}parameterize(V,B,K,te){if(typeof V=="function")return this.parameter(V,K,te);V=Array.isArray(V)?V:[V];let Q="",J=-1;for(;++J<V.length;){J>0&&(Q+=", ");let ie=V[J];M(ie)&&(ie=JSON.stringify(ie)),Q+=this.parameter(ie===void 0?B:ie,K,te)}return Q}values(V,B,K){return Array.isArray(V)?Array.isArray(V[0])?`(${V.map(te=>`(${this.parameterize(te,void 0,B,K)})`).join(", ")})`:`(${this.parameterize(V,void 0,B,K)})`:V&&V.isRawInstance?`(${this.parameter(V,B,K)})`:this.parameter(V,B,K)}processPassedConnection(V){}toPathForJson(V){return V}}return Object.assign(H.prototype,{_escapeBinding:a({escapeString(G){return`'${G.replace(/'/g,"''")}'`}}),canCancelQuery:!1}),H0=H,H0}var V0,R$;function KK(){if(R$)return V0;R$=1;function e(n){if(n.charAt(0)==="/"){const h=n.split(" ");return{host:h[0],database:h[1]}}const r={};let s,a=!1;/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(n)&&(n=encodeURI(n).replace(/\%25(\d\d)/g,"%$1"));try{s=new URL(n,"postgres://base")}catch{s=new URL(n.replace("@/","@___DUMMY___/"),"postgres://base"),a=!0}for(const h of s.searchParams.entries())r[h[0]]=h[1];if(r.user=r.user||decodeURIComponent(s.username),r.password=r.password||decodeURIComponent(s.password),s.protocol=="socket:")return r.host=decodeURI(s.pathname),r.database=s.searchParams.get("db"),r.client_encoding=s.searchParams.get("encoding"),r;const o=a?"":s.hostname;r.host?o&&/^%2f/i.test(o)&&(s.pathname=o+s.pathname):r.host=decodeURIComponent(o),r.port||(r.port=s.port);const l=s.pathname.slice(1)||null;r.database=l?decodeURI(l):null,(r.ssl==="true"||r.ssl==="1")&&(r.ssl=!0),r.ssl==="0"&&(r.ssl=!1),(r.sslcert||r.sslkey||r.sslrootcert||r.sslmode)&&(r.ssl={});const u=r.sslcert||r.sslkey||r.sslrootcert?Qe:null;switch(r.sslcert&&(r.ssl.cert=u.readFileSync(r.sslcert).toString()),r.sslkey&&(r.ssl.key=u.readFileSync(r.sslkey).toString()),r.sslrootcert&&(r.ssl.ca=u.readFileSync(r.sslrootcert).toString()),r.sslmode){case"disable":{r.ssl=!1;break}case"prefer":case"require":case"verify-ca":case"verify-full":break;case"no-verify":{r.ssl.rejectUnauthorized=!1;break}}return r}return V0=e,e.parse=e,V0}var F0,O$;function YK(){if(O$)return F0;O$=1;const{parse:e}=KK(),n=e,r=process&&process.platform&&process.platform==="win32";function s(o){try{return new URL(o)}catch{return null}}F0=function(l){const u=s(l),h=r&&u&&u.protocol.length===2;if(!u||h)return{client:"sqlite3",connection:{filename:l}};let{protocol:f}=u;f.slice(-1)===":"&&(f=f.slice(0,-1));const p=["postgresql","postgres"].includes(f);return{client:f,connection:p?n(l):a(u)}};function a(o){const l={};let u=o.pathname;if(u[0]==="/"&&(u=u.slice(1)),l.database=u,o.hostname&&(o.protocol.indexOf("mssql")===0?l.server=o.hostname:l.host=o.hostname),o.port&&(l.port=o.port),(o.username||o.password)&&(l.user=decodeURIComponent(o.username)),o.password&&(l.password=decodeURIComponent(o.password)),o.searchParams)for(const[h,f]of o.searchParams.entries())if(["mysql:","mariadb:","mssql:"].includes(o.protocol))try{l[h]=JSON.parse(f)}catch{l[h]=f}else l[h]=f;return l}return F0}var Ru={},G0,M$;function XK(){if(M$)return G0;M$=1;const e=Ji();class n extends e{begin(s){return this.isolationLevel&&this.client.logger.warn("sqlite3 only supports serializable transactions, ignoring the isolation level param"),this.readOnly&&this.client.logger.warn("sqlite3 implicitly handles read vs write transactions"),this.query(s,"BEGIN;")}}return G0=n,G0}var K0,j$;function WK(){if(j$)return K0;j$=1;const e=yh(),n=Ws(),r=tn(),s=qn(),a=Js(),o=ta(),l=Hf(),{isString:u}=mt(),{wrapString:h,columnize:f}=Vt(),p=e("");class d extends o{constructor(y,C,x){super(y,C,x),this.forShare=p,this.forKeyShare=p,this.forUpdate=p,this.forNoKeyUpdate=p}insert(){const y=this.single.insert||[];let C=this.with()+`insert into ${this.tableName} `;if(Array.isArray(y)){if(y.length===0)return"";if(y.length===1&&y[0]&&s(y[0]))return{sql:C+this._emptyInsertValue}}else if(typeof y=="object"&&s(y))return{sql:C+this._emptyInsertValue};const x=this._prepInsert(y);if(u(x))return{sql:C+x};if(x.columns.length===0)return{sql:""};if(C+=`(${this.formatter.columnize(x.columns)})`,this.client.valueForUndefined!==null&&x.values.forEach(R=>{n(R,O=>{if(O===void 0)throw new TypeError("`sqlite` does not support inserting default values. Specify values explicitly or use the `useNullAsDefault` config flag. (see docs https://knexjs.org/guide/query-builder.html#insert).")})}),x.values.length===1){const R=this.client.parameterize(x.values[0],this.client.valueForUndefined,this.builder,this.bindingsHolder);C+=` values (${R})`;const{onConflict:O,ignore:I,merge:k}=this.single;if(O&&I)C+=this._ignore(O);else if(O&&k){C+=this._merge(k.updates,O,y);const j=this.where();j&&(C+=` ${j}`)}const{returning:N}=this.single;return N&&(C+=this._returning(N)),{sql:C,returning:N}}const v=[];let b=-1;for(;++b<x.values.length;){let R=-1;const O=v[b]=[];let I=x.values[b];for(I=I===void 0?this.client.valueForUndefined:I;++R<x.columns.length;)O.push(this.client.alias(this.client.parameter(I[R],this.builder,this.bindingsHolder),this.formatter.wrap(x.columns[R])));v[b]=O.join(", ")}C+=" select "+v.join(" union all select ");const{onConflict:w,ignore:E,merge:q}=this.single;w&&E?C+=" where true"+this._ignore(w):w&&q&&(C+=" where true"+this._merge(q.updates,w,y));const{returning:A}=this.single;return A&&(C+=this._returning(A)),{sql:C,returning:A}}update(){const y=this.with(),C=this._prepUpdate(this.single.update),x=this.where(),{returning:v}=this.single;return{sql:y+`update ${this.single.only?"only ":""}${this.tableName} set ${C.join(", ")}`+(x?` ${x}`:"")+this._returning(v),returning:v}}_ignore(y){return y===!0?" on conflict do nothing":` on conflict ${this._onConflictClause(y)} do nothing`}_merge(y,C,x){let v=` on conflict ${this._onConflictClause(C)} do update set `;if(y&&Array.isArray(y))return v+=y.map(b=>h(b.split(".").pop(),this.formatter.builder,this.client,this.formatter)).map(b=>`${b} = excluded.${b}`).join(", "),v;if(y&&typeof y=="object"){const b=this._prepUpdate(y);return typeof b=="string"?v+=b:v+=b.join(","),v}else{const b=this._prepInsert(x);if(typeof b=="string")throw new Error("If using merge with a raw insert query, then updates must be provided");return v+=b.columns.map(w=>h(w.split(".").pop(),this.builder,this.client)).map(w=>`${w} = excluded.${w}`).join(", "),v}}_returning(y){return y?` returning ${this.formatter.columnize(y)}`:""}truncate(){const{table:y}=this.single;return{sql:`delete from ${this.tableName}`,output(){return this.query({sql:`delete from sqlite_sequence where name = '${y}'`}).catch(l)}}}columnInfo(){const y=this.single.columnInfo;return{sql:`PRAGMA table_info(\`${this.client.customWrapIdentifier(this.single.table,r)}\`)`,output(x){const v=/.*\((\d+)\)/,b=a(x,function(w,E){let{type:q}=E,A=q.match(v);return A&&(A=A[1]),q=A?q.split("(")[0]:q,w[E.name]={type:q.toLowerCase(),maxLength:A,nullable:!E.notnull,defaultValue:E.dflt_value},w},{});return y&&b[y]||b}}}limit(){const y=!this.single.limit&&this.single.limit!==0;return y&&!this.single.offset?"":(this.single.limit=y?-1:this.single.limit,`limit ${this._getValueOrParameterFromAttribute("limit")}`)}jsonExtract(y){return this._jsonExtract("json_extract",y)}jsonSet(y){return this._jsonSet("json_set",y)}jsonInsert(y){return this._jsonSet("json_insert",y)}jsonRemove(y){const C=`json_remove(${f(y.column,this.builder,this.client,this.bindingsHolder)},${this.client.parameter(y.path,this.builder,this.bindingsHolder)})`;return y.alias?this.client.alias(C,this.formatter.wrap(y.alias)):C}whereJsonPath(y){return this._whereJsonPath("json_extract",y)}whereJsonSupersetOf(y){throw new Error("Json superset where clause not actually supported by SQLite")}whereJsonSubsetOf(y){throw new Error("Json subset where clause not actually supported by SQLite")}onJsonPathEquals(y){return this._onJsonPathEquals("json_extract",y)}}return K0=d,K0}var Y0,$$;function JK(){if($$)return Y0;$$=1;var e=Eo();function n(r,s){var a;return e(r,function(o,l,u){return a=s(o,l,u),!a}),!!a}return Y0=n,Y0}var X0,L$;function ZK(){if(L$)return X0;L$=1;var e=vB(),n=mn(),r=JK(),s=vt(),a=To();function o(l,u,h){var f=s(l)?e:r;return h&&a(l,u,h)&&(u=void 0),f(l,n(u,3))}return X0=o,X0}var W0,I$;function eY(){if(I$)return W0;I$=1;const e=Ao(),n=ZK();class r extends e{constructor(a,o){super(a,o)}hasTable(a){const o=`select * from sqlite_master where type = 'table' and name = ${this.client.parameter(this.formatter.wrap(a).replace(/`/g,""),this.builder,this.bindingsHolder)}`;this.pushQuery({sql:o,output:l=>l.length>0})}hasColumn(a,o){this.pushQuery({sql:`PRAGMA table_info(${this.formatter.wrap(a)})`,output(l){return n(l,u=>this.client.wrapIdentifier(u.name.toLowerCase())===this.client.wrapIdentifier(o.toLowerCase()))}})}renameTable(a,o){this.pushQuery(`alter table ${this.formatter.wrap(a)} rename to ${this.formatter.wrap(o)}`)}async generateDdlCommands(){const a=this.builder._sequence;for(let l=0,u=a.length;l<u;l++){const h=a[l];this[h.method].apply(this,h.args)}const o=this.sequence;if(o.length===1&&o[0].statementsProducer)return o[0].statementsProducer();{const l=[];for(const u of o){const h=u.sql;Array.isArray(h)?l.push(...h):l.push(h)}return{pre:[],sql:l,check:null,post:[]}}}}return W0=r,W0}var J0,D$;function tY(){if(D$)return J0;D$=1;const e=na();class n extends e{constructor(){super(...arguments),this.modifiers=["nullable","defaultTo"],this._addCheckModifiers()}enu(s){return`text check (${this.formatter.wrap(this.args[0])} in ('${s.join("', '")}'))`}_pushAlterCheckQuery(s,a){throw new Error("Alter table with to add constraints is not permitted in SQLite")}checkRegex(s,a){return this._check(`${this.formatter.wrap(this.getColumnName())} REGEXP ${this.client._escapeBinding(s)}`,a)}}return n.prototype.json="json",n.prototype.jsonb="json",n.prototype.double=n.prototype.decimal=n.prototype.floating="float",n.prototype.timestamp="datetime",n.prototype.increments=n.prototype.bigincrements="integer not null primary key autoincrement",J0=n,J0}var Z0,k$;function nY(){if(k$)return Z0;k$=1;const e=ZE(),n=wh(),r=tn(),{isObject:s}=mt(),a=No(),{formatDefault:o}=ea();class l extends a{constructor(){super(...arguments)}createQuery(h,f,p){let g=(f?"create table if not exists ":"create table ")+this.tableName();p&&this.tableNameLike()?g+=" as select * from "+this.tableNameLike()+" where 0=1":(g+=" ("+h.sql.join(", "),g+=this.foreignKeys()||"",g+=this.primaryKeys()||"",g+=this._addChecks(),g+=")"),this.pushQuery(g),p&&this.addColumns(h,this.addColumnsPrefix)}addColumns(h,f,p){if(f===this.alterColumnsPrefix){const d=this,g=p.map(y=>{const C=this.client.customWrapIdentifier(y.getColumnName(),r,y.columnBuilder.queryContext()),x=y.getColumnType(),v=y.modified.defaultTo?o(y.modified.defaultTo[0],y.type,this.client):null,b=y.modified.nullable&&y.modified.nullable[0]===!1;return{name:C,type:x,defaultTo:v,notNull:b}});this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,statementsProducer(y,C){return d.client.ddl(d,y,C).alterColumn(g)}})}else for(let d=0,g=h.sql.length;d<g;d++)this.pushQuery({sql:`alter table ${this.tableName()} add column ${h.sql[d]}`,bindings:h.bindings[d]})}dropUnique(h,f){f=f?this.formatter.wrap(f):this._indexCommand("unique",this.tableNameRaw,h),this.pushQuery(`drop index ${f}`)}dropForeign(h,f){const p=this;h=Array.isArray(h)?h:[h],h=h.map(d=>this.client.customWrapIdentifier(d,r)),f=this.client.customWrapIdentifier(f,r),this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,output(d){return p.client.ddl(p,d,this.connection).dropForeign(h,f)}})}dropPrimary(h){const f=this;h=this.client.customWrapIdentifier(h,r),this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,output(p){return f.client.ddl(f,p,this.connection).dropPrimary(h)}})}dropIndex(h,f){f=f?this.formatter.wrap(f):this._indexCommand("index",this.tableNameRaw,h),this.pushQuery(`drop index ${f}`)}unique(h,f){let p,d;s(f)&&({indexName:f,deferrable:p,predicate:d}=f),p&&p!=="not deferrable"&&this.client.logger.warn(`sqlite3: unique index \`${f}\` will not be deferrable ${p} because sqlite3 does not support deferred constraints.`),f=f?this.formatter.wrap(f):this._indexCommand("unique",this.tableNameRaw,h),h=this.formatter.columnize(h);const g=d?" "+this.client.queryCompiler(d).where():"";this.pushQuery(`create unique index ${f} on ${this.tableName()} (${h})${g}`)}index(h,f,p){f=f?this.formatter.wrap(f):this._indexCommand("index",this.tableNameRaw,h),h=this.formatter.columnize(h);let d;s(p)&&({predicate:d}=p);const g=d?" "+this.client.queryCompiler(d).where():"";this.pushQuery(`create index ${f} on ${this.tableName()} (${h})${g}`)}primary(h,f){const p=this;h=Array.isArray(h)?h:[h],h=h.map(g=>this.client.customWrapIdentifier(g,r));let d;s(f)&&({constraintName:f,deferrable:d}=f),d&&d!=="not deferrable"&&this.client.logger.warn(`sqlite3: primary key constraint \`${f}\` will not be deferrable ${d} because sqlite3 does not support deferred constraints.`),f=this.client.customWrapIdentifier(f,r),this.method!=="create"&&this.method!=="createIfNot"&&this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,output(g){return p.client.ddl(p,g,this.connection).primary(h,f)}})}foreign(h){const f=this;this.method!=="create"&&this.method!=="createIfNot"&&(h.column=Array.isArray(h.column)?h.column:[h.column],h.column=h.column.map(p=>this.client.customWrapIdentifier(p,r)),h.inTable=this.client.customWrapIdentifier(h.inTable,r),h.references=Array.isArray(h.references)?h.references:[h.references],h.references=h.references.map(p=>this.client.customWrapIdentifier(p,r)),this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,statementsProducer(p,d){return f.client.ddl(f,p,d).foreign(h)}}))}primaryKeys(){const h=e(this.grouped.alterTable||[],{method:"primary"});if(h.length>0&&h[0].args.length>0){const f=h[0].args[0];let p=h[0].args[1]||"";p&&(p=" constraint "+this.formatter.wrap(p));const d=this.grouped.columns.filter(g=>g.builder._type==="increments").length>0;return`,${p} ${d?"unique":"primary key"} (${this.formatter.columnize(f)})`}}foreignKeys(){let h="";const f=e(this.grouped.alterTable||[],{method:"foreign"});for(let p=0,d=f.length;p<d;p++){const g=f[p].args[0],y=this.formatter.columnize(g.column),C=this.formatter.columnize(g.references),x=this.formatter.wrap(g.inTable);let v=g.keyName||"";v&&(v=" constraint "+this.formatter.wrap(v)),h+=`,${v} foreign key(${y}) references ${x}(${C})`,g.onDelete&&(h+=` on delete ${g.onDelete}`),g.onUpdate&&(h+=` on update ${g.onUpdate}`)}return h}createTableBlock(){return this.getColumns().concat().join(",")}renameColumn(h,f){this.pushQuery({sql:`alter table ${this.tableName()} rename ${this.formatter.wrap(h)} to ${this.formatter.wrap(f)}`})}_setNullableState(h,f){const p=this;this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,statementsProducer(d,g){return p.client.ddl(p,d,g).setNullable(h,f)}})}dropColumn(){const h=this,p=n(arguments).map(d=>this.client.customWrapIdentifier(d,r));this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,output(d){return h.client.ddl(h,d,this.connection).dropColumn(p)}})}}return Z0=l,Z0}var ew,B$;function rY(){if(B$)return ew;B$=1;const e=Ro(),{columnize:n}=Vt();class r extends e{constructor(a,o){super(a,o)}createOrReplace(){const a=this.columns,o=this.selectQuery.toString(),l=this.viewName(),u=a?" ("+n(a,this.viewBuilder,this.client,this.bindingsHolder)+")":"",h=`drop view if exists ${l}`,f=`create view ${l}${u} as ${o}`;this.pushQuery({sql:h}),this.pushQuery({sql:f})}}return ew=r,ew}var tw,P$;function iY(){if(P$)return tw;P$=1;function e(u,h,f){return`INSERT INTO "${h}" SELECT ${f===void 0?"*":f.map(p=>`"${p}"`).join(", ")} FROM "${u}";`}function n(u){return`DROP TABLE "${u}"`}function r(u,h){return`ALTER TABLE "${u}" RENAME TO "${h}"`}function s(u){return`SELECT type, sql FROM sqlite_master WHERE (type='table' OR (type='index' AND sql IS NOT NULL)) AND lower(tbl_name)='${u.toLowerCase()}'`}function a(){return"PRAGMA foreign_keys"}function o(u){return`PRAGMA foreign_keys = ${u?"ON":"OFF"}`}function l(){return"PRAGMA foreign_key_check"}return tw={copyData:e,dropOriginal:n,renameTable:r,getTableSql:s,isForeignCheckEnabled:a,setForeignCheck:o,executeForeignCheck:l},tw}var nw,z$;function sY(){if(z$)return nw;z$=1;function e(n,r){const s=new RegExp(Object.entries(r).map(([l,u])=>`(?<${l}>${u.source})`).join("|"),"yi");let a=0;const o=[];for(;a<n.length;){s.lastIndex=a;const l=n.match(s);if(l!==null){const[u,h]=Object.entries(l.groups).find(([f,p])=>p!==void 0);a+=h.length,u.startsWith("_")||o.push({type:u,text:h})}else throw new Error(`No matching tokenizer rule found at: [${n.substring(a)}]`)}return o}return nw={tokenize:e},nw}var rw,U$;function aY(){if(U$)return rw;U$=1;function e(f,p=d=>d){return function({index:d=0,input:g}){let y=d;const C=[];for(const x of f){const v=x({index:y,input:g});if(v.success)y=v.index,C.push(v.ast);else return v}return{success:!0,ast:p(C),index:y,input:g}}}function n(f,p=d=>d){return function({index:d=0,input:g}){for(const y of f){const C=y({index:d,input:g});if(C.success)return{success:!0,ast:p(C.ast),index:C.index,input:g}}return{success:!1,ast:null,index:d,input:g}}}function r(f,p=d=>d){return function({index:d=0,input:g}){let y={},C=d;const x=[];do y=f({index:C,input:g}),y.success&&(C=y.index,x.push(y.ast));while(y.success);return x.length>0?{success:!0,ast:p(x),index:C,input:g}:{success:!1,ast:null,index:C,input:g}}}function s(f,p=d=>d){return function({index:d=0,input:g}){const y=f({index:d,input:g});return y.success?{success:!0,ast:p(y.ast),index:y.index,input:g}:{success:!0,ast:p(null),index:d,input:g}}}function a(f,p=d=>d){return function({index:d=0,input:g}){const y=f.do({index:d,input:g});return y.success&&f.next({index:y.index,input:g}).success?{success:!0,ast:p(y.ast),index:y.index,input:g}:{success:!1,ast:null,index:d,input:g}}}function o(f,p=d=>d){return function({index:d=0,input:g}){const y=f.do({index:d,input:g});return y.success&&!f.not({index:d,input:g}).success?{success:!0,ast:p(y.ast),index:y.index,input:g}:{success:!1,ast:null,index:d,input:g}}}function l(f,p=d=>d.text){return function({index:d=0,input:g}){const y=g[d];return y!==void 0&&(f.type===void 0||f.type===y.type)&&(f.text===void 0||f.text.toUpperCase()===y.text.toUpperCase())?{success:!0,ast:p(y),index:d+1,input:g}:{success:!1,ast:null,index:d,input:g}}}return rw={s:e,a:n,m:r,o:s,l:a,n:o,t:l,e:function({index:f=0,input:p}){return{success:!0,ast:null,index:f,input:p}},f:function({index:f=0,input:p}){return{success:f===p.length,ast:null,index:f,input:p}}},rw}var iw,Q$;function oY(){if(Q$)return iw;Q$=1;const{tokenize:e}=sY(),{s:n,a:r,m:s,o:a,l:o,n:l,t:u,e:h,f}=aY(),p={keyword:/(?:ABORT|ACTION|ADD|AFTER|ALL|ALTER|ALWAYS|ANALYZE|AND|AS|ASC|ATTACH|AUTOINCREMENT|BEFORE|BEGIN|BETWEEN|BY|CASCADE|CASE|CAST|CHECK|COLLATE|COLUMN|COMMIT|CONFLICT|CONSTRAINT|CREATE|CROSS|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|DATABASE|DEFAULT|DEFERRED|DEFERRABLE|DELETE|DESC|DETACH|DISTINCT|DO|DROP|END|EACH|ELSE|ESCAPE|EXCEPT|EXCLUSIVE|EXCLUDE|EXISTS|EXPLAIN|FAIL|FILTER|FIRST|FOLLOWING|FOR|FOREIGN|FROM|FULL|GENERATED|GLOB|GROUP|GROUPS|HAVING|IF|IGNORE|IMMEDIATE|IN|INDEX|INDEXED|INITIALLY|INNER|INSERT|INSTEAD|INTERSECT|INTO|IS|ISNULL|JOIN|KEY|LAST|LEFT|LIKE|LIMIT|MATCH|MATERIALIZED|NATURAL|NO|NOT|NOTHING|NOTNULL|NULL|NULLS|OF|OFFSET|ON|OR|ORDER|OTHERS|OUTER|OVER|PARTITION|PLAN|PRAGMA|PRECEDING|PRIMARY|QUERY|RAISE|RANGE|RECURSIVE|REFERENCES|REGEXP|REINDEX|RELEASE|RENAME|REPLACE|RESTRICT|RETURNING|RIGHT|ROLLBACK|ROW|ROWS|SAVEPOINT|SELECT|SET|TABLE|TEMP|TEMPORARY|THEN|TIES|TO|TRANSACTION|TRIGGER|UNBOUNDED|UNION|UNIQUE|UPDATE|USING|VACUUM|VALUES|VIEW|VIRTUAL|WHEN|WHERE|WINDOW|WITH|WITHOUT)(?=\s+|-|\(|\)|;|\+|\*|\/|%|==|=|<=|<>|<<|<|>=|>>|>|!=|,|&|~|\|\||\||\.)/,id:/"[^"]*(?:""[^"]*)*"|`[^`]*(?:``[^`]*)*`|\[[^[\]]*\]|[a-z_][a-z0-9_$]*/,string:/'[^']*(?:''[^']*)*'/,blob:/x'(?:[0-9a-f][0-9a-f])+'/,numeric:/(?:\d+(?:\.\d*)?|\.\d+)(?:e(?:\+|-)?\d+)?|0x[0-9a-f]+/,variable:/\?\d*|[@$:][a-z0-9_$]+/,operator:/-|\(|\)|;|\+|\*|\/|%|==|=|<=|<>|<<|<|>=|>>|>|!=|,|&|~|\|\||\||\./,_ws:/\s+/};function d(de){const X=y({input:e(de,p)});if(!X.success)throw new Error(`Parsing CREATE TABLE failed at [${X.input.slice(X.index).map(Me=>Me.text).join(" ")}] of "${de}"`);return X.ast}function g(de){const X=be({input:e(de,p)});if(!X.success)throw new Error(`Parsing CREATE INDEX failed at [${X.input.slice(X.index).map(Me=>Me.text).join(" ")}] of "${de}"`);return X.ast}function y(de){return n([u({text:"CREATE"},X=>null),C,u({text:"TABLE"},X=>null),_e,we,ae,u({text:"("},X=>null),v,M,u({text:")"},X=>null),x,f],X=>Object.assign({},...X.filter(Me=>Me!==null)))(de)}function C(de){return r([u({text:"TEMP"}),u({text:"TEMPORARY"}),h],X=>({temporary:X!==null}))(de)}function x(de){return a(n([u({text:"WITHOUT"}),u({text:"ROWID"})]),X=>({rowid:X!==null}))(de)}function v(de){return r([n([b,u({text:","}),v],X=>({columns:[X[0]].concat(X[2].columns)})),n([b],X=>({columns:[X[0]]}))])(de)}function b(de){return n([n([Oe],X=>({name:X[0]})),w,E],X=>Object.assign({},...X))(de)}function w(de){return a(n([s(u({type:"id"})),r([n([u({text:"("}),rt,u({text:","}),rt,u({text:")"})],X=>`(${X[1]}, ${X[3]})`),n([u({text:"("}),rt,u({text:")"})],X=>`(${X[1]})`),h])],X=>`${X[0].join(" ")}${X[1]||""}`),X=>({type:X}))(de)}function E(de){return a(s(q),X=>({constraints:Object.assign({primary:null,notnull:null,null:null,unique:null,check:null,default:null,collate:null,references:null,as:null},...X||[])}))(de)}function q(de){return r([A,O,I,k,N,j,D,z,T])(de)}function A(de){return n([fe,u({text:"PRIMARY"},X=>null),u({text:"KEY"},X=>null),Tt,G,R],X=>({primary:Object.assign({},...X.filter(Me=>Me!==null))}))(de)}function R(de){return a(u({text:"AUTOINCREMENT"}),X=>({autoincrement:X!==null}))(de)}function O(de){return n([fe,u({text:"NOT"},X=>null),u({text:"NULL"},X=>null),G],X=>({notnull:Object.assign({},...X.filter(Me=>Me!==null))}))(de)}function I(de){return n([fe,u({text:"NULL"},X=>null),G],X=>({null:Object.assign({},...X.filter(Me=>Me!==null))}))(de)}function k(de){return n([fe,u({text:"UNIQUE"},X=>null),G],X=>({unique:Object.assign({},...X.filter(Me=>Me!==null))}))(de)}function N(de){return n([fe,u({text:"CHECK"},X=>null),u({text:"("},X=>null),n([Ge],X=>({expression:X[0]})),u({text:")"},X=>null)],X=>({check:Object.assign({},...X.filter(Me=>Me!==null))}))(de)}function j(de){return n([fe,u({text:"DEFAULT"},X=>null),r([n([u({text:"("}),Ge,u({text:")"})],X=>({value:X[1],expression:!0})),n([Je],X=>({value:X[0],expression:!1})),n([rt],X=>({value:X[0],expression:!1}))])],X=>({default:Object.assign({},...X.filter(Me=>Me!==null))}))(de)}function D(de){return n([fe,u({text:"COLLATE"},X=>null),u({type:"id"},X=>({collation:X.text}))],X=>({collate:Object.assign({},...X.filter(Me=>Me!==null))}))(de)}function z(de){return n([fe,n([K],X=>X[0].references)],X=>({references:Object.assign({},...X.filter(Me=>Me!==null))}))(de)}function T(de){return n([fe,a(n([u({text:"GENERATED"}),u({text:"ALWAYS"})]),X=>({generated:X!==null})),u({text:"AS"},X=>null),u({text:"("},X=>null),n([Ge],X=>({expression:X[0]})),u({text:")"},X=>null),r([u({text:"STORED"}),u({text:"VIRTUAL"}),h],X=>({mode:X?X.toUpperCase():null}))],X=>({as:Object.assign({},...X.filter(Me=>Me!==null))}))(de)}function M(de){return a(s(n([u({text:","}),$],X=>X[1])),X=>({constraints:X||[]}))(de)}function $(de){return r([P,H,V,B])(de)}function P(de){return n([fe,u({text:"PRIMARY"},X=>null),u({text:"KEY"},X=>null),u({text:"("},X=>null),Se,u({text:")"},X=>null),G],X=>Object.assign({type:"PRIMARY KEY"},...X.filter(Me=>Me!==null)))(de)}function H(de){return n([fe,u({text:"UNIQUE"},X=>null),u({text:"("},X=>null),Se,u({text:")"},X=>null),G],X=>Object.assign({type:"UNIQUE"},...X.filter(Me=>Me!==null)))(de)}function G(de){return a(n([u({text:"ON"}),u({text:"CONFLICT"}),r([u({text:"ROLLBACK"}),u({text:"ABORT"}),u({text:"FAIL"}),u({text:"IGNORE"}),u({text:"REPLACE"})])],X=>X[2]),X=>({conflict:X?X.toUpperCase():null}))(de)}function V(de){return n([fe,u({text:"CHECK"},X=>null),u({text:"("},X=>null),n([Ge],X=>({expression:X[0]})),u({text:")"},X=>null)],X=>Object.assign({type:"CHECK"},...X.filter(Me=>Me!==null)))(de)}function B(de){return n([fe,u({text:"FOREIGN"},X=>null),u({text:"KEY"},X=>null),u({text:"("},X=>null),Q,u({text:")"},X=>null),K],X=>Object.assign({type:"FOREIGN KEY"},...X.filter(Me=>Me!==null)))(de)}function K(de){return n([u({text:"REFERENCES"},X=>null),ae,te,a(s(r([J,ie,oe])),X=>Object.assign({delete:null,update:null,match:null},...X||[])),ee],X=>({references:Object.assign({},...X.filter(Me=>Me!==null))}))(de)}function te(de){return a(n([u({text:"("}),Q,u({text:")"})],X=>X[1]),X=>({columns:X?X.columns:[]}))(de)}function Q(de){return n([a(s(n([Oe,u({text:","})],X=>X[0])),X=>X!==null?X:[]),Oe],X=>({columns:X[0].concat([X[1]])}))(de)}function J(de){return n([u({text:"ON"}),u({text:"DELETE"}),We],X=>({delete:X[2]}))(de)}function ie(de){return n([u({text:"ON"}),u({text:"UPDATE"}),We],X=>({update:X[2]}))(de)}function oe(de){return n([u({text:"MATCH"}),r([u({type:"keyword"}),u({type:"id"})])],X=>({match:X[1]}))(de)}function ee(de){return a(n([a(u({text:"NOT"})),u({text:"DEFERRABLE"}),a(n([u({text:"INITIALLY"}),r([u({text:"DEFERRED"}),u({text:"IMMEDIATE"})])],X=>X[1].toUpperCase()))]),X=>({deferrable:X?{not:X[0]!==null,initially:X[2]}:null}))(de)}function fe(de){return a(n([u({text:"CONSTRAINT"}),Oe],X=>X[1]),X=>({name:X}))(de)}function be(de){return n([u({text:"CREATE"},X=>null),ve,u({text:"INDEX"},X=>null),_e,we,W,u({text:"ON"},X=>null),ae,u({text:"("},X=>null),Se,u({text:")"},X=>null),xe,f],X=>Object.assign({},...X.filter(Me=>Me!==null)))(de)}function ve(de){return a(u({text:"UNIQUE"}),X=>({unique:X!==null}))(de)}function _e(de){return a(n([u({text:"IF"}),u({text:"NOT"}),u({text:"EXISTS"})]),X=>({exists:X!==null}))(de)}function we(de){return a(n([Oe,u({text:"."})],X=>X[0]),X=>({schema:X}))(de)}function W(de){return n([Oe],X=>({index:X[0]}))(de)}function ae(de){return n([Oe],X=>({table:X[0]}))(de)}function xe(de){return a(n([u({text:"WHERE"}),Ge],X=>X[1]),X=>({where:X}))(de)}function Se(de){return r([n([gt,u({text:","}),Se],X=>({columns:[X[0]].concat(X[2].columns)})),n([ut,u({text:","}),Se],X=>({columns:[X[0]].concat(X[2].columns)})),o({do:gt,next:u({text:")"})},X=>({columns:[X]})),o({do:ut,next:u({text:")"})},X=>({columns:[X]}))])(de)}function gt(de){return n([n([Oe],X=>({name:X[0],expression:!1})),It,Tt],X=>Object.assign({},...X.filter(Me=>Me!==null)))(de)}function ut(de){return n([n([qt],X=>({name:X[0],expression:!0})),It,Tt],X=>Object.assign({},...X.filter(Me=>Me!==null)))(de)}function It(de){return a(n([u({text:"COLLATE"}),u({type:"id"})],X=>X[1]),X=>({collation:X}))(de)}function Tt(de){return r([u({text:"ASC"}),u({text:"DESC"}),h],X=>({order:X?X.toUpperCase():null}))(de)}function qt(de){return s(r([l({do:u({type:"keyword"}),not:r([u({text:"COLLATE"}),u({text:"ASC"}),u({text:"DESC"})])}),u({type:"id"}),u({type:"string"}),u({type:"blob"}),u({type:"numeric"}),u({type:"variable"}),l({do:u({type:"operator"}),not:r([u({text:"("}),u({text:")"}),u({text:","})])}),n([u({text:"("}),a(Ge),u({text:")"})],X=>X[1]||[])]))(de)}function Ge(de){return s(r([u({type:"keyword"}),u({type:"id"}),u({type:"string"}),u({type:"blob"}),u({type:"numeric"}),u({type:"variable"}),l({do:u({type:"operator"}),not:r([u({text:"("}),u({text:")"})])}),n([u({text:"("}),a(Ge),u({text:")"})],X=>X[1]||[])]))(de)}function Oe(de){return r([u({type:"id"}),u({type:"string"})],X=>/^["`['][^]*["`\]']$/.test(X)?X.substring(1,X.length-1):X)(de)}function We(de){return r([n([u({text:"SET"}),u({text:"NULL"})],X=>`${X[0]} ${X[1]}`),n([u({text:"SET"}),u({text:"DEFAULT"})],X=>`${X[0]} ${X[1]}`),u({text:"CASCADE"}),u({text:"RESTRICT"}),n([u({text:"NO"}),u({text:"ACTION"})],X=>`${X[0]} ${X[1]}`)],X=>X.toUpperCase())(de)}function Je(de){return r([u({type:"numeric"}),u({type:"string"}),u({type:"id"}),u({type:"blob"}),u({text:"NULL"}),u({text:"TRUE"}),u({text:"FALSE"}),u({text:"CURRENT_TIME"}),u({text:"CURRENT_DATE"}),u({text:"CURRENT_TIMESTAMP"})])(de)}function rt(de){return n([r([u({text:"+"}),u({text:"-"}),h]),u({type:"numeric"})],X=>`${X[0]||""}${X[1]}`)(de)}return iw={parseCreateTable:d,parseCreateIndex:g},iw}var sw,H$;function uY(){if(H$)return sw;H$=1;function e(W,ae=xe=>xe){return r(W,ae)}function n(W,ae=xe=>xe){return G(W,ae)}function r(W,ae){return`CREATE${s(W)} TABLE${B(W)} ${K(W,ae)}${Q(W,ae)} (${o(W,ae)}${E(W,ae)})${a(W)}`}function s(W,ae){return W.temporary?" TEMP":""}function a(W,ae){return W.rowid?" WITHOUT ROWID":""}function o(W,ae){return W.columns.map(xe=>l(xe,ae)).join(", ")}function l(W,ae){return`${we(W.name,ae)}${u(W)}${h(W.constraints,ae)}`}function u(W,ae){return W.type!==null?` ${W.type}`:""}function h(W,ae){return`${f(W,ae)}${d(W,ae)}${g(W,ae)}${y(W,ae)}${C(W,ae)}${x(W,ae)}${v(W,ae)}${b(W,ae)}${w(W,ae)}`}function f(W,ae){return W.primary!==null?` ${H(W.primary,ae)}PRIMARY KEY${be(W.primary)}${O(W.primary)}${p(W.primary)}`:""}function p(W,ae){return W.autoincrement?" AUTOINCREMENT":""}function d(W,ae){return W.notnull!==null?` ${H(W.notnull,ae)}NOT NULL${O(W.notnull)}`:""}function g(W,ae){return W.null!==null?` ${H(W.null,ae)}NULL${O(W.null)}`:""}function y(W,ae){return W.unique!==null?` ${H(W.unique,ae)}UNIQUE${O(W.unique)}`:""}function C(W,ae){return W.check!==null?` ${H(W.check,ae)}CHECK (${_e(W.check.expression)})`:""}function x(W,ae){return W.default!==null?` ${H(W.default,ae)}DEFAULT ${W.default.expression?`(${_e(W.default.value)})`:W.default.value}`:""}function v(W,ae){return W.collate!==null?` ${H(W.collate,ae)}COLLATE ${W.collate.collation}`:""}function b(W,ae){return W.references!==null?` ${H(W.references,ae)}${N(W.references,ae)}`:""}function w(W,ae){return W.as!==null?` ${H(W.as,ae)}${W.as.generated?"GENERATED ALWAYS ":""}AS (${_e(W.as.expression)})${W.as.mode!==null?` ${W.as.mode}`:""}`:""}function E(W,ae){return W.constraints.reduce((xe,Se)=>`${xe}, ${q(Se,ae)}`,"")}function q(W,ae){switch(W.type){case"PRIMARY KEY":return A(W,ae);case"UNIQUE":return R(W,ae);case"CHECK":return I(W,ae);case"FOREIGN KEY":return k(W,ae)}}function A(W,ae){return`${H(W,ae)}PRIMARY KEY (${ie(W,ae)})${O(W)}`}function R(W,ae){return`${H(W,ae)}UNIQUE (${ie(W,ae)})${O(W)}`}function O(W,ae){return W.conflict!==null?` ON CONFLICT ${W.conflict}`:""}function I(W,ae){return`${H(W,ae)}CHECK (${_e(W.expression)})`}function k(W,ae){return`${H(W,ae)}FOREIGN KEY (${D(W,ae)}) ${N(W.references,ae)}`}function N(W,ae){return`REFERENCES ${Q(W,ae)}${j(W,ae)}${z(W)}${P(W.deferrable)}`}function j(W,ae){return W.columns.length>0?` (${D(W,ae)})`:""}function D(W,ae){return W.columns.map(xe=>we(xe,ae)).join(", ")}function z(W,ae){return`${T(W)}${M(W)}${$(W)}`}function T(W,ae){return W.delete!==null?` ON DELETE ${W.delete}`:""}function M(W,ae){return W.update!==null?` ON UPDATE ${W.update}`:""}function $(W,ae){return W.match!==null?` MATCH ${W.match}`:""}function P(W,ae){return W!==null?` ${W.not?"NOT ":""}DEFERRABLE${W.initially!==null?` INITIALLY ${W.initially}`:""}`:""}function H(W,ae){return W.name!==null?`CONSTRAINT ${we(W.name,ae)} `:""}function G(W,ae){return`CREATE${V(W)} INDEX${B(W)} ${K(W,ae)}${te(W,ae)} on ${Q(W,ae)} (${ie(W,ae)})${J(W)}`}function V(W,ae){return W.unique?" UNIQUE":""}function B(W,ae){return W.exists?" IF NOT EXISTS":""}function K(W,ae){return W.schema!==null?`${we(W.schema,ae)}.`:""}function te(W,ae){return we(W.index,ae)}function Q(W,ae){return we(W.table,ae)}function J(W,ae){return W.where!==null?` where ${_e(W.where)}`:""}function ie(W,ae){return W.columns.map(xe=>xe.expression?ee(xe):oe(xe,ae)).join(", ")}function oe(W,ae){return`${we(W.name,ae)}${fe(W)}${be(W)}`}function ee(W,ae){return`${ve(W.name)}${fe(W)}${be(W)}`}function fe(W,ae){return W.collation!==null?` COLLATE ${W.collation}`:""}function be(W,ae){return W.order!==null?` ${W.order}`:""}function ve(W,ae){return _e(W)}function _e(W,ae){return W.reduce((xe,Se)=>Array.isArray(Se)?`${xe}(${_e(Se)})`:xe?`${xe} ${Se}`:Se,"")}function we(W,ae){return ae(W)}return sw={compileCreateTable:e,compileCreateIndex:n},sw}var aw,V$;function lY(){if(V$)return aw;V$=1;function e(r,s){return r.toLowerCase()===s.toLowerCase()}function n(r,s){return r.some(a=>e(a,s))}return aw={isEqualId:e,includesId:n},aw}var ow,F$;function cY(){if(F$)return ow;F$=1;const e=tn(),{nanonum:n}=dx(),{copyData:r,dropOriginal:s,renameTable:a,getTableSql:o,isForeignCheckEnabled:l,setForeignCheck:u,executeForeignCheck:h}=iY(),{parseCreateTable:f,parseCreateIndex:p}=oY(),{compileCreateTable:d,compileCreateIndex:g}=uY(),{isEqualId:y,includesId:C}=lY();class x{constructor(b,w,E,q){this.client=b,this.tableCompiler=w,this.pragma=E,this.tableNameRaw=this.tableCompiler.tableNameRaw,this.alteredName=`_knex_temp_alter${n(3)}`,this.connection=q,this.formatter=A=>this.client.customWrapIdentifier(A,e),this.wrap=A=>this.client.wrapIdentifierImpl(A)}tableName(){return this.formatter(this.tableNameRaw)}getTableSql(){const b=this.tableName();return this.client.transaction(async w=>{w.disableProcessing();const E=await w.raw(o(b));return w.enableProcessing(),{createTable:E.filter(q=>q.type==="table")[0].sql,createIndices:E.filter(q=>q.type==="index").map(q=>q.sql)}},{connection:this.connection})}async isForeignCheckEnabled(){return(await this.client.raw(l()).connection(this.connection))[0].foreign_keys===1}async setForeignCheck(b){await this.client.raw(u(b)).connection(this.connection)}renameTable(b){return b.raw(a(this.alteredName,this.tableName()))}dropOriginal(b){return b.raw(s(this.tableName()))}copyData(b,w){return b.raw(r(this.tableName(),this.alteredName,w))}async alterColumn(b){const{createTable:w,createIndices:E}=await this.getTableSql(),q=f(w);q.table=this.alteredName,q.columns=q.columns.map(R=>{const O=b.find(I=>y(I.name,R.name));return O&&(R.type=O.type,R.constraints.default=O.defaultTo!==null?{name:null,value:O.defaultTo,expression:!1}:null,R.constraints.notnull=O.notNull?{name:null,conflict:null}:null,R.constraints.null=O.notNull?null:R.constraints.null),R});const A=d(q,this.wrap);return this.generateAlterCommands(A,E)}async dropColumn(b){const{createTable:w,createIndices:E}=await this.getTableSql(),q=f(w);if(q.table=this.alteredName,q.columns=q.columns.filter(I=>I.expression||!C(b,I.name)),q.columns.length===0)throw new Error("Unable to drop last column from table");q.constraints=q.constraints.filter(I=>I.type==="PRIMARY KEY"||I.type==="UNIQUE"?I.columns.every(k=>k.expression||!C(b,k.name)):I.type==="FOREIGN KEY"?I.columns.every(k=>!C(b,k))&&(I.references.table!==q.table||I.references.columns.every(k=>!C(b,k))):!0);const A=q.columns.map(I=>I.name),R=d(q,this.wrap),O=[];for(const I of E){const k=p(I);k.columns=k.columns.filter(N=>N.expression||!C(b,N.name)),k.columns.length>0&&O.push(g(k,this.wrap))}return this.alter(R,O,A)}async dropForeign(b,w){const{createTable:E,createIndices:q}=await this.getTableSql(),A=f(E);A.table=this.alteredName,w||(A.columns=A.columns.map(O=>({...O,references:C(b,O.name)?null:O.references}))),A.constraints=A.constraints.filter(O=>O.type==="FOREIGN KEY"?w?!O.name||!y(O.name,w):O.columns.every(I=>!C(b,I)):!0);const R=d(A,this.wrap);return this.alter(R,q)}async dropPrimary(b){const{createTable:w,createIndices:E}=await this.getTableSql(),q=f(w);q.table=this.alteredName,q.columns=q.columns.map(R=>({...R,primary:null})),q.constraints=q.constraints.filter(R=>R.type==="PRIMARY KEY"?b?!R.name||!y(R.name,b):!1:!0);const A=d(q,this.wrap);return this.alter(A,E)}async primary(b,w){const{createTable:E,createIndices:q}=await this.getTableSql(),A=f(E);A.table=this.alteredName,A.columns=A.columns.map(O=>({...O,primary:null})),A.constraints=A.constraints.filter(O=>O.type!=="PRIMARY KEY"),A.constraints.push({type:"PRIMARY KEY",name:w||null,columns:b.map(O=>({name:O,expression:!1,collation:null,order:null})),conflict:null});const R=d(A,this.wrap);return this.alter(R,q)}async foreign(b){const{createTable:w,createIndices:E}=await this.getTableSql(),q=f(w);q.table=this.alteredName,q.constraints.push({type:"FOREIGN KEY",name:b.keyName||null,columns:b.column,references:{table:b.inTable,columns:b.references,delete:b.onDelete||null,update:b.onUpdate||null,match:null,deferrable:null}});const A=d(q,this.wrap);return this.generateAlterCommands(A,E)}async setNullable(b,w){const{createTable:E,createIndices:q}=await this.getTableSql(),A=f(E);A.table=this.alteredName;const R=A.columns.find(I=>y(b,I.name));if(!R)throw new Error(`.setNullable: Column ${b} does not exist in table ${this.tableName()}.`);R.constraints.notnull=w?null:{name:null,conflict:null},R.constraints.null=w?R.constraints.null:null;const O=d(A,this.wrap);return this.generateAlterCommands(O,q)}async alter(b,w,E){const q=await this.isForeignCheckEnabled();q&&await this.setForeignCheck(!1);try{await this.client.transaction(async A=>{await A.raw(b),await this.copyData(A,E),await this.dropOriginal(A),await this.renameTable(A);for(const R of w)await A.raw(R);if(q&&(await A.raw(h())).length>0)throw new Error("FOREIGN KEY constraint failed")},{connection:this.connection})}finally{q&&await this.setForeignCheck(!0)}}async generateAlterCommands(b,w,E){const q=[],A=[],R=[];let O=null;q.push(b),q.push(r(this.tableName(),this.alteredName,E)),q.push(s(this.tableName())),q.push(a(this.alteredName,this.tableName()));for(const k of w)q.push(k);return await this.isForeignCheckEnabled()&&(A.push(u(!1)),R.push(u(!0)),O=h()),{pre:A,sql:q,check:O,post:R}}}return ow=x,ow}var uw,G$;function fY(){if(G$)return uw;G$=1;const e=ni();return uw=class extends e{withMaterialized(r,s,a){return this._validateWithArgs(r,s,a,"with"),this.withWrapped(r,s,a,!0)}withNotMaterialized(r,s,a){return this._validateWithArgs(r,s,a,"with"),this.withWrapped(r,s,a,!1)}},uw}var lw,K$;function fP(){if(K$)return lw;K$=1;const e=nx(),n=ti(),{promisify:r}=Qe,s=ra(),a=qo(),o=XK(),l=WK(),u=eY(),h=tY(),f=nY(),p=rY(),d=cY(),g=Ah(),y=fY();class C extends s{constructor(v){super(v),v.connection&&v.connection.filename===void 0&&this.logger.warn("Could not find `connection.filename` in config. Please specify the database path and name to avoid errors. (see docs https://knexjs.org/guide/#configuration-options)"),v.useNullAsDefault===void 0&&this.logger.warn("sqlite does not support inserting default values. Set the `useNullAsDefault` flag to hide this warning. (see docs https://knexjs.org/guide/query-builder.html#insert).")}_driver(){return Qe}schemaCompiler(){return new u(this,...arguments)}transaction(){return new o(this,...arguments)}queryCompiler(v,b){return new l(this,v,b)}queryBuilder(){return new y(this)}viewCompiler(v,b){return new p(this,v,b)}columnCompiler(){return new h(this,...arguments)}tableCompiler(){return new f(this,...arguments)}ddl(v,b,w){return new d(this,v,b,w)}wrapIdentifierImpl(v){return v!=="*"?`\`${v.replace(/`/g,"``")}\``:"*"}acquireRawConnection(){return new Promise((v,b)=>{let w=this.driver.OPEN_READWRITE|this.driver.OPEN_CREATE;if(this.connectionSettings.flags){if(!Array.isArray(this.connectionSettings.flags))throw new Error("flags must be an array of strings");this.connectionSettings.flags.forEach(q=>{if(!q.startsWith("OPEN_")||!this.driver[q])throw new Error(`flag ${q} not supported by node-sqlite3`);w=w|this.driver[q]})}const E=new this.driver.Database(this.connectionSettings.filename,w,q=>{if(q)return b(q);v(E)})})}async destroyRawConnection(v){return r(w=>v.close(w))()}_query(v,b){if(!b.sql)throw new Error("The query is empty");const{method:w}=b;let E;switch(w){case"insert":case"update":E=b.returning?"all":"run";break;case"counter":case"del":E="run";break;default:E="all"}return new Promise(function(q,A){if(!v||!v[E])return A(new Error(`Error calling ${E} on connection.`));v[E](b.sql,b.bindings,function(R,O){return R?A(R):(b.response=O,b.context=this,q(b))})})}_stream(v,b,w){if(!b.sql)throw new Error("The query is empty");const E=this;return new Promise(function(q,A){return w.on("error",A),w.on("end",q),E._query(v,b).then(R=>R.response).then(R=>R.forEach(O=>w.write(O))).catch(function(R){w.emit("error",R)}).then(function(){w.end()})})}processResponse(v,b){const w=v.context,{response:E,returning:q}=v;if(v.output)return v.output.call(b,E);switch(v.method){case"select":return E;case"first":return E[0];case"pluck":return n(E,v.pluck);case"insert":return q&&E?E:[w.lastID];case"update":return q&&E?E:w.changes;case"del":case"counter":return w.changes;default:return E}}poolDefaults(){return e({min:1,max:1},super.poolDefaults())}formatter(v){return new g(this,v)}values(v,b,w){return Array.isArray(v)?Array.isArray(v[0])?`( values ${v.map(E=>`(${this.parameterize(E,void 0,b,w)})`).join(", ")})`:`(${this.parameterize(v,void 0,b,w)})`:v instanceof a?`(${this.parameter(v,b,w)})`:this.parameter(v,b,w)}}return Object.assign(C.prototype,{dialect:"sqlite3",driverName:"sqlite3"}),lw=C,lw}var cw,Y$;function hY(){if(Y$)return cw;Y$=1;const e=fP();class n extends e{_driver(){return Qe}async acquireRawConnection(){const s=this.connectionSettings.options||{};return new this.driver(this.connectionSettings.filename,{nativeBinding:s.nativeBinding,readonly:!!s.readonly})}async destroyRawConnection(s){return s.close()}async _query(s,a){if(!a.sql)throw new Error("The query is empty");if(!s)throw new Error("No connection provided");const o=s.prepare(a.sql),l=this._formatBindings(a.bindings);if(o.reader){const h=await o.all(l);return a.response=h,a}const u=await o.run(l);return a.response=u,a.context={lastID:u.lastInsertRowid,changes:u.changes},a}_formatBindings(s){return s?s.map(a=>a instanceof Date?a.valueOf():typeof a=="boolean"?Number(a):a):[]}}return Object.assign(n.prototype,{driverName:"better-sqlite3"}),cw=n,cw}var fw,X$;function hP(){if(X$)return fw;X$=1;const e=Ji();class n extends e{begin(s){const a=[this.isolationLevel?`ISOLATION LEVEL ${this.isolationLevel}`:"",this.readOnly?"READ ONLY":""].join(" ").trim();return a.length===0?this.query(s,"BEGIN;"):this.query(s,`BEGIN TRANSACTION ${a};`)}}return fw=n,fw}var hw,W$;function mx(){if(W$)return hw;W$=1;const e=tn(),n=Js(),r=ta(),{wrapString:s,columnize:a,operator:o,wrap:l}=Vt();class u extends r{constructor(f,p,d){super(f,p,d),this._defaultInsertValue="default"}truncate(){return`truncate ${this.tableName} restart identity`}insert(){let f=super.insert();if(f==="")return f;const{returning:p,onConflict:d,ignore:g,merge:y,insert:C}=this.single;if(d&&g&&(f+=this._ignore(d)),d&&y){f+=this._merge(y.updates,d,C);const x=this.where();x&&(f+=` ${x}`)}return p&&(f+=this._returning(p)),{sql:f,returning:p}}update(){const f=this.with(),p=this._prepUpdate(this.single.update),d=this.where(),{returning:g,updateFrom:y}=this.single;return{sql:f+`update ${this.single.only?"only ":""}${this.tableName} set ${p.join(", ")}`+this._updateFrom(y)+(d?` ${d}`:"")+this._returning(g),returning:g}}using(){const f=this.single.using;if(!f)return;let p="using ";return Array.isArray(f)?p+=f.map(d=>this.formatter.wrap(d)).join(","):p+=this.formatter.wrap(f),p}del(){const{tableName:f}=this,p=this.with();let d=this.where()||"",g=this.using()||"";const y=this.grouped.join,C=[];if(Array.isArray(y)){for(const b of y){C.push(l(this._joinTable(b),void 0,this.builder,this.client,this.bindingsHolder));const w=[];for(const E of b.clauses)w.push(this.whereBasic({column:E.column,operator:"=",value:E.value,asColumn:!0}));w.length>0&&(d+=(d?" and ":"where ")+w.join(" and "))}C.length>0&&(g+=(g?",":"using ")+C.join(","))}const x=p+`delete from ${this.single.only?"only ":""}${f}`+(g?` ${g}`:"")+(d?` ${d}`:""),{returning:v}=this.single;return{sql:x+this._returning(v),returning:v}}aggregate(f){return this._aggregate(f,{distinctParentheses:!0})}_returning(f){return f?` returning ${this.formatter.columnize(f)}`:""}_updateFrom(f){return f?` from ${this.formatter.wrap(f)}`:""}_ignore(f){return f===!0?" on conflict do nothing":` on conflict ${this._onConflictClause(f)} do nothing`}_merge(f,p,d){let g=` on conflict ${this._onConflictClause(p)} do update set `;if(f&&Array.isArray(f))return g+=f.map(y=>s(y.split(".").pop(),this.formatter.builder,this.client,this.formatter)).map(y=>`${y} = excluded.${y}`).join(", "),g;if(f&&typeof f=="object"){const y=this._prepUpdate(f);return typeof y=="string"?g+=y:g+=y.join(","),g}else{const y=this._prepInsert(d);if(typeof y=="string")throw new Error("If using merge with a raw insert query, then updates must be provided");return g+=y.columns.map(C=>s(C.split(".").pop(),this.builder,this.client)).map(C=>`${C} = excluded.${C}`).join(", "),g}}_tableNames(f){const p=this.single.schema,d=[];for(let g=0;g<f.length;g++){let y=f[g];y&&(p&&(y=`${p}.${y}`),d.push(this.formatter.wrap(y)))}return d.join(", ")}_lockingClause(f){const p=this.single.lockTables||[];return f+(p.length?" of "+this._tableNames(p):"")}_groupOrder(f,p){return super._groupOrderNulls(f,p)}forUpdate(){return this._lockingClause("for update")}forShare(){return this._lockingClause("for share")}forNoKeyUpdate(){return this._lockingClause("for no key update")}forKeyShare(){return this._lockingClause("for key share")}skipLocked(){return"skip locked"}noWait(){return"nowait"}columnInfo(){const f=this.single.columnInfo;let p=this.single.schema;const d=this.client.customWrapIdentifier(this.single.table,e);p&&(p=this.client.customWrapIdentifier(p,e));const g="select * from information_schema.columns where table_name = ? and table_catalog = current_database()",y=[d];return this._buildColumnInfoQuery(p,g,y,f)}_buildColumnInfoQuery(f,p,d,g){return f?(p+=" and table_schema = ?",d.push(f)):p+=" and table_schema = current_schema()",{sql:p,bindings:d,output(y){const C=n(y.rows,function(x,v){return x[v.column_name]={type:v.data_type,maxLength:v.character_maximum_length,nullable:v.is_nullable==="YES",defaultValue:v.column_default},x},{});return g&&C[g]||C}}}distinctOn(f){return"distinct on ("+this.formatter.columnize(f)+") "}jsonExtract(f){return this._jsonExtract("jsonb_path_query",f)}jsonSet(f){return this._jsonSet("jsonb_set",Object.assign({},f,{path:this.client.toPathForJson(f.path)}))}jsonInsert(f){return this._jsonSet("jsonb_insert",Object.assign({},f,{path:this.client.toPathForJson(f.path)}))}jsonRemove(f){const p=`${a(f.column,this.builder,this.client,this.bindingsHolder)} #- ${this.client.parameter(this.client.toPathForJson(f.path),this.builder,this.bindingsHolder)}`;return f.alias?this.client.alias(p,this.formatter.wrap(f.alias)):p}whereJsonPath(f){let p="";return!isNaN(f.value)&&parseInt(f.value)?p="::int":!isNaN(f.value)&&parseFloat(f.value)?p="::float":p=" #>> '{}'",`jsonb_path_query_first(${this._columnClause(f)}, ${this.client.parameter(f.jsonPath,this.builder,this.bindingsHolder)})${p} ${o(f.operator,this.builder,this.client,this.bindingsHolder)} ${this._jsonValueClause(f)}`}whereJsonSupersetOf(f){return this._not(f,`${l(f.column,void 0,this.builder,this.client,this.bindingsHolder)} @> ${this._jsonValueClause(f)}`)}whereJsonSubsetOf(f){return this._not(f,`${a(f.column,this.builder,this.client,this.bindingsHolder)} <@ ${this._jsonValueClause(f)}`)}onJsonPathEquals(f){return this._onJsonPathEquals("jsonb_path_query_first",f)}}return hw=u,hw}var dw,J$;function dY(){if(J$)return dw;J$=1;const e=ni();return dw=class extends e{updateFrom(r){return this._single.updateFrom=r,this}using(r){return this._single.using=r,this}withMaterialized(r,s,a){return this._validateWithArgs(r,s,a,"with"),this.withWrapped(r,s,a,!0)}withNotMaterialized(r,s,a){return this._validateWithArgs(r,s,a,"with"),this.withWrapped(r,s,a,!1)}},dw}var pw,Z$;function gx(){if(Z$)return pw;Z$=1;const e=na(),{isObject:n}=mt(),{toNumber:r}=Qt(),s=new RegExp("(?<!')'(?!')","g");class a extends e{constructor(u,h,f){super(u,h,f),this.modifiers=["nullable","defaultTo","comment"],this._addCheckModifiers()}bit(u){return u.length!==!1?`bit(${u.length})`:"bit"}enu(u,h){h=h||{};const f=h.useNative&&h.existingType?void 0:u.join("', '");if(h.useNative){let p="";const d=h.schemaName||this.tableCompiler.schemaNameRaw;return d&&(p+=`"${d}".`),p+=`"${h.enumName}"`,h.existingType||this.tableCompiler.unshiftQuery(`create type ${p} as enum ('${f}')`),p}return`text check (${this.formatter.wrap(this.args[0])} in ('${f}'))`}decimal(u,h){return u===null?"decimal":`decimal(${r(u,8)}, ${r(h,2)})`}json(u){return u&&this.client.logger.deprecate("json(true)","jsonb()"),o(this.client,u)}jsonb(){return o(this.client,!0)}checkRegex(u,h){return this._check(`${this.formatter.wrap(this.getColumnName())} ~ ${this.client._escapeBinding(u)}`,h)}datetime(u=!1,h){let f;return n(u)?{useTz:f,precision:h}=u:f=!u,f=typeof f=="boolean"?f:!0,h=h!=null?"("+h+")":"",`${f?"timestamptz":"timestamp"}${h}`}timestamp(u=!1,h){return this.datetime(u,h)}comment(u){const h=this.args[0]||this.defaults("columnName"),f=u?`'${u.replace(s,"''")}'`:"NULL";this.pushAdditional(function(){this.pushQuery(`comment on column ${this.tableCompiler.tableName()}.`+this.formatter.wrap(h)+` is ${f}`)},u)}increments(u={primaryKey:!0}){return"serial"+(this.tableCompiler._canBeAddPrimaryKey(u)?" primary key":"")}bigincrements(u={primaryKey:!0}){return"bigserial"+(this.tableCompiler._canBeAddPrimaryKey(u)?" primary key":"")}uuid(u={primaryKey:!1}){return"uuid"+(this.tableCompiler._canBeAddPrimaryKey(u)?" primary key":"")}}a.prototype.bigint="bigint",a.prototype.binary="bytea",a.prototype.bool="boolean",a.prototype.double="double precision",a.prototype.floating="real",a.prototype.smallint="smallint",a.prototype.tinyint="smallint";function o(l,u){return!l.version||l.config.client==="cockroachdb"||l.config.jsonbSupport===!0||parseFloat(l.version)>=9.2?u?"jsonb":"json":"text"}return pw=a,pw}var mw,eL;function yx(){if(eL)return mw;eL=1;const e=So(),n=No(),{isObject:r,isString:s}=mt();class a extends n{constructor(l,u){super(l,u)}renameColumn(l,u){return this.pushQuery({sql:`alter table ${this.tableName()} rename ${this.formatter.wrap(l)} to ${this.formatter.wrap(u)}`})}_setNullableState(l,u){const h=u?"drop not null":"set not null",f=`alter table ${this.tableName()} alter column ${this.formatter.wrap(l)} ${h}`;return this.pushQuery({sql:f})}compileAdd(l){const u=this.formatter.wrap(l),h=this.prefixArray("add column",this.getColumns(l));return this.pushQuery({sql:`alter table ${u} ${h.join(", ")}`})}createQuery(l,u,h){const f=u?"create table if not exists ":"create table ",p=` (${l.sql.join(", ")}${this.primaryKeys()||""}${this._addChecks()})`;let d=f+this.tableName()+(h&&this.tableNameLike()?" (like "+this.tableNameLike()+" including all"+(l.sql.length?", "+l.sql.join(", "):"")+")":p);this.single.inherits&&(d+=` inherits (${this.formatter.wrap(this.single.inherits)})`),this.pushQuery({sql:d,bindings:l.bindings}),e(this.single,"comment")&&this.comment(this.single.comment)}primaryKeys(){const l=(this.grouped.alterTable||[]).filter(u=>u.method==="primary");if(l.length>0&&l[0].args.length>0){const u=l[0].args[0];let h=l[0].args[1]||"",f;return r(h)&&({constraintName:h,deferrable:f}=h),f=f?` deferrable initially ${f}`:"",h=h?this.formatter.wrap(h):this.formatter.wrap(`${this.tableNameRaw}_pkey`),`, constraint ${h} primary key (${this.formatter.columnize(u)})${f}`}}addColumns(l,u,h){if(u===this.alterColumnsPrefix)for(const f of h)this._addColumn(f);else super.addColumns(l,u)}_addColumn(l){const u=this.tableName(),h=l.getColumnType(),f=this.client.wrapIdentifier(l.getColumnName(),l.columnBuilder.queryContext()),p=l.type==="enu";this.pushQuery({sql:`alter table ${u} alter column ${f} drop default`,bindings:[]});const d=l.columnBuilder.alterNullable;d&&this.pushQuery({sql:`alter table ${u} alter column ${f} drop not null`,bindings:[]}),l.columnBuilder.alterType&&this.pushQuery({sql:`alter table ${u} alter column ${f} type ${h} using (${f}${p?"::text::":"::"}${h})`,bindings:[]});const y=l.modified.defaultTo;if(y){const C=l.defaultTo.apply(l,y);this.pushQuery({sql:`alter table ${u} alter column ${f} set ${C}`,bindings:[]})}if(d){const C=l.modified.nullable;C&&C[0]===!1&&this.pushQuery({sql:`alter table ${u} alter column ${f} set not null`,bindings:[]})}}comment(l){this.pushQuery(`comment on table ${this.tableName()} is '${this.single.comment}'`)}primary(l,u){let h;r(u)&&({constraintName:u,deferrable:h}=u),h=h?` deferrable initially ${h}`:"",u=u?this.formatter.wrap(u):this.formatter.wrap(`${this.tableNameRaw}_pkey`),this.method!=="create"&&this.method!=="createIfNot"&&this.pushQuery(`alter table ${this.tableName()} add constraint ${u} primary key (${this.formatter.columnize(l)})${h}`)}unique(l,u){let h,f=!0,p;if(r(u)&&({indexName:u,deferrable:h,useConstraint:f,predicate:p}=u,f===void 0&&(f=!!h||!p)),!f&&h&&h!=="not deferrable")throw new Error("postgres cannot create deferrable index");if(f&&p)throw new Error("postgres cannot create constraint with predicate");if(h=h?` deferrable initially ${h}`:"",u=u?this.formatter.wrap(u):this._indexCommand("unique",this.tableNameRaw,l),f)this.pushQuery(`alter table ${this.tableName()} add constraint ${u} unique (`+this.formatter.columnize(l)+")"+h);else{const d=p?" "+this.client.queryCompiler(p).where():"";this.pushQuery(`create unique index ${u} on ${this.tableName()} (${this.formatter.columnize(l)})${d}`)}}index(l,u,h){u=u?this.formatter.wrap(u):this._indexCommand("index",this.tableNameRaw,l);let f,p,d;s(h)?p=h:r(h)&&({indexType:d,storageEngineIndexType:p,predicate:f}=h);const g=f?" "+this.client.queryCompiler(f).where():"";this.pushQuery(`create${typeof d=="string"&&d.toLowerCase()==="unique"?" unique":""} index ${u} on ${this.tableName()}${p&&` using ${p}`||""} (`+this.formatter.columnize(l)+`)${g}`)}dropPrimary(l){l=l?this.formatter.wrap(l):this.formatter.wrap(this.tableNameRaw+"_pkey"),this.pushQuery(`alter table ${this.tableName()} drop constraint ${l}`)}dropIndex(l,u){u=u?this.formatter.wrap(u):this._indexCommand("index",this.tableNameRaw,l),u=this.schemaNameRaw?`${this.formatter.wrap(this.schemaNameRaw)}.${u}`:u,this.pushQuery(`drop index ${u}`)}dropUnique(l,u){u=u?this.formatter.wrap(u):this._indexCommand("unique",this.tableNameRaw,l),this.pushQuery(`alter table ${this.tableName()} drop constraint ${u}`)}dropForeign(l,u){u=u?this.formatter.wrap(u):this._indexCommand("foreign",this.tableNameRaw,l),this.pushQuery(`alter table ${this.tableName()} drop constraint ${u}`)}}return mw=a,mw}var gw,tL;function vx(){if(tL)return gw;tL=1;const e=Ro();class n extends e{constructor(s,a){super(s,a)}renameColumn(s,a){return this.pushQuery({sql:`alter view ${this.viewName()} rename ${this.formatter.wrap(s)} to ${this.formatter.wrap(a)}`})}defaultTo(s,a){return this.pushQuery({sql:`alter view ${this.viewName()} alter ${this.formatter.wrap(s)} set default ${a}`})}createOrReplace(){this.createQuery(this.columns,this.selectQuery,!1,!0)}createMaterializedView(){this.createQuery(this.columns,this.selectQuery,!0)}}return gw=n,gw}var yw,nL;function pY(){if(nL)return yw;nL=1;const e=Tl();class n extends e{constructor(){super(...arguments)}checkOption(){this._single.checkOption="default_option"}localCheckOption(){this._single.checkOption="local"}cascadedCheckOption(){this._single.checkOption="cascaded"}}return yw=n,yw}var vw,rL;function dP(){if(rL)return vw;rL=1;const e=Ao();class n extends e{constructor(s,a){super(s,a)}hasTable(s){let a="select * from information_schema.tables where table_name = ?";const o=[s];this.schema?(a+=" and table_schema = ?",o.push(this.schema)):a+=" and table_schema = current_schema()",this.pushQuery({sql:a,bindings:o,output(l){return l.rows.length>0}})}hasColumn(s,a){let o="select * from information_schema.columns where table_name = ? and column_name = ?";const l=[s,a];this.schema?(o+=" and table_schema = ?",l.push(this.schema)):o+=" and table_schema = current_schema()",this.pushQuery({sql:o,bindings:l,output(u){return u.rows.length>0}})}qualifiedTableName(s){const a=this.schema?`${this.schema}.${s}`:s;return this.formatter.wrap(a)}renameTable(s,a){this.pushQuery(`alter table ${this.qualifiedTableName(s)} rename to ${this.formatter.wrap(a)}`)}createSchema(s){this.pushQuery(`create schema ${this.formatter.wrap(s)}`)}createSchemaIfNotExists(s){this.pushQuery(`create schema if not exists ${this.formatter.wrap(s)}`)}dropSchema(s,a=!1){this.pushQuery(`drop schema ${this.formatter.wrap(s)}${a?" cascade":""}`)}dropSchemaIfExists(s,a=!1){this.pushQuery(`drop schema if exists ${this.formatter.wrap(s)}${a?" cascade":""}`)}dropExtension(s){this.pushQuery(`drop extension ${this.formatter.wrap(s)}`)}dropExtensionIfExists(s){this.pushQuery(`drop extension if exists ${this.formatter.wrap(s)}`)}createExtension(s){this.pushQuery(`create extension ${this.formatter.wrap(s)}`)}createExtensionIfNotExists(s){this.pushQuery(`create extension if not exists ${this.formatter.wrap(s)}`)}renameView(s,a){this.pushQuery(this.alterViewPrefix+`${this.formatter.wrap(s)} rename to ${this.formatter.wrap(a)}`)}refreshMaterializedView(s,a=!1){this.pushQuery({sql:`refresh materialized view${a?" concurrently":""} ${this.formatter.wrap(s)}`})}dropMaterializedView(s){this._dropView(s,!1,!0)}dropMaterializedViewIfExists(s){this._dropView(s,!0,!0)}}return vw=n,vw}var bw,iL;function Nh(){if(iL)return bw;iL=1;const e=Th(),n=ti(),{promisify:r}=Qe,s=ra(),a=hP(),o=mx(),l=dY(),u=gx(),h=yx(),f=vx(),p=pY(),d=dP(),{makeEscape:g}=ux(),{isString:y}=mt();class C extends s{constructor(b){super(b),b.returning&&(this.defaultReturning=b.returning),b.searchPath&&(this.searchPath=b.searchPath)}transaction(){return new a(this,...arguments)}queryBuilder(){return new l(this)}queryCompiler(b,w){return new o(this,b,w)}columnCompiler(){return new u(this,...arguments)}schemaCompiler(){return new d(this,...arguments)}tableCompiler(){return new h(this,...arguments)}viewCompiler(){return new f(this,...arguments)}viewBuilder(){return new p(this,...arguments)}_driver(){return Qe}wrapIdentifierImpl(b){if(b==="*")return b;let w="";const E=b.match(/(.*?)(\[[0-9]+\])/);return E&&(b=E[1],w=E[2]),`"${b.replace(/"/g,'""')}"${w}`}_acquireOnlyConnection(){const b=new this.driver.Client(this.connectionSettings);return b.on("error",w=>{b.__knex__disposed=w}),b.on("end",w=>{b.__knex__disposed=w||"Connection ended unexpectedly"}),b.connect().then(()=>b)}acquireRawConnection(){const b=this;return this._acquireOnlyConnection().then(function(w){return b.version?w:b.checkVersion(w).then(function(E){return b.version=E,w})}).then(async function(E){return await b.setSchemaSearchPath(E),E})}async destroyRawConnection(b){return r(E=>b.end(E))()}checkVersion(b){return new Promise((w,E)=>{b.query("select version();",(q,A)=>{if(q)return E(q);w(this._parseVersion(A.rows[0].version))})})}_parseVersion(b){return/^PostgreSQL (.*?)( |$)/.exec(b)[1]}positionBindings(b){let w=0;return b.replace(/(\\*)(\?)/g,function(E,q){return q.length%2?"?":(w++,`$${w}`)})}setSchemaSearchPath(b,w){let E=w||this.searchPath;if(!E)return Promise.resolve(!0);if(!Array.isArray(E)&&!y(E))throw new TypeError(`knex: Expected searchPath to be Array/String, got: ${typeof E}`);if(y(E)){if(E.includes(",")){const A=`[${E.split(",").map(R=>`'${R}'`).join(", ")}]`;this.logger.warn(`Detected comma in searchPath "${E}".If you are trying to specify multiple schemas, use Array syntax: ${A}`)}E=[E]}return E=E.map(q=>`"${q}"`).join(","),new Promise(function(q,A){b.query(`set search_path to ${E}`,function(R){if(R)return A(R);q(!0)})})}_stream(b,w,E,q){if(!w.sql)throw new Error("The query is empty");const A=process.browser?void 0:Qe,R=w.sql;return new Promise(function(O,I){const k=b.query(new A(R,w.bindings,q),N=>{I(N)});k.on("error",function(N){I(N),E.emit("error",N)}),E.on("end",O),k.pipe(E)})}_query(b,w){if(!w.sql)throw new Error("The query is empty");let E={text:w.sql,values:w.bindings||[]};return w.options&&(E=e(E,w.options)),new Promise(function(q,A){b.query(E,function(R,O){if(R)return A(R);w.response=O,q(w)})})}processResponse(b,w){const E=b.response;if(b.output)return b.output.call(w,E);if(b.method==="raw")return E;const{returning:q}=b;if(E.command==="SELECT")return b.method==="first"?E.rows[0]:b.method==="pluck"?n(E.rows,b.pluck):E.rows;if(q){const A=[];for(let R=0,O=E.rows.length;R<O;R++){const I=E.rows[R];A[R]=I}return A}return E.command==="UPDATE"||E.command==="DELETE"?E.rowCount:E}async cancelQuery(b){const w=await this.acquireRawConnection();try{return await this._wrappedCancelQueryCall(w,b)}finally{await this.destroyRawConnection(w).catch(E=>{this.logger.warn(`Connection Error: ${E}`)})}}_wrappedCancelQueryCall(b,w){return this._query(b,{sql:"SELECT pg_cancel_backend($1);",bindings:[w.processID],options:{}})}toPathForJson(b){const w=/^{.*}$/;return b.match(w)?b:"{"+b.replace(/^(\$\.)/,"").replace(".",",").replace(/\[([0-9]+)]/,",$1")+"}"}}Object.assign(C.prototype,{dialect:"postgresql",driverName:"pg",canCancelQuery:!0,_escapeBinding:g({escapeArray(v,b){return b(x(v,b))},escapeString(v){let b=!1,w="'";for(let E=0;E<v.length;E++){const q=v[E];q==="'"?w+=q+q:q==="\\"?(w+=q+q,b=!0):w+=q}return w+="'",b===!0&&(w="E"+w),w},escapeObject(v,b,w,E=[]){if(v&&typeof v.toPostgres=="function"){if(E=E||[],E.indexOf(v)!==-1)throw new Error(`circular reference detected while preparing "${v}" for query`);return E.push(v),b(v.toPostgres(b),E)}return JSON.stringify(v)}})});function x(v,b){let w="{";for(let E=0;E<v.length;E++){E>0&&(w+=",");const q=v[E];q===null||typeof q>"u"?w+="NULL":Array.isArray(q)?w+=x(q,b):typeof q=="number"?w+=q:w+=JSON.stringify(typeof q=="string"?q:b(q))}return w+"}"}return bw=C,bw}var _w,sL;function mY(){if(sL)return _w;sL=1;const e=mx(),{columnize:n,wrap:r,operator:s}=Vt();class a extends e{truncate(){return`truncate ${this.tableName}`}upsert(){let l=this._upsert();if(l==="")return l;const{returning:u}=this.single;return u&&(l+=this._returning(u)),{sql:l,returning:u}}_upsert(){const l=this.single.upsert||[],u=this.with()+`upsert into ${this.tableName} `,h=this._insertBody(l);return h===""?"":u+h}_groupOrder(l,u){return this._basicGroupOrder(l,u)}whereJsonPath(l){let u="";return!isNaN(l.value)&&parseInt(l.value)?u="::int":!isNaN(l.value)&&parseFloat(l.value)?u="::float":u=" #>> '{}'",`json_extract_path(${this._columnClause(l)}, ${this.client.toArrayPathFromJsonPath(l.jsonPath,this.builder,this.bindingsHolder)})${u} ${s(l.operator,this.builder,this.client,this.bindingsHolder)} ${this._jsonValueClause(l)}`}_jsonExtract(l,u){let h;return Array.isArray(u.column)?h=u.column:h=[u],h.map(f=>{const p=`json_extract_path(${n(f.column||f[0],this.builder,this.client,this.bindingsHolder)}, ${this.client.toArrayPathFromJsonPath(f.path||f[1],this.builder,this.bindingsHolder)})`,d=f.alias||f[2];return d?this.client.alias(p,this.formatter.wrap(d)):p}).join(", ")}_onJsonPathEquals(l,u){return"json_extract_path("+r(u.columnFirst,void 0,this.builder,this.client,this.bindingsHolder)+", "+this.client.toArrayPathFromJsonPath(u.jsonPathFirst,this.builder,this.bindingsHolder)+") = json_extract_path("+r(u.columnSecond,void 0,this.builder,this.client,this.bindingsHolder)+", "+this.client.toArrayPathFromJsonPath(u.jsonPathSecond,this.builder,this.bindingsHolder)+")"}}return _w=a,_w}var ww,aL;function gY(){if(aL)return ww;aL=1;const e=gx();class n extends e{uuid(s={primaryKey:!1}){return"uuid"+(this.tableCompiler._canBeAddPrimaryKey(s)?" primary key default gen_random_uuid()":"")}}return ww=n,ww}var Cw,oL;function yY(){if(oL)return Cw;oL=1;const e=yx();class n extends e{constructor(s,a){super(s,a)}addColumns(s,a,o){if(a===this.alterColumnsPrefix)for(const l of o)this.client.logger.warn("Experimental alter column in use, see issue: https://github.com/cockroachdb/cockroach/issues/49329"),this.pushQuery({sql:"SET enable_experimental_alter_column_type_general = true",bindings:[]}),super._addColumn(l);else super.addColumns(s,a)}dropUnique(s,a){a=a?this.formatter.wrap(a):this._indexCommand("unique",this.tableNameRaw,s),this.pushQuery(`drop index ${this.tableName()}@${a} cascade `)}}return Cw=n,Cw}var Ew,uL;function vY(){if(uL)return Ew;uL=1;const e=vx();class n extends e{renameColumn(s,a){throw new Error("rename column of views is not supported by this dialect.")}defaultTo(s,a){throw new Error("change default values of views is not supported by this dialect.")}}return Ew=n,Ew}var xw,lL;function bY(){if(lL)return xw;lL=1;const e=ni(),n=qn();return xw=class extends e{upsert(s,a,o){return this._method="upsert",n(a)||this.returning(a,o),this._single.upsert=s,this}},xw}var Sw,cL;function _Y(){if(cL)return Sw;cL=1;const e=Nh(),n=hP(),r=mY(),s=gY(),a=yY(),o=vY(),l=bY();class u extends e{transaction(){return new n(this,...arguments)}queryCompiler(f,p){return new r(this,f,p)}columnCompiler(){return new s(this,...arguments)}tableCompiler(){return new a(this,...arguments)}viewCompiler(){return new o(this,...arguments)}queryBuilder(){return new l(this)}_parseVersion(f){return f.split(" ")[2]}async cancelQuery(f){try{return await this._wrappedCancelQueryCall(null,f)}catch(p){throw this.logger.warn(`Connection Error: ${p}`),p}}_wrappedCancelQueryCall(f,p){if(!(p.activeQuery.processID===0&&p.activeQuery.secretKey===0))return p.cancel(p,p.activeQuery)}toArrayPathFromJsonPath(f,p,d){return f.replace(/^(\$\.)/,"").replace(/\[([0-9]+)]/,".$1").split(".").map((function(g){return this.parameter(g,p,d)}).bind(this)).join(", ")}}return Object.assign(u.prototype,{driverName:"cockroachdb"}),Sw=u,Sw}var Tw,fL;function wY(){if(fL)return Tw;fL=1;function e(n){return n==null}return Tw=e,Tw}var qw,hL;function CY(){if(hL)return qw;hL=1;const e=Ah();class n extends e{columnizeWithPrefix(s,a){const o=typeof a=="string"?[a]:a;let l="",u=-1;for(;++u<o.length;)u>0&&(l+=", "),l+=s+this.wrap(o[u]);return l}escapingStringDelimiters(s){return(s||"").replace(/'/g,"''")}}return qw=n,qw}var Aw,dL;function EY(){if(dL)return Aw;dL=1;const e=Ji(),n=tr()("knex:tx");class r extends e{begin(u){return n("transaction::begin id=%s",this.txid),new Promise((h,f)=>{u.beginTransaction(p=>{if(p)return n("transaction::begin error id=%s message=%s",this.txid,p.message),f(p);h()},this.outerTx?this.txid:void 0,s(this.isolationLevel))}).then(this._resolver,this._rejecter)}savepoint(u){return n("transaction::savepoint id=%s",this.txid),new Promise((h,f)=>{u.saveTransaction(p=>{if(p)return n("transaction::savepoint id=%s message=%s",this.txid,p.message),f(p);this.trxClient.emit("query",{__knexUid:this.trxClient.__knexUid,__knexTxId:this.trxClient.__knexTxId,autogenerated:!0,sql:this.outerTx?`SAVE TRANSACTION [${this.txid}]`:"SAVE TRANSACTION"}),h()},this.outerTx?this.txid:void 0)})}commit(u,h){return n("transaction::commit id=%s",this.txid),new Promise((f,p)=>{u.commitTransaction(d=>{if(d)return n("transaction::commit error id=%s message=%s",this.txid,d.message),p(d);this._completed=!0,f(h)},this.outerTx?this.txid:void 0)}).then(()=>this._resolver(h),this._rejecter)}release(u,h){return this._resolver(h)}rollback(u,h){return this._completed=!0,n("transaction::rollback id=%s",this.txid),new Promise((f,p)=>{if(!u.inTransaction)return p(h||new Error("Transaction rejected with non-error: undefined"));if(u.state.name!=="LoggedIn")return p(new Error("Can't rollback transaction. There is a request in progress"));u.rollbackTransaction(d=>{d&&n("transaction::rollback error id=%s message=%s",this.txid,d.message),p(d||h||new Error("Transaction rejected with non-error: undefined"))},this.outerTx?this.txid:void 0)}).catch(f=>{if(!h&&this.doNotRejectOnRollback){this._resolver();return}if(h)try{f.originalError=h}catch{}this._rejecter(f)})}rollbackTo(u,h){return this.rollback(u,h).then(()=>void this.trxClient.emit("query",{__knexUid:this.trxClient.__knexUid,__knexTxId:this.trxClient.__knexTxId,autogenerated:!0,sql:"ROLLBACK TRANSACTION"}))}}Aw=r;function s(l){if(!l)return;l=l.toUpperCase().replace(" ","_");const u=a[l];if(!u)throw new Error(`Unknown Isolation level, was expecting one of: ${JSON.stringify(o)}`);return u}const a={READ_UNCOMMITTED:1,READ_COMMITTED:2,REPEATABLE_READ:3,SERIALIZABLE:4,SNAPSHOT:5},o=Object.keys(a).map(l=>l.toLowerCase().replace("_"," "));return Aw}var Nw,pL;function xY(){if(pL)return Nw;pL=1;const e=ta(),n=px(),r=tn(),s=qn(),a=qo(),{columnize:o}=Vt(),l=["comments","columns","join","lock","where","union","group","having","order","limit","offset"];class u extends e{constructor(f,p,d){super(f,p,d);const{onConflict:g}=this.single;if(g)throw new Error(".onConflict() is not supported for mssql.");this._emptyInsertValue="default values"}with(){const f=[];if(this.grouped.with)for(const d of this.grouped.with)d.recursive&&(f.push(d),d.recursive=!1);const p=super.with();for(const d of f)d.recursive=!0;return p}select(){const f=this.with(),p=l.map(d=>this[d](this));return f+n(p).join(" ")}insert(){return this.single.options&&this.single.options.includeTriggerModifications?this.insertWithTriggers():this.standardInsert()}insertWithTriggers(){const f=this.single.insert||[],{returning:p}=this.single;let d=this.with()+`${this._buildTempTable(p)}insert into ${this.tableName} `;const g=p?this._returning("insert",p,!0)+" ":"";if(Array.isArray(f)){if(f.length===0)return""}else if(typeof f=="object"&&s(f))return{sql:d+g+this._emptyInsertValue+this._buildReturningSelect(p),returning:p};return d+=this._buildInsertData(f,g),p&&(d+=this._buildReturningSelect(p)),{sql:d,returning:p}}_buildInsertData(f,p){let d="";const g=this._prepInsert(f);if(typeof g=="string")d+=g;else if(g.columns.length)d+=`(${this.formatter.columnize(g.columns)}`,d+=`) ${p}values (`+this._buildInsertValues(g)+")";else if(f.length===1&&f[0])d+=p+this._emptyInsertValue;else return"";return d}standardInsert(){const f=this.single.insert||[];let p=this.with()+`insert into ${this.tableName} `;const{returning:d}=this.single,g=d?this._returning("insert",d)+" ":"";if(Array.isArray(f)){if(f.length===0)return""}else if(typeof f=="object"&&s(f))return{sql:p+g+this._emptyInsertValue,returning:d};return p+=this._buildInsertData(f,g),{sql:p,returning:d}}update(){return this.single.options&&this.single.options.includeTriggerModifications?this.updateWithTriggers():this.standardUpdate()}updateWithTriggers(){const f=this.top(),p=this.with(),d=this._prepUpdate(this.single.update),g=this.join(),y=this.where(),C=this.order(),{returning:x}=this.single,v=this._buildTempTable(x);return{sql:p+v+`update ${f?f+" ":""}${this.tableName} set `+d.join(", ")+(x?` ${this._returning("update",x,!0)}`:"")+(g?` from ${this.tableName} ${g}`:"")+(y?` ${y}`:"")+(C?` ${C}`:"")+(x?this._buildReturningSelect(x):this._returning("rowcount","@@rowcount")),returning:x||"@@rowcount"}}_formatGroupsItemValue(f,p){const d=super._formatGroupsItemValue(f);if(p&&!(f instanceof a)){const g=`IIF(${d} is null,`;if(p==="first")return`${g}0,1)`;if(p==="last")return`${g}1,0)`}return d}standardUpdate(){const f=this.top(),p=this.with(),d=this._prepUpdate(this.single.update),g=this.join(),y=this.where(),C=this.order(),{returning:x}=this.single;return{sql:p+`update ${f?f+" ":""}${this.tableName} set `+d.join(", ")+(x?` ${this._returning("update",x)}`:"")+(g?` from ${this.tableName} ${g}`:"")+(y?` ${y}`:"")+(C?` ${C}`:"")+(x?"":this._returning("rowcount","@@rowcount")),returning:x||"@@rowcount"}}del(){return this.single.options&&this.single.options.includeTriggerModifications?this.deleteWithTriggers():this.standardDelete()}deleteWithTriggers(){const f=this.with(),{tableName:p}=this,d=this.where(),g=this.join(),{returning:y}=this.single,C=y?` ${this._returning("del",y,!0)}`:"",x=g?`${p}${C} `:"";return{sql:f+`${this._buildTempTable(y)}delete ${x}from ${p}`+(g?"":C)+(g?` ${g}`:"")+(d?` ${d}`:"")+(y?this._buildReturningSelect(y):this._returning("rowcount","@@rowcount")),returning:y||"@@rowcount"}}standardDelete(){const f=this.with(),{tableName:p}=this,d=this.where(),g=this.join(),{returning:y}=this.single,C=y?` ${this._returning("del",y)}`:"",x=g?`${p}${C} `:"";return{sql:f+`delete ${x}from ${p}`+(g?"":C)+(g?` ${g}`:"")+(d?` ${d}`:"")+(y?"":this._returning("rowcount","@@rowcount")),returning:y||"@@rowcount"}}columns(){let f="";if(this.onlyUnions())return"";const p=this.top(),d=this._hintComments(),g=this.grouped.columns||[];let y=-1,C=[];if(g)for(;++y<g.length;){const v=g[y];if(v.distinct&&(f="distinct "),v.distinctOn){f=this.distinctOn(v.value);continue}v.type==="aggregate"?C.push(...this.aggregate(v)):v.type==="aggregateRaw"?C.push(this.aggregateRaw(v)):v.type==="analytic"?C.push(this.analytic(v)):v.type==="json"?C.push(this.json(v)):v.value&&v.value.length>0&&C.push(this.formatter.columnize(v.value))}return C.length===0&&(C=["*"]),`${this.onlyJson()?"":"select "}${d}${f}`+(p?p+" ":"")+C.join(", ")+(this.tableName?` from ${this.tableName}`:"")}_returning(f,p,d){switch(f){case"update":case"insert":return p?`output ${this.formatter.columnizeWithPrefix("inserted.",p)}${d?" into #out":""}`:"";case"del":return p?`output ${this.formatter.columnizeWithPrefix("deleted.",p)}${d?" into #out":""}`:"";case"rowcount":return p?";select @@rowcount":""}}_buildTempTable(f){if(f&&f.length>0){let p="";Array.isArray(f)?p=f.map(g=>`[t].${this.formatter.columnize(g)}`).join(","):p=`[t].${this.formatter.columnize(f)}`;let d=`select top(0) ${p} into #out `;return d+=`from ${this.tableName} as t `,d+=`left join ${this.tableName} on 0=1;`,d}return""}_buildReturningSelect(f){if(f&&f.length>0){let p="";Array.isArray(f)?p=f.map(g=>`${this.formatter.columnize(g)}`).join(","):p=this.formatter.columnize(f);let d=`; select ${p} from #out; `;return d+="drop table #out;",d}return""}truncate(){return`truncate table ${this.tableName}`}forUpdate(){return"with (UPDLOCK)"}forShare(){return"with (HOLDLOCK)"}columnInfo(){const f=this.single.columnInfo;let p=this.single.schema;const d=this.client.customWrapIdentifier(this.single.table,r);p&&(p=this.client.customWrapIdentifier(p,r));let g="select [COLUMN_NAME], [COLUMN_DEFAULT], [DATA_TYPE], [CHARACTER_MAXIMUM_LENGTH], [IS_NULLABLE] from INFORMATION_SCHEMA.COLUMNS where table_name = ? and table_catalog = ?";const y=[d,this.client.database()];return p?(g+=" and table_schema = ?",y.push(p)):g+=" and table_schema = 'dbo'",{sql:g,bindings:y,output(C){const x=C.reduce((v,b)=>(v[b[0].value]={defaultValue:b[1].value,type:b[2].value,maxLength:b[3].value,nullable:b[4].value==="YES"},v),{});return f&&x[f]||x}}}top(){const f=!this.single.limit&&this.single.limit!==0,p=!this.single.offset;return f||!p?"":`top (${this._getValueOrParameterFromAttribute("limit")})`}limit(){return""}offset(){const f=!this.single.limit&&this.single.limit!==0,p=!this.single.offset;if(p)return"";let d=`offset ${p?"0":this._getValueOrParameterFromAttribute("offset")} rows`;return f||(d+=` fetch next ${this._getValueOrParameterFromAttribute("limit")} rows only`),d}whereLike(f){return`${this._columnClause(f)} collate SQL_Latin1_General_CP1_CS_AS ${this._not(f,"like ")}${this._valueClause(f)}`}whereILike(f){return`${this._columnClause(f)} collate SQL_Latin1_General_CP1_CI_AS ${this._not(f,"like ")}${this._valueClause(f)}`}jsonExtract(f){return this._jsonExtract(f.singleValue?"JSON_VALUE":"JSON_QUERY",f)}jsonSet(f){return this._jsonSet("JSON_MODIFY",f)}jsonInsert(f){return this._jsonSet("JSON_MODIFY",f)}jsonRemove(f){const p=`JSON_MODIFY(${o(f.column,this.builder,this.client,this.bindingsHolder)},${this.client.parameter(f.path,this.builder,this.bindingsHolder)}, NULL)`;return f.alias?this.client.alias(p,this.formatter.wrap(f.alias)):p}whereJsonPath(f){return this._whereJsonPath("JSON_VALUE",f)}whereJsonSupersetOf(f){throw new Error("Json superset where clause not actually supported by MSSQL")}whereJsonSubsetOf(f){throw new Error("Json subset where clause not actually supported by MSSQL")}_getExtracts(f,p){const d=o(f.column,this.builder,this.client,this.bindingsHolder);return(Array.isArray(f.values)?f.values:[f.values]).map(function(g){return"JSON_VALUE("+d+","+this.client.parameter(g,this.builder,this.bindingsHolder)+")"},this).join(p)}onJsonPathEquals(f){return this._onJsonPathEquals("JSON_VALUE",f)}}return Nw=u,Nw}var Rw,mL;function SY(){if(mL)return Rw;mL=1;const e=Ao();class n extends e{constructor(a,o){super(a,o)}dropTableIfExists(a){const o=this.formatter.wrap(r(this.schema,a));this.pushQuery(`if object_id('${o}', 'U') is not null DROP TABLE ${o}`)}dropViewIfExists(a){const o=this.formatter.wrap(r(this.schema,a));this.pushQuery(`if object_id('${o}', 'V') is not null DROP VIEW ${o}`)}renameTable(a,o){this.pushQuery(`exec sp_rename ${this.client.parameter(r(this.schema,a),this.builder,this.bindingsHolder)}, ${this.client.parameter(o,this.builder,this.bindingsHolder)}`)}renameView(a,o){this.pushQuery(`exec sp_rename ${this.client.parameter(r(this.schema,a),this.builder,this.bindingsHolder)}, ${this.client.parameter(o,this.builder,this.bindingsHolder)}`)}hasTable(a){const o=this.client.parameter(r(this.schema,a),this.builder,this.bindingsHolder),l=[a];let u=`SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = ${o}`;this.schema&&(u+=" AND TABLE_SCHEMA = ?",l.push(this.schema)),this.pushQuery({sql:u,bindings:l,output:h=>h.length>0})}hasColumn(a,o){const l=this.client.parameter(o,this.builder,this.bindingsHolder),u=this.client.parameter(this.formatter.wrap(r(this.schema,a)),this.builder,this.bindingsHolder),h=`select object_id from sys.columns where name = ${l} and object_id = object_id(${u})`;this.pushQuery({sql:h,output:f=>f.length>0})}}n.prototype.dropTablePrefix="DROP TABLE ";function r(s,a){return s?`${s}.${a}`:a}return Rw=n,Rw}var Ow,gL;function TY(){if(gL)return Ow;gL=1;const e=No(),n=Qt(),{isObject:r}=mt();class s extends e{constructor(o,l){super(o,l)}createQuery(o,l,u){let h=l?`if object_id('${this.tableName()}', 'U') is null `:"";u?h+=`SELECT * INTO ${this.tableName()} FROM ${this.tableNameLike()} WHERE 0=1`:h+="CREATE TABLE "+this.tableName()+(this._formatting?` (
84
+ `:" (")+o.sql.join(this._formatting?`,
85
+ `:", ")+this._addChecks()+")",this.pushQuery(h),this.single.comment&&this.comment(this.single.comment),u&&this.addColumns(o,this.addColumnsPrefix)}comment(o){if(!o)return;o.length>7500/2&&this.client.logger.warn("Your comment might be longer than the max comment length for MSSQL of 7,500 bytes.");const l=this.formatter.escapingStringDelimiters(o),u=this.formatter.escapingStringDelimiters(this.schemaNameRaw||"dbo"),h=this.formatter.escapingStringDelimiters(this.tableNameRaw),f=`N'MS_Description', N'${l}', N'Schema', N'${u}', N'Table', N'${h}'`,p=`EXISTS(SELECT * FROM sys.fn_listextendedproperty(N'MS_Description', N'Schema', N'${u}', N'Table', N'${h}', NULL, NULL))`;this.pushQuery(`IF ${p}
86
+ EXEC sys.sp_updateextendedproperty ${f}
87
+ ELSE
88
+ EXEC sys.sp_addextendedproperty ${f}`)}addColumns(o,l){l=l||this.addColumnsPrefix,o.sql.length>0&&this.pushQuery({sql:(this.lowerCase?"alter table ":"ALTER TABLE ")+this.tableName()+" "+l+o.sql.join(", "),bindings:o.bindings})}alterColumns(o,l){for(let u=0,h=l.length;u<h;u++){const f=l[u];if(f.modified.defaultTo){const d=`
89
+ DECLARE @constraint varchar(100) = (SELECT default_constraints.name
90
+ FROM sys.all_columns
91
+ INNER JOIN sys.tables
92
+ ON all_columns.object_id = tables.object_id
93
+ INNER JOIN sys.schemas
94
+ ON tables.schema_id = schemas.schema_id
95
+ INNER JOIN sys.default_constraints
96
+ ON all_columns.default_object_id = default_constraints.object_id
97
+ WHERE schemas.name = '${this.schemaNameRaw||"dbo"}'
98
+ AND tables.name = '${this.tableNameRaw}'
99
+ AND all_columns.name = '${f.getColumnName()}')
100
+
101
+ IF @constraint IS NOT NULL EXEC('ALTER TABLE ${this.tableNameRaw} DROP CONSTRAINT ' + @constraint)`;this.pushQuery(d)}}o.sql.forEach(u=>{this.pushQuery({sql:(this.lowerCase?"alter table ":"ALTER TABLE ")+this.tableName()+" "+(this.lowerCase?this.alterColumnPrefix.toLowerCase():this.alterColumnPrefix)+u,bindings:o.bindings})})}dropColumn(){const o=this,l=n.normalizeArr.apply(null,arguments),h=(Array.isArray(l)?l:[l]).map(p=>o.formatter.wrap(p)),f=this.schemaNameRaw||"dbo";for(const p of l){const d=`
102
+ DECLARE @constraint varchar(100) = (SELECT default_constraints.name
103
+ FROM sys.all_columns
104
+ INNER JOIN sys.tables
105
+ ON all_columns.object_id = tables.object_id
106
+ INNER JOIN sys.schemas
107
+ ON tables.schema_id = schemas.schema_id
108
+ INNER JOIN sys.default_constraints
109
+ ON all_columns.default_object_id = default_constraints.object_id
110
+ WHERE schemas.name = '${f}'
111
+ AND tables.name = '${this.tableNameRaw}'
112
+ AND all_columns.name = '${p}')
113
+
114
+ IF @constraint IS NOT NULL EXEC('ALTER TABLE ${this.tableNameRaw} DROP CONSTRAINT ' + @constraint)`;this.pushQuery(d)}this.pushQuery((this.lowerCase?"alter table ":"ALTER TABLE ")+this.tableName()+" "+this.dropColumnPrefix+h.join(", "))}changeType(){}renameColumn(o,l){this.pushQuery(`exec sp_rename ${this.client.parameter(this.tableName()+"."+o,this.tableBuilder,this.bindingsHolder)}, ${this.client.parameter(l,this.tableBuilder,this.bindingsHolder)}, 'COLUMN'`)}dropFKRefs(o,l){const u=this.client.formatter(this.tableBuilder);return Promise.all(l.map(function(h){const f=u.wrap(h.CONSTRAINT_NAME),p=u.wrap(h.TABLE_NAME);return o.query({sql:`ALTER TABLE ${p} DROP CONSTRAINT ${f}`})}))}createFKRefs(o,l){const u=this.client.formatter(this.tableBuilder);return Promise.all(l.map(function(h){const f=u.wrap(h.TABLE_NAME),p=u.wrap(h.CONSTRAINT_NAME),d=u.columnize(h.COLUMN_NAME),g=u.columnize(h.REFERENCED_COLUMN_NAME),y=u.wrap(h.REFERENCED_TABLE_NAME),C=` ON UPDATE ${h.UPDATE_RULE}`,x=` ON DELETE ${h.DELETE_RULE}`;return o.query({sql:`ALTER TABLE ${f} ADD CONSTRAINT ${p} FOREIGN KEY (`+d+") REFERENCES "+y+" ("+g+")"+C+x})}))}index(o,l,u){l=l?this.formatter.wrap(l):this._indexCommand("index",this.tableNameRaw,o);let h;r(u)&&({predicate:h}=u);const f=h?" "+this.client.queryCompiler(h).where():"";this.pushQuery(`CREATE INDEX ${l} ON ${this.tableName()} (${this.formatter.columnize(o)})${f}`)}primary(o,l){let u;r(l)&&({constraintName:l,deferrable:u}=l),u&&u!=="not deferrable"&&this.client.logger.warn(`mssql: primary key constraint [${l}] will not be deferrable ${u} because mssql does not support deferred constraints.`),l=l?this.formatter.wrap(l):this.formatter.wrap(`${this.tableNameRaw}_pkey`),this.forCreate?this.pushQuery(`CONSTRAINT ${l} PRIMARY KEY (${this.formatter.columnize(o)})`):this.pushQuery(`ALTER TABLE ${this.tableName()} ADD CONSTRAINT ${l} PRIMARY KEY (${this.formatter.columnize(o)})`)}unique(o,l){let u,h=!1,f;if(r(l)&&({indexName:l,deferrable:u,useConstraint:h,predicate:f}=l),u&&u!=="not deferrable"&&this.client.logger.warn(`mssql: unique index [${l}] will not be deferrable ${u} because mssql does not support deferred constraints.`),h&&f)throw new Error("mssql cannot create constraint with predicate");if(l=l?this.formatter.wrap(l):this._indexCommand("unique",this.tableNameRaw,o),Array.isArray(o)||(o=[o]),h)this.pushQuery(`ALTER TABLE ${this.tableName()} ADD CONSTRAINT ${l} UNIQUE (${this.formatter.columnize(o)})`);else{const p=f?" "+this.client.queryCompiler(f).where():" WHERE "+o.map(d=>this.formatter.columnize(d)+" IS NOT NULL").join(" AND ");this.pushQuery(`CREATE UNIQUE INDEX ${l} ON ${this.tableName()} (${this.formatter.columnize(o)})${p}`)}}dropIndex(o,l){l=l?this.formatter.wrap(l):this._indexCommand("index",this.tableNameRaw,o),this.pushQuery(`DROP INDEX ${l} ON ${this.tableName()}`)}dropForeign(o,l){l=l?this.formatter.wrap(l):this._indexCommand("foreign",this.tableNameRaw,o),this.pushQuery(`ALTER TABLE ${this.tableName()} DROP CONSTRAINT ${l}`)}dropPrimary(o){o=o?this.formatter.wrap(o):this.formatter.wrap(`${this.tableNameRaw}_pkey`),this.pushQuery(`ALTER TABLE ${this.tableName()} DROP CONSTRAINT ${o}`)}dropUnique(o,l){l=l?this.formatter.wrap(l):this._indexCommand("unique",this.tableNameRaw,o),this.pushQuery(`DROP INDEX ${l} ON ${this.tableName()}`)}}return s.prototype.createAlterTableMethods=["foreign","primary"],s.prototype.lowerCase=!1,s.prototype.addColumnsPrefix="ADD ",s.prototype.dropColumnPrefix="DROP COLUMN ",s.prototype.alterColumnPrefix="ALTER COLUMN ",Ow=s,Ow}var Mw,yL;function qY(){if(yL)return Mw;yL=1;const e=Ro(),{columnize:n}=Vt();class r extends e{constructor(a,o){super(a,o)}createQuery(a,o,l,u){let f="CREATE "+(u?"OR ALTER ":"")+"VIEW "+this.viewName();const p=a?" ("+n(a,this.viewBuilder,this.client,this.bindingsHolder)+")":"";f+=p,f+=" AS ",f+=o.toString(),this.pushQuery({sql:f})}renameColumn(a,o){this.pushQuery(`exec sp_rename ${this.client.parameter(this.viewName()+"."+a,this.viewBuilder,this.bindingsHolder)}, ${this.client.parameter(o,this.viewBuilder,this.bindingsHolder)}, 'COLUMN'`)}createOrReplace(){this.createQuery(this.columns,this.selectQuery,!1,!0)}}return Mw=r,Mw}var jw,vL;function AY(){if(vL)return jw;vL=1;const e=na(),{toNumber:n}=Qt(),{formatDefault:r}=ea(),{operator:s}=Vt();class a extends e{constructor(l,u,h){super(l,u,h),this.modifiers=["nullable","defaultTo","first","after","comment"],this._addCheckModifiers()}double(l,u){return"float"}floating(l,u){return"float"}integer(){return"int"}tinyint(){return"tinyint"}varchar(l){return`nvarchar(${n(l,255)})`}timestamp({useTz:l=!1}={}){return l?"datetimeoffset":"datetime2"}bit(l){return l>1&&this.client.logger.warn("Bit field is exactly 1 bit length for MSSQL"),"bit"}binary(l){return l?`varbinary(${n(l)})`:"varbinary(max)"}first(){return this.client.logger.warn("Column first modifier not available for MSSQL"),""}after(l){return this.client.logger.warn("Column after modifier not available for MSSQL"),""}defaultTo(l,{constraintName:u}={}){const h=r(l,this.type,this.client);return u=typeof u<"u"?u:`${this.tableCompiler.tableNameRaw}_${this.getColumnName()}_default`.toLowerCase(),this.columnBuilder._method==="alter"?(this.pushAdditional(function(){this.pushQuery(`ALTER TABLE ${this.tableCompiler.tableName()} ADD CONSTRAINT ${this.formatter.wrap(u)} DEFAULT ${h} FOR ${this.formatter.wrap(this.getColumnName())}`)}),""):u?`CONSTRAINT ${this.formatter.wrap(u)} DEFAULT ${h}`:`DEFAULT ${h}`}comment(l){if(!l)return;l&&l.length>7500/2&&this.client.logger.warn("Your comment might be longer than the max comment length for MSSQL of 7,500 bytes.");const u=this.formatter.escapingStringDelimiters(l),h=this.tableCompiler.schemaNameRaw||"dbo",f=this.formatter.escapingStringDelimiters(this.tableCompiler.tableNameRaw),p=this.formatter.escapingStringDelimiters(this.args[0]||this.defaults("columnName")),d=`N'MS_Description', N'${u}', N'Schema', N'${h}', N'Table', N'${f}', N'Column', N'${p}'`;return this.pushAdditional(function(){const g=`EXISTS(SELECT * FROM sys.fn_listextendedproperty(N'MS_Description', N'Schema', N'${h}', N'Table', N'${f}', N'Column', N'${p}'))`;this.pushQuery(`IF ${g}
115
+ EXEC sys.sp_updateextendedproperty ${d}
116
+ ELSE
117
+ EXEC sys.sp_addextendedproperty ${d}`)}),""}checkLength(l,u,h){return this._check(`LEN(${this.formatter.wrap(this.getColumnName())}) ${s(l,this.columnBuilder,this.bindingsHolder)} ${n(u)}`,h)}checkRegex(l,u){return this._check(`${this.formatter.wrap(this.getColumnName())} LIKE ${this.client._escapeBinding("%"+l+"%")}`,u)}increments(l={primaryKey:!0}){return"int identity(1,1) not null"+(this.tableCompiler._canBeAddPrimaryKey(l)?" primary key":"")}bigincrements(l={primaryKey:!0}){return"bigint identity(1,1) not null"+(this.tableCompiler._canBeAddPrimaryKey(l)?" primary key":"")}}return a.prototype.bigint="bigint",a.prototype.mediumint="int",a.prototype.smallint="smallint",a.prototype.text="nvarchar(max)",a.prototype.mediumtext="nvarchar(max)",a.prototype.longtext="nvarchar(max)",a.prototype.json=a.prototype.jsonb="nvarchar(max)",a.prototype.enu="nvarchar(100)",a.prototype.uuid=({useBinaryUuid:o=!1}={})=>o?"binary(16)":"uniqueidentifier",a.prototype.datetime="datetime2",a.prototype.bool="bit",jw=a,jw}var $w,bL;function NY(){if(bL)return $w;bL=1;const e=ti(),n=wY(),r=ra(),s=CY(),a=EY(),o=xY(),l=SY(),u=TY(),h=qY(),f=AY(),p=ni(),{setHiddenProperty:d}=lx(),g=tr()("knex:mssql"),y={MIN:-2147483648,MAX:2147483647},C={MIN:-9007199254740991,MAX:9007199254740991};class x extends r{constructor(b={}){super(b)}_generateConnection(){const b=this.connectionSettings;b.options=b.options||{};const w={authentication:{type:b.type||"default",options:{userName:b.userName||b.user,password:b.password,domain:b.domain,token:b.token,clientId:b.clientId,clientSecret:b.clientSecret,tenantId:b.tenantId,msiEndpoint:b.msiEndpoint}},server:b.server||b.host,options:{database:b.database,encrypt:b.encrypt||!1,port:b.port||1433,connectTimeout:b.connectionTimeout||b.timeout||15e3,requestTimeout:n(b.requestTimeout)?15e3:b.requestTimeout,rowCollectionOnDone:!1,rowCollectionOnRequestCompletion:!1,useColumnNames:!1,tdsVersion:b.options.tdsVersion||"7_4",appName:b.options.appName||"knex",trustServerCertificate:!1,...b.options}};return w.authentication.options.password&&d(w.authentication.options),w.options.instanceName&&delete w.options.port,isNaN(w.options.requestTimeout)&&(w.options.requestTimeout=15e3),w.options.requestTimeout===1/0&&(w.options.requestTimeout=0),w.options.requestTimeout<0&&(w.options.requestTimeout=0),b.debug&&(w.options.debug={packet:!0,token:!0,data:!0,payload:!0}),w}_driver(){return Qe}formatter(){return new s(this,...arguments)}transaction(){return new a(this,...arguments)}queryCompiler(){return new o(this,...arguments)}schemaCompiler(){return new l(this,...arguments)}tableCompiler(){return new u(this,...arguments)}viewCompiler(){return new h(this,...arguments)}queryBuilder(){return new p(this)}columnCompiler(){return new f(this,...arguments)}wrapIdentifierImpl(b){return b==="*"?"*":`[${b.replace(/[[\]]+/g,"")}]`}acquireRawConnection(){return new Promise((b,w)=>{g("connection::connection new connection requested");const E=this._driver(),q=Object.assign({},this._generateConnection()),A=new E.Connection(q);A.connect(R=>R?(g("connection::connect error: %s",R.message),w(R)):(g("connection::connect connected to server"),A.connected=!0,A.on("error",O=>{g("connection::error message=%s",O.message),A.__knex__disposed=O,A.connected=!1}),A.once("end",()=>{A.connected=!1,A.__knex__disposed="Connection to server was terminated.",g("connection::end connection ended.")}),b(A)))})}validateConnection(b){return b&&b.connected}destroyRawConnection(b){return g("connection::destroy"),new Promise(w=>{b.once("end",()=>{w()}),b.close()})}positionBindings(b){let w=-1;return b.replace(/\\?\?/g,E=>E==="\\?"?"?":(w+=1,`@p${w}`))}_chomp(b){if(b.state.name==="LoggedIn"){const w=this.requestQueue.pop();w&&(g("connection::query executing query, %d more in queue",this.requestQueue.length),b.execSql(w))}}_enqueueRequest(b,w){this.requestQueue.push(b),this._chomp(w)}_makeRequest(b,w){const E=this._driver(),q=typeof b=="string"?b:b.sql;let A=0;if(!q)throw new Error("The query is empty");g("request::request sql=%s",q);const R=new E.Request(q,(O,I)=>{if(O)return g("request::error message=%s",O.message),w(O);A=I,g("request::callback rowCount=%d",A)});return R.on("prepared",()=>{g("request %s::request prepared",this.id)}),R.on("done",(O,I)=>{g("request::done rowCount=%d more=%s",O,I)}),R.on("doneProc",(O,I)=>{g("request::doneProc id=%s rowCount=%d more=%s",R.id,O,I)}),R.on("doneInProc",(O,I)=>{g("request::doneInProc id=%s rowCount=%d more=%s",R.id,O,I)}),R.once("requestCompleted",()=>(g("request::completed id=%s",R.id),w(null,A))),R.on("error",O=>(g("request::error id=%s message=%s",R.id,O.message),w(O))),R}_stream(b,w,E){return new Promise((q,A)=>{const R=this._makeRequest(w,O=>{if(O)return E.emit("error",O),A(O);q()});R.on("row",O=>{E.write(O.reduce((I,k)=>({...I,[k.metadata.colName]:k.value}),{}))}),R.on("error",O=>{E.emit("error",O),A(O)}),R.once("requestCompleted",()=>{E.end(),q()}),this._assignBindings(R,w.bindings),this._enqueueRequest(R,b)})}_assignBindings(b,w){if(Array.isArray(w))for(let E=0;E<w.length;E++){const q=w[E];this._setReqInput(b,E,q)}}_scaleForBinding(b){if(b%1===0)throw new Error(`The binding value ${b} must be a decimal number.`);return{scale:10}}_typeForBinding(b){const w=this._driver();if(this.connectionSettings.options&&this.connectionSettings.options.mapBinding){const E=this.connectionSettings.options.mapBinding(b);if(E)return[E.value,E.type]}switch(typeof b){case"string":return[b,w.TYPES.NVarChar];case"boolean":return[b,w.TYPES.Bit];case"number":{if(b%1!==0)return[b,w.TYPES.Float];if(b<y.MIN||b>y.MAX){if(b<C.MIN||b>C.MAX)throw new Error(`Bigint must be safe integer or must be passed as string, saw ${b}`);return[b,w.TYPES.BigInt]}return[b,w.TYPES.Int]}default:return b instanceof Date?[b,w.TYPES.DateTime]:b instanceof Buffer?[b,w.TYPES.VarBinary]:[b,w.TYPES.NVarChar]}}_query(b,w){return new Promise((E,q)=>{const A=[],R=this._makeRequest(w,(O,I)=>{if(O)return q(O);w.response=A,process.nextTick(()=>this._chomp(b)),E(w)});R.on("row",O=>{g("request::row"),A.push(O)}),this._assignBindings(R,w.bindings),this._enqueueRequest(R,b)})}_setReqInput(b,w,E){const[q,A]=this._typeForBinding(E),R="p".concat(w);let O;typeof q=="number"&&q%1!==0&&(O=this._scaleForBinding(q)),g("request::binding pos=%d type=%s value=%s",w,A.name,q),Buffer.isBuffer(q)&&(O={length:"max"}),b.addParameter(R,A,q,O)}processResponse(b,w){if(b==null)return;let{response:E}=b;const{method:q}=b;if(b.output||(E=E.map(A=>A.reduce((R,O)=>{const I=O.metadata.colName;return R[I]?(Array.isArray(R[I])||(R[I]=[R[I]]),R[I].push(O.value)):R[I]=O.value,R},{})),b.output))return b.output.call(w,E);switch(q){case"select":return E;case"first":return E[0];case"pluck":return e(E,b.pluck);case"insert":case"del":case"update":case"counter":return b.returning&&b.returning==="@@rowcount"?E[0][""]:E;default:return E}}}return Object.assign(x.prototype,{requestQueue:[],dialect:"mssql",driverName:"mssql"}),$w=x,$w}var Lw,_L;function RY(){if(_L)return Lw;_L=1;var e="Expected a function";function n(r,s,a){if(typeof r!="function")throw new TypeError(e);return setTimeout(function(){r.apply(void 0,a)},s)}return Lw=n,Lw}var Iw,wL;function OY(){if(wL)return Iw;wL=1;var e=RY(),n=xl(),r=n(function(s,a){return e(s,1,a)});return Iw=r,Iw}var Dw,CL;function MY(){if(CL)return Dw;CL=1;const e=Ji(),r=tr()("knex:tx");class s extends e{query(o,l,u,h){const f=this,p=this.trxClient.query(o,l).catch(d=>{if(d.errno===1305){this.trxClient.logger.warn("Transaction was implicitly committed, do not mix transactions and DDL with MySQL (#805)");return}u=2,h=d,f._completed=!0,r("%s error running transaction query",f.txid)}).then(function(d){if(u===1&&f._resolver(h),u===2){if(h===void 0){if(f.doNotRejectOnRollback&&/^ROLLBACK\b/i.test(l)){f._resolver();return}h=new Error(`Transaction rejected with non-error: ${h}`)}f._rejecter(h)}return d});return(u===1||u===2)&&(f._completed=!0),p}}return Dw=s,Dw}var kw,EL;function jY(){if(EL)return kw;EL=1;const e=ni(),n=qn();return kw=class extends e{upsert(s,a,o){return this._method="upsert",n(a)||this.returning(a,o),this._single.upsert=s,this}},kw}var Bw,xL;function $Y(){if(xL)return Bw;xL=1;const e=Qe,n=tn(),r=Wi(),s=qn(),a=ta(),{wrapAsIdentifier:o}=ea(),{columnize:l,wrap:u}=Vt(),h=p=>r(p)||Array.isArray(p);class f extends a{constructor(d,g,y){super(d,g,y);const{returning:C}=this.single;C&&this.client.logger.warn(".returning() is not supported by mysql and will not have any effect."),this._emptyInsertValue="() values ()"}del(){const d=super.del();if(d==="")return d;const g=this.comments();return(g===""?"":g+" ")+d}insert(){let d=super.insert();if(d==="")return d;const g=this.comments();d=(g===""?"":g+" ")+d;const{ignore:y,merge:C,insert:x}=this.single;if(y&&(d=d.replace("insert into","insert ignore into")),C&&(d+=this._merge(C.updates,x),this.where()))throw new Error(".onConflict().merge().where() is not supported for mysql");return d}upsert(){const d=this.single.upsert||[],g=this.with()+`replace into ${this.tableName} `,y=this._insertBody(d);return y===""?"":g+y}_merge(d,g){const y=" on duplicate key update ";if(d&&Array.isArray(d))return y+d.map(C=>o(C,this.formatter.builder,this.client)).map(C=>`${C} = values(${C})`).join(", ");if(d&&typeof d=="object"){const C=this._prepUpdate(d);return y+C.join(",")}else{const C=this._prepInsert(g);if(typeof C=="string")throw new Error("If using merge with a raw insert query, then updates must be provided");return y+C.columns.map(x=>o(x,this.builder,this.client)).map(x=>`${x} = values(${x})`).join(", ")}}update(){const d=this.comments(),g=this.with(),y=this.join(),C=this._prepUpdate(this.single.update),x=this.where(),v=this.order(),b=this.limit();return(d===""?"":d+" ")+g+`update ${this.tableName}`+(y?` ${y}`:"")+" set "+C.join(", ")+(x?` ${x}`:"")+(v?` ${v}`:"")+(b?` ${b}`:"")}forUpdate(){return"for update"}forShare(){return"lock in share mode"}skipLocked(){return"skip locked"}noWait(){return"nowait"}columnInfo(){const d=this.single.columnInfo;return{sql:"select * from information_schema.columns where table_name = ? and table_schema = ?",bindings:[this.client.customWrapIdentifier(this.single.table,n),this.client.database()],output(y){const C=y.reduce(function(x,v){return x[v.COLUMN_NAME]={defaultValue:v.COLUMN_DEFAULT==="NULL"?null:v.COLUMN_DEFAULT,type:v.DATA_TYPE,maxLength:v.CHARACTER_MAXIMUM_LENGTH,nullable:v.IS_NULLABLE==="YES"},x},{});return d&&C[d]||C}}}limit(){const d=!this.single.limit&&this.single.limit!==0;return d&&!this.single.offset?"":`limit ${this.single.offset&&d?"18446744073709551615":this._getValueOrParameterFromAttribute("limit")}`}whereBasic(d){return e(!h(d.value),"The values in where clause must not be object or array."),super.whereBasic(d)}whereRaw(d){return e(s(d.value.bindings)||!Object.values(d.value.bindings).some(h),"The values in where clause must not be object or array."),super.whereRaw(d)}whereLike(d){return`${this._columnClause(d)} ${this._not(d,"like ")}${this._valueClause(d)} COLLATE utf8_bin`}whereILike(d){return`${this._columnClause(d)} ${this._not(d,"like ")}${this._valueClause(d)}`}jsonExtract(d){return this._jsonExtract(["json_extract","json_unquote"],d)}jsonSet(d){return this._jsonSet("json_set",d)}jsonInsert(d){return this._jsonSet("json_insert",d)}jsonRemove(d){const g=`json_remove(${l(d.column,this.builder,this.client,this.bindingsHolder)},${this.client.parameter(d.path,this.builder,this.bindingsHolder)})`;return d.alias?this.client.alias(g,this.formatter.wrap(d.alias)):g}whereJsonObject(d){return this._not(d,`json_contains(${this._columnClause(d)}, ${this._jsonValueClause(d)})`)}whereJsonPath(d){return this._whereJsonPath("json_extract",d)}whereJsonSupersetOf(d){return this._not(d,`json_contains(${u(d.column,void 0,this.builder,this.client,this.bindingsHolder)},${this._jsonValueClause(d)})`)}whereJsonSubsetOf(d){return this._not(d,`json_contains(${this._jsonValueClause(d)},${u(d.column,void 0,this.builder,this.client,this.bindingsHolder)})`)}onJsonPathEquals(d){return this._onJsonPathEquals("json_extract",d)}}return Bw=f,Bw}var Pw,SL;function LY(){if(SL)return Pw;SL=1;const e=Ao();class n extends e{constructor(s,a){super(s,a)}renameTable(s,a){this.pushQuery(`rename table ${this.formatter.wrap(s)} to ${this.formatter.wrap(a)}`)}renameView(s,a){this.renameTable(s,a)}hasTable(s){let a="select * from information_schema.tables where table_name = ?";const o=[s];this.schema?(a+=" and table_schema = ?",o.push(this.schema)):a+=" and table_schema = database()",this.pushQuery({sql:a,bindings:o,output:function(u){return u.length>0}})}hasColumn(s,a){this.pushQuery({sql:`show columns from ${this.formatter.wrap(s)}`,output(o){return o.some(l=>this.client.wrapIdentifier(l.Field.toLowerCase())===this.client.wrapIdentifier(a.toLowerCase()))}})}}return Pw=n,Pw}var zw,TL;function IY(){if(TL)return zw;TL=1;const e=No(),{isObject:n,isString:r}=mt();class s extends e{constructor(o,l){super(o,l)}createQuery(o,l,u){const h=l?"create table if not exists ":"create table ",{client:f}=this;let p={},d=" ("+o.sql.join(", ");d+=this.primaryKeys()||"",d+=this._addChecks(),d+=")";let g=h+this.tableName()+(u&&this.tableNameLike()?" like "+this.tableNameLike():d);f.connectionSettings&&(p=f.connectionSettings);const y=this.single.charset||p.charset||"",C=this.single.collate||p.collate||"",x=this.single.engine||"";if(y&&!u&&(g+=` default character set ${y}`),C&&(g+=` collate ${C}`),x&&(g+=` engine = ${x}`),this.single.comment){const v=this.single.comment||"",b=1024;v.length>b&&this.client.logger.warn(`The max length for a table comment is ${b} characters`),g+=` comment = '${v}'`}this.pushQuery(g),u&&this.addColumns(o,this.addColumnsPrefix)}comment(o){this.pushQuery(`alter table ${this.tableName()} comment = '${o}'`)}changeType(){}renameColumn(o,l){const u=this,h=this.tableName(),f=this.formatter.wrap(o)+" "+this.formatter.wrap(l);this.pushQuery({sql:`show full fields from ${h} where field = `+this.client.parameter(o,this.tableBuilder,this.bindingsHolder),output(p){const d=p[0],g=this;return u.getFKRefs(g).then(([y])=>new Promise((C,x)=>{try{y.length||C(),C(u.dropFKRefs(g,y))}catch(v){x(v)}}).then(function(){let C=`alter table ${h} change ${f} ${d.Type}`;return String(d.Null).toUpperCase()!=="YES"?C+=" NOT NULL":C+=" NULL",d.Default!==void 0&&d.Default!==null&&(C+=` DEFAULT '${d.Default}'`),d.Collation!==void 0&&d.Collation!==null&&(C+=` COLLATE '${d.Collation}'`),d.Extra=="auto_increment"&&(C+=" AUTO_INCREMENT"),g.query({sql:C})}).then(function(){if(y.length)return u.createFKRefs(g,y.map(function(C){return C.REFERENCED_COLUMN_NAME===o&&(C.REFERENCED_COLUMN_NAME=l),C.COLUMN_NAME===o&&(C.COLUMN_NAME=l),C}))}))}})}primaryKeys(){const o=(this.grouped.alterTable||[]).filter(l=>l.method==="primary");if(o.length>0&&o[0].args.length>0){const l=o[0].args[0];let u=o[0].args[1]||"";if(u&&(u=" constraint "+this.formatter.wrap(u)),this.grouped.columns){const h=this._getIncrementsColumnNames();h.length&&h.forEach(p=>{l.includes(p)||l.unshift(p)});const f=this._getBigIncrementsColumnNames();f.length&&f.forEach(p=>{l.includes(p)||l.unshift(p)})}return`,${u} primary key (${this.formatter.columnize(l)})`}}getFKRefs(o){const l={bindings:[]},u="SELECT KCU.CONSTRAINT_NAME, KCU.TABLE_NAME, KCU.COLUMN_NAME, KCU.REFERENCED_TABLE_NAME, KCU.REFERENCED_COLUMN_NAME, RC.UPDATE_RULE, RC.DELETE_RULE FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS KCU JOIN INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS AS RC USING(CONSTRAINT_NAME)WHERE KCU.REFERENCED_TABLE_NAME = "+this.client.parameter(this.tableNameRaw,this.tableBuilder,l)+" AND KCU.CONSTRAINT_SCHEMA = "+this.client.parameter(this.client.database(),this.tableBuilder,l)+" AND RC.CONSTRAINT_SCHEMA = "+this.client.parameter(this.client.database(),this.tableBuilder,l);return o.query({sql:u,bindings:l.bindings})}dropFKRefs(o,l){const u=this.client.formatter(this.tableBuilder);return Promise.all(l.map(function(h){const f=u.wrap(h.CONSTRAINT_NAME),p=u.wrap(h.TABLE_NAME);return o.query({sql:`alter table ${p} drop foreign key ${f}`})}))}createFKRefs(o,l){const u=this.client.formatter(this.tableBuilder);return Promise.all(l.map(function(h){const f=u.wrap(h.TABLE_NAME),p=u.wrap(h.CONSTRAINT_NAME),d=u.columnize(h.COLUMN_NAME),g=u.columnize(h.REFERENCED_COLUMN_NAME),y=u.wrap(h.REFERENCED_TABLE_NAME),C=` ON UPDATE ${h.UPDATE_RULE}`,x=` ON DELETE ${h.DELETE_RULE}`;return o.query({sql:`alter table ${f} add constraint ${p} foreign key (`+d+") references "+y+" ("+g+")"+C+x})}))}index(o,l,u){let h,f;r(u)?f=u:n(u)&&({indexType:f,storageEngineIndexType:h}=u),l=l?this.formatter.wrap(l):this._indexCommand("index",this.tableNameRaw,o),h=h?` using ${h}`:"",this.pushQuery(`alter table ${this.tableName()} add${f?` ${f}`:""} index ${l}(${this.formatter.columnize(o)})${h}`)}primary(o,l){let u;n(l)&&({constraintName:l,deferrable:u}=l),u&&u!=="not deferrable"&&this.client.logger.warn(`mysql: primary key constraint \`${l}\` will not be deferrable ${u} because mysql does not support deferred constraints.`),l=l?this.formatter.wrap(l):this.formatter.wrap(`${this.tableNameRaw}_pkey`);const h=o;let f=[],p=[];this.grouped.columns&&(f=this._getIncrementsColumnNames(),f&&f.forEach(d=>{h.includes(d)||h.unshift(d)}),p=this._getBigIncrementsColumnNames(),p&&p.forEach(d=>{h.includes(d)||h.unshift(d)})),this.method!=="create"&&this.method!=="createIfNot"&&this.pushQuery(`alter table ${this.tableName()} add primary key ${l}(${this.formatter.columnize(h)})`),f.length&&this.pushQuery(`alter table ${this.tableName()} modify column ${this.formatter.columnize(f)} int unsigned not null auto_increment`),p.length&&this.pushQuery(`alter table ${this.tableName()} modify column ${this.formatter.columnize(p)} bigint unsigned not null auto_increment`)}unique(o,l){let u,h;n(l)&&({indexName:l,deferrable:h,storageEngineIndexType:u}=l),h&&h!=="not deferrable"&&this.client.logger.warn(`mysql: unique index \`${l}\` will not be deferrable ${h} because mysql does not support deferred constraints.`),l=l?this.formatter.wrap(l):this._indexCommand("unique",this.tableNameRaw,o),u=u?` using ${u}`:"",this.pushQuery(`alter table ${this.tableName()} add unique ${l}(${this.formatter.columnize(o)})${u}`)}dropIndex(o,l){l=l?this.formatter.wrap(l):this._indexCommand("index",this.tableNameRaw,o),this.pushQuery(`alter table ${this.tableName()} drop index ${l}`)}dropForeign(o,l){l=l?this.formatter.wrap(l):this._indexCommand("foreign",this.tableNameRaw,o),this.pushQuery(`alter table ${this.tableName()} drop foreign key ${l}`)}dropPrimary(){this.pushQuery(`alter table ${this.tableName()} drop primary key`)}dropUnique(o,l){l=l?this.formatter.wrap(l):this._indexCommand("unique",this.tableNameRaw,o),this.pushQuery(`alter table ${this.tableName()} drop index ${l}`)}}return s.prototype.addColumnsPrefix="add ",s.prototype.alterColumnsPrefix="modify ",s.prototype.dropColumnPrefix="drop ",zw=s,zw}var Uw,qL;function DY(){if(qL)return Uw;qL=1;const e=na(),{isObject:n}=mt(),{toNumber:r}=Qt(),s=new RegExp("(?<!\\\\)'","g");class a extends e{constructor(l,u,h){super(l,u,h),this.modifiers=["unsigned","nullable","defaultTo","comment","collate","first","after"],this._addCheckModifiers()}double(l,u){return l?`double(${r(l,8)}, ${r(u,2)})`:"double"}integer(l){return l=l?`(${r(l,11)})`:"",`int${l}`}tinyint(l){return l=l?`(${r(l,1)})`:"",`tinyint${l}`}text(l){switch(l){case"medium":case"mediumtext":return"mediumtext";case"long":case"longtext":return"longtext";default:return"text"}}mediumtext(){return this.text("medium")}longtext(){return this.text("long")}enu(l){return`enum('${l.join("', '")}')`}datetime(l){return n(l)&&({precision:l}=l),typeof l=="number"?`datetime(${l})`:"datetime"}timestamp(l){return n(l)&&({precision:l}=l),typeof l=="number"?`timestamp(${l})`:"timestamp"}time(l){return n(l)&&({precision:l}=l),typeof l=="number"?`time(${l})`:"time"}bit(l){return l?`bit(${r(l)})`:"bit"}binary(l){return l?`varbinary(${r(l)})`:"blob"}json(){return"json"}jsonb(){return"json"}defaultTo(l){if(l==null)return;if((this.type==="json"||this.type==="jsonb")&&n(l))return`default ('${JSON.stringify(l)}')`;const u=super.defaultTo.apply(this,arguments);return this.type!=="blob"&&this.type.indexOf("text")===-1?u:""}unsigned(){return"unsigned"}comment(l){return l&&l.length>255&&this.client.logger.warn("Your comment is longer than the max comment length for MySQL"),l&&`comment '${l.replace(s,"\\'")}'`}first(){return"first"}after(l){return`after ${this.formatter.wrap(l)}`}collate(l){return l&&`collate '${l}'`}checkRegex(l,u){return this._check(`${this.formatter.wrap(this.getColumnName())} REGEXP ${this.client._escapeBinding(l)}`,u)}increments(l={primaryKey:!0}){return"int unsigned not null"+(this.tableCompiler._canBeAddPrimaryKey(l)?" auto_increment primary key":"")}bigincrements(l={primaryKey:!0}){return"bigint unsigned not null"+(this.tableCompiler._canBeAddPrimaryKey(l)?" auto_increment primary key":"")}}return a.prototype.bigint="bigint",a.prototype.mediumint="mediumint",a.prototype.smallint="smallint",Uw=a,Uw}var Qw,AL;function kY(){if(AL)return Qw;AL=1;const e=Ro();class n extends e{constructor(s,a){super(s,a)}createOrReplace(){this.createQuery(this.columns,this.selectQuery,!1,!0)}}return Qw=n,Qw}var Hw,NL;function BY(){if(NL)return Hw;NL=1;const e=Tl();class n extends e{constructor(){super(...arguments)}checkOption(){this._single.checkOption="default_option"}localCheckOption(){this._single.checkOption="local"}cascadedCheckOption(){this._single.checkOption="cascaded"}}return Hw=n,Hw}var Vw,RL;function pP(){if(RL)return Vw;RL=1;const e=OY(),n=ti(),{promisify:r}=Qe,s=ra(),a=MY(),o=jY(),l=$Y(),u=LY(),h=IY(),f=DY(),{makeEscape:p}=ux(),d=kY(),g=BY();class y extends s{_driver(){return Qe}queryBuilder(){return new o(this)}queryCompiler(x,v){return new l(this,x,v)}schemaCompiler(){return new u(this,...arguments)}tableCompiler(){return new h(this,...arguments)}viewCompiler(){return new d(this,...arguments)}viewBuilder(){return new g(this,...arguments)}columnCompiler(){return new f(this,...arguments)}transaction(){return new a(this,...arguments)}wrapIdentifierImpl(x){return x!=="*"?`\`${x.replace(/`/g,"``")}\``:"*"}acquireRawConnection(){return new Promise((x,v)=>{const b=this.driver.createConnection(this.connectionSettings);b.on("error",w=>{b.__knex__disposed=w}),b.connect(w=>{if(w)return b.removeAllListeners(),v(w);x(b)})})}async destroyRawConnection(x){try{return await r(b=>x.end(b))()}catch(v){x.__knex__disposed=v}finally{e(()=>x.removeAllListeners())}}validateConnection(x){return x.state==="connected"||x.state==="authenticated"}_stream(x,v,b,w){if(!v.sql)throw new Error("The query is empty");w=w||{};const E=Object.assign({sql:v.sql},v.options);return new Promise((q,A)=>{b.on("error",A),b.on("end",q);const R=x.query(E,v.bindings).stream(w);R.on("error",O=>{A(O),b.emit("error",O)}),R.pipe(b)})}_query(x,v){if((!v||typeof v=="string")&&(v={sql:v}),!v.sql)throw new Error("The query is empty");return new Promise(function(b,w){if(!v.sql){b();return}const E=Object.assign({sql:v.sql},v.options);x.query(E,v.bindings,function(q,A,R){if(q)return w(q);v.response=[A,R],b(v)})})}processResponse(x,v){if(x==null)return;const{response:b}=x,{method:w}=x,E=b[0],q=b[1];if(x.output)return x.output.call(v,E,q);switch(w){case"select":return E;case"first":return E[0];case"pluck":return n(E,x.pluck);case"insert":return[E.insertId];case"del":case"update":case"counter":return E.affectedRows;default:return b}}async cancelQuery(x){const v=await this.acquireRawConnection();try{return await this._wrappedCancelQueryCall(v,x)}finally{await this.destroyRawConnection(v),v.__knex__disposed&&this.logger.warn(`Connection Error: ${v.__knex__disposed}`)}}_wrappedCancelQueryCall(x,v){return this._query(x,{sql:"KILL QUERY ?",bindings:[v.threadId],options:{}})}}return Object.assign(y.prototype,{dialect:"mysql",driverName:"mysql",_escapeBinding:p(),canCancelQuery:!0}),Vw=y,Vw}var Fw,OL;function PY(){if(OL)return Fw;OL=1;const e=Ji(),n=tr()("knex:tx");class r extends e{query(a,o,l,u){const h=this,f=this.trxClient.query(a,o).catch(p=>{if(p.code==="ER_SP_DOES_NOT_EXIST"){this.trxClient.logger.warn("Transaction was implicitly committed, do not mix transactions and DDL with MySQL (#805)");return}l=2,u=p,h._completed=!0,n("%s error running transaction query",h.txid)}).then(function(p){if(l===1&&h._resolver(u),l===2){if(u===void 0){if(h.doNotRejectOnRollback&&/^ROLLBACK\b/i.test(o)){h._resolver();return}u=new Error(`Transaction rejected with non-error: ${u}`)}return h._rejecter(u),p}});return(l===1||l===2)&&(h._completed=!0),f}}return Fw=r,Fw}var Gw,ML;function zY(){if(ML)return Gw;ML=1;const e=pP(),n=PY();class r extends e{transaction(){return new n(this,...arguments)}_driver(){return Qe}initializeDriver(){try{this.driver=this._driver()}catch(a){let o=`Knex: run
118
+ $ npm install ${this.driverName}`;throw process.version.replace(/^v/,"").split(".")[0]<=12&&(o+="@3.2.0",this.logger.error("Mysql2 version 3.2.0 is the latest version to support Node.js 12 or lower.")),o+=" --save",this.logger.error(`${o}
119
+ ${a.message}
120
+ ${a.stack}`),new Error(`${o}
121
+ ${a.message}`)}}validateConnection(a){return a&&!a._fatalError&&!a._protocolError&&!a._closing&&!a.stream.destroyed}}return Object.assign(r.prototype,{driverName:"mysql2"}),Gw=r,Gw}var Kw,jL;function Us(){if(jL)return Kw;jL=1;class e{constructor(o){this.oracleVersion=o;const l=o.split(".").map(u=>parseInt(u));l[0]>12||l[0]===12&&l[1]>=2?this.limit=128:this.limit=30}generateCombinedName(o,l,u,h){const f=Qe;Array.isArray(h)||(h=h?[h]:[]);const p=u.replace(/\.|-/g,"_"),d=h.join("_");let g=`${p}_${d.length?d+"_":""}${l}`.toLowerCase();return g.length>this.limit&&(o.warn(`Automatically generated name "${g}" exceeds ${this.limit} character limit for Oracle Database ${this.oracleVersion}. Using base64 encoded sha1 of that name instead.`),g=f.createHash("sha1").update(g).digest("base64").replace("=","")),g}}function n(a,o){return`begin execute immediate '${a.replace(/'/g,"''")}'; exception when others then if sqlcode != ${o} then raise; end if; end;`}function r(a){this.columnName=a}r.prototype.toString=function(){return`[object ReturningHelper:${this.columnName}]`};function s(a){return["DPI-1010","DPI-1080","ORA-03114","ORA-03113","ORA-03135","ORA-12514","ORA-00022","ORA-00028","ORA-00031","ORA-00045","ORA-00378","ORA-00602","ORA-00603","ORA-00609","ORA-01012","ORA-01041","ORA-01043","ORA-01089","ORA-01092","ORA-02396","ORA-03122","ORA-12153","ORA-12537","ORA-12547","ORA-12570","ORA-12583","ORA-27146","ORA-28511","ORA-56600","NJS-024","NJS-003"].some(function(o){return a.message.indexOf(o)===0})}return Kw={NameHelper:e,isConnectionError:s,wrapSqlWithCatch:n,ReturningHelper:r},Kw}var Yw,$L;function bx(){if($L)return Yw;$L=1;const{NameHelper:e}=Us();class n{constructor(s){this.nameHelper=new e(s)}renameColumnTrigger(s,a,o,l){const u=this.nameHelper.generateCombinedName(s,"autoinc_trg",a),h=this.nameHelper.generateCombinedName(s,"seq",a);return`DECLARE PK_NAME VARCHAR(200); IS_AUTOINC NUMBER := 0; BEGIN EXECUTE IMMEDIATE ('ALTER TABLE "${a}" RENAME COLUMN "${o}" TO "${l}"'); SELECT COUNT(*) INTO IS_AUTOINC from "USER_TRIGGERS" where trigger_name = '${u}'; IF (IS_AUTOINC > 0) THEN SELECT cols.column_name INTO PK_NAME FROM all_constraints cons, all_cons_columns cols WHERE cons.constraint_type = 'P' AND cons.constraint_name = cols.constraint_name AND cons.owner = cols.owner AND cols.table_name = '${a}'; IF ('${l}' = PK_NAME) THEN EXECUTE IMMEDIATE ('DROP TRIGGER "${u}"'); EXECUTE IMMEDIATE ('create or replace trigger "${u}" BEFORE INSERT on "${a}" for each row declare checking number := 1; begin if (:new."${l}" is null) then while checking >= 1 loop select "${h}".nextval into :new."${l}" from dual; select count("${l}") into checking from "${a}" where "${l}" = :new."${l}"; end loop; end if; end;'); end if; end if;END;`}createAutoIncrementTrigger(s,a,o){const l=`"${a}"`,u=a,h=o?`"${o}".`:"",f=o?`'${o}'`:"cols.owner",p=this.nameHelper.generateCombinedName(s,"autoinc_trg",a),g=`"${this.nameHelper.generateCombinedName(s,"seq",a)}"`;return`DECLARE PK_NAME VARCHAR(200); BEGIN EXECUTE IMMEDIATE ('CREATE SEQUENCE ${h}${g}'); SELECT cols.column_name INTO PK_NAME FROM all_constraints cons, all_cons_columns cols WHERE cons.constraint_type = 'P' AND cons.constraint_name = cols.constraint_name AND cons.owner = ${f} AND cols.table_name = '${u}'; execute immediate ('create or replace trigger ${h}"${p}" BEFORE INSERT on ${h}${l} for each row declare checking number := 1; begin if (:new."' || PK_NAME || '" is null) then while checking >= 1 loop select ${h}${g}.nextval into :new."' || PK_NAME || '" from dual; select count("' || PK_NAME || '") into checking from ${h}${l} where "' || PK_NAME || '" = :new."' || PK_NAME || '"; end loop; end if; end;'); END;`}renameTableAndAutoIncrementTrigger(s,a,o){const l=this.nameHelper.generateCombinedName(s,"autoinc_trg",a),u=this.nameHelper.generateCombinedName(s,"seq",a),h=this.nameHelper.generateCombinedName(s,"autoinc_trg",o),f=this.nameHelper.generateCombinedName(s,"seq",o);return`DECLARE PK_NAME VARCHAR(200); IS_AUTOINC NUMBER := 0; BEGIN EXECUTE IMMEDIATE ('RENAME "${a}" TO "${o}"'); SELECT COUNT(*) INTO IS_AUTOINC from "USER_TRIGGERS" where trigger_name = '${l}'; IF (IS_AUTOINC > 0) THEN EXECUTE IMMEDIATE ('DROP TRIGGER "${l}"'); EXECUTE IMMEDIATE ('RENAME "${u}" TO "${f}"'); SELECT cols.column_name INTO PK_NAME FROM all_constraints cons, all_cons_columns cols WHERE cons.constraint_type = 'P' AND cons.constraint_name = cols.constraint_name AND cons.owner = cols.owner AND cols.table_name = '${o}'; EXECUTE IMMEDIATE ('create or replace trigger "${h}" BEFORE INSERT on "${o}" for each row declare checking number := 1; begin if (:new."' || PK_NAME || '" is null) then while checking >= 1 loop select "${f}".nextval into :new."' || PK_NAME || '" from dual; select count("' || PK_NAME || '") into checking from "${o}" where "' || PK_NAME || '" = :new."' || PK_NAME || '"; end loop; end if; end;'); end if;END;`}}return Yw=n,Yw}var Xw,LL;function UY(){if(LL)return Xw;LL=1;const e=Ao(),n=Us(),r=bx();class s extends e{constructor(){super(...arguments)}renameTable(o,l){const h=new r(this.client.version).renameTableAndAutoIncrementTrigger(this.client.logger,o,l);this.pushQuery(h)}hasTable(o){this.pushQuery({sql:"select TABLE_NAME from USER_TABLES where TABLE_NAME = "+this.client.parameter(o,this.builder,this.bindingsHolder),output(l){return l.length>0}})}hasColumn(o,l){const u=`select COLUMN_NAME from ALL_TAB_COLUMNS where TABLE_NAME = ${this.client.parameter(o,this.builder,this.bindingsHolder)} and COLUMN_NAME = ${this.client.parameter(l,this.builder,this.bindingsHolder)}`;this.pushQuery({sql:u,output:h=>h.length>0})}dropSequenceIfExists(o){const l=this.schema?`"${this.schema}".`:"";this.pushQuery(n.wrapSqlWithCatch(`drop sequence ${l}${this.formatter.wrap(o)}`,-2289))}_dropRelatedSequenceIfExists(o){const u=new n.NameHelper(this.client.version).generateCombinedName(this.client.logger,"seq",o);this.dropSequenceIfExists(u)}dropTable(o){const l=this.schema?`"${this.schema}".`:"";this.pushQuery(`drop table ${l}${this.formatter.wrap(o)}`),this._dropRelatedSequenceIfExists(o)}dropTableIfExists(o){this.dropObject(o,"table")}dropViewIfExists(o){this.dropObject(o,"view")}dropObject(o,l){const u=this.schema?`"${this.schema}".`:"";let h=-942;l==="materialized view"&&(h=-12003),this.pushQuery(n.wrapSqlWithCatch(`drop ${l} ${u}${this.formatter.wrap(o)}`,h)),this._dropRelatedSequenceIfExists(o)}refreshMaterializedView(o){return this.pushQuery({sql:`BEGIN DBMS_MVIEW.REFRESH('${this.schemaNameRaw?this.schemaNameRaw+".":""}${o}'); END;`})}dropMaterializedView(o){this._dropView(o,!1,!0)}dropMaterializedViewIfExists(o){this.dropObject(o,"materialized view")}}return Xw=s,Xw}var Ww,IL;function QY(){if(IL)return Ww;IL=1;const e=qh(),n=Sl();class r extends e{constructor(){super(...arguments)}checkIn(){return this._modifiers.checkIn=n(arguments),this}}return Ww=r,Ww}var Jw,DL;function HY(){if(DL)return Jw;DL=1;var e=kB();function n(r){return r&&r.length?e(r):[]}return Jw=n,Jw}var Zw,kL;function VY(){if(kL)return Zw;kL=1;const e=bx();function n(r){const s=new e(r.client.version);r.pushAdditional(function(){const a=this.tableCompiler.tableNameRaw,o=this.tableCompiler.schemaNameRaw,l=s.createAutoIncrementTrigger(this.client.logger,a,o);this.pushQuery(l)})}return Zw={createAutoIncrementTriggerAndSequence:n},Zw}var eC,BL;function mP(){if(BL)return eC;BL=1;const e=HY(),n=qo(),r=na(),{createAutoIncrementTriggerAndSequence:s}=VY(),{toNumber:a}=Qt();class o extends r{constructor(){super(...arguments),this.modifiers=["defaultTo","checkIn","nullable","comment"]}increments(u={primaryKey:!0}){return s(this),"integer not null"+(this.tableCompiler._canBeAddPrimaryKey(u)?" primary key":"")}bigincrements(u={primaryKey:!0}){return s(this),"number(20, 0) not null"+(this.tableCompiler._canBeAddPrimaryKey(u)?" primary key":"")}floating(u){const h=a(u,0);return`float${h?`(${h})`:""}`}double(u,h){return`number(${a(u,8)}, ${a(h,2)})`}decimal(u,h){return u===null?"decimal":`decimal(${a(u,8)}, ${a(h,2)})`}integer(u){return u?`number(${a(u,11)})`:"integer"}enu(u){u=e(u);const h=(u||[]).reduce((f,p)=>Math.max(f,String(p).length),1);return this.columnBuilder._modifiers.checkIn=[u],`varchar2(${h})`}datetime(u){return u?"timestamp":"timestamp with time zone"}timestamp(u){return u?"timestamp":"timestamp with time zone"}bool(){return this.columnBuilder._modifiers.checkIn=[[0,1]],"number(1, 0)"}varchar(u){return`varchar2(${a(u,255)})`}comment(u){const h=this.args[0]||this.defaults("columnName");this.pushAdditional(function(){this.pushQuery(`comment on column ${this.tableCompiler.tableName()}.`+this.formatter.wrap(h)+" is '"+(u||"")+"'")},u)}checkIn(u){return u===void 0?"":(u instanceof n?u=u.toQuery():Array.isArray(u)?u=u.map(h=>`'${h}'`).join(", "):u=`'${u}'`,`check (${this.formatter.wrap(this.args[0])} in (${u}))`)}}return o.prototype.tinyint="smallint",o.prototype.smallint="smallint",o.prototype.mediumint="integer",o.prototype.biginteger="number(20, 0)",o.prototype.text="clob",o.prototype.time="timestamp with time zone",o.prototype.bit="clob",o.prototype.json="clob",eC=o,eC}var tC,PL;function gP(){if(PL)return tC;PL=1;const e=Us(),n=No(),r=Qt(),s=bx(),{isObject:a}=mt();class o extends n{constructor(){super(...arguments)}addColumns(u,h){if(u.sql.length>0){h=h||this.addColumnsPrefix;const f=u.sql;let d=`${this.lowerCase?"alter table ":"ALTER TABLE "}${this.tableName()} ${h}`;u.sql.length>1?d+=`(${f.join(", ")})`:d+=f.join(", "),this.pushQuery({sql:d,bindings:u.bindings})}}renameColumn(u,h){const f=this.tableName().slice(1,-1),p=new s(this.client.version);return this.pushQuery(p.renameColumnTrigger(this.client.logger,f,u,h))}compileAdd(u){const h=this.formatter.wrap(u),f=this.prefixArray("add column",this.getColumns(u));return this.pushQuery({sql:`alter table ${h} ${f.join(", ")}`})}createQuery(u,h,f){const p=f&&this.tableNameLike()?" as (select * from "+this.tableNameLike()+" where 0=1)":" ("+u.sql.join(", ")+this._addChecks()+")",d=`create table ${this.tableName()}${p}`;this.pushQuery({sql:h?e.wrapSqlWithCatch(d,-955):d,bindings:u.bindings}),this.single.comment&&this.comment(this.single.comment),f&&this.addColumns(u,this.addColumnsPrefix)}comment(u){this.pushQuery(`comment on table ${this.tableName()} is '${u}'`)}dropColumn(){const u=r.normalizeArr.apply(null,arguments);this.pushQuery(`alter table ${this.tableName()} drop (${this.formatter.columnize(u)})`)}_indexCommand(u,h,f){const p=new e.NameHelper(this.client.version);return this.formatter.wrap(p.generateCombinedName(this.client.logger,u,h,f))}primary(u,h){let f;a(h)&&({constraintName:h,deferrable:f}=h),f=f?` deferrable initially ${f}`:"",h=h?this.formatter.wrap(h):this.formatter.wrap(`${this.tableNameRaw}_pkey`);const p=u;let d=[];this.grouped.columns&&(d=this._getIncrementsColumnNames(),d&&d.forEach(g=>{p.includes(g)||p.unshift(g)})),this.pushQuery(`alter table ${this.tableName()} add constraint ${h} primary key (${this.formatter.columnize(p)})${f}`)}dropPrimary(u){u=u?this.formatter.wrap(u):this.formatter.wrap(this.tableNameRaw+"_pkey"),this.pushQuery(`alter table ${this.tableName()} drop constraint ${u}`)}index(u,h){h=h?this.formatter.wrap(h):this._indexCommand("index",this.tableNameRaw,u),this.pushQuery(`create index ${h} on ${this.tableName()} (`+this.formatter.columnize(u)+")")}dropIndex(u,h){h=h?this.formatter.wrap(h):this._indexCommand("index",this.tableNameRaw,u),this.pushQuery(`drop index ${h}`)}unique(u,h){let f;a(h)&&({indexName:h,deferrable:f}=h),f=f?` deferrable initially ${f}`:"",h=h?this.formatter.wrap(h):this._indexCommand("unique",this.tableNameRaw,u),this.pushQuery(`alter table ${this.tableName()} add constraint ${h} unique (`+this.formatter.columnize(u)+")"+f)}dropUnique(u,h){h=h?this.formatter.wrap(h):this._indexCommand("unique",this.tableNameRaw,u),this.pushQuery(`alter table ${this.tableName()} drop constraint ${h}`)}dropForeign(u,h){h=h?this.formatter.wrap(h):this._indexCommand("foreign",this.tableNameRaw,u),this.pushQuery(`alter table ${this.tableName()} drop constraint ${h}`)}}return o.prototype.addColumnsPrefix="add ",o.prototype.alterColumnsPrefix="modify ",tC=o,tC}var nC,zL;function yP(){if(zL)return nC;zL=1;const{ReturningHelper:e}=Us(),{isConnectionError:n}=Us(),r=ra(),s=UY(),a=QY(),o=mP(),l=gP();class u extends r{schemaCompiler(){return new s(this,...arguments)}columnBuilder(){return new a(this,...arguments)}columnCompiler(){return new o(this,...arguments)}tableCompiler(){return new l(this,...arguments)}database(){return this.connectionSettings.database}positionBindings(f){let p=0;return f.replace(/\?/g,function(){return p+=1,`:${p}`})}_stream(f,p,d,g){if(!p.sql)throw new Error("The query is empty");return new Promise(function(y,C){d.on("error",v=>{n(v)&&(f.__knex__disposed=v),C(v)}),d.on("end",y);const x=f.queryStream(p.sql,p.bindings,g);x.pipe(d),x.on("error",function(v){C(v),d.emit("error",v)})})}alias(f,p){return f+" "+p}parameter(f,p,d){return f instanceof e&&this.driver?f=new this.driver.OutParam(this.driver.OCCISTRING):typeof f=="boolean"&&(f=f?1:0),super.parameter(f,p,d)}}return Object.assign(u.prototype,{dialect:"oracle",driverName:"oracle"}),nC=u,nC}var rC,UL;function FY(){if(UL)return rC;UL=1;const e=px(),n=tn(),r=qn(),s=Wi(),a=Js(),o=ta(),{ReturningHelper:l}=Us(),{isString:u}=mt(),h=["comments","columns","join","where","union","group","having","order","lock"];class f extends o{constructor(d,g,y){super(d,g,y);const{onConflict:C}=this.single;if(C)throw new Error(".onConflict() is not supported for oracledb.");this.first=this.select}insert(){let d=this.single.insert||[],{returning:g}=this.single;if(!Array.isArray(d)&&s(this.single.insert)&&(d=[this.single.insert]),g&&!Array.isArray(g)&&(g=[g]),Array.isArray(d)&&d.length===1&&r(d[0]))return this._addReturningToSqlAndConvert(`insert into ${this.tableName} (${this.formatter.wrap(this.single.returning)}) values (default)`,g,this.tableName);if(r(this.single.insert)&&typeof this.single.insert!="function")return"";const y=this._prepInsert(d),C={};if(u(y))return this._addReturningToSqlAndConvert(`insert into ${this.tableName} ${y}`,g);if(y.values.length===1)return this._addReturningToSqlAndConvert(`insert into ${this.tableName} (${this.formatter.columnize(y.columns)}) values (${this.client.parameterize(y.values[0],void 0,this.builder,this.bindingsHolder)})`,g,this.tableName);const x=y.columns.length===0;return C.sql="begin "+y.values.map(v=>{let b;const w=x?"":this.client.parameterize(v,this.client.valueForUndefined,this.builder,this.bindingsHolder),E=Array.isArray(g)?g:[g];let q=`insert into ${this.tableName} `;g&&(b=new l(E.join(":")),C.outParams=(C.outParams||[]).concat(b)),x?q+=`(${this.formatter.wrap(this.single.returning)}) values (default)`:q+=`(${this.formatter.columnize(y.columns)}) values (${w})`,q+=g?` returning ROWID into ${this.client.parameter(b,this.builder,this.bindingsHolder)}`:"",q=this.formatter.client.positionBindings(q);const A=w.replace("DEFAULT, ","").replace(", DEFAULT","");return`execute immediate '${q.replace(/'/g,"''")}`+(A||g?"' using ":"")+A+(A&&g?", ":"")+(g?"out ?":"")+";"}).join(" ")+"end;",g&&(C.returning=g,C.returningSql=`select ${this.formatter.columnize(g)} from `+this.tableName+" where ROWID in ("+C.outParams.map((v,b)=>`:${b+1}`).join(", ")+") order by case ROWID "+C.outParams.map((v,b)=>`when CHARTOROWID(:${b+1}) then ${b}`).join(" ")+" end"),C}update(){const d=this._prepUpdate(this.single.update),g=this.where();let{returning:y}=this.single;const C=`update ${this.tableName} set `+d.join(", ")+(g?` ${g}`:"");return y?(Array.isArray(y)||(y=[y]),this._addReturningToSqlAndConvert(C,y,this.tableName)):C}truncate(){return`truncate table ${this.tableName}`}forUpdate(){return"for update"}forShare(){return this.client.logger.warn("lock for share is not supported by oracle dialect"),""}columnInfo(){const d=this.single.columnInfo;return{sql:`select * from xmltable( '/ROWSET/ROW'
122
+ passing dbms_xmlgen.getXMLType('
123
+ select char_col_decl_length, column_name, data_type, data_default, nullable
124
+ from all_tab_columns where table_name = ''${this.client.customWrapIdentifier(this.single.table,n)}'' ')
125
+ columns
126
+ CHAR_COL_DECL_LENGTH number, COLUMN_NAME varchar2(200), DATA_TYPE varchar2(106),
127
+ DATA_DEFAULT clob, NULLABLE varchar2(1))`,output(C){const x=a(C,function(v,b){return v[b.COLUMN_NAME]={type:b.DATA_TYPE,defaultValue:b.DATA_DEFAULT,maxLength:b.CHAR_COL_DECL_LENGTH,nullable:b.NULLABLE==="Y"},v},{});return d&&x[d]||x}}}select(){let d=this.with();const g=h.map(y=>this[y]());return d+=e(g).join(" "),this._surroundQueryWithLimitAndOffset(d)}aggregate(d){return this._aggregate(d,{aliasSeparator:" "})}_addReturningToSqlAndConvert(d,g,y){const C={sql:d};if(!g)return C;const x=Array.isArray(g)?g:[g],v=new l(x.join(":"));return C.sql=d+" returning ROWID into "+this.client.parameter(v,this.builder,this.bindingsHolder),C.returningSql=`select ${this.formatter.columnize(g)} from ${y} where ROWID = :1`,C.outParams=[v],C.returning=g,C}_surroundQueryWithLimitAndOffset(d){let{limit:g}=this.single;const{offset:y}=this.single,C=g||g===0||g==="0";if(g=+g,!C&&!y)return d;if(d=d||"",C&&!y)return`select * from (${d}) where rownum <= ${this._getValueOrParameterFromAttribute("limit",g)}`;const x=+y+(C?g:1e13);return"select * from (select row_.*, ROWNUM rownum_ from ("+d+") row_ where rownum <= "+(this.single.skipBinding.offset?x:this.client.parameter(x,this.builder,this.bindingsHolder))+") where rownum_ > "+this._getValueOrParameterFromAttribute("offset",y)}}return rC=f,rC}var iC,QL;function uE(){if(QL)return iC;QL=1;const e=Us(),{promisify:n}=Qe,r=Qe;function s(u,h){this.columnName=u,this.value=h,this.returning=!1}s.prototype.toString=function(){return"[object BlobHelper:"+this.columnName+"]"};function a(u,h){return new Promise((f,p)=>{let d=h==="string"?"":Buffer.alloc(0);u.on("error",function(g){p(g)}),u.on("data",function(g){h==="string"?d+=g:d=Buffer.concat([d,g])}),u.on("end",function(){f(d)})})}const o=function(u){const h=Qe;let f;if(u.type)u.type===h.BLOB?f="buffer":u.type===h.CLOB&&(f="string");else if(u.iLob)u.iLob.type===h.CLOB?f="string":u.iLob.type===h.BLOB&&(f="buffer");else throw new Error("Unrecognized oracledb lob stream type");return f==="string"&&u.setEncoding("utf-8"),a(u,f)};function l(u,h){if(u.executeAsync)return;u.commitAsync=function(){return new Promise((p,d)=>{this.commit(function(g){if(g)return d(g);p()})})},u.rollbackAsync=function(){return new Promise((p,d)=>{this.rollback(function(g){if(g)return d(g);p()})})};const f=n(function(p,d,g,y){if(g=g||{},g.outFormat=h.driver.OUT_FORMAT_OBJECT||h.driver.OBJECT,!g.outFormat)throw new Error("not found oracledb.outFormat constants");g.resultSet?u.execute(p,d||[],g,function(C,x){if(C)return e.isConnectionError(C)&&(u.close().catch(function(E){}),u.__knex__disposed=C),y(C);const v={rows:[],resultSet:x.resultSet},b=100,w=function(E,q,A){q.getRows(A,function(R,O){if(R)e.isConnectionError(R)&&(E.close().catch(function(I){}),E.__knex__disposed=R),q.close(function(){return y(R)});else{if(O.length===0)return y(null,v);if(O.length>0)if(O.length===A)v.rows=v.rows.concat(O),w(E,q,A);else return v.rows=v.rows.concat(O),y(null,v)}})};w(u,x.resultSet,b)}):u.execute(p,d||[],g,function(C,x){return C?(e.isConnectionError(C)&&(u.close().catch(function(v){}),u.__knex__disposed=C),y(C)):y(null,x)})});u.executeAsync=function(p,d,g){return f(p,d,g).then(async y=>{const C=()=>y.resultSet?n(y.resultSet.close).call(y.resultSet):Promise.resolve(),x=[];if(y.rows&&Array.isArray(y.rows))for(let v=0;v<y.rows.length;v++){const b=y.rows[v];for(const w in b)b[w]instanceof r.Readable&&x.push({index:v,key:w,stream:b[w]})}try{for(const v of x)y.rows[v.index][v.key]=await o(v.stream)}catch(v){throw await C().catch(()=>{}),v}return await C(),y})}}return e.BlobHelper=s,e.monkeyPatchConnection=l,iC=e,iC}var sC,HL;function GY(){if(HL)return sC;HL=1;const e=gh(),n=Ws(),r=qn(),s=Wi(),a=FY(),o=uE().ReturningHelper,l=uE().BlobHelper,{isString:u}=mt(),{columnize:h}=Vt();class f extends a{insert(){const d=this,g=this._prepOutbindings(this.single.insert,this.single.returning),y=g.outBinding,C=g.returning,x=g.values;if(Array.isArray(x)&&x.length===1&&r(x[0])){const E=this.single.returning?" ("+this.formatter.wrap(this.single.returning)+")":"";return this._addReturningToSqlAndConvert("insert into "+this.tableName+E+" values (default)",y[0],this.tableName,C)}if(r(this.single.insert)&&typeof this.single.insert!="function")return"";const v=this._prepInsert(x),b={};if(u(v))return this._addReturningToSqlAndConvert("insert into "+this.tableName+" "+v,y[0],this.tableName,C);if(v.values.length===1)return this._addReturningToSqlAndConvert("insert into "+this.tableName+" ("+this.formatter.columnize(v.columns)+") values ("+this.client.parameterize(v.values[0],void 0,this.builder,this.bindingsHolder)+")",y[0],this.tableName,C);const w=v.columns.length===0;return b.returning=C,b.sql="begin "+v.values.map(function(E,q){const A=w?"":d.client.parameterize(E,d.client.valueForUndefined,d.builder,d.bindingsHolder);let R="insert into "+d.tableName;w?R+=" ("+d.formatter.wrap(d.single.returning)+") values (default)":R+=" ("+d.formatter.columnize(v.columns)+") values ("+A+")";let O="",I="",k="",N="";n(E,function(D){D instanceof l||(k+=" ?,")}),k=k.slice(0,-1),y[q].forEach(function(D){const z=D.columnName||D;if(O+=d.formatter.wrap(z)+",",I+=" ?,",N+=" out ?,",D instanceof l)return d.formatter.bindings.push(D);d.formatter.bindings.push(new o(z))}),O=O.slice(0,-1),I=I.slice(0,-1),N=N.slice(0,-1),O&&I&&(R+=" returning "+O+" into"+I),R=d.formatter.client.positionBindings(R);const j=A.replace(/DEFAULT, /g,"").replace(/, DEFAULT/g,"").replace("EMPTY_BLOB(), ","").replace(", EMPTY_BLOB()","");return"execute immediate '"+R.replace(/'/g,"''")+(j||E?"' using ":"")+j+(j&&N?",":"")+N+";"}).join(" ")+"end;",b.outBinding=y,C[0]==="*"&&(b.returningSql=function(){return"select * from "+d.tableName+" where ROWID in ("+this.outBinding.map(function(E,q){return":"+(q+1)}).join(", ")+") order by case ROWID "+this.outBinding.map(function(E,q){return"when CHARTOROWID(:"+(q+1)+") then "+q}).join(" ")+" end"}),b}with(){const d=[];if(this.grouped.with)for(const y of this.grouped.with)y.recursive&&(d.push(y),y.recursive=!1);const g=super.with();for(const y of d)y.recursive=!0;return g}_addReturningToSqlAndConvert(d,g,y,C){const x=this,v={sql:d};if(!g)return v;const b=Array.isArray(g)?g:[g];let w="",E="";return b.forEach(function(q){const A=q.columnName||q;if(w+=x.formatter.wrap(A)+",",E+="?,",q instanceof l)return x.formatter.bindings.push(q);x.formatter.bindings.push(new o(A))}),v.sql=d,w=w.slice(0,-1),E=E.slice(0,-1),w&&E&&(v.sql+=" returning "+w+" into "+E),v.outBinding=[g],C[0]==="*"&&(v.returningSql=function(){return"select * from "+x.tableName+" where ROWID = :1"}),v.returning=C,v}_prepOutbindings(d,g){const y={};let C=d||[],x=g||[];!Array.isArray(C)&&s(d)&&(C=[C]),x&&!Array.isArray(x)&&(x=[x]);const v=[];return n(C,function(b,w){x[0]==="*"?v[w]=["ROWID"]:v[w]=e(x),n(b,function(E,q){if(E instanceof Buffer){b[q]=new l(q,E);const A=v[w].indexOf(q);A>=0&&(v[w].splice(A,1),b[q].returning=!0),v[w].push(b[q])}E===void 0&&delete C[w][q]})}),y.returning=x,y.outBinding=v,y.values=C,y}_groupOrder(d,g){return super._groupOrderNulls(d,g)}update(){const d=this,g={},y=this._prepOutbindings(this.single.update||this.single.counter,this.single.returning),C=y.outBinding,x=y.returning,v=this._prepUpdate(this.single.update),b=this.where();let w="",E="";return r(v)&&typeof this.single.update!="function"?"":(C.forEach(function(q){q.forEach(function(A){const R=A.columnName||A;if(w+=d.formatter.wrap(R)+",",E+=" ?,",A instanceof l)return d.formatter.bindings.push(A);d.formatter.bindings.push(new o(R))})}),w=w.slice(0,-1),E=E.slice(0,-1),g.outBinding=C,g.returning=x,g.sql="update "+this.tableName+" set "+v.join(", ")+(b?" "+b:""),C.length&&!r(C[0])&&(g.sql+=" returning "+w+" into"+E),x[0]==="*"&&(g.returningSql=function(){let q="select * from "+d.tableName;const A=this.rowsAffected.length||this.rowsAffected;let R=" where ROWID in (",O=") order by case ROWID ";for(let I=0;I<A;I++)this.returning[0]==="*"&&(R+=":"+(I+1)+", ",O+="when CHARTOROWID(:"+(I+1)+") then "+I+" ");return this.returning[0]==="*"&&(this.returning=this.returning.slice(0,-1),R=R.slice(0,-2),O=O.slice(0,-1)),q+=R+O+" end"}),g)}_jsonPathWrap(d){return`'${d.path||d[1]}'`}jsonExtract(d){return this._jsonExtract(d.singleValue?"json_value":"json_query",d)}jsonSet(d){return`json_transform(${h(d.column,this.builder,this.client,this.bindingsHolder)}, set ${this.client.parameter(d.path,this.builder,this.bindingsHolder)} = ${this.client.parameter(d.value,this.builder,this.bindingsHolder)})`}jsonInsert(d){return`json_transform(${h(d.column,this.builder,this.client,this.bindingsHolder)}, insert ${this.client.parameter(d.path,this.builder,this.bindingsHolder)} = ${this.client.parameter(d.value,this.builder,this.bindingsHolder)})`}jsonRemove(d){const g=`json_transform(${h(d.column,this.builder,this.client,this.bindingsHolder)}, remove ${this.client.parameter(d.path,this.builder,this.bindingsHolder)})`;return d.alias?this.client.alias(g,this.formatter.wrap(d.alias)):g}whereJsonPath(d){return this._whereJsonPath("json_value",d)}whereJsonSupersetOf(d){throw new Error("Json superset where clause not actually supported by Oracle")}whereJsonSubsetOf(d){throw new Error("Json subset where clause not actually supported by Oracle")}onJsonPathEquals(d){return this._onJsonPathEquals("json_value",d)}}return sC=f,sC}var aC,VL;function KY(){if(VL)return aC;VL=1;const e=gP();class n extends e{constructor(s,a){super(s,a)}_setNullableState(s,a){const o=a?"NULL":"NOT NULL",l=`alter table ${this.tableName()} modify (${this.formatter.wrap(s)} ${o})`;return this.pushQuery({sql:l})}}return aC=n,aC}var oC,FL;function YY(){if(FL)return oC;FL=1;const e=mP(),{isObject:n}=mt();class r extends e{constructor(){super(...arguments),this.modifiers=["defaultTo","nullable","comment","checkJson"],this._addCheckModifiers()}datetime(a){let o;return n(a)?{useTz:o}=a:o=!a,o?"timestamp with local time zone":"timestamp"}timestamp(a){let o;return n(a)?{useTz:o}=a:o=!a,o?"timestamp with local time zone":"timestamp"}checkRegex(a,o){return this._check(`REGEXP_LIKE(${this.formatter.wrap(this.getColumnName())},${this.client._escapeBinding(a)})`,o)}json(){return this.columnBuilder._modifiers.checkJson=[this.formatter.columnize(this.getColumnName())],"varchar2(4000)"}jsonb(){return this.json()}checkJson(a){return`check (${a} is json)`}}return r.prototype.time="timestamp with local time zone",r.prototype.uuid=({useBinaryUuid:s=!1}={})=>s?"raw(16)":"char(36)",oC=r,oC}var uC,GL;function XY(){if(GL)return uC;GL=1;const e=Ro();class n extends e{constructor(s,a){super(s,a)}createOrReplace(){this.createQuery(this.columns,this.selectQuery,!1,!0)}createMaterializedView(){this.createQuery(this.columns,this.selectQuery,!0)}}return uC=n,uC}var lC,KL;function WY(){if(KL)return lC;KL=1;const e=Tl();class n extends e{constructor(){super(...arguments)}checkOption(){this._single.checkOption="default_option"}}return lC=n,lC}var cC,YL;function JY(){if(YL)return cC;YL=1;const e=Ji(),{timeout:n,KnexTimeoutError:r}=bo(),s=tr()("knex:tx");return cC=class extends e{begin(o){return this.isolationLevel&&this.client.logger.warn("Transaction isolation is not currently supported for Oracle"),Promise.resolve()}async commit(o,l){this._completed=!0;try{await o.commitAsync(),this._resolver(l)}catch(u){this._rejecter(u)}}release(o,l){return this._resolver(l)}rollback(o,l){return this._completed=!0,s("%s: rolling back",this.txid),n(o.rollbackAsync(),5e3).catch(u=>{if(!(u instanceof r))return Promise.reject(u);this._rejecter(u)}).then(()=>{if(l===void 0){if(this.doNotRejectOnRollback){this._resolver();return}l=new Error(`Transaction rejected with non-error: ${l}`)}this._rejecter(l)})}savepoint(o){return this.query(o,`SAVEPOINT ${this.txid}`)}async acquireConnection(o,l){const u=o&&o.connection,h=u||await this.client.acquireConnection();try{return h.__knexTxId=this.txid,h.isTransaction=!0,await l(h)}finally{s("%s: releasing connection",this.txid),h.isTransaction=!1;try{await h.commitAsync()}catch(f){this._rejecter(f)}finally{u?s("%s: not releasing external connection",this.txid):await this.client.releaseConnection(h)}}}},cC}var fC,XL;function ZY(){if(XL)return fC;XL=1;var e={};const n=Ws(),r=Ch(),s=qn(),a=ti(),o=Ah(),l=GY(),u=KY(),h=YY(),{BlobHelper:f,ReturningHelper:p,monkeyPatchConnection:d}=uE(),g=XY(),y=WY(),C=JY(),x=yP(),{isString:v}=mt(),{outputQuery:b,unwrapRaw:w}=Vt(),{compileCallback:E}=ea();class q extends x{constructor(I){super(I),this.version&&(this.version=A(this.version)),this.driver&&(e.UV_THREADPOOL_SIZE=e.UV_THREADPOOL_SIZE||1,e.UV_THREADPOOL_SIZE=parseInt(e.UV_THREADPOOL_SIZE)+this.driver.poolMax)}_driver(){const I=this,k=Qe;return I.fetchAsString=[],this.config.fetchAsString&&Array.isArray(this.config.fetchAsString)&&this.config.fetchAsString.forEach(function(N){v(N)&&(N=N.toUpperCase(),k[N]&&(N!=="NUMBER"&&N!=="DATE"&&N!=="CLOB"&&N!=="BUFFER"&&this.logger.warn('Only "date", "number", "clob" and "buffer" are supported for fetchAsString'),I.fetchAsString.push(k[N])))}),k}queryCompiler(I,k){return new l(this,I,k)}tableCompiler(){return new u(this,...arguments)}columnCompiler(){return new h(this,...arguments)}viewBuilder(){return new y(this,...arguments)}viewCompiler(){return new g(this,...arguments)}formatter(I){return new o(this,I)}transaction(){return new C(this,...arguments)}prepBindings(I){return a(I,k=>k instanceof f&&this.driver?{type:this.driver.BLOB,dir:this.driver.BIND_OUT}:k instanceof p&&this.driver?{type:this.driver.STRING,dir:this.driver.BIND_OUT}:typeof k=="boolean"?k?1:0:k)}parameter(I,k,N){return typeof I=="function"?b(E(I,void 0,this,N),!0,k,this):I instanceof f?(N.bindings.push(I.value),"?"):w(I,!0,k,this,N)||"?"}acquireRawConnection(){return new Promise((I,k)=>{const N=this.connectionSettings.externalAuth?{externalAuth:this.connectionSettings.externalAuth}:{user:this.connectionSettings.user,password:this.connectionSettings.password};N.connectString=R(this.connectionSettings),this.connectionSettings.prefetchRowCount&&(N.prefetchRows=this.connectionSettings.prefetchRowCount),this.connectionSettings.stmtCacheSize!==void 0&&(N.stmtCacheSize=this.connectionSettings.stmtCacheSize),this.driver.fetchAsString=this.fetchAsString,this.driver.getConnection(N,(j,D)=>{if(j)return k(j);d(D,this),I(D)})})}destroyRawConnection(I){return I.release()}async acquireConnection(){const I=await super.acquireConnection();return this.checkVersion(I),I}checkVersion(I){if(this.version)return this.version;const k=A(I.oracleServerVersionString);if(!k)throw new Error(this.version===null?"Invalid Oracledb version number format passed to knex. Unable to successfully auto-detect as fallback. Please specify a valid oracledb version.":"Unable to detect Oracledb version number automatically. Please specify the version in knex configuration.");return this.version=k,k}_query(I,k){if(!k.sql)throw new Error("The query is empty");const N=Object.assign({},k.options,{autoCommit:!1});return k.method==="select"&&(N.resultSet=!0),I.executeAsync(k.sql,k.bindings,N).then(async function(j){let D=r(j.outBinds);if(k.response=j.rows||[],k.rowsAffected=j.rows?j.rows.rowsAffected:j.rowsAffected,k.method==="raw"&&D.length>0)return{response:D};if(k.method==="update"){const M=k.rowsAffected.length||k.rowsAffected,$=[],P=[],H=G=>function(V,B){const K=B*M;P.push(D[G+K])};for(let G=0;G<M;G++)$.push(k.outBinding[0]),n(k.outBinding[0],H(G));D=P,k.outBinding=$}if(!k.returning&&D.length===0)return I.isTransaction||await I.commitAsync(),k;const z=[];let T=0;for(let M=0;M<k.outBinding.length;M++){const $=k.outBinding[M];T=T+(k.outBinding[M-1]?k.outBinding[M-1].length:0);for(let P=0;P<$.length;P++){const H=$[P];await new Promise(function(G,V){if(H instanceof f){const B=D[P+T];H.returning&&(k.response[M]=k.response[M]||{},k.response[M][H.columnName]=H.value),B.on("error",function(K){V(K)}),B.on("finish",function(){G()}),B.write(H.value),B.end()}else k.outBinding[M][P]==="ROWID"?(z.push(D[P+T]),G()):(k.response[M]=k.response[M]||{},k.response[M][H]=D[P+T],G())})}}if(k.returningSql){const M=await I.executeAsync(k.returningSql(),z,{resultSet:!0});k.response=M.rows}return I.isTransaction||await I.commitAsync(),k})}processResponse(I,k){const{response:N}=I;if(I.output)return I.output.call(k,N);switch(I.method){case"select":return N;case"first":return N[0];case"pluck":return a(N,I.pluck);case"insert":case"del":case"update":case"counter":return I.returning&&!s(I.returning)||I.returningSql?N:I.rowsAffected!==void 0?I.rowsAffected:1;default:return N}}processPassedConnection(I){this.checkVersion(I),d(I,this)}}q.prototype.driverName="oracledb";function A(O){try{const I=O.split(".").slice(0,2);I.forEach((N,j)=>{I[j]=N.replace(/\D$/,"")});const k=I.join(".");return k.match(/^\d+\.?\d*$/)?k:null}catch{return null}}function R(O){return O.connectString?O.connectString:O.port?O.host+":"+O.port+"/"+O.database:O.host+"/"+O.database}return fC=q,fC}var hC,WL;function eX(){if(WL)return hC;WL=1;const e=Nh();class n extends e{constructor(...s){super(...s),this.driverName="pgnative",this.canCancelQuery=!0}_driver(){return Qe.native}_stream(s,a,o,l){if(!a.sql)throw new Error("The query is empty");const u=this;return new Promise((h,f)=>(o.on("error",f),o.on("end",h),u._query(s,a).then(p=>p.response).then(({rows:p})=>p.forEach(d=>o.write(d))).catch(function(p){o.emit("error",p)}).then(function(){o.end()})))}async cancelQuery(s){try{return await this._wrappedCancelQueryCall(null,s)}catch(a){throw this.logger.warn(`Connection Error: ${a}`),a}}_wrappedCancelQueryCall(s,a){return new Promise(function(o,l){a.native.cancel(function(u){if(u){l(u);return}o(!0)})})}}return hC=n,hC}var dC,JL;function tX(){if(JL)return dC;JL=1;const e=Ji();return dC=class extends e{begin(r){const s=[this.isolationLevel?`ISOLATION LEVEL ${this.isolationLevel}`:"",this.readOnly?"READ ONLY":""].join(" ").trim();return s.length===0?this.query(r,"BEGIN;"):this.query(r,`BEGIN ${s};`)}savepoint(r){return this.trxClient.logger("Redshift does not support savepoints."),Promise.resolve()}release(r,s){return this.trxClient.logger("Redshift does not support savepoints."),Promise.resolve()}rollbackTo(r,s){return this.trxClient.logger("Redshift does not support savepoints."),Promise.resolve()}},dC}var pC,ZL;function nX(){if(ZL)return pC;ZL=1;const e=ta(),n=mx(),r=tn(),{columnize:s}=Vt();class a extends n{truncate(){return`truncate ${this.tableName.toLowerCase()}`}insert(){const l=e.prototype.insert.apply(this,arguments);return l===""?l:(this._slightReturn(),{sql:l})}update(){const l=e.prototype.update.apply(this,arguments);return this._slightReturn(),{sql:l}}del(){const l=e.prototype.del.apply(this,arguments);return this._slightReturn(),{sql:l}}_slightReturn(){this.single.isReturning&&this.client.logger.warn("insert/update/delete returning is not supported by redshift dialect")}forUpdate(){return this.client.logger.warn("table lock is not supported by redshift dialect"),""}forShare(){return this.client.logger.warn("lock for share is not supported by redshift dialect"),""}forNoKeyUpdate(){return this.client.logger.warn("table lock is not supported by redshift dialect"),""}forKeyShare(){return this.client.logger.warn("lock for share is not supported by redshift dialect"),""}columnInfo(){const l=this.single.columnInfo;let u=this.single.schema;const h=this.client.customWrapIdentifier(this.single.table,r);u&&(u=this.client.customWrapIdentifier(u,r));const f="select * from information_schema.columns where table_name = ? and table_catalog = ?",p=[h.toLowerCase(),this.client.database().toLowerCase()];return this._buildColumnInfoQuery(u,f,p,l)}jsonExtract(l){let u;return Array.isArray(l.column)?u=l.column:u=[l],u.map(h=>{const f=`json_extract_path_text(${s(h.column||h[0],this.builder,this.client,this.bindingsHolder)}, ${this.client.toPathForJson(l.path||h[1],this.builder,this.bindingsHolder)})`,p=h.alias||h[2];return p?this.client.alias(f,this.formatter.wrap(p)):f}).join(", ")}jsonSet(l){throw new Error("Json set is not supported by Redshift")}jsonInsert(l){throw new Error("Json insert is not supported by Redshift")}jsonRemove(l){throw new Error("Json remove is not supported by Redshift")}whereJsonPath(l){return this._whereJsonPath("json_extract_path_text",Object.assign({},l,{path:this.client.toPathForJson(l.path)}))}whereJsonSupersetOf(l){throw new Error("Json superset is not supported by Redshift")}whereJsonSubsetOf(l){throw new Error("Json subset is not supported by Redshift")}onJsonPathEquals(l){return this._onJsonPathEquals("json_extract_path_text",l)}}return pC=a,pC}var mC,eI;function rX(){if(eI)return mC;eI=1;const e=qh();class n extends e{constructor(){super(...arguments)}primary(){return this.notNullable(),super.primary(...arguments)}index(){return this.client.logger.warn("Redshift does not support the creation of indexes."),this}}return mC=n,mC}var gC,tI;function iX(){if(tI)return gC;tI=1;const e=gx(),n=na();class r extends e{constructor(){super(...arguments)}bit(a){return a.length!==!1?`char(${a.length})`:"char(1)"}datetime(a){return a?"timestamp":"timestamptz"}timestamp(a){return a?"timestamp":"timestamptz"}comment(a){this.pushAdditional(function(){this.pushQuery(`comment on column ${this.tableCompiler.tableName()}.`+this.formatter.wrap(this.args[0])+" is "+(a?`'${a}'`:"NULL"))},a)}}return r.prototype.increments=({primaryKey:s=!0}={})=>"integer identity(1,1)"+(s?" primary key":"")+" not null",r.prototype.bigincrements=({primaryKey:s=!0}={})=>"bigint identity(1,1)"+(s?" primary key":"")+" not null",r.prototype.binary="varchar(max)",r.prototype.blob="varchar(max)",r.prototype.enu="varchar(255)",r.prototype.enum="varchar(255)",r.prototype.json="varchar(max)",r.prototype.jsonb="varchar(max)",r.prototype.longblob="varchar(max)",r.prototype.mediumblob="varchar(16777218)",r.prototype.set="text",r.prototype.text="varchar(max)",r.prototype.tinyblob="varchar(256)",r.prototype.uuid=n.prototype.uuid,r.prototype.varbinary="varchar(max)",r.prototype.bigint="bigint",r.prototype.bool="boolean",r.prototype.double="double precision",r.prototype.floating="real",r.prototype.smallint="smallint",r.prototype.tinyint="smallint",gC=r,gC}var yC,nI;function sX(){if(nI)return yC;nI=1;const e=So(),n=yx();class r extends n{constructor(){super(...arguments)}index(a,o,l){this.client.logger.warn("Redshift does not support the creation of indexes.")}dropIndex(a,o){this.client.logger.warn("Redshift does not support the deletion of indexes.")}createQuery(a,o,l){const u=o?"create table if not exists ":"create table ",h=" ("+a.sql.join(", ")+this._addChecks()+")";let f=u+this.tableName()+(l&&this.tableNameLike()?" (like "+this.tableNameLike()+")":h);this.single.inherits&&(f+=` like (${this.formatter.wrap(this.single.inherits)})`),this.pushQuery({sql:f,bindings:a.bindings}),e(this.single,"comment")&&this.comment(this.single.comment),l&&this.addColumns(a,this.addColumnsPrefix)}primary(a,o){const l=this;o=o?l.formatter.wrap(o):l.formatter.wrap(`${this.tableNameRaw}_pkey`),a.constructor!==Array&&(a=[a]);const u=l.grouped.columns;if(u)for(let h=0;h<a.length;h++){let f=u.find(d=>d.grouping==="columns"&&d.builder&&d.builder._method==="add"&&d.builder._args&&d.builder._args.indexOf(a[h])>-1);if(f&&(f=f.builder),!(f&&f._modifiers&&f._modifiers.nullable&&f._modifiers.nullable[0]===!1))return f?this.client.logger.warn("Redshift does not allow primary keys to contain nullable columns."):this.client.logger.warn("Redshift does not allow primary keys to contain nonexistent columns.")}return l.pushQuery(`alter table ${l.tableName()} add constraint ${o} primary key (${l.formatter.columnize(a)})`)}addColumns(a,o,l){if(o===this.alterColumnsPrefix)super.addColumns(a,o,l);else{o=o||this.addColumnsPrefix,l=l||this.getColumns();for(const u of l){const h=this.tableName(),f=u.compileColumn();this.pushQuery({sql:`alter table ${h} ${o}${f}`,bindings:[]})}}}}return yC=r,yC}var vC,rI;function aX(){if(rI)return vC;rI=1;const e=dP();class n extends e{constructor(){super(...arguments)}}return vC=n,vC}var bC,iI;function oX(){if(iI)return bC;iI=1;const e=vx();class n extends e{constructor(s,a){super(s,a)}}return bC=n,bC}var _C,sI;function uX(){if(sI)return _C;sI=1;const e=Nh(),n=ti(),r=tX(),s=nX(),a=rX(),o=iX(),l=sX(),u=aX(),h=oX();class f extends e{transaction(){return new r(this,...arguments)}queryCompiler(d,g){return new s(this,d,g)}columnBuilder(){return new a(this,...arguments)}columnCompiler(){return new o(this,...arguments)}tableCompiler(){return new l(this,...arguments)}schemaCompiler(){return new u(this,...arguments)}viewCompiler(){return new h(this,...arguments)}_driver(){return Qe}processResponse(d,g){const y=d.response;return d.output?d.output.call(g,y):d.method==="raw"?y:y.command==="SELECT"?d.method==="first"?y.rows[0]:d.method==="pluck"?n(y.rows,d.pluck):y.rows:y.command==="INSERT"||y.command==="UPDATE"||y.command==="DELETE"?y.rowCount:y}toPathForJson(d,g,y){return d.replace(/^(\$\.)/,"").split(".").map((function(C){return this.parameter(C,g,y)}).bind(this)).join(", ")}}return Object.assign(f.prototype,{dialect:"redshift",driverName:"pg-redshift"}),_C=f,_C}var aI;function lX(){if(aI)return Ru;aI=1,Object.defineProperty(Ru,"__esModule",{value:!0}),Ru.getDialectByNameOrAlias=void 0;const{resolveClientNameWithAliases:e}=Qt(),n=Object.freeze({"better-sqlite3":()=>hY(),cockroachdb:()=>_Y(),mssql:()=>NY(),mysql:()=>pP(),mysql2:()=>zY(),oracle:()=>yP(),oracledb:()=>ZY(),pgnative:()=>eX(),postgres:()=>Nh(),redshift:()=>uX(),sqlite3:()=>fP()});function r(s){const a=e(s),o=n[a];if(!o)throw new Error(`Invalid clientName given: ${s}`);return o()}return Ru.getDialectByNameOrAlias=r,Ru}var wC,oI;function cX(){if(oI)return wC;oI=1;const e=ra(),{SUPPORTED_CLIENTS:n}=cx(),r=YK(),{getDialectByNameOrAlias:s}=lX();function a(o){let l,u;const h=typeof o=="string"?Object.assign(r(o),arguments[2]):o;if(arguments.length===0||!h.client&&!h.dialect)l=e;else if(typeof h.client=="function")l=h.client;else{const f=h.client||h.dialect;if(!n.includes(f))throw new Error(`knex: Unknown configuration option 'client' value ${f}. Note that it is case-sensitive, check documentation for supported values.`);l=s(f)}return typeof h.connection=="string"?u=Object.assign({},h,{connection:r(h.connection).connection}):u=Object.assign({},h),{resolvedConfig:u,Dialect:l}}return wC={resolveConfig:a},wC}var CC,uI;function fX(){if(uI)return CC;uI=1;const e=ra(),n=ni(),r=nP(),s=iP(),{KnexTimeoutError:a}=bo(),{resolveConfig:o}=cX(),l=lP(),u=Tl(),h=qh(),f=cP();function p(d){const{resolvedConfig:g,Dialect:y}=o(...arguments),C=s(new y(g));return g.userParams&&(C.userParams=g.userParams),C}return p.Client=e,p.KnexTimeoutError=a,p.QueryBuilder={extend:function(d,g){n.extend(d,g),r.push(d)}},p.SchemaBuilder={extend:function(d,g){l.extend(d,g)}},p.ViewBuilder={extend:function(d,g){u.extend(d,g)}},p.ColumnBuilder={extend:function(d,g){h.extend(d,g)}},p.TableBuilder={extend:function(d,g){f.extend(d,g)}},CC=p,CC}var EC,lI;function hX(){return lI||(lI=1,EC=fX()),EC}hX();function cI(e){return e.schema?`${e.schema}.${e.name}`:e.name}function fI(e,n){return`${e}:${n}`}function dX(e,n){const r=[],s=new Map;for(const f of e)s.set(cI(f),f);const a=new Map;for(const f of n)a.set(cI(f),f);for(const[f,p]of s)a.has(f)||r.push({type:"table-removed",table:p.name,schema:p.schema});for(const[f,p]of a)s.has(f)||r.push({type:"table-added",table:p.name,schema:p.schema});for(const[f,p]of s){const d=a.get(f);if(!d)continue;const g=new Map(p.columns.map(v=>[v.name,v])),y=new Map(d.columns.map(v=>[v.name,v]));for(const[v,b]of g){const w=y.get(v);if(!w){r.push({type:"column-removed",table:p.name,schema:p.schema,column:v,dataType:b.dataType});continue}b.dataType!==w.dataType&&r.push({type:"column-type-changed",table:p.name,schema:p.schema,column:v,oldType:b.dataType,newType:w.dataType}),b.nullable!==w.nullable&&r.push({type:"column-nullability-changed",table:p.name,schema:p.schema,column:v,nullable:w.nullable})}for(const[v,b]of y)g.has(v)||r.push({type:"column-added",table:p.name,schema:p.schema,column:v,dataType:b.dataType});const C=new Map(p.foreignKeys.map(v=>[fI(p.name,v.constraintName),v])),x=new Map(d.foreignKeys.map(v=>[fI(d.name,v.constraintName),v]));for(const[v,b]of C)x.has(v)||r.push({type:"fk-removed",table:p.name,schema:p.schema,constraintName:b.constraintName,columnName:b.columnName,referencedTable:b.referencedTable});for(const[v,b]of x)C.has(v)||r.push({type:"fk-added",table:d.name,schema:d.schema,constraintName:b.constraintName,columnName:b.columnName,referencedTable:b.referencedTable})}const o=r.filter(f=>f.type==="table-added").map(f=>f.table),l=r.filter(f=>f.type==="table-removed").map(f=>f.table),u=r.filter(f=>f.type==="column-added").length,h=r.filter(f=>f.type==="column-type-changed"||f.type==="column-nullability-changed").length;return{changes:r,hasChanges:r.length>0,tablesAdded:o,tablesRemoved:l,columnsAdded:u,columnsModified:h}}function pX(){const e=qe(d=>d.connectionId),n=qe(d=>d.crawlResult),r=qe(d=>d.pollingEnabled),s=qe(d=>d.schemaBaseline),a=qe(d=>d.setSchemaDiff),o=(n==null?void 0:n.startTable)??"",l=(n==null?void 0:n.startSchema)??null,u=(n==null?void 0:n.depth)??1,h=!!(e&&n&&r&&s),f=Xn.schema.crawlFrom.useQuery({connectionId:e??"",tableName:o,schema:l,maxDepth:u},{enabled:h,refetchInterval:h?3e4:!1,refetchOnWindowFocus:!1}),p=re.useRef(f.data);re.useEffect(()=>{if(!f.data||f.data===p.current)return;p.current=f.data;const d=qe.getState().schemaBaseline;if(!d)return;const g=dX(d,f.data.tables);g.hasChanges&&a(g)},[f.data,a])}function mX(){const e=qe(s=>s.connectionId),n=qe(s=>s.crawlResult),r=qe(s=>s.setSchemaBaseline);return re.useEffect(()=>{n!=null&&n.tables&&r(n.tables)},[n,r]),pX(),e?n?F.jsxs("div",{className:"app-exploring",children:[F.jsxs("aside",{className:"sidebar",children:[F.jsx("h2",{children:"SchemaLens"}),F.jsx(jq,{}),F.jsx(hK,{}),F.jsx(fK,{})]}),F.jsx("main",{className:"canvas-main",children:F.jsx(cK,{})})]}):F.jsxs("div",{className:"app-centered",children:[F.jsx("h1",{children:"SchemaLens"}),F.jsx(jq,{})]}):F.jsxs("div",{className:"app-centered",children:[F.jsx("h1",{children:"SchemaLens"}),F.jsx("p",{children:"Living architecture diagrams from your database schema."}),F.jsx(FQ,{})]})}function gX(){return F.jsx(Xn.Provider,{client:zQ,queryClient:Rq,children:F.jsx(oU,{client:Rq,children:F.jsx(mX,{})})})}$z.createRoot(document.getElementById("root")).render(F.jsx(re.StrictMode,{children:F.jsx(gX,{})}));