@api-doc-tor/express 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
var xy=Object.defineProperty;var wy=(t,r,i)=>r in t?xy(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i;var ya=(t,r,i)=>wy(t,typeof r!="symbol"?r+"":r,i);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();var by=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _u(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Zc={exports:{}},va={},ef={exports:{}},dt={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its 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 Gp;function _y(){if(Gp)return dt;Gp=1;var t=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),d=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),x=Symbol.iterator;function _(A){return A===null||typeof A!="object"?null:(A=x&&A[x]||A["@@iterator"],typeof A=="function"?A:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,M={};function T(A,U,de){this.props=A,this.context=U,this.refs=M,this.updater=de||C}T.prototype.isReactComponent={},T.prototype.setState=function(A,U){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,U,"setState")},T.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function P(){}P.prototype=T.prototype;function F(A,U,de){this.props=A,this.context=U,this.refs=M,this.updater=de||C}var $=F.prototype=new P;$.constructor=F,j($,T.prototype),$.isPureReactComponent=!0;var R=Array.isArray,V=Object.prototype.hasOwnProperty,K={current:null},W={key:!0,ref:!0,__self:!0,__source:!0};function Q(A,U,de){var _e,Te={},Oe=null,Re=null;if(U!=null)for(_e in U.ref!==void 0&&(Re=U.ref),U.key!==void 0&&(Oe=""+U.key),U)V.call(U,_e)&&!W.hasOwnProperty(_e)&&(Te[_e]=U[_e]);var Se=arguments.length-2;if(Se===1)Te.children=de;else if(1<Se){for(var De=Array(Se),Ne=0;Ne<Se;Ne++)De[Ne]=arguments[Ne+2];Te.children=De}if(A&&A.defaultProps)for(_e in Se=A.defaultProps,Se)Te[_e]===void 0&&(Te[_e]=Se[_e]);return{$$typeof:t,type:A,key:Oe,ref:Re,props:Te,_owner:K.current}}function pe(A,U){return{$$typeof:t,type:A.type,key:U,ref:A.ref,props:A.props,_owner:A._owner}}function ke(A){return typeof A=="object"&&A!==null&&A.$$typeof===t}function X(A){var U={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(de){return U[de]})}var ue=/\/+/g;function ve(A,U){return typeof A=="object"&&A!==null&&A.key!=null?X(""+A.key):U.toString(36)}function D(A,U,de,_e,Te){var Oe=typeof A;(Oe==="undefined"||Oe==="boolean")&&(A=null);var Re=!1;if(A===null)Re=!0;else switch(Oe){case"string":case"number":Re=!0;break;case"object":switch(A.$$typeof){case t:case r:Re=!0}}if(Re)return Re=A,Te=Te(Re),A=_e===""?"."+ve(Re,0):_e,R(Te)?(de="",A!=null&&(de=A.replace(ue,"$&/")+"/"),D(Te,U,de,"",function(Ne){return Ne})):Te!=null&&(ke(Te)&&(Te=pe(Te,de+(!Te.key||Re&&Re.key===Te.key?"":(""+Te.key).replace(ue,"$&/")+"/")+A)),U.push(Te)),1;if(Re=0,_e=_e===""?".":_e+":",R(A))for(var Se=0;Se<A.length;Se++){Oe=A[Se];var De=_e+ve(Oe,Se);Re+=D(Oe,U,de,De,Te)}else if(De=_(A),typeof De=="function")for(A=De.call(A),Se=0;!(Oe=A.next()).done;)Oe=Oe.value,De=_e+ve(Oe,Se++),Re+=D(Oe,U,de,De,Te);else if(Oe==="object")throw U=String(A),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.");return Re}function fe(A,U,de){if(A==null)return A;var _e=[],Te=0;return D(A,_e,"","",function(Oe){return U.call(de,Oe,Te++)}),_e}function J(A){if(A._status===-1){var U=A._result;U=U(),U.then(function(de){(A._status===0||A._status===-1)&&(A._status=1,A._result=de)},function(de){(A._status===0||A._status===-1)&&(A._status=2,A._result=de)}),A._status===-1&&(A._status=0,A._result=U)}if(A._status===1)return A._result.default;throw A._result}var ae={current:null},B={transition:null},q={ReactCurrentDispatcher:ae,ReactCurrentBatchConfig:B,ReactCurrentOwner:K};function Z(){throw Error("act(...) is not supported in production builds of React.")}return dt.Children={map:fe,forEach:function(A,U,de){fe(A,function(){U.apply(this,arguments)},de)},count:function(A){var U=0;return fe(A,function(){U++}),U},toArray:function(A){return fe(A,function(U){return U})||[]},only:function(A){if(!ke(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},dt.Component=T,dt.Fragment=i,dt.Profiler=l,dt.PureComponent=F,dt.StrictMode=s,dt.Suspense=v,dt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q,dt.act=Z,dt.cloneElement=function(A,U,de){if(A==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+A+".");var _e=j({},A.props),Te=A.key,Oe=A.ref,Re=A._owner;if(U!=null){if(U.ref!==void 0&&(Oe=U.ref,Re=K.current),U.key!==void 0&&(Te=""+U.key),A.type&&A.type.defaultProps)var Se=A.type.defaultProps;for(De in U)V.call(U,De)&&!W.hasOwnProperty(De)&&(_e[De]=U[De]===void 0&&Se!==void 0?Se[De]:U[De])}var De=arguments.length-2;if(De===1)_e.children=de;else if(1<De){Se=Array(De);for(var Ne=0;Ne<De;Ne++)Se[Ne]=arguments[Ne+2];_e.children=Se}return{$$typeof:t,type:A.type,key:Te,ref:Oe,props:_e,_owner:Re}},dt.createContext=function(A){return A={$$typeof:d,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},A.Provider={$$typeof:c,_context:A},A.Consumer=A},dt.createElement=Q,dt.createFactory=function(A){var U=Q.bind(null,A);return U.type=A,U},dt.createRef=function(){return{current:null}},dt.forwardRef=function(A){return{$$typeof:h,render:A}},dt.isValidElement=ke,dt.lazy=function(A){return{$$typeof:S,_payload:{_status:-1,_result:A},_init:J}},dt.memo=function(A,U){return{$$typeof:b,type:A,compare:U===void 0?null:U}},dt.startTransition=function(A){var U=B.transition;B.transition={};try{A()}finally{B.transition=U}},dt.unstable_act=Z,dt.useCallback=function(A,U){return ae.current.useCallback(A,U)},dt.useContext=function(A){return ae.current.useContext(A)},dt.useDebugValue=function(){},dt.useDeferredValue=function(A){return ae.current.useDeferredValue(A)},dt.useEffect=function(A,U){return ae.current.useEffect(A,U)},dt.useId=function(){return ae.current.useId()},dt.useImperativeHandle=function(A,U,de){return ae.current.useImperativeHandle(A,U,de)},dt.useInsertionEffect=function(A,U){return ae.current.useInsertionEffect(A,U)},dt.useLayoutEffect=function(A,U){return ae.current.useLayoutEffect(A,U)},dt.useMemo=function(A,U){return ae.current.useMemo(A,U)},dt.useReducer=function(A,U,de){return ae.current.useReducer(A,U,de)},dt.useRef=function(A){return ae.current.useRef(A)},dt.useState=function(A){return ae.current.useState(A)},dt.useSyncExternalStore=function(A,U,de){return ae.current.useSyncExternalStore(A,U,de)},dt.useTransition=function(){return ae.current.useTransition()},dt.version="18.3.1",dt}var Jp;function Oa(){return Jp||(Jp=1,ef.exports=_y()),ef.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its 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 Zp;function Sy(){if(Zp)return va;Zp=1;var t=Oa(),r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,l=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function d(h,v,b){var S,x={},_=null,C=null;b!==void 0&&(_=""+b),v.key!==void 0&&(_=""+v.key),v.ref!==void 0&&(C=v.ref);for(S in v)s.call(v,S)&&!c.hasOwnProperty(S)&&(x[S]=v[S]);if(h&&h.defaultProps)for(S in v=h.defaultProps,v)x[S]===void 0&&(x[S]=v[S]);return{$$typeof:r,type:h,key:_,ref:C,props:x,_owner:l.current}}return va.Fragment=i,va.jsx=d,va.jsxs=d,va}var eh;function ky(){return eh||(eh=1,Zc.exports=Sy()),Zc.exports}var g=ky(),H=Oa();const Sm=_u(H);var Kl={},tf={exports:{}},Jn={},nf={exports:{}},rf={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its 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 th;function Ny(){return th||(th=1,(function(t){function r(B,q){var Z=B.length;B.push(q);e:for(;0<Z;){var A=Z-1>>>1,U=B[A];if(0<l(U,q))B[A]=q,B[Z]=U,Z=A;else break e}}function i(B){return B.length===0?null:B[0]}function s(B){if(B.length===0)return null;var q=B[0],Z=B.pop();if(Z!==q){B[0]=Z;e:for(var A=0,U=B.length,de=U>>>1;A<de;){var _e=2*(A+1)-1,Te=B[_e],Oe=_e+1,Re=B[Oe];if(0>l(Te,Z))Oe<U&&0>l(Re,Te)?(B[A]=Re,B[Oe]=Z,A=Oe):(B[A]=Te,B[_e]=Z,A=_e);else if(Oe<U&&0>l(Re,Z))B[A]=Re,B[Oe]=Z,A=Oe;else break e}}return q}function l(B,q){var Z=B.sortIndex-q.sortIndex;return Z!==0?Z:B.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var d=Date,h=d.now();t.unstable_now=function(){return d.now()-h}}var v=[],b=[],S=1,x=null,_=3,C=!1,j=!1,M=!1,T=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,F=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function $(B){for(var q=i(b);q!==null;){if(q.callback===null)s(b);else if(q.startTime<=B)s(b),q.sortIndex=q.expirationTime,r(v,q);else break;q=i(b)}}function R(B){if(M=!1,$(B),!j)if(i(v)!==null)j=!0,J(V);else{var q=i(b);q!==null&&ae(R,q.startTime-B)}}function V(B,q){j=!1,M&&(M=!1,P(Q),Q=-1),C=!0;var Z=_;try{for($(q),x=i(v);x!==null&&(!(x.expirationTime>q)||B&&!X());){var A=x.callback;if(typeof A=="function"){x.callback=null,_=x.priorityLevel;var U=A(x.expirationTime<=q);q=t.unstable_now(),typeof U=="function"?x.callback=U:x===i(v)&&s(v),$(q)}else s(v);x=i(v)}if(x!==null)var de=!0;else{var _e=i(b);_e!==null&&ae(R,_e.startTime-q),de=!1}return de}finally{x=null,_=Z,C=!1}}var K=!1,W=null,Q=-1,pe=5,ke=-1;function X(){return!(t.unstable_now()-ke<pe)}function ue(){if(W!==null){var B=t.unstable_now();ke=B;var q=!0;try{q=W(!0,B)}finally{q?ve():(K=!1,W=null)}}else K=!1}var ve;if(typeof F=="function")ve=function(){F(ue)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,fe=D.port2;D.port1.onmessage=ue,ve=function(){fe.postMessage(null)}}else ve=function(){T(ue,0)};function J(B){W=B,K||(K=!0,ve())}function ae(B,q){Q=T(function(){B(t.unstable_now())},q)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(B){B.callback=null},t.unstable_continueExecution=function(){j||C||(j=!0,J(V))},t.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):pe=0<B?Math.floor(1e3/B):5},t.unstable_getCurrentPriorityLevel=function(){return _},t.unstable_getFirstCallbackNode=function(){return i(v)},t.unstable_next=function(B){switch(_){case 1:case 2:case 3:var q=3;break;default:q=_}var Z=_;_=q;try{return B()}finally{_=Z}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(B,q){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var Z=_;_=B;try{return q()}finally{_=Z}},t.unstable_scheduleCallback=function(B,q,Z){var A=t.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?A+Z:A):Z=A,B){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=Z+U,B={id:S++,callback:q,priorityLevel:B,startTime:Z,expirationTime:U,sortIndex:-1},Z>A?(B.sortIndex=Z,r(b,B),i(v)===null&&B===i(b)&&(M?(P(Q),Q=-1):M=!0,ae(R,Z-A))):(B.sortIndex=U,r(v,B),j||C||(j=!0,J(V))),B},t.unstable_shouldYield=X,t.unstable_wrapCallback=function(B){var q=_;return function(){var Z=_;_=q;try{return B.apply(this,arguments)}finally{_=Z}}}})(rf)),rf}var nh;function Ey(){return nh||(nh=1,nf.exports=Ny()),nf.exports}/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its 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 rh;function Cy(){if(rh)return Jn;rh=1;var t=Oa(),r=Ey();function i(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=1;o<arguments.length;o++)n+="&args[]="+encodeURIComponent(arguments[o]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,l={};function c(e,n){d(e,n),d(e+"Capture",n)}function d(e,n){for(l[e]=n,e=0;e<n.length;e++)s.add(n[e])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),v=Object.prototype.hasOwnProperty,b=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,S={},x={};function _(e){return v.call(x,e)?!0:v.call(S,e)?!1:b.test(e)?x[e]=!0:(S[e]=!0,!1)}function C(e,n,o,u){if(o!==null&&o.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return u?!1:o!==null?!o.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function j(e,n,o,u){if(n===null||typeof n>"u"||C(e,n,o,u))return!0;if(u)return!1;if(o!==null)switch(o.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function M(e,n,o,u,p,y,E){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=u,this.attributeNamespace=p,this.mustUseProperty=o,this.propertyName=e,this.type=n,this.sanitizeURL=y,this.removeEmptyString=E}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){T[e]=new M(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];T[n]=new M(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){T[e]=new M(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){T[e]=new M(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){T[e]=new M(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){T[e]=new M(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){T[e]=new M(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){T[e]=new M(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){T[e]=new M(e,5,!1,e.toLowerCase(),null,!1,!1)});var P=/[\-:]([a-z])/g;function F(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(P,F);T[n]=new M(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(P,F);T[n]=new M(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(P,F);T[n]=new M(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){T[e]=new M(e,1,!1,e.toLowerCase(),null,!1,!1)}),T.xlinkHref=new M("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){T[e]=new M(e,1,!1,e.toLowerCase(),null,!0,!0)});function $(e,n,o,u){var p=T.hasOwnProperty(n)?T[n]:null;(p!==null?p.type!==0:u||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(j(n,o,p,u)&&(o=null),u||p===null?_(n)&&(o===null?e.removeAttribute(n):e.setAttribute(n,""+o)):p.mustUseProperty?e[p.propertyName]=o===null?p.type===3?!1:"":o:(n=p.attributeName,u=p.attributeNamespace,o===null?e.removeAttribute(n):(p=p.type,o=p===3||p===4&&o===!0?"":""+o,u?e.setAttributeNS(u,n,o):e.setAttribute(n,o))))}var R=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,V=Symbol.for("react.element"),K=Symbol.for("react.portal"),W=Symbol.for("react.fragment"),Q=Symbol.for("react.strict_mode"),pe=Symbol.for("react.profiler"),ke=Symbol.for("react.provider"),X=Symbol.for("react.context"),ue=Symbol.for("react.forward_ref"),ve=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),fe=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),ae=Symbol.for("react.offscreen"),B=Symbol.iterator;function q(e){return e===null||typeof e!="object"?null:(e=B&&e[B]||e["@@iterator"],typeof e=="function"?e:null)}var Z=Object.assign,A;function U(e){if(A===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);A=n&&n[1]||""}return`
|
|
34
|
+
`+A+e}var de=!1;function _e(e,n){if(!e||de)return"";de=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(xe){var u=xe}Reflect.construct(e,[],n)}else{try{n.call()}catch(xe){u=xe}e.call(n.prototype)}else{try{throw Error()}catch(xe){u=xe}e()}}catch(xe){if(xe&&u&&typeof xe.stack=="string"){for(var p=xe.stack.split(`
|
|
35
|
+
`),y=u.stack.split(`
|
|
36
|
+
`),E=p.length-1,z=y.length-1;1<=E&&0<=z&&p[E]!==y[z];)z--;for(;1<=E&&0<=z;E--,z--)if(p[E]!==y[z]){if(E!==1||z!==1)do if(E--,z--,0>z||p[E]!==y[z]){var Y=`
|
|
37
|
+
`+p[E].replace(" at new "," at ");return e.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",e.displayName)),Y}while(1<=E&&0<=z);break}}}finally{de=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?U(e):""}function Te(e){switch(e.tag){case 5:return U(e.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return e=_e(e.type,!1),e;case 11:return e=_e(e.type.render,!1),e;case 1:return e=_e(e.type,!0),e;default:return""}}function Oe(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case W:return"Fragment";case K:return"Portal";case pe:return"Profiler";case Q:return"StrictMode";case ve:return"Suspense";case D:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case X:return(e.displayName||"Context")+".Consumer";case ke:return(e._context.displayName||"Context")+".Provider";case ue:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case fe:return n=e.displayName||null,n!==null?n:Oe(e.type)||"Memo";case J:n=e._payload,e=e._init;try{return Oe(e(n))}catch{}}return null}function Re(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Oe(n);case 8:return n===Q?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function Se(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function De(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Ne(e){var n=De(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),u=""+e[n];if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var p=o.get,y=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return p.call(this)},set:function(E){u=""+E,y.call(this,E)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return u},setValue:function(E){u=""+E},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Ze(e){e._valueTracker||(e._valueTracker=Ne(e))}function Be(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var o=n.getValue(),u="";return e&&(u=De(e)?e.checked?"true":"false":e.value),e=u,e!==o?(n.setValue(e),!0):!1}function Ue(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function qe(e,n){var o=n.checked;return Z({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??e._wrapperState.initialChecked})}function nt(e,n){var o=n.defaultValue==null?"":n.defaultValue,u=n.checked!=null?n.checked:n.defaultChecked;o=Se(n.value!=null?n.value:o),e._wrapperState={initialChecked:u,initialValue:o,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function ct(e,n){n=n.checked,n!=null&&$(e,"checked",n,!1)}function St(e,n){ct(e,n);var o=Se(n.value),u=n.type;if(o!=null)u==="number"?(o===0&&e.value===""||e.value!=o)&&(e.value=""+o):e.value!==""+o&&(e.value=""+o);else if(u==="submit"||u==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?Xt(e,n.type,o):n.hasOwnProperty("defaultValue")&&Xt(e,n.type,Se(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function gn(e,n,o){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var u=n.type;if(!(u!=="submit"&&u!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,o||n===e.value||(e.value=n),e.defaultValue=n}o=e.name,o!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,o!==""&&(e.name=o)}function Xt(e,n,o){(n!=="number"||Ue(e.ownerDocument)!==e)&&(o==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+o&&(e.defaultValue=""+o))}var Qt=Array.isArray;function kt(e,n,o,u){if(e=e.options,n){n={};for(var p=0;p<o.length;p++)n["$"+o[p]]=!0;for(o=0;o<e.length;o++)p=n.hasOwnProperty("$"+e[o].value),e[o].selected!==p&&(e[o].selected=p),p&&u&&(e[o].defaultSelected=!0)}else{for(o=""+Se(o),n=null,p=0;p<e.length;p++){if(e[p].value===o){e[p].selected=!0,u&&(e[p].defaultSelected=!0);return}n!==null||e[p].disabled||(n=e[p])}n!==null&&(n.selected=!0)}}function Kt(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(i(91));return Z({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function kn(e,n){var o=n.value;if(o==null){if(o=n.children,n=n.defaultValue,o!=null){if(n!=null)throw Error(i(92));if(Qt(o)){if(1<o.length)throw Error(i(93));o=o[0]}n=o}n==null&&(n=""),o=n}e._wrapperState={initialValue:Se(o)}}function fr(e,n){var o=Se(n.value),u=Se(n.defaultValue);o!=null&&(o=""+o,o!==e.value&&(e.value=o),n.defaultValue==null&&e.defaultValue!==o&&(e.defaultValue=o)),u!=null&&(e.defaultValue=""+u)}function an(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function Et(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Gt(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?Et(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var yn,er=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,o,u,p){MSApp.execUnsafeLocalFunction(function(){return e(n,o,u,p)})}:e})(function(e,n){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=n;else{for(yn=yn||document.createElement("div"),yn.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=yn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function nn(e,n){if(n){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=n;return}}e.textContent=n}var Mn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},In=["Webkit","ms","Moz","O"];Object.keys(Mn).forEach(function(e){In.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),Mn[n]=Mn[e]})});function dr(e,n,o){return n==null||typeof n=="boolean"||n===""?"":o||typeof n!="number"||n===0||Mn.hasOwnProperty(e)&&Mn[e]?(""+n).trim():n+"px"}function ln(e,n){e=e.style;for(var o in n)if(n.hasOwnProperty(o)){var u=o.indexOf("--")===0,p=dr(o,n[o],u);o==="float"&&(o="cssFloat"),u?e.setProperty(o,p):e[o]=p}}var rn=Z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ye(e,n){if(n){if(rn[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(i(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(i(61))}if(n.style!=null&&typeof n.style!="object")throw Error(i(62))}}function _t(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";switch(e){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 Tn=null;function pr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var He=null,un=null,An=null;function Cr(e){if(e=na(e)){if(typeof He!="function")throw Error(i(280));var n=e.stateNode;n&&(n=sl(n),He(e.stateNode,e.type,n))}}function Ht(e){un?An?An.push(e):An=[e]:un=e}function qr(){if(un){var e=un,n=An;if(An=un=null,Cr(e),n)for(e=0;e<n.length;e++)Cr(n[e])}}function Do(e,n){return e(n)}function zo(){}var zn=!1;function tr(e,n,o){if(zn)return e(n,o);zn=!0;try{return Do(e,n,o)}finally{zn=!1,(un!==null||An!==null)&&(zo(),qr())}}function Fn(e,n){var o=e.stateNode;if(o===null)return null;var u=sl(o);if(u===null)return null;o=u[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(e=e.type,u=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!u;break e;default:e=!1}if(e)return null;if(o&&typeof o!="function")throw Error(i(231,n,typeof o));return o}var hr=!1;if(h)try{var yt={};Object.defineProperty(yt,"passive",{get:function(){hr=!0}}),window.addEventListener("test",yt,yt),window.removeEventListener("test",yt,yt)}catch{hr=!1}function It(e,n,o,u,p,y,E,z,Y){var xe=Array.prototype.slice.call(arguments,3);try{n.apply(o,xe)}catch(Me){this.onError(Me)}}var jr=!1,nr=null,cn=!1,Bn=null,hi={onError:function(e){jr=!0,nr=e}};function Hn(e,n,o,u,p,y,E,z,Y){jr=!1,nr=null,It.apply(hi,arguments)}function mr(e,n,o,u,p,y,E,z,Y){if(Hn.apply(this,arguments),jr){if(jr){var xe=nr;jr=!1,nr=null}else throw Error(i(198));cn||(cn=!0,Bn=xe)}}function qt(e){var n=e,o=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(o=n.return),e=n.return;while(e)}return n.tag===3?o:null}function gr(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function lo(e){if(qt(e)!==e)throw Error(i(188))}function Vn(e){var n=e.alternate;if(!n){if(n=qt(e),n===null)throw Error(i(188));return n!==e?null:e}for(var o=e,u=n;;){var p=o.return;if(p===null)break;var y=p.alternate;if(y===null){if(u=p.return,u!==null){o=u;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===o)return lo(p),e;if(y===u)return lo(p),n;y=y.sibling}throw Error(i(188))}if(o.return!==u.return)o=p,u=y;else{for(var E=!1,z=p.child;z;){if(z===o){E=!0,o=p,u=y;break}if(z===u){E=!0,u=p,o=y;break}z=z.sibling}if(!E){for(z=y.child;z;){if(z===o){E=!0,o=y,u=p;break}if(z===u){E=!0,u=y,o=p;break}z=z.sibling}if(!E)throw Error(i(189))}}if(o.alternate!==u)throw Error(i(190))}if(o.tag!==3)throw Error(i(188));return o.stateNode.current===o?e:n}function uo(e){return e=Vn(e),e!==null?On(e):null}function On(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=On(e);if(n!==null)return n;e=e.sibling}return null}var co=r.unstable_scheduleCallback,Wr=r.unstable_cancelCallback,Nt=r.unstable_shouldYield,Un=r.unstable_requestPaint,pt=r.unstable_now,Fo=r.unstable_getCurrentPriorityLevel,yr=r.unstable_ImmediatePriority,Yr=r.unstable_UserBlockingPriority,rr=r.unstable_NormalPriority,Rn=r.unstable_LowPriority,Xr=r.unstable_IdlePriority,L=null,we=null;function Ee(e){if(we&&typeof we.onCommitFiberRoot=="function")try{we.onCommitFiberRoot(L,e,void 0,(e.current.flags&128)===128)}catch{}}var Qe=Math.clz32?Math.clz32:Wt,Tt=Math.log,Lt=Math.LN2;function Wt(e){return e>>>=0,e===0?32:31-(Tt(e)/Lt|0)|0}var Jt=64,Dt=4194304;function Vt(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ht(e,n){var o=e.pendingLanes;if(o===0)return 0;var u=0,p=e.suspendedLanes,y=e.pingedLanes,E=o&268435455;if(E!==0){var z=E&~p;z!==0?u=Vt(z):(y&=E,y!==0&&(u=Vt(y)))}else E=o&~p,E!==0?u=Vt(E):y!==0&&(u=Vt(y));if(u===0)return 0;if(n!==0&&n!==u&&(n&p)===0&&(p=u&-u,y=n&-n,p>=y||p===16&&(y&4194240)!==0))return n;if((u&4)!==0&&(u|=o&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=u;0<n;)o=31-Qe(n),p=1<<o,u|=e[o],n&=~p;return u}function or(e,n){switch(e){case 1:case 2:case 4:return n+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function vr(e,n){for(var o=e.suspendedLanes,u=e.pingedLanes,p=e.expirationTimes,y=e.pendingLanes;0<y;){var E=31-Qe(y),z=1<<E,Y=p[E];Y===-1?((z&o)===0||(z&u)!==0)&&(p[E]=or(z,n)):Y<=n&&(e.expiredLanes|=z),y&=~z}}function vn(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function xr(){var e=Jt;return Jt<<=1,(Jt&4194240)===0&&(Jt=64),e}function fo(e){for(var n=[],o=0;31>o;o++)n.push(e);return n}function wr(e,n,o){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-Qe(n),e[n]=o}function mi(e,n){var o=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var u=e.eventTimes;for(e=e.expirationTimes;0<o;){var p=31-Qe(o),y=1<<p;n[p]=0,u[p]=-1,e[p]=-1,o&=~y}}function Bo(e,n){var o=e.entangledLanes|=n;for(e=e.entanglements;o;){var u=31-Qe(o),p=1<<u;p&n|e[u]&n&&(e[u]|=n),o&=~p}}var wt=0;function Va(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var gt,Ui,Ua,Ka,Nn,Qr=!1,po=[],xn=null,Pr=null,$r=null,At=new Map,wn=new Map,Kn=[],gi="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 submit".split(" ");function Ki(e,n){switch(e){case"focusin":case"focusout":xn=null;break;case"dragenter":case"dragleave":Pr=null;break;case"mouseover":case"mouseout":$r=null;break;case"pointerover":case"pointerout":At.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":wn.delete(n.pointerId)}}function qn(e,n,o,u,p,y){return e===null||e.nativeEvent!==y?(e={blockedOn:n,domEventName:o,eventSystemFlags:u,nativeEvent:y,targetContainers:[p]},n!==null&&(n=na(n),n!==null&&Ui(n)),e):(e.eventSystemFlags|=u,n=e.targetContainers,p!==null&&n.indexOf(p)===-1&&n.push(p),e)}function Lu(e,n,o,u,p){switch(n){case"focusin":return xn=qn(xn,e,n,o,u,p),!0;case"dragenter":return Pr=qn(Pr,e,n,o,u,p),!0;case"mouseover":return $r=qn($r,e,n,o,u,p),!0;case"pointerover":var y=p.pointerId;return At.set(y,qn(At.get(y)||null,e,n,o,u,p)),!0;case"gotpointercapture":return y=p.pointerId,wn.set(y,qn(wn.get(y)||null,e,n,o,u,p)),!0}return!1}function ir(e){var n=ki(e.target);if(n!==null){var o=qt(n);if(o!==null){if(n=o.tag,n===13){if(n=gr(o),n!==null){e.blockedOn=n,Nn(e.priority,function(){Ua(o)});return}}else if(n===3&&o.stateNode.current.memoizedState.isDehydrated){e.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ho(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var o=Vo(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(o===null){o=e.nativeEvent;var u=new o.constructor(o.type,o);Tn=u,o.target.dispatchEvent(u),Tn=null}else return n=na(o),n!==null&&Ui(n),e.blockedOn=o,!1;n.shift()}return!0}function Ds(e,n,o){Ho(e)&&o.delete(n)}function zs(){Qr=!1,xn!==null&&Ho(xn)&&(xn=null),Pr!==null&&Ho(Pr)&&(Pr=null),$r!==null&&Ho($r)&&($r=null),At.forEach(Ds),wn.forEach(Ds)}function Mr(e,n){e.blockedOn===n&&(e.blockedOn=null,Qr||(Qr=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,zs)))}function ho(e){function n(p){return Mr(p,e)}if(0<po.length){Mr(po[0],e);for(var o=1;o<po.length;o++){var u=po[o];u.blockedOn===e&&(u.blockedOn=null)}}for(xn!==null&&Mr(xn,e),Pr!==null&&Mr(Pr,e),$r!==null&&Mr($r,e),At.forEach(n),wn.forEach(n),o=0;o<Kn.length;o++)u=Kn[o],u.blockedOn===e&&(u.blockedOn=null);for(;0<Kn.length&&(o=Kn[0],o.blockedOn===null);)ir(o),o.blockedOn===null&&Kn.shift()}var mo=R.ReactCurrentBatchConfig,qi=!0;function yi(e,n,o,u){var p=wt,y=mo.transition;mo.transition=null;try{wt=1,Fs(e,n,o,u)}finally{wt=p,mo.transition=y}}function Du(e,n,o,u){var p=wt,y=mo.transition;mo.transition=null;try{wt=4,Fs(e,n,o,u)}finally{wt=p,mo.transition=y}}function Fs(e,n,o,u){if(qi){var p=Vo(e,n,o,u);if(p===null)Vu(e,n,u,go,o),Ki(e,u);else if(Lu(p,e,n,o,u))u.stopPropagation();else if(Ki(e,u),n&4&&-1<gi.indexOf(e)){for(;p!==null;){var y=na(p);if(y!==null&>(y),y=Vo(e,n,o,u),y===null&&Vu(e,n,u,go,o),y===p)break;p=y}p!==null&&u.stopPropagation()}else Vu(e,n,u,null,o)}}var go=null;function Vo(e,n,o,u){if(go=null,e=pr(u),e=ki(e),e!==null)if(n=qt(e),n===null)e=null;else if(o=n.tag,o===13){if(e=gr(n),e!==null)return e;e=null}else if(o===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null);return go=e,null}function Wi(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Fo()){case yr:return 1;case Yr:return 4;case rr:case Rn:return 16;case Xr:return 536870912;default:return 16}default:return 16}}var Gr=null,Bs=null,Yi=null;function Xi(){if(Yi)return Yi;var e,n=Bs,o=n.length,u,p="value"in Gr?Gr.value:Gr.textContent,y=p.length;for(e=0;e<o&&n[e]===p[e];e++);var E=o-e;for(u=1;u<=E&&n[o-u]===p[y-u];u++);return Yi=p.slice(e,1<u?1-u:void 0)}function Uo(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function vi(){return!0}function xi(){return!1}function fn(e){function n(o,u,p,y,E){this._reactName=o,this._targetInst=p,this.type=u,this.nativeEvent=y,this.target=E,this.currentTarget=null;for(var z in e)e.hasOwnProperty(z)&&(o=e[z],this[z]=o?o(y):y[z]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?vi:xi,this.isPropagationStopped=xi,this}return Z(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=vi)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=vi)},persist:function(){},isPersistent:vi}),n}var Ir={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qi=fn(Ir),wi=Z({},Ir,{view:0,detail:0}),Ko=fn(wi),yo,bi,vo,qo=Z({},wi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ns,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==vo&&(vo&&e.type==="mousemove"?(yo=e.screenX-vo.screenX,bi=e.screenY-vo.screenY):bi=yo=0,vo=e),yo)},movementY:function(e){return"movementY"in e?e.movementY:bi}}),Gi=fn(qo),dn=Z({},qo,{dataTransfer:0}),_i=fn(dn),Si=Z({},wi,{relatedTarget:0}),Ji=fn(Si),Zi=Z({},Ir,{animationName:0,elapsedTime:0,pseudoElement:0}),qa=fn(Zi),Wa=Z({},Ir,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),es=fn(Wa),Hs=Z({},Ir,{data:0}),Jr=fn(Hs),Vs={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Us={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"},ts={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ks(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=ts[e])?!!n[e]:!1}function ns(){return Ks}var zu=Z({},wi,{key:function(e){if(e.key){var n=Vs[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Uo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Us[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ns,charCode:function(e){return e.type==="keypress"?Uo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Uo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qs=fn(zu),rs=Z({},qo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ya=fn(rs),Ws=Z({},wi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ns}),Ys=fn(Ws),Fu=Z({},Ir,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xa=fn(Fu),Bu=Z({},qo,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Qa=fn(Bu),Ga=[9,13,27,32],Xs=h&&"CompositionEvent"in window,Wo=null;h&&"documentMode"in document&&(Wo=document.documentMode);var Qs=h&&"TextEvent"in window&&!Wo,Gs=h&&(!Xs||Wo&&8<Wo&&11>=Wo),Js=" ",Ja=!1;function Za(e,n){switch(e){case"keyup":return Ga.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function el(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Tr=!1;function Ar(e,n){switch(e){case"compositionend":return el(n);case"keypress":return n.which!==32?null:(Ja=!0,Js);case"textInput":return e=n.data,e===Js&&Ja?null:e;default:return null}}function zt(e,n){if(Tr)return e==="compositionend"||!Xs&&Za(e,n)?(e=Xi(),Yi=Bs=Gr=null,Tr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Gs&&n.locale!=="ko"?null:n.data;default:return null}}var os={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 xo(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!os[e.type]:n==="textarea"}function tl(e,n,o,u){Ht(u),n=rl(n,"onChange"),0<n.length&&(o=new Qi("onChange","change",null,o,u),e.push({event:o,listeners:n}))}var wo=null,Yo=null;function bo(e){pd(e,0)}function Xo(e){var n=ls(e);if(Be(n))return e}function Qo(e,n){if(e==="change")return n}var Or=!1;if(h){var is;if(h){var a="oninput"in document;if(!a){var f=document.createElement("div");f.setAttribute("oninput","return;"),a=typeof f.oninput=="function"}is=a}else is=!1;Or=is&&(!document.documentMode||9<document.documentMode)}function m(){wo&&(wo.detachEvent("onpropertychange",w),Yo=wo=null)}function w(e){if(e.propertyName==="value"&&Xo(Yo)){var n=[];tl(n,Yo,e,pr(e)),tr(bo,n)}}function k(e,n,o){e==="focusin"?(m(),wo=n,Yo=o,wo.attachEvent("onpropertychange",w)):e==="focusout"&&m()}function N(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Xo(Yo)}function I(e,n){if(e==="click")return Xo(n)}function O(e,n){if(e==="input"||e==="change")return Xo(n)}function ee(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var ce=typeof Object.is=="function"?Object.is:ee;function ne(e,n){if(ce(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var o=Object.keys(e),u=Object.keys(n);if(o.length!==u.length)return!1;for(u=0;u<o.length;u++){var p=o[u];if(!v.call(n,p)||!ce(e[p],n[p]))return!1}return!0}function G(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function te(e,n){var o=G(e);e=0;for(var u;o;){if(o.nodeType===3){if(u=e+o.textContent.length,e<=n&&u>=n)return{node:o,offset:n-e};e=u}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=G(o)}}function le(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?le(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function ie(){for(var e=window,n=Ue();n instanceof e.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)e=n.contentWindow;else break;n=Ue(e.document)}return n}function oe(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function se(e){var n=ie(),o=e.focusedElem,u=e.selectionRange;if(n!==o&&o&&o.ownerDocument&&le(o.ownerDocument.documentElement,o)){if(u!==null&&oe(o)){if(n=u.start,e=u.end,e===void 0&&(e=n),"selectionStart"in o)o.selectionStart=n,o.selectionEnd=Math.min(e,o.value.length);else if(e=(n=o.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var p=o.textContent.length,y=Math.min(u.start,p);u=u.end===void 0?y:Math.min(u.end,p),!e.extend&&y>u&&(p=u,u=y,y=p),p=te(o,y);var E=te(o,u);p&&E&&(e.rangeCount!==1||e.anchorNode!==p.node||e.anchorOffset!==p.offset||e.focusNode!==E.node||e.focusOffset!==E.offset)&&(n=n.createRange(),n.setStart(p.node,p.offset),e.removeAllRanges(),y>u?(e.addRange(n),e.extend(E.node,E.offset)):(n.setEnd(E.node,E.offset),e.addRange(n)))}}for(n=[],e=o;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<n.length;o++)e=n[o],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ye=h&&"documentMode"in document&&11>=document.documentMode,he=null,be=null,Ce=null,Pe=!1;function ze(e,n,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Pe||he==null||he!==Ue(u)||(u=he,"selectionStart"in u&&oe(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Ce&&ne(Ce,u)||(Ce=u,u=rl(be,"onSelect"),0<u.length&&(n=new Qi("onSelect","select",null,n,o),e.push({event:n,listeners:u}),n.target=he)))}function Ie(e,n){var o={};return o[e.toLowerCase()]=n.toLowerCase(),o["Webkit"+e]="webkit"+n,o["Moz"+e]="moz"+n,o}var Ve={animationend:Ie("Animation","AnimationEnd"),animationiteration:Ie("Animation","AnimationIteration"),animationstart:Ie("Animation","AnimationStart"),transitionend:Ie("Transition","TransitionEnd")},Le={},We={};h&&(We=document.createElement("div").style,"AnimationEvent"in window||(delete Ve.animationend.animation,delete Ve.animationiteration.animation,delete Ve.animationstart.animation),"TransitionEvent"in window||delete Ve.transitionend.transition);function je(e){if(Le[e])return Le[e];if(!Ve[e])return e;var n=Ve[e],o;for(o in n)if(n.hasOwnProperty(o)&&o in We)return Le[e]=n[o];return e}var it=je("animationend"),st=je("animationiteration"),ut=je("animationstart"),ft=je("transitionend"),En=new Map,lt="abort auxClick 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(" ");function jt(e,n){En.set(e,n),c(n,[e])}for(var Zt=0;Zt<lt.length;Zt++){var Go=lt[Zt],bn=Go.toLowerCase(),_o=Go[0].toUpperCase()+Go.slice(1);jt(bn,"on"+_o)}jt(it,"onAnimationEnd"),jt(st,"onAnimationIteration"),jt(ut,"onAnimationStart"),jt("dblclick","onDoubleClick"),jt("focusin","onFocus"),jt("focusout","onBlur"),jt(ft,"onTransitionEnd"),d("onMouseEnter",["mouseout","mouseover"]),d("onMouseLeave",["mouseout","mouseover"]),d("onPointerEnter",["pointerout","pointerover"]),d("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var So="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(" "),$g=new Set("cancel close invalid load scroll toggle".split(" ").concat(So));function dd(e,n,o){var u=e.type||"unknown-event";e.currentTarget=o,mr(u,n,void 0,e),e.currentTarget=null}function pd(e,n){n=(n&4)!==0;for(var o=0;o<e.length;o++){var u=e[o],p=u.event;u=u.listeners;e:{var y=void 0;if(n)for(var E=u.length-1;0<=E;E--){var z=u[E],Y=z.instance,xe=z.currentTarget;if(z=z.listener,Y!==y&&p.isPropagationStopped())break e;dd(p,z,xe),y=Y}else for(E=0;E<u.length;E++){if(z=u[E],Y=z.instance,xe=z.currentTarget,z=z.listener,Y!==y&&p.isPropagationStopped())break e;dd(p,z,xe),y=Y}}}if(cn)throw e=Bn,cn=!1,Bn=null,e}function Pt(e,n){var o=n[Xu];o===void 0&&(o=n[Xu]=new Set);var u=e+"__bubble";o.has(u)||(hd(n,e,2,!1),o.add(u))}function Hu(e,n,o){var u=0;n&&(u|=4),hd(o,e,u,n)}var nl="_reactListening"+Math.random().toString(36).slice(2);function Zs(e){if(!e[nl]){e[nl]=!0,s.forEach(function(o){o!=="selectionchange"&&($g.has(o)||Hu(o,!1,e),Hu(o,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[nl]||(n[nl]=!0,Hu("selectionchange",!1,n))}}function hd(e,n,o,u){switch(Wi(n)){case 1:var p=yi;break;case 4:p=Du;break;default:p=Fs}o=p.bind(null,n,o,e),p=void 0,!hr||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(p=!0),u?p!==void 0?e.addEventListener(n,o,{capture:!0,passive:p}):e.addEventListener(n,o,!0):p!==void 0?e.addEventListener(n,o,{passive:p}):e.addEventListener(n,o,!1)}function Vu(e,n,o,u,p){var y=u;if((n&1)===0&&(n&2)===0&&u!==null)e:for(;;){if(u===null)return;var E=u.tag;if(E===3||E===4){var z=u.stateNode.containerInfo;if(z===p||z.nodeType===8&&z.parentNode===p)break;if(E===4)for(E=u.return;E!==null;){var Y=E.tag;if((Y===3||Y===4)&&(Y=E.stateNode.containerInfo,Y===p||Y.nodeType===8&&Y.parentNode===p))return;E=E.return}for(;z!==null;){if(E=ki(z),E===null)return;if(Y=E.tag,Y===5||Y===6){u=y=E;continue e}z=z.parentNode}}u=u.return}tr(function(){var xe=y,Me=pr(o),Ae=[];e:{var $e=En.get(e);if($e!==void 0){var Ke=Qi,Ge=e;switch(e){case"keypress":if(Uo(o)===0)break e;case"keydown":case"keyup":Ke=qs;break;case"focusin":Ge="focus",Ke=Ji;break;case"focusout":Ge="blur",Ke=Ji;break;case"beforeblur":case"afterblur":Ke=Ji;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ke=Gi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ke=_i;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ke=Ys;break;case it:case st:case ut:Ke=qa;break;case ft:Ke=Xa;break;case"scroll":Ke=Ko;break;case"wheel":Ke=Qa;break;case"copy":case"cut":case"paste":Ke=es;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ke=Ya}var Je=(n&4)!==0,Yt=!Je&&e==="scroll",me=Je?$e!==null?$e+"Capture":null:$e;Je=[];for(var re=xe,ge;re!==null;){ge=re;var Fe=ge.stateNode;if(ge.tag===5&&Fe!==null&&(ge=Fe,me!==null&&(Fe=Fn(re,me),Fe!=null&&Je.push(ea(re,Fe,ge)))),Yt)break;re=re.return}0<Je.length&&($e=new Ke($e,Ge,null,o,Me),Ae.push({event:$e,listeners:Je}))}}if((n&7)===0){e:{if($e=e==="mouseover"||e==="pointerover",Ke=e==="mouseout"||e==="pointerout",$e&&o!==Tn&&(Ge=o.relatedTarget||o.fromElement)&&(ki(Ge)||Ge[ko]))break e;if((Ke||$e)&&($e=Me.window===Me?Me:($e=Me.ownerDocument)?$e.defaultView||$e.parentWindow:window,Ke?(Ge=o.relatedTarget||o.toElement,Ke=xe,Ge=Ge?ki(Ge):null,Ge!==null&&(Yt=qt(Ge),Ge!==Yt||Ge.tag!==5&&Ge.tag!==6)&&(Ge=null)):(Ke=null,Ge=xe),Ke!==Ge)){if(Je=Gi,Fe="onMouseLeave",me="onMouseEnter",re="mouse",(e==="pointerout"||e==="pointerover")&&(Je=Ya,Fe="onPointerLeave",me="onPointerEnter",re="pointer"),Yt=Ke==null?$e:ls(Ke),ge=Ge==null?$e:ls(Ge),$e=new Je(Fe,re+"leave",Ke,o,Me),$e.target=Yt,$e.relatedTarget=ge,Fe=null,ki(Me)===xe&&(Je=new Je(me,re+"enter",Ge,o,Me),Je.target=ge,Je.relatedTarget=Yt,Fe=Je),Yt=Fe,Ke&&Ge)t:{for(Je=Ke,me=Ge,re=0,ge=Je;ge;ge=ss(ge))re++;for(ge=0,Fe=me;Fe;Fe=ss(Fe))ge++;for(;0<re-ge;)Je=ss(Je),re--;for(;0<ge-re;)me=ss(me),ge--;for(;re--;){if(Je===me||me!==null&&Je===me.alternate)break t;Je=ss(Je),me=ss(me)}Je=null}else Je=null;Ke!==null&&md(Ae,$e,Ke,Je,!1),Ge!==null&&Yt!==null&&md(Ae,Yt,Ge,Je,!0)}}e:{if($e=xe?ls(xe):window,Ke=$e.nodeName&&$e.nodeName.toLowerCase(),Ke==="select"||Ke==="input"&&$e.type==="file")var et=Qo;else if(xo($e))if(Or)et=O;else{et=N;var rt=k}else(Ke=$e.nodeName)&&Ke.toLowerCase()==="input"&&($e.type==="checkbox"||$e.type==="radio")&&(et=I);if(et&&(et=et(e,xe))){tl(Ae,et,o,Me);break e}rt&&rt(e,$e,xe),e==="focusout"&&(rt=$e._wrapperState)&&rt.controlled&&$e.type==="number"&&Xt($e,"number",$e.value)}switch(rt=xe?ls(xe):window,e){case"focusin":(xo(rt)||rt.contentEditable==="true")&&(he=rt,be=xe,Ce=null);break;case"focusout":Ce=be=he=null;break;case"mousedown":Pe=!0;break;case"contextmenu":case"mouseup":case"dragend":Pe=!1,ze(Ae,o,Me);break;case"selectionchange":if(ye)break;case"keydown":case"keyup":ze(Ae,o,Me)}var ot;if(Xs)e:{switch(e){case"compositionstart":var at="onCompositionStart";break e;case"compositionend":at="onCompositionEnd";break e;case"compositionupdate":at="onCompositionUpdate";break e}at=void 0}else Tr?Za(e,o)&&(at="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(at="onCompositionStart");at&&(Gs&&o.locale!=="ko"&&(Tr||at!=="onCompositionStart"?at==="onCompositionEnd"&&Tr&&(ot=Xi()):(Gr=Me,Bs="value"in Gr?Gr.value:Gr.textContent,Tr=!0)),rt=rl(xe,at),0<rt.length&&(at=new Jr(at,e,null,o,Me),Ae.push({event:at,listeners:rt}),ot?at.data=ot:(ot=el(o),ot!==null&&(at.data=ot)))),(ot=Qs?Ar(e,o):zt(e,o))&&(xe=rl(xe,"onBeforeInput"),0<xe.length&&(Me=new Jr("onBeforeInput","beforeinput",null,o,Me),Ae.push({event:Me,listeners:xe}),Me.data=ot))}pd(Ae,n)})}function ea(e,n,o){return{instance:e,listener:n,currentTarget:o}}function rl(e,n){for(var o=n+"Capture",u=[];e!==null;){var p=e,y=p.stateNode;p.tag===5&&y!==null&&(p=y,y=Fn(e,o),y!=null&&u.unshift(ea(e,y,p)),y=Fn(e,n),y!=null&&u.push(ea(e,y,p))),e=e.return}return u}function ss(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function md(e,n,o,u,p){for(var y=n._reactName,E=[];o!==null&&o!==u;){var z=o,Y=z.alternate,xe=z.stateNode;if(Y!==null&&Y===u)break;z.tag===5&&xe!==null&&(z=xe,p?(Y=Fn(o,y),Y!=null&&E.unshift(ea(o,Y,z))):p||(Y=Fn(o,y),Y!=null&&E.push(ea(o,Y,z)))),o=o.return}E.length!==0&&e.push({event:n,listeners:E})}var Mg=/\r\n?/g,Ig=/\u0000|\uFFFD/g;function gd(e){return(typeof e=="string"?e:""+e).replace(Mg,`
|
|
38
|
+
`).replace(Ig,"")}function ol(e,n,o){if(n=gd(n),gd(e)!==n&&o)throw Error(i(425))}function il(){}var Uu=null,Ku=null;function qu(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Wu=typeof setTimeout=="function"?setTimeout:void 0,Tg=typeof clearTimeout=="function"?clearTimeout:void 0,yd=typeof Promise=="function"?Promise:void 0,Ag=typeof queueMicrotask=="function"?queueMicrotask:typeof yd<"u"?function(e){return yd.resolve(null).then(e).catch(Og)}:Wu;function Og(e){setTimeout(function(){throw e})}function Yu(e,n){var o=n,u=0;do{var p=o.nextSibling;if(e.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"){if(u===0){e.removeChild(p),ho(n);return}u--}else o!=="$"&&o!=="$?"&&o!=="$!"||u++;o=p}while(o);ho(n)}function Jo(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return e}function vd(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="$"||o==="$!"||o==="$?"){if(n===0)return e;n--}else o==="/$"&&n++}e=e.previousSibling}return null}var as=Math.random().toString(36).slice(2),Zr="__reactFiber$"+as,ta="__reactProps$"+as,ko="__reactContainer$"+as,Xu="__reactEvents$"+as,Rg="__reactListeners$"+as,Lg="__reactHandles$"+as;function ki(e){var n=e[Zr];if(n)return n;for(var o=e.parentNode;o;){if(n=o[ko]||o[Zr]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(e=vd(e);e!==null;){if(o=e[Zr])return o;e=vd(e)}return n}e=o,o=e.parentNode}return null}function na(e){return e=e[Zr]||e[ko],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ls(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function sl(e){return e[ta]||null}var Qu=[],us=-1;function Zo(e){return{current:e}}function $t(e){0>us||(e.current=Qu[us],Qu[us]=null,us--)}function Ct(e,n){us++,Qu[us]=e.current,e.current=n}var ei={},Cn=Zo(ei),Wn=Zo(!1),Ni=ei;function cs(e,n){var o=e.type.contextTypes;if(!o)return ei;var u=e.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===n)return u.__reactInternalMemoizedMaskedChildContext;var p={},y;for(y in o)p[y]=n[y];return u&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=p),p}function Yn(e){return e=e.childContextTypes,e!=null}function al(){$t(Wn),$t(Cn)}function xd(e,n,o){if(Cn.current!==ei)throw Error(i(168));Ct(Cn,n),Ct(Wn,o)}function wd(e,n,o){var u=e.stateNode;if(n=n.childContextTypes,typeof u.getChildContext!="function")return o;u=u.getChildContext();for(var p in u)if(!(p in n))throw Error(i(108,Re(e)||"Unknown",p));return Z({},o,u)}function ll(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ei,Ni=Cn.current,Ct(Cn,e),Ct(Wn,Wn.current),!0}function bd(e,n,o){var u=e.stateNode;if(!u)throw Error(i(169));o?(e=wd(e,n,Ni),u.__reactInternalMemoizedMergedChildContext=e,$t(Wn),$t(Cn),Ct(Cn,e)):$t(Wn),Ct(Wn,o)}var No=null,ul=!1,Gu=!1;function _d(e){No===null?No=[e]:No.push(e)}function Dg(e){ul=!0,_d(e)}function ti(){if(!Gu&&No!==null){Gu=!0;var e=0,n=wt;try{var o=No;for(wt=1;e<o.length;e++){var u=o[e];do u=u(!0);while(u!==null)}No=null,ul=!1}catch(p){throw No!==null&&(No=No.slice(e+1)),co(yr,ti),p}finally{wt=n,Gu=!1}}return null}var fs=[],ds=0,cl=null,fl=0,br=[],_r=0,Ei=null,Eo=1,Co="";function Ci(e,n){fs[ds++]=fl,fs[ds++]=cl,cl=e,fl=n}function Sd(e,n,o){br[_r++]=Eo,br[_r++]=Co,br[_r++]=Ei,Ei=e;var u=Eo;e=Co;var p=32-Qe(u)-1;u&=~(1<<p),o+=1;var y=32-Qe(n)+p;if(30<y){var E=p-p%5;y=(u&(1<<E)-1).toString(32),u>>=E,p-=E,Eo=1<<32-Qe(n)+p|o<<p|u,Co=y+e}else Eo=1<<y|o<<p|u,Co=e}function Ju(e){e.return!==null&&(Ci(e,1),Sd(e,1,0))}function Zu(e){for(;e===cl;)cl=fs[--ds],fs[ds]=null,fl=fs[--ds],fs[ds]=null;for(;e===Ei;)Ei=br[--_r],br[_r]=null,Co=br[--_r],br[_r]=null,Eo=br[--_r],br[_r]=null}var sr=null,ar=null,Ot=!1,Rr=null;function kd(e,n){var o=Er(5,null,null,0);o.elementType="DELETED",o.stateNode=n,o.return=e,n=e.deletions,n===null?(e.deletions=[o],e.flags|=16):n.push(o)}function Nd(e,n){switch(e.tag){case 5:var o=e.type;return n=n.nodeType!==1||o.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,sr=e,ar=Jo(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,sr=e,ar=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(o=Ei!==null?{id:Eo,overflow:Co}:null,e.memoizedState={dehydrated:n,treeContext:o,retryLane:1073741824},o=Er(18,null,null,0),o.stateNode=n,o.return=e,e.child=o,sr=e,ar=null,!0):!1;default:return!1}}function ec(e){return(e.mode&1)!==0&&(e.flags&128)===0}function tc(e){if(Ot){var n=ar;if(n){var o=n;if(!Nd(e,n)){if(ec(e))throw Error(i(418));n=Jo(o.nextSibling);var u=sr;n&&Nd(e,n)?kd(u,o):(e.flags=e.flags&-4097|2,Ot=!1,sr=e)}}else{if(ec(e))throw Error(i(418));e.flags=e.flags&-4097|2,Ot=!1,sr=e}}}function Ed(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;sr=e}function dl(e){if(e!==sr)return!1;if(!Ot)return Ed(e),Ot=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!qu(e.type,e.memoizedProps)),n&&(n=ar)){if(ec(e))throw Cd(),Error(i(418));for(;n;)kd(e,n),n=Jo(n.nextSibling)}if(Ed(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="/$"){if(n===0){ar=Jo(e.nextSibling);break e}n--}else o!=="$"&&o!=="$!"&&o!=="$?"||n++}e=e.nextSibling}ar=null}}else ar=sr?Jo(e.stateNode.nextSibling):null;return!0}function Cd(){for(var e=ar;e;)e=Jo(e.nextSibling)}function ps(){ar=sr=null,Ot=!1}function nc(e){Rr===null?Rr=[e]:Rr.push(e)}var zg=R.ReactCurrentBatchConfig;function ra(e,n,o){if(e=o.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(o._owner){if(o=o._owner,o){if(o.tag!==1)throw Error(i(309));var u=o.stateNode}if(!u)throw Error(i(147,e));var p=u,y=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===y?n.ref:(n=function(E){var z=p.refs;E===null?delete z[y]:z[y]=E},n._stringRef=y,n)}if(typeof e!="string")throw Error(i(284));if(!o._owner)throw Error(i(290,e))}return e}function pl(e,n){throw e=Object.prototype.toString.call(n),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e))}function jd(e){var n=e._init;return n(e._payload)}function Pd(e){function n(me,re){if(e){var ge=me.deletions;ge===null?(me.deletions=[re],me.flags|=16):ge.push(re)}}function o(me,re){if(!e)return null;for(;re!==null;)n(me,re),re=re.sibling;return null}function u(me,re){for(me=new Map;re!==null;)re.key!==null?me.set(re.key,re):me.set(re.index,re),re=re.sibling;return me}function p(me,re){return me=ui(me,re),me.index=0,me.sibling=null,me}function y(me,re,ge){return me.index=ge,e?(ge=me.alternate,ge!==null?(ge=ge.index,ge<re?(me.flags|=2,re):ge):(me.flags|=2,re)):(me.flags|=1048576,re)}function E(me){return e&&me.alternate===null&&(me.flags|=2),me}function z(me,re,ge,Fe){return re===null||re.tag!==6?(re=Wc(ge,me.mode,Fe),re.return=me,re):(re=p(re,ge),re.return=me,re)}function Y(me,re,ge,Fe){var et=ge.type;return et===W?Me(me,re,ge.props.children,Fe,ge.key):re!==null&&(re.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===J&&jd(et)===re.type)?(Fe=p(re,ge.props),Fe.ref=ra(me,re,ge),Fe.return=me,Fe):(Fe=Ll(ge.type,ge.key,ge.props,null,me.mode,Fe),Fe.ref=ra(me,re,ge),Fe.return=me,Fe)}function xe(me,re,ge,Fe){return re===null||re.tag!==4||re.stateNode.containerInfo!==ge.containerInfo||re.stateNode.implementation!==ge.implementation?(re=Yc(ge,me.mode,Fe),re.return=me,re):(re=p(re,ge.children||[]),re.return=me,re)}function Me(me,re,ge,Fe,et){return re===null||re.tag!==7?(re=Oi(ge,me.mode,Fe,et),re.return=me,re):(re=p(re,ge),re.return=me,re)}function Ae(me,re,ge){if(typeof re=="string"&&re!==""||typeof re=="number")return re=Wc(""+re,me.mode,ge),re.return=me,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case V:return ge=Ll(re.type,re.key,re.props,null,me.mode,ge),ge.ref=ra(me,null,re),ge.return=me,ge;case K:return re=Yc(re,me.mode,ge),re.return=me,re;case J:var Fe=re._init;return Ae(me,Fe(re._payload),ge)}if(Qt(re)||q(re))return re=Oi(re,me.mode,ge,null),re.return=me,re;pl(me,re)}return null}function $e(me,re,ge,Fe){var et=re!==null?re.key:null;if(typeof ge=="string"&&ge!==""||typeof ge=="number")return et!==null?null:z(me,re,""+ge,Fe);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case V:return ge.key===et?Y(me,re,ge,Fe):null;case K:return ge.key===et?xe(me,re,ge,Fe):null;case J:return et=ge._init,$e(me,re,et(ge._payload),Fe)}if(Qt(ge)||q(ge))return et!==null?null:Me(me,re,ge,Fe,null);pl(me,ge)}return null}function Ke(me,re,ge,Fe,et){if(typeof Fe=="string"&&Fe!==""||typeof Fe=="number")return me=me.get(ge)||null,z(re,me,""+Fe,et);if(typeof Fe=="object"&&Fe!==null){switch(Fe.$$typeof){case V:return me=me.get(Fe.key===null?ge:Fe.key)||null,Y(re,me,Fe,et);case K:return me=me.get(Fe.key===null?ge:Fe.key)||null,xe(re,me,Fe,et);case J:var rt=Fe._init;return Ke(me,re,ge,rt(Fe._payload),et)}if(Qt(Fe)||q(Fe))return me=me.get(ge)||null,Me(re,me,Fe,et,null);pl(re,Fe)}return null}function Ge(me,re,ge,Fe){for(var et=null,rt=null,ot=re,at=re=0,mn=null;ot!==null&&at<ge.length;at++){ot.index>at?(mn=ot,ot=null):mn=ot.sibling;var bt=$e(me,ot,ge[at],Fe);if(bt===null){ot===null&&(ot=mn);break}e&&ot&&bt.alternate===null&&n(me,ot),re=y(bt,re,at),rt===null?et=bt:rt.sibling=bt,rt=bt,ot=mn}if(at===ge.length)return o(me,ot),Ot&&Ci(me,at),et;if(ot===null){for(;at<ge.length;at++)ot=Ae(me,ge[at],Fe),ot!==null&&(re=y(ot,re,at),rt===null?et=ot:rt.sibling=ot,rt=ot);return Ot&&Ci(me,at),et}for(ot=u(me,ot);at<ge.length;at++)mn=Ke(ot,me,at,ge[at],Fe),mn!==null&&(e&&mn.alternate!==null&&ot.delete(mn.key===null?at:mn.key),re=y(mn,re,at),rt===null?et=mn:rt.sibling=mn,rt=mn);return e&&ot.forEach(function(ci){return n(me,ci)}),Ot&&Ci(me,at),et}function Je(me,re,ge,Fe){var et=q(ge);if(typeof et!="function")throw Error(i(150));if(ge=et.call(ge),ge==null)throw Error(i(151));for(var rt=et=null,ot=re,at=re=0,mn=null,bt=ge.next();ot!==null&&!bt.done;at++,bt=ge.next()){ot.index>at?(mn=ot,ot=null):mn=ot.sibling;var ci=$e(me,ot,bt.value,Fe);if(ci===null){ot===null&&(ot=mn);break}e&&ot&&ci.alternate===null&&n(me,ot),re=y(ci,re,at),rt===null?et=ci:rt.sibling=ci,rt=ci,ot=mn}if(bt.done)return o(me,ot),Ot&&Ci(me,at),et;if(ot===null){for(;!bt.done;at++,bt=ge.next())bt=Ae(me,bt.value,Fe),bt!==null&&(re=y(bt,re,at),rt===null?et=bt:rt.sibling=bt,rt=bt);return Ot&&Ci(me,at),et}for(ot=u(me,ot);!bt.done;at++,bt=ge.next())bt=Ke(ot,me,at,bt.value,Fe),bt!==null&&(e&&bt.alternate!==null&&ot.delete(bt.key===null?at:bt.key),re=y(bt,re,at),rt===null?et=bt:rt.sibling=bt,rt=bt);return e&&ot.forEach(function(vy){return n(me,vy)}),Ot&&Ci(me,at),et}function Yt(me,re,ge,Fe){if(typeof ge=="object"&&ge!==null&&ge.type===W&&ge.key===null&&(ge=ge.props.children),typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case V:e:{for(var et=ge.key,rt=re;rt!==null;){if(rt.key===et){if(et=ge.type,et===W){if(rt.tag===7){o(me,rt.sibling),re=p(rt,ge.props.children),re.return=me,me=re;break e}}else if(rt.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===J&&jd(et)===rt.type){o(me,rt.sibling),re=p(rt,ge.props),re.ref=ra(me,rt,ge),re.return=me,me=re;break e}o(me,rt);break}else n(me,rt);rt=rt.sibling}ge.type===W?(re=Oi(ge.props.children,me.mode,Fe,ge.key),re.return=me,me=re):(Fe=Ll(ge.type,ge.key,ge.props,null,me.mode,Fe),Fe.ref=ra(me,re,ge),Fe.return=me,me=Fe)}return E(me);case K:e:{for(rt=ge.key;re!==null;){if(re.key===rt)if(re.tag===4&&re.stateNode.containerInfo===ge.containerInfo&&re.stateNode.implementation===ge.implementation){o(me,re.sibling),re=p(re,ge.children||[]),re.return=me,me=re;break e}else{o(me,re);break}else n(me,re);re=re.sibling}re=Yc(ge,me.mode,Fe),re.return=me,me=re}return E(me);case J:return rt=ge._init,Yt(me,re,rt(ge._payload),Fe)}if(Qt(ge))return Ge(me,re,ge,Fe);if(q(ge))return Je(me,re,ge,Fe);pl(me,ge)}return typeof ge=="string"&&ge!==""||typeof ge=="number"?(ge=""+ge,re!==null&&re.tag===6?(o(me,re.sibling),re=p(re,ge),re.return=me,me=re):(o(me,re),re=Wc(ge,me.mode,Fe),re.return=me,me=re),E(me)):o(me,re)}return Yt}var hs=Pd(!0),$d=Pd(!1),hl=Zo(null),ml=null,ms=null,rc=null;function oc(){rc=ms=ml=null}function ic(e){var n=hl.current;$t(hl),e._currentValue=n}function sc(e,n,o){for(;e!==null;){var u=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,u!==null&&(u.childLanes|=n)):u!==null&&(u.childLanes&n)!==n&&(u.childLanes|=n),e===o)break;e=e.return}}function gs(e,n){ml=e,rc=ms=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(Xn=!0),e.firstContext=null)}function Sr(e){var n=e._currentValue;if(rc!==e)if(e={context:e,memoizedValue:n,next:null},ms===null){if(ml===null)throw Error(i(308));ms=e,ml.dependencies={lanes:0,firstContext:e}}else ms=ms.next=e;return n}var ji=null;function ac(e){ji===null?ji=[e]:ji.push(e)}function Md(e,n,o,u){var p=n.interleaved;return p===null?(o.next=o,ac(n)):(o.next=p.next,p.next=o),n.interleaved=o,jo(e,u)}function jo(e,n){e.lanes|=n;var o=e.alternate;for(o!==null&&(o.lanes|=n),o=e,e=e.return;e!==null;)e.childLanes|=n,o=e.alternate,o!==null&&(o.childLanes|=n),o=e,e=e.return;return o.tag===3?o.stateNode:null}var ni=!1;function lc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Id(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Po(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function ri(e,n,o){var u=e.updateQueue;if(u===null)return null;if(u=u.shared,(xt&2)!==0){var p=u.pending;return p===null?n.next=n:(n.next=p.next,p.next=n),u.pending=n,jo(e,o)}return p=u.interleaved,p===null?(n.next=n,ac(u)):(n.next=p.next,p.next=n),u.interleaved=n,jo(e,o)}function gl(e,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194240)!==0)){var u=n.lanes;u&=e.pendingLanes,o|=u,n.lanes=o,Bo(e,o)}}function Td(e,n){var o=e.updateQueue,u=e.alternate;if(u!==null&&(u=u.updateQueue,o===u)){var p=null,y=null;if(o=o.firstBaseUpdate,o!==null){do{var E={eventTime:o.eventTime,lane:o.lane,tag:o.tag,payload:o.payload,callback:o.callback,next:null};y===null?p=y=E:y=y.next=E,o=o.next}while(o!==null);y===null?p=y=n:y=y.next=n}else p=y=n;o={baseState:u.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:u.shared,effects:u.effects},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=n:e.next=n,o.lastBaseUpdate=n}function yl(e,n,o,u){var p=e.updateQueue;ni=!1;var y=p.firstBaseUpdate,E=p.lastBaseUpdate,z=p.shared.pending;if(z!==null){p.shared.pending=null;var Y=z,xe=Y.next;Y.next=null,E===null?y=xe:E.next=xe,E=Y;var Me=e.alternate;Me!==null&&(Me=Me.updateQueue,z=Me.lastBaseUpdate,z!==E&&(z===null?Me.firstBaseUpdate=xe:z.next=xe,Me.lastBaseUpdate=Y))}if(y!==null){var Ae=p.baseState;E=0,Me=xe=Y=null,z=y;do{var $e=z.lane,Ke=z.eventTime;if((u&$e)===$e){Me!==null&&(Me=Me.next={eventTime:Ke,lane:0,tag:z.tag,payload:z.payload,callback:z.callback,next:null});e:{var Ge=e,Je=z;switch($e=n,Ke=o,Je.tag){case 1:if(Ge=Je.payload,typeof Ge=="function"){Ae=Ge.call(Ke,Ae,$e);break e}Ae=Ge;break e;case 3:Ge.flags=Ge.flags&-65537|128;case 0:if(Ge=Je.payload,$e=typeof Ge=="function"?Ge.call(Ke,Ae,$e):Ge,$e==null)break e;Ae=Z({},Ae,$e);break e;case 2:ni=!0}}z.callback!==null&&z.lane!==0&&(e.flags|=64,$e=p.effects,$e===null?p.effects=[z]:$e.push(z))}else Ke={eventTime:Ke,lane:$e,tag:z.tag,payload:z.payload,callback:z.callback,next:null},Me===null?(xe=Me=Ke,Y=Ae):Me=Me.next=Ke,E|=$e;if(z=z.next,z===null){if(z=p.shared.pending,z===null)break;$e=z,z=$e.next,$e.next=null,p.lastBaseUpdate=$e,p.shared.pending=null}}while(!0);if(Me===null&&(Y=Ae),p.baseState=Y,p.firstBaseUpdate=xe,p.lastBaseUpdate=Me,n=p.shared.interleaved,n!==null){p=n;do E|=p.lane,p=p.next;while(p!==n)}else y===null&&(p.shared.lanes=0);Mi|=E,e.lanes=E,e.memoizedState=Ae}}function Ad(e,n,o){if(e=n.effects,n.effects=null,e!==null)for(n=0;n<e.length;n++){var u=e[n],p=u.callback;if(p!==null){if(u.callback=null,u=o,typeof p!="function")throw Error(i(191,p));p.call(u)}}}var oa={},eo=Zo(oa),ia=Zo(oa),sa=Zo(oa);function Pi(e){if(e===oa)throw Error(i(174));return e}function uc(e,n){switch(Ct(sa,n),Ct(ia,e),Ct(eo,oa),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:Gt(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=Gt(n,e)}$t(eo),Ct(eo,n)}function ys(){$t(eo),$t(ia),$t(sa)}function Od(e){Pi(sa.current);var n=Pi(eo.current),o=Gt(n,e.type);n!==o&&(Ct(ia,e),Ct(eo,o))}function cc(e){ia.current===e&&($t(eo),$t(ia))}var Ft=Zo(0);function vl(e){for(var n=e;n!==null;){if(n.tag===13){var o=n.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||o.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var fc=[];function dc(){for(var e=0;e<fc.length;e++)fc[e]._workInProgressVersionPrimary=null;fc.length=0}var xl=R.ReactCurrentDispatcher,pc=R.ReactCurrentBatchConfig,$i=0,Bt=null,on=null,pn=null,wl=!1,aa=!1,la=0,Fg=0;function jn(){throw Error(i(321))}function hc(e,n){if(n===null)return!1;for(var o=0;o<n.length&&o<e.length;o++)if(!ce(e[o],n[o]))return!1;return!0}function mc(e,n,o,u,p,y){if($i=y,Bt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,xl.current=e===null||e.memoizedState===null?Ug:Kg,e=o(u,p),aa){y=0;do{if(aa=!1,la=0,25<=y)throw Error(i(301));y+=1,pn=on=null,n.updateQueue=null,xl.current=qg,e=o(u,p)}while(aa)}if(xl.current=Sl,n=on!==null&&on.next!==null,$i=0,pn=on=Bt=null,wl=!1,n)throw Error(i(300));return e}function gc(){var e=la!==0;return la=0,e}function to(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pn===null?Bt.memoizedState=pn=e:pn=pn.next=e,pn}function kr(){if(on===null){var e=Bt.alternate;e=e!==null?e.memoizedState:null}else e=on.next;var n=pn===null?Bt.memoizedState:pn.next;if(n!==null)pn=n,on=e;else{if(e===null)throw Error(i(310));on=e,e={memoizedState:on.memoizedState,baseState:on.baseState,baseQueue:on.baseQueue,queue:on.queue,next:null},pn===null?Bt.memoizedState=pn=e:pn=pn.next=e}return pn}function ua(e,n){return typeof n=="function"?n(e):n}function yc(e){var n=kr(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var u=on,p=u.baseQueue,y=o.pending;if(y!==null){if(p!==null){var E=p.next;p.next=y.next,y.next=E}u.baseQueue=p=y,o.pending=null}if(p!==null){y=p.next,u=u.baseState;var z=E=null,Y=null,xe=y;do{var Me=xe.lane;if(($i&Me)===Me)Y!==null&&(Y=Y.next={lane:0,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null}),u=xe.hasEagerState?xe.eagerState:e(u,xe.action);else{var Ae={lane:Me,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null};Y===null?(z=Y=Ae,E=u):Y=Y.next=Ae,Bt.lanes|=Me,Mi|=Me}xe=xe.next}while(xe!==null&&xe!==y);Y===null?E=u:Y.next=z,ce(u,n.memoizedState)||(Xn=!0),n.memoizedState=u,n.baseState=E,n.baseQueue=Y,o.lastRenderedState=u}if(e=o.interleaved,e!==null){p=e;do y=p.lane,Bt.lanes|=y,Mi|=y,p=p.next;while(p!==e)}else p===null&&(o.lanes=0);return[n.memoizedState,o.dispatch]}function vc(e){var n=kr(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var u=o.dispatch,p=o.pending,y=n.memoizedState;if(p!==null){o.pending=null;var E=p=p.next;do y=e(y,E.action),E=E.next;while(E!==p);ce(y,n.memoizedState)||(Xn=!0),n.memoizedState=y,n.baseQueue===null&&(n.baseState=y),o.lastRenderedState=y}return[y,u]}function Rd(){}function Ld(e,n){var o=Bt,u=kr(),p=n(),y=!ce(u.memoizedState,p);if(y&&(u.memoizedState=p,Xn=!0),u=u.queue,xc(Fd.bind(null,o,u,e),[e]),u.getSnapshot!==n||y||pn!==null&&pn.memoizedState.tag&1){if(o.flags|=2048,ca(9,zd.bind(null,o,u,p,n),void 0,null),hn===null)throw Error(i(349));($i&30)!==0||Dd(o,n,p)}return p}function Dd(e,n,o){e.flags|=16384,e={getSnapshot:n,value:o},n=Bt.updateQueue,n===null?(n={lastEffect:null,stores:null},Bt.updateQueue=n,n.stores=[e]):(o=n.stores,o===null?n.stores=[e]:o.push(e))}function zd(e,n,o,u){n.value=o,n.getSnapshot=u,Bd(n)&&Hd(e)}function Fd(e,n,o){return o(function(){Bd(n)&&Hd(e)})}function Bd(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!ce(e,o)}catch{return!0}}function Hd(e){var n=jo(e,1);n!==null&&Fr(n,e,1,-1)}function Vd(e){var n=to();return typeof e=="function"&&(e=e()),n.memoizedState=n.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:e},n.queue=e,e=e.dispatch=Vg.bind(null,Bt,e),[n.memoizedState,e]}function ca(e,n,o,u){return e={tag:e,create:n,destroy:o,deps:u,next:null},n=Bt.updateQueue,n===null?(n={lastEffect:null,stores:null},Bt.updateQueue=n,n.lastEffect=e.next=e):(o=n.lastEffect,o===null?n.lastEffect=e.next=e:(u=o.next,o.next=e,e.next=u,n.lastEffect=e)),e}function Ud(){return kr().memoizedState}function bl(e,n,o,u){var p=to();Bt.flags|=e,p.memoizedState=ca(1|n,o,void 0,u===void 0?null:u)}function _l(e,n,o,u){var p=kr();u=u===void 0?null:u;var y=void 0;if(on!==null){var E=on.memoizedState;if(y=E.destroy,u!==null&&hc(u,E.deps)){p.memoizedState=ca(n,o,y,u);return}}Bt.flags|=e,p.memoizedState=ca(1|n,o,y,u)}function Kd(e,n){return bl(8390656,8,e,n)}function xc(e,n){return _l(2048,8,e,n)}function qd(e,n){return _l(4,2,e,n)}function Wd(e,n){return _l(4,4,e,n)}function Yd(e,n){if(typeof n=="function")return e=e(),n(e),function(){n(null)};if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Xd(e,n,o){return o=o!=null?o.concat([e]):null,_l(4,4,Yd.bind(null,n,e),o)}function wc(){}function Qd(e,n){var o=kr();n=n===void 0?null:n;var u=o.memoizedState;return u!==null&&n!==null&&hc(n,u[1])?u[0]:(o.memoizedState=[e,n],e)}function Gd(e,n){var o=kr();n=n===void 0?null:n;var u=o.memoizedState;return u!==null&&n!==null&&hc(n,u[1])?u[0]:(e=e(),o.memoizedState=[e,n],e)}function Jd(e,n,o){return($i&21)===0?(e.baseState&&(e.baseState=!1,Xn=!0),e.memoizedState=o):(ce(o,n)||(o=xr(),Bt.lanes|=o,Mi|=o,e.baseState=!0),n)}function Bg(e,n){var o=wt;wt=o!==0&&4>o?o:4,e(!0);var u=pc.transition;pc.transition={};try{e(!1),n()}finally{wt=o,pc.transition=u}}function Zd(){return kr().memoizedState}function Hg(e,n,o){var u=ai(e);if(o={lane:u,action:o,hasEagerState:!1,eagerState:null,next:null},ep(e))tp(n,o);else if(o=Md(e,n,o,u),o!==null){var p=Dn();Fr(o,e,u,p),np(o,n,u)}}function Vg(e,n,o){var u=ai(e),p={lane:u,action:o,hasEagerState:!1,eagerState:null,next:null};if(ep(e))tp(n,p);else{var y=e.alternate;if(e.lanes===0&&(y===null||y.lanes===0)&&(y=n.lastRenderedReducer,y!==null))try{var E=n.lastRenderedState,z=y(E,o);if(p.hasEagerState=!0,p.eagerState=z,ce(z,E)){var Y=n.interleaved;Y===null?(p.next=p,ac(n)):(p.next=Y.next,Y.next=p),n.interleaved=p;return}}catch{}finally{}o=Md(e,n,p,u),o!==null&&(p=Dn(),Fr(o,e,u,p),np(o,n,u))}}function ep(e){var n=e.alternate;return e===Bt||n!==null&&n===Bt}function tp(e,n){aa=wl=!0;var o=e.pending;o===null?n.next=n:(n.next=o.next,o.next=n),e.pending=n}function np(e,n,o){if((o&4194240)!==0){var u=n.lanes;u&=e.pendingLanes,o|=u,n.lanes=o,Bo(e,o)}}var Sl={readContext:Sr,useCallback:jn,useContext:jn,useEffect:jn,useImperativeHandle:jn,useInsertionEffect:jn,useLayoutEffect:jn,useMemo:jn,useReducer:jn,useRef:jn,useState:jn,useDebugValue:jn,useDeferredValue:jn,useTransition:jn,useMutableSource:jn,useSyncExternalStore:jn,useId:jn,unstable_isNewReconciler:!1},Ug={readContext:Sr,useCallback:function(e,n){return to().memoizedState=[e,n===void 0?null:n],e},useContext:Sr,useEffect:Kd,useImperativeHandle:function(e,n,o){return o=o!=null?o.concat([e]):null,bl(4194308,4,Yd.bind(null,n,e),o)},useLayoutEffect:function(e,n){return bl(4194308,4,e,n)},useInsertionEffect:function(e,n){return bl(4,2,e,n)},useMemo:function(e,n){var o=to();return n=n===void 0?null:n,e=e(),o.memoizedState=[e,n],e},useReducer:function(e,n,o){var u=to();return n=o!==void 0?o(n):n,u.memoizedState=u.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},u.queue=e,e=e.dispatch=Hg.bind(null,Bt,e),[u.memoizedState,e]},useRef:function(e){var n=to();return e={current:e},n.memoizedState=e},useState:Vd,useDebugValue:wc,useDeferredValue:function(e){return to().memoizedState=e},useTransition:function(){var e=Vd(!1),n=e[0];return e=Bg.bind(null,e[1]),to().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,o){var u=Bt,p=to();if(Ot){if(o===void 0)throw Error(i(407));o=o()}else{if(o=n(),hn===null)throw Error(i(349));($i&30)!==0||Dd(u,n,o)}p.memoizedState=o;var y={value:o,getSnapshot:n};return p.queue=y,Kd(Fd.bind(null,u,y,e),[e]),u.flags|=2048,ca(9,zd.bind(null,u,y,o,n),void 0,null),o},useId:function(){var e=to(),n=hn.identifierPrefix;if(Ot){var o=Co,u=Eo;o=(u&~(1<<32-Qe(u)-1)).toString(32)+o,n=":"+n+"R"+o,o=la++,0<o&&(n+="H"+o.toString(32)),n+=":"}else o=Fg++,n=":"+n+"r"+o.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},Kg={readContext:Sr,useCallback:Qd,useContext:Sr,useEffect:xc,useImperativeHandle:Xd,useInsertionEffect:qd,useLayoutEffect:Wd,useMemo:Gd,useReducer:yc,useRef:Ud,useState:function(){return yc(ua)},useDebugValue:wc,useDeferredValue:function(e){var n=kr();return Jd(n,on.memoizedState,e)},useTransition:function(){var e=yc(ua)[0],n=kr().memoizedState;return[e,n]},useMutableSource:Rd,useSyncExternalStore:Ld,useId:Zd,unstable_isNewReconciler:!1},qg={readContext:Sr,useCallback:Qd,useContext:Sr,useEffect:xc,useImperativeHandle:Xd,useInsertionEffect:qd,useLayoutEffect:Wd,useMemo:Gd,useReducer:vc,useRef:Ud,useState:function(){return vc(ua)},useDebugValue:wc,useDeferredValue:function(e){var n=kr();return on===null?n.memoizedState=e:Jd(n,on.memoizedState,e)},useTransition:function(){var e=vc(ua)[0],n=kr().memoizedState;return[e,n]},useMutableSource:Rd,useSyncExternalStore:Ld,useId:Zd,unstable_isNewReconciler:!1};function Lr(e,n){if(e&&e.defaultProps){n=Z({},n),e=e.defaultProps;for(var o in e)n[o]===void 0&&(n[o]=e[o]);return n}return n}function bc(e,n,o,u){n=e.memoizedState,o=o(u,n),o=o==null?n:Z({},n,o),e.memoizedState=o,e.lanes===0&&(e.updateQueue.baseState=o)}var kl={isMounted:function(e){return(e=e._reactInternals)?qt(e)===e:!1},enqueueSetState:function(e,n,o){e=e._reactInternals;var u=Dn(),p=ai(e),y=Po(u,p);y.payload=n,o!=null&&(y.callback=o),n=ri(e,y,p),n!==null&&(Fr(n,e,p,u),gl(n,e,p))},enqueueReplaceState:function(e,n,o){e=e._reactInternals;var u=Dn(),p=ai(e),y=Po(u,p);y.tag=1,y.payload=n,o!=null&&(y.callback=o),n=ri(e,y,p),n!==null&&(Fr(n,e,p,u),gl(n,e,p))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var o=Dn(),u=ai(e),p=Po(o,u);p.tag=2,n!=null&&(p.callback=n),n=ri(e,p,u),n!==null&&(Fr(n,e,u,o),gl(n,e,u))}};function rp(e,n,o,u,p,y,E){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(u,y,E):n.prototype&&n.prototype.isPureReactComponent?!ne(o,u)||!ne(p,y):!0}function op(e,n,o){var u=!1,p=ei,y=n.contextType;return typeof y=="object"&&y!==null?y=Sr(y):(p=Yn(n)?Ni:Cn.current,u=n.contextTypes,y=(u=u!=null)?cs(e,p):ei),n=new n(o,y),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=kl,e.stateNode=n,n._reactInternals=e,u&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=p,e.__reactInternalMemoizedMaskedChildContext=y),n}function ip(e,n,o,u){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(o,u),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(o,u),n.state!==e&&kl.enqueueReplaceState(n,n.state,null)}function _c(e,n,o,u){var p=e.stateNode;p.props=o,p.state=e.memoizedState,p.refs={},lc(e);var y=n.contextType;typeof y=="object"&&y!==null?p.context=Sr(y):(y=Yn(n)?Ni:Cn.current,p.context=cs(e,y)),p.state=e.memoizedState,y=n.getDerivedStateFromProps,typeof y=="function"&&(bc(e,n,y,o),p.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(n=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),n!==p.state&&kl.enqueueReplaceState(p,p.state,null),yl(e,o,p,u),p.state=e.memoizedState),typeof p.componentDidMount=="function"&&(e.flags|=4194308)}function vs(e,n){try{var o="",u=n;do o+=Te(u),u=u.return;while(u);var p=o}catch(y){p=`
|
|
39
|
+
Error generating stack: `+y.message+`
|
|
40
|
+
`+y.stack}return{value:e,source:n,stack:p,digest:null}}function Sc(e,n,o){return{value:e,source:null,stack:o??null,digest:n??null}}function kc(e,n){try{console.error(n.value)}catch(o){setTimeout(function(){throw o})}}var Wg=typeof WeakMap=="function"?WeakMap:Map;function sp(e,n,o){o=Po(-1,o),o.tag=3,o.payload={element:null};var u=n.value;return o.callback=function(){Ml||(Ml=!0,zc=u),kc(e,n)},o}function ap(e,n,o){o=Po(-1,o),o.tag=3;var u=e.type.getDerivedStateFromError;if(typeof u=="function"){var p=n.value;o.payload=function(){return u(p)},o.callback=function(){kc(e,n)}}var y=e.stateNode;return y!==null&&typeof y.componentDidCatch=="function"&&(o.callback=function(){kc(e,n),typeof u!="function"&&(ii===null?ii=new Set([this]):ii.add(this));var E=n.stack;this.componentDidCatch(n.value,{componentStack:E!==null?E:""})}),o}function lp(e,n,o){var u=e.pingCache;if(u===null){u=e.pingCache=new Wg;var p=new Set;u.set(n,p)}else p=u.get(n),p===void 0&&(p=new Set,u.set(n,p));p.has(o)||(p.add(o),e=ay.bind(null,e,n,o),n.then(e,e))}function up(e){do{var n;if((n=e.tag===13)&&(n=e.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return e;e=e.return}while(e!==null);return null}function cp(e,n,o,u,p){return(e.mode&1)===0?(e===n?e.flags|=65536:(e.flags|=128,o.flags|=131072,o.flags&=-52805,o.tag===1&&(o.alternate===null?o.tag=17:(n=Po(-1,1),n.tag=2,ri(o,n,1))),o.lanes|=1),e):(e.flags|=65536,e.lanes=p,e)}var Yg=R.ReactCurrentOwner,Xn=!1;function Ln(e,n,o,u){n.child=e===null?$d(n,null,o,u):hs(n,e.child,o,u)}function fp(e,n,o,u,p){o=o.render;var y=n.ref;return gs(n,p),u=mc(e,n,o,u,y,p),o=gc(),e!==null&&!Xn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~p,$o(e,n,p)):(Ot&&o&&Ju(n),n.flags|=1,Ln(e,n,u,p),n.child)}function dp(e,n,o,u,p){if(e===null){var y=o.type;return typeof y=="function"&&!qc(y)&&y.defaultProps===void 0&&o.compare===null&&o.defaultProps===void 0?(n.tag=15,n.type=y,pp(e,n,y,u,p)):(e=Ll(o.type,null,u,n,n.mode,p),e.ref=n.ref,e.return=n,n.child=e)}if(y=e.child,(e.lanes&p)===0){var E=y.memoizedProps;if(o=o.compare,o=o!==null?o:ne,o(E,u)&&e.ref===n.ref)return $o(e,n,p)}return n.flags|=1,e=ui(y,u),e.ref=n.ref,e.return=n,n.child=e}function pp(e,n,o,u,p){if(e!==null){var y=e.memoizedProps;if(ne(y,u)&&e.ref===n.ref)if(Xn=!1,n.pendingProps=u=y,(e.lanes&p)!==0)(e.flags&131072)!==0&&(Xn=!0);else return n.lanes=e.lanes,$o(e,n,p)}return Nc(e,n,o,u,p)}function hp(e,n,o){var u=n.pendingProps,p=u.children,y=e!==null?e.memoizedState:null;if(u.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ct(ws,lr),lr|=o;else{if((o&1073741824)===0)return e=y!==null?y.baseLanes|o:o,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,Ct(ws,lr),lr|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},u=y!==null?y.baseLanes:o,Ct(ws,lr),lr|=u}else y!==null?(u=y.baseLanes|o,n.memoizedState=null):u=o,Ct(ws,lr),lr|=u;return Ln(e,n,p,o),n.child}function mp(e,n){var o=n.ref;(e===null&&o!==null||e!==null&&e.ref!==o)&&(n.flags|=512,n.flags|=2097152)}function Nc(e,n,o,u,p){var y=Yn(o)?Ni:Cn.current;return y=cs(n,y),gs(n,p),o=mc(e,n,o,u,y,p),u=gc(),e!==null&&!Xn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~p,$o(e,n,p)):(Ot&&u&&Ju(n),n.flags|=1,Ln(e,n,o,p),n.child)}function gp(e,n,o,u,p){if(Yn(o)){var y=!0;ll(n)}else y=!1;if(gs(n,p),n.stateNode===null)El(e,n),op(n,o,u),_c(n,o,u,p),u=!0;else if(e===null){var E=n.stateNode,z=n.memoizedProps;E.props=z;var Y=E.context,xe=o.contextType;typeof xe=="object"&&xe!==null?xe=Sr(xe):(xe=Yn(o)?Ni:Cn.current,xe=cs(n,xe));var Me=o.getDerivedStateFromProps,Ae=typeof Me=="function"||typeof E.getSnapshotBeforeUpdate=="function";Ae||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(z!==u||Y!==xe)&&ip(n,E,u,xe),ni=!1;var $e=n.memoizedState;E.state=$e,yl(n,u,E,p),Y=n.memoizedState,z!==u||$e!==Y||Wn.current||ni?(typeof Me=="function"&&(bc(n,o,Me,u),Y=n.memoizedState),(z=ni||rp(n,o,z,u,$e,Y,xe))?(Ae||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(n.flags|=4194308)):(typeof E.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=u,n.memoizedState=Y),E.props=u,E.state=Y,E.context=xe,u=z):(typeof E.componentDidMount=="function"&&(n.flags|=4194308),u=!1)}else{E=n.stateNode,Id(e,n),z=n.memoizedProps,xe=n.type===n.elementType?z:Lr(n.type,z),E.props=xe,Ae=n.pendingProps,$e=E.context,Y=o.contextType,typeof Y=="object"&&Y!==null?Y=Sr(Y):(Y=Yn(o)?Ni:Cn.current,Y=cs(n,Y));var Ke=o.getDerivedStateFromProps;(Me=typeof Ke=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(z!==Ae||$e!==Y)&&ip(n,E,u,Y),ni=!1,$e=n.memoizedState,E.state=$e,yl(n,u,E,p);var Ge=n.memoizedState;z!==Ae||$e!==Ge||Wn.current||ni?(typeof Ke=="function"&&(bc(n,o,Ke,u),Ge=n.memoizedState),(xe=ni||rp(n,o,xe,u,$e,Ge,Y)||!1)?(Me||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(u,Ge,Y),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(u,Ge,Y)),typeof E.componentDidUpdate=="function"&&(n.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof E.componentDidUpdate!="function"||z===e.memoizedProps&&$e===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||z===e.memoizedProps&&$e===e.memoizedState||(n.flags|=1024),n.memoizedProps=u,n.memoizedState=Ge),E.props=u,E.state=Ge,E.context=Y,u=xe):(typeof E.componentDidUpdate!="function"||z===e.memoizedProps&&$e===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||z===e.memoizedProps&&$e===e.memoizedState||(n.flags|=1024),u=!1)}return Ec(e,n,o,u,y,p)}function Ec(e,n,o,u,p,y){mp(e,n);var E=(n.flags&128)!==0;if(!u&&!E)return p&&bd(n,o,!1),$o(e,n,y);u=n.stateNode,Yg.current=n;var z=E&&typeof o.getDerivedStateFromError!="function"?null:u.render();return n.flags|=1,e!==null&&E?(n.child=hs(n,e.child,null,y),n.child=hs(n,null,z,y)):Ln(e,n,z,y),n.memoizedState=u.state,p&&bd(n,o,!0),n.child}function yp(e){var n=e.stateNode;n.pendingContext?xd(e,n.pendingContext,n.pendingContext!==n.context):n.context&&xd(e,n.context,!1),uc(e,n.containerInfo)}function vp(e,n,o,u,p){return ps(),nc(p),n.flags|=256,Ln(e,n,o,u),n.child}var Cc={dehydrated:null,treeContext:null,retryLane:0};function jc(e){return{baseLanes:e,cachePool:null,transitions:null}}function xp(e,n,o){var u=n.pendingProps,p=Ft.current,y=!1,E=(n.flags&128)!==0,z;if((z=E)||(z=e!==null&&e.memoizedState===null?!1:(p&2)!==0),z?(y=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(p|=1),Ct(Ft,p&1),e===null)return tc(n),e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((n.mode&1)===0?n.lanes=1:e.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(E=u.children,e=u.fallback,y?(u=n.mode,y=n.child,E={mode:"hidden",children:E},(u&1)===0&&y!==null?(y.childLanes=0,y.pendingProps=E):y=Dl(E,u,0,null),e=Oi(e,u,o,null),y.return=n,e.return=n,y.sibling=e,n.child=y,n.child.memoizedState=jc(o),n.memoizedState=Cc,e):Pc(n,E));if(p=e.memoizedState,p!==null&&(z=p.dehydrated,z!==null))return Xg(e,n,E,u,z,p,o);if(y){y=u.fallback,E=n.mode,p=e.child,z=p.sibling;var Y={mode:"hidden",children:u.children};return(E&1)===0&&n.child!==p?(u=n.child,u.childLanes=0,u.pendingProps=Y,n.deletions=null):(u=ui(p,Y),u.subtreeFlags=p.subtreeFlags&14680064),z!==null?y=ui(z,y):(y=Oi(y,E,o,null),y.flags|=2),y.return=n,u.return=n,u.sibling=y,n.child=u,u=y,y=n.child,E=e.child.memoizedState,E=E===null?jc(o):{baseLanes:E.baseLanes|o,cachePool:null,transitions:E.transitions},y.memoizedState=E,y.childLanes=e.childLanes&~o,n.memoizedState=Cc,u}return y=e.child,e=y.sibling,u=ui(y,{mode:"visible",children:u.children}),(n.mode&1)===0&&(u.lanes=o),u.return=n,u.sibling=null,e!==null&&(o=n.deletions,o===null?(n.deletions=[e],n.flags|=16):o.push(e)),n.child=u,n.memoizedState=null,u}function Pc(e,n){return n=Dl({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function Nl(e,n,o,u){return u!==null&&nc(u),hs(n,e.child,null,o),e=Pc(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Xg(e,n,o,u,p,y,E){if(o)return n.flags&256?(n.flags&=-257,u=Sc(Error(i(422))),Nl(e,n,E,u)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(y=u.fallback,p=n.mode,u=Dl({mode:"visible",children:u.children},p,0,null),y=Oi(y,p,E,null),y.flags|=2,u.return=n,y.return=n,u.sibling=y,n.child=u,(n.mode&1)!==0&&hs(n,e.child,null,E),n.child.memoizedState=jc(E),n.memoizedState=Cc,y);if((n.mode&1)===0)return Nl(e,n,E,null);if(p.data==="$!"){if(u=p.nextSibling&&p.nextSibling.dataset,u)var z=u.dgst;return u=z,y=Error(i(419)),u=Sc(y,u,void 0),Nl(e,n,E,u)}if(z=(E&e.childLanes)!==0,Xn||z){if(u=hn,u!==null){switch(E&-E){case 4:p=2;break;case 16:p=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:p=32;break;case 536870912:p=268435456;break;default:p=0}p=(p&(u.suspendedLanes|E))!==0?0:p,p!==0&&p!==y.retryLane&&(y.retryLane=p,jo(e,p),Fr(u,e,p,-1))}return Kc(),u=Sc(Error(i(421))),Nl(e,n,E,u)}return p.data==="$?"?(n.flags|=128,n.child=e.child,n=ly.bind(null,e),p._reactRetry=n,null):(e=y.treeContext,ar=Jo(p.nextSibling),sr=n,Ot=!0,Rr=null,e!==null&&(br[_r++]=Eo,br[_r++]=Co,br[_r++]=Ei,Eo=e.id,Co=e.overflow,Ei=n),n=Pc(n,u.children),n.flags|=4096,n)}function wp(e,n,o){e.lanes|=n;var u=e.alternate;u!==null&&(u.lanes|=n),sc(e.return,n,o)}function $c(e,n,o,u,p){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:p}:(y.isBackwards=n,y.rendering=null,y.renderingStartTime=0,y.last=u,y.tail=o,y.tailMode=p)}function bp(e,n,o){var u=n.pendingProps,p=u.revealOrder,y=u.tail;if(Ln(e,n,u.children,o),u=Ft.current,(u&2)!==0)u=u&1|2,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&wp(e,o,n);else if(e.tag===19)wp(e,o,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}u&=1}if(Ct(Ft,u),(n.mode&1)===0)n.memoizedState=null;else switch(p){case"forwards":for(o=n.child,p=null;o!==null;)e=o.alternate,e!==null&&vl(e)===null&&(p=o),o=o.sibling;o=p,o===null?(p=n.child,n.child=null):(p=o.sibling,o.sibling=null),$c(n,!1,p,o,y);break;case"backwards":for(o=null,p=n.child,n.child=null;p!==null;){if(e=p.alternate,e!==null&&vl(e)===null){n.child=p;break}e=p.sibling,p.sibling=o,o=p,p=e}$c(n,!0,o,null,y);break;case"together":$c(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function El(e,n){(n.mode&1)===0&&e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2)}function $o(e,n,o){if(e!==null&&(n.dependencies=e.dependencies),Mi|=n.lanes,(o&n.childLanes)===0)return null;if(e!==null&&n.child!==e.child)throw Error(i(153));if(n.child!==null){for(e=n.child,o=ui(e,e.pendingProps),n.child=o,o.return=n;e.sibling!==null;)e=e.sibling,o=o.sibling=ui(e,e.pendingProps),o.return=n;o.sibling=null}return n.child}function Qg(e,n,o){switch(n.tag){case 3:yp(n),ps();break;case 5:Od(n);break;case 1:Yn(n.type)&&ll(n);break;case 4:uc(n,n.stateNode.containerInfo);break;case 10:var u=n.type._context,p=n.memoizedProps.value;Ct(hl,u._currentValue),u._currentValue=p;break;case 13:if(u=n.memoizedState,u!==null)return u.dehydrated!==null?(Ct(Ft,Ft.current&1),n.flags|=128,null):(o&n.child.childLanes)!==0?xp(e,n,o):(Ct(Ft,Ft.current&1),e=$o(e,n,o),e!==null?e.sibling:null);Ct(Ft,Ft.current&1);break;case 19:if(u=(o&n.childLanes)!==0,(e.flags&128)!==0){if(u)return bp(e,n,o);n.flags|=128}if(p=n.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),Ct(Ft,Ft.current),u)break;return null;case 22:case 23:return n.lanes=0,hp(e,n,o)}return $o(e,n,o)}var _p,Mc,Sp,kp;_p=function(e,n){for(var o=n.child;o!==null;){if(o.tag===5||o.tag===6)e.appendChild(o.stateNode);else if(o.tag!==4&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===n)break;for(;o.sibling===null;){if(o.return===null||o.return===n)return;o=o.return}o.sibling.return=o.return,o=o.sibling}},Mc=function(){},Sp=function(e,n,o,u){var p=e.memoizedProps;if(p!==u){e=n.stateNode,Pi(eo.current);var y=null;switch(o){case"input":p=qe(e,p),u=qe(e,u),y=[];break;case"select":p=Z({},p,{value:void 0}),u=Z({},u,{value:void 0}),y=[];break;case"textarea":p=Kt(e,p),u=Kt(e,u),y=[];break;default:typeof p.onClick!="function"&&typeof u.onClick=="function"&&(e.onclick=il)}Ye(o,u);var E;o=null;for(xe in p)if(!u.hasOwnProperty(xe)&&p.hasOwnProperty(xe)&&p[xe]!=null)if(xe==="style"){var z=p[xe];for(E in z)z.hasOwnProperty(E)&&(o||(o={}),o[E]="")}else xe!=="dangerouslySetInnerHTML"&&xe!=="children"&&xe!=="suppressContentEditableWarning"&&xe!=="suppressHydrationWarning"&&xe!=="autoFocus"&&(l.hasOwnProperty(xe)?y||(y=[]):(y=y||[]).push(xe,null));for(xe in u){var Y=u[xe];if(z=p!=null?p[xe]:void 0,u.hasOwnProperty(xe)&&Y!==z&&(Y!=null||z!=null))if(xe==="style")if(z){for(E in z)!z.hasOwnProperty(E)||Y&&Y.hasOwnProperty(E)||(o||(o={}),o[E]="");for(E in Y)Y.hasOwnProperty(E)&&z[E]!==Y[E]&&(o||(o={}),o[E]=Y[E])}else o||(y||(y=[]),y.push(xe,o)),o=Y;else xe==="dangerouslySetInnerHTML"?(Y=Y?Y.__html:void 0,z=z?z.__html:void 0,Y!=null&&z!==Y&&(y=y||[]).push(xe,Y)):xe==="children"?typeof Y!="string"&&typeof Y!="number"||(y=y||[]).push(xe,""+Y):xe!=="suppressContentEditableWarning"&&xe!=="suppressHydrationWarning"&&(l.hasOwnProperty(xe)?(Y!=null&&xe==="onScroll"&&Pt("scroll",e),y||z===Y||(y=[])):(y=y||[]).push(xe,Y))}o&&(y=y||[]).push("style",o);var xe=y;(n.updateQueue=xe)&&(n.flags|=4)}},kp=function(e,n,o,u){o!==u&&(n.flags|=4)};function fa(e,n){if(!Ot)switch(e.tailMode){case"hidden":n=e.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?e.tail=null:o.sibling=null;break;case"collapsed":o=e.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:u.sibling=null}}function Pn(e){var n=e.alternate!==null&&e.alternate.child===e.child,o=0,u=0;if(n)for(var p=e.child;p!==null;)o|=p.lanes|p.childLanes,u|=p.subtreeFlags&14680064,u|=p.flags&14680064,p.return=e,p=p.sibling;else for(p=e.child;p!==null;)o|=p.lanes|p.childLanes,u|=p.subtreeFlags,u|=p.flags,p.return=e,p=p.sibling;return e.subtreeFlags|=u,e.childLanes=o,n}function Gg(e,n,o){var u=n.pendingProps;switch(Zu(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pn(n),null;case 1:return Yn(n.type)&&al(),Pn(n),null;case 3:return u=n.stateNode,ys(),$t(Wn),$t(Cn),dc(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(e===null||e.child===null)&&(dl(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Rr!==null&&(Hc(Rr),Rr=null))),Mc(e,n),Pn(n),null;case 5:cc(n);var p=Pi(sa.current);if(o=n.type,e!==null&&n.stateNode!=null)Sp(e,n,o,u,p),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!u){if(n.stateNode===null)throw Error(i(166));return Pn(n),null}if(e=Pi(eo.current),dl(n)){u=n.stateNode,o=n.type;var y=n.memoizedProps;switch(u[Zr]=n,u[ta]=y,e=(n.mode&1)!==0,o){case"dialog":Pt("cancel",u),Pt("close",u);break;case"iframe":case"object":case"embed":Pt("load",u);break;case"video":case"audio":for(p=0;p<So.length;p++)Pt(So[p],u);break;case"source":Pt("error",u);break;case"img":case"image":case"link":Pt("error",u),Pt("load",u);break;case"details":Pt("toggle",u);break;case"input":nt(u,y),Pt("invalid",u);break;case"select":u._wrapperState={wasMultiple:!!y.multiple},Pt("invalid",u);break;case"textarea":kn(u,y),Pt("invalid",u)}Ye(o,y),p=null;for(var E in y)if(y.hasOwnProperty(E)){var z=y[E];E==="children"?typeof z=="string"?u.textContent!==z&&(y.suppressHydrationWarning!==!0&&ol(u.textContent,z,e),p=["children",z]):typeof z=="number"&&u.textContent!==""+z&&(y.suppressHydrationWarning!==!0&&ol(u.textContent,z,e),p=["children",""+z]):l.hasOwnProperty(E)&&z!=null&&E==="onScroll"&&Pt("scroll",u)}switch(o){case"input":Ze(u),gn(u,y,!0);break;case"textarea":Ze(u),an(u);break;case"select":case"option":break;default:typeof y.onClick=="function"&&(u.onclick=il)}u=p,n.updateQueue=u,u!==null&&(n.flags|=4)}else{E=p.nodeType===9?p:p.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Et(o)),e==="http://www.w3.org/1999/xhtml"?o==="script"?(e=E.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof u.is=="string"?e=E.createElement(o,{is:u.is}):(e=E.createElement(o),o==="select"&&(E=e,u.multiple?E.multiple=!0:u.size&&(E.size=u.size))):e=E.createElementNS(e,o),e[Zr]=n,e[ta]=u,_p(e,n,!1,!1),n.stateNode=e;e:{switch(E=_t(o,u),o){case"dialog":Pt("cancel",e),Pt("close",e),p=u;break;case"iframe":case"object":case"embed":Pt("load",e),p=u;break;case"video":case"audio":for(p=0;p<So.length;p++)Pt(So[p],e);p=u;break;case"source":Pt("error",e),p=u;break;case"img":case"image":case"link":Pt("error",e),Pt("load",e),p=u;break;case"details":Pt("toggle",e),p=u;break;case"input":nt(e,u),p=qe(e,u),Pt("invalid",e);break;case"option":p=u;break;case"select":e._wrapperState={wasMultiple:!!u.multiple},p=Z({},u,{value:void 0}),Pt("invalid",e);break;case"textarea":kn(e,u),p=Kt(e,u),Pt("invalid",e);break;default:p=u}Ye(o,p),z=p;for(y in z)if(z.hasOwnProperty(y)){var Y=z[y];y==="style"?ln(e,Y):y==="dangerouslySetInnerHTML"?(Y=Y?Y.__html:void 0,Y!=null&&er(e,Y)):y==="children"?typeof Y=="string"?(o!=="textarea"||Y!=="")&&nn(e,Y):typeof Y=="number"&&nn(e,""+Y):y!=="suppressContentEditableWarning"&&y!=="suppressHydrationWarning"&&y!=="autoFocus"&&(l.hasOwnProperty(y)?Y!=null&&y==="onScroll"&&Pt("scroll",e):Y!=null&&$(e,y,Y,E))}switch(o){case"input":Ze(e),gn(e,u,!1);break;case"textarea":Ze(e),an(e);break;case"option":u.value!=null&&e.setAttribute("value",""+Se(u.value));break;case"select":e.multiple=!!u.multiple,y=u.value,y!=null?kt(e,!!u.multiple,y,!1):u.defaultValue!=null&&kt(e,!!u.multiple,u.defaultValue,!0);break;default:typeof p.onClick=="function"&&(e.onclick=il)}switch(o){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}}u&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return Pn(n),null;case 6:if(e&&n.stateNode!=null)kp(e,n,e.memoizedProps,u);else{if(typeof u!="string"&&n.stateNode===null)throw Error(i(166));if(o=Pi(sa.current),Pi(eo.current),dl(n)){if(u=n.stateNode,o=n.memoizedProps,u[Zr]=n,(y=u.nodeValue!==o)&&(e=sr,e!==null))switch(e.tag){case 3:ol(u.nodeValue,o,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ol(u.nodeValue,o,(e.mode&1)!==0)}y&&(n.flags|=4)}else u=(o.nodeType===9?o:o.ownerDocument).createTextNode(u),u[Zr]=n,n.stateNode=u}return Pn(n),null;case 13:if($t(Ft),u=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ot&&ar!==null&&(n.mode&1)!==0&&(n.flags&128)===0)Cd(),ps(),n.flags|=98560,y=!1;else if(y=dl(n),u!==null&&u.dehydrated!==null){if(e===null){if(!y)throw Error(i(318));if(y=n.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(i(317));y[Zr]=n}else ps(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Pn(n),y=!1}else Rr!==null&&(Hc(Rr),Rr=null),y=!0;if(!y)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=o,n):(u=u!==null,u!==(e!==null&&e.memoizedState!==null)&&u&&(n.child.flags|=8192,(n.mode&1)!==0&&(e===null||(Ft.current&1)!==0?sn===0&&(sn=3):Kc())),n.updateQueue!==null&&(n.flags|=4),Pn(n),null);case 4:return ys(),Mc(e,n),e===null&&Zs(n.stateNode.containerInfo),Pn(n),null;case 10:return ic(n.type._context),Pn(n),null;case 17:return Yn(n.type)&&al(),Pn(n),null;case 19:if($t(Ft),y=n.memoizedState,y===null)return Pn(n),null;if(u=(n.flags&128)!==0,E=y.rendering,E===null)if(u)fa(y,!1);else{if(sn!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(E=vl(e),E!==null){for(n.flags|=128,fa(y,!1),u=E.updateQueue,u!==null&&(n.updateQueue=u,n.flags|=4),n.subtreeFlags=0,u=o,o=n.child;o!==null;)y=o,e=u,y.flags&=14680066,E=y.alternate,E===null?(y.childLanes=0,y.lanes=e,y.child=null,y.subtreeFlags=0,y.memoizedProps=null,y.memoizedState=null,y.updateQueue=null,y.dependencies=null,y.stateNode=null):(y.childLanes=E.childLanes,y.lanes=E.lanes,y.child=E.child,y.subtreeFlags=0,y.deletions=null,y.memoizedProps=E.memoizedProps,y.memoizedState=E.memoizedState,y.updateQueue=E.updateQueue,y.type=E.type,e=E.dependencies,y.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),o=o.sibling;return Ct(Ft,Ft.current&1|2),n.child}e=e.sibling}y.tail!==null&&pt()>bs&&(n.flags|=128,u=!0,fa(y,!1),n.lanes=4194304)}else{if(!u)if(e=vl(E),e!==null){if(n.flags|=128,u=!0,o=e.updateQueue,o!==null&&(n.updateQueue=o,n.flags|=4),fa(y,!0),y.tail===null&&y.tailMode==="hidden"&&!E.alternate&&!Ot)return Pn(n),null}else 2*pt()-y.renderingStartTime>bs&&o!==1073741824&&(n.flags|=128,u=!0,fa(y,!1),n.lanes=4194304);y.isBackwards?(E.sibling=n.child,n.child=E):(o=y.last,o!==null?o.sibling=E:n.child=E,y.last=E)}return y.tail!==null?(n=y.tail,y.rendering=n,y.tail=n.sibling,y.renderingStartTime=pt(),n.sibling=null,o=Ft.current,Ct(Ft,u?o&1|2:o&1),n):(Pn(n),null);case 22:case 23:return Uc(),u=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==u&&(n.flags|=8192),u&&(n.mode&1)!==0?(lr&1073741824)!==0&&(Pn(n),n.subtreeFlags&6&&(n.flags|=8192)):Pn(n),null;case 24:return null;case 25:return null}throw Error(i(156,n.tag))}function Jg(e,n){switch(Zu(n),n.tag){case 1:return Yn(n.type)&&al(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return ys(),$t(Wn),$t(Cn),dc(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return cc(n),null;case 13:if($t(Ft),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));ps()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return $t(Ft),null;case 4:return ys(),null;case 10:return ic(n.type._context),null;case 22:case 23:return Uc(),null;case 24:return null;default:return null}}var Cl=!1,$n=!1,Zg=typeof WeakSet=="function"?WeakSet:Set,Xe=null;function xs(e,n){var o=e.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(u){Ut(e,n,u)}else o.current=null}function Ic(e,n,o){try{o()}catch(u){Ut(e,n,u)}}var Np=!1;function ey(e,n){if(Uu=qi,e=ie(),oe(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var u=o.getSelection&&o.getSelection();if(u&&u.rangeCount!==0){o=u.anchorNode;var p=u.anchorOffset,y=u.focusNode;u=u.focusOffset;try{o.nodeType,y.nodeType}catch{o=null;break e}var E=0,z=-1,Y=-1,xe=0,Me=0,Ae=e,$e=null;t:for(;;){for(var Ke;Ae!==o||p!==0&&Ae.nodeType!==3||(z=E+p),Ae!==y||u!==0&&Ae.nodeType!==3||(Y=E+u),Ae.nodeType===3&&(E+=Ae.nodeValue.length),(Ke=Ae.firstChild)!==null;)$e=Ae,Ae=Ke;for(;;){if(Ae===e)break t;if($e===o&&++xe===p&&(z=E),$e===y&&++Me===u&&(Y=E),(Ke=Ae.nextSibling)!==null)break;Ae=$e,$e=Ae.parentNode}Ae=Ke}o=z===-1||Y===-1?null:{start:z,end:Y}}else o=null}o=o||{start:0,end:0}}else o=null;for(Ku={focusedElem:e,selectionRange:o},qi=!1,Xe=n;Xe!==null;)if(n=Xe,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,Xe=e;else for(;Xe!==null;){n=Xe;try{var Ge=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(Ge!==null){var Je=Ge.memoizedProps,Yt=Ge.memoizedState,me=n.stateNode,re=me.getSnapshotBeforeUpdate(n.elementType===n.type?Je:Lr(n.type,Je),Yt);me.__reactInternalSnapshotBeforeUpdate=re}break;case 3:var ge=n.stateNode.containerInfo;ge.nodeType===1?ge.textContent="":ge.nodeType===9&&ge.documentElement&&ge.removeChild(ge.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(Fe){Ut(n,n.return,Fe)}if(e=n.sibling,e!==null){e.return=n.return,Xe=e;break}Xe=n.return}return Ge=Np,Np=!1,Ge}function da(e,n,o){var u=n.updateQueue;if(u=u!==null?u.lastEffect:null,u!==null){var p=u=u.next;do{if((p.tag&e)===e){var y=p.destroy;p.destroy=void 0,y!==void 0&&Ic(n,o,y)}p=p.next}while(p!==u)}}function jl(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var u=o.create;o.destroy=u()}o=o.next}while(o!==n)}}function Tc(e){var n=e.ref;if(n!==null){var o=e.stateNode;switch(e.tag){case 5:e=o;break;default:e=o}typeof n=="function"?n(e):n.current=e}}function Ep(e){var n=e.alternate;n!==null&&(e.alternate=null,Ep(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[Zr],delete n[ta],delete n[Xu],delete n[Rg],delete n[Lg])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Cp(e){return e.tag===5||e.tag===3||e.tag===4}function jp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Cp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ac(e,n,o){var u=e.tag;if(u===5||u===6)e=e.stateNode,n?o.nodeType===8?o.parentNode.insertBefore(e,n):o.insertBefore(e,n):(o.nodeType===8?(n=o.parentNode,n.insertBefore(e,o)):(n=o,n.appendChild(e)),o=o._reactRootContainer,o!=null||n.onclick!==null||(n.onclick=il));else if(u!==4&&(e=e.child,e!==null))for(Ac(e,n,o),e=e.sibling;e!==null;)Ac(e,n,o),e=e.sibling}function Oc(e,n,o){var u=e.tag;if(u===5||u===6)e=e.stateNode,n?o.insertBefore(e,n):o.appendChild(e);else if(u!==4&&(e=e.child,e!==null))for(Oc(e,n,o),e=e.sibling;e!==null;)Oc(e,n,o),e=e.sibling}var _n=null,Dr=!1;function oi(e,n,o){for(o=o.child;o!==null;)Pp(e,n,o),o=o.sibling}function Pp(e,n,o){if(we&&typeof we.onCommitFiberUnmount=="function")try{we.onCommitFiberUnmount(L,o)}catch{}switch(o.tag){case 5:$n||xs(o,n);case 6:var u=_n,p=Dr;_n=null,oi(e,n,o),_n=u,Dr=p,_n!==null&&(Dr?(e=_n,o=o.stateNode,e.nodeType===8?e.parentNode.removeChild(o):e.removeChild(o)):_n.removeChild(o.stateNode));break;case 18:_n!==null&&(Dr?(e=_n,o=o.stateNode,e.nodeType===8?Yu(e.parentNode,o):e.nodeType===1&&Yu(e,o),ho(e)):Yu(_n,o.stateNode));break;case 4:u=_n,p=Dr,_n=o.stateNode.containerInfo,Dr=!0,oi(e,n,o),_n=u,Dr=p;break;case 0:case 11:case 14:case 15:if(!$n&&(u=o.updateQueue,u!==null&&(u=u.lastEffect,u!==null))){p=u=u.next;do{var y=p,E=y.destroy;y=y.tag,E!==void 0&&((y&2)!==0||(y&4)!==0)&&Ic(o,n,E),p=p.next}while(p!==u)}oi(e,n,o);break;case 1:if(!$n&&(xs(o,n),u=o.stateNode,typeof u.componentWillUnmount=="function"))try{u.props=o.memoizedProps,u.state=o.memoizedState,u.componentWillUnmount()}catch(z){Ut(o,n,z)}oi(e,n,o);break;case 21:oi(e,n,o);break;case 22:o.mode&1?($n=(u=$n)||o.memoizedState!==null,oi(e,n,o),$n=u):oi(e,n,o);break;default:oi(e,n,o)}}function $p(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var o=e.stateNode;o===null&&(o=e.stateNode=new Zg),n.forEach(function(u){var p=uy.bind(null,e,u);o.has(u)||(o.add(u),u.then(p,p))})}}function zr(e,n){var o=n.deletions;if(o!==null)for(var u=0;u<o.length;u++){var p=o[u];try{var y=e,E=n,z=E;e:for(;z!==null;){switch(z.tag){case 5:_n=z.stateNode,Dr=!1;break e;case 3:_n=z.stateNode.containerInfo,Dr=!0;break e;case 4:_n=z.stateNode.containerInfo,Dr=!0;break e}z=z.return}if(_n===null)throw Error(i(160));Pp(y,E,p),_n=null,Dr=!1;var Y=p.alternate;Y!==null&&(Y.return=null),p.return=null}catch(xe){Ut(p,n,xe)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)Mp(n,e),n=n.sibling}function Mp(e,n){var o=e.alternate,u=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(zr(n,e),no(e),u&4){try{da(3,e,e.return),jl(3,e)}catch(Je){Ut(e,e.return,Je)}try{da(5,e,e.return)}catch(Je){Ut(e,e.return,Je)}}break;case 1:zr(n,e),no(e),u&512&&o!==null&&xs(o,o.return);break;case 5:if(zr(n,e),no(e),u&512&&o!==null&&xs(o,o.return),e.flags&32){var p=e.stateNode;try{nn(p,"")}catch(Je){Ut(e,e.return,Je)}}if(u&4&&(p=e.stateNode,p!=null)){var y=e.memoizedProps,E=o!==null?o.memoizedProps:y,z=e.type,Y=e.updateQueue;if(e.updateQueue=null,Y!==null)try{z==="input"&&y.type==="radio"&&y.name!=null&&ct(p,y),_t(z,E);var xe=_t(z,y);for(E=0;E<Y.length;E+=2){var Me=Y[E],Ae=Y[E+1];Me==="style"?ln(p,Ae):Me==="dangerouslySetInnerHTML"?er(p,Ae):Me==="children"?nn(p,Ae):$(p,Me,Ae,xe)}switch(z){case"input":St(p,y);break;case"textarea":fr(p,y);break;case"select":var $e=p._wrapperState.wasMultiple;p._wrapperState.wasMultiple=!!y.multiple;var Ke=y.value;Ke!=null?kt(p,!!y.multiple,Ke,!1):$e!==!!y.multiple&&(y.defaultValue!=null?kt(p,!!y.multiple,y.defaultValue,!0):kt(p,!!y.multiple,y.multiple?[]:"",!1))}p[ta]=y}catch(Je){Ut(e,e.return,Je)}}break;case 6:if(zr(n,e),no(e),u&4){if(e.stateNode===null)throw Error(i(162));p=e.stateNode,y=e.memoizedProps;try{p.nodeValue=y}catch(Je){Ut(e,e.return,Je)}}break;case 3:if(zr(n,e),no(e),u&4&&o!==null&&o.memoizedState.isDehydrated)try{ho(n.containerInfo)}catch(Je){Ut(e,e.return,Je)}break;case 4:zr(n,e),no(e);break;case 13:zr(n,e),no(e),p=e.child,p.flags&8192&&(y=p.memoizedState!==null,p.stateNode.isHidden=y,!y||p.alternate!==null&&p.alternate.memoizedState!==null||(Dc=pt())),u&4&&$p(e);break;case 22:if(Me=o!==null&&o.memoizedState!==null,e.mode&1?($n=(xe=$n)||Me,zr(n,e),$n=xe):zr(n,e),no(e),u&8192){if(xe=e.memoizedState!==null,(e.stateNode.isHidden=xe)&&!Me&&(e.mode&1)!==0)for(Xe=e,Me=e.child;Me!==null;){for(Ae=Xe=Me;Xe!==null;){switch($e=Xe,Ke=$e.child,$e.tag){case 0:case 11:case 14:case 15:da(4,$e,$e.return);break;case 1:xs($e,$e.return);var Ge=$e.stateNode;if(typeof Ge.componentWillUnmount=="function"){u=$e,o=$e.return;try{n=u,Ge.props=n.memoizedProps,Ge.state=n.memoizedState,Ge.componentWillUnmount()}catch(Je){Ut(u,o,Je)}}break;case 5:xs($e,$e.return);break;case 22:if($e.memoizedState!==null){Ap(Ae);continue}}Ke!==null?(Ke.return=$e,Xe=Ke):Ap(Ae)}Me=Me.sibling}e:for(Me=null,Ae=e;;){if(Ae.tag===5){if(Me===null){Me=Ae;try{p=Ae.stateNode,xe?(y=p.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none"):(z=Ae.stateNode,Y=Ae.memoizedProps.style,E=Y!=null&&Y.hasOwnProperty("display")?Y.display:null,z.style.display=dr("display",E))}catch(Je){Ut(e,e.return,Je)}}}else if(Ae.tag===6){if(Me===null)try{Ae.stateNode.nodeValue=xe?"":Ae.memoizedProps}catch(Je){Ut(e,e.return,Je)}}else if((Ae.tag!==22&&Ae.tag!==23||Ae.memoizedState===null||Ae===e)&&Ae.child!==null){Ae.child.return=Ae,Ae=Ae.child;continue}if(Ae===e)break e;for(;Ae.sibling===null;){if(Ae.return===null||Ae.return===e)break e;Me===Ae&&(Me=null),Ae=Ae.return}Me===Ae&&(Me=null),Ae.sibling.return=Ae.return,Ae=Ae.sibling}}break;case 19:zr(n,e),no(e),u&4&&$p(e);break;case 21:break;default:zr(n,e),no(e)}}function no(e){var n=e.flags;if(n&2){try{e:{for(var o=e.return;o!==null;){if(Cp(o)){var u=o;break e}o=o.return}throw Error(i(160))}switch(u.tag){case 5:var p=u.stateNode;u.flags&32&&(nn(p,""),u.flags&=-33);var y=jp(e);Oc(e,y,p);break;case 3:case 4:var E=u.stateNode.containerInfo,z=jp(e);Ac(e,z,E);break;default:throw Error(i(161))}}catch(Y){Ut(e,e.return,Y)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function ty(e,n,o){Xe=e,Ip(e)}function Ip(e,n,o){for(var u=(e.mode&1)!==0;Xe!==null;){var p=Xe,y=p.child;if(p.tag===22&&u){var E=p.memoizedState!==null||Cl;if(!E){var z=p.alternate,Y=z!==null&&z.memoizedState!==null||$n;z=Cl;var xe=$n;if(Cl=E,($n=Y)&&!xe)for(Xe=p;Xe!==null;)E=Xe,Y=E.child,E.tag===22&&E.memoizedState!==null?Op(p):Y!==null?(Y.return=E,Xe=Y):Op(p);for(;y!==null;)Xe=y,Ip(y),y=y.sibling;Xe=p,Cl=z,$n=xe}Tp(e)}else(p.subtreeFlags&8772)!==0&&y!==null?(y.return=p,Xe=y):Tp(e)}}function Tp(e){for(;Xe!==null;){var n=Xe;if((n.flags&8772)!==0){var o=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:$n||jl(5,n);break;case 1:var u=n.stateNode;if(n.flags&4&&!$n)if(o===null)u.componentDidMount();else{var p=n.elementType===n.type?o.memoizedProps:Lr(n.type,o.memoizedProps);u.componentDidUpdate(p,o.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}var y=n.updateQueue;y!==null&&Ad(n,y,u);break;case 3:var E=n.updateQueue;if(E!==null){if(o=null,n.child!==null)switch(n.child.tag){case 5:o=n.child.stateNode;break;case 1:o=n.child.stateNode}Ad(n,E,o)}break;case 5:var z=n.stateNode;if(o===null&&n.flags&4){o=z;var Y=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":Y.autoFocus&&o.focus();break;case"img":Y.src&&(o.src=Y.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var xe=n.alternate;if(xe!==null){var Me=xe.memoizedState;if(Me!==null){var Ae=Me.dehydrated;Ae!==null&&ho(Ae)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}$n||n.flags&512&&Tc(n)}catch($e){Ut(n,n.return,$e)}}if(n===e){Xe=null;break}if(o=n.sibling,o!==null){o.return=n.return,Xe=o;break}Xe=n.return}}function Ap(e){for(;Xe!==null;){var n=Xe;if(n===e){Xe=null;break}var o=n.sibling;if(o!==null){o.return=n.return,Xe=o;break}Xe=n.return}}function Op(e){for(;Xe!==null;){var n=Xe;try{switch(n.tag){case 0:case 11:case 15:var o=n.return;try{jl(4,n)}catch(Y){Ut(n,o,Y)}break;case 1:var u=n.stateNode;if(typeof u.componentDidMount=="function"){var p=n.return;try{u.componentDidMount()}catch(Y){Ut(n,p,Y)}}var y=n.return;try{Tc(n)}catch(Y){Ut(n,y,Y)}break;case 5:var E=n.return;try{Tc(n)}catch(Y){Ut(n,E,Y)}}}catch(Y){Ut(n,n.return,Y)}if(n===e){Xe=null;break}var z=n.sibling;if(z!==null){z.return=n.return,Xe=z;break}Xe=n.return}}var ny=Math.ceil,Pl=R.ReactCurrentDispatcher,Rc=R.ReactCurrentOwner,Nr=R.ReactCurrentBatchConfig,xt=0,hn=null,en=null,Sn=0,lr=0,ws=Zo(0),sn=0,pa=null,Mi=0,$l=0,Lc=0,ha=null,Qn=null,Dc=0,bs=1/0,Mo=null,Ml=!1,zc=null,ii=null,Il=!1,si=null,Tl=0,ma=0,Fc=null,Al=-1,Ol=0;function Dn(){return(xt&6)!==0?pt():Al!==-1?Al:Al=pt()}function ai(e){return(e.mode&1)===0?1:(xt&2)!==0&&Sn!==0?Sn&-Sn:zg.transition!==null?(Ol===0&&(Ol=xr()),Ol):(e=wt,e!==0||(e=window.event,e=e===void 0?16:Wi(e.type)),e)}function Fr(e,n,o,u){if(50<ma)throw ma=0,Fc=null,Error(i(185));wr(e,o,u),((xt&2)===0||e!==hn)&&(e===hn&&((xt&2)===0&&($l|=o),sn===4&&li(e,Sn)),Gn(e,u),o===1&&xt===0&&(n.mode&1)===0&&(bs=pt()+500,ul&&ti()))}function Gn(e,n){var o=e.callbackNode;vr(e,n);var u=ht(e,e===hn?Sn:0);if(u===0)o!==null&&Wr(o),e.callbackNode=null,e.callbackPriority=0;else if(n=u&-u,e.callbackPriority!==n){if(o!=null&&Wr(o),n===1)e.tag===0?Dg(Lp.bind(null,e)):_d(Lp.bind(null,e)),Ag(function(){(xt&6)===0&&ti()}),o=null;else{switch(Va(u)){case 1:o=yr;break;case 4:o=Yr;break;case 16:o=rr;break;case 536870912:o=Xr;break;default:o=rr}o=Kp(o,Rp.bind(null,e))}e.callbackPriority=n,e.callbackNode=o}}function Rp(e,n){if(Al=-1,Ol=0,(xt&6)!==0)throw Error(i(327));var o=e.callbackNode;if(_s()&&e.callbackNode!==o)return null;var u=ht(e,e===hn?Sn:0);if(u===0)return null;if((u&30)!==0||(u&e.expiredLanes)!==0||n)n=Rl(e,u);else{n=u;var p=xt;xt|=2;var y=zp();(hn!==e||Sn!==n)&&(Mo=null,bs=pt()+500,Ti(e,n));do try{iy();break}catch(z){Dp(e,z)}while(!0);oc(),Pl.current=y,xt=p,en!==null?n=0:(hn=null,Sn=0,n=sn)}if(n!==0){if(n===2&&(p=vn(e),p!==0&&(u=p,n=Bc(e,p))),n===1)throw o=pa,Ti(e,0),li(e,u),Gn(e,pt()),o;if(n===6)li(e,u);else{if(p=e.current.alternate,(u&30)===0&&!ry(p)&&(n=Rl(e,u),n===2&&(y=vn(e),y!==0&&(u=y,n=Bc(e,y))),n===1))throw o=pa,Ti(e,0),li(e,u),Gn(e,pt()),o;switch(e.finishedWork=p,e.finishedLanes=u,n){case 0:case 1:throw Error(i(345));case 2:Ai(e,Qn,Mo);break;case 3:if(li(e,u),(u&130023424)===u&&(n=Dc+500-pt(),10<n)){if(ht(e,0)!==0)break;if(p=e.suspendedLanes,(p&u)!==u){Dn(),e.pingedLanes|=e.suspendedLanes&p;break}e.timeoutHandle=Wu(Ai.bind(null,e,Qn,Mo),n);break}Ai(e,Qn,Mo);break;case 4:if(li(e,u),(u&4194240)===u)break;for(n=e.eventTimes,p=-1;0<u;){var E=31-Qe(u);y=1<<E,E=n[E],E>p&&(p=E),u&=~y}if(u=p,u=pt()-u,u=(120>u?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*ny(u/1960))-u,10<u){e.timeoutHandle=Wu(Ai.bind(null,e,Qn,Mo),u);break}Ai(e,Qn,Mo);break;case 5:Ai(e,Qn,Mo);break;default:throw Error(i(329))}}}return Gn(e,pt()),e.callbackNode===o?Rp.bind(null,e):null}function Bc(e,n){var o=ha;return e.current.memoizedState.isDehydrated&&(Ti(e,n).flags|=256),e=Rl(e,n),e!==2&&(n=Qn,Qn=o,n!==null&&Hc(n)),e}function Hc(e){Qn===null?Qn=e:Qn.push.apply(Qn,e)}function ry(e){for(var n=e;;){if(n.flags&16384){var o=n.updateQueue;if(o!==null&&(o=o.stores,o!==null))for(var u=0;u<o.length;u++){var p=o[u],y=p.getSnapshot;p=p.value;try{if(!ce(y(),p))return!1}catch{return!1}}}if(o=n.child,n.subtreeFlags&16384&&o!==null)o.return=n,n=o;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function li(e,n){for(n&=~Lc,n&=~$l,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var o=31-Qe(n),u=1<<o;e[o]=-1,n&=~u}}function Lp(e){if((xt&6)!==0)throw Error(i(327));_s();var n=ht(e,0);if((n&1)===0)return Gn(e,pt()),null;var o=Rl(e,n);if(e.tag!==0&&o===2){var u=vn(e);u!==0&&(n=u,o=Bc(e,u))}if(o===1)throw o=pa,Ti(e,0),li(e,n),Gn(e,pt()),o;if(o===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,Ai(e,Qn,Mo),Gn(e,pt()),null}function Vc(e,n){var o=xt;xt|=1;try{return e(n)}finally{xt=o,xt===0&&(bs=pt()+500,ul&&ti())}}function Ii(e){si!==null&&si.tag===0&&(xt&6)===0&&_s();var n=xt;xt|=1;var o=Nr.transition,u=wt;try{if(Nr.transition=null,wt=1,e)return e()}finally{wt=u,Nr.transition=o,xt=n,(xt&6)===0&&ti()}}function Uc(){lr=ws.current,$t(ws)}function Ti(e,n){e.finishedWork=null,e.finishedLanes=0;var o=e.timeoutHandle;if(o!==-1&&(e.timeoutHandle=-1,Tg(o)),en!==null)for(o=en.return;o!==null;){var u=o;switch(Zu(u),u.tag){case 1:u=u.type.childContextTypes,u!=null&&al();break;case 3:ys(),$t(Wn),$t(Cn),dc();break;case 5:cc(u);break;case 4:ys();break;case 13:$t(Ft);break;case 19:$t(Ft);break;case 10:ic(u.type._context);break;case 22:case 23:Uc()}o=o.return}if(hn=e,en=e=ui(e.current,null),Sn=lr=n,sn=0,pa=null,Lc=$l=Mi=0,Qn=ha=null,ji!==null){for(n=0;n<ji.length;n++)if(o=ji[n],u=o.interleaved,u!==null){o.interleaved=null;var p=u.next,y=o.pending;if(y!==null){var E=y.next;y.next=p,u.next=E}o.pending=u}ji=null}return e}function Dp(e,n){do{var o=en;try{if(oc(),xl.current=Sl,wl){for(var u=Bt.memoizedState;u!==null;){var p=u.queue;p!==null&&(p.pending=null),u=u.next}wl=!1}if($i=0,pn=on=Bt=null,aa=!1,la=0,Rc.current=null,o===null||o.return===null){sn=1,pa=n,en=null;break}e:{var y=e,E=o.return,z=o,Y=n;if(n=Sn,z.flags|=32768,Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var xe=Y,Me=z,Ae=Me.tag;if((Me.mode&1)===0&&(Ae===0||Ae===11||Ae===15)){var $e=Me.alternate;$e?(Me.updateQueue=$e.updateQueue,Me.memoizedState=$e.memoizedState,Me.lanes=$e.lanes):(Me.updateQueue=null,Me.memoizedState=null)}var Ke=up(E);if(Ke!==null){Ke.flags&=-257,cp(Ke,E,z,y,n),Ke.mode&1&&lp(y,xe,n),n=Ke,Y=xe;var Ge=n.updateQueue;if(Ge===null){var Je=new Set;Je.add(Y),n.updateQueue=Je}else Ge.add(Y);break e}else{if((n&1)===0){lp(y,xe,n),Kc();break e}Y=Error(i(426))}}else if(Ot&&z.mode&1){var Yt=up(E);if(Yt!==null){(Yt.flags&65536)===0&&(Yt.flags|=256),cp(Yt,E,z,y,n),nc(vs(Y,z));break e}}y=Y=vs(Y,z),sn!==4&&(sn=2),ha===null?ha=[y]:ha.push(y),y=E;do{switch(y.tag){case 3:y.flags|=65536,n&=-n,y.lanes|=n;var me=sp(y,Y,n);Td(y,me);break e;case 1:z=Y;var re=y.type,ge=y.stateNode;if((y.flags&128)===0&&(typeof re.getDerivedStateFromError=="function"||ge!==null&&typeof ge.componentDidCatch=="function"&&(ii===null||!ii.has(ge)))){y.flags|=65536,n&=-n,y.lanes|=n;var Fe=ap(y,z,n);Td(y,Fe);break e}}y=y.return}while(y!==null)}Bp(o)}catch(et){n=et,en===o&&o!==null&&(en=o=o.return);continue}break}while(!0)}function zp(){var e=Pl.current;return Pl.current=Sl,e===null?Sl:e}function Kc(){(sn===0||sn===3||sn===2)&&(sn=4),hn===null||(Mi&268435455)===0&&($l&268435455)===0||li(hn,Sn)}function Rl(e,n){var o=xt;xt|=2;var u=zp();(hn!==e||Sn!==n)&&(Mo=null,Ti(e,n));do try{oy();break}catch(p){Dp(e,p)}while(!0);if(oc(),xt=o,Pl.current=u,en!==null)throw Error(i(261));return hn=null,Sn=0,sn}function oy(){for(;en!==null;)Fp(en)}function iy(){for(;en!==null&&!Nt();)Fp(en)}function Fp(e){var n=Up(e.alternate,e,lr);e.memoizedProps=e.pendingProps,n===null?Bp(e):en=n,Rc.current=null}function Bp(e){var n=e;do{var o=n.alternate;if(e=n.return,(n.flags&32768)===0){if(o=Gg(o,n,lr),o!==null){en=o;return}}else{if(o=Jg(o,n),o!==null){o.flags&=32767,en=o;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{sn=6,en=null;return}}if(n=n.sibling,n!==null){en=n;return}en=n=e}while(n!==null);sn===0&&(sn=5)}function Ai(e,n,o){var u=wt,p=Nr.transition;try{Nr.transition=null,wt=1,sy(e,n,o,u)}finally{Nr.transition=p,wt=u}return null}function sy(e,n,o,u){do _s();while(si!==null);if((xt&6)!==0)throw Error(i(327));o=e.finishedWork;var p=e.finishedLanes;if(o===null)return null;if(e.finishedWork=null,e.finishedLanes=0,o===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0;var y=o.lanes|o.childLanes;if(mi(e,y),e===hn&&(en=hn=null,Sn=0),(o.subtreeFlags&2064)===0&&(o.flags&2064)===0||Il||(Il=!0,Kp(rr,function(){return _s(),null})),y=(o.flags&15990)!==0,(o.subtreeFlags&15990)!==0||y){y=Nr.transition,Nr.transition=null;var E=wt;wt=1;var z=xt;xt|=4,Rc.current=null,ey(e,o),Mp(o,e),se(Ku),qi=!!Uu,Ku=Uu=null,e.current=o,ty(o),Un(),xt=z,wt=E,Nr.transition=y}else e.current=o;if(Il&&(Il=!1,si=e,Tl=p),y=e.pendingLanes,y===0&&(ii=null),Ee(o.stateNode),Gn(e,pt()),n!==null)for(u=e.onRecoverableError,o=0;o<n.length;o++)p=n[o],u(p.value,{componentStack:p.stack,digest:p.digest});if(Ml)throw Ml=!1,e=zc,zc=null,e;return(Tl&1)!==0&&e.tag!==0&&_s(),y=e.pendingLanes,(y&1)!==0?e===Fc?ma++:(ma=0,Fc=e):ma=0,ti(),null}function _s(){if(si!==null){var e=Va(Tl),n=Nr.transition,o=wt;try{if(Nr.transition=null,wt=16>e?16:e,si===null)var u=!1;else{if(e=si,si=null,Tl=0,(xt&6)!==0)throw Error(i(331));var p=xt;for(xt|=4,Xe=e.current;Xe!==null;){var y=Xe,E=y.child;if((Xe.flags&16)!==0){var z=y.deletions;if(z!==null){for(var Y=0;Y<z.length;Y++){var xe=z[Y];for(Xe=xe;Xe!==null;){var Me=Xe;switch(Me.tag){case 0:case 11:case 15:da(8,Me,y)}var Ae=Me.child;if(Ae!==null)Ae.return=Me,Xe=Ae;else for(;Xe!==null;){Me=Xe;var $e=Me.sibling,Ke=Me.return;if(Ep(Me),Me===xe){Xe=null;break}if($e!==null){$e.return=Ke,Xe=$e;break}Xe=Ke}}}var Ge=y.alternate;if(Ge!==null){var Je=Ge.child;if(Je!==null){Ge.child=null;do{var Yt=Je.sibling;Je.sibling=null,Je=Yt}while(Je!==null)}}Xe=y}}if((y.subtreeFlags&2064)!==0&&E!==null)E.return=y,Xe=E;else e:for(;Xe!==null;){if(y=Xe,(y.flags&2048)!==0)switch(y.tag){case 0:case 11:case 15:da(9,y,y.return)}var me=y.sibling;if(me!==null){me.return=y.return,Xe=me;break e}Xe=y.return}}var re=e.current;for(Xe=re;Xe!==null;){E=Xe;var ge=E.child;if((E.subtreeFlags&2064)!==0&&ge!==null)ge.return=E,Xe=ge;else e:for(E=re;Xe!==null;){if(z=Xe,(z.flags&2048)!==0)try{switch(z.tag){case 0:case 11:case 15:jl(9,z)}}catch(et){Ut(z,z.return,et)}if(z===E){Xe=null;break e}var Fe=z.sibling;if(Fe!==null){Fe.return=z.return,Xe=Fe;break e}Xe=z.return}}if(xt=p,ti(),we&&typeof we.onPostCommitFiberRoot=="function")try{we.onPostCommitFiberRoot(L,e)}catch{}u=!0}return u}finally{wt=o,Nr.transition=n}}return!1}function Hp(e,n,o){n=vs(o,n),n=sp(e,n,1),e=ri(e,n,1),n=Dn(),e!==null&&(wr(e,1,n),Gn(e,n))}function Ut(e,n,o){if(e.tag===3)Hp(e,e,o);else for(;n!==null;){if(n.tag===3){Hp(n,e,o);break}else if(n.tag===1){var u=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(ii===null||!ii.has(u))){e=vs(o,e),e=ap(n,e,1),n=ri(n,e,1),e=Dn(),n!==null&&(wr(n,1,e),Gn(n,e));break}}n=n.return}}function ay(e,n,o){var u=e.pingCache;u!==null&&u.delete(n),n=Dn(),e.pingedLanes|=e.suspendedLanes&o,hn===e&&(Sn&o)===o&&(sn===4||sn===3&&(Sn&130023424)===Sn&&500>pt()-Dc?Ti(e,0):Lc|=o),Gn(e,n)}function Vp(e,n){n===0&&((e.mode&1)===0?n=1:(n=Dt,Dt<<=1,(Dt&130023424)===0&&(Dt=4194304)));var o=Dn();e=jo(e,n),e!==null&&(wr(e,n,o),Gn(e,o))}function ly(e){var n=e.memoizedState,o=0;n!==null&&(o=n.retryLane),Vp(e,o)}function uy(e,n){var o=0;switch(e.tag){case 13:var u=e.stateNode,p=e.memoizedState;p!==null&&(o=p.retryLane);break;case 19:u=e.stateNode;break;default:throw Error(i(314))}u!==null&&u.delete(n),Vp(e,o)}var Up;Up=function(e,n,o){if(e!==null)if(e.memoizedProps!==n.pendingProps||Wn.current)Xn=!0;else{if((e.lanes&o)===0&&(n.flags&128)===0)return Xn=!1,Qg(e,n,o);Xn=(e.flags&131072)!==0}else Xn=!1,Ot&&(n.flags&1048576)!==0&&Sd(n,fl,n.index);switch(n.lanes=0,n.tag){case 2:var u=n.type;El(e,n),e=n.pendingProps;var p=cs(n,Cn.current);gs(n,o),p=mc(null,n,u,e,p,o);var y=gc();return n.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Yn(u)?(y=!0,ll(n)):y=!1,n.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,lc(n),p.updater=kl,n.stateNode=p,p._reactInternals=n,_c(n,u,e,o),n=Ec(null,n,u,!0,y,o)):(n.tag=0,Ot&&y&&Ju(n),Ln(null,n,p,o),n=n.child),n;case 16:u=n.elementType;e:{switch(El(e,n),e=n.pendingProps,p=u._init,u=p(u._payload),n.type=u,p=n.tag=fy(u),e=Lr(u,e),p){case 0:n=Nc(null,n,u,e,o);break e;case 1:n=gp(null,n,u,e,o);break e;case 11:n=fp(null,n,u,e,o);break e;case 14:n=dp(null,n,u,Lr(u.type,e),o);break e}throw Error(i(306,u,""))}return n;case 0:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:Lr(u,p),Nc(e,n,u,p,o);case 1:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:Lr(u,p),gp(e,n,u,p,o);case 3:e:{if(yp(n),e===null)throw Error(i(387));u=n.pendingProps,y=n.memoizedState,p=y.element,Id(e,n),yl(n,u,null,o);var E=n.memoizedState;if(u=E.element,y.isDehydrated)if(y={element:u,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},n.updateQueue.baseState=y,n.memoizedState=y,n.flags&256){p=vs(Error(i(423)),n),n=vp(e,n,u,o,p);break e}else if(u!==p){p=vs(Error(i(424)),n),n=vp(e,n,u,o,p);break e}else for(ar=Jo(n.stateNode.containerInfo.firstChild),sr=n,Ot=!0,Rr=null,o=$d(n,null,u,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(ps(),u===p){n=$o(e,n,o);break e}Ln(e,n,u,o)}n=n.child}return n;case 5:return Od(n),e===null&&tc(n),u=n.type,p=n.pendingProps,y=e!==null?e.memoizedProps:null,E=p.children,qu(u,p)?E=null:y!==null&&qu(u,y)&&(n.flags|=32),mp(e,n),Ln(e,n,E,o),n.child;case 6:return e===null&&tc(n),null;case 13:return xp(e,n,o);case 4:return uc(n,n.stateNode.containerInfo),u=n.pendingProps,e===null?n.child=hs(n,null,u,o):Ln(e,n,u,o),n.child;case 11:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:Lr(u,p),fp(e,n,u,p,o);case 7:return Ln(e,n,n.pendingProps,o),n.child;case 8:return Ln(e,n,n.pendingProps.children,o),n.child;case 12:return Ln(e,n,n.pendingProps.children,o),n.child;case 10:e:{if(u=n.type._context,p=n.pendingProps,y=n.memoizedProps,E=p.value,Ct(hl,u._currentValue),u._currentValue=E,y!==null)if(ce(y.value,E)){if(y.children===p.children&&!Wn.current){n=$o(e,n,o);break e}}else for(y=n.child,y!==null&&(y.return=n);y!==null;){var z=y.dependencies;if(z!==null){E=y.child;for(var Y=z.firstContext;Y!==null;){if(Y.context===u){if(y.tag===1){Y=Po(-1,o&-o),Y.tag=2;var xe=y.updateQueue;if(xe!==null){xe=xe.shared;var Me=xe.pending;Me===null?Y.next=Y:(Y.next=Me.next,Me.next=Y),xe.pending=Y}}y.lanes|=o,Y=y.alternate,Y!==null&&(Y.lanes|=o),sc(y.return,o,n),z.lanes|=o;break}Y=Y.next}}else if(y.tag===10)E=y.type===n.type?null:y.child;else if(y.tag===18){if(E=y.return,E===null)throw Error(i(341));E.lanes|=o,z=E.alternate,z!==null&&(z.lanes|=o),sc(E,o,n),E=y.sibling}else E=y.child;if(E!==null)E.return=y;else for(E=y;E!==null;){if(E===n){E=null;break}if(y=E.sibling,y!==null){y.return=E.return,E=y;break}E=E.return}y=E}Ln(e,n,p.children,o),n=n.child}return n;case 9:return p=n.type,u=n.pendingProps.children,gs(n,o),p=Sr(p),u=u(p),n.flags|=1,Ln(e,n,u,o),n.child;case 14:return u=n.type,p=Lr(u,n.pendingProps),p=Lr(u.type,p),dp(e,n,u,p,o);case 15:return pp(e,n,n.type,n.pendingProps,o);case 17:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:Lr(u,p),El(e,n),n.tag=1,Yn(u)?(e=!0,ll(n)):e=!1,gs(n,o),op(n,u,p),_c(n,u,p,o),Ec(null,n,u,!0,e,o);case 19:return bp(e,n,o);case 22:return hp(e,n,o)}throw Error(i(156,n.tag))};function Kp(e,n){return co(e,n)}function cy(e,n,o,u){this.tag=e,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Er(e,n,o,u){return new cy(e,n,o,u)}function qc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fy(e){if(typeof e=="function")return qc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ue)return 11;if(e===fe)return 14}return 2}function ui(e,n){var o=e.alternate;return o===null?(o=Er(e.tag,n,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=n,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&14680064,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,n=e.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o}function Ll(e,n,o,u,p,y){var E=2;if(u=e,typeof e=="function")qc(e)&&(E=1);else if(typeof e=="string")E=5;else e:switch(e){case W:return Oi(o.children,p,y,n);case Q:E=8,p|=8;break;case pe:return e=Er(12,o,n,p|2),e.elementType=pe,e.lanes=y,e;case ve:return e=Er(13,o,n,p),e.elementType=ve,e.lanes=y,e;case D:return e=Er(19,o,n,p),e.elementType=D,e.lanes=y,e;case ae:return Dl(o,p,y,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ke:E=10;break e;case X:E=9;break e;case ue:E=11;break e;case fe:E=14;break e;case J:E=16,u=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return n=Er(E,o,n,p),n.elementType=e,n.type=u,n.lanes=y,n}function Oi(e,n,o,u){return e=Er(7,e,u,n),e.lanes=o,e}function Dl(e,n,o,u){return e=Er(22,e,u,n),e.elementType=ae,e.lanes=o,e.stateNode={isHidden:!1},e}function Wc(e,n,o){return e=Er(6,e,null,n),e.lanes=o,e}function Yc(e,n,o){return n=Er(4,e.children!==null?e.children:[],e.key,n),n.lanes=o,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function dy(e,n,o,u,p){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=fo(0),this.expirationTimes=fo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fo(0),this.identifierPrefix=u,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function Xc(e,n,o,u,p,y,E,z,Y){return e=new dy(e,n,o,z,Y),n===1?(n=1,y===!0&&(n|=8)):n=0,y=Er(3,null,null,n),e.current=y,y.stateNode=e,y.memoizedState={element:u,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},lc(y),e}function py(e,n,o){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:K,key:u==null?null:""+u,children:e,containerInfo:n,implementation:o}}function qp(e){if(!e)return ei;e=e._reactInternals;e:{if(qt(e)!==e||e.tag!==1)throw Error(i(170));var n=e;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(Yn(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(i(171))}if(e.tag===1){var o=e.type;if(Yn(o))return wd(e,o,n)}return n}function Wp(e,n,o,u,p,y,E,z,Y){return e=Xc(o,u,!0,e,p,y,E,z,Y),e.context=qp(null),o=e.current,u=Dn(),p=ai(o),y=Po(u,p),y.callback=n??null,ri(o,y,p),e.current.lanes=p,wr(e,p,u),Gn(e,u),e}function zl(e,n,o,u){var p=n.current,y=Dn(),E=ai(p);return o=qp(o),n.context===null?n.context=o:n.pendingContext=o,n=Po(y,E),n.payload={element:e},u=u===void 0?null:u,u!==null&&(n.callback=u),e=ri(p,n,E),e!==null&&(Fr(e,p,E,y),gl(e,p,E)),E}function Fl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Yp(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o<n?o:n}}function Qc(e,n){Yp(e,n),(e=e.alternate)&&Yp(e,n)}function hy(){return null}var Xp=typeof reportError=="function"?reportError:function(e){console.error(e)};function Gc(e){this._internalRoot=e}Bl.prototype.render=Gc.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));zl(e,n,null,null)},Bl.prototype.unmount=Gc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Ii(function(){zl(null,e,null,null)}),n[ko]=null}};function Bl(e){this._internalRoot=e}Bl.prototype.unstable_scheduleHydration=function(e){if(e){var n=Ka();e={blockedOn:null,target:e,priority:n};for(var o=0;o<Kn.length&&n!==0&&n<Kn[o].priority;o++);Kn.splice(o,0,e),o===0&&ir(e)}};function Jc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Hl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Qp(){}function my(e,n,o,u,p){if(p){if(typeof u=="function"){var y=u;u=function(){var xe=Fl(E);y.call(xe)}}var E=Wp(n,u,e,0,null,!1,!1,"",Qp);return e._reactRootContainer=E,e[ko]=E.current,Zs(e.nodeType===8?e.parentNode:e),Ii(),E}for(;p=e.lastChild;)e.removeChild(p);if(typeof u=="function"){var z=u;u=function(){var xe=Fl(Y);z.call(xe)}}var Y=Xc(e,0,!1,null,null,!1,!1,"",Qp);return e._reactRootContainer=Y,e[ko]=Y.current,Zs(e.nodeType===8?e.parentNode:e),Ii(function(){zl(n,Y,o,u)}),Y}function Vl(e,n,o,u,p){var y=o._reactRootContainer;if(y){var E=y;if(typeof p=="function"){var z=p;p=function(){var Y=Fl(E);z.call(Y)}}zl(n,E,e,p)}else E=my(o,n,e,p,u);return Fl(E)}gt=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var o=Vt(n.pendingLanes);o!==0&&(Bo(n,o|1),Gn(n,pt()),(xt&6)===0&&(bs=pt()+500,ti()))}break;case 13:Ii(function(){var u=jo(e,1);if(u!==null){var p=Dn();Fr(u,e,1,p)}}),Qc(e,1)}},Ui=function(e){if(e.tag===13){var n=jo(e,134217728);if(n!==null){var o=Dn();Fr(n,e,134217728,o)}Qc(e,134217728)}},Ua=function(e){if(e.tag===13){var n=ai(e),o=jo(e,n);if(o!==null){var u=Dn();Fr(o,e,n,u)}Qc(e,n)}},Ka=function(){return wt},Nn=function(e,n){var o=wt;try{return wt=e,n()}finally{wt=o}},He=function(e,n,o){switch(n){case"input":if(St(e,o),n=o.name,o.type==="radio"&&n!=null){for(o=e;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<o.length;n++){var u=o[n];if(u!==e&&u.form===e.form){var p=sl(u);if(!p)throw Error(i(90));Be(u),St(u,p)}}}break;case"textarea":fr(e,o);break;case"select":n=o.value,n!=null&&kt(e,!!o.multiple,n,!1)}},Do=Vc,zo=Ii;var gy={usingClientEntryPoint:!1,Events:[na,ls,sl,Ht,qr,Vc]},ga={findFiberByHostInstance:ki,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},yy={bundleType:ga.bundleType,version:ga.version,rendererPackageName:ga.rendererPackageName,rendererConfig:ga.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:R.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=uo(e),e===null?null:e.stateNode},findFiberByHostInstance:ga.findFiberByHostInstance||hy,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ul=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ul.isDisabled&&Ul.supportsFiber)try{L=Ul.inject(yy),we=Ul}catch{}}return Jn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=gy,Jn.createPortal=function(e,n){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Jc(n))throw Error(i(200));return py(e,n,null,o)},Jn.createRoot=function(e,n){if(!Jc(e))throw Error(i(299));var o=!1,u="",p=Xp;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onRecoverableError!==void 0&&(p=n.onRecoverableError)),n=Xc(e,1,!1,null,null,o,!1,u,p),e[ko]=n.current,Zs(e.nodeType===8?e.parentNode:e),new Gc(n)},Jn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=uo(n),e=e===null?null:e.stateNode,e},Jn.flushSync=function(e){return Ii(e)},Jn.hydrate=function(e,n,o){if(!Hl(n))throw Error(i(200));return Vl(null,e,n,!0,o)},Jn.hydrateRoot=function(e,n,o){if(!Jc(e))throw Error(i(405));var u=o!=null&&o.hydratedSources||null,p=!1,y="",E=Xp;if(o!=null&&(o.unstable_strictMode===!0&&(p=!0),o.identifierPrefix!==void 0&&(y=o.identifierPrefix),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),n=Wp(n,null,e,1,o??null,p,!1,y,E),e[ko]=n.current,Zs(e),u)for(e=0;e<u.length;e++)o=u[e],p=o._getVersion,p=p(o._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[o,p]:n.mutableSourceEagerHydrationData.push(o,p);return new Bl(n)},Jn.render=function(e,n,o){if(!Hl(n))throw Error(i(200));return Vl(null,e,n,!1,o)},Jn.unmountComponentAtNode=function(e){if(!Hl(e))throw Error(i(40));return e._reactRootContainer?(Ii(function(){Vl(null,null,e,!1,function(){e._reactRootContainer=null,e[ko]=null})}),!0):!1},Jn.unstable_batchedUpdates=Vc,Jn.unstable_renderSubtreeIntoContainer=function(e,n,o,u){if(!Hl(o))throw Error(i(200));if(e==null||e._reactInternals===void 0)throw Error(i(38));return Vl(e,n,o,!1,u)},Jn.version="18.3.1-next-f1338f8080-20240426",Jn}var oh;function km(){if(oh)return tf.exports;oh=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),tf.exports=Cy(),tf.exports}var ih;function jy(){if(ih)return Kl;ih=1;var t=km();return Kl.createRoot=t.createRoot,Kl.hydrateRoot=t.hydrateRoot,Kl}var Py=jy();const $y=_u(Py);function sh(t){if(!t||typeof t!="object")throw new Error("OpenAPI: expected object");const r=t;if(r.openapi!=="3.0.0"&&r.openapi!=="3.0.1"&&r.openapi!=="3.0.2"&&r.openapi!=="3.0.3"&&!(typeof r.openapi=="string"&&r.openapi.startsWith("3.0."))){if(!(typeof r.openapi=="string"&&r.openapi.startsWith("3.1")))throw new Error(`OpenAPI: unsupported openapi field: ${String(r.openapi)}`)}if(!r.info||typeof r.info!="object")throw new Error("OpenAPI: missing info");if(!r.paths||typeof r.paths!="object")throw new Error("OpenAPI: missing paths")}const My="x-api-doc-tor-llm-key";function nu(t){switch(t){case"anthropic":return"claude-sonnet-4-20250514";case"openai":return"gpt-4o-mini";case"openrouter":return"openai/gpt-4o-mini";default:return"gpt-4o-mini"}}const Iy=["get","post","put","patch","delete","options","head","trace"];function ah(t){return t.replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_|_$/g,"").replace(/_+/g,"_")}function Su(t,r,i,s){if(i)return ah(i).replace(/^[0-9]/,"_$&")||`op_${s}`;const l=ah(r.replace(/[{}]/g,""));return`${t}_${l}`||`op_${s}`}function ku(t){var s;return`${(((s=t.info)==null?void 0:s.title)??"Api").replace(/[^a-zA-Z0-9]+/g," ").trim().split(/\s+/).filter(Boolean).map(l=>l.charAt(0).toUpperCase()+l.slice(1).toLowerCase()).join("")||"Api"}Client`}function Nu(t){return(t.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(i=>i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join("")||"Api")+"Service"}function so(t){const r=[];if(!t.paths)return r;for(const[i,s]of Object.entries(t.paths)){if(!s||typeof s!="object"||"$ref"in s)continue;const l=s;for(const c of Iy){const d=l[c];d&&typeof d=="object"&&r.push({method:c,path:i,operationId:d.operationId,tags:d.tags})}}return r}function Ty(t,r,i,s="baseUrl"){var c,d;const l=r.toUpperCase();return`const ${s} = "${((d=(c=t.servers)==null?void 0:c[0])==null?void 0:d.url)??"http://localhost:3000"}";
|
|
41
|
+
/** @returns {Promise<unknown>} */
|
|
42
|
+
const res = await fetch(\`${s}${i}\`, {
|
|
43
|
+
method: "${l}",
|
|
44
|
+
headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
|
|
45
|
+
${l==="GET"||l==="HEAD"?"":"body: JSON.stringify({}),"}
|
|
46
|
+
});
|
|
47
|
+
const data = await res.json();
|
|
48
|
+
`}function Nm(t,r){const i=t.map((s,l)=>` /**
|
|
49
|
+
* @param {{ headers?: Record<string, string> }} [options]
|
|
50
|
+
* @returns {Promise<unknown>}
|
|
51
|
+
*/
|
|
52
|
+
async ${Su(s.method,s.path,s.operationId,l)}(options) {
|
|
53
|
+
const res = await fetch(\`\${this.baseUrl}${s.path}\`, {
|
|
54
|
+
method: "${s.method.toUpperCase()}",
|
|
55
|
+
headers: { ...this.defaultHeaders, ...options?.headers },
|
|
56
|
+
});
|
|
57
|
+
return res.json();
|
|
58
|
+
}`);return`export class ${r} {
|
|
59
|
+
/**
|
|
60
|
+
* @param {string} baseUrl
|
|
61
|
+
* @param {Record<string, string>} [defaultHeaders]
|
|
62
|
+
*/
|
|
63
|
+
constructor(baseUrl, defaultHeaders = {}) {
|
|
64
|
+
this.baseUrl = baseUrl;
|
|
65
|
+
this.defaultHeaders = defaultHeaders;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
${i.join(`
|
|
69
|
+
|
|
70
|
+
`)}
|
|
71
|
+
}
|
|
72
|
+
`}function Ay(t){return Nm(so(t),ku(t))}function Oy(t,r){const i=Nu(r),s=so(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return Nm(s,i)}function Ry(t,r,i){var c,d;const s=((d=(c=t.servers)==null?void 0:c[0])==null?void 0:d.url)??"http://localhost:3000",l=r.toUpperCase();return`<?php
|
|
73
|
+
$baseUrl = '${s}';
|
|
74
|
+
$url = $baseUrl . '${i}';
|
|
75
|
+
$opts = [
|
|
76
|
+
'http' => [
|
|
77
|
+
'method' => '${l}',
|
|
78
|
+
'header' => "Content-Type: application/json\\r\\nAuthorization: Bearer {$token}\\r\\n",
|
|
79
|
+
${l==="GET"||l==="HEAD"?"":"'content' => json_encode([]),"}
|
|
80
|
+
],
|
|
81
|
+
];
|
|
82
|
+
$context = stream_context_create($opts);
|
|
83
|
+
$response = file_get_contents($url, false, $context);
|
|
84
|
+
$data = json_decode($response, true);
|
|
85
|
+
`}function Em(t,r){const i=t.map((s,l)=>` public function ${Su(s.method,s.path,s.operationId,l)}(array $extraHeaders = []): array
|
|
86
|
+
{
|
|
87
|
+
$url = $this->baseUrl . '${s.path}';
|
|
88
|
+
$headers = array_merge($this->defaultHeaders, $extraHeaders);
|
|
89
|
+
$opts = [
|
|
90
|
+
'http' => [
|
|
91
|
+
'method' => '${s.method.toUpperCase()}',
|
|
92
|
+
'header' => $this->formatHeaders($headers),
|
|
93
|
+
],
|
|
94
|
+
];
|
|
95
|
+
$ctx = stream_context_create($opts);
|
|
96
|
+
$raw = file_get_contents($url, false, $ctx);
|
|
97
|
+
return json_decode($raw ?: '[]', true) ?: [];
|
|
98
|
+
}`);return`<?php
|
|
99
|
+
|
|
100
|
+
declare(strict_types=1);
|
|
101
|
+
|
|
102
|
+
final class ${r}
|
|
103
|
+
{
|
|
104
|
+
public function __construct(
|
|
105
|
+
private string $baseUrl,
|
|
106
|
+
/** @var array<string, string> */
|
|
107
|
+
private array $defaultHeaders = [],
|
|
108
|
+
) {
|
|
109
|
+
$this->baseUrl = rtrim($baseUrl, '/');
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** @param array<string, string> $headers */
|
|
113
|
+
private function formatHeaders(array $headers): string
|
|
114
|
+
{
|
|
115
|
+
$lines = [];
|
|
116
|
+
foreach ($headers as $k => $v) {
|
|
117
|
+
$lines[] = $k . ': ' . $v;
|
|
118
|
+
}
|
|
119
|
+
return implode("\\r\\n", $lines) . "\\r\\n";
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
${i.join(`
|
|
123
|
+
|
|
124
|
+
`)}
|
|
125
|
+
}
|
|
126
|
+
`}function Ly(t){return Em(so(t),ku(t))}function Dy(t,r){const i=Nu(r),s=so(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return Em(s,i)}function zy(t,r,i){var d,h;const s=((h=(d=t.servers)==null?void 0:d[0])==null?void 0:h.url)??"http://localhost:3000",l=r.toLowerCase();return`import httpx
|
|
127
|
+
|
|
128
|
+
base_url = "${s}"
|
|
129
|
+
url = f"{base_url}${i}"
|
|
130
|
+
headers = {"Authorization": f"Bearer {token}"}
|
|
131
|
+
with httpx.Client() as client:
|
|
132
|
+
response = client.${l}(url, headers=headers${l==="get"||l==="head"?"":", json={}"})
|
|
133
|
+
data = response.json()
|
|
134
|
+
`}function Cm(t,r){const i=t.map((s,l)=>{const c=Su(s.method,s.path,s.operationId,l),d=s.method.toLowerCase(),h=d==="get"||d==="head"?"":", json={}";return` def ${c}(self, headers: dict | None = None) -> dict:
|
|
135
|
+
h = {**self.default_headers, **(headers or {})}
|
|
136
|
+
r = self._client.${d}(f"{self.base_url}${s.path}", headers=h${h})
|
|
137
|
+
return r.json()`});return`from __future__ import annotations
|
|
138
|
+
import httpx
|
|
139
|
+
|
|
140
|
+
class ${r}:
|
|
141
|
+
def __init__(self, base_url: str, default_headers: dict | None = None) -> None:
|
|
142
|
+
self.base_url = base_url.rstrip("/")
|
|
143
|
+
self.default_headers = default_headers or {}
|
|
144
|
+
self._client = httpx.Client()
|
|
145
|
+
|
|
146
|
+
def close(self) -> None:
|
|
147
|
+
self._client.close()
|
|
148
|
+
|
|
149
|
+
${i.join(`
|
|
150
|
+
|
|
151
|
+
`)}
|
|
152
|
+
`}function Fy(t){return Cm(so(t),ku(t))}function By(t,r){const i=Nu(r),s=so(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return Cm(s,i)}function Hy(t){const r=t.split("/");return(r[r.length-1]??"Unknown").replace(/[^a-zA-Z0-9_]/g,"_")}function Sf(t){if(!t)return"unknown";if("$ref"in t&&t.$ref)return Hy(t.$ref);const r=t;return r.type==="string"?"string":r.type==="number"||r.type==="integer"?"number":r.type==="boolean"?"boolean":r.type==="array"&&r.items?`${Sf(r.items)}[]`:r.type==="object"&&r.properties?`{
|
|
153
|
+
${Object.entries(r.properties).map(([s,l])=>` ${JSON.stringify(s)}?: ${Sf(l)};`).join(`
|
|
154
|
+
`)}
|
|
155
|
+
}`:"Record<string, unknown>"}function Vy(t,r,i,s="baseUrl"){var b,S,x,_,C,j;const l=(S=(b=t.paths)==null?void 0:b[i])==null?void 0:S[r],c=l==null?void 0:l.requestBody;let d;if((_=(x=c==null?void 0:c.content)==null?void 0:x["application/json"])!=null&&_.schema){const M=c.content["application/json"].schema;M&&!("$ref"in M)&&(d=M)}const h=d?Sf(d):"Record<string, unknown>",v=r.toUpperCase();return`const ${s} = "${((j=(C=t.servers)==null?void 0:C[0])==null?void 0:j.url)??"http://localhost:3000"}";
|
|
156
|
+
const res = await fetch(\`${s}${i}\`, {
|
|
157
|
+
method: "${v}",
|
|
158
|
+
headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
|
|
159
|
+
${v==="GET"||v==="HEAD"?"":`body: JSON.stringify({} as ${h}),`}
|
|
160
|
+
});
|
|
161
|
+
const data = await res.json() as unknown;
|
|
162
|
+
`}function jm(t,r){const i=t.map((s,l)=>` async ${Su(s.method,s.path,s.operationId,l)}(options?: { headers?: Record<string, string> }): Promise<unknown> {
|
|
163
|
+
const res = await fetch(\`\${this.baseUrl}${s.path}\`, {
|
|
164
|
+
method: "${s.method.toUpperCase()}",
|
|
165
|
+
headers: { ...this.defaultHeaders, ...options?.headers },
|
|
166
|
+
});
|
|
167
|
+
return res.json();
|
|
168
|
+
}`);return`export class ${r} {
|
|
169
|
+
constructor(
|
|
170
|
+
private baseUrl: string,
|
|
171
|
+
private defaultHeaders: Record<string, string> = {},
|
|
172
|
+
) {}
|
|
173
|
+
|
|
174
|
+
${i.join(`
|
|
175
|
+
|
|
176
|
+
`)}
|
|
177
|
+
}
|
|
178
|
+
`}function Uy(t){const r=so(t),i=ku(t);return jm(r,i)}function Ky(t,r){const i=Nu(r),s=so(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return jm(s,i)}function qy(t,r,i,s){switch(r){case"typescript":return Vy(t,i,s);case"javascript":return Ty(t,i,s);case"python":return zy(t,i,s);case"php":return Ry(t,i,s);default:{const l=r;throw new Error(`Unsupported language: ${l}`)}}}function Wy(t,r,i){switch(r){case"typescript":return Ky(t,i);case"javascript":return Oy(t,i);case"python":return By(t,i);case"php":return Dy(t,i);default:{const s=r;throw new Error(`Unsupported language: ${s}`)}}}function Yy(t,r,i){if(i===null)switch(r){case"typescript":return Uy(t);case"javascript":return Ay(t);case"python":return Fy(t);case"php":return Ly(t);default:{const s=r;throw new Error(`Unsupported language: ${s}`)}}return Wy(t,r,i)}function Xy(t){const r=new Set;for(const i of so(t))for(const s of i.tags??[])r.add(s);return r.size===0&&r.add("default"),[...r].sort()}function To(t,r){var i,s,l;return r!=null&&r.trim()?r.replace(/\/$/,""):((l=(s=(i=t.servers)==null?void 0:i[0])==null?void 0:s.url)==null?void 0:l.replace(/\/$/,""))??window.location.origin}function Qy(t){var i;const r=(i=t.components)==null?void 0:i.securitySchemes;return r?Object.keys(r):[]}function Bf(t,r){if(!r.startsWith("$"))return;let i=t;const s=r.slice(1);if(s.startsWith(".")){for(const l of s.slice(1).split("."))if(i&&typeof i=="object"&&l in i)i=i[l];else return;return i}return i}var ru={exports:{}},Gy=ru.exports,lh;function Jy(){return lh||(lh=1,(function(t,r){((i,s)=>{t.exports=s()})(Gy,function(){var i=function(a,f){return(i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(m,w){m.__proto__=w}:function(m,w){for(var k in w)Object.prototype.hasOwnProperty.call(w,k)&&(m[k]=w[k])}))(a,f)},s=function(){return(s=Object.assign||function(a){for(var f,m=1,w=arguments.length;m<w;m++)for(var k in f=arguments[m])Object.prototype.hasOwnProperty.call(f,k)&&(a[k]=f[k]);return a}).apply(this,arguments)};function l(a,f,m){for(var w,k=0,N=f.length;k<N;k++)!w&&k in f||((w=w||Array.prototype.slice.call(f,0,k))[k]=f[k]);return a.concat(w||Array.prototype.slice.call(f))}var c=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:by,d=Object.keys,h=Array.isArray;function v(a,f){return typeof f=="object"&&d(f).forEach(function(m){a[m]=f[m]}),a}typeof Promise>"u"||c.Promise||(c.Promise=Promise);var b=Object.getPrototypeOf,S={}.hasOwnProperty;function x(a,f){return S.call(a,f)}function _(a,f){typeof f=="function"&&(f=f(b(a))),(typeof Reflect>"u"?d:Reflect.ownKeys)(f).forEach(function(m){j(a,m,f[m])})}var C=Object.defineProperty;function j(a,f,m,w){C(a,f,v(m&&x(m,"get")&&typeof m.get=="function"?{get:m.get,set:m.set,configurable:!0}:{value:m,configurable:!0,writable:!0},w))}function M(a){return{from:function(f){return a.prototype=Object.create(f.prototype),j(a.prototype,"constructor",a),{extend:_.bind(null,a.prototype)}}}}var T=Object.getOwnPropertyDescriptor,P=[].slice;function F(a,f,m){return P.call(a,f,m)}function $(a,f){return f(a)}function R(a){if(!a)throw new Error("Assertion Failed")}function V(a){c.setImmediate?setImmediate(a):setTimeout(a,0)}function K(a,f){if(typeof f=="string"&&x(a,f))return a[f];if(!f)return a;if(typeof f!="string"){for(var m=[],w=0,k=f.length;w<k;++w){var N=K(a,f[w]);m.push(N)}return m}var I,O=f.indexOf(".");return O===-1||(I=a[f.substr(0,O)])==null?void 0:K(I,f.substr(O+1))}function W(a,f,m){if(a&&f!==void 0&&!("isFrozen"in Object&&Object.isFrozen(a)))if(typeof f!="string"&&"length"in f){R(typeof m!="string"&&"length"in m);for(var w=0,k=f.length;w<k;++w)W(a,f[w],m[w])}else{var N,I,O=f.indexOf(".");O!==-1?(N=f.substr(0,O),(O=f.substr(O+1))===""?m===void 0?h(a)&&!isNaN(parseInt(N))?a.splice(N,1):delete a[N]:a[N]=m:W(I=(I=a[N])&&x(a,N)?I:a[N]={},O,m)):m===void 0?h(a)&&!isNaN(parseInt(f))?a.splice(f,1):delete a[f]:a[f]=m}}function Q(a){var f,m={};for(f in a)x(a,f)&&(m[f]=a[f]);return m}var pe=[].concat;function ke(a){return pe.apply([],a)}var U="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(ke([8,16,32,64].map(function(a){return["Int","Uint","Float"].map(function(f){return f+a+"Array"})}))).filter(function(a){return c[a]}),X=new Set(U.map(function(a){return c[a]})),ue=null;function ve(a){return ue=new WeakMap,a=(function f(m){if(!m||typeof m!="object")return m;var w=ue.get(m);if(w)return w;if(h(m)){w=[],ue.set(m,w);for(var k=0,N=m.length;k<N;++k)w.push(f(m[k]))}else if(X.has(m.constructor))w=m;else{var I,O=b(m);for(I in w=O===Object.prototype?{}:Object.create(O),ue.set(m,w),m)x(m,I)&&(w[I]=f(m[I]))}return w})(a),ue=null,a}var D={}.toString;function fe(a){return D.call(a).slice(8,-1)}var J=typeof Symbol<"u"?Symbol.iterator:"@@iterator",ae=typeof J=="symbol"?function(a){var f;return a!=null&&(f=a[J])&&f.apply(a)}:function(){return null};function B(a,f){f=a.indexOf(f),0<=f&&a.splice(f,1)}var q={};function Z(a){var f,m,w,k;if(arguments.length===1){if(h(a))return a.slice();if(this===q&&typeof a=="string")return[a];if(k=ae(a))for(m=[];!(w=k.next()).done;)m.push(w.value);else{if(a==null)return[a];if(typeof(f=a.length)!="number")return[a];for(m=new Array(f);f--;)m[f]=a[f]}}else for(f=arguments.length,m=new Array(f);f--;)m[f]=arguments[f];return m}var A=typeof Symbol<"u"?function(a){return a[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},U=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Et=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(U),de={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function _e(a,f){this.name=a,this.message=f}function Te(a,f){return a+". Errors: "+Object.keys(f).map(function(m){return f[m].toString()}).filter(function(m,w,k){return k.indexOf(m)===w}).join(`
|
|
179
|
+
`)}function Oe(a,f,m,w){this.failures=f,this.failedKeys=w,this.successCount=m,this.message=Te(a,f)}function Re(a,f){this.name="BulkError",this.failures=Object.keys(f).map(function(m){return f[m]}),this.failuresByPos=f,this.message=Te(a,this.failures)}M(_e).from(Error).extend({toString:function(){return this.name+": "+this.message}}),M(Oe).from(_e),M(Re).from(_e);var Se=Et.reduce(function(a,f){return a[f]=f+"Error",a},{}),De=_e,Ne=Et.reduce(function(a,f){var m=f+"Error";function w(k,N){this.name=m,k?typeof k=="string"?(this.message="".concat(k).concat(N?`
|
|
180
|
+
`+N:""),this.inner=N||null):typeof k=="object"&&(this.message="".concat(k.name," ").concat(k.message),this.inner=k):(this.message=de[f]||m,this.inner=null)}return M(w).from(De),a[f]=w,a},{}),Ze=(Ne.Syntax=SyntaxError,Ne.Type=TypeError,Ne.Range=RangeError,U.reduce(function(a,f){return a[f+"Error"]=Ne[f],a},{}));U=Et.reduce(function(a,f){return["Syntax","Type","Range"].indexOf(f)===-1&&(a[f+"Error"]=Ne[f]),a},{});function Be(){}function Ue(a){return a}function qe(a,f){return a==null||a===Ue?f:function(m){return f(a(m))}}function nt(a,f){return function(){a.apply(this,arguments),f.apply(this,arguments)}}function ct(a,f){return a===Be?f:function(){var m=a.apply(this,arguments),w=(m!==void 0&&(arguments[0]=m),this.onsuccess),k=this.onerror,N=(this.onsuccess=null,this.onerror=null,f.apply(this,arguments));return w&&(this.onsuccess=this.onsuccess?nt(w,this.onsuccess):w),k&&(this.onerror=this.onerror?nt(k,this.onerror):k),N!==void 0?N:m}}function St(a,f){return a===Be?f:function(){a.apply(this,arguments);var m=this.onsuccess,w=this.onerror;this.onsuccess=this.onerror=null,f.apply(this,arguments),m&&(this.onsuccess=this.onsuccess?nt(m,this.onsuccess):m),w&&(this.onerror=this.onerror?nt(w,this.onerror):w)}}function gn(a,f){return a===Be?f:function(k){var w=a.apply(this,arguments),k=(v(k,w),this.onsuccess),N=this.onerror,I=(this.onsuccess=null,this.onerror=null,f.apply(this,arguments));return k&&(this.onsuccess=this.onsuccess?nt(k,this.onsuccess):k),N&&(this.onerror=this.onerror?nt(N,this.onerror):N),w===void 0?I===void 0?void 0:I:v(w,I)}}function Xt(a,f){return a===Be?f:function(){return f.apply(this,arguments)!==!1&&a.apply(this,arguments)}}function Qt(a,f){return a===Be?f:function(){var m=a.apply(this,arguments);if(m&&typeof m.then=="function"){for(var w=this,k=arguments.length,N=new Array(k);k--;)N[k]=arguments[k];return m.then(function(){return f.apply(w,N)})}return f.apply(this,arguments)}}U.ModifyError=Oe,U.DexieError=_e,U.BulkError=Re;var kt=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Kt(a){kt=a}var kn={},fr=100,an=typeof Promise>"u"?[]:(Et=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[an=crypto.subtle.digest("SHA-512",new Uint8Array([0])),b(an),Et]:[Et,b(Et),Et]),Et=an[0],xo=an[1],xo=xo&&xo.then,Gt=Et&&Et.constructor,yn=!!an[2],er=function(a,f){_t.push([a,f]),Mn&&(queueMicrotask(zo),Mn=!1)},nn=!0,Mn=!0,In=[],dr=[],ln=Ue,rn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Be,pgp:!1,env:{},finalize:Be},Ye=rn,_t=[],Tn=0,pr=[];function He(a){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var f=this._PSD=Ye;if(typeof a!="function"){if(a!==kn)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&Cr(this,this._value)}else this._state=null,this._value=null,++f.ref,(function m(w,k){try{k(function(N){if(w._state===null){if(N===w)throw new TypeError("A promise cannot be resolved with itself.");var I=w._lib&&zn();N&&typeof N.then=="function"?m(w,function(O,ee){N instanceof He?N._then(O,ee):N.then(O,ee)}):(w._state=!0,w._value=N,Ht(w)),I&&tr()}},Cr.bind(null,w))}catch(N){Cr(w,N)}})(this,a)}var un={get:function(){var a=Ye,f=Bn;function m(w,k){var N=this,I=!a.global&&(a!==Ye||f!==Bn),O=I&&!qt(),ee=new He(function(ce,ne){qr(N,new An(co(w,a,I,O),co(k,a,I,O),ce,ne,a))});return this._consoleTask&&(ee._consoleTask=this._consoleTask),ee}return m.prototype=kn,m},set:function(a){j(this,"then",a&&a.prototype===kn?un:{get:function(){return a},set:un.set})}};function An(a,f,m,w,k){this.onFulfilled=typeof a=="function"?a:null,this.onRejected=typeof f=="function"?f:null,this.resolve=m,this.reject=w,this.psd=k}function Cr(a,f){var m,w;dr.push(f),a._state===null&&(m=a._lib&&zn(),f=ln(f),a._state=!1,a._value=f,w=a,In.some(function(k){return k._value===w._value})||In.push(w),Ht(a),m)&&tr()}function Ht(a){var f=a._listeners;a._listeners=[];for(var m=0,w=f.length;m<w;++m)qr(a,f[m]);var k=a._PSD;--k.ref||k.finalize(),Tn===0&&(++Tn,er(function(){--Tn==0&&Fn()},[]))}function qr(a,f){if(a._state===null)a._listeners.push(f);else{var m=a._state?f.onFulfilled:f.onRejected;if(m===null)return(a._state?f.resolve:f.reject)(a._value);++f.psd.ref,++Tn,er(Do,[m,a,f])}}function Do(a,f,m){try{var w,k=f._value;!f._state&&dr.length&&(dr=[]),w=kt&&f._consoleTask?f._consoleTask.run(function(){return a(k)}):a(k),f._state||dr.indexOf(k)!==-1||(N=>{for(var I=In.length;I;)if(In[--I]._value===N._value)return In.splice(I,1)})(f),m.resolve(w)}catch(N){m.reject(N)}finally{--Tn==0&&Fn(),--m.psd.ref||m.psd.finalize()}}function zo(){On(rn,function(){zn()&&tr()})}function zn(){var a=nn;return Mn=nn=!1,a}function tr(){var a,f,m;do for(;0<_t.length;)for(a=_t,_t=[],m=a.length,f=0;f<m;++f){var w=a[f];w[0].apply(null,w[1])}while(0<_t.length);Mn=nn=!0}function Fn(){for(var a=In,f=(In=[],a.forEach(function(w){w._PSD.onunhandled.call(null,w._value,w)}),pr.slice(0)),m=f.length;m;)f[--m]()}function hr(a){return new He(kn,!1,a)}function yt(a,f){var m=Ye;return function(){var w=zn(),k=Ye;try{return Vn(m,!0),a.apply(this,arguments)}catch(N){f&&f(N)}finally{Vn(k,!1),w&&tr()}}}_(He.prototype,{then:un,_then:function(a,f){qr(this,new An(null,null,a,f,Ye))},catch:function(a){var f,m;return arguments.length===1?this.then(null,a):(f=a,m=arguments[1],typeof f=="function"?this.then(null,function(w){return(w instanceof f?m:hr)(w)}):this.then(null,function(w){return(w&&w.name===f?m:hr)(w)}))},finally:function(a){return this.then(function(f){return He.resolve(a()).then(function(){return f})},function(f){return He.resolve(a()).then(function(){return hr(f)})})},timeout:function(a,f){var m=this;return a<1/0?new He(function(w,k){var N=setTimeout(function(){return k(new Ne.Timeout(f))},a);m.then(w,k).finally(clearTimeout.bind(null,N))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&j(He.prototype,Symbol.toStringTag,"Dexie.Promise"),rn.env=uo(),_(He,{all:function(){var a=Z.apply(null,arguments).map(gr);return new He(function(f,m){a.length===0&&f([]);var w=a.length;a.forEach(function(k,N){return He.resolve(k).then(function(I){a[N]=I,--w||f(a)},m)})})},resolve:function(a){return a instanceof He?a:a&&typeof a.then=="function"?new He(function(f,m){a.then(f,m)}):new He(kn,!0,a)},reject:hr,race:function(){var a=Z.apply(null,arguments).map(gr);return new He(function(f,m){a.map(function(w){return He.resolve(w).then(f,m)})})},PSD:{get:function(){return Ye},set:function(a){return Ye=a}},totalEchoes:{get:function(){return Bn}},newPSD:Hn,usePSD:On,scheduler:{get:function(){return er},set:function(a){er=a}},rejectionMapper:{get:function(){return ln},set:function(a){ln=a}},follow:function(a,f){return new He(function(m,w){return Hn(function(k,N){var I=Ye;I.unhandleds=[],I.onunhandled=N,I.finalize=nt(function(){var O,ee=this;O=function(){ee.unhandleds.length===0?k():N(ee.unhandleds[0])},pr.push(function ce(){O(),pr.splice(pr.indexOf(ce),1)}),++Tn,er(function(){--Tn==0&&Fn()},[])},I.finalize),a()},f,m,w)})}}),Gt&&(Gt.allSettled&&j(He,"allSettled",function(){var a=Z.apply(null,arguments).map(gr);return new He(function(f){a.length===0&&f([]);var m=a.length,w=new Array(m);a.forEach(function(k,N){return He.resolve(k).then(function(I){return w[N]={status:"fulfilled",value:I}},function(I){return w[N]={status:"rejected",reason:I}}).then(function(){return--m||f(w)})})})}),Gt.any&&typeof AggregateError<"u"&&j(He,"any",function(){var a=Z.apply(null,arguments).map(gr);return new He(function(f,m){a.length===0&&m(new AggregateError([]));var w=a.length,k=new Array(w);a.forEach(function(N,I){return He.resolve(N).then(function(O){return f(O)},function(O){k[I]=O,--w||m(new AggregateError(k))})})})}),Gt.withResolvers)&&(He.withResolvers=Gt.withResolvers);var It={awaits:0,echoes:0,id:0},jr=0,nr=[],cn=0,Bn=0,hi=0;function Hn(a,I,m,w){var k=Ye,N=Object.create(k),I=(N.parent=k,N.ref=0,N.global=!1,N.id=++hi,rn.env,N.env=yn?{Promise:He,PromiseProp:{value:He,configurable:!0,writable:!0},all:He.all,race:He.race,allSettled:He.allSettled,any:He.any,resolve:He.resolve,reject:He.reject}:{},I&&v(N,I),++k.ref,N.finalize=function(){--this.parent.ref||this.parent.finalize()},On(N,a,m,w));return N.ref===0&&N.finalize(),I}function mr(){return It.id||(It.id=++jr),++It.awaits,It.echoes+=fr,It.id}function qt(){return!!It.awaits&&(--It.awaits==0&&(It.id=0),It.echoes=It.awaits*fr,!0)}function gr(a){return It.echoes&&a&&a.constructor===Gt?(mr(),a.then(function(f){return qt(),f},function(f){return qt(),Nt(f)})):a}function lo(){var a=nr[nr.length-1];nr.pop(),Vn(a,!1)}function Vn(a,f){var m,w,k=Ye;(f?!It.echoes||cn++&&a===Ye:!cn||--cn&&a===Ye)||queueMicrotask(f?(function(N){++Bn,It.echoes&&--It.echoes!=0||(It.echoes=It.awaits=It.id=0),nr.push(Ye),Vn(N,!0)}).bind(null,a):lo),a!==Ye&&(Ye=a,k===rn&&(rn.env=uo()),yn)&&(m=rn.env.Promise,w=a.env,k.global||a.global)&&(Object.defineProperty(c,"Promise",w.PromiseProp),m.all=w.all,m.race=w.race,m.resolve=w.resolve,m.reject=w.reject,w.allSettled&&(m.allSettled=w.allSettled),w.any)&&(m.any=w.any)}function uo(){var a=c.Promise;return yn?{Promise:a,PromiseProp:Object.getOwnPropertyDescriptor(c,"Promise"),all:a.all,race:a.race,allSettled:a.allSettled,any:a.any,resolve:a.resolve,reject:a.reject}:{}}function On(a,f,m,w,k){var N=Ye;try{return Vn(a,!0),f(m,w,k)}finally{Vn(N,!1)}}function co(a,f,m,w){return typeof a!="function"?a:function(){var k=Ye;m&&mr(),Vn(f,!0);try{return a.apply(this,arguments)}finally{Vn(k,!1),w&&queueMicrotask(qt)}}}function Wr(a){Promise===Gt&&It.echoes===0?cn===0?a():enqueueNativeMicroTask(a):setTimeout(a,0)}(""+xo).indexOf("[native code]")===-1&&(mr=qt=Be);var Nt=He.reject,Un="",pt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Fo="String expected.",yr="__dbnames",Yr="readonly",rr="readwrite";function Rn(a,f){return a?f?function(){return a.apply(this,arguments)&&f.apply(this,arguments)}:a:f}var Xr={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function L(a){return typeof a!="string"||/\./.test(a)?function(f){return f}:function(f){return f[a]===void 0&&a in f&&delete(f=ve(f))[a],f}}function we(){throw Ne.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function Ee(a,f){try{var m=Qe(a),w=Qe(f);if(m!==w)return m==="Array"?1:w==="Array"?-1:m==="binary"?1:w==="binary"?-1:m==="string"?1:w==="string"?-1:m==="Date"?1:w!=="Date"?NaN:-1;switch(m){case"number":case"Date":case"string":return f<a?1:a<f?-1:0;case"binary":for(var k=Tt(a),N=Tt(f),I=k.length,O=N.length,ee=I<O?I:O,ce=0;ce<ee;++ce)if(k[ce]!==N[ce])return k[ce]<N[ce]?-1:1;return I===O?0:I<O?-1:1;case"Array":for(var ne=a,G=f,te=ne.length,le=G.length,ie=te<le?te:le,oe=0;oe<ie;++oe){var se=Ee(ne[oe],G[oe]);if(se!==0)return se}return te===le?0:te<le?-1:1}}catch{}return NaN}function Qe(a){var f=typeof a;return f=="object"&&(ArrayBuffer.isView(a)||(f=fe(a))==="ArrayBuffer")?"binary":f}function Tt(a){return a instanceof Uint8Array?a:ArrayBuffer.isView(a)?new Uint8Array(a.buffer,a.byteOffset,a.byteLength):new Uint8Array(a)}function Lt(a,f,m){var w=a.schema.yProps;return w?(f&&0<m.numFailures&&(f=f.filter(function(k,N){return!m.failures[N]})),Promise.all(w.map(function(k){return k=k.updatesTable,f?a.db.table(k).where("k").anyOf(f).delete():a.db.table(k).clear()})).then(function(){return m})):m}Jt.prototype.execute=function(a){var f=this["@@propmod"];if(f.add!==void 0){var m=f.add;if(h(m))return l(l([],h(a)?a:[],!0),m).sort();if(typeof m=="number")return(Number(a)||0)+m;if(typeof m=="bigint")try{return BigInt(a)+m}catch{return BigInt(0)+m}throw new TypeError("Invalid term ".concat(m))}if(f.remove!==void 0){var w=f.remove;if(h(w))return h(a)?a.filter(function(k){return!w.includes(k)}).sort():[];if(typeof w=="number")return Number(a)-w;if(typeof w=="bigint")try{return BigInt(a)-w}catch{return BigInt(0)-w}throw new TypeError("Invalid subtrahend ".concat(w))}return m=(m=f.replacePrefix)==null?void 0:m[0],m&&typeof a=="string"&&a.startsWith(m)?f.replacePrefix[1]+a.substring(m.length):a};var Wt=Jt;function Jt(a){this["@@propmod"]=a}function Dt(a,f){for(var m=d(f),w=m.length,k=!1,N=0;N<w;++N){var I=m[N],O=f[I],ee=K(a,I);O instanceof Wt?(W(a,I,O.execute(ee)),k=!0):ee!==O&&(W(a,I,O),k=!0)}return k}ht.prototype._trans=function(a,f,m){var w=this._tx||Ye.trans,k=this.name,N=kt&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(a==="readonly"?"read":"write"," ").concat(this.name));function I(ce,ne,G){if(G.schema[k])return f(G.idbtrans,G);throw new Ne.NotFound("Table "+k+" not part of transaction")}var O=zn();try{var ee=w&&w.db._novip===this.db._novip?w===Ye.trans?w._promise(a,I,m):Hn(function(){return w._promise(a,I,m)},{trans:w,transless:Ye.transless||Ye}):(function ce(ne,G,te,le){if(ne.idbdb&&(ne._state.openComplete||Ye.letThrough||ne._vip)){var ie=ne._createTransaction(G,te,ne._dbSchema);try{ie.create(),ne._state.PR1398_maxLoop=3}catch(oe){return oe.name===Se.InvalidState&&ne.isOpen()&&0<--ne._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),ne.close({disableAutoOpen:!1}),ne.open().then(function(){return ce(ne,G,te,le)})):Nt(oe)}return ie._promise(G,function(oe,se){return Hn(function(){return Ye.trans=ie,le(oe,se,ie)})}).then(function(oe){if(G==="readwrite")try{ie.idbtrans.commit()}catch{}return G==="readonly"?oe:ie._completion.then(function(){return oe})})}if(ne._state.openComplete)return Nt(new Ne.DatabaseClosed(ne._state.dbOpenError));if(!ne._state.isBeingOpened){if(!ne._state.autoOpen)return Nt(new Ne.DatabaseClosed);ne.open().catch(Be)}return ne._state.dbReadyPromise.then(function(){return ce(ne,G,te,le)})})(this.db,a,[this.name],I);return N&&(ee._consoleTask=N,ee=ee.catch(function(ce){return console.trace(ce),Nt(ce)})),ee}finally{O&&tr()}},ht.prototype.get=function(a,f){var m=this;return a&&a.constructor===Object?this.where(a).first(f):a==null?Nt(new Ne.Type("Invalid argument to Table.get()")):this._trans("readonly",function(w){return m.core.get({trans:w,key:a}).then(function(k){return m.hook.reading.fire(k)})}).then(f)},ht.prototype.where=function(a){if(typeof a=="string")return new this.db.WhereClause(this,a);if(h(a))return new this.db.WhereClause(this,"[".concat(a.join("+"),"]"));var f=d(a);if(f.length===1)return this.where(f[0]).equals(a[f[0]]);var m=this.schema.indexes.concat(this.schema.primKey).filter(function(O){if(O.compound&&f.every(function(ce){return 0<=O.keyPath.indexOf(ce)})){for(var ee=0;ee<f.length;++ee)if(f.indexOf(O.keyPath[ee])===-1)return!1;return!0}return!1}).sort(function(O,ee){return O.keyPath.length-ee.keyPath.length})[0];if(m&&this.db._maxKey!==Un)return I=m.keyPath.slice(0,f.length),this.where(I).equals(I.map(function(O){return a[O]}));!m&&kt&&console.warn("The query ".concat(JSON.stringify(a)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(f.join("+"),"]"));var w=this.schema.idxByName;function k(O,ee){return Ee(O,ee)===0}var I=f.reduce(function(ne,ee){var ce=ne[0],ne=ne[1],G=w[ee],te=a[ee];return[ce||G,ce||!G?Rn(ne,G&&G.multi?function(le){return le=K(le,ee),h(le)&&le.some(function(ie){return k(te,ie)})}:function(le){return k(te,K(le,ee))}):ne]},[null,null]),N=I[0],I=I[1];return N?this.where(N.name).equals(a[N.keyPath]).filter(I):m?this.filter(I):this.where(f).equals("")},ht.prototype.filter=function(a){return this.toCollection().and(a)},ht.prototype.count=function(a){return this.toCollection().count(a)},ht.prototype.offset=function(a){return this.toCollection().offset(a)},ht.prototype.limit=function(a){return this.toCollection().limit(a)},ht.prototype.each=function(a){return this.toCollection().each(a)},ht.prototype.toArray=function(a){return this.toCollection().toArray(a)},ht.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},ht.prototype.orderBy=function(a){return new this.db.Collection(new this.db.WhereClause(this,h(a)?"[".concat(a.join("+"),"]"):a))},ht.prototype.reverse=function(){return this.toCollection().reverse()},ht.prototype.mapToClass=function(a){for(var f=this.db,m=this.name,w=((this.schema.mappedClass=a).prototype instanceof we&&(a=(I=>{var O=ne,ee=I;if(typeof ee!="function"&&ee!==null)throw new TypeError("Class extends value "+String(ee)+" is not a constructor or null");function ce(){this.constructor=O}function ne(){return I!==null&&I.apply(this,arguments)||this}return i(O,ee),O.prototype=ee===null?Object.create(ee):(ce.prototype=ee.prototype,new ce),Object.defineProperty(ne.prototype,"db",{get:function(){return f},enumerable:!1,configurable:!0}),ne.prototype.table=function(){return m},ne})(a)),new Set),k=a.prototype;k;k=b(k))Object.getOwnPropertyNames(k).forEach(function(I){return w.add(I)});function N(I){if(!I)return I;var O,ee=Object.create(a.prototype);for(O in I)if(!w.has(O))try{ee[O]=I[O]}catch{}return ee}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=N,this.hook("reading",N),a},ht.prototype.defineClass=function(){return this.mapToClass(function(a){v(this,a)})},ht.prototype.add=function(a,f){var m=this,w=this.schema.primKey,k=w.auto,N=w.keyPath,I=a;return N&&k&&(I=L(N)(a)),this._trans("readwrite",function(O){return m.core.mutate({trans:O,type:"add",keys:f!=null?[f]:null,values:[I]})}).then(function(O){return O.numFailures?He.reject(O.failures[0]):O.lastResult}).then(function(O){if(N)try{W(a,N,O)}catch{}return O})},ht.prototype.upsert=function(a,f){var m=this,w=this.schema.primKey.keyPath;return this._trans("readwrite",function(k){return m.core.get({trans:k,key:a}).then(function(N){var I=N??{};return Dt(I,f),w&&W(I,w,a),m.core.mutate({trans:k,type:"put",values:[I],keys:[a],upsert:!0,updates:{keys:[a],changeSpecs:[f]}}).then(function(O){return O.numFailures?He.reject(O.failures[0]):!!N})})})},ht.prototype.update=function(a,f){return typeof a!="object"||h(a)?this.where(":id").equals(a).modify(f):(a=K(a,this.schema.primKey.keyPath))===void 0?Nt(new Ne.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(a).modify(f)},ht.prototype.put=function(a,f){var m=this,w=this.schema.primKey,k=w.auto,N=w.keyPath,I=a;return N&&k&&(I=L(N)(a)),this._trans("readwrite",function(O){return m.core.mutate({trans:O,type:"put",values:[I],keys:f!=null?[f]:null})}).then(function(O){return O.numFailures?He.reject(O.failures[0]):O.lastResult}).then(function(O){if(N)try{W(a,N,O)}catch{}return O})},ht.prototype.delete=function(a){var f=this;return this._trans("readwrite",function(m){return f.core.mutate({trans:m,type:"delete",keys:[a]}).then(function(w){return Lt(f,[a],w)}).then(function(w){return w.numFailures?He.reject(w.failures[0]):void 0})})},ht.prototype.clear=function(){var a=this;return this._trans("readwrite",function(f){return a.core.mutate({trans:f,type:"deleteRange",range:Xr}).then(function(m){return Lt(a,null,m)})}).then(function(f){return f.numFailures?He.reject(f.failures[0]):void 0})},ht.prototype.bulkGet=function(a){var f=this;return this._trans("readonly",function(m){return f.core.getMany({keys:a,trans:m}).then(function(w){return w.map(function(k){return f.hook.reading.fire(k)})})})},ht.prototype.bulkAdd=function(a,f,m){var w=this,k=Array.isArray(f)?f:void 0,N=(m=m||(k?void 0:f))?m.allKeys:void 0;return this._trans("readwrite",function(I){var O=w.schema.primKey,ce=O.auto,O=O.keyPath;if(O&&k)throw new Ne.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(k&&k.length!==a.length)throw new Ne.InvalidArgument("Arguments objects and keys must have the same length");var ee=a.length,ce=O&&ce?a.map(L(O)):a;return w.core.mutate({trans:I,type:"add",keys:k,values:ce,wantResults:N}).then(function(ne){var G=ne.numFailures,te=ne.failures;if(G===0)return N?ne.results:ne.lastResult;throw new Re("".concat(w.name,".bulkAdd(): ").concat(G," of ").concat(ee," operations failed"),te)})})},ht.prototype.bulkPut=function(a,f,m){var w=this,k=Array.isArray(f)?f:void 0,N=(m=m||(k?void 0:f))?m.allKeys:void 0;return this._trans("readwrite",function(I){var O=w.schema.primKey,ce=O.auto,O=O.keyPath;if(O&&k)throw new Ne.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(k&&k.length!==a.length)throw new Ne.InvalidArgument("Arguments objects and keys must have the same length");var ee=a.length,ce=O&&ce?a.map(L(O)):a;return w.core.mutate({trans:I,type:"put",keys:k,values:ce,wantResults:N}).then(function(ne){var G=ne.numFailures,te=ne.failures;if(G===0)return N?ne.results:ne.lastResult;throw new Re("".concat(w.name,".bulkPut(): ").concat(G," of ").concat(ee," operations failed"),te)})})},ht.prototype.bulkUpdate=function(a){var f=this,m=this.core,w=a.map(function(I){return I.key}),k=a.map(function(I){return I.changes}),N=[];return this._trans("readwrite",function(I){return m.getMany({trans:I,keys:w,cache:"clone"}).then(function(O){var ee=[],ce=[],ne=(a.forEach(function(G,te){var le=G.key,ie=G.changes,oe=O[te];if(oe){for(var se=0,ye=Object.keys(ie);se<ye.length;se++){var he=ye[se],be=ie[he];if(he===f.schema.primKey.keyPath){if(Ee(be,le)!==0)throw new Ne.Constraint("Cannot update primary key in bulkUpdate()")}else W(oe,he,be)}N.push(te),ee.push(le),ce.push(oe)}}),ee.length);return m.mutate({trans:I,type:"put",keys:ee,values:ce,updates:{keys:w,changeSpecs:k}}).then(function(G){var te=G.numFailures,le=G.failures;if(te===0)return ne;for(var ie=0,oe=Object.keys(le);ie<oe.length;ie++){var se,ye=oe[ie],he=N[Number(ye)];he!=null&&(se=le[ye],delete le[ye],le[he]=se)}throw new Re("".concat(f.name,".bulkUpdate(): ").concat(te," of ").concat(ne," operations failed"),le)})})})},ht.prototype.bulkDelete=function(a){var f=this,m=a.length;return this._trans("readwrite",function(w){return f.core.mutate({trans:w,type:"delete",keys:a}).then(function(k){return Lt(f,a,k)})}).then(function(w){var k=w.numFailures,N=w.failures;if(k===0)return w.lastResult;throw new Re("".concat(f.name,".bulkDelete(): ").concat(k," of ").concat(m," operations failed"),N)})};var Vt=ht;function ht(){}function or(a){function f(I,O){if(O){for(var ee=arguments.length,ce=new Array(ee-1);--ee;)ce[ee-1]=arguments[ee];return m[I].subscribe.apply(null,ce),a}if(typeof I=="string")return m[I]}var m={};f.addEventType=N;for(var w=1,k=arguments.length;w<k;++w)N(arguments[w]);return f;function N(I,O,ee){var ce,ne;if(typeof I!="object")return O=O||Xt,ne={subscribers:[],fire:ee=ee||Be,subscribe:function(G){ne.subscribers.indexOf(G)===-1&&(ne.subscribers.push(G),ne.fire=O(ne.fire,G))},unsubscribe:function(G){ne.subscribers=ne.subscribers.filter(function(te){return te!==G}),ne.fire=ne.subscribers.reduce(O,ee)}},m[I]=f[I]=ne;d(ce=I).forEach(function(G){var te=ce[G];if(h(te))N(G,ce[G][0],ce[G][1]);else{if(te!=="asap")throw new Ne.InvalidArgument("Invalid event config");var le=N(G,Ue,function(){for(var ie=arguments.length,oe=new Array(ie);ie--;)oe[ie]=arguments[ie];le.subscribers.forEach(function(se){V(function(){se.apply(null,oe)})})})}})}}function vr(a,f){return M(f).from({prototype:a}),f}function vn(a,f){return!(a.filter||a.algorithm||a.or)&&(f?a.justLimit:!a.replayFilter)}function xr(a,f){a.filter=Rn(a.filter,f)}function fo(a,f,m){var w=a.replayFilter;a.replayFilter=w?function(){return Rn(w(),f())}:f,a.justLimit=m&&!w}function wr(a,f){if(a.isPrimKey)return f.primaryKey;var m=f.getIndexByKeyPath(a.index);if(m)return m;throw new Ne.Schema("KeyPath "+a.index+" on object store "+f.name+" is not indexed")}function mi(a,f,m){var w=wr(a,f.schema);return f.openCursor({trans:m,values:!a.keysOnly,reverse:a.dir==="prev",unique:!!a.unique,query:{index:w,range:a.range}})}function Bo(a,f,m,w){var k,N,I=a.replayFilter?Rn(a.filter,a.replayFilter()):a.filter;return a.or?(k={},N=function(O,ee,ce){var ne,G;I&&!I(ee,ce,function(te){return ee.stop(te)},function(te){return ee.fail(te)})||((G=""+(ne=ee.primaryKey))=="[object ArrayBuffer]"&&(G=""+new Uint8Array(ne)),x(k,G))||(k[G]=!0,f(O,ee,ce))},Promise.all([a.or._iterate(N,m),wt(mi(a,w,m),a.algorithm,N,!a.keysOnly&&a.valueMapper)])):wt(mi(a,w,m),Rn(a.algorithm,I),f,!a.keysOnly&&a.valueMapper)}function wt(a,f,m,w){var k=yt(w?function(N,I,O){return m(w(N),I,O)}:m);return a.then(function(N){if(N)return N.start(function(){var I=function(){return N.continue()};f&&!f(N,function(O){return I=O},function(O){N.stop(O),I=Be},function(O){N.fail(O),I=Be})||k(N.value,N,function(O){return I=O}),I()})})}gt.prototype._read=function(a,f){var m=this._ctx;return m.error?m.table._trans(null,Nt.bind(null,m.error)):m.table._trans("readonly",a).then(f)},gt.prototype._write=function(a){var f=this._ctx;return f.error?f.table._trans(null,Nt.bind(null,f.error)):f.table._trans("readwrite",a,"locked")},gt.prototype._addAlgorithm=function(a){var f=this._ctx;f.algorithm=Rn(f.algorithm,a)},gt.prototype._iterate=function(a,f){return Bo(this._ctx,a,f,this._ctx.table.core)},gt.prototype.clone=function(a){var f=Object.create(this.constructor.prototype),m=Object.create(this._ctx);return a&&v(m,a),f._ctx=m,f},gt.prototype.raw=function(){return this._ctx.valueMapper=null,this},gt.prototype.each=function(a){var f=this._ctx;return this._read(function(m){return Bo(f,a,m,f.table.core)})},gt.prototype.count=function(a){var f=this;return this._read(function(m){var w,k=f._ctx,N=k.table.core;return vn(k,!0)?N.count({trans:m,query:{index:wr(k,N.schema),range:k.range}}).then(function(I){return Math.min(I,k.limit)}):(w=0,Bo(k,function(){return++w,!1},m,N).then(function(){return w}))}).then(a)},gt.prototype.sortBy=function(a,f){var m=a.split(".").reverse(),w=m[0],k=m.length-1;function N(ee,ce){return ce?N(ee[m[ce]],ce-1):ee[w]}var I=this._ctx.dir==="next"?1:-1;function O(ee,ce){return Ee(N(ee,k),N(ce,k))*I}return this.toArray(function(ee){return ee.sort(O)}).then(f)},gt.prototype.toArray=function(a){var f=this;return this._read(function(m){var w,k,N,I=f._ctx;return vn(I,!0)&&0<I.limit?(w=I.valueMapper,k=wr(I,I.table.core.schema),I.table.core.query({trans:m,limit:I.limit,values:!0,direction:I.dir==="prev"?"prev":void 0,query:{index:k,range:I.range}}).then(function(O){return O=O.result,w?O.map(w):O})):(N=[],Bo(I,function(O){return N.push(O)},m,I.table.core).then(function(){return N}))},a)},gt.prototype.offset=function(a){var f=this._ctx;return a<=0||(f.offset+=a,vn(f)?fo(f,function(){var m=a;return function(w,k){return m===0||(m===1?--m:k(function(){w.advance(m),m=0}),!1)}}):fo(f,function(){var m=a;return function(){return--m<0}})),this},gt.prototype.limit=function(a){return this._ctx.limit=Math.min(this._ctx.limit,a),fo(this._ctx,function(){var f=a;return function(m,w,k){return--f<=0&&w(k),0<=f}},!0),this},gt.prototype.until=function(a,f){return xr(this._ctx,function(m,w,k){return!a(m.value)||(w(k),f)}),this},gt.prototype.first=function(a){return this.limit(1).toArray(function(f){return f[0]}).then(a)},gt.prototype.last=function(a){return this.reverse().first(a)},gt.prototype.filter=function(a){var f;return xr(this._ctx,function(m){return a(m.value)}),(f=this._ctx).isMatch=Rn(f.isMatch,a),this},gt.prototype.and=function(a){return this.filter(a)},gt.prototype.or=function(a){return new this.db.WhereClause(this._ctx.table,a,this)},gt.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},gt.prototype.desc=function(){return this.reverse()},gt.prototype.eachKey=function(a){var f=this._ctx;return f.keysOnly=!f.isMatch,this.each(function(m,w){a(w.key,w)})},gt.prototype.eachUniqueKey=function(a){return this._ctx.unique="unique",this.eachKey(a)},gt.prototype.eachPrimaryKey=function(a){var f=this._ctx;return f.keysOnly=!f.isMatch,this.each(function(m,w){a(w.primaryKey,w)})},gt.prototype.keys=function(a){var f=this._ctx,m=(f.keysOnly=!f.isMatch,[]);return this.each(function(w,k){m.push(k.key)}).then(function(){return m}).then(a)},gt.prototype.primaryKeys=function(a){var f=this._ctx;if(vn(f,!0)&&0<f.limit)return this._read(function(w){var k=wr(f,f.table.core.schema);return f.table.core.query({trans:w,values:!1,limit:f.limit,direction:f.dir==="prev"?"prev":void 0,query:{index:k,range:f.range}})}).then(function(w){return w.result}).then(a);f.keysOnly=!f.isMatch;var m=[];return this.each(function(w,k){m.push(k.primaryKey)}).then(function(){return m}).then(a)},gt.prototype.uniqueKeys=function(a){return this._ctx.unique="unique",this.keys(a)},gt.prototype.firstKey=function(a){return this.limit(1).keys(function(f){return f[0]}).then(a)},gt.prototype.lastKey=function(a){return this.reverse().firstKey(a)},gt.prototype.distinct=function(){var a,f=this._ctx,f=f.index&&f.table.schema.idxByName[f.index];return f&&f.multi&&(a={},xr(this._ctx,function(w){var w=w.primaryKey.toString(),k=x(a,w);return a[w]=!0,!k})),this},gt.prototype.modify=function(a){var f=this,m=this._ctx;return this._write(function(w){function k(oe,se){var ye=se.failures;te+=oe-se.numFailures;for(var he=0,be=d(ye);he<be.length;he++){var Ce=be[he];G.push(ye[Ce])}}var N=typeof a=="function"?a:function(oe){return Dt(oe,a)},I=m.table.core,ne=I.schema.primaryKey,O=ne.outbound,ee=ne.extractKey,ce=200,ne=f.db._options.modifyChunkSize,G=(ne&&(ce=typeof ne=="object"?ne[I.name]||ne["*"]||200:ne),[]),te=0,le=[],ie=a===Ui;return f.clone().primaryKeys().then(function(oe){function se(he){var be=Math.min(ce,oe.length-he),Ce=oe.slice(he,he+be);return(ie?Promise.resolve([]):I.getMany({trans:w,keys:Ce,cache:"immutable"})).then(function(Pe){var ze=[],Ie=[],Ve=O?[]:null,Le=ie?Ce:[];if(!ie)for(var We=0;We<be;++We){var je=Pe[We],it={value:ve(je),primKey:oe[he+We]};N.call(it,it.value,it)!==!1&&(it.value==null?Le.push(oe[he+We]):O||Ee(ee(je),ee(it.value))===0?(Ie.push(it.value),O&&Ve.push(oe[he+We])):(Le.push(oe[he+We]),ze.push(it.value)))}return Promise.resolve(0<ze.length&&I.mutate({trans:w,type:"add",values:ze}).then(function(st){for(var ut in st.failures)Le.splice(parseInt(ut),1);k(ze.length,st)})).then(function(){return(0<Ie.length||ye&&typeof a=="object")&&I.mutate({trans:w,type:"put",keys:Ve,values:Ie,criteria:ye,changeSpec:typeof a!="function"&&a,isAdditionalChunk:0<he}).then(function(st){return k(Ie.length,st)})}).then(function(){return(0<Le.length||ye&&ie)&&I.mutate({trans:w,type:"delete",keys:Le,criteria:ye,isAdditionalChunk:0<he}).then(function(st){return Lt(m.table,Le,st)}).then(function(st){return k(Le.length,st)})}).then(function(){return oe.length>he+be&&se(he+ce)})})}var ye=vn(m)&&m.limit===1/0&&(typeof a!="function"||ie)&&{index:m.index,range:m.range};return se(0).then(function(){if(0<G.length)throw new Oe("Error modifying one or more objects",G,te,le);return oe.length})})})},gt.prototype.delete=function(){var a=this._ctx,f=a.range;return!vn(a)||a.table.schema.yProps||!a.isPrimKey&&f.type!==3?this.modify(Ui):this._write(function(m){var w=a.table.core.schema.primaryKey,k=f;return a.table.core.count({trans:m,query:{index:w,range:k}}).then(function(N){return a.table.core.mutate({trans:m,type:"deleteRange",range:k}).then(function(ee){var O=ee.failures,ee=ee.numFailures;if(ee)throw new Oe("Could not delete some values",Object.keys(O).map(function(ce){return O[ce]}),N-ee);return N-ee})})})};var Va=gt;function gt(){}var Ui=function(a,f){return f.value=null};function Ua(a,f){return a<f?-1:a===f?0:1}function Ka(a,f){return f<a?-1:a===f?0:1}function Nn(a,f,m){return a=a instanceof $r?new a.Collection(a):a,a._ctx.error=new(m||TypeError)(f),a}function Qr(a){return new a.Collection(a,function(){return Pr("")}).limit(0)}function po(le,f,m,w){var k,N,I,O,ee,ce,ne,G=m.length;if(!m.every(function(oe){return typeof oe=="string"}))return Nn(le,Fo);function te(oe){k=oe==="next"?function(ye){return ye.toUpperCase()}:function(ye){return ye.toLowerCase()},N=oe==="next"?function(ye){return ye.toLowerCase()}:function(ye){return ye.toUpperCase()},I=oe==="next"?Ua:Ka;var se=m.map(function(ye){return{lower:N(ye),upper:k(ye)}}).sort(function(ye,he){return I(ye.lower,he.lower)});O=se.map(function(ye){return ye.upper}),ee=se.map(function(ye){return ye.lower}),ne=(ce=oe)==="next"?"":w}te("next");var le=new le.Collection(le,function(){return xn(O[0],ee[G-1]+w)}),ie=(le._ondirectionchange=function(oe){te(oe)},0);return le._addAlgorithm(function(oe,se,ye){var he=oe.key;if(typeof he=="string"){var be=N(he);if(f(be,ee,ie))return!0;for(var Ce=null,Pe=ie;Pe<G;++Pe){var ze=((Ie,Ve,Le,We,je,it)=>{for(var st=Math.min(Ie.length,We.length),ut=-1,ft=0;ft<st;++ft){var En=Ve[ft];if(En!==We[ft])return je(Ie[ft],Le[ft])<0?Ie.substr(0,ft)+Le[ft]+Le.substr(ft+1):je(Ie[ft],We[ft])<0?Ie.substr(0,ft)+We[ft]+Le.substr(ft+1):0<=ut?Ie.substr(0,ut)+Ve[ut]+Le.substr(ut+1):null;je(Ie[ft],En)<0&&(ut=ft)}return st<We.length&&it==="next"?Ie+Le.substr(Ie.length):st<Ie.length&&it==="prev"?Ie.substr(0,Le.length):ut<0?null:Ie.substr(0,ut)+We[ut]+Le.substr(ut+1)})(he,be,O[Pe],ee[Pe],I,ce);ze===null&&Ce===null?ie=Pe+1:(Ce===null||0<I(Ce,ze))&&(Ce=ze)}se(Ce!==null?function(){oe.continue(Ce+ne)}:ye)}return!1}),le}function xn(a,f,m,w){return{type:2,lower:a,upper:f,lowerOpen:m,upperOpen:w}}function Pr(a){return{type:1,lower:a,upper:a}}Object.defineProperty(At.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),At.prototype.between=function(a,f,m,w){m=m!==!1,w=w===!0;try{return 0<this._cmp(a,f)||this._cmp(a,f)===0&&(m||w)&&(!m||!w)?Qr(this):new this.Collection(this,function(){return xn(a,f,!m,!w)})}catch{return Nn(this,pt)}},At.prototype.equals=function(a){return a==null?Nn(this,pt):new this.Collection(this,function(){return Pr(a)})},At.prototype.above=function(a){return a==null?Nn(this,pt):new this.Collection(this,function(){return xn(a,void 0,!0)})},At.prototype.aboveOrEqual=function(a){return a==null?Nn(this,pt):new this.Collection(this,function(){return xn(a,void 0,!1)})},At.prototype.below=function(a){return a==null?Nn(this,pt):new this.Collection(this,function(){return xn(void 0,a,!1,!0)})},At.prototype.belowOrEqual=function(a){return a==null?Nn(this,pt):new this.Collection(this,function(){return xn(void 0,a)})},At.prototype.startsWith=function(a){return typeof a!="string"?Nn(this,Fo):this.between(a,a+Un,!0,!0)},At.prototype.startsWithIgnoreCase=function(a){return a===""?this.startsWith(a):po(this,function(f,m){return f.indexOf(m[0])===0},[a],Un)},At.prototype.equalsIgnoreCase=function(a){return po(this,function(f,m){return f===m[0]},[a],"")},At.prototype.anyOfIgnoreCase=function(){var a=Z.apply(q,arguments);return a.length===0?Qr(this):po(this,function(f,m){return m.indexOf(f)!==-1},a,"")},At.prototype.startsWithAnyOfIgnoreCase=function(){var a=Z.apply(q,arguments);return a.length===0?Qr(this):po(this,function(f,m){return m.some(function(w){return f.indexOf(w)===0})},a,Un)},At.prototype.anyOf=function(){var a,f,m=this,w=Z.apply(q,arguments),k=this._cmp;try{w.sort(k)}catch{return Nn(this,pt)}return w.length===0?Qr(this):((a=new this.Collection(this,function(){return xn(w[0],w[w.length-1])}))._ondirectionchange=function(N){k=N==="next"?m._ascending:m._descending,w.sort(k)},f=0,a._addAlgorithm(function(N,I,O){for(var ee=N.key;0<k(ee,w[f]);)if(++f===w.length)return I(O),!1;return k(ee,w[f])===0||(I(function(){N.continue(w[f])}),!1)}),a)},At.prototype.notEqual=function(a){return this.inAnyRange([[-1/0,a],[a,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},At.prototype.noneOf=function(){var a=Z.apply(q,arguments);if(a.length===0)return new this.Collection(this);try{a.sort(this._ascending)}catch{return Nn(this,pt)}var f=a.reduce(function(m,w){return m?m.concat([[m[m.length-1][1],w]]):[[-1/0,w]]},null);return f.push([a[a.length-1],this.db._maxKey]),this.inAnyRange(f,{includeLowers:!1,includeUppers:!1})},At.prototype.inAnyRange=function(a,ye){var m=this,w=this._cmp,k=this._ascending,N=this._descending,I=this._min,O=this._max;if(a.length===0)return Qr(this);if(!a.every(function(he){return he[0]!==void 0&&he[1]!==void 0&&k(he[0],he[1])<=0}))return Nn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Ne.InvalidArgument);var ee=!ye||ye.includeLowers!==!1,ce=ye&&ye.includeUppers===!0,ne,G=k;function te(he,be){return G(he[0],be[0])}try{(ne=a.reduce(function(he,be){for(var Ce=0,Pe=he.length;Ce<Pe;++Ce){var ze=he[Ce];if(w(be[0],ze[1])<0&&0<w(be[1],ze[0])){ze[0]=I(ze[0],be[0]),ze[1]=O(ze[1],be[1]);break}}return Ce===Pe&&he.push(be),he},[])).sort(te)}catch{return Nn(this,pt)}var le=0,ie=ce?function(he){return 0<k(he,ne[le][1])}:function(he){return 0<=k(he,ne[le][1])},oe=ee?function(he){return 0<N(he,ne[le][0])}:function(he){return 0<=N(he,ne[le][0])},se=ie,ye=new this.Collection(this,function(){return xn(ne[0][0],ne[ne.length-1][1],!ee,!ce)});return ye._ondirectionchange=function(he){G=he==="next"?(se=ie,k):(se=oe,N),ne.sort(te)},ye._addAlgorithm(function(he,be,Ce){for(var Pe,ze=he.key;se(ze);)if(++le===ne.length)return be(Ce),!1;return!ie(Pe=ze)&&!oe(Pe)||(m._cmp(ze,ne[le][1])===0||m._cmp(ze,ne[le][0])===0||be(function(){G===k?he.continue(ne[le][0]):he.continue(ne[le][1])}),!1)}),ye},At.prototype.startsWithAnyOf=function(){var a=Z.apply(q,arguments);return a.every(function(f){return typeof f=="string"})?a.length===0?Qr(this):this.inAnyRange(a.map(function(f){return[f,f+Un]})):Nn(this,"startsWithAnyOf() only works with strings")};var $r=At;function At(){}function wn(a){return yt(function(f){return Kn(f),a(f.target.error),!1})}function Kn(a){a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault()}var gi="storagemutated",Ki="x-storagemutated-1",qn=or(null,gi),Lu=(ir.prototype._lock=function(){return R(!Ye.global),++this._reculock,this._reculock!==1||Ye.global||(Ye.lockOwnerFor=this),this},ir.prototype._unlock=function(){if(R(!Ye.global),--this._reculock==0)for(Ye.global||(Ye.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var a=this._blockedFuncs.shift();try{On(a[1],a[0])}catch{}}return this},ir.prototype._locked=function(){return this._reculock&&Ye.lockOwnerFor!==this},ir.prototype.create=function(a){var f=this;if(this.mode){var m=this.db.idbdb,w=this.db._state.dbOpenError;if(R(!this.idbtrans),!a&&!m)switch(w&&w.name){case"DatabaseClosedError":throw new Ne.DatabaseClosed(w);case"MissingAPIError":throw new Ne.MissingAPI(w.message,w);default:throw new Ne.OpenFailed(w)}if(!this.active)throw new Ne.TransactionInactive;R(this._completion._state===null),(a=this.idbtrans=a||(this.db.core||m).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=yt(function(k){Kn(k),f._reject(a.error)}),a.onabort=yt(function(k){Kn(k),f.active&&f._reject(new Ne.Abort(a.error)),f.active=!1,f.on("abort").fire(k)}),a.oncomplete=yt(function(){f.active=!1,f._resolve(),"mutatedParts"in a&&qn.storagemutated.fire(a.mutatedParts)})}return this},ir.prototype._promise=function(a,f,m){var w,k=this;return a==="readwrite"&&this.mode!=="readwrite"?Nt(new Ne.ReadOnly("Transaction is readonly")):this.active?this._locked()?new He(function(N,I){k._blockedFuncs.push([function(){k._promise(a,f,m).then(N,I)},Ye])}):m?Hn(function(){var N=new He(function(I,O){k._lock();var ee=f(I,O,k);ee&&ee.then&&ee.then(I,O)});return N.finally(function(){return k._unlock()}),N._lib=!0,N}):((w=new He(function(N,I){var O=f(N,I,k);O&&O.then&&O.then(N,I)}))._lib=!0,w):Nt(new Ne.TransactionInactive)},ir.prototype._root=function(){return this.parent?this.parent._root():this},ir.prototype.waitFor=function(a){var f,m=this._root(),w=He.resolve(a),k=(m._waitingFor?m._waitingFor=m._waitingFor.then(function(){return w}):(m._waitingFor=w,m._waitingQueue=[],f=m.idbtrans.objectStore(m.storeNames[0]),(function N(){for(++m._spinCount;m._waitingQueue.length;)m._waitingQueue.shift()();m._waitingFor&&(f.get(-1/0).onsuccess=N)})()),m._waitingFor);return new He(function(N,I){w.then(function(O){return m._waitingQueue.push(yt(N.bind(null,O)))},function(O){return m._waitingQueue.push(yt(I.bind(null,O)))}).finally(function(){m._waitingFor===k&&(m._waitingFor=null)})})},ir.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Ne.Abort))},ir.prototype.table=function(a){var f=this._memoizedTables||(this._memoizedTables={});if(x(f,a))return f[a];var m=this.schema[a];if(m)return(m=new this.db.Table(a,m,this)).core=this.db.core.table(a),f[a]=m;throw new Ne.NotFound("Table "+a+" not part of transaction")},ir);function ir(){}function Ho(a,f,m,w,k,N,I,O){return{name:a,keyPath:f,unique:m,multi:w,auto:k,compound:N,src:(m&&!I?"&":"")+(w?"*":"")+(k?"++":"")+Ds(f),type:O}}function Ds(a){return typeof a=="string"?a:a?"["+[].join.call(a,"+")+"]":""}function zs(a,f,m){return{name:a,primKey:f,indexes:m,mappedClass:null,idxByName:(w=function(k){return[k.name,k]},m.reduce(function(k,N,I){return N=w(N,I),N&&(k[N[0]]=N[1]),k},{}))};var w}var Mr=function(a){try{return a.only([[]]),Mr=function(){return[[]]},[[]]}catch{return Mr=function(){return Un},Un}};function ho(a){return a==null?function(){}:typeof a=="string"?(f=a).split(".").length===1?function(m){return m[f]}:function(m){return K(m,f)}:function(m){return K(m,a)};var f}function mo(a){return[].slice.call(a)}var qi=0;function yi(a){return a==null?":id":typeof a=="string"?a:"[".concat(a.join("+"),"]")}function Du(a,f,I){function w(se){if(se.type===3)return null;if(se.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var le=se.lower,ie=se.upper,oe=se.lowerOpen,se=se.upperOpen;return le===void 0?ie===void 0?null:f.upperBound(ie,!!se):ie===void 0?f.lowerBound(le,!!oe):f.bound(le,ie,!!oe,!!se)}function k(te){var le,ie,oe=te.name;return{name:oe,schema:te,mutate:function(se){var ye=se.trans,he=se.type,be=se.keys,Ce=se.values,Pe=se.range;return new Promise(function(ze,Ie){ze=yt(ze);var Ve=ye.objectStore(oe),Le=Ve.keyPath==null,We=he==="put"||he==="add";if(!We&&he!=="delete"&&he!=="deleteRange")throw new Error("Invalid operation type: "+he);var je,it=(be||Ce||{length:1}).length;if(be&&Ce&&be.length!==Ce.length)throw new Error("Given keys array must have same length as given values array.");if(it===0)return ze({numFailures:0,failures:{},results:[],lastResult:void 0});function st(bn){++En,Kn(bn)}var ut=[],ft=[],En=0;if(he==="deleteRange"){if(Pe.type===4)return ze({numFailures:En,failures:ft,results:[],lastResult:void 0});Pe.type===3?ut.push(je=Ve.clear()):ut.push(je=Ve.delete(w(Pe)))}else{var Le=We?Le?[Ce,be]:[Ce,null]:[be,null],lt=Le[0],jt=Le[1];if(We)for(var Zt=0;Zt<it;++Zt)ut.push(je=jt&&jt[Zt]!==void 0?Ve[he](lt[Zt],jt[Zt]):Ve[he](lt[Zt])),je.onerror=st;else for(Zt=0;Zt<it;++Zt)ut.push(je=Ve[he](lt[Zt])),je.onerror=st}function Go(bn){bn=bn.target.result,ut.forEach(function(_o,So){return _o.error!=null&&(ft[So]=_o.error)}),ze({numFailures:En,failures:ft,results:he==="delete"?be:ut.map(function(_o){return _o.result}),lastResult:bn})}je.onerror=function(bn){st(bn),Go(bn)},je.onsuccess=Go})},getMany:function(se){var ye=se.trans,he=se.keys;return new Promise(function(be,Ce){be=yt(be);for(var Pe,ze=ye.objectStore(oe),Ie=he.length,Ve=new Array(Ie),Le=0,We=0,je=function(ut){ut=ut.target,Ve[ut._pos]=ut.result,++We===Le&&be(Ve)},it=wn(Ce),st=0;st<Ie;++st)he[st]!=null&&((Pe=ze.get(he[st]))._pos=st,Pe.onsuccess=je,Pe.onerror=it,++Le);Le===0&&be(Ve)})},get:function(se){var ye=se.trans,he=se.key;return new Promise(function(be,Ce){be=yt(be);var Pe=ye.objectStore(oe).get(he);Pe.onsuccess=function(ze){return be(ze.target.result)},Pe.onerror=wn(Ce)})},query:(le=ee,ie=ce,function(se){return new Promise(function(ye,he){ye=yt(ye);var be,Ce,Pe,ze,it=se.trans,Ie=se.values,Ve=se.limit,je=se.query,Le=(Le=se.direction)!=null?Le:"next",We=Ve===1/0?void 0:Ve,st=je.index,je=je.range,it=it.objectStore(oe),it=st.isPrimaryKey?it:it.index(st.name),st=w(je);if(Ve===0)return ye({result:[]});ie?(je={query:st,count:We,direction:Le},(be=Ie?it.getAll(je):it.getAllKeys(je)).onsuccess=function(ut){return ye({result:ut.target.result})},be.onerror=wn(he)):le&&Le==="next"?((be=Ie?it.getAll(st,We):it.getAllKeys(st,We)).onsuccess=function(ut){return ye({result:ut.target.result})},be.onerror=wn(he)):(Ce=0,Pe=!Ie&&"openKeyCursor"in it?it.openKeyCursor(st,Le):it.openCursor(st,Le),ze=[],Pe.onsuccess=function(){var ut=Pe.result;return!ut||(ze.push(Ie?ut.value:ut.primaryKey),++Ce===Ve)?ye({result:ze}):void ut.continue()},Pe.onerror=wn(he))})}),openCursor:function(se){var ye=se.trans,he=se.values,be=se.query,Ce=se.reverse,Pe=se.unique;return new Promise(function(ze,Ie){ze=yt(ze);var We=be.index,Ve=be.range,Le=ye.objectStore(oe),Le=We.isPrimaryKey?Le:Le.index(We.name),We=Ce?Pe?"prevunique":"prev":Pe?"nextunique":"next",je=!he&&"openKeyCursor"in Le?Le.openKeyCursor(w(Ve),We):Le.openCursor(w(Ve),We);je.onerror=wn(Ie),je.onsuccess=yt(function(it){var st,ut,ft,En,lt=je.result;lt?(lt.___id=++qi,lt.done=!1,st=lt.continue.bind(lt),ut=(ut=lt.continuePrimaryKey)&&ut.bind(lt),ft=lt.advance.bind(lt),En=function(){throw new Error("Cursor not stopped")},lt.trans=ye,lt.stop=lt.continue=lt.continuePrimaryKey=lt.advance=function(){throw new Error("Cursor not started")},lt.fail=yt(Ie),lt.next=function(){var jt=this,Zt=1;return this.start(function(){return Zt--?jt.continue():jt.stop()}).then(function(){return jt})},lt.start=function(jt){function Zt(){if(je.result)try{jt()}catch(bn){lt.fail(bn)}else lt.done=!0,lt.start=function(){throw new Error("Cursor behind last entry")},lt.stop()}var Go=new Promise(function(bn,_o){bn=yt(bn),je.onerror=wn(_o),lt.fail=_o,lt.stop=function(So){lt.stop=lt.continue=lt.continuePrimaryKey=lt.advance=En,bn(So)}});return je.onsuccess=yt(function(bn){je.onsuccess=Zt,Zt()}),lt.continue=st,lt.continuePrimaryKey=ut,lt.advance=ft,Zt(),Go},ze(lt)):ze(null)},Ie)})},count:function(se){var ye=se.query,he=se.trans,be=ye.index,Ce=ye.range;return new Promise(function(Pe,ze){var Ie=he.objectStore(oe),Ie=be.isPrimaryKey?Ie:Ie.index(be.name),Ve=w(Ce),Ve=Ve?Ie.count(Ve):Ie.count();Ve.onsuccess=yt(function(Le){return Pe(Le.target.result)}),Ve.onerror=wn(ze)})}}}N=I,O=mo((I=a).objectStoreNames),ne=0<O.length?N.objectStore(O[0]):{};var N,I={schema:{name:I.name,tables:O.map(function(te){return N.objectStore(te)}).map(function(te){var le=te.keyPath,ie=te.autoIncrement,se=h(le),oe={},se={name:te.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:le==null,compound:se,keyPath:le,autoIncrement:ie,unique:!0,extractKey:ho(le)},indexes:mo(te.indexNames).map(function(ye){return te.index(ye)}).map(function(Ce){var Pe=Ce.name,he=Ce.unique,be=Ce.multiEntry,Ce=Ce.keyPath,Pe={name:Pe,compound:h(Ce),keyPath:Ce,unique:he,multiEntry:be,extractKey:ho(Ce)};return oe[yi(Ce)]=Pe}),getIndexByKeyPath:function(ye){return oe[yi(ye)]}};return oe[":id"]=se.primaryKey,le!=null&&(oe[yi(le)]=se.primaryKey),se})},hasGetAll:0<O.length&&"getAll"in ne&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604),hasIdb3Features:"getAllRecords"in ne},O=I.schema,ee=I.hasGetAll,ce=I.hasIdb3Features,ne=O.tables.map(k),G={};return ne.forEach(function(te){return G[te.name]=te}),{stack:"dbcore",transaction:a.transaction.bind(a),table:function(te){if(G[te])return G[te];throw new Error("Table '".concat(te,"' not found"))},MIN_KEY:-1/0,MAX_KEY:Mr(f),schema:O}}function Fs(a,f,m,w){return m=m.IDBKeyRange,f=Du(f,m,w),{dbcore:a.dbcore.reduce(function(k,N){return N=N.create,s(s({},k),N(k))},f)}}function go(a,f){var m=f.db,m=Fs(a._middlewares,m,a._deps,f);a.core=m.dbcore,a.tables.forEach(function(w){var k=w.name;a.core.schema.tables.some(function(N){return N.name===k})&&(w.core=a.core.table(k),a[k]instanceof a.Table)&&(a[k].core=w.core)})}function Vo(a,f,m,w){m.forEach(function(k){var N=w[k];f.forEach(function(I){var O=(function ee(ce,ne){return T(ce,ne)||(ce=b(ce))&&ee(ce,ne)})(I,k);(!O||"value"in O&&O.value===void 0)&&(I===a.Transaction.prototype||I instanceof a.Transaction?j(I,k,{get:function(){return this.table(k)},set:function(ee){C(this,k,{value:ee,writable:!0,configurable:!0,enumerable:!0})}}):I[k]=new a.Table(k,N))})})}function Wi(a,f){f.forEach(function(m){for(var w in m)m[w]instanceof a.Table&&delete m[w]})}function Gr(a,f){return a._cfg.version-f._cfg.version}function Bs(a,f,m,w){var k=a._dbSchema,N=(m.objectStoreNames.contains("$meta")&&!k.$meta&&(k.$meta=zs("$meta",Qi("")[0],[]),a._storeNames.push("$meta")),a._createTransaction("readwrite",a._storeNames,k)),I=(N.create(m),N._completion.catch(w),N._reject.bind(N)),O=Ye.transless||Ye;Hn(function(){if(Ye.trans=N,Ye.transless=O,f!==0)return go(a,m),ce=f,((ee=N).storeNames.includes("$meta")?ee.table("$meta").get("version").then(function(ne){return ne??ce}):He.resolve(ce)).then(function(se){var G=a,te=se,le=N,ie=m,oe=[],se=G._versions,ye=G._dbSchema=fn(0,G.idbdb,ie);return(se=se.filter(function(he){return he._cfg.version>=te})).length===0?He.resolve():(se.forEach(function(he){oe.push(function(){var be,Ce,Pe,ze=ye,Ie=he._cfg.dbschema,Ve=(Ir(G,ze,ie),Ir(G,Ie,ie),ye=G._dbSchema=Ie,Xi(ze,Ie)),Le=(Ve.add.forEach(function(We){Uo(ie,We[0],We[1].primKey,We[1].indexes)}),Ve.change.forEach(function(We){if(We.recreate)throw new Ne.Upgrade("Not yet support for changing primary key");var je=ie.objectStore(We.name);We.add.forEach(function(it){return xi(je,it)}),We.change.forEach(function(it){je.deleteIndex(it.name),xi(je,it)}),We.del.forEach(function(it){return je.deleteIndex(it)})}),he._cfg.contentUpgrade);if(Le&&he._cfg.version>te)return go(G,ie),le._memoizedTables={},be=Q(Ie),Ve.del.forEach(function(We){be[We]=ze[We]}),Wi(G,[G.Transaction.prototype]),Vo(G,[G.Transaction.prototype],d(be),be),le.schema=be,(Ce=A(Le))&&mr(),Ie=He.follow(function(){var We;(Pe=Le(le))&&Ce&&(We=qt.bind(null,null),Pe.then(We,We))}),Pe&&typeof Pe.then=="function"?He.resolve(Pe):Ie.then(function(){return Pe})}),oe.push(function(be){var Ce,Pe,ze=he._cfg.dbschema;Ce=ze,Pe=be,[].slice.call(Pe.db.objectStoreNames).forEach(function(Ie){return Ce[Ie]==null&&Pe.db.deleteObjectStore(Ie)}),Wi(G,[G.Transaction.prototype]),Vo(G,[G.Transaction.prototype],G._storeNames,G._dbSchema),le.schema=G._dbSchema}),oe.push(function(be){G.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(G.idbdb.version/10)===he._cfg.version?(G.idbdb.deleteObjectStore("$meta"),delete G._dbSchema.$meta,G._storeNames=G._storeNames.filter(function(Ce){return Ce!=="$meta"})):be.objectStore("$meta").put(he._cfg.version,"version"))})}),(function he(){return oe.length?He.resolve(oe.shift()(le.idbtrans)).then(he):He.resolve()})().then(function(){vi(ye,ie)}))}).catch(I);var ee,ce;d(k).forEach(function(ne){Uo(m,ne,k[ne].primKey,k[ne].indexes)}),go(a,m),He.follow(function(){return a.on.populate.fire(N)}).catch(I)})}function Yi(a,f){vi(a._dbSchema,f),f.db.version%10!=0||f.objectStoreNames.contains("$meta")||f.db.createObjectStore("$meta").add(Math.ceil(f.db.version/10-1),"version");var m=fn(0,a.idbdb,f);Ir(a,a._dbSchema,f);for(var w=0,k=Xi(m,a._dbSchema).change;w<k.length;w++){var N=(I=>{if(I.change.length||I.recreate)return console.warn("Unable to patch indexes of table ".concat(I.name," because it has changes on the type of index or primary key.")),{value:void 0};var O=f.objectStore(I.name);I.add.forEach(function(ee){kt&&console.debug("Dexie upgrade patch: Creating missing index ".concat(I.name,".").concat(ee.src)),xi(O,ee)})})(k[w]);if(typeof N=="object")return N.value}}function Xi(a,f){var m,w={del:[],add:[],change:[]};for(m in a)f[m]||w.del.push(m);for(m in f){var k=a[m],N=f[m];if(k){var I={name:m,def:N,recreate:!1,del:[],add:[],change:[]};if(""+(k.primKey.keyPath||"")!=""+(N.primKey.keyPath||"")||k.primKey.auto!==N.primKey.auto)I.recreate=!0,w.change.push(I);else{var O=k.idxByName,ee=N.idxByName,ce=void 0;for(ce in O)ee[ce]||I.del.push(ce);for(ce in ee){var ne=O[ce],G=ee[ce];ne?ne.src!==G.src&&I.change.push(G):I.add.push(G)}(0<I.del.length||0<I.add.length||0<I.change.length)&&w.change.push(I)}}else w.add.push([m,N])}return w}function Uo(a,f,m,w){var k=a.db.createObjectStore(f,m.keyPath?{keyPath:m.keyPath,autoIncrement:m.auto}:{autoIncrement:m.auto});w.forEach(function(N){return xi(k,N)})}function vi(a,f){d(a).forEach(function(m){f.db.objectStoreNames.contains(m)||(kt&&console.debug("Dexie: Creating missing table",m),Uo(f,m,a[m].primKey,a[m].indexes))})}function xi(a,f){a.createIndex(f.name,f.keyPath,{unique:f.unique,multiEntry:f.multi})}function fn(a,f,m){var w={};return F(f.objectStoreNames,0).forEach(function(k){for(var N=m.objectStore(k),I=Ho(Ds(ce=N.keyPath),ce||"",!0,!1,!!N.autoIncrement,ce&&typeof ce!="string",!0),O=[],ee=0;ee<N.indexNames.length;++ee){var ne=N.index(N.indexNames[ee]),ce=ne.keyPath,ne=Ho(ne.name,ce,!!ne.unique,!!ne.multiEntry,!1,ce&&typeof ce!="string",!1);O.push(ne)}w[k]=zs(k,I,O)}),w}function Ir(a,f,m){for(var w=m.db.objectStoreNames,k=0;k<w.length;++k){var N=w[k],I=m.objectStore(N);a._hasGetAll="getAll"in I;for(var O=0;O<I.indexNames.length;++O){var ee,ce=I.indexNames[O],ne=I.index(ce).keyPath,ne=typeof ne=="string"?ne:"["+F(ne).join("+")+"]";f[N]&&(ee=f[N].idxByName[ne])&&(ee.name=ce,delete f[N].idxByName[ne],f[N].idxByName[ce]=ee)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&c.WorkerGlobalScope&&c instanceof c.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(a._hasGetAll=!1)}function Qi(a){return a.split(",").map(function(f,m){var k=f.split(":"),w=(w=k[1])==null?void 0:w.trim(),k=(f=k[0].trim()).replace(/([&*]|\+\+)/g,""),N=/^\[/.test(k)?k.match(/^\[(.*)\]$/)[1].split("+"):k;return Ho(k,N||null,/\&/.test(f),/\*/.test(f),/\+\+/.test(f),h(N),m===0,w)})}Ko.prototype._createTableSchema=zs,Ko.prototype._parseIndexSyntax=Qi,Ko.prototype._parseStoresSpec=function(a,f){var m=this;d(a).forEach(function(w){if(a[w]!==null){var k=m._parseIndexSyntax(a[w]),N=k.shift();if(!N)throw new Ne.Schema("Invalid schema for table "+w+": "+a[w]);if(N.unique=!0,N.multi)throw new Ne.Schema("Primary key cannot be multiEntry*");k.forEach(function(I){if(I.auto)throw new Ne.Schema("Only primary key can be marked as autoIncrement (++)");if(!I.keyPath)throw new Ne.Schema("Index must have a name and cannot be an empty string")}),N=m._createTableSchema(w,N,k),f[w]=N}})},Ko.prototype.stores=function(m){var f=this.db,m=(this._cfg.storesSource=this._cfg.storesSource?v(this._cfg.storesSource,m):m,f._versions),w={},k={};return m.forEach(function(N){v(w,N._cfg.storesSource),k=N._cfg.dbschema={},N._parseStoresSpec(w,k)}),f._dbSchema=k,Wi(f,[f._allTables,f,f.Transaction.prototype]),Vo(f,[f._allTables,f,f.Transaction.prototype,this._cfg.tables],d(k),k),f._storeNames=d(k),this},Ko.prototype.upgrade=function(a){return this._cfg.contentUpgrade=Qt(this._cfg.contentUpgrade||Be,a),this};var wi=Ko;function Ko(){}var yo=(()=>{var a,f,m;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(a=new Set,f=new FinalizationRegistry(function(w){a.delete(w)}),{toArray:function(){return Array.from(a).map(function(w){return w.deref()}).filter(function(w){return w!==void 0})},add:function(w){var k=new WeakRef(w._novip);a.add(k),f.register(w._novip,k,k),a.size>w._options.maxConnections&&(k=a.values().next().value,a.delete(k),f.unregister(k))},remove:function(w){if(w)for(var k=a.values(),N=k.next();!N.done;){var I=N.value;if(I.deref()===w._novip)return a.delete(I),void f.unregister(I);N=k.next()}}}):(m=[],{toArray:function(){return m},add:function(w){m.push(w._novip)},remove:function(w){w&&(w=m.indexOf(w._novip))!==-1&&m.splice(w,1)}})})();function bi(a,f){var m=a._dbNamesDB;return m||(m=a._dbNamesDB=new Ar(yr,{addons:[],indexedDB:a,IDBKeyRange:f})).version(1).stores({dbnames:"name"}),m.table("dbnames")}function vo(a){return a&&typeof a.databases=="function"}function qo(a){return Hn(function(){return Ye.letThrough=!0,a()})}function Gi(a){return!("from"in a)}var dn=function(a,f){var m;if(!this)return m=new dn,a&&"d"in a&&v(m,a),m;v(this,arguments.length?{d:1,from:a,to:1<arguments.length?f:a}:{d:0})};function _i(a,f,m){var w=Ee(f,m);if(!isNaN(w)){if(0<w)throw RangeError();if(Gi(a))return v(a,{from:f,to:m,d:1});var w=a.l,k=a.r;if(Ee(m,a.from)<0)return w?_i(w,f,m):a.l={from:f,to:m,d:1,l:null,r:null},qa(a);if(0<Ee(f,a.to))return k?_i(k,f,m):a.r={from:f,to:m,d:1,l:null,r:null},qa(a);Ee(f,a.from)<0&&(a.from=f,a.l=null,a.d=k?k.d+1:1),0<Ee(m,a.to)&&(a.to=m,a.r=null,a.d=a.l?a.l.d+1:1),f=!a.r,w&&!a.l&&Si(a,w),k&&f&&Si(a,k)}}function Si(a,f){Gi(f)||(function m(w,k){var N=k.from,I=k.l,O=k.r;_i(w,N,k.to),I&&m(w,I),O&&m(w,O)})(a,f)}function Ji(a,f){var m=Zi(f),w=m.next();if(!w.done)for(var k=w.value,N=Zi(a),I=N.next(k.from),O=I.value;!w.done&&!I.done;){if(Ee(O.from,k.to)<=0&&0<=Ee(O.to,k.from))return!0;Ee(k.from,O.from)<0?k=(w=m.next(O.from)).value:O=(I=N.next(k.from)).value}return!1}function Zi(a){var f=Gi(a)?null:{s:0,n:a};return{next:function(m){for(var w=0<arguments.length;f;)switch(f.s){case 0:if(f.s=1,w)for(;f.n.l&&Ee(m,f.n.from)<0;)f={up:f,n:f.n.l,s:1};else for(;f.n.l;)f={up:f,n:f.n.l,s:1};case 1:if(f.s=2,!w||Ee(m,f.n.to)<=0)return{value:f.n,done:!1};case 2:if(f.n.r){f.s=3,f={up:f,n:f.n.r,s:0};continue}case 3:f=f.up}return{done:!0}}}}function qa(a){var f,m,w,k=(((k=a.r)==null?void 0:k.d)||0)-(((k=a.l)==null?void 0:k.d)||0),k=1<k?"r":k<-1?"l":"";k&&(f=k=="r"?"l":"r",m=s({},a),w=a[k],a.from=w.from,a.to=w.to,a[k]=w[k],m[k]=w[f],(a[f]=m).d=Wa(m)),a.d=Wa(a)}function Wa(m){var f=m.r,m=m.l;return(f?m?Math.max(f.d,m.d):f.d:m?m.d:0)+1}function es(a,f){return d(f).forEach(function(m){a[m]?Si(a[m],f[m]):a[m]=(function w(k){var N,I,O={};for(N in k)x(k,N)&&(I=k[N],O[N]=!I||typeof I!="object"||X.has(I.constructor)?I:w(I));return O})(f[m])}),a}function Hs(a,f){return a.all||f.all||Object.keys(a).some(function(m){return f[m]&&Ji(f[m],a[m])})}_(dn.prototype,((Et={add:function(a){return Si(this,a),this},addKey:function(a){return _i(this,a,a),this},addKeys:function(a){var f=this;return a.forEach(function(m){return _i(f,m,m)}),this},hasKey:function(a){var f=Zi(this).next(a).value;return f&&Ee(f.from,a)<=0&&0<=Ee(f.to,a)}})[J]=function(){return Zi(this)},Et));var Jr={},Vs={},Us=!1;function ts(a){es(Vs,a),Us||(Us=!0,setTimeout(function(){Us=!1,Ks(Vs,!(Vs={}))},0))}function Ks(a,f){f===void 0&&(f=!1);var m=new Set;if(a.all)for(var w=0,k=Object.values(Jr);w<k.length;w++)ns(O=k[w],a,m,f);else for(var N in a){var I,O,N=/^idb\:\/\/(.*)\/(.*)\//.exec(N);N&&(I=N[1],N=N[2],O=Jr["idb://".concat(I,"/").concat(N)])&&ns(O,a,m,f)}m.forEach(function(ee){return ee()})}function ns(a,f,m,w){for(var k=[],N=0,I=Object.entries(a.queries.query);N<I.length;N++){for(var O=I[N],ee=O[0],ce=[],ne=0,G=O[1];ne<G.length;ne++){var te=G[ne];Hs(f,te.obsSet)?te.subscribers.forEach(function(se){return m.add(se)}):w&&ce.push(te)}w&&k.push([ee,ce])}if(w)for(var le=0,ie=k;le<ie.length;le++){var oe=ie[le],ee=oe[0],ce=oe[1];a.queries.query[ee]=ce}}function zu(a){var f=a._state,m=a._deps.indexedDB;if(f.isBeingOpened||a.idbdb)return f.dbReadyPromise.then(function(){return f.dbOpenError?Nt(f.dbOpenError):a});f.isBeingOpened=!0,f.dbOpenError=null,f.openComplete=!1;var w=f.openCanceller,k=Math.round(10*a.verno),N=!1;function I(){if(f.openCanceller!==w)throw new Ne.DatabaseClosed("db.open() was cancelled")}function O(){return new He(function(te,le){if(I(),!m)throw new Ne.MissingAPI;var ie=a.name,oe=f.autoSchema||!k?m.open(ie):m.open(ie,k);if(!oe)throw new Ne.MissingAPI;oe.onerror=wn(le),oe.onblocked=yt(a._fireOnBlocked),oe.onupgradeneeded=yt(function(se){var ye;ne=oe.transaction,f.autoSchema&&!a._options.allowEmptyDB?(oe.onerror=Kn,ne.abort(),oe.result.close(),(ye=m.deleteDatabase(ie)).onsuccess=ye.onerror=yt(function(){le(new Ne.NoSuchDatabase("Database ".concat(ie," doesnt exist")))})):(ne.onerror=wn(le),ye=se.oldVersion>Math.pow(2,62)?0:se.oldVersion,G=ye<1,a.idbdb=oe.result,N&&Yi(a,ne),Bs(a,ye/10,ne,le))},le),oe.onsuccess=yt(function(){ne=null;var se,ye,he,be,Ce,Pe,ze=a.idbdb=oe.result,Ie=F(ze.objectStoreNames);if(0<Ie.length)try{var Ve=ze.transaction((Ce=Ie).length===1?Ce[0]:Ce,"readonly");if(f.autoSchema)Pe=ze,be=Ve,(he=a).verno=Pe.version/10,be=he._dbSchema=fn(0,Pe,be),he._storeNames=F(Pe.objectStoreNames,0),Vo(he,[he._allTables],d(be),be);else if(Ir(a,a._dbSchema,Ve),ye=Ve,((ye=Xi(fn(0,(se=a).idbdb,ye),se._dbSchema)).add.length||ye.change.some(function(Le){return Le.add.length||Le.change.length}))&&!N)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),ze.close(),k=ze.version+1,N=!0,te(O());go(a,Ve)}catch{}yo.add(a),ze.onversionchange=yt(function(Le){f.vcFired=!0,a.on("versionchange").fire(Le)}),ze.onclose=yt(function(){a.close({disableAutoOpen:!1})}),G&&(Ie=a._deps,Ce=ie,vo(Pe=Ie.indexedDB)||Ce===yr||bi(Pe,Ie.IDBKeyRange).put({name:Ce}).catch(Be)),te()},le)}).catch(function(te){switch(te==null?void 0:te.name){case"UnknownError":if(0<f.PR1398_maxLoop)return f.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),O();break;case"VersionError":if(0<k)return k=0,O()}return He.reject(te)})}var ee,ce=f.dbReadyResolve,ne=null,G=!1;return He.race([w,(typeof navigator>"u"?He.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(te){function le(){return indexedDB.databases().finally(te)}ee=setInterval(le,100),le()}).finally(function(){return clearInterval(ee)}):Promise.resolve()).then(O)]).then(function(){return I(),f.onReadyBeingFired=[],He.resolve(qo(function(){return a.on.ready.fire(a.vip)})).then(function te(){var le;if(0<f.onReadyBeingFired.length)return le=f.onReadyBeingFired.reduce(Qt,Be),f.onReadyBeingFired=[],He.resolve(qo(function(){return le(a.vip)})).then(te)})}).finally(function(){f.openCanceller===w&&(f.onReadyBeingFired=null,f.isBeingOpened=!1)}).catch(function(te){f.dbOpenError=te;try{ne&&ne.abort()}catch{}return w===f.openCanceller&&a._close(),Nt(te)}).finally(function(){f.openComplete=!0,ce()}).then(function(){var te;return G&&(te={},a.tables.forEach(function(le){le.schema.indexes.forEach(function(ie){ie.name&&(te["idb://".concat(a.name,"/").concat(le.name,"/").concat(ie.name)]=new dn(-1/0,[[[]]]))}),te["idb://".concat(a.name,"/").concat(le.name,"/")]=te["idb://".concat(a.name,"/").concat(le.name,"/:dels")]=new dn(-1/0,[[[]]])}),qn(gi).fire(te),Ks(te,!0)),a})}function qs(a){function f(N){return a.next(N)}var m=k(f),w=k(function(N){return a.throw(N)});function k(N){return function(O){var O=N(O),ee=O.value;return O.done?ee:ee&&typeof ee.then=="function"?ee.then(m,w):h(ee)?Promise.all(ee).then(m,w):m(ee)}}return k(f)()}function rs(a,f,m){for(var w=h(a)?a.slice():[a],k=0;k<m;++k)w.push(f);return w}var Ya={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(a){return s(s({},a),{table:function(w){var m=a.table(w),w=m.schema,k={},N=[];function I(te,le,ie){var he=yi(te),oe=k[he]=k[he]||[],se=te==null?0:typeof te=="string"?1:te.length,ye=0<le,he=s(s({},ie),{name:ye?"".concat(he,"(virtual-from:").concat(ie.name,")"):ie.name,lowLevelIndex:ie,isVirtual:ye,keyTail:le,keyLength:se,extractKey:ho(te),unique:!ye&&ie.unique});return oe.push(he),he.isPrimaryKey||N.push(he),1<se&&I(se===2?te[0]:te.slice(0,se-1),le+1,ie),oe.sort(function(be,Ce){return be.keyTail-Ce.keyTail}),he}var O=I(w.primaryKey.keyPath,0,w.primaryKey);k[":id"]=[O];for(var ee=0,ce=w.indexes;ee<ce.length;ee++){var ne=ce[ee];I(ne.keyPath,0,ne)}function G(te){var le,ie=te.query.index;return ie.isVirtual?s(s({},te),{query:{index:ie.lowLevelIndex,range:(le=te.query.range,ie=ie.keyTail,{type:le.type===1?2:le.type,lower:rs(le.lower,le.lowerOpen?a.MAX_KEY:a.MIN_KEY,ie),lowerOpen:!0,upper:rs(le.upper,le.upperOpen?a.MIN_KEY:a.MAX_KEY,ie),upperOpen:!0})}}):te}return s(s({},m),{schema:s(s({},w),{primaryKey:O,indexes:N,getIndexByKeyPath:function(te){return(te=k[yi(te)])&&te[0]}}),count:function(te){return m.count(G(te))},query:function(te){return m.query(G(te))},openCursor:function(te){var le=te.query.index,ie=le.keyTail,oe=le.keyLength;return le.isVirtual?m.openCursor(G(te)).then(function(ye){return ye&&se(ye)}):m.openCursor(te);function se(ye){return Object.create(ye,{continue:{value:function(he){he!=null?ye.continue(rs(he,te.reverse?a.MAX_KEY:a.MIN_KEY,ie)):te.unique?ye.continue(ye.key.slice(0,oe).concat(te.reverse?a.MIN_KEY:a.MAX_KEY,ie)):ye.continue()}},continuePrimaryKey:{value:function(he,be){ye.continuePrimaryKey(rs(he,a.MAX_KEY,ie),be)}},primaryKey:{get:function(){return ye.primaryKey}},key:{get:function(){var he=ye.key;return oe===1?he[0]:he.slice(0,oe)}},value:{get:function(){return ye.value}}})}}})}})}};function Ws(a,f,m,w){return m=m||{},w=w||"",d(a).forEach(function(k){var N,I,O;x(f,k)?(N=a[k],I=f[k],typeof N=="object"&&typeof I=="object"&&N&&I?(O=fe(N))!==fe(I)?m[w+k]=f[k]:O==="Object"?Ws(N,I,m,w+k+"."):N!==I&&(m[w+k]=f[k]):N!==I&&(m[w+k]=f[k])):m[w+k]=void 0}),d(f).forEach(function(k){x(a,k)||(m[w+k]=f[k])}),m}function Ys(a,f){return f.type==="delete"?f.keys:f.keys||f.values.map(a.extractKey)}var Fu={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(a){return s(s({},a),{table:function(f){var m=a.table(f),w=m.schema.primaryKey;return s(s({},m),{mutate:function(k){var N=Ye.trans,I=N.table(f).hook,O=I.deleting,ee=I.creating,ce=I.updating;switch(k.type){case"add":if(ee.fire===Be)break;return N._promise("readwrite",function(){return ne(k)},!0);case"put":if(ee.fire===Be&&ce.fire===Be)break;return N._promise("readwrite",function(){return ne(k)},!0);case"delete":if(O.fire===Be)break;return N._promise("readwrite",function(){return ne(k)},!0);case"deleteRange":if(O.fire===Be)break;return N._promise("readwrite",function(){return(function G(te,le,ie){return m.query({trans:te,values:!1,query:{index:w,range:le},limit:ie}).then(function(oe){var se=oe.result;return ne({type:"delete",keys:se,trans:te}).then(function(ye){return 0<ye.numFailures?Promise.reject(ye.failures[0]):se.length<ie?{failures:[],numFailures:0,lastResult:void 0}:G(te,s(s({},le),{lower:se[se.length-1],lowerOpen:!0}),ie)})})})(k.trans,k.range,1e4)},!0)}return m.mutate(k);function ne(G){var te,le,ie,oe=Ye.trans,se=G.keys||Ys(w,G);if(se)return(G=G.type==="add"||G.type==="put"?s(s({},G),{keys:se}):s({},G)).type!=="delete"&&(G.values=l([],G.values)),G.keys&&(G.keys=l([],G.keys)),te=m,ie=se,((le=G).type==="add"?Promise.resolve([]):te.getMany({trans:le.trans,keys:ie,cache:"immutable"})).then(function(ye){var he=se.map(function(be,Ce){var Pe,ze,Ie,Ve=ye[Ce],Le={onerror:null,onsuccess:null};return G.type==="delete"?O.fire.call(Le,be,Ve,oe):G.type==="add"||Ve===void 0?(Pe=ee.fire.call(Le,be,G.values[Ce],oe),be==null&&Pe!=null&&(G.keys[Ce]=be=Pe,w.outbound||W(G.values[Ce],w.keyPath,be))):(Pe=Ws(Ve,G.values[Ce]),(ze=ce.fire.call(Le,Pe,be,Ve,oe))&&(Ie=G.values[Ce],Object.keys(ze).forEach(function(We){x(Ie,We)?Ie[We]=ze[We]:W(Ie,We,ze[We])}))),Le});return m.mutate(G).then(function(be){for(var Ce=be.failures,Pe=be.results,ze=be.numFailures,be=be.lastResult,Ie=0;Ie<se.length;++Ie){var Ve=(Pe||se)[Ie],Le=he[Ie];Ve==null?Le.onerror&&Le.onerror(Ce[Ie]):Le.onsuccess&&Le.onsuccess(G.type==="put"&&ye[Ie]?G.values[Ie]:Ve)}return{failures:Ce,results:Pe,numFailures:ze,lastResult:be}}).catch(function(be){return he.forEach(function(Ce){return Ce.onerror&&Ce.onerror(be)}),Promise.reject(be)})});throw new Error("Keys missing")}}})}})}};function Xa(a,f,m){try{if(!f||f.keys.length<a.length)return null;for(var w=[],k=0,N=0;k<f.keys.length&&N<a.length;++k)Ee(f.keys[k],a[N])===0&&(w.push(m?ve(f.values[k]):f.values[k]),++N);return w.length===a.length?w:null}catch{return null}}var Bu={stack:"dbcore",level:-1,create:function(a){return{table:function(f){var m=a.table(f);return s(s({},m),{getMany:function(w){var k;return w.cache?(k=Xa(w.keys,w.trans._cache,w.cache==="clone"))?He.resolve(k):m.getMany(w).then(function(N){return w.trans._cache={keys:w.keys,values:w.cache==="clone"?ve(N):N},N}):m.getMany(w)},mutate:function(w){return w.type!=="add"&&(w.trans._cache=null),m.mutate(w)}})}}}};function Qa(a,f){return a.trans.mode==="readonly"&&!!a.subscr&&!a.trans.explicit&&a.trans.db._options.cache!=="disabled"&&!f.schema.primaryKey.outbound}function Ga(a,f){switch(a){case"query":return f.values&&!f.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Xs={stack:"dbcore",level:0,name:"Observability",create:function(a){var f=a.schema.name,m=new dn(a.MIN_KEY,a.MAX_KEY);return s(s({},a),{transaction:function(w,k,N){if(Ye.subscr&&k!=="readonly")throw new Ne.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Ye.querier));return a.transaction(w,k,N)},table:function(w){function k(se){var oe,se=se.query;return[oe=se.index,new dn((oe=(se=se.range).lower)!=null?oe:a.MIN_KEY,(oe=se.upper)!=null?oe:a.MAX_KEY)]}var N=a.table(w),I=N.schema,O=I.primaryKey,ee=I.indexes,ce=O.extractKey,ne=O.outbound,G=O.autoIncrement&&ee.filter(function(ie){return ie.compound&&ie.keyPath.includes(O.keyPath)}),te=s(s({},N),{mutate:function(ie){function oe(je){return je="idb://".concat(f,"/").concat(w,"/").concat(je),Ce[je]||(Ce[je]=new dn)}var se,ye,he,be=ie.trans,Ce=ie.mutatedParts||(ie.mutatedParts={}),Pe=oe(""),ze=oe(":dels"),Ie=ie.type,Le=ie.type==="deleteRange"?[ie.range]:ie.type==="delete"?[ie.keys]:ie.values.length<50?[Ys(O,ie).filter(function(je){return je}),ie.values]:[],Ve=Le[0],Le=Le[1],We=ie.trans._cache;return h(Ve)?(Pe.addKeys(Ve),(Ie=Ie==="delete"||Ve.length===Le.length?Xa(Ve,We):null)||ze.addKeys(Ve),(Ie||Le)&&(se=oe,ye=Ie,he=Le,I.indexes.forEach(function(je){var it=se(je.name||"");function st(ft){return ft!=null?je.extractKey(ft):null}function ut(ft){je.multiEntry&&h(ft)?ft.forEach(function(En){return it.addKey(En)}):it.addKey(ft)}(ye||he).forEach(function(ft,jt){var lt=ye&&st(ye[jt]),jt=he&&st(he[jt]);Ee(lt,jt)!==0&&(lt!=null&&ut(lt),jt!=null)&&ut(jt)})}))):Ve?(Le={from:(We=Ve.lower)!=null?We:a.MIN_KEY,to:(Ie=Ve.upper)!=null?Ie:a.MAX_KEY},ze.add(Le),Pe.add(Le)):(Pe.add(m),ze.add(m),I.indexes.forEach(function(je){return oe(je.name).add(m)})),N.mutate(ie).then(function(je){return!Ve||ie.type!=="add"&&ie.type!=="put"||(Pe.addKeys(je.results),G&&G.forEach(function(it){for(var st=ie.values.map(function(lt){return it.extractKey(lt)}),ut=it.keyPath.findIndex(function(lt){return lt===O.keyPath}),ft=0,En=je.results.length;ft<En;++ft)st[ft][ut]=je.results[ft];oe(it.name).addKeys(st)})),be.mutatedParts=es(be.mutatedParts||{},Ce),je})}}),le={get:function(ie){return[O,new dn(ie.key)]},getMany:function(ie){return[O,new dn().addKeys(ie.keys)]},count:k,query:k,openCursor:k};return d(le).forEach(function(ie){te[ie]=function(oe){var se=Ye.subscr,ye=!!se,he=Qa(Ye,N)&&Ga(ie,oe)?oe.obsSet={}:se;if(ye){var be,se=function(Le){return Le="idb://".concat(f,"/").concat(w,"/").concat(Le),he[Le]||(he[Le]=new dn)},Ce=se(""),Pe=se(":dels"),ye=le[ie](oe),ze=ye[0],ye=ye[1];if((ie==="query"&&ze.isPrimaryKey&&!oe.values?Pe:se(ze.name||"")).add(ye),!ze.isPrimaryKey){if(ie!=="count")return be=ie==="query"&&ne&&oe.values&&N.query(s(s({},oe),{values:!1})),N[ie].apply(this,arguments).then(function(Le){if(ie==="query"){if(ne&&oe.values)return be.then(function(st){return st=st.result,Ce.addKeys(st),Le});var We=oe.values?Le.result.map(ce):Le.result;(oe.values?Ce:Pe).addKeys(We)}else{var je,it;if(ie==="openCursor")return it=oe.values,(je=Le)&&Object.create(je,{key:{get:function(){return Pe.addKey(je.primaryKey),je.key}},primaryKey:{get:function(){var st=je.primaryKey;return Pe.addKey(st),st}},value:{get:function(){return it&&Ce.addKey(je.primaryKey),je.value}}})}return Le});Pe.add(m)}}return N[ie].apply(this,arguments)}}),te}})}};function Wo(a,f,m){var w;return m.numFailures===0?f:f.type==="deleteRange"||(w=f.keys?f.keys.length:"values"in f&&f.values?f.values.length:1,m.numFailures===w)?null:(w=s({},f),h(w.keys)&&(w.keys=w.keys.filter(function(k,N){return!(N in m.failures)})),"values"in w&&h(w.values)&&(w.values=w.values.filter(function(k,N){return!(N in m.failures)})),w)}function Qs(a,f){return m=a,((w=f).lower===void 0||(w.lowerOpen?0<Ee(m,w.lower):0<=Ee(m,w.lower)))&&(m=a,(w=f).upper===void 0||(w.upperOpen?Ee(m,w.upper)<0:Ee(m,w.upper)<=0));var m,w}function Gs(a,f,m,w,k,N){var I,O,ee,ce,ne,G,te;return!m||m.length===0||(I=f.query.index,O=I.multiEntry,ee=f.query.range,ce=w.schema.primaryKey.extractKey,ne=I.extractKey,G=(I.lowLevelIndex||I).extractKey,(w=m.reduce(function(le,ie){var oe=le,se=[];if(ie.type==="add"||ie.type==="put")for(var ye=new dn,he=ie.values.length-1;0<=he;--he){var be,Ce=ie.values[he],Pe=ce(Ce);!ye.hasKey(Pe)&&(be=ne(Ce),O&&h(be)?be.some(function(We){return Qs(We,ee)}):Qs(be,ee))&&(ye.addKey(Pe),se.push(Ce))}switch(ie.type){case"add":var ze=new dn().addKeys(f.values?le.map(function(je){return ce(je)}):le),oe=le.concat(f.values?se.filter(function(je){return je=ce(je),!ze.hasKey(je)&&(ze.addKey(je),!0)}):se.map(function(je){return ce(je)}).filter(function(je){return!ze.hasKey(je)&&(ze.addKey(je),!0)}));break;case"put":var Ie=new dn().addKeys(ie.values.map(function(je){return ce(je)}));oe=le.filter(function(je){return!Ie.hasKey(f.values?ce(je):je)}).concat(f.values?se:se.map(function(je){return ce(je)}));break;case"delete":var Ve=new dn().addKeys(ie.keys);oe=le.filter(function(je){return!Ve.hasKey(f.values?ce(je):je)});break;case"deleteRange":var Le=ie.range;oe=le.filter(function(je){return!Qs(ce(je),Le)})}return oe},a))===a)?a:(te=function(le,ie){return Ee(G(le),G(ie))||Ee(ce(le),ce(ie))},w.sort(f.direction==="prev"||f.direction==="prevunique"?function(le,ie){return te(ie,le)}:te),f.limit&&f.limit<1/0&&(w.length>f.limit?w.length=f.limit:a.length===f.limit&&w.length<f.limit&&(k.dirty=!0)),N?Object.freeze(w):w)}function Js(a,f){return Ee(a.lower,f.lower)===0&&Ee(a.upper,f.upper)===0&&!!a.lowerOpen==!!f.lowerOpen&&!!a.upperOpen==!!f.upperOpen}function Ja(a,f){return((m,w,k,N)=>{if(m===void 0)return w!==void 0?-1:0;if(w===void 0)return 1;if((m=Ee(m,w))===0){if(k&&N)return 0;if(k)return 1;if(N)return-1}return m})(a.lower,f.lower,a.lowerOpen,f.lowerOpen)<=0&&0<=((m,w,k,N)=>{if(m===void 0)return w!==void 0?1:0;if(w===void 0)return-1;if((m=Ee(m,w))===0){if(k&&N)return 0;if(k)return-1;if(N)return 1}return m})(a.upper,f.upper,a.upperOpen,f.upperOpen)}function Za(a,f,m,w){a.subscribers.add(m),w.addEventListener("abort",function(){var k,N;a.subscribers.delete(m),a.subscribers.size===0&&(k=a,N=f,setTimeout(function(){k.subscribers.size===0&&B(N,k)},3e3))})}var el={stack:"dbcore",level:0,name:"Cache",create:function(a){var f=a.schema.name;return s(s({},a),{transaction:function(m,w,k){var N,I,O=a.transaction(m,w,k);return w==="readwrite"&&(k=(N=new AbortController).signal,O.addEventListener("abort",(I=function(ee){return function(){if(N.abort(),w==="readwrite"){for(var ce=new Set,ne=0,G=m;ne<G.length;ne++){var te=G[ne],le=Jr["idb://".concat(f,"/").concat(te)];if(le){var ie=a.table(te),oe=le.optimisticOps.filter(function(je){return je.trans===O});if(O._explicit&&ee&&O.mutatedParts)for(var se=0,ye=Object.values(le.queries.query);se<ye.length;se++)for(var he=0,be=(ze=ye[se]).slice();he<be.length;he++)Hs((Ie=be[he]).obsSet,O.mutatedParts)&&(B(ze,Ie),Ie.subscribers.forEach(function(je){return ce.add(je)}));else if(0<oe.length){le.optimisticOps=le.optimisticOps.filter(function(je){return je.trans!==O});for(var Ce=0,Pe=Object.values(le.queries.query);Ce<Pe.length;Ce++)for(var ze,Ie,Ve,Le=0,We=(ze=Pe[Ce]).slice();Le<We.length;Le++)(Ie=We[Le]).res!=null&&O.mutatedParts&&(ee&&!Ie.dirty?(Ve=Object.isFrozen(Ie.res),Ve=Gs(Ie.res,Ie.req,oe,ie,Ie,Ve),Ie.dirty?(B(ze,Ie),Ie.subscribers.forEach(function(je){return ce.add(je)})):Ve!==Ie.res&&(Ie.res=Ve,Ie.promise=He.resolve({result:Ve}))):(Ie.dirty&&B(ze,Ie),Ie.subscribers.forEach(function(je){return ce.add(je)})))}}}ce.forEach(function(je){return je()})}}})(!1),{signal:k}),O.addEventListener("error",I(!1),{signal:k}),O.addEventListener("complete",I(!0),{signal:k})),O},table:function(m){var w=a.table(m),k=w.schema.primaryKey;return s(s({},w),{mutate:function(N){var I,O=Ye.trans;return!k.outbound&&O.db._options.cache!=="disabled"&&!O.explicit&&O.idbtrans.mode==="readwrite"&&(I=Jr["idb://".concat(f,"/").concat(m)])?(O=w.mutate(N),N.type!=="add"&&N.type!=="put"||!(50<=N.values.length||Ys(k,N).some(function(ee){return ee==null}))?(I.optimisticOps.push(N),N.mutatedParts&&ts(N.mutatedParts),O.then(function(ee){0<ee.numFailures&&(B(I.optimisticOps,N),(ee=Wo(0,N,ee))&&I.optimisticOps.push(ee),N.mutatedParts)&&ts(N.mutatedParts)}),O.catch(function(){B(I.optimisticOps,N),N.mutatedParts&&ts(N.mutatedParts)})):O.then(function(ee){var ce=Wo(0,s(s({},N),{values:N.values.map(function(ne,G){var te;return ee.failures[G]?ne:(W(te=(te=k.keyPath)!=null&&te.includes(".")?ve(ne):s({},ne),k.keyPath,ee.results[G]),te)})}),ee);I.optimisticOps.push(ce),queueMicrotask(function(){return N.mutatedParts&&ts(N.mutatedParts)})}),O):w.mutate(N)},query:function(N){var I,O,ee,ce,ne,G,te;return Qa(Ye,w)&&Ga("query",N)?(I=((ee=Ye.trans)==null?void 0:ee.db._options.cache)==="immutable",O=(ee=Ye).requery,ee=ee.signal,G=((le,ie,oe,se)=>{var ye=Jr["idb://".concat(le,"/").concat(ie)];if(!ye)return[];if(!(le=ye.queries[oe]))return[null,!1,ye,null];var he=le[(se.query?se.query.index.name:null)||""];if(!he)return[null,!1,ye,null];switch(oe){case"query":var be=(Ce=se.direction)!=null?Ce:"next",Ce=he.find(function(Pe){var ze;return Pe.req.limit===se.limit&&Pe.req.values===se.values&&((ze=Pe.req.direction)!=null?ze:"next")===be&&Js(Pe.req.query.range,se.query.range)});return Ce?[Ce,!0,ye,he]:[he.find(function(Pe){var ze;return("limit"in Pe.req?Pe.req.limit:1/0)>=se.limit&&((ze=Pe.req.direction)!=null?ze:"next")===be&&(!se.values||Pe.req.values)&&Ja(Pe.req.query.range,se.query.range)}),!1,ye,he];case"count":return Ce=he.find(function(Pe){return Js(Pe.req.query.range,se.query.range)}),[Ce,!!Ce,ye,he]}})(f,m,"query",N),te=G[0],ce=G[2],ne=G[3],te&&G[1]?te.obsSet=N.obsSet:(G=w.query(N).then(function(le){var ie=le.result;if(te&&(te.res=ie),I){for(var oe=0,se=ie.length;oe<se;++oe)Object.freeze(ie[oe]);Object.freeze(ie)}else le.result=ve(ie);return le}).catch(function(le){return ne&&te&&B(ne,te),Promise.reject(le)}),te={obsSet:N.obsSet,promise:G,subscribers:new Set,type:"query",req:N,dirty:!1},ne?ne.push(te):(ne=[te],(ce=ce||(Jr["idb://".concat(f,"/").concat(m)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[N.query.index.name||""]=ne)),Za(te,ne,O,ee),te.promise.then(function(le){return{result:Gs(le.result,N,ce==null?void 0:ce.optimisticOps,w,te,I)}})):w.query(N)}})}})}};function Tr(a,f){return new Proxy(a,{get:function(m,w,k){return w==="db"?f:Reflect.get(m,w,k)}})}zt.prototype.version=function(a){if(isNaN(a)||a<.1)throw new Ne.Type("Given version is not a positive number");if(a=Math.round(10*a)/10,this.idbdb||this._state.isBeingOpened)throw new Ne.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,a);var f=this._versions,m=f.filter(function(w){return w._cfg.version===a})[0];return m||(m=new this.Version(a),f.push(m),f.sort(Gr),m.stores({}),this._state.autoSchema=!1),m},zt.prototype._whenReady=function(a){var f=this;return this.idbdb&&(this._state.openComplete||Ye.letThrough||this._vip)?a():new He(function(m,w){if(f._state.openComplete)return w(new Ne.DatabaseClosed(f._state.dbOpenError));if(!f._state.isBeingOpened){if(!f._state.autoOpen)return void w(new Ne.DatabaseClosed);f.open().catch(Be)}f._state.dbReadyPromise.then(m,w)}).then(a)},zt.prototype.use=function(k){var f=k.stack,m=k.create,w=k.level,k=k.name,N=(k&&this.unuse({stack:f,name:k}),this._middlewares[f]||(this._middlewares[f]=[]));return N.push({stack:f,create:m,level:w??10,name:k}),N.sort(function(I,O){return I.level-O.level}),this},zt.prototype.unuse=function(a){var f=a.stack,m=a.name,w=a.create;return f&&this._middlewares[f]&&(this._middlewares[f]=this._middlewares[f].filter(function(k){return w?k.create!==w:!!m&&k.name!==m})),this},zt.prototype.open=function(){var a=this;return On(rn,function(){return zu(a)})},zt.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var a=this._state;if(yo.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}a.isBeingOpened||(a.dbReadyPromise=new He(function(f){a.dbReadyResolve=f}),a.openCanceller=new He(function(f,m){a.cancelOpen=m}))},zt.prototype.close=function(f){var f=(f===void 0?{disableAutoOpen:!0}:f).disableAutoOpen,m=this._state;f?(m.isBeingOpened&&m.cancelOpen(new Ne.DatabaseClosed),this._close(),m.autoOpen=!1,m.dbOpenError=new Ne.DatabaseClosed):(this._close(),m.autoOpen=this._options.autoOpen||m.isBeingOpened,m.openComplete=!1,m.dbOpenError=null)},zt.prototype.delete=function(a){var f=this,m=(a===void 0&&(a={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),w=this._state;return new He(function(k,N){function I(){f.close(a);var O=f._deps.indexedDB.deleteDatabase(f.name);O.onsuccess=yt(function(){var ee,ce,ne;ee=f._deps,ce=f.name,vo(ne=ee.indexedDB)||ce===yr||bi(ne,ee.IDBKeyRange).delete(ce).catch(Be),k()}),O.onerror=wn(N),O.onblocked=f._fireOnBlocked}if(m)throw new Ne.InvalidArgument("Invalid closeOptions argument to db.delete()");w.isBeingOpened?w.dbReadyPromise.then(I):I()})},zt.prototype.backendDB=function(){return this.idbdb},zt.prototype.isOpen=function(){return this.idbdb!==null},zt.prototype.hasBeenClosed=function(){var a=this._state.dbOpenError;return a&&a.name==="DatabaseClosed"},zt.prototype.hasFailed=function(){return this._state.dbOpenError!==null},zt.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(zt.prototype,"tables",{get:function(){var a=this;return d(this._allTables).map(function(f){return a._allTables[f]})},enumerable:!1,configurable:!0}),zt.prototype.transaction=function(){var a=(function(f,m,w){var k=arguments.length;if(k<2)throw new Ne.InvalidArgument("Too few arguments");for(var N=new Array(k-1);--k;)N[k-1]=arguments[k];return w=N.pop(),[f,ke(N),w]}).apply(this,arguments);return this._transaction.apply(this,a)},zt.prototype._transaction=function(a,f,m){var w,k,N=this,I=Ye.trans,O=(I&&I.db===this&&a.indexOf("!")===-1||(I=null),a.indexOf("?")!==-1);a=a.replace("!","").replace("?","");try{if(k=f.map(function(ce){if(ce=ce instanceof N.Table?ce.name:ce,typeof ce!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return ce}),a=="r"||a===Yr)w=Yr;else{if(a!="rw"&&a!=rr)throw new Ne.InvalidArgument("Invalid transaction mode: "+a);w=rr}if(I){if(I.mode===Yr&&w===rr){if(!O)throw new Ne.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");I=null}I&&k.forEach(function(ce){if(I&&I.storeNames.indexOf(ce)===-1){if(!O)throw new Ne.SubTransaction("Table "+ce+" not included in parent transaction.");I=null}}),O&&I&&!I.active&&(I=null)}}catch(ce){return I?I._promise(null,function(ne,G){G(ce)}):Nt(ce)}var ee=(function ce(ne,G,te,le,ie){return He.resolve().then(function(){var he=Ye.transless||Ye,oe=ne._createTransaction(G,te,ne._dbSchema,le),he=(oe.explicit=!0,{trans:oe,transless:he});if(le)oe.idbtrans=le.idbtrans;else try{oe.create(),oe.idbtrans._explicit=!0,ne._state.PR1398_maxLoop=3}catch(be){return be.name===Se.InvalidState&&ne.isOpen()&&0<--ne._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),ne.close({disableAutoOpen:!1}),ne.open().then(function(){return ce(ne,G,te,null,ie)})):Nt(be)}var se,ye=A(ie),he=(ye&&mr(),He.follow(function(){var be;(se=ie.call(oe,oe))&&(ye?(be=qt.bind(null,null),se.then(be,be)):typeof se.next=="function"&&typeof se.throw=="function"&&(se=qs(se)))},he));return(se&&typeof se.then=="function"?He.resolve(se).then(function(be){return oe.active?be:Nt(new Ne.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):he.then(function(){return se})).then(function(be){return le&&oe._resolve(),oe._completion.then(function(){return be})}).catch(function(be){return oe._reject(be),Nt(be)})})}).bind(null,this,w,k,I,m);return I?I._promise(w,ee,"lock"):Ye.trans?On(Ye.transless,function(){return N._whenReady(ee)}):this._whenReady(ee)},zt.prototype.table=function(a){if(x(this._allTables,a))return this._allTables[a];throw new Ne.InvalidTable("Table ".concat(a," does not exist"))};var Ar=zt;function zt(a,f){var m,w,k,N,I,O=this,ee=(this._middlewares={},this.verno=0,zt.dependencies),ee=(this._options=f=s({addons:zt.addons,autoOpen:!0,indexedDB:ee.indexedDB,IDBKeyRange:ee.IDBKeyRange,cache:"cloned",maxConnections:1e3},f),this._deps={indexedDB:f.indexedDB,IDBKeyRange:f.IDBKeyRange},f.addons),ce=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Be,dbReadyPromise:null,cancelOpen:Be,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:f.autoOpen}),ne=(ce.dbReadyPromise=new He(function(G){ce.dbReadyResolve=G}),ce.openCanceller=new He(function(G,te){ce.cancelOpen=te}),this._state=ce,this.name=a,this.on=or(this,"populate","blocked","versionchange","close",{ready:[Qt,Be]}),this.once=function(G,te){var le=function(){for(var ie=[],oe=0;oe<arguments.length;oe++)ie[oe]=arguments[oe];O.on(G).unsubscribe(le),te.apply(O,ie)};return O.on(G,le)},this.on.ready.subscribe=$(this.on.ready.subscribe,function(G){return function(te,le){zt.vip(function(){var ie,oe=O._state;oe.openComplete?(oe.dbOpenError||He.resolve().then(te),le&&G(te)):oe.onReadyBeingFired?(oe.onReadyBeingFired.push(te),le&&G(te)):(G(te),ie=O,le||G(function se(){ie.on.ready.unsubscribe(te),ie.on.ready.unsubscribe(se)}))})}}),this.Collection=(m=this,vr(Va.prototype,function(se,oe){this.db=m;var le=Xr,ie=null;if(oe)try{le=oe()}catch(he){ie=he}var oe=se._ctx,se=oe.table,ye=se.hook.reading.fire;this._ctx={table:se,index:oe.index,isPrimKey:!oe.index||se.schema.primKey.keyPath&&oe.index===se.schema.primKey.name,range:le,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:ie,or:oe.or,valueMapper:ye!==Ue?ye:null}})),this.Table=(w=this,vr(Vt.prototype,function(G,te,le){this.db=w,this._tx=le,this.name=G,this.schema=te,this.hook=w._allTables[G]?w._allTables[G].hook:or(null,{creating:[ct,Be],reading:[qe,Ue],updating:[gn,Be],deleting:[St,Be]})})),this.Transaction=(k=this,vr(Lu.prototype,function(G,te,le,ie,oe){var se=this;G!=="readonly"&&te.forEach(function(ye){ye=(ye=le[ye])==null?void 0:ye.yProps,ye&&(te=te.concat(ye.map(function(he){return he.updatesTable})))}),this.db=k,this.mode=G,this.storeNames=te,this.schema=le,this.chromeTransactionDurability=ie,this.idbtrans=null,this.on=or(this,"complete","error","abort"),this.parent=oe||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new He(function(ye,he){se._resolve=ye,se._reject=he}),this._completion.then(function(){se.active=!1,se.on.complete.fire()},function(ye){var he=se.active;return se.active=!1,se.on.error.fire(ye),se.parent?se.parent._reject(ye):he&&se.idbtrans&&se.idbtrans.abort(),Nt(ye)})})),this.Version=(N=this,vr(wi.prototype,function(G){this.db=N,this._cfg={version:G,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(I=this,vr($r.prototype,function(G,te,le){if(this.db=I,this._ctx={table:G,index:te===":id"?null:te,or:le},this._cmp=this._ascending=Ee,this._descending=function(ie,oe){return Ee(oe,ie)},this._max=function(ie,oe){return 0<Ee(ie,oe)?ie:oe},this._min=function(ie,oe){return Ee(ie,oe)<0?ie:oe},this._IDBKeyRange=I._deps.IDBKeyRange,!this._IDBKeyRange)throw new Ne.MissingAPI})),this.on("versionchange",function(G){0<G.newVersion?console.warn("Another connection wants to upgrade database '".concat(O.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(O.name,"'. Closing db now to resume the delete request.")),O.close({disableAutoOpen:!1})}),this.on("blocked",function(G){!G.newVersion||G.newVersion<G.oldVersion?console.warn("Dexie.delete('".concat(O.name,"') was blocked")):console.warn("Upgrade '".concat(O.name,"' blocked by other connection holding version ").concat(G.oldVersion/10))}),this._maxKey=Mr(f.IDBKeyRange),this._createTransaction=function(G,te,le,ie){return new O.Transaction(G,te,le,O._options.chromeTransactionDurability,ie)},this._fireOnBlocked=function(G){O.on("blocked").fire(G),yo.toArray().filter(function(te){return te.name===O.name&&te!==O&&!te._state.vcFired}).map(function(te){return te.on("versionchange").fire(G)})},this.use(Bu),this.use(el),this.use(Xs),this.use(Ya),this.use(Fu),new Proxy(this,{get:function(G,te,le){var ie;return te==="_vip"||(te==="table"?function(oe){return Tr(O.table(oe),ne)}:(ie=Reflect.get(G,te,le))instanceof Vt?Tr(ie,ne):te==="tables"?ie.map(function(oe){return Tr(oe,ne)}):te==="_createTransaction"?function(){return Tr(ie.apply(this,arguments),ne)}:ie)}}));this.vip=ne,ee.forEach(function(G){return G(O)})}var os,xo=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",tl=(wo.prototype.subscribe=function(a,f,m){return this._subscribe(a&&typeof a!="function"?a:{next:a,error:f,complete:m})},wo.prototype[xo]=function(){return this},wo);function wo(a){this._subscribe=a}try{os={indexedDB:c.indexedDB||c.mozIndexedDB||c.webkitIndexedDB||c.msIndexedDB,IDBKeyRange:c.IDBKeyRange||c.webkitIDBKeyRange}}catch{os={indexedDB:null,IDBKeyRange:null}}function Yo(a){var f,m=!1,w=new tl(function(k){var N=A(a),I,O=!1,ee={},ce={},ne={get closed(){return O},unsubscribe:function(){O||(O=!0,I&&I.abort(),G&&qn.storagemutated.unsubscribe(ie))}},G=(k.start&&k.start(ne),!1),te=function(){return Wr(oe)};function le(){return Hs(ce,ee)}var ie=function(se){es(ee,se),le()&&te()},oe=function(){var se,ye,he;!O&&os.indexedDB&&(ee={},se={},I&&I.abort(),I=new AbortController,he=(be=>{var Ce=zn();try{N&&mr();var Pe=Hn(a,be);return Pe=N?Pe.finally(qt):Pe}finally{Ce&&tr()}})(ye={subscr:se,signal:I.signal,requery:te,querier:a,trans:null}),G||(qn(gi,ie),G=!0),Promise.resolve(he).then(function(be){m=!0,f=be,O||ye.signal.aborted||(le()||(ce=se,le())?te():(ee={},Wr(function(){return!O&&k.next&&k.next(be)})))},function(be){m=!1,["DatabaseClosedError","AbortError"].includes(be==null?void 0:be.name)||O||Wr(function(){O||k.error&&k.error(be)})}))};return setTimeout(te,0),ne});return w.hasValue=function(){return m},w.getValue=function(){return f},w}var bo=Ar;function Xo(a){var f=Or;try{Or=!0,qn.storagemutated.fire(a),Ks(a,!0)}finally{Or=f}}_(bo,s(s({},U),{delete:function(a){return new bo(a,{addons:[]}).delete()},exists:function(a){return new bo(a,{addons:[]}).open().then(function(f){return f.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(a){try{return f=bo.dependencies,m=f.indexedDB,f=f.IDBKeyRange,(vo(m)?Promise.resolve(m.databases()).then(function(w){return w.map(function(k){return k.name}).filter(function(k){return k!==yr})}):bi(m,f).toCollection().primaryKeys()).then(a)}catch{return Nt(new Ne.MissingAPI)}var f,m},defineClass:function(){return function(a){v(this,a)}},ignoreTransaction:function(a){return Ye.trans?On(Ye.transless||rn,a):a()},vip:qo,async:function(a){return function(){try{var f=qs(a.apply(this,arguments));return f&&typeof f.then=="function"?f:He.resolve(f)}catch(m){return Nt(m)}}},spawn:function(a,f,m){try{var w=qs(a.apply(m,f||[]));return w&&typeof w.then=="function"?w:He.resolve(w)}catch(k){return Nt(k)}},currentTransaction:{get:function(){return Ye.trans||null}},waitFor:function(a,f){return a=He.resolve(typeof a=="function"?bo.ignoreTransaction(a):a).timeout(f||6e4),Ye.trans?Ye.trans.waitFor(a):a},Promise:He,debug:{get:function(){return kt},set:function(a){Kt(a)}},derive:M,extend:v,props:_,override:$,Events:or,on:qn,liveQuery:Yo,extendObservabilitySet:es,getByKeyPath:K,setByKeyPath:W,delByKeyPath:function(a,f){typeof f=="string"?W(a,f,void 0):"length"in f&&[].map.call(f,function(m){W(a,m,void 0)})},shallowClone:Q,deepClone:ve,getObjectDiff:Ws,cmp:Ee,asap:V,minKey:-1/0,addons:[],connections:{get:yo.toArray},errnames:Se,dependencies:os,cache:Jr,semVer:"4.4.2",version:"4.4.2".split(".").map(function(a){return parseInt(a)}).reduce(function(a,f,m){return a+f/Math.pow(10,2*m)})})),bo.maxKey=Mr(bo.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(qn(gi,function(a){Or||(a=new CustomEvent(Ki,{detail:a}),Or=!0,dispatchEvent(a),Or=!1)}),addEventListener(Ki,function(a){a=a.detail,Or||Xo(a)}));var Qo,Or=!1,is=function(){};return typeof BroadcastChannel<"u"&&((is=function(){(Qo=new BroadcastChannel(Ki)).onmessage=function(a){return a.data&&Xo(a.data)}})(),typeof Qo.unref=="function"&&Qo.unref(),qn(gi,function(a){Or||Qo.postMessage(a)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(a){if(!Ar.disableBfCache&&a.persisted){kt&&console.debug("Dexie: handling persisted pagehide"),Qo!=null&&Qo.close();for(var f=0,m=yo.toArray();f<m.length;f++)m[f].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(a){!Ar.disableBfCache&&a.persisted&&(kt&&console.debug("Dexie: handling persisted pageshow"),is(),Xo({all:new dn(-1/0,[[]])}))})),He.rejectionMapper=function(a,f){return!a||a instanceof _e||a instanceof TypeError||a instanceof SyntaxError||!a.name||!Ze[a.name]?a:(f=new Ze[a.name](f||a.message,a),"stack"in a&&j(f,"stack",{get:function(){return this.inner.stack}}),f)},Kt(kt),s(Ar,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:Ar,Entity:we,PropModification:Wt,RangeSet:dn,add:function(a){return new Wt({add:a})},cmp:Ee,default:Ar,liveQuery:Yo,mergeRanges:Si,rangesOverlap:Ji,remove:function(a){return new Wt({remove:a})},replacePrefix:function(a,f){return new Wt({replacePrefix:[a,f]})}}),{default:Ar}),Ar})})(ru)),ru.exports}var Zy=Jy();const kf=_u(Zy),uh=Symbol.for("Dexie"),cu=globalThis[uh]||(globalThis[uh]=kf);if(kf.semVer!==cu.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${kf.semVer} and ${cu.semVer}`);const{liveQuery:m2,mergeRanges:g2,rangesOverlap:y2,RangeSet:v2,cmp:x2,Entity:w2,PropModification:b2,replacePrefix:_2,add:S2,remove:k2,DexieYProvider:N2}=cu;class ev extends cu{constructor(){super("api-doc-tor");ya(this,"flows");ya(this,"testSuites");ya(this,"environments");ya(this,"kv");this.version(1).stores({flows:"++id, name",testSuites:"++id, name",environments:"++id, name",kv:"key"})}}const mt=new ev,Ps="openapiOverride";async function tv(t){await mt.kv.put({key:Ps,value:JSON.stringify(t)})}async function ch(){await mt.kv.delete(Ps)}async function nv(){const[t,r,i,s]=await Promise.all([mt.flows.toArray(),mt.testSuites.toArray(),mt.environments.toArray(),mt.kv.get(Ps)]),l=await mt.kv.get("authTokens");let c;try{c=l!=null&&l.value?JSON.parse(l.value):void 0}catch{c=void 0}let d;if(s!=null&&s.value)try{d=JSON.parse(s.value)}catch{d=void 0}return{formatVersion:1,exportedAt:new Date().toISOString(),flows:t,testSuites:r,environments:i,authTokens:c,...d!==void 0?{importedOpenApi:d}:{}}}async function Pm(t){await mt.transaction("rw",mt.flows,mt.testSuites,mt.environments,mt.kv,async()=>{await mt.flows.clear(),await mt.testSuites.clear(),await mt.environments.clear();for(const r of t.flows)await mt.flows.add({name:r.name,steps:r.steps,graph:r.graph});for(const r of t.testSuites)await mt.testSuites.add({name:r.name,cases:r.cases});for(const r of t.environments)await mt.environments.add({name:r.name,baseUrl:r.baseUrl,vars:r.vars??{}});t.authTokens&&await mt.kv.put({key:"authTokens",value:JSON.stringify(t.authTokens)}),Object.prototype.hasOwnProperty.call(t,"importedOpenApi")&&(t.importedOpenApi===null?await mt.kv.delete(Ps):t.importedOpenApi!==void 0&&await mt.kv.put({key:Ps,value:JSON.stringify(t.importedOpenApi)}))})}async function rv(t){if(t.formatVersion!==1)return!1;const[r,i]=await Promise.all([mt.flows.count(),mt.testSuites.count()]);return r>0||i>0?!1:(await Pm(t),!0)}function ov(t,r,i){var d,h;const s=[],l=r===t.expectStatus;if(s.push(`HTTP ${r} ${l?"✓":`✗ (esperado ${t.expectStatus})`}`),!l)return{pass:!1,lines:s};if((d=t.contains)!=null&&d.trim()){const v=i.includes(t.contains);if(s.push(`Contiene texto "${t.contains}": ${v?"✓":"✗"}`),!v)return{pass:!1,lines:s}}const c=(h=t.jsonPath)==null?void 0:h.trim();if(c){let v;try{v=JSON.parse(i)}catch{return s.push("Body no es JSON válido: ✗"),{pass:!1,lines:s}}const b=Bf(v,c),S=t.expectJsonValue;if(S!==void 0&&S!==""){const x=b==null?String(b):typeof b=="object"?JSON.stringify(b):String(b),_=S.trim(),C=x===_||String(b)===_;if(s.push(`JSON path ${c} → ${x} vs "${_}": ${C?"✓":"✗"}`),!C)return{pass:!1,lines:s}}else{const x=b!=null;if(s.push(`JSON path ${c} existe: ${x?"✓":"✗"}`),!x)return{pass:!1,lines:s}}}return{pass:!0,lines:s}}function tn(t){if(typeof t=="string"||typeof t=="number")return""+t;let r="";if(Array.isArray(t))for(let i=0,s;i<t.length;i++)(s=tn(t[i]))!==""&&(r+=(r&&" ")+s);else for(let i in t)t[i]&&(r+=(r&&" ")+i);return r}var iv={value:()=>{}};function Eu(){for(var t=0,r=arguments.length,i={},s;t<r;++t){if(!(s=arguments[t]+"")||s in i||/[\s.]/.test(s))throw new Error("illegal type: "+s);i[s]=[]}return new ou(i)}function ou(t){this._=t}function sv(t,r){return t.trim().split(/^|\s+/).map(function(i){var s="",l=i.indexOf(".");if(l>=0&&(s=i.slice(l+1),i=i.slice(0,l)),i&&!r.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:s}})}ou.prototype=Eu.prototype={constructor:ou,on:function(t,r){var i=this._,s=sv(t+"",i),l,c=-1,d=s.length;if(arguments.length<2){for(;++c<d;)if((l=(t=s[c]).type)&&(l=av(i[l],t.name)))return l;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++c<d;)if(l=(t=s[c]).type)i[l]=fh(i[l],t.name,r);else if(r==null)for(l in i)i[l]=fh(i[l],t.name,null);return this},copy:function(){var t={},r=this._;for(var i in r)t[i]=r[i].slice();return new ou(t)},call:function(t,r){if((l=arguments.length-2)>0)for(var i=new Array(l),s=0,l,c;s<l;++s)i[s]=arguments[s+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(c=this._[t],s=0,l=c.length;s<l;++s)c[s].value.apply(r,i)},apply:function(t,r,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var s=this._[t],l=0,c=s.length;l<c;++l)s[l].value.apply(r,i)}};function av(t,r){for(var i=0,s=t.length,l;i<s;++i)if((l=t[i]).name===r)return l.value}function fh(t,r,i){for(var s=0,l=t.length;s<l;++s)if(t[s].name===r){t[s]=iv,t=t.slice(0,s).concat(t.slice(s+1));break}return i!=null&&t.push({name:r,value:i}),t}var Nf="http://www.w3.org/1999/xhtml";const dh={svg:"http://www.w3.org/2000/svg",xhtml:Nf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Cu(t){var r=t+="",i=r.indexOf(":");return i>=0&&(r=t.slice(0,i))!=="xmlns"&&(t=t.slice(i+1)),dh.hasOwnProperty(r)?{space:dh[r],local:t}:t}function lv(t){return function(){var r=this.ownerDocument,i=this.namespaceURI;return i===Nf&&r.documentElement.namespaceURI===Nf?r.createElement(t):r.createElementNS(i,t)}}function uv(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function $m(t){var r=Cu(t);return(r.local?uv:lv)(r)}function cv(){}function Hf(t){return t==null?cv:function(){return this.querySelector(t)}}function fv(t){typeof t!="function"&&(t=Hf(t));for(var r=this._groups,i=r.length,s=new Array(i),l=0;l<i;++l)for(var c=r[l],d=c.length,h=s[l]=new Array(d),v,b,S=0;S<d;++S)(v=c[S])&&(b=t.call(v,v.__data__,S,c))&&("__data__"in v&&(b.__data__=v.__data__),h[S]=b);return new cr(s,this._parents)}function dv(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function pv(){return[]}function Mm(t){return t==null?pv:function(){return this.querySelectorAll(t)}}function hv(t){return function(){return dv(t.apply(this,arguments))}}function mv(t){typeof t=="function"?t=hv(t):t=Mm(t);for(var r=this._groups,i=r.length,s=[],l=[],c=0;c<i;++c)for(var d=r[c],h=d.length,v,b=0;b<h;++b)(v=d[b])&&(s.push(t.call(v,v.__data__,b,d)),l.push(v));return new cr(s,l)}function Im(t){return function(){return this.matches(t)}}function Tm(t){return function(r){return r.matches(t)}}var gv=Array.prototype.find;function yv(t){return function(){return gv.call(this.children,t)}}function vv(){return this.firstElementChild}function xv(t){return this.select(t==null?vv:yv(typeof t=="function"?t:Tm(t)))}var wv=Array.prototype.filter;function bv(){return Array.from(this.children)}function _v(t){return function(){return wv.call(this.children,t)}}function Sv(t){return this.selectAll(t==null?bv:_v(typeof t=="function"?t:Tm(t)))}function kv(t){typeof t!="function"&&(t=Im(t));for(var r=this._groups,i=r.length,s=new Array(i),l=0;l<i;++l)for(var c=r[l],d=c.length,h=s[l]=[],v,b=0;b<d;++b)(v=c[b])&&t.call(v,v.__data__,b,c)&&h.push(v);return new cr(s,this._parents)}function Am(t){return new Array(t.length)}function Nv(){return new cr(this._enter||this._groups.map(Am),this._parents)}function fu(t,r){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=r}fu.prototype={constructor:fu,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,r){return this._parent.insertBefore(t,r)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Ev(t){return function(){return t}}function Cv(t,r,i,s,l,c){for(var d=0,h,v=r.length,b=c.length;d<b;++d)(h=r[d])?(h.__data__=c[d],s[d]=h):i[d]=new fu(t,c[d]);for(;d<v;++d)(h=r[d])&&(l[d]=h)}function jv(t,r,i,s,l,c,d){var h,v,b=new Map,S=r.length,x=c.length,_=new Array(S),C;for(h=0;h<S;++h)(v=r[h])&&(_[h]=C=d.call(v,v.__data__,h,r)+"",b.has(C)?l[h]=v:b.set(C,v));for(h=0;h<x;++h)C=d.call(t,c[h],h,c)+"",(v=b.get(C))?(s[h]=v,v.__data__=c[h],b.delete(C)):i[h]=new fu(t,c[h]);for(h=0;h<S;++h)(v=r[h])&&b.get(_[h])===v&&(l[h]=v)}function Pv(t){return t.__data__}function $v(t,r){if(!arguments.length)return Array.from(this,Pv);var i=r?jv:Cv,s=this._parents,l=this._groups;typeof t!="function"&&(t=Ev(t));for(var c=l.length,d=new Array(c),h=new Array(c),v=new Array(c),b=0;b<c;++b){var S=s[b],x=l[b],_=x.length,C=Mv(t.call(S,S&&S.__data__,b,s)),j=C.length,M=h[b]=new Array(j),T=d[b]=new Array(j),P=v[b]=new Array(_);i(S,x,M,T,P,C,r);for(var F=0,$=0,R,V;F<j;++F)if(R=M[F]){for(F>=$&&($=F+1);!(V=T[$])&&++$<j;);R._next=V||null}}return d=new cr(d,s),d._enter=h,d._exit=v,d}function Mv(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Iv(){return new cr(this._exit||this._groups.map(Am),this._parents)}function Tv(t,r,i){var s=this.enter(),l=this,c=this.exit();return typeof t=="function"?(s=t(s),s&&(s=s.selection())):s=s.append(t+""),r!=null&&(l=r(l),l&&(l=l.selection())),i==null?c.remove():i(c),s&&l?s.merge(l).order():l}function Av(t){for(var r=t.selection?t.selection():t,i=this._groups,s=r._groups,l=i.length,c=s.length,d=Math.min(l,c),h=new Array(l),v=0;v<d;++v)for(var b=i[v],S=s[v],x=b.length,_=h[v]=new Array(x),C,j=0;j<x;++j)(C=b[j]||S[j])&&(_[j]=C);for(;v<l;++v)h[v]=i[v];return new cr(h,this._parents)}function Ov(){for(var t=this._groups,r=-1,i=t.length;++r<i;)for(var s=t[r],l=s.length-1,c=s[l],d;--l>=0;)(d=s[l])&&(c&&d.compareDocumentPosition(c)^4&&c.parentNode.insertBefore(d,c),c=d);return this}function Rv(t){t||(t=Lv);function r(x,_){return x&&_?t(x.__data__,_.__data__):!x-!_}for(var i=this._groups,s=i.length,l=new Array(s),c=0;c<s;++c){for(var d=i[c],h=d.length,v=l[c]=new Array(h),b,S=0;S<h;++S)(b=d[S])&&(v[S]=b);v.sort(r)}return new cr(l,this._parents).order()}function Lv(t,r){return t<r?-1:t>r?1:t>=r?0:NaN}function Dv(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function zv(){return Array.from(this)}function Fv(){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var s=t[r],l=0,c=s.length;l<c;++l){var d=s[l];if(d)return d}return null}function Bv(){let t=0;for(const r of this)++t;return t}function Hv(){return!this.node()}function Vv(t){for(var r=this._groups,i=0,s=r.length;i<s;++i)for(var l=r[i],c=0,d=l.length,h;c<d;++c)(h=l[c])&&t.call(h,h.__data__,c,l);return this}function Uv(t){return function(){this.removeAttribute(t)}}function Kv(t){return function(){this.removeAttributeNS(t.space,t.local)}}function qv(t,r){return function(){this.setAttribute(t,r)}}function Wv(t,r){return function(){this.setAttributeNS(t.space,t.local,r)}}function Yv(t,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttribute(t):this.setAttribute(t,i)}}function Xv(t,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,i)}}function Qv(t,r){var i=Cu(t);if(arguments.length<2){var s=this.node();return i.local?s.getAttributeNS(i.space,i.local):s.getAttribute(i)}return this.each((r==null?i.local?Kv:Uv:typeof r=="function"?i.local?Xv:Yv:i.local?Wv:qv)(i,r))}function Om(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Gv(t){return function(){this.style.removeProperty(t)}}function Jv(t,r,i){return function(){this.style.setProperty(t,r,i)}}function Zv(t,r,i){return function(){var s=r.apply(this,arguments);s==null?this.style.removeProperty(t):this.style.setProperty(t,s,i)}}function ex(t,r,i){return arguments.length>1?this.each((r==null?Gv:typeof r=="function"?Zv:Jv)(t,r,i??"")):$s(this.node(),t)}function $s(t,r){return t.style.getPropertyValue(r)||Om(t).getComputedStyle(t,null).getPropertyValue(r)}function tx(t){return function(){delete this[t]}}function nx(t,r){return function(){this[t]=r}}function rx(t,r){return function(){var i=r.apply(this,arguments);i==null?delete this[t]:this[t]=i}}function ox(t,r){return arguments.length>1?this.each((r==null?tx:typeof r=="function"?rx:nx)(t,r)):this.node()[t]}function Rm(t){return t.trim().split(/^|\s+/)}function Vf(t){return t.classList||new Lm(t)}function Lm(t){this._node=t,this._names=Rm(t.getAttribute("class")||"")}Lm.prototype={add:function(t){var r=this._names.indexOf(t);r<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var r=this._names.indexOf(t);r>=0&&(this._names.splice(r,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Dm(t,r){for(var i=Vf(t),s=-1,l=r.length;++s<l;)i.add(r[s])}function zm(t,r){for(var i=Vf(t),s=-1,l=r.length;++s<l;)i.remove(r[s])}function ix(t){return function(){Dm(this,t)}}function sx(t){return function(){zm(this,t)}}function ax(t,r){return function(){(r.apply(this,arguments)?Dm:zm)(this,t)}}function lx(t,r){var i=Rm(t+"");if(arguments.length<2){for(var s=Vf(this.node()),l=-1,c=i.length;++l<c;)if(!s.contains(i[l]))return!1;return!0}return this.each((typeof r=="function"?ax:r?ix:sx)(i,r))}function ux(){this.textContent=""}function cx(t){return function(){this.textContent=t}}function fx(t){return function(){var r=t.apply(this,arguments);this.textContent=r??""}}function dx(t){return arguments.length?this.each(t==null?ux:(typeof t=="function"?fx:cx)(t)):this.node().textContent}function px(){this.innerHTML=""}function hx(t){return function(){this.innerHTML=t}}function mx(t){return function(){var r=t.apply(this,arguments);this.innerHTML=r??""}}function gx(t){return arguments.length?this.each(t==null?px:(typeof t=="function"?mx:hx)(t)):this.node().innerHTML}function yx(){this.nextSibling&&this.parentNode.appendChild(this)}function vx(){return this.each(yx)}function xx(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function wx(){return this.each(xx)}function bx(t){var r=typeof t=="function"?t:$m(t);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function _x(){return null}function Sx(t,r){var i=typeof t=="function"?t:$m(t),s=r==null?_x:typeof r=="function"?r:Hf(r);return this.select(function(){return this.insertBefore(i.apply(this,arguments),s.apply(this,arguments)||null)})}function kx(){var t=this.parentNode;t&&t.removeChild(this)}function Nx(){return this.each(kx)}function Ex(){var t=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function Cx(){var t=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function jx(t){return this.select(t?Cx:Ex)}function Px(t){return arguments.length?this.property("__data__",t):this.node().__data__}function $x(t){return function(r){t.call(this,r,this.__data__)}}function Mx(t){return t.trim().split(/^|\s+/).map(function(r){var i="",s=r.indexOf(".");return s>=0&&(i=r.slice(s+1),r=r.slice(0,s)),{type:r,name:i}})}function Ix(t){return function(){var r=this.__on;if(r){for(var i=0,s=-1,l=r.length,c;i<l;++i)c=r[i],(!t.type||c.type===t.type)&&c.name===t.name?this.removeEventListener(c.type,c.listener,c.options):r[++s]=c;++s?r.length=s:delete this.__on}}}function Tx(t,r,i){return function(){var s=this.__on,l,c=$x(r);if(s){for(var d=0,h=s.length;d<h;++d)if((l=s[d]).type===t.type&&l.name===t.name){this.removeEventListener(l.type,l.listener,l.options),this.addEventListener(l.type,l.listener=c,l.options=i),l.value=r;return}}this.addEventListener(t.type,c,i),l={type:t.type,name:t.name,value:r,listener:c,options:i},s?s.push(l):this.__on=[l]}}function Ax(t,r,i){var s=Mx(t+""),l,c=s.length,d;if(arguments.length<2){var h=this.node().__on;if(h){for(var v=0,b=h.length,S;v<b;++v)for(l=0,S=h[v];l<c;++l)if((d=s[l]).type===S.type&&d.name===S.name)return S.value}return}for(h=r?Tx:Ix,l=0;l<c;++l)this.each(h(s[l],r,i));return this}function Fm(t,r,i){var s=Om(t),l=s.CustomEvent;typeof l=="function"?l=new l(r,i):(l=s.document.createEvent("Event"),i?(l.initEvent(r,i.bubbles,i.cancelable),l.detail=i.detail):l.initEvent(r,!1,!1)),t.dispatchEvent(l)}function Ox(t,r){return function(){return Fm(this,t,r)}}function Rx(t,r){return function(){return Fm(this,t,r.apply(this,arguments))}}function Lx(t,r){return this.each((typeof r=="function"?Rx:Ox)(t,r))}function*Dx(){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var s=t[r],l=0,c=s.length,d;l<c;++l)(d=s[l])&&(yield d)}var Bm=[null];function cr(t,r){this._groups=t,this._parents=r}function Ra(){return new cr([[document.documentElement]],Bm)}function zx(){return this}cr.prototype=Ra.prototype={constructor:cr,select:fv,selectAll:mv,selectChild:xv,selectChildren:Sv,filter:kv,data:$v,enter:Nv,exit:Iv,join:Tv,merge:Av,selection:zx,order:Ov,sort:Rv,call:Dv,nodes:zv,node:Fv,size:Bv,empty:Hv,each:Vv,attr:Qv,style:ex,property:ox,classed:lx,text:dx,html:gx,raise:vx,lower:wx,append:bx,insert:Sx,remove:Nx,clone:jx,datum:Px,on:Ax,dispatch:Lx,[Symbol.iterator]:Dx};function ur(t){return typeof t=="string"?new cr([[document.querySelector(t)]],[document.documentElement]):new cr([[t]],Bm)}function Fx(t){let r;for(;r=t.sourceEvent;)t=r;return t}function Br(t,r){if(t=Fx(t),r===void 0&&(r=t.currentTarget),r){var i=r.ownerSVGElement||r;if(i.createSVGPoint){var s=i.createSVGPoint();return s.x=t.clientX,s.y=t.clientY,s=s.matrixTransform(r.getScreenCTM().inverse()),[s.x,s.y]}if(r.getBoundingClientRect){var l=r.getBoundingClientRect();return[t.clientX-l.left-r.clientLeft,t.clientY-l.top-r.clientTop]}}return[t.pageX,t.pageY]}const Bx={passive:!1},Ea={capture:!0,passive:!1};function of(t){t.stopImmediatePropagation()}function Cs(t){t.preventDefault(),t.stopImmediatePropagation()}function Hm(t){var r=t.document.documentElement,i=ur(t).on("dragstart.drag",Cs,Ea);"onselectstart"in r?i.on("selectstart.drag",Cs,Ea):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function Vm(t,r){var i=t.document.documentElement,s=ur(t).on("dragstart.drag",null);r&&(s.on("click.drag",Cs,Ea),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in i?s.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const ql=t=>()=>t;function Ef(t,{sourceEvent:r,subject:i,target:s,identifier:l,active:c,x:d,y:h,dx:v,dy:b,dispatch:S}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:l,enumerable:!0,configurable:!0},active:{value:c,enumerable:!0,configurable:!0},x:{value:d,enumerable:!0,configurable:!0},y:{value:h,enumerable:!0,configurable:!0},dx:{value:v,enumerable:!0,configurable:!0},dy:{value:b,enumerable:!0,configurable:!0},_:{value:S}})}Ef.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Hx(t){return!t.ctrlKey&&!t.button}function Vx(){return this.parentNode}function Ux(t,r){return r??{x:t.x,y:t.y}}function Kx(){return navigator.maxTouchPoints||"ontouchstart"in this}function Um(){var t=Hx,r=Vx,i=Ux,s=Kx,l={},c=Eu("start","drag","end"),d=0,h,v,b,S,x=0;function _(R){R.on("mousedown.drag",C).filter(s).on("touchstart.drag",T).on("touchmove.drag",P,Bx).on("touchend.drag touchcancel.drag",F).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function C(R,V){if(!(S||!t.call(this,R,V))){var K=$(this,r.call(this,R,V),R,V,"mouse");K&&(ur(R.view).on("mousemove.drag",j,Ea).on("mouseup.drag",M,Ea),Hm(R.view),of(R),b=!1,h=R.clientX,v=R.clientY,K("start",R))}}function j(R){if(Cs(R),!b){var V=R.clientX-h,K=R.clientY-v;b=V*V+K*K>x}l.mouse("drag",R)}function M(R){ur(R.view).on("mousemove.drag mouseup.drag",null),Vm(R.view,b),Cs(R),l.mouse("end",R)}function T(R,V){if(t.call(this,R,V)){var K=R.changedTouches,W=r.call(this,R,V),Q=K.length,pe,ke;for(pe=0;pe<Q;++pe)(ke=$(this,W,R,V,K[pe].identifier,K[pe]))&&(of(R),ke("start",R,K[pe]))}}function P(R){var V=R.changedTouches,K=V.length,W,Q;for(W=0;W<K;++W)(Q=l[V[W].identifier])&&(Cs(R),Q("drag",R,V[W]))}function F(R){var V=R.changedTouches,K=V.length,W,Q;for(S&&clearTimeout(S),S=setTimeout(function(){S=null},500),W=0;W<K;++W)(Q=l[V[W].identifier])&&(of(R),Q("end",R,V[W]))}function $(R,V,K,W,Q,pe){var ke=c.copy(),X=Br(pe||K,V),ue,ve,D;if((D=i.call(R,new Ef("beforestart",{sourceEvent:K,target:_,identifier:Q,active:d,x:X[0],y:X[1],dx:0,dy:0,dispatch:ke}),W))!=null)return ue=D.x-X[0]||0,ve=D.y-X[1]||0,function fe(J,ae,B){var q=X,Z;switch(J){case"start":l[Q]=fe,Z=d++;break;case"end":delete l[Q],--d;case"drag":X=Br(B||ae,V),Z=d;break}ke.call(J,R,new Ef(J,{sourceEvent:ae,subject:D,target:_,identifier:Q,active:Z,x:X[0]+ue,y:X[1]+ve,dx:X[0]-q[0],dy:X[1]-q[1],dispatch:ke}),W)}}return _.filter=function(R){return arguments.length?(t=typeof R=="function"?R:ql(!!R),_):t},_.container=function(R){return arguments.length?(r=typeof R=="function"?R:ql(R),_):r},_.subject=function(R){return arguments.length?(i=typeof R=="function"?R:ql(R),_):i},_.touchable=function(R){return arguments.length?(s=typeof R=="function"?R:ql(!!R),_):s},_.on=function(){var R=c.on.apply(c,arguments);return R===c?_:R},_.clickDistance=function(R){return arguments.length?(x=(R=+R)*R,_):Math.sqrt(x)},_}function Uf(t,r,i){t.prototype=r.prototype=i,i.constructor=t}function Km(t,r){var i=Object.create(t.prototype);for(var s in r)i[s]=r[s];return i}function La(){}var Ca=.7,du=1/Ca,js="\\s*([+-]?\\d+)\\s*",ja="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",oo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qx=/^#([0-9a-f]{3,8})$/,Wx=new RegExp(`^rgb\\(${js},${js},${js}\\)$`),Yx=new RegExp(`^rgb\\(${oo},${oo},${oo}\\)$`),Xx=new RegExp(`^rgba\\(${js},${js},${js},${ja}\\)$`),Qx=new RegExp(`^rgba\\(${oo},${oo},${oo},${ja}\\)$`),Gx=new RegExp(`^hsl\\(${ja},${oo},${oo}\\)$`),Jx=new RegExp(`^hsla\\(${ja},${oo},${oo},${ja}\\)$`),ph={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};Uf(La,Fi,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:hh,formatHex:hh,formatHex8:Zx,formatHsl:ew,formatRgb:mh,toString:mh});function hh(){return this.rgb().formatHex()}function Zx(){return this.rgb().formatHex8()}function ew(){return qm(this).formatHsl()}function mh(){return this.rgb().formatRgb()}function Fi(t){var r,i;return t=(t+"").trim().toLowerCase(),(r=qx.exec(t))?(i=r[1].length,r=parseInt(r[1],16),i===6?gh(r):i===3?new Zn(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):i===8?Wl(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):i===4?Wl(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=Wx.exec(t))?new Zn(r[1],r[2],r[3],1):(r=Yx.exec(t))?new Zn(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=Xx.exec(t))?Wl(r[1],r[2],r[3],r[4]):(r=Qx.exec(t))?Wl(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=Gx.exec(t))?xh(r[1],r[2]/100,r[3]/100,1):(r=Jx.exec(t))?xh(r[1],r[2]/100,r[3]/100,r[4]):ph.hasOwnProperty(t)?gh(ph[t]):t==="transparent"?new Zn(NaN,NaN,NaN,0):null}function gh(t){return new Zn(t>>16&255,t>>8&255,t&255,1)}function Wl(t,r,i,s){return s<=0&&(t=r=i=NaN),new Zn(t,r,i,s)}function tw(t){return t instanceof La||(t=Fi(t)),t?(t=t.rgb(),new Zn(t.r,t.g,t.b,t.opacity)):new Zn}function Cf(t,r,i,s){return arguments.length===1?tw(t):new Zn(t,r,i,s??1)}function Zn(t,r,i,s){this.r=+t,this.g=+r,this.b=+i,this.opacity=+s}Uf(Zn,Cf,Km(La,{brighter(t){return t=t==null?du:Math.pow(du,t),new Zn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ca:Math.pow(Ca,t),new Zn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Zn(Di(this.r),Di(this.g),Di(this.b),pu(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:yh,formatHex:yh,formatHex8:nw,formatRgb:vh,toString:vh}));function yh(){return`#${Li(this.r)}${Li(this.g)}${Li(this.b)}`}function nw(){return`#${Li(this.r)}${Li(this.g)}${Li(this.b)}${Li((isNaN(this.opacity)?1:this.opacity)*255)}`}function vh(){const t=pu(this.opacity);return`${t===1?"rgb(":"rgba("}${Di(this.r)}, ${Di(this.g)}, ${Di(this.b)}${t===1?")":`, ${t})`}`}function pu(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Di(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Li(t){return t=Di(t),(t<16?"0":"")+t.toString(16)}function xh(t,r,i,s){return s<=0?t=r=i=NaN:i<=0||i>=1?t=r=NaN:r<=0&&(t=NaN),new Hr(t,r,i,s)}function qm(t){if(t instanceof Hr)return new Hr(t.h,t.s,t.l,t.opacity);if(t instanceof La||(t=Fi(t)),!t)return new Hr;if(t instanceof Hr)return t;t=t.rgb();var r=t.r/255,i=t.g/255,s=t.b/255,l=Math.min(r,i,s),c=Math.max(r,i,s),d=NaN,h=c-l,v=(c+l)/2;return h?(r===c?d=(i-s)/h+(i<s)*6:i===c?d=(s-r)/h+2:d=(r-i)/h+4,h/=v<.5?c+l:2-c-l,d*=60):h=v>0&&v<1?0:d,new Hr(d,h,v,t.opacity)}function rw(t,r,i,s){return arguments.length===1?qm(t):new Hr(t,r,i,s??1)}function Hr(t,r,i,s){this.h=+t,this.s=+r,this.l=+i,this.opacity=+s}Uf(Hr,rw,Km(La,{brighter(t){return t=t==null?du:Math.pow(du,t),new Hr(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ca:Math.pow(Ca,t),new Hr(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,r=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,s=i+(i<.5?i:1-i)*r,l=2*i-s;return new Zn(sf(t>=240?t-240:t+120,l,s),sf(t,l,s),sf(t<120?t+240:t-120,l,s),this.opacity)},clamp(){return new Hr(wh(this.h),Yl(this.s),Yl(this.l),pu(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 t=pu(this.opacity);return`${t===1?"hsl(":"hsla("}${wh(this.h)}, ${Yl(this.s)*100}%, ${Yl(this.l)*100}%${t===1?")":`, ${t})`}`}}));function wh(t){return t=(t||0)%360,t<0?t+360:t}function Yl(t){return Math.max(0,Math.min(1,t||0))}function sf(t,r,i){return(t<60?r+(i-r)*t/60:t<180?i:t<240?r+(i-r)*(240-t)/60:r)*255}const Kf=t=>()=>t;function ow(t,r){return function(i){return t+i*r}}function iw(t,r,i){return t=Math.pow(t,i),r=Math.pow(r,i)-t,i=1/i,function(s){return Math.pow(t+s*r,i)}}function sw(t){return(t=+t)==1?Wm:function(r,i){return i-r?iw(r,i,t):Kf(isNaN(r)?i:r)}}function Wm(t,r){var i=r-t;return i?ow(t,i):Kf(isNaN(t)?r:t)}const hu=(function t(r){var i=sw(r);function s(l,c){var d=i((l=Cf(l)).r,(c=Cf(c)).r),h=i(l.g,c.g),v=i(l.b,c.b),b=Wm(l.opacity,c.opacity);return function(S){return l.r=d(S),l.g=h(S),l.b=v(S),l.opacity=b(S),l+""}}return s.gamma=t,s})(1);function aw(t,r){r||(r=[]);var i=t?Math.min(r.length,t.length):0,s=r.slice(),l;return function(c){for(l=0;l<i;++l)s[l]=t[l]*(1-c)+r[l]*c;return s}}function lw(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function uw(t,r){var i=r?r.length:0,s=t?Math.min(i,t.length):0,l=new Array(s),c=new Array(i),d;for(d=0;d<s;++d)l[d]=Sa(t[d],r[d]);for(;d<i;++d)c[d]=r[d];return function(h){for(d=0;d<s;++d)c[d]=l[d](h);return c}}function cw(t,r){var i=new Date;return t=+t,r=+r,function(s){return i.setTime(t*(1-s)+r*s),i}}function ro(t,r){return t=+t,r=+r,function(i){return t*(1-i)+r*i}}function fw(t,r){var i={},s={},l;(t===null||typeof t!="object")&&(t={}),(r===null||typeof r!="object")&&(r={});for(l in r)l in t?i[l]=Sa(t[l],r[l]):s[l]=r[l];return function(c){for(l in i)s[l]=i[l](c);return s}}var jf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,af=new RegExp(jf.source,"g");function dw(t){return function(){return t}}function pw(t){return function(r){return t(r)+""}}function Ym(t,r){var i=jf.lastIndex=af.lastIndex=0,s,l,c,d=-1,h=[],v=[];for(t=t+"",r=r+"";(s=jf.exec(t))&&(l=af.exec(r));)(c=l.index)>i&&(c=r.slice(i,c),h[d]?h[d]+=c:h[++d]=c),(s=s[0])===(l=l[0])?h[d]?h[d]+=l:h[++d]=l:(h[++d]=null,v.push({i:d,x:ro(s,l)})),i=af.lastIndex;return i<r.length&&(c=r.slice(i),h[d]?h[d]+=c:h[++d]=c),h.length<2?v[0]?pw(v[0].x):dw(r):(r=v.length,function(b){for(var S=0,x;S<r;++S)h[(x=v[S]).i]=x.x(b);return h.join("")})}function Sa(t,r){var i=typeof r,s;return r==null||i==="boolean"?Kf(r):(i==="number"?ro:i==="string"?(s=Fi(r))?(r=s,hu):Ym:r instanceof Fi?hu:r instanceof Date?cw:lw(r)?aw:Array.isArray(r)?uw:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?fw:ro)(t,r)}var bh=180/Math.PI,Pf={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Xm(t,r,i,s,l,c){var d,h,v;return(d=Math.sqrt(t*t+r*r))&&(t/=d,r/=d),(v=t*i+r*s)&&(i-=t*v,s-=r*v),(h=Math.sqrt(i*i+s*s))&&(i/=h,s/=h,v/=h),t*s<r*i&&(t=-t,r=-r,v=-v,d=-d),{translateX:l,translateY:c,rotate:Math.atan2(r,t)*bh,skewX:Math.atan(v)*bh,scaleX:d,scaleY:h}}var Xl;function hw(t){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return r.isIdentity?Pf:Xm(r.a,r.b,r.c,r.d,r.e,r.f)}function mw(t){return t==null||(Xl||(Xl=document.createElementNS("http://www.w3.org/2000/svg","g")),Xl.setAttribute("transform",t),!(t=Xl.transform.baseVal.consolidate()))?Pf:(t=t.matrix,Xm(t.a,t.b,t.c,t.d,t.e,t.f))}function Qm(t,r,i,s){function l(b){return b.length?b.pop()+" ":""}function c(b,S,x,_,C,j){if(b!==x||S!==_){var M=C.push("translate(",null,r,null,i);j.push({i:M-4,x:ro(b,x)},{i:M-2,x:ro(S,_)})}else(x||_)&&C.push("translate("+x+r+_+i)}function d(b,S,x,_){b!==S?(b-S>180?S+=360:S-b>180&&(b+=360),_.push({i:x.push(l(x)+"rotate(",null,s)-2,x:ro(b,S)})):S&&x.push(l(x)+"rotate("+S+s)}function h(b,S,x,_){b!==S?_.push({i:x.push(l(x)+"skewX(",null,s)-2,x:ro(b,S)}):S&&x.push(l(x)+"skewX("+S+s)}function v(b,S,x,_,C,j){if(b!==x||S!==_){var M=C.push(l(C)+"scale(",null,",",null,")");j.push({i:M-4,x:ro(b,x)},{i:M-2,x:ro(S,_)})}else(x!==1||_!==1)&&C.push(l(C)+"scale("+x+","+_+")")}return function(b,S){var x=[],_=[];return b=t(b),S=t(S),c(b.translateX,b.translateY,S.translateX,S.translateY,x,_),d(b.rotate,S.rotate,x,_),h(b.skewX,S.skewX,x,_),v(b.scaleX,b.scaleY,S.scaleX,S.scaleY,x,_),b=S=null,function(C){for(var j=-1,M=_.length,T;++j<M;)x[(T=_[j]).i]=T.x(C);return x.join("")}}}var gw=Qm(hw,"px, ","px)","deg)"),yw=Qm(mw,", ",")",")"),vw=1e-12;function _h(t){return((t=Math.exp(t))+1/t)/2}function xw(t){return((t=Math.exp(t))-1/t)/2}function ww(t){return((t=Math.exp(2*t))-1)/(t+1)}const iu=(function t(r,i,s){function l(c,d){var h=c[0],v=c[1],b=c[2],S=d[0],x=d[1],_=d[2],C=S-h,j=x-v,M=C*C+j*j,T,P;if(M<vw)P=Math.log(_/b)/r,T=function(W){return[h+W*C,v+W*j,b*Math.exp(r*W*P)]};else{var F=Math.sqrt(M),$=(_*_-b*b+s*M)/(2*b*i*F),R=(_*_-b*b-s*M)/(2*_*i*F),V=Math.log(Math.sqrt($*$+1)-$),K=Math.log(Math.sqrt(R*R+1)-R);P=(K-V)/r,T=function(W){var Q=W*P,pe=_h(V),ke=b/(i*F)*(pe*ww(r*Q+V)-xw(V));return[h+ke*C,v+ke*j,b*pe/_h(r*Q+V)]}}return T.duration=P*1e3*r/Math.SQRT2,T}return l.rho=function(c){var d=Math.max(.001,+c),h=d*d,v=h*h;return t(d,h,v)},l})(Math.SQRT2,2,4);var Ms=0,ba=0,xa=0,Gm=1e3,mu,_a,gu=0,Bi=0,ju=0,Pa=typeof performance=="object"&&performance.now?performance:Date,Jm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function qf(){return Bi||(Jm(bw),Bi=Pa.now()+ju)}function bw(){Bi=0}function yu(){this._call=this._time=this._next=null}yu.prototype=Zm.prototype={constructor:yu,restart:function(t,r,i){if(typeof t!="function")throw new TypeError("callback is not a function");i=(i==null?qf():+i)+(r==null?0:+r),!this._next&&_a!==this&&(_a?_a._next=this:mu=this,_a=this),this._call=t,this._time=i,$f()},stop:function(){this._call&&(this._call=null,this._time=1/0,$f())}};function Zm(t,r,i){var s=new yu;return s.restart(t,r,i),s}function _w(){qf(),++Ms;for(var t=mu,r;t;)(r=Bi-t._time)>=0&&t._call.call(void 0,r),t=t._next;--Ms}function Sh(){Bi=(gu=Pa.now())+ju,Ms=ba=0;try{_w()}finally{Ms=0,kw(),Bi=0}}function Sw(){var t=Pa.now(),r=t-gu;r>Gm&&(ju-=r,gu=t)}function kw(){for(var t,r=mu,i,s=1/0;r;)r._call?(s>r._time&&(s=r._time),t=r,r=r._next):(i=r._next,r._next=null,r=t?t._next=i:mu=i);_a=t,$f(s)}function $f(t){if(!Ms){ba&&(ba=clearTimeout(ba));var r=t-Bi;r>24?(t<1/0&&(ba=setTimeout(Sh,t-Pa.now()-ju)),xa&&(xa=clearInterval(xa))):(xa||(gu=Pa.now(),xa=setInterval(Sw,Gm)),Ms=1,Jm(Sh))}}function kh(t,r,i){var s=new yu;return r=r==null?0:+r,s.restart(l=>{s.stop(),t(l+r)},r,i),s}var Nw=Eu("start","end","cancel","interrupt"),Ew=[],e0=0,Nh=1,Mf=2,su=3,Eh=4,If=5,au=6;function Pu(t,r,i,s,l,c){var d=t.__transition;if(!d)t.__transition={};else if(i in d)return;Cw(t,i,{name:r,index:s,group:l,on:Nw,tween:Ew,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:e0})}function Wf(t,r){var i=Kr(t,r);if(i.state>e0)throw new Error("too late; already scheduled");return i}function ao(t,r){var i=Kr(t,r);if(i.state>su)throw new Error("too late; already running");return i}function Kr(t,r){var i=t.__transition;if(!i||!(i=i[r]))throw new Error("transition not found");return i}function Cw(t,r,i){var s=t.__transition,l;s[r]=i,i.timer=Zm(c,0,i.time);function c(b){i.state=Nh,i.timer.restart(d,i.delay,i.time),i.delay<=b&&d(b-i.delay)}function d(b){var S,x,_,C;if(i.state!==Nh)return v();for(S in s)if(C=s[S],C.name===i.name){if(C.state===su)return kh(d);C.state===Eh?(C.state=au,C.timer.stop(),C.on.call("interrupt",t,t.__data__,C.index,C.group),delete s[S]):+S<r&&(C.state=au,C.timer.stop(),C.on.call("cancel",t,t.__data__,C.index,C.group),delete s[S])}if(kh(function(){i.state===su&&(i.state=Eh,i.timer.restart(h,i.delay,i.time),h(b))}),i.state=Mf,i.on.call("start",t,t.__data__,i.index,i.group),i.state===Mf){for(i.state=su,l=new Array(_=i.tween.length),S=0,x=-1;S<_;++S)(C=i.tween[S].value.call(t,t.__data__,i.index,i.group))&&(l[++x]=C);l.length=x+1}}function h(b){for(var S=b<i.duration?i.ease.call(null,b/i.duration):(i.timer.restart(v),i.state=If,1),x=-1,_=l.length;++x<_;)l[x].call(t,S);i.state===If&&(i.on.call("end",t,t.__data__,i.index,i.group),v())}function v(){i.state=au,i.timer.stop(),delete s[r];for(var b in s)return;delete t.__transition}}function lu(t,r){var i=t.__transition,s,l,c=!0,d;if(i){r=r==null?null:r+"";for(d in i){if((s=i[d]).name!==r){c=!1;continue}l=s.state>Mf&&s.state<If,s.state=au,s.timer.stop(),s.on.call(l?"interrupt":"cancel",t,t.__data__,s.index,s.group),delete i[d]}c&&delete t.__transition}}function jw(t){return this.each(function(){lu(this,t)})}function Pw(t,r){var i,s;return function(){var l=ao(this,t),c=l.tween;if(c!==i){s=i=c;for(var d=0,h=s.length;d<h;++d)if(s[d].name===r){s=s.slice(),s.splice(d,1);break}}l.tween=s}}function $w(t,r,i){var s,l;if(typeof i!="function")throw new Error;return function(){var c=ao(this,t),d=c.tween;if(d!==s){l=(s=d).slice();for(var h={name:r,value:i},v=0,b=l.length;v<b;++v)if(l[v].name===r){l[v]=h;break}v===b&&l.push(h)}c.tween=l}}function Mw(t,r){var i=this._id;if(t+="",arguments.length<2){for(var s=Kr(this.node(),i).tween,l=0,c=s.length,d;l<c;++l)if((d=s[l]).name===t)return d.value;return null}return this.each((r==null?Pw:$w)(i,t,r))}function Yf(t,r,i){var s=t._id;return t.each(function(){var l=ao(this,s);(l.value||(l.value={}))[r]=i.apply(this,arguments)}),function(l){return Kr(l,s).value[r]}}function t0(t,r){var i;return(typeof r=="number"?ro:r instanceof Fi?hu:(i=Fi(r))?(r=i,hu):Ym)(t,r)}function Iw(t){return function(){this.removeAttribute(t)}}function Tw(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Aw(t,r,i){var s,l=i+"",c;return function(){var d=this.getAttribute(t);return d===l?null:d===s?c:c=r(s=d,i)}}function Ow(t,r,i){var s,l=i+"",c;return function(){var d=this.getAttributeNS(t.space,t.local);return d===l?null:d===s?c:c=r(s=d,i)}}function Rw(t,r,i){var s,l,c;return function(){var d,h=i(this),v;return h==null?void this.removeAttribute(t):(d=this.getAttribute(t),v=h+"",d===v?null:d===s&&v===l?c:(l=v,c=r(s=d,h)))}}function Lw(t,r,i){var s,l,c;return function(){var d,h=i(this),v;return h==null?void this.removeAttributeNS(t.space,t.local):(d=this.getAttributeNS(t.space,t.local),v=h+"",d===v?null:d===s&&v===l?c:(l=v,c=r(s=d,h)))}}function Dw(t,r){var i=Cu(t),s=i==="transform"?yw:t0;return this.attrTween(t,typeof r=="function"?(i.local?Lw:Rw)(i,s,Yf(this,"attr."+t,r)):r==null?(i.local?Tw:Iw)(i):(i.local?Ow:Aw)(i,s,r))}function zw(t,r){return function(i){this.setAttribute(t,r.call(this,i))}}function Fw(t,r){return function(i){this.setAttributeNS(t.space,t.local,r.call(this,i))}}function Bw(t,r){var i,s;function l(){var c=r.apply(this,arguments);return c!==s&&(i=(s=c)&&Fw(t,c)),i}return l._value=r,l}function Hw(t,r){var i,s;function l(){var c=r.apply(this,arguments);return c!==s&&(i=(s=c)&&zw(t,c)),i}return l._value=r,l}function Vw(t,r){var i="attr."+t;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(r==null)return this.tween(i,null);if(typeof r!="function")throw new Error;var s=Cu(t);return this.tween(i,(s.local?Bw:Hw)(s,r))}function Uw(t,r){return function(){Wf(this,t).delay=+r.apply(this,arguments)}}function Kw(t,r){return r=+r,function(){Wf(this,t).delay=r}}function qw(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?Uw:Kw)(r,t)):Kr(this.node(),r).delay}function Ww(t,r){return function(){ao(this,t).duration=+r.apply(this,arguments)}}function Yw(t,r){return r=+r,function(){ao(this,t).duration=r}}function Xw(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?Ww:Yw)(r,t)):Kr(this.node(),r).duration}function Qw(t,r){if(typeof r!="function")throw new Error;return function(){ao(this,t).ease=r}}function Gw(t){var r=this._id;return arguments.length?this.each(Qw(r,t)):Kr(this.node(),r).ease}function Jw(t,r){return function(){var i=r.apply(this,arguments);if(typeof i!="function")throw new Error;ao(this,t).ease=i}}function Zw(t){if(typeof t!="function")throw new Error;return this.each(Jw(this._id,t))}function e1(t){typeof t!="function"&&(t=Im(t));for(var r=this._groups,i=r.length,s=new Array(i),l=0;l<i;++l)for(var c=r[l],d=c.length,h=s[l]=[],v,b=0;b<d;++b)(v=c[b])&&t.call(v,v.__data__,b,c)&&h.push(v);return new Ro(s,this._parents,this._name,this._id)}function t1(t){if(t._id!==this._id)throw new Error;for(var r=this._groups,i=t._groups,s=r.length,l=i.length,c=Math.min(s,l),d=new Array(s),h=0;h<c;++h)for(var v=r[h],b=i[h],S=v.length,x=d[h]=new Array(S),_,C=0;C<S;++C)(_=v[C]||b[C])&&(x[C]=_);for(;h<s;++h)d[h]=r[h];return new Ro(d,this._parents,this._name,this._id)}function n1(t){return(t+"").trim().split(/^|\s+/).every(function(r){var i=r.indexOf(".");return i>=0&&(r=r.slice(0,i)),!r||r==="start"})}function r1(t,r,i){var s,l,c=n1(r)?Wf:ao;return function(){var d=c(this,t),h=d.on;h!==s&&(l=(s=h).copy()).on(r,i),d.on=l}}function o1(t,r){var i=this._id;return arguments.length<2?Kr(this.node(),i).on.on(t):this.each(r1(i,t,r))}function i1(t){return function(){var r=this.parentNode;for(var i in this.__transition)if(+i!==t)return;r&&r.removeChild(this)}}function s1(){return this.on("end.remove",i1(this._id))}function a1(t){var r=this._name,i=this._id;typeof t!="function"&&(t=Hf(t));for(var s=this._groups,l=s.length,c=new Array(l),d=0;d<l;++d)for(var h=s[d],v=h.length,b=c[d]=new Array(v),S,x,_=0;_<v;++_)(S=h[_])&&(x=t.call(S,S.__data__,_,h))&&("__data__"in S&&(x.__data__=S.__data__),b[_]=x,Pu(b[_],r,i,_,b,Kr(S,i)));return new Ro(c,this._parents,r,i)}function l1(t){var r=this._name,i=this._id;typeof t!="function"&&(t=Mm(t));for(var s=this._groups,l=s.length,c=[],d=[],h=0;h<l;++h)for(var v=s[h],b=v.length,S,x=0;x<b;++x)if(S=v[x]){for(var _=t.call(S,S.__data__,x,v),C,j=Kr(S,i),M=0,T=_.length;M<T;++M)(C=_[M])&&Pu(C,r,i,M,_,j);c.push(_),d.push(S)}return new Ro(c,d,r,i)}var u1=Ra.prototype.constructor;function c1(){return new u1(this._groups,this._parents)}function f1(t,r){var i,s,l;return function(){var c=$s(this,t),d=(this.style.removeProperty(t),$s(this,t));return c===d?null:c===i&&d===s?l:l=r(i=c,s=d)}}function n0(t){return function(){this.style.removeProperty(t)}}function d1(t,r,i){var s,l=i+"",c;return function(){var d=$s(this,t);return d===l?null:d===s?c:c=r(s=d,i)}}function p1(t,r,i){var s,l,c;return function(){var d=$s(this,t),h=i(this),v=h+"";return h==null&&(v=h=(this.style.removeProperty(t),$s(this,t))),d===v?null:d===s&&v===l?c:(l=v,c=r(s=d,h))}}function h1(t,r){var i,s,l,c="style."+r,d="end."+c,h;return function(){var v=ao(this,t),b=v.on,S=v.value[c]==null?h||(h=n0(r)):void 0;(b!==i||l!==S)&&(s=(i=b).copy()).on(d,l=S),v.on=s}}function m1(t,r,i){var s=(t+="")=="transform"?gw:t0;return r==null?this.styleTween(t,f1(t,s)).on("end.style."+t,n0(t)):typeof r=="function"?this.styleTween(t,p1(t,s,Yf(this,"style."+t,r))).each(h1(this._id,t)):this.styleTween(t,d1(t,s,r),i).on("end.style."+t,null)}function g1(t,r,i){return function(s){this.style.setProperty(t,r.call(this,s),i)}}function y1(t,r,i){var s,l;function c(){var d=r.apply(this,arguments);return d!==l&&(s=(l=d)&&g1(t,d,i)),s}return c._value=r,c}function v1(t,r,i){var s="style."+(t+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(r==null)return this.tween(s,null);if(typeof r!="function")throw new Error;return this.tween(s,y1(t,r,i??""))}function x1(t){return function(){this.textContent=t}}function w1(t){return function(){var r=t(this);this.textContent=r??""}}function b1(t){return this.tween("text",typeof t=="function"?w1(Yf(this,"text",t)):x1(t==null?"":t+""))}function _1(t){return function(r){this.textContent=t.call(this,r)}}function S1(t){var r,i;function s(){var l=t.apply(this,arguments);return l!==i&&(r=(i=l)&&_1(l)),r}return s._value=t,s}function k1(t){var r="text";if(arguments.length<1)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,S1(t))}function N1(){for(var t=this._name,r=this._id,i=r0(),s=this._groups,l=s.length,c=0;c<l;++c)for(var d=s[c],h=d.length,v,b=0;b<h;++b)if(v=d[b]){var S=Kr(v,r);Pu(v,t,i,b,d,{time:S.time+S.delay+S.duration,delay:0,duration:S.duration,ease:S.ease})}return new Ro(s,this._parents,t,i)}function E1(){var t,r,i=this,s=i._id,l=i.size();return new Promise(function(c,d){var h={value:d},v={value:function(){--l===0&&c()}};i.each(function(){var b=ao(this,s),S=b.on;S!==t&&(r=(t=S).copy(),r._.cancel.push(h),r._.interrupt.push(h),r._.end.push(v)),b.on=r}),l===0&&c()})}var C1=0;function Ro(t,r,i,s){this._groups=t,this._parents=r,this._name=i,this._id=s}function r0(){return++C1}var Io=Ra.prototype;Ro.prototype={constructor:Ro,select:a1,selectAll:l1,selectChild:Io.selectChild,selectChildren:Io.selectChildren,filter:e1,merge:t1,selection:c1,transition:N1,call:Io.call,nodes:Io.nodes,node:Io.node,size:Io.size,empty:Io.empty,each:Io.each,on:o1,attr:Dw,attrTween:Vw,style:m1,styleTween:v1,text:b1,textTween:k1,remove:s1,tween:Mw,delay:qw,duration:Xw,ease:Gw,easeVarying:Zw,end:E1,[Symbol.iterator]:Io[Symbol.iterator]};function j1(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var P1={time:null,delay:0,duration:250,ease:j1};function $1(t,r){for(var i;!(i=t.__transition)||!(i=i[r]);)if(!(t=t.parentNode))throw new Error(`transition ${r} not found`);return i}function M1(t){var r,i;t instanceof Ro?(r=t._id,t=t._name):(r=r0(),(i=P1).time=qf(),t=t==null?null:t+"");for(var s=this._groups,l=s.length,c=0;c<l;++c)for(var d=s[c],h=d.length,v,b=0;b<h;++b)(v=d[b])&&Pu(v,t,r,b,d,i||$1(v,r));return new Ro(s,this._parents,t,r)}Ra.prototype.interrupt=jw;Ra.prototype.transition=M1;const Ql=t=>()=>t;function I1(t,{sourceEvent:r,target:i,transform:s,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:l}})}function Ao(t,r,i){this.k=t,this.x=r,this.y=i}Ao.prototype={constructor:Ao,scale:function(t){return t===1?this:new Ao(this.k*t,this.x,this.y)},translate:function(t,r){return t===0&r===0?this:new Ao(this.k,this.x+this.k*t,this.y+this.k*r)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var $u=new Ao(1,0,0);o0.prototype=Ao.prototype;function o0(t){for(;!t.__zoom;)if(!(t=t.parentNode))return $u;return t.__zoom}function lf(t){t.stopImmediatePropagation()}function wa(t){t.preventDefault(),t.stopImmediatePropagation()}function T1(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function A1(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function Ch(){return this.__zoom||$u}function O1(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function R1(){return navigator.maxTouchPoints||"ontouchstart"in this}function L1(t,r,i){var s=t.invertX(r[0][0])-i[0][0],l=t.invertX(r[1][0])-i[1][0],c=t.invertY(r[0][1])-i[0][1],d=t.invertY(r[1][1])-i[1][1];return t.translate(l>s?(s+l)/2:Math.min(0,s)||Math.max(0,l),d>c?(c+d)/2:Math.min(0,c)||Math.max(0,d))}function i0(){var t=T1,r=A1,i=L1,s=O1,l=R1,c=[0,1/0],d=[[-1/0,-1/0],[1/0,1/0]],h=250,v=iu,b=Eu("start","zoom","end"),S,x,_,C=500,j=150,M=0,T=10;function P(D){D.property("__zoom",Ch).on("wheel.zoom",Q,{passive:!1}).on("mousedown.zoom",pe).on("dblclick.zoom",ke).filter(l).on("touchstart.zoom",X).on("touchmove.zoom",ue).on("touchend.zoom touchcancel.zoom",ve).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}P.transform=function(D,fe,J,ae){var B=D.selection?D.selection():D;B.property("__zoom",Ch),D!==B?V(D,fe,J,ae):B.interrupt().each(function(){K(this,arguments).event(ae).start().zoom(null,typeof fe=="function"?fe.apply(this,arguments):fe).end()})},P.scaleBy=function(D,fe,J,ae){P.scaleTo(D,function(){var B=this.__zoom.k,q=typeof fe=="function"?fe.apply(this,arguments):fe;return B*q},J,ae)},P.scaleTo=function(D,fe,J,ae){P.transform(D,function(){var B=r.apply(this,arguments),q=this.__zoom,Z=J==null?R(B):typeof J=="function"?J.apply(this,arguments):J,A=q.invert(Z),U=typeof fe=="function"?fe.apply(this,arguments):fe;return i($(F(q,U),Z,A),B,d)},J,ae)},P.translateBy=function(D,fe,J,ae){P.transform(D,function(){return i(this.__zoom.translate(typeof fe=="function"?fe.apply(this,arguments):fe,typeof J=="function"?J.apply(this,arguments):J),r.apply(this,arguments),d)},null,ae)},P.translateTo=function(D,fe,J,ae,B){P.transform(D,function(){var q=r.apply(this,arguments),Z=this.__zoom,A=ae==null?R(q):typeof ae=="function"?ae.apply(this,arguments):ae;return i($u.translate(A[0],A[1]).scale(Z.k).translate(typeof fe=="function"?-fe.apply(this,arguments):-fe,typeof J=="function"?-J.apply(this,arguments):-J),q,d)},ae,B)};function F(D,fe){return fe=Math.max(c[0],Math.min(c[1],fe)),fe===D.k?D:new Ao(fe,D.x,D.y)}function $(D,fe,J){var ae=fe[0]-J[0]*D.k,B=fe[1]-J[1]*D.k;return ae===D.x&&B===D.y?D:new Ao(D.k,ae,B)}function R(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function V(D,fe,J,ae){D.on("start.zoom",function(){K(this,arguments).event(ae).start()}).on("interrupt.zoom end.zoom",function(){K(this,arguments).event(ae).end()}).tween("zoom",function(){var B=this,q=arguments,Z=K(B,q).event(ae),A=r.apply(B,q),U=J==null?R(A):typeof J=="function"?J.apply(B,q):J,de=Math.max(A[1][0]-A[0][0],A[1][1]-A[0][1]),_e=B.__zoom,Te=typeof fe=="function"?fe.apply(B,q):fe,Oe=v(_e.invert(U).concat(de/_e.k),Te.invert(U).concat(de/Te.k));return function(Re){if(Re===1)Re=Te;else{var Se=Oe(Re),De=de/Se[2];Re=new Ao(De,U[0]-Se[0]*De,U[1]-Se[1]*De)}Z.zoom(null,Re)}})}function K(D,fe,J){return!J&&D.__zooming||new W(D,fe)}function W(D,fe){this.that=D,this.args=fe,this.active=0,this.sourceEvent=null,this.extent=r.apply(D,fe),this.taps=0}W.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,fe){return this.mouse&&D!=="mouse"&&(this.mouse[1]=fe.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=fe.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=fe.invert(this.touch1[0])),this.that.__zoom=fe,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var fe=ur(this.that).datum();b.call(D,this.that,new I1(D,{sourceEvent:this.sourceEvent,target:P,transform:this.that.__zoom,dispatch:b}),fe)}};function Q(D,...fe){if(!t.apply(this,arguments))return;var J=K(this,fe).event(D),ae=this.__zoom,B=Math.max(c[0],Math.min(c[1],ae.k*Math.pow(2,s.apply(this,arguments)))),q=Br(D);if(J.wheel)(J.mouse[0][0]!==q[0]||J.mouse[0][1]!==q[1])&&(J.mouse[1]=ae.invert(J.mouse[0]=q)),clearTimeout(J.wheel);else{if(ae.k===B)return;J.mouse=[q,ae.invert(q)],lu(this),J.start()}wa(D),J.wheel=setTimeout(Z,j),J.zoom("mouse",i($(F(ae,B),J.mouse[0],J.mouse[1]),J.extent,d));function Z(){J.wheel=null,J.end()}}function pe(D,...fe){if(_||!t.apply(this,arguments))return;var J=D.currentTarget,ae=K(this,fe,!0).event(D),B=ur(D.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",de,!0),q=Br(D,J),Z=D.clientX,A=D.clientY;Hm(D.view),lf(D),ae.mouse=[q,this.__zoom.invert(q)],lu(this),ae.start();function U(_e){if(wa(_e),!ae.moved){var Te=_e.clientX-Z,Oe=_e.clientY-A;ae.moved=Te*Te+Oe*Oe>M}ae.event(_e).zoom("mouse",i($(ae.that.__zoom,ae.mouse[0]=Br(_e,J),ae.mouse[1]),ae.extent,d))}function de(_e){B.on("mousemove.zoom mouseup.zoom",null),Vm(_e.view,ae.moved),wa(_e),ae.event(_e).end()}}function ke(D,...fe){if(t.apply(this,arguments)){var J=this.__zoom,ae=Br(D.changedTouches?D.changedTouches[0]:D,this),B=J.invert(ae),q=J.k*(D.shiftKey?.5:2),Z=i($(F(J,q),ae,B),r.apply(this,fe),d);wa(D),h>0?ur(this).transition().duration(h).call(V,Z,ae,D):ur(this).call(P.transform,Z,ae,D)}}function X(D,...fe){if(t.apply(this,arguments)){var J=D.touches,ae=J.length,B=K(this,fe,D.changedTouches.length===ae).event(D),q,Z,A,U;for(lf(D),Z=0;Z<ae;++Z)A=J[Z],U=Br(A,this),U=[U,this.__zoom.invert(U),A.identifier],B.touch0?!B.touch1&&B.touch0[2]!==U[2]&&(B.touch1=U,B.taps=0):(B.touch0=U,q=!0,B.taps=1+!!S);S&&(S=clearTimeout(S)),q&&(B.taps<2&&(x=U[0],S=setTimeout(function(){S=null},C)),lu(this),B.start())}}function ue(D,...fe){if(this.__zooming){var J=K(this,fe).event(D),ae=D.changedTouches,B=ae.length,q,Z,A,U;for(wa(D),q=0;q<B;++q)Z=ae[q],A=Br(Z,this),J.touch0&&J.touch0[2]===Z.identifier?J.touch0[0]=A:J.touch1&&J.touch1[2]===Z.identifier&&(J.touch1[0]=A);if(Z=J.that.__zoom,J.touch1){var de=J.touch0[0],_e=J.touch0[1],Te=J.touch1[0],Oe=J.touch1[1],Re=(Re=Te[0]-de[0])*Re+(Re=Te[1]-de[1])*Re,Se=(Se=Oe[0]-_e[0])*Se+(Se=Oe[1]-_e[1])*Se;Z=F(Z,Math.sqrt(Re/Se)),A=[(de[0]+Te[0])/2,(de[1]+Te[1])/2],U=[(_e[0]+Oe[0])/2,(_e[1]+Oe[1])/2]}else if(J.touch0)A=J.touch0[0],U=J.touch0[1];else return;J.zoom("touch",i($(Z,A,U),J.extent,d))}}function ve(D,...fe){if(this.__zooming){var J=K(this,fe).event(D),ae=D.changedTouches,B=ae.length,q,Z;for(lf(D),_&&clearTimeout(_),_=setTimeout(function(){_=null},C),q=0;q<B;++q)Z=ae[q],J.touch0&&J.touch0[2]===Z.identifier?delete J.touch0:J.touch1&&J.touch1[2]===Z.identifier&&delete J.touch1;if(J.touch1&&!J.touch0&&(J.touch0=J.touch1,delete J.touch1),J.touch0)J.touch0[1]=this.__zoom.invert(J.touch0[0]);else if(J.end(),J.taps===2&&(Z=Br(Z,this),Math.hypot(x[0]-Z[0],x[1]-Z[1])<T)){var A=ur(this).on("dblclick.zoom");A&&A.apply(this,arguments)}}}return P.wheelDelta=function(D){return arguments.length?(s=typeof D=="function"?D:Ql(+D),P):s},P.filter=function(D){return arguments.length?(t=typeof D=="function"?D:Ql(!!D),P):t},P.touchable=function(D){return arguments.length?(l=typeof D=="function"?D:Ql(!!D),P):l},P.extent=function(D){return arguments.length?(r=typeof D=="function"?D:Ql([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),P):r},P.scaleExtent=function(D){return arguments.length?(c[0]=+D[0],c[1]=+D[1],P):[c[0],c[1]]},P.translateExtent=function(D){return arguments.length?(d[0][0]=+D[0][0],d[1][0]=+D[1][0],d[0][1]=+D[0][1],d[1][1]=+D[1][1],P):[[d[0][0],d[0][1]],[d[1][0],d[1][1]]]},P.constrain=function(D){return arguments.length?(i=D,P):i},P.duration=function(D){return arguments.length?(h=+D,P):h},P.interpolate=function(D){return arguments.length?(v=D,P):v},P.on=function(){var D=b.on.apply(b,arguments);return D===b?P:D},P.clickDistance=function(D){return arguments.length?(M=(D=+D)*D,P):Math.sqrt(M)},P.tapDistance=function(D){return arguments.length?(T=+D,P):T},P}const io={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:t=>`Node type "${t}" 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:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:r,sourceHandle:i,targetHandle:s})=>`Couldn't create edge for ${t} handle id: "${t==="source"?i:s}", edge id: ${r}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/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."},$a=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],s0=["Enter"," ","Escape"],a0={"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:t,x:r,y:i})=>`Moved selected node ${t}. New position, x: ${r}, y: ${i}`,"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 Is;(function(t){t.Strict="strict",t.Loose="loose"})(Is||(Is={}));var zi;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(zi||(zi={}));var Ma;(function(t){t.Partial="partial",t.Full="full"})(Ma||(Ma={}));const l0={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var pi;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(pi||(pi={}));var vu;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(vu||(vu={}));var tt;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(tt||(tt={}));const jh={[tt.Left]:tt.Right,[tt.Right]:tt.Left,[tt.Top]:tt.Bottom,[tt.Bottom]:tt.Top};function u0(t){return t===null?null:t?"valid":"invalid"}const c0=t=>"id"in t&&"source"in t&&"target"in t,D1=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Xf=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),Da=(t,r=[0,0])=>{const{width:i,height:s}=Lo(t),l=t.origin??r,c=i*l[0],d=s*l[1];return{x:t.position.x-c,y:t.position.y-d}},z1=(t,r={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const i=t.reduce((s,l)=>{const c=typeof l=="string";let d=!r.nodeLookup&&!c?l:void 0;r.nodeLookup&&(d=c?r.nodeLookup.get(l):Xf(l)?l:r.nodeLookup.get(l.id));const h=d?xu(d,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Mu(s,h)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Iu(i)},za=(t,r={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return t.forEach(l=>{(r.filter===void 0||r.filter(l))&&(i=Mu(i,xu(l)),s=!0)}),s?Iu(i):{x:0,y:0,width:0,height:0}},Qf=(t,r,[i,s,l]=[0,0,1],c=!1,d=!1)=>{const h={...Ba(r,[i,s,l]),width:r.width/l,height:r.height/l},v=[];for(const b of t.values()){const{measured:S,selectable:x=!0,hidden:_=!1}=b;if(d&&!x||_)continue;const C=S.width??b.width??b.initialWidth??null,j=S.height??b.height??b.initialHeight??null,M=Ia(h,As(b)),T=(C??0)*(j??0),P=c&&M>0;(!b.internals.handleBounds||P||M>=T||b.dragging)&&v.push(b)}return v},F1=(t,r)=>{const i=new Set;return t.forEach(s=>{i.add(s.id)}),r.filter(s=>i.has(s.source)||i.has(s.target))};function B1(t,r){const i=new Map,s=r!=null&&r.nodes?new Set(r.nodes.map(l=>l.id)):null;return t.forEach(l=>{l.measured.width&&l.measured.height&&((r==null?void 0:r.includeHiddenNodes)||!l.hidden)&&(!s||s.has(l.id))&&i.set(l.id,l)}),i}async function H1({nodes:t,width:r,height:i,panZoom:s,minZoom:l,maxZoom:c},d){if(t.size===0)return Promise.resolve(!0);const h=B1(t,d),v=za(h),b=Gf(v,r,i,(d==null?void 0:d.minZoom)??l,(d==null?void 0:d.maxZoom)??c,(d==null?void 0:d.padding)??.1);return await s.setViewport(b,{duration:d==null?void 0:d.duration,ease:d==null?void 0:d.ease,interpolate:d==null?void 0:d.interpolate}),Promise.resolve(!0)}function f0({nodeId:t,nextPosition:r,nodeLookup:i,nodeOrigin:s=[0,0],nodeExtent:l,onError:c}){const d=i.get(t),h=d.parentId?i.get(d.parentId):void 0,{x:v,y:b}=h?h.internals.positionAbsolute:{x:0,y:0},S=d.origin??s;let x=d.extent||l;if(d.extent==="parent"&&!d.expandParent)if(!h)c==null||c("005",io.error005());else{const C=h.measured.width,j=h.measured.height;C&&j&&(x=[[v,b],[v+C,b+j]])}else h&&Os(d.extent)&&(x=[[d.extent[0][0]+v,d.extent[0][1]+b],[d.extent[1][0]+v,d.extent[1][1]+b]]);const _=Os(x)?Hi(r,x,d.measured):r;return(d.measured.width===void 0||d.measured.height===void 0)&&(c==null||c("015",io.error015())),{position:{x:_.x-v+(d.measured.width??0)*S[0],y:_.y-b+(d.measured.height??0)*S[1]},positionAbsolute:_}}async function V1({nodesToRemove:t=[],edgesToRemove:r=[],nodes:i,edges:s,onBeforeDelete:l}){const c=new Set(t.map(_=>_.id)),d=[];for(const _ of i){if(_.deletable===!1)continue;const C=c.has(_.id),j=!C&&_.parentId&&d.find(M=>M.id===_.parentId);(C||j)&&d.push(_)}const h=new Set(r.map(_=>_.id)),v=s.filter(_=>_.deletable!==!1),S=F1(d,v);for(const _ of v)h.has(_.id)&&!S.find(j=>j.id===_.id)&&S.push(_);if(!l)return{edges:S,nodes:d};const x=await l({nodes:d,edges:S});return typeof x=="boolean"?x?{edges:S,nodes:d}:{edges:[],nodes:[]}:x}const Ts=(t,r=0,i=1)=>Math.min(Math.max(t,r),i),Hi=(t={x:0,y:0},r,i)=>({x:Ts(t.x,r[0][0],r[1][0]-((i==null?void 0:i.width)??0)),y:Ts(t.y,r[0][1],r[1][1]-((i==null?void 0:i.height)??0))});function d0(t,r,i){const{width:s,height:l}=Lo(i),{x:c,y:d}=i.internals.positionAbsolute;return Hi(t,[[c,d],[c+s,d+l]],r)}const Ph=(t,r,i)=>t<r?Ts(Math.abs(t-r),1,r)/r:t>i?-Ts(Math.abs(t-i),1,r)/r:0,p0=(t,r,i=15,s=40)=>{const l=Ph(t.x,s,r.width-s)*i,c=Ph(t.y,s,r.height-s)*i;return[l,c]},Mu=(t,r)=>({x:Math.min(t.x,r.x),y:Math.min(t.y,r.y),x2:Math.max(t.x2,r.x2),y2:Math.max(t.y2,r.y2)}),Tf=({x:t,y:r,width:i,height:s})=>({x:t,y:r,x2:t+i,y2:r+s}),Iu=({x:t,y:r,x2:i,y2:s})=>({x:t,y:r,width:i-t,height:s-r}),As=(t,r=[0,0])=>{var l,c;const{x:i,y:s}=Xf(t)?t.internals.positionAbsolute:Da(t,r);return{x:i,y:s,width:((l=t.measured)==null?void 0:l.width)??t.width??t.initialWidth??0,height:((c=t.measured)==null?void 0:c.height)??t.height??t.initialHeight??0}},xu=(t,r=[0,0])=>{var l,c;const{x:i,y:s}=Xf(t)?t.internals.positionAbsolute:Da(t,r);return{x:i,y:s,x2:i+(((l=t.measured)==null?void 0:l.width)??t.width??t.initialWidth??0),y2:s+(((c=t.measured)==null?void 0:c.height)??t.height??t.initialHeight??0)}},h0=(t,r)=>Iu(Mu(Tf(t),Tf(r))),Ia=(t,r)=>{const i=Math.max(0,Math.min(t.x+t.width,r.x+r.width)-Math.max(t.x,r.x)),s=Math.max(0,Math.min(t.y+t.height,r.y+r.height)-Math.max(t.y,r.y));return Math.ceil(i*s)},$h=t=>Vr(t.width)&&Vr(t.height)&&Vr(t.x)&&Vr(t.y),Vr=t=>!isNaN(t)&&isFinite(t),U1=(t,r)=>{},Fa=(t,r=[1,1])=>({x:r[0]*Math.round(t.x/r[0]),y:r[1]*Math.round(t.y/r[1])}),Ba=({x:t,y:r},[i,s,l],c=!1,d=[1,1])=>{const h={x:(t-i)/l,y:(r-s)/l};return c?Fa(h,d):h},wu=({x:t,y:r},[i,s,l])=>({x:t*l+i,y:r*l+s});function Ss(t,r){if(typeof t=="number")return Math.floor((r-r/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(i)}if(typeof t=="string"&&t.endsWith("%")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(r*i*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function K1(t,r,i){if(typeof t=="string"||typeof t=="number"){const s=Ss(t,i),l=Ss(t,r);return{top:s,right:l,bottom:s,left:l,x:l*2,y:s*2}}if(typeof t=="object"){const s=Ss(t.top??t.y??0,i),l=Ss(t.bottom??t.y??0,i),c=Ss(t.left??t.x??0,r),d=Ss(t.right??t.x??0,r);return{top:s,right:d,bottom:l,left:c,x:c+d,y:s+l}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function q1(t,r,i,s,l,c){const{x:d,y:h}=wu(t,[r,i,s]),{x:v,y:b}=wu({x:t.x+t.width,y:t.y+t.height},[r,i,s]),S=l-v,x=c-b;return{left:Math.floor(d),top:Math.floor(h),right:Math.floor(S),bottom:Math.floor(x)}}const Gf=(t,r,i,s,l,c)=>{const d=K1(c,r,i),h=(r-d.x)/t.width,v=(i-d.y)/t.height,b=Math.min(h,v),S=Ts(b,s,l),x=t.x+t.width/2,_=t.y+t.height/2,C=r/2-x*S,j=i/2-_*S,M=q1(t,C,j,S,r,i),T={left:Math.min(M.left-d.left,0),top:Math.min(M.top-d.top,0),right:Math.min(M.right-d.right,0),bottom:Math.min(M.bottom-d.bottom,0)};return{x:C-T.left+T.right,y:j-T.top+T.bottom,zoom:S}},Ta=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function Os(t){return t!=null&&t!=="parent"}function Lo(t){var r,i;return{width:((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth??0,height:((i=t.measured)==null?void 0:i.height)??t.height??t.initialHeight??0}}function m0(t){var r,i;return(((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth)!==void 0&&(((i=t.measured)==null?void 0:i.height)??t.height??t.initialHeight)!==void 0}function g0(t,r={width:0,height:0},i,s,l){const c={...t},d=s.get(i);if(d){const h=d.origin||l;c.x+=d.internals.positionAbsolute.x-(r.width??0)*h[0],c.y+=d.internals.positionAbsolute.y-(r.height??0)*h[1]}return c}function Mh(t,r){if(t.size!==r.size)return!1;for(const i of t)if(!r.has(i))return!1;return!0}function W1(){let t,r;return{promise:new Promise((s,l)=>{t=s,r=l}),resolve:t,reject:r}}function Y1(t){return{...a0,...t||{}}}function ka(t,{snapGrid:r=[0,0],snapToGrid:i=!1,transform:s,containerBounds:l}){const{x:c,y:d}=Ur(t),h=Ba({x:c-((l==null?void 0:l.left)??0),y:d-((l==null?void 0:l.top)??0)},s),{x:v,y:b}=i?Fa(h,r):h;return{xSnapped:v,ySnapped:b,...h}}const Jf=t=>({width:t.offsetWidth,height:t.offsetHeight}),y0=t=>{var r;return((r=t==null?void 0:t.getRootNode)==null?void 0:r.call(t))||(window==null?void 0:window.document)},X1=["INPUT","SELECT","TEXTAREA"];function v0(t){var s,l;const r=((l=(s=t.composedPath)==null?void 0:s.call(t))==null?void 0:l[0])||t.target;return(r==null?void 0:r.nodeType)!==1?!1:X1.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const x0=t=>"clientX"in t,Ur=(t,r)=>{var c,d;const i=x0(t),s=i?t.clientX:(c=t.touches)==null?void 0:c[0].clientX,l=i?t.clientY:(d=t.touches)==null?void 0:d[0].clientY;return{x:s-((r==null?void 0:r.left)??0),y:l-((r==null?void 0:r.top)??0)}},Ih=(t,r,i,s,l)=>{const c=r.querySelectorAll(`.${t}`);return!c||!c.length?null:Array.from(c).map(d=>{const h=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),type:t,nodeId:l,position:d.getAttribute("data-handlepos"),x:(h.left-i.left)/s,y:(h.top-i.top)/s,...Jf(d)}})};function w0({sourceX:t,sourceY:r,targetX:i,targetY:s,sourceControlX:l,sourceControlY:c,targetControlX:d,targetControlY:h}){const v=t*.125+l*.375+d*.375+i*.125,b=r*.125+c*.375+h*.375+s*.125,S=Math.abs(v-t),x=Math.abs(b-r);return[v,b,S,x]}function Gl(t,r){return t>=0?.5*t:r*25*Math.sqrt(-t)}function Th({pos:t,x1:r,y1:i,x2:s,y2:l,c}){switch(t){case tt.Left:return[r-Gl(r-s,c),i];case tt.Right:return[r+Gl(s-r,c),i];case tt.Top:return[r,i-Gl(i-l,c)];case tt.Bottom:return[r,i+Gl(l-i,c)]}}function b0({sourceX:t,sourceY:r,sourcePosition:i=tt.Bottom,targetX:s,targetY:l,targetPosition:c=tt.Top,curvature:d=.25}){const[h,v]=Th({pos:i,x1:t,y1:r,x2:s,y2:l,c:d}),[b,S]=Th({pos:c,x1:s,y1:l,x2:t,y2:r,c:d}),[x,_,C,j]=w0({sourceX:t,sourceY:r,targetX:s,targetY:l,sourceControlX:h,sourceControlY:v,targetControlX:b,targetControlY:S});return[`M${t},${r} C${h},${v} ${b},${S} ${s},${l}`,x,_,C,j]}function _0({sourceX:t,sourceY:r,targetX:i,targetY:s}){const l=Math.abs(i-t)/2,c=i<t?i+l:i-l,d=Math.abs(s-r)/2,h=s<r?s+d:s-d;return[c,h,l,d]}function Q1({sourceNode:t,targetNode:r,selected:i=!1,zIndex:s=0,elevateOnSelect:l=!1,zIndexMode:c="basic"}){if(c==="manual")return s;const d=l&&i?s+1e3:s,h=Math.max(t.parentId||l&&t.selected?t.internals.z:0,r.parentId||l&&r.selected?r.internals.z:0);return d+h}function G1({sourceNode:t,targetNode:r,width:i,height:s,transform:l}){const c=Mu(xu(t),xu(r));c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const d={x:-l[0]/l[2],y:-l[1]/l[2],width:i/l[2],height:s/l[2]};return Ia(d,Iu(c))>0}const J1=({source:t,sourceHandle:r,target:i,targetHandle:s})=>`xy-edge__${t}${r||""}-${i}${s||""}`,Z1=(t,r)=>r.some(i=>i.source===t.source&&i.target===t.target&&(i.sourceHandle===t.sourceHandle||!i.sourceHandle&&!t.sourceHandle)&&(i.targetHandle===t.targetHandle||!i.targetHandle&&!t.targetHandle)),S0=(t,r,i={})=>{if(!t.source||!t.target)return r;const s=i.getEdgeId||J1;let l;return c0(t)?l={...t}:l={...t,id:s(t)},Z1(l,r)?r:(l.sourceHandle===null&&delete l.sourceHandle,l.targetHandle===null&&delete l.targetHandle,r.concat(l))};function k0({sourceX:t,sourceY:r,targetX:i,targetY:s}){const[l,c,d,h]=_0({sourceX:t,sourceY:r,targetX:i,targetY:s});return[`M ${t},${r}L ${i},${s}`,l,c,d,h]}const Ah={[tt.Left]:{x:-1,y:0},[tt.Right]:{x:1,y:0},[tt.Top]:{x:0,y:-1},[tt.Bottom]:{x:0,y:1}},eb=({source:t,sourcePosition:r=tt.Bottom,target:i})=>r===tt.Left||r===tt.Right?t.x<i.x?{x:1,y:0}:{x:-1,y:0}:t.y<i.y?{x:0,y:1}:{x:0,y:-1},Oh=(t,r)=>Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2));function tb({source:t,sourcePosition:r=tt.Bottom,target:i,targetPosition:s=tt.Top,center:l,offset:c,stepPosition:d}){const h=Ah[r],v=Ah[s],b={x:t.x+h.x*c,y:t.y+h.y*c},S={x:i.x+v.x*c,y:i.y+v.y*c},x=eb({source:b,sourcePosition:r,target:S}),_=x.x!==0?"x":"y",C=x[_];let j=[],M,T;const P={x:0,y:0},F={x:0,y:0},[,,$,R]=_0({sourceX:t.x,sourceY:t.y,targetX:i.x,targetY:i.y});if(h[_]*v[_]===-1){_==="x"?(M=l.x??b.x+(S.x-b.x)*d,T=l.y??(b.y+S.y)/2):(M=l.x??(b.x+S.x)/2,T=l.y??b.y+(S.y-b.y)*d);const Q=[{x:M,y:b.y},{x:M,y:S.y}],pe=[{x:b.x,y:T},{x:S.x,y:T}];h[_]===C?j=_==="x"?Q:pe:j=_==="x"?pe:Q}else{const Q=[{x:b.x,y:S.y}],pe=[{x:S.x,y:b.y}];if(_==="x"?j=h.x===C?pe:Q:j=h.y===C?Q:pe,r===s){const D=Math.abs(t[_]-i[_]);if(D<=c){const fe=Math.min(c-1,c-D);h[_]===C?P[_]=(b[_]>t[_]?-1:1)*fe:F[_]=(S[_]>i[_]?-1:1)*fe}}if(r!==s){const D=_==="x"?"y":"x",fe=h[_]===v[D],J=b[D]>S[D],ae=b[D]<S[D];(h[_]===1&&(!fe&&J||fe&&ae)||h[_]!==1&&(!fe&&ae||fe&&J))&&(j=_==="x"?Q:pe)}const ke={x:b.x+P.x,y:b.y+P.y},X={x:S.x+F.x,y:S.y+F.y},ue=Math.max(Math.abs(ke.x-j[0].x),Math.abs(X.x-j[0].x)),ve=Math.max(Math.abs(ke.y-j[0].y),Math.abs(X.y-j[0].y));ue>=ve?(M=(ke.x+X.x)/2,T=j[0].y):(M=j[0].x,T=(ke.y+X.y)/2)}const V={x:b.x+P.x,y:b.y+P.y},K={x:S.x+F.x,y:S.y+F.y};return[[t,...V.x!==j[0].x||V.y!==j[0].y?[V]:[],...j,...K.x!==j[j.length-1].x||K.y!==j[j.length-1].y?[K]:[],i],M,T,$,R]}function nb(t,r,i,s){const l=Math.min(Oh(t,r)/2,Oh(r,i)/2,s),{x:c,y:d}=r;if(t.x===c&&c===i.x||t.y===d&&d===i.y)return`L${c} ${d}`;if(t.y===d){const b=t.x<i.x?-1:1,S=t.y<i.y?1:-1;return`L ${c+l*b},${d}Q ${c},${d} ${c},${d+l*S}`}const h=t.x<i.x?1:-1,v=t.y<i.y?-1:1;return`L ${c},${d+l*v}Q ${c},${d} ${c+l*h},${d}`}function Af({sourceX:t,sourceY:r,sourcePosition:i=tt.Bottom,targetX:s,targetY:l,targetPosition:c=tt.Top,borderRadius:d=5,centerX:h,centerY:v,offset:b=20,stepPosition:S=.5}){const[x,_,C,j,M]=tb({source:{x:t,y:r},sourcePosition:i,target:{x:s,y:l},targetPosition:c,center:{x:h,y:v},offset:b,stepPosition:S});let T=`M${x[0].x} ${x[0].y}`;for(let P=1;P<x.length-1;P++)T+=nb(x[P-1],x[P],x[P+1],d);return T+=`L${x[x.length-1].x} ${x[x.length-1].y}`,[T,_,C,j,M]}function Rh(t){var r;return t&&!!(t.internals.handleBounds||(r=t.handles)!=null&&r.length)&&!!(t.measured.width||t.width||t.initialWidth)}function rb(t){var x;const{sourceNode:r,targetNode:i}=t;if(!Rh(r)||!Rh(i))return null;const s=r.internals.handleBounds||Lh(r.handles),l=i.internals.handleBounds||Lh(i.handles),c=Dh((s==null?void 0:s.source)??[],t.sourceHandle),d=Dh(t.connectionMode===Is.Strict?(l==null?void 0:l.target)??[]:((l==null?void 0:l.target)??[]).concat((l==null?void 0:l.source)??[]),t.targetHandle);if(!c||!d)return(x=t.onError)==null||x.call(t,"008",io.error008(c?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const h=(c==null?void 0:c.position)||tt.Bottom,v=(d==null?void 0:d.position)||tt.Top,b=Vi(r,c,h),S=Vi(i,d,v);return{sourceX:b.x,sourceY:b.y,targetX:S.x,targetY:S.y,sourcePosition:h,targetPosition:v}}function Lh(t){if(!t)return null;const r=[],i=[];for(const s of t)s.width=s.width??1,s.height=s.height??1,s.type==="source"?r.push(s):s.type==="target"&&i.push(s);return{source:r,target:i}}function Vi(t,r,i=tt.Left,s=!1){const l=((r==null?void 0:r.x)??0)+t.internals.positionAbsolute.x,c=((r==null?void 0:r.y)??0)+t.internals.positionAbsolute.y,{width:d,height:h}=r??Lo(t);if(s)return{x:l+d/2,y:c+h/2};switch((r==null?void 0:r.position)??i){case tt.Top:return{x:l+d/2,y:c};case tt.Right:return{x:l+d,y:c+h/2};case tt.Bottom:return{x:l+d/2,y:c+h};case tt.Left:return{x:l,y:c+h/2}}}function Dh(t,r){return t&&(r?t.find(i=>i.id===r):t[0])||null}function Of(t,r){return t?typeof t=="string"?t:`${r?`${r}__`:""}${Object.keys(t).sort().map(s=>`${s}=${t[s]}`).join("&")}`:""}function ob(t,{id:r,defaultColor:i,defaultMarkerStart:s,defaultMarkerEnd:l}){const c=new Set;return t.reduce((d,h)=>([h.markerStart||s,h.markerEnd||l].forEach(v=>{if(v&&typeof v=="object"){const b=Of(v,r);c.has(b)||(d.push({id:b,color:v.color||i,...v}),c.add(b))}}),d),[]).sort((d,h)=>d.id.localeCompare(h.id))}const N0=1e3,ib=10,Zf={nodeOrigin:[0,0],nodeExtent:$a,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},sb={...Zf,checkEquality:!0};function ed(t,r){const i={...t};for(const s in r)r[s]!==void 0&&(i[s]=r[s]);return i}function ab(t,r,i){const s=ed(Zf,i);for(const l of t.values())if(l.parentId)nd(l,t,r,s);else{const c=Da(l,s.nodeOrigin),d=Os(l.extent)?l.extent:s.nodeExtent,h=Hi(c,d,Lo(l));l.internals.positionAbsolute=h}}function lb(t,r){if(!t.handles)return t.measured?r==null?void 0:r.internals.handleBounds:void 0;const i=[],s=[];for(const l of t.handles){const c={id:l.id,width:l.width??1,height:l.height??1,nodeId:t.id,x:l.x,y:l.y,position:l.position,type:l.type};l.type==="source"?i.push(c):l.type==="target"&&s.push(c)}return{source:i,target:s}}function td(t){return t==="manual"}function Rf(t,r,i,s={}){var S,x;const l=ed(sb,s),c={i:0},d=new Map(r),h=l!=null&&l.elevateNodesOnSelect&&!td(l.zIndexMode)?N0:0;let v=t.length>0,b=!1;r.clear(),i.clear();for(const _ of t){let C=d.get(_.id);if(l.checkEquality&&_===(C==null?void 0:C.internals.userNode))r.set(_.id,C);else{const j=Da(_,l.nodeOrigin),M=Os(_.extent)?_.extent:l.nodeExtent,T=Hi(j,M,Lo(_));C={...l.defaults,..._,measured:{width:(S=_.measured)==null?void 0:S.width,height:(x=_.measured)==null?void 0:x.height},internals:{positionAbsolute:T,handleBounds:lb(_,C),z:E0(_,h,l.zIndexMode),userNode:_}},r.set(_.id,C)}(C.measured===void 0||C.measured.width===void 0||C.measured.height===void 0)&&!C.hidden&&(v=!1),_.parentId&&nd(C,r,i,s,c),b||(b=_.selected??!1)}return{nodesInitialized:v,hasSelectedNodes:b}}function ub(t,r){if(!t.parentId)return;const i=r.get(t.parentId);i?i.set(t.id,t):r.set(t.parentId,new Map([[t.id,t]]))}function nd(t,r,i,s,l){const{elevateNodesOnSelect:c,nodeOrigin:d,nodeExtent:h,zIndexMode:v}=ed(Zf,s),b=t.parentId,S=r.get(b);if(!S){console.warn(`Parent node ${b} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}ub(t,i),l&&!S.parentId&&S.internals.rootParentIndex===void 0&&v==="auto"&&(S.internals.rootParentIndex=++l.i,S.internals.z=S.internals.z+l.i*ib),l&&S.internals.rootParentIndex!==void 0&&(l.i=S.internals.rootParentIndex);const x=c&&!td(v)?N0:0,{x:_,y:C,z:j}=cb(t,S,d,h,x,v),{positionAbsolute:M}=t.internals,T=_!==M.x||C!==M.y;(T||j!==t.internals.z)&&r.set(t.id,{...t,internals:{...t.internals,positionAbsolute:T?{x:_,y:C}:M,z:j}})}function E0(t,r,i){const s=Vr(t.zIndex)?t.zIndex:0;return td(i)?s:s+(t.selected?r:0)}function cb(t,r,i,s,l,c){const{x:d,y:h}=r.internals.positionAbsolute,v=Lo(t),b=Da(t,i),S=Os(t.extent)?Hi(b,t.extent,v):b;let x=Hi({x:d+S.x,y:h+S.y},s,v);t.extent==="parent"&&(x=d0(x,v,r));const _=E0(t,l,c),C=r.internals.z??0;return{x:x.x,y:x.y,z:C>=_?C+1:_}}function rd(t,r,i,s=[0,0]){var d;const l=[],c=new Map;for(const h of t){const v=r.get(h.parentId);if(!v)continue;const b=((d=c.get(h.parentId))==null?void 0:d.expandedRect)??As(v),S=h0(b,h.rect);c.set(h.parentId,{expandedRect:S,parent:v})}return c.size>0&&c.forEach(({expandedRect:h,parent:v},b)=>{var $;const S=v.internals.positionAbsolute,x=Lo(v),_=v.origin??s,C=h.x<S.x?Math.round(Math.abs(S.x-h.x)):0,j=h.y<S.y?Math.round(Math.abs(S.y-h.y)):0,M=Math.max(x.width,Math.round(h.width)),T=Math.max(x.height,Math.round(h.height)),P=(M-x.width)*_[0],F=(T-x.height)*_[1];(C>0||j>0||P||F)&&(l.push({id:b,type:"position",position:{x:v.position.x-C+P,y:v.position.y-j+F}}),($=i.get(b))==null||$.forEach(R=>{t.some(V=>V.id===R.id)||l.push({id:R.id,type:"position",position:{x:R.position.x+C,y:R.position.y+j}})})),(x.width<h.width||x.height<h.height||C||j)&&l.push({id:b,type:"dimensions",setAttributes:!0,dimensions:{width:M+(C?_[0]*C-P:0),height:T+(j?_[1]*j-F:0)}})}),l}function fb(t,r,i,s,l,c,d){const h=s==null?void 0:s.querySelector(".xyflow__viewport");let v=!1;if(!h)return{changes:[],updatedInternals:v};const b=[],S=window.getComputedStyle(h),{m22:x}=new window.DOMMatrixReadOnly(S.transform),_=[];for(const C of t.values()){const j=r.get(C.id);if(!j)continue;if(j.hidden){r.set(j.id,{...j,internals:{...j.internals,handleBounds:void 0}}),v=!0;continue}const M=Jf(C.nodeElement),T=j.measured.width!==M.width||j.measured.height!==M.height;if(!!(M.width&&M.height&&(T||!j.internals.handleBounds||C.force))){const F=C.nodeElement.getBoundingClientRect(),$=Os(j.extent)?j.extent:c;let{positionAbsolute:R}=j.internals;j.parentId&&j.extent==="parent"?R=d0(R,M,r.get(j.parentId)):$&&(R=Hi(R,$,M));const V={...j,measured:M,internals:{...j.internals,positionAbsolute:R,handleBounds:{source:Ih("source",C.nodeElement,F,x,j.id),target:Ih("target",C.nodeElement,F,x,j.id)}}};r.set(j.id,V),j.parentId&&nd(V,r,i,{nodeOrigin:l,zIndexMode:d}),v=!0,T&&(b.push({id:j.id,type:"dimensions",dimensions:M}),j.expandParent&&j.parentId&&_.push({id:j.id,parentId:j.parentId,rect:As(V,l)}))}}if(_.length>0){const C=rd(_,r,i,l);b.push(...C)}return{changes:b,updatedInternals:v}}async function db({delta:t,panZoom:r,transform:i,translateExtent:s,width:l,height:c}){if(!r||!t.x&&!t.y)return Promise.resolve(!1);const d=await r.setViewportConstrained({x:i[0]+t.x,y:i[1]+t.y,zoom:i[2]},[[0,0],[l,c]],s),h=!!d&&(d.x!==i[0]||d.y!==i[1]||d.k!==i[2]);return Promise.resolve(h)}function zh(t,r,i,s,l,c){let d=l;const h=s.get(d)||new Map;s.set(d,h.set(i,r)),d=`${l}-${t}`;const v=s.get(d)||new Map;if(s.set(d,v.set(i,r)),c){d=`${l}-${t}-${c}`;const b=s.get(d)||new Map;s.set(d,b.set(i,r))}}function C0(t,r,i){t.clear(),r.clear();for(const s of i){const{source:l,target:c,sourceHandle:d=null,targetHandle:h=null}=s,v={edgeId:s.id,source:l,target:c,sourceHandle:d,targetHandle:h},b=`${l}-${d}--${c}-${h}`,S=`${c}-${h}--${l}-${d}`;zh("source",v,S,t,l,d),zh("target",v,b,t,c,h),r.set(s.id,s)}}function j0(t,r){if(!t.parentId)return!1;const i=r.get(t.parentId);return i?i.selected?!0:j0(i,r):!1}function Fh(t,r,i){var l;let s=t;do{if((l=s==null?void 0:s.matches)!=null&&l.call(s,r))return!0;if(s===i)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function pb(t,r,i,s){const l=new Map;for(const[c,d]of t)if((d.selected||d.id===s)&&(!d.parentId||!j0(d,t))&&(d.draggable||r&&typeof d.draggable>"u")){const h=t.get(c);h&&l.set(c,{id:c,position:h.position||{x:0,y:0},distance:{x:i.x-h.internals.positionAbsolute.x,y:i.y-h.internals.positionAbsolute.y},extent:h.extent,parentId:h.parentId,origin:h.origin,expandParent:h.expandParent,internals:{positionAbsolute:h.internals.positionAbsolute||{x:0,y:0}},measured:{width:h.measured.width??0,height:h.measured.height??0}})}return l}function uf({nodeId:t,dragItems:r,nodeLookup:i,dragging:s=!0}){var d,h,v;const l=[];for(const[b,S]of r){const x=(d=i.get(b))==null?void 0:d.internals.userNode;x&&l.push({...x,position:S.position,dragging:s})}if(!t)return[l[0],l];const c=(h=i.get(t))==null?void 0:h.internals.userNode;return[c?{...c,position:((v=r.get(t))==null?void 0:v.position)||c.position,dragging:s}:l[0],l]}function hb({dragItems:t,snapGrid:r,x:i,y:s}){const l=t.values().next().value;if(!l)return null;const c={x:i-l.distance.x,y:s-l.distance.y},d=Fa(c,r);return{x:d.x-c.x,y:d.y-c.y}}function mb({onNodeMouseDown:t,getStoreItems:r,onDragStart:i,onDrag:s,onDragStop:l}){let c={x:null,y:null},d=0,h=new Map,v=!1,b={x:0,y:0},S=null,x=!1,_=null,C=!1,j=!1,M=null;function T({noDragClassName:F,handleSelector:$,domNode:R,isSelectable:V,nodeId:K,nodeClickDistance:W=0}){_=ur(R);function Q({x:ue,y:ve}){const{nodeLookup:D,nodeExtent:fe,snapGrid:J,snapToGrid:ae,nodeOrigin:B,onNodeDrag:q,onSelectionDrag:Z,onError:A,updateNodePositions:U}=r();c={x:ue,y:ve};let de=!1;const _e=h.size>1,Te=_e&&fe?Tf(za(h)):null,Oe=_e&&ae?hb({dragItems:h,snapGrid:J,x:ue,y:ve}):null;for(const[Re,Se]of h){if(!D.has(Re))continue;let De={x:ue-Se.distance.x,y:ve-Se.distance.y};ae&&(De=Oe?{x:Math.round(De.x+Oe.x),y:Math.round(De.y+Oe.y)}:Fa(De,J));let Ne=null;if(_e&&fe&&!Se.extent&&Te){const{positionAbsolute:Ue}=Se.internals,qe=Ue.x-Te.x+fe[0][0],nt=Ue.x+Se.measured.width-Te.x2+fe[1][0],ct=Ue.y-Te.y+fe[0][1],St=Ue.y+Se.measured.height-Te.y2+fe[1][1];Ne=[[qe,ct],[nt,St]]}const{position:Ze,positionAbsolute:Be}=f0({nodeId:Re,nextPosition:De,nodeLookup:D,nodeExtent:Ne||fe,nodeOrigin:B,onError:A});de=de||Se.position.x!==Ze.x||Se.position.y!==Ze.y,Se.position=Ze,Se.internals.positionAbsolute=Be}if(j=j||de,!!de&&(U(h,!0),M&&(s||q||!K&&Z))){const[Re,Se]=uf({nodeId:K,dragItems:h,nodeLookup:D});s==null||s(M,h,Re,Se),q==null||q(M,Re,Se),K||Z==null||Z(M,Se)}}async function pe(){if(!S)return;const{transform:ue,panBy:ve,autoPanSpeed:D,autoPanOnNodeDrag:fe}=r();if(!fe){v=!1,cancelAnimationFrame(d);return}const[J,ae]=p0(b,S,D);(J!==0||ae!==0)&&(c.x=(c.x??0)-J/ue[2],c.y=(c.y??0)-ae/ue[2],await ve({x:J,y:ae})&&Q(c)),d=requestAnimationFrame(pe)}function ke(ue){var _e;const{nodeLookup:ve,multiSelectionActive:D,nodesDraggable:fe,transform:J,snapGrid:ae,snapToGrid:B,selectNodesOnDrag:q,onNodeDragStart:Z,onSelectionDragStart:A,unselectNodesAndEdges:U}=r();x=!0,(!q||!V)&&!D&&K&&((_e=ve.get(K))!=null&&_e.selected||U()),V&&q&&K&&(t==null||t(K));const de=ka(ue.sourceEvent,{transform:J,snapGrid:ae,snapToGrid:B,containerBounds:S});if(c=de,h=pb(ve,fe,de,K),h.size>0&&(i||Z||!K&&A)){const[Te,Oe]=uf({nodeId:K,dragItems:h,nodeLookup:ve});i==null||i(ue.sourceEvent,h,Te,Oe),Z==null||Z(ue.sourceEvent,Te,Oe),K||A==null||A(ue.sourceEvent,Oe)}}const X=Um().clickDistance(W).on("start",ue=>{const{domNode:ve,nodeDragThreshold:D,transform:fe,snapGrid:J,snapToGrid:ae}=r();S=(ve==null?void 0:ve.getBoundingClientRect())||null,C=!1,j=!1,M=ue.sourceEvent,D===0&&ke(ue),c=ka(ue.sourceEvent,{transform:fe,snapGrid:J,snapToGrid:ae,containerBounds:S}),b=Ur(ue.sourceEvent,S)}).on("drag",ue=>{const{autoPanOnNodeDrag:ve,transform:D,snapGrid:fe,snapToGrid:J,nodeDragThreshold:ae,nodeLookup:B}=r(),q=ka(ue.sourceEvent,{transform:D,snapGrid:fe,snapToGrid:J,containerBounds:S});if(M=ue.sourceEvent,(ue.sourceEvent.type==="touchmove"&&ue.sourceEvent.touches.length>1||K&&!B.has(K))&&(C=!0),!C){if(!v&&ve&&x&&(v=!0,pe()),!x){const Z=Ur(ue.sourceEvent,S),A=Z.x-b.x,U=Z.y-b.y;Math.sqrt(A*A+U*U)>ae&&ke(ue)}(c.x!==q.xSnapped||c.y!==q.ySnapped)&&h&&x&&(b=Ur(ue.sourceEvent,S),Q(q))}}).on("end",ue=>{if(!(!x||C)&&(v=!1,x=!1,cancelAnimationFrame(d),h.size>0)){const{nodeLookup:ve,updateNodePositions:D,onNodeDragStop:fe,onSelectionDragStop:J}=r();if(j&&(D(h,!1),j=!1),l||fe||!K&&J){const[ae,B]=uf({nodeId:K,dragItems:h,nodeLookup:ve,dragging:!1});l==null||l(ue.sourceEvent,h,ae,B),fe==null||fe(ue.sourceEvent,ae,B),K||J==null||J(ue.sourceEvent,B)}}}).filter(ue=>{const ve=ue.target;return!ue.button&&(!F||!Fh(ve,`.${F}`,R))&&(!$||Fh(ve,$,R))});_.call(X)}function P(){_==null||_.on(".drag",null)}return{update:T,destroy:P}}function gb(t,r,i){const s=[],l={x:t.x-i,y:t.y-i,width:i*2,height:i*2};for(const c of r.values())Ia(l,As(c))>0&&s.push(c);return s}const yb=250;function vb(t,r,i,s){var h,v;let l=[],c=1/0;const d=gb(t,i,r+yb);for(const b of d){const S=[...((h=b.internals.handleBounds)==null?void 0:h.source)??[],...((v=b.internals.handleBounds)==null?void 0:v.target)??[]];for(const x of S){if(s.nodeId===x.nodeId&&s.type===x.type&&s.id===x.id)continue;const{x:_,y:C}=Vi(b,x,x.position,!0),j=Math.sqrt(Math.pow(_-t.x,2)+Math.pow(C-t.y,2));j>r||(j<c?(l=[{...x,x:_,y:C}],c=j):j===c&&l.push({...x,x:_,y:C}))}}if(!l.length)return null;if(l.length>1){const b=s.type==="source"?"target":"source";return l.find(S=>S.type===b)??l[0]}return l[0]}function P0(t,r,i,s,l,c=!1){var b,S,x;const d=s.get(t);if(!d)return null;const h=l==="strict"?(b=d.internals.handleBounds)==null?void 0:b[r]:[...((S=d.internals.handleBounds)==null?void 0:S.source)??[],...((x=d.internals.handleBounds)==null?void 0:x.target)??[]],v=(i?h==null?void 0:h.find(_=>_.id===i):h==null?void 0:h[0])??null;return v&&c?{...v,...Vi(d,v,v.position,!0)}:v}function $0(t,r){return t||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function xb(t,r){let i=null;return r?i=!0:t&&!r&&(i=!1),i}const M0=()=>!0;function wb(t,{connectionMode:r,connectionRadius:i,handleId:s,nodeId:l,edgeUpdaterType:c,isTarget:d,domNode:h,nodeLookup:v,lib:b,autoPanOnConnect:S,flowId:x,panBy:_,cancelConnection:C,onConnectStart:j,onConnect:M,onConnectEnd:T,isValidConnection:P=M0,onReconnectEnd:F,updateConnection:$,getTransform:R,getFromHandle:V,autoPanSpeed:K,dragThreshold:W=1,handleDomNode:Q}){const pe=y0(t.target);let ke=0,X;const{x:ue,y:ve}=Ur(t),D=$0(c,Q),fe=h==null?void 0:h.getBoundingClientRect();let J=!1;if(!fe||!D)return;const ae=P0(l,D,s,v,r);if(!ae)return;let B=Ur(t,fe),q=!1,Z=null,A=!1,U=null;function de(){if(!S||!fe)return;const[Ze,Be]=p0(B,fe,K);_({x:Ze,y:Be}),ke=requestAnimationFrame(de)}const _e={...ae,nodeId:l,type:D,position:ae.position},Te=v.get(l);let Re={inProgress:!0,isValid:null,from:Vi(Te,_e,tt.Left,!0),fromHandle:_e,fromPosition:_e.position,fromNode:Te,to:B,toHandle:null,toPosition:jh[_e.position],toNode:null,pointer:B};function Se(){J=!0,$(Re),j==null||j(t,{nodeId:l,handleId:s,handleType:D})}W===0&&Se();function De(Ze){if(!J){const{x:St,y:gn}=Ur(Ze),Xt=St-ue,Qt=gn-ve;if(!(Xt*Xt+Qt*Qt>W*W))return;Se()}if(!V()||!_e){Ne(Ze);return}const Be=R();B=Ur(Ze,fe),X=vb(Ba(B,Be,!1,[1,1]),i,v,_e),q||(de(),q=!0);const Ue=I0(Ze,{handle:X,connectionMode:r,fromNodeId:l,fromHandleId:s,fromType:d?"target":"source",isValidConnection:P,doc:pe,lib:b,flowId:x,nodeLookup:v});U=Ue.handleDomNode,Z=Ue.connection,A=xb(!!X,Ue.isValid);const qe=v.get(l),nt=qe?Vi(qe,_e,tt.Left,!0):Re.from,ct={...Re,from:nt,isValid:A,to:Ue.toHandle&&A?wu({x:Ue.toHandle.x,y:Ue.toHandle.y},Be):B,toHandle:Ue.toHandle,toPosition:A&&Ue.toHandle?Ue.toHandle.position:jh[_e.position],toNode:Ue.toHandle?v.get(Ue.toHandle.nodeId):null,pointer:B};$(ct),Re=ct}function Ne(Ze){if(!("touches"in Ze&&Ze.touches.length>0)){if(J){(X||U)&&Z&&A&&(M==null||M(Z));const{inProgress:Be,...Ue}=Re,qe={...Ue,toPosition:Re.toHandle?Re.toPosition:null};T==null||T(Ze,qe),c&&(F==null||F(Ze,qe))}C(),cancelAnimationFrame(ke),q=!1,A=!1,Z=null,U=null,pe.removeEventListener("mousemove",De),pe.removeEventListener("mouseup",Ne),pe.removeEventListener("touchmove",De),pe.removeEventListener("touchend",Ne)}}pe.addEventListener("mousemove",De),pe.addEventListener("mouseup",Ne),pe.addEventListener("touchmove",De),pe.addEventListener("touchend",Ne)}function I0(t,{handle:r,connectionMode:i,fromNodeId:s,fromHandleId:l,fromType:c,doc:d,lib:h,flowId:v,isValidConnection:b=M0,nodeLookup:S}){const x=c==="target",_=r?d.querySelector(`.${h}-flow__handle[data-id="${v}-${r==null?void 0:r.nodeId}-${r==null?void 0:r.id}-${r==null?void 0:r.type}"]`):null,{x:C,y:j}=Ur(t),M=d.elementFromPoint(C,j),T=M!=null&&M.classList.contains(`${h}-flow__handle`)?M:_,P={handleDomNode:T,isValid:!1,connection:null,toHandle:null};if(T){const F=$0(void 0,T),$=T.getAttribute("data-nodeid"),R=T.getAttribute("data-handleid"),V=T.classList.contains("connectable"),K=T.classList.contains("connectableend");if(!$||!F)return P;const W={source:x?$:s,sourceHandle:x?R:l,target:x?s:$,targetHandle:x?l:R};P.connection=W;const pe=V&&K&&(i===Is.Strict?x&&F==="source"||!x&&F==="target":$!==s||R!==l);P.isValid=pe&&b(W),P.toHandle=P0($,F,R,S,i,!0)}return P}const Lf={onPointerDown:wb,isValid:I0};function bb({domNode:t,panZoom:r,getTransform:i,getViewScale:s}){const l=ur(t);function c({translateExtent:h,width:v,height:b,zoomStep:S=1,pannable:x=!0,zoomable:_=!0,inversePan:C=!1}){const j=$=>{if($.sourceEvent.type!=="wheel"||!r)return;const R=i(),V=$.sourceEvent.ctrlKey&&Ta()?10:1,K=-$.sourceEvent.deltaY*($.sourceEvent.deltaMode===1?.05:$.sourceEvent.deltaMode?1:.002)*S,W=R[2]*Math.pow(2,K*V);r.scaleTo(W)};let M=[0,0];const T=$=>{($.sourceEvent.type==="mousedown"||$.sourceEvent.type==="touchstart")&&(M=[$.sourceEvent.clientX??$.sourceEvent.touches[0].clientX,$.sourceEvent.clientY??$.sourceEvent.touches[0].clientY])},P=$=>{const R=i();if($.sourceEvent.type!=="mousemove"&&$.sourceEvent.type!=="touchmove"||!r)return;const V=[$.sourceEvent.clientX??$.sourceEvent.touches[0].clientX,$.sourceEvent.clientY??$.sourceEvent.touches[0].clientY],K=[V[0]-M[0],V[1]-M[1]];M=V;const W=s()*Math.max(R[2],Math.log(R[2]))*(C?-1:1),Q={x:R[0]-K[0]*W,y:R[1]-K[1]*W},pe=[[0,0],[v,b]];r.setViewportConstrained({x:Q.x,y:Q.y,zoom:R[2]},pe,h)},F=i0().on("start",T).on("zoom",x?P:null).on("zoom.wheel",_?j:null);l.call(F,{})}function d(){l.on("zoom",null)}return{update:c,destroy:d,pointer:Br}}const Tu=t=>({x:t.x,y:t.y,zoom:t.k}),cf=({x:t,y:r,zoom:i})=>$u.translate(t,r).scale(i),Ns=(t,r)=>t.target.closest(`.${r}`),T0=(t,r)=>r===2&&Array.isArray(t)&&t.includes(2),_b=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,ff=(t,r=0,i=_b,s=()=>{})=>{const l=typeof r=="number"&&r>0;return l||s(),l?t.transition().duration(r).ease(i).on("end",s):t},A0=t=>{const r=t.ctrlKey&&Ta()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*r};function Sb({zoomPanValues:t,noWheelClassName:r,d3Selection:i,d3Zoom:s,panOnScrollMode:l,panOnScrollSpeed:c,zoomOnPinch:d,onPanZoomStart:h,onPanZoom:v,onPanZoomEnd:b}){return S=>{if(Ns(S,r))return S.ctrlKey&&S.preventDefault(),!1;S.preventDefault(),S.stopImmediatePropagation();const x=i.property("__zoom").k||1;if(S.ctrlKey&&d){const T=Br(S),P=A0(S),F=x*Math.pow(2,P);s.scaleTo(i,F,T,S);return}const _=S.deltaMode===1?20:1;let C=l===zi.Vertical?0:S.deltaX*_,j=l===zi.Horizontal?0:S.deltaY*_;!Ta()&&S.shiftKey&&l!==zi.Vertical&&(C=S.deltaY*_,j=0),s.translateBy(i,-(C/x)*c,-(j/x)*c,{internal:!0});const M=Tu(i.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(v==null||v(S,M),t.panScrollTimeout=setTimeout(()=>{b==null||b(S,M),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,h==null||h(S,M))}}function kb({noWheelClassName:t,preventScrolling:r,d3ZoomHandler:i}){return function(s,l){const c=s.type==="wheel",d=!r&&c&&!s.ctrlKey,h=Ns(s,t);if(s.ctrlKey&&c&&h&&s.preventDefault(),d||h)return null;s.preventDefault(),i.call(this,s,l)}}function Nb({zoomPanValues:t,onDraggingChange:r,onPanZoomStart:i}){return s=>{var c,d,h;if((c=s.sourceEvent)!=null&&c.internal)return;const l=Tu(s.transform);t.mouseButton=((d=s.sourceEvent)==null?void 0:d.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=l,((h=s.sourceEvent)==null?void 0:h.type)==="mousedown"&&r(!0),i&&(i==null||i(s.sourceEvent,l))}}function Eb({zoomPanValues:t,panOnDrag:r,onPaneContextMenu:i,onTransformChange:s,onPanZoom:l}){return c=>{var d,h;t.usedRightMouseButton=!!(i&&T0(r,t.mouseButton??0)),(d=c.sourceEvent)!=null&&d.sync||s([c.transform.x,c.transform.y,c.transform.k]),l&&!((h=c.sourceEvent)!=null&&h.internal)&&(l==null||l(c.sourceEvent,Tu(c.transform)))}}function Cb({zoomPanValues:t,panOnDrag:r,panOnScroll:i,onDraggingChange:s,onPanZoomEnd:l,onPaneContextMenu:c}){return d=>{var h;if(!((h=d.sourceEvent)!=null&&h.internal)&&(t.isZoomingOrPanning=!1,c&&T0(r,t.mouseButton??0)&&!t.usedRightMouseButton&&d.sourceEvent&&c(d.sourceEvent),t.usedRightMouseButton=!1,s(!1),l)){const v=Tu(d.transform);t.prevViewport=v,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{l==null||l(d.sourceEvent,v)},i?150:0)}}}function jb({zoomActivationKeyPressed:t,zoomOnScroll:r,zoomOnPinch:i,panOnDrag:s,panOnScroll:l,zoomOnDoubleClick:c,userSelectionActive:d,noWheelClassName:h,noPanClassName:v,lib:b,connectionInProgress:S}){return x=>{var T;const _=t||r,C=i&&x.ctrlKey,j=x.type==="wheel";if(x.button===1&&x.type==="mousedown"&&(Ns(x,`${b}-flow__node`)||Ns(x,`${b}-flow__edge`)))return!0;if(!s&&!_&&!l&&!c&&!i||d||S&&!j||Ns(x,h)&&j||Ns(x,v)&&(!j||l&&j&&!t)||!i&&x.ctrlKey&&j)return!1;if(!i&&x.type==="touchstart"&&((T=x.touches)==null?void 0:T.length)>1)return x.preventDefault(),!1;if(!_&&!l&&!C&&j||!s&&(x.type==="mousedown"||x.type==="touchstart")||Array.isArray(s)&&!s.includes(x.button)&&x.type==="mousedown")return!1;const M=Array.isArray(s)&&s.includes(x.button)||!x.button||x.button<=1;return(!x.ctrlKey||j)&&M}}function Pb({domNode:t,minZoom:r,maxZoom:i,translateExtent:s,viewport:l,onPanZoom:c,onPanZoomStart:d,onPanZoomEnd:h,onDraggingChange:v}){const b={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},S=t.getBoundingClientRect(),x=i0().scaleExtent([r,i]).translateExtent(s),_=ur(t).call(x);F({x:l.x,y:l.y,zoom:Ts(l.zoom,r,i)},[[0,0],[S.width,S.height]],s);const C=_.on("wheel.zoom"),j=_.on("dblclick.zoom");x.wheelDelta(A0);function M(X,ue){return _?new Promise(ve=>{x==null||x.interpolate((ue==null?void 0:ue.interpolate)==="linear"?Sa:iu).transform(ff(_,ue==null?void 0:ue.duration,ue==null?void 0:ue.ease,()=>ve(!0)),X)}):Promise.resolve(!1)}function T({noWheelClassName:X,noPanClassName:ue,onPaneContextMenu:ve,userSelectionActive:D,panOnScroll:fe,panOnDrag:J,panOnScrollMode:ae,panOnScrollSpeed:B,preventScrolling:q,zoomOnPinch:Z,zoomOnScroll:A,zoomOnDoubleClick:U,zoomActivationKeyPressed:de,lib:_e,onTransformChange:Te,connectionInProgress:Oe,paneClickDistance:Re,selectionOnDrag:Se}){D&&!b.isZoomingOrPanning&&P();const De=fe&&!de&&!D;x.clickDistance(Se?1/0:!Vr(Re)||Re<0?0:Re);const Ne=De?Sb({zoomPanValues:b,noWheelClassName:X,d3Selection:_,d3Zoom:x,panOnScrollMode:ae,panOnScrollSpeed:B,zoomOnPinch:Z,onPanZoomStart:d,onPanZoom:c,onPanZoomEnd:h}):kb({noWheelClassName:X,preventScrolling:q,d3ZoomHandler:C});if(_.on("wheel.zoom",Ne,{passive:!1}),!D){const Be=Nb({zoomPanValues:b,onDraggingChange:v,onPanZoomStart:d});x.on("start",Be);const Ue=Eb({zoomPanValues:b,panOnDrag:J,onPaneContextMenu:!!ve,onPanZoom:c,onTransformChange:Te});x.on("zoom",Ue);const qe=Cb({zoomPanValues:b,panOnDrag:J,panOnScroll:fe,onPaneContextMenu:ve,onPanZoomEnd:h,onDraggingChange:v});x.on("end",qe)}const Ze=jb({zoomActivationKeyPressed:de,panOnDrag:J,zoomOnScroll:A,panOnScroll:fe,zoomOnDoubleClick:U,zoomOnPinch:Z,userSelectionActive:D,noPanClassName:ue,noWheelClassName:X,lib:_e,connectionInProgress:Oe});x.filter(Ze),U?_.on("dblclick.zoom",j):_.on("dblclick.zoom",null)}function P(){x.on("zoom",null)}async function F(X,ue,ve){const D=cf(X),fe=x==null?void 0:x.constrain()(D,ue,ve);return fe&&await M(fe),new Promise(J=>J(fe))}async function $(X,ue){const ve=cf(X);return await M(ve,ue),new Promise(D=>D(ve))}function R(X){if(_){const ue=cf(X),ve=_.property("__zoom");(ve.k!==X.zoom||ve.x!==X.x||ve.y!==X.y)&&(x==null||x.transform(_,ue,null,{sync:!0}))}}function V(){const X=_?o0(_.node()):{x:0,y:0,k:1};return{x:X.x,y:X.y,zoom:X.k}}function K(X,ue){return _?new Promise(ve=>{x==null||x.interpolate((ue==null?void 0:ue.interpolate)==="linear"?Sa:iu).scaleTo(ff(_,ue==null?void 0:ue.duration,ue==null?void 0:ue.ease,()=>ve(!0)),X)}):Promise.resolve(!1)}function W(X,ue){return _?new Promise(ve=>{x==null||x.interpolate((ue==null?void 0:ue.interpolate)==="linear"?Sa:iu).scaleBy(ff(_,ue==null?void 0:ue.duration,ue==null?void 0:ue.ease,()=>ve(!0)),X)}):Promise.resolve(!1)}function Q(X){x==null||x.scaleExtent(X)}function pe(X){x==null||x.translateExtent(X)}function ke(X){const ue=!Vr(X)||X<0?0:X;x==null||x.clickDistance(ue)}return{update:T,destroy:P,setViewport:$,setViewportConstrained:F,getViewport:V,scaleTo:K,scaleBy:W,setScaleExtent:Q,setTranslateExtent:pe,syncViewport:R,setClickDistance:ke}}var Rs;(function(t){t.Line="line",t.Handle="handle"})(Rs||(Rs={}));function $b({width:t,prevWidth:r,height:i,prevHeight:s,affectsX:l,affectsY:c}){const d=t-r,h=i-s,v=[d>0?1:d<0?-1:0,h>0?1:h<0?-1:0];return d&&l&&(v[0]=v[0]*-1),h&&c&&(v[1]=v[1]*-1),v}function Bh(t){const r=t.includes("right")||t.includes("left"),i=t.includes("bottom")||t.includes("top"),s=t.includes("left"),l=t.includes("top");return{isHorizontal:r,isVertical:i,affectsX:s,affectsY:l}}function fi(t,r){return Math.max(0,r-t)}function di(t,r){return Math.max(0,t-r)}function Jl(t,r,i){return Math.max(0,r-t,t-i)}function Hh(t,r){return t?!r:r}function Mb(t,r,i,s,l,c,d,h){let{affectsX:v,affectsY:b}=r;const{isHorizontal:S,isVertical:x}=r,_=S&&x,{xSnapped:C,ySnapped:j}=i,{minWidth:M,maxWidth:T,minHeight:P,maxHeight:F}=s,{x:$,y:R,width:V,height:K,aspectRatio:W}=t;let Q=Math.floor(S?C-t.pointerX:0),pe=Math.floor(x?j-t.pointerY:0);const ke=V+(v?-Q:Q),X=K+(b?-pe:pe),ue=-c[0]*V,ve=-c[1]*K;let D=Jl(ke,M,T),fe=Jl(X,P,F);if(d){let B=0,q=0;v&&Q<0?B=fi($+Q+ue,d[0][0]):!v&&Q>0&&(B=di($+ke+ue,d[1][0])),b&&pe<0?q=fi(R+pe+ve,d[0][1]):!b&&pe>0&&(q=di(R+X+ve,d[1][1])),D=Math.max(D,B),fe=Math.max(fe,q)}if(h){let B=0,q=0;v&&Q>0?B=di($+Q,h[0][0]):!v&&Q<0&&(B=fi($+ke,h[1][0])),b&&pe>0?q=di(R+pe,h[0][1]):!b&&pe<0&&(q=fi(R+X,h[1][1])),D=Math.max(D,B),fe=Math.max(fe,q)}if(l){if(S){const B=Jl(ke/W,P,F)*W;if(D=Math.max(D,B),d){let q=0;!v&&!b||v&&!b&&_?q=di(R+ve+ke/W,d[1][1])*W:q=fi(R+ve+(v?Q:-Q)/W,d[0][1])*W,D=Math.max(D,q)}if(h){let q=0;!v&&!b||v&&!b&&_?q=fi(R+ke/W,h[1][1])*W:q=di(R+(v?Q:-Q)/W,h[0][1])*W,D=Math.max(D,q)}}if(x){const B=Jl(X*W,M,T)/W;if(fe=Math.max(fe,B),d){let q=0;!v&&!b||b&&!v&&_?q=di($+X*W+ue,d[1][0])/W:q=fi($+(b?pe:-pe)*W+ue,d[0][0])/W,fe=Math.max(fe,q)}if(h){let q=0;!v&&!b||b&&!v&&_?q=fi($+X*W,h[1][0])/W:q=di($+(b?pe:-pe)*W,h[0][0])/W,fe=Math.max(fe,q)}}}pe=pe+(pe<0?fe:-fe),Q=Q+(Q<0?D:-D),l&&(_?ke>X*W?pe=(Hh(v,b)?-Q:Q)/W:Q=(Hh(v,b)?-pe:pe)*W:S?(pe=Q/W,b=v):(Q=pe*W,v=b));const J=v?$+Q:$,ae=b?R+pe:R;return{width:V+(v?-Q:Q),height:K+(b?-pe:pe),x:c[0]*Q*(v?-1:1)+J,y:c[1]*pe*(b?-1:1)+ae}}const O0={width:0,height:0,x:0,y:0},Ib={...O0,pointerX:0,pointerY:0,aspectRatio:1};function Tb(t){return[[0,0],[t.measured.width,t.measured.height]]}function Ab(t,r,i){const s=r.position.x+t.position.x,l=r.position.y+t.position.y,c=t.measured.width??0,d=t.measured.height??0,h=i[0]*c,v=i[1]*d;return[[s-h,l-v],[s+c-h,l+d-v]]}function Ob({domNode:t,nodeId:r,getStoreItems:i,onChange:s,onEnd:l}){const c=ur(t);let d={controlDirection:Bh("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function h({controlPosition:b,boundaries:S,keepAspectRatio:x,resizeDirection:_,onResizeStart:C,onResize:j,onResizeEnd:M,shouldResize:T}){let P={...O0},F={...Ib};d={boundaries:S,resizeDirection:_,keepAspectRatio:x,controlDirection:Bh(b)};let $,R=null,V=[],K,W,Q,pe=!1;const ke=Um().on("start",X=>{const{nodeLookup:ue,transform:ve,snapGrid:D,snapToGrid:fe,nodeOrigin:J,paneDomNode:ae}=i();if($=ue.get(r),!$)return;R=(ae==null?void 0:ae.getBoundingClientRect())??null;const{xSnapped:B,ySnapped:q}=ka(X.sourceEvent,{transform:ve,snapGrid:D,snapToGrid:fe,containerBounds:R});P={width:$.measured.width??0,height:$.measured.height??0,x:$.position.x??0,y:$.position.y??0},F={...P,pointerX:B,pointerY:q,aspectRatio:P.width/P.height},K=void 0,$.parentId&&($.extent==="parent"||$.expandParent)&&(K=ue.get($.parentId),W=K&&$.extent==="parent"?Tb(K):void 0),V=[],Q=void 0;for(const[Z,A]of ue)if(A.parentId===r&&(V.push({id:Z,position:{...A.position},extent:A.extent}),A.extent==="parent"||A.expandParent)){const U=Ab(A,$,A.origin??J);Q?Q=[[Math.min(U[0][0],Q[0][0]),Math.min(U[0][1],Q[0][1])],[Math.max(U[1][0],Q[1][0]),Math.max(U[1][1],Q[1][1])]]:Q=U}C==null||C(X,{...P})}).on("drag",X=>{const{transform:ue,snapGrid:ve,snapToGrid:D,nodeOrigin:fe}=i(),J=ka(X.sourceEvent,{transform:ue,snapGrid:ve,snapToGrid:D,containerBounds:R}),ae=[];if(!$)return;const{x:B,y:q,width:Z,height:A}=P,U={},de=$.origin??fe,{width:_e,height:Te,x:Oe,y:Re}=Mb(F,d.controlDirection,J,d.boundaries,d.keepAspectRatio,de,W,Q),Se=_e!==Z,De=Te!==A,Ne=Oe!==B&&Se,Ze=Re!==q&&De;if(!Ne&&!Ze&&!Se&&!De)return;if((Ne||Ze||de[0]===1||de[1]===1)&&(U.x=Ne?Oe:P.x,U.y=Ze?Re:P.y,P.x=U.x,P.y=U.y,V.length>0)){const nt=Oe-B,ct=Re-q;for(const St of V)St.position={x:St.position.x-nt+de[0]*(_e-Z),y:St.position.y-ct+de[1]*(Te-A)},ae.push(St)}if((Se||De)&&(U.width=Se&&(!d.resizeDirection||d.resizeDirection==="horizontal")?_e:P.width,U.height=De&&(!d.resizeDirection||d.resizeDirection==="vertical")?Te:P.height,P.width=U.width,P.height=U.height),K&&$.expandParent){const nt=de[0]*(U.width??0);U.x&&U.x<nt&&(P.x=nt,F.x=F.x-(U.x-nt));const ct=de[1]*(U.height??0);U.y&&U.y<ct&&(P.y=ct,F.y=F.y-(U.y-ct))}const Be=$b({width:P.width,prevWidth:Z,height:P.height,prevHeight:A,affectsX:d.controlDirection.affectsX,affectsY:d.controlDirection.affectsY}),Ue={...P,direction:Be};(T==null?void 0:T(X,Ue))!==!1&&(pe=!0,j==null||j(X,Ue),s(U,ae))}).on("end",X=>{pe&&(M==null||M(X,{...P}),l==null||l({...P}),pe=!1)});c.call(ke)}function v(){c.on(".drag",null)}return{update:h,destroy:v}}var df={exports:{}},pf={},hf={exports:{}},mf={};/**
|
|
181
|
+
* @license React
|
|
182
|
+
* use-sync-external-store-shim.production.js
|
|
183
|
+
*
|
|
184
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
185
|
+
*
|
|
186
|
+
* This source code is licensed under the MIT license found in the
|
|
187
|
+
* LICENSE file in the root directory of this source tree.
|
|
188
|
+
*/var Vh;function Rb(){if(Vh)return mf;Vh=1;var t=Oa();function r(x,_){return x===_&&(x!==0||1/x===1/_)||x!==x&&_!==_}var i=typeof Object.is=="function"?Object.is:r,s=t.useState,l=t.useEffect,c=t.useLayoutEffect,d=t.useDebugValue;function h(x,_){var C=_(),j=s({inst:{value:C,getSnapshot:_}}),M=j[0].inst,T=j[1];return c(function(){M.value=C,M.getSnapshot=_,v(M)&&T({inst:M})},[x,C,_]),l(function(){return v(M)&&T({inst:M}),x(function(){v(M)&&T({inst:M})})},[x]),d(C),C}function v(x){var _=x.getSnapshot;x=x.value;try{var C=_();return!i(x,C)}catch{return!0}}function b(x,_){return _()}var S=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?b:h;return mf.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:S,mf}var Uh;function Lb(){return Uh||(Uh=1,hf.exports=Rb()),hf.exports}/**
|
|
189
|
+
* @license React
|
|
190
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
191
|
+
*
|
|
192
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
193
|
+
*
|
|
194
|
+
* This source code is licensed under the MIT license found in the
|
|
195
|
+
* LICENSE file in the root directory of this source tree.
|
|
196
|
+
*/var Kh;function Db(){if(Kh)return pf;Kh=1;var t=Oa(),r=Lb();function i(b,S){return b===S&&(b!==0||1/b===1/S)||b!==b&&S!==S}var s=typeof Object.is=="function"?Object.is:i,l=r.useSyncExternalStore,c=t.useRef,d=t.useEffect,h=t.useMemo,v=t.useDebugValue;return pf.useSyncExternalStoreWithSelector=function(b,S,x,_,C){var j=c(null);if(j.current===null){var M={hasValue:!1,value:null};j.current=M}else M=j.current;j=h(function(){function P(K){if(!F){if(F=!0,$=K,K=_(K),C!==void 0&&M.hasValue){var W=M.value;if(C(W,K))return R=W}return R=K}if(W=R,s($,K))return W;var Q=_(K);return C!==void 0&&C(W,Q)?($=K,W):($=K,R=Q)}var F=!1,$,R,V=x===void 0?null:x;return[function(){return P(S())},V===null?void 0:function(){return P(V())}]},[S,x,_,C]);var T=l(b,j[0],j[1]);return d(function(){M.hasValue=!0,M.value=T},[T]),v(T),T},pf}var qh;function zb(){return qh||(qh=1,df.exports=Db()),df.exports}var Fb=zb();const Bb=_u(Fb),Hb={},Wh=t=>{let r;const i=new Set,s=(S,x)=>{const _=typeof S=="function"?S(r):S;if(!Object.is(_,r)){const C=r;r=x??(typeof _!="object"||_===null)?_:Object.assign({},r,_),i.forEach(j=>j(r,C))}},l=()=>r,v={setState:s,getState:l,getInitialState:()=>b,subscribe:S=>(i.add(S),()=>i.delete(S)),destroy:()=>{(Hb?"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."),i.clear()}},b=r=t(s,l,v);return v},Vb=t=>t?Wh(t):Wh,{useDebugValue:Ub}=Sm,{useSyncExternalStoreWithSelector:Kb}=Bb,qb=t=>t;function R0(t,r=qb,i){const s=Kb(t.subscribe,t.getState,t.getServerState||t.getInitialState,r,i);return Ub(s),s}const Yh=(t,r)=>{const i=Vb(t),s=(l,c=r)=>R0(i,l,c);return Object.assign(s,i),s},Wb=(t,r)=>t?Yh(t,r):Yh;function Rt(t,r){if(Object.is(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(const[s,l]of t)if(!Object.is(l,r.get(s)))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(const s of t)if(!r.has(s))return!1;return!0}const i=Object.keys(t);if(i.length!==Object.keys(r).length)return!1;for(const s of i)if(!Object.prototype.hasOwnProperty.call(r,s)||!Object.is(t[s],r[s]))return!1;return!0}km();const Au=H.createContext(null),Yb=Au.Provider,L0=io.error001();function vt(t,r){const i=H.useContext(Au);if(i===null)throw new Error(L0);return R0(i,t,r)}function Mt(){const t=H.useContext(Au);if(t===null)throw new Error(L0);return H.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const Xh={display:"none"},Xb={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},D0="react-flow__node-desc",z0="react-flow__edge-desc",Qb="react-flow__aria-live",Gb=t=>t.ariaLiveMessage,Jb=t=>t.ariaLabelConfig;function Zb({rfId:t}){const r=vt(Gb);return g.jsx("div",{id:`${Qb}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:Xb,children:r})}function e_({rfId:t,disableKeyboardA11y:r}){const i=vt(Jb);return g.jsxs(g.Fragment,{children:[g.jsx("div",{id:`${D0}-${t}`,style:Xh,children:r?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),g.jsx("div",{id:`${z0}-${t}`,style:Xh,children:i["edge.a11yDescription.default"]}),!r&&g.jsx(Zb,{rfId:t})]})}const Ha=H.forwardRef(({position:t="top-left",children:r,className:i,style:s,...l},c)=>{const d=`${t}`.split("-");return g.jsx("div",{className:tn(["react-flow__panel",i,...d]),style:s,ref:c,...l,children:r})});Ha.displayName="Panel";function t_({proOptions:t,position:r="bottom-right"}){return t!=null&&t.hideAttribution?null:g.jsx(Ha,{position:r,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:g.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const n_=t=>{const r=[],i=[];for(const[,s]of t.nodeLookup)s.selected&&r.push(s.internals.userNode);for(const[,s]of t.edgeLookup)s.selected&&i.push(s);return{selectedNodes:r,selectedEdges:i}},Zl=t=>t.id;function r_(t,r){return Rt(t.selectedNodes.map(Zl),r.selectedNodes.map(Zl))&&Rt(t.selectedEdges.map(Zl),r.selectedEdges.map(Zl))}function o_({onSelectionChange:t}){const r=Mt(),{selectedNodes:i,selectedEdges:s}=vt(n_,r_);return H.useEffect(()=>{const l={nodes:i,edges:s};t==null||t(l),r.getState().onSelectionChangeHandlers.forEach(c=>c(l))},[i,s,t]),null}const i_=t=>!!t.onSelectionChangeHandlers;function s_({onSelectionChange:t}){const r=vt(i_);return t||r?g.jsx(o_,{onSelectionChange:t}):null}const Df=typeof window<"u"?H.useLayoutEffect:H.useEffect,F0=[0,0],a_={x:0,y:0,zoom:1},l_=["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"],Qh=[...l_,"rfId"],u_=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),Gh={translateExtent:$a,nodeOrigin:F0,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function c_(t){const{setNodes:r,setEdges:i,setMinZoom:s,setMaxZoom:l,setTranslateExtent:c,setNodeExtent:d,reset:h,setDefaultNodesAndEdges:v}=vt(u_,Rt),b=Mt();Df(()=>(v(t.defaultNodes,t.defaultEdges),()=>{S.current=Gh,h()}),[]);const S=H.useRef(Gh);return Df(()=>{for(const x of Qh){const _=t[x],C=S.current[x];_!==C&&(typeof t[x]>"u"||(x==="nodes"?r(_):x==="edges"?i(_):x==="minZoom"?s(_):x==="maxZoom"?l(_):x==="translateExtent"?c(_):x==="nodeExtent"?d(_):x==="ariaLabelConfig"?b.setState({ariaLabelConfig:Y1(_)}):x==="fitView"?b.setState({fitViewQueued:_}):x==="fitViewOptions"?b.setState({fitViewOptions:_}):b.setState({[x]:_})))}S.current=t},Qh.map(x=>t[x])),null}function Jh(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function f_(t){var s;const[r,i]=H.useState(t==="system"?null:t);return H.useEffect(()=>{if(t!=="system"){i(t);return}const l=Jh(),c=()=>i(l!=null&&l.matches?"dark":"light");return c(),l==null||l.addEventListener("change",c),()=>{l==null||l.removeEventListener("change",c)}},[t]),r!==null?r:(s=Jh())!=null&&s.matches?"dark":"light"}const Zh=typeof document<"u"?document:null;function Aa(t=null,r={target:Zh,actInsideInputWithModifier:!0}){const[i,s]=H.useState(!1),l=H.useRef(!1),c=H.useRef(new Set([])),[d,h]=H.useMemo(()=>{if(t!==null){const b=(Array.isArray(t)?t:[t]).filter(x=>typeof x=="string").map(x=>x.replace("+",`
|
|
197
|
+
`).replace(`
|
|
198
|
+
|
|
199
|
+
`,`
|
|
200
|
+
+`).split(`
|
|
201
|
+
`)),S=b.reduce((x,_)=>x.concat(..._),[]);return[b,S]}return[[],[]]},[t]);return H.useEffect(()=>{const v=(r==null?void 0:r.target)??Zh,b=(r==null?void 0:r.actInsideInputWithModifier)??!0;if(t!==null){const S=C=>{var T,P;if(l.current=C.ctrlKey||C.metaKey||C.shiftKey||C.altKey,(!l.current||l.current&&!b)&&v0(C))return!1;const M=tm(C.code,h);if(c.current.add(C[M]),em(d,c.current,!1)){const F=((P=(T=C.composedPath)==null?void 0:T.call(C))==null?void 0:P[0])||C.target,$=(F==null?void 0:F.nodeName)==="BUTTON"||(F==null?void 0:F.nodeName)==="A";r.preventDefault!==!1&&(l.current||!$)&&C.preventDefault(),s(!0)}},x=C=>{const j=tm(C.code,h);em(d,c.current,!0)?(s(!1),c.current.clear()):c.current.delete(C[j]),C.key==="Meta"&&c.current.clear(),l.current=!1},_=()=>{c.current.clear(),s(!1)};return v==null||v.addEventListener("keydown",S),v==null||v.addEventListener("keyup",x),window.addEventListener("blur",_),window.addEventListener("contextmenu",_),()=>{v==null||v.removeEventListener("keydown",S),v==null||v.removeEventListener("keyup",x),window.removeEventListener("blur",_),window.removeEventListener("contextmenu",_)}}},[t,s]),i}function em(t,r,i){return t.filter(s=>i||s.length===r.size).some(s=>s.every(l=>r.has(l)))}function tm(t,r){return r.includes(t)?"code":"key"}const d_=()=>{const t=Mt();return H.useMemo(()=>({zoomIn:r=>{const{panZoom:i}=t.getState();return i?i.scaleBy(1.2,r):Promise.resolve(!1)},zoomOut:r=>{const{panZoom:i}=t.getState();return i?i.scaleBy(1/1.2,r):Promise.resolve(!1)},zoomTo:(r,i)=>{const{panZoom:s}=t.getState();return s?s.scaleTo(r,i):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(r,i)=>{const{transform:[s,l,c],panZoom:d}=t.getState();return d?(await d.setViewport({x:r.x??s,y:r.y??l,zoom:r.zoom??c},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[r,i,s]=t.getState().transform;return{x:r,y:i,zoom:s}},setCenter:async(r,i,s)=>t.getState().setCenter(r,i,s),fitBounds:async(r,i)=>{const{width:s,height:l,minZoom:c,maxZoom:d,panZoom:h}=t.getState(),v=Gf(r,s,l,c,d,(i==null?void 0:i.padding)??.1);return h?(await h.setViewport(v,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(r,i={})=>{const{transform:s,snapGrid:l,snapToGrid:c,domNode:d}=t.getState();if(!d)return r;const{x:h,y:v}=d.getBoundingClientRect(),b={x:r.x-h,y:r.y-v},S=i.snapGrid??l,x=i.snapToGrid??c;return Ba(b,s,x,S)},flowToScreenPosition:r=>{const{transform:i,domNode:s}=t.getState();if(!s)return r;const{x:l,y:c}=s.getBoundingClientRect(),d=wu(r,i);return{x:d.x+l,y:d.y+c}}}),[])};function B0(t,r){const i=[],s=new Map,l=[];for(const c of t)if(c.type==="add"){l.push(c);continue}else if(c.type==="remove"||c.type==="replace")s.set(c.id,[c]);else{const d=s.get(c.id);d?d.push(c):s.set(c.id,[c])}for(const c of r){const d=s.get(c.id);if(!d){i.push(c);continue}if(d[0].type==="remove")continue;if(d[0].type==="replace"){i.push({...d[0].item});continue}const h={...c};for(const v of d)p_(v,h);i.push(h)}return l.length&&l.forEach(c=>{c.index!==void 0?i.splice(c.index,0,{...c.item}):i.push({...c.item})}),i}function p_(t,r){switch(t.type){case"select":{r.selected=t.selected;break}case"position":{typeof t.position<"u"&&(r.position=t.position),typeof t.dragging<"u"&&(r.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(r.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(r.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(r.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(r.resizing=t.resizing);break}}}function H0(t,r){return B0(t,r)}function V0(t,r){return B0(t,r)}function Ri(t,r){return{id:t,type:"select",selected:r}}function Es(t,r=new Set,i=!1){const s=[];for(const[l,c]of t){const d=r.has(l);!(c.selected===void 0&&!d)&&c.selected!==d&&(i&&(c.selected=d),s.push(Ri(c.id,d)))}return s}function nm({items:t=[],lookup:r}){var l;const i=[],s=new Map(t.map(c=>[c.id,c]));for(const[c,d]of t.entries()){const h=r.get(d.id),v=((l=h==null?void 0:h.internals)==null?void 0:l.userNode)??h;v!==void 0&&v!==d&&i.push({id:d.id,item:d,type:"replace"}),v===void 0&&i.push({item:d,type:"add",index:c})}for(const[c]of r)s.get(c)===void 0&&i.push({id:c,type:"remove"});return i}function rm(t){return{id:t.id,type:"remove"}}const om=t=>D1(t),h_=t=>c0(t);function U0(t){return H.forwardRef(t)}function im(t){const[r,i]=H.useState(BigInt(0)),[s]=H.useState(()=>m_(()=>i(l=>l+BigInt(1))));return Df(()=>{const l=s.get();l.length&&(t(l),s.reset())},[r]),s}function m_(t){let r=[];return{get:()=>r,reset:()=>{r=[]},push:i=>{r.push(i),t()}}}const K0=H.createContext(null);function g_({children:t}){const r=Mt(),i=H.useCallback(h=>{const{nodes:v=[],setNodes:b,hasDefaultNodes:S,onNodesChange:x,nodeLookup:_,fitViewQueued:C,onNodesChangeMiddlewareMap:j}=r.getState();let M=v;for(const P of h)M=typeof P=="function"?P(M):P;let T=nm({items:M,lookup:_});for(const P of j.values())T=P(T);S&&b(M),T.length>0?x==null||x(T):C&&window.requestAnimationFrame(()=>{const{fitViewQueued:P,nodes:F,setNodes:$}=r.getState();P&&$(F)})},[]),s=im(i),l=H.useCallback(h=>{const{edges:v=[],setEdges:b,hasDefaultEdges:S,onEdgesChange:x,edgeLookup:_}=r.getState();let C=v;for(const j of h)C=typeof j=="function"?j(C):j;S?b(C):x&&x(nm({items:C,lookup:_}))},[]),c=im(l),d=H.useMemo(()=>({nodeQueue:s,edgeQueue:c}),[]);return g.jsx(K0.Provider,{value:d,children:t})}function y_(){const t=H.useContext(K0);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const v_=t=>!!t.panZoom;function od(){const t=d_(),r=Mt(),i=y_(),s=vt(v_),l=H.useMemo(()=>{const c=x=>r.getState().nodeLookup.get(x),d=x=>{i.nodeQueue.push(x)},h=x=>{i.edgeQueue.push(x)},v=x=>{var P,F;const{nodeLookup:_,nodeOrigin:C}=r.getState(),j=om(x)?x:_.get(x.id),M=j.parentId?g0(j.position,j.measured,j.parentId,_,C):j.position,T={...j,position:M,width:((P=j.measured)==null?void 0:P.width)??j.width,height:((F=j.measured)==null?void 0:F.height)??j.height};return As(T)},b=(x,_,C={replace:!1})=>{d(j=>j.map(M=>{if(M.id===x){const T=typeof _=="function"?_(M):_;return C.replace&&om(T)?T:{...M,...T}}return M}))},S=(x,_,C={replace:!1})=>{h(j=>j.map(M=>{if(M.id===x){const T=typeof _=="function"?_(M):_;return C.replace&&h_(T)?T:{...M,...T}}return M}))};return{getNodes:()=>r.getState().nodes.map(x=>({...x})),getNode:x=>{var _;return(_=c(x))==null?void 0:_.internals.userNode},getInternalNode:c,getEdges:()=>{const{edges:x=[]}=r.getState();return x.map(_=>({..._}))},getEdge:x=>r.getState().edgeLookup.get(x),setNodes:d,setEdges:h,addNodes:x=>{const _=Array.isArray(x)?x:[x];i.nodeQueue.push(C=>[...C,..._])},addEdges:x=>{const _=Array.isArray(x)?x:[x];i.edgeQueue.push(C=>[...C,..._])},toObject:()=>{const{nodes:x=[],edges:_=[],transform:C}=r.getState(),[j,M,T]=C;return{nodes:x.map(P=>({...P})),edges:_.map(P=>({...P})),viewport:{x:j,y:M,zoom:T}}},deleteElements:async({nodes:x=[],edges:_=[]})=>{const{nodes:C,edges:j,onNodesDelete:M,onEdgesDelete:T,triggerNodeChanges:P,triggerEdgeChanges:F,onDelete:$,onBeforeDelete:R}=r.getState(),{nodes:V,edges:K}=await V1({nodesToRemove:x,edgesToRemove:_,nodes:C,edges:j,onBeforeDelete:R}),W=K.length>0,Q=V.length>0;if(W){const pe=K.map(rm);T==null||T(K),F(pe)}if(Q){const pe=V.map(rm);M==null||M(V),P(pe)}return(Q||W)&&($==null||$({nodes:V,edges:K})),{deletedNodes:V,deletedEdges:K}},getIntersectingNodes:(x,_=!0,C)=>{const j=$h(x),M=j?x:v(x),T=C!==void 0;return M?(C||r.getState().nodes).filter(P=>{const F=r.getState().nodeLookup.get(P.id);if(F&&!j&&(P.id===x.id||!F.internals.positionAbsolute))return!1;const $=As(T?P:F),R=Ia($,M);return _&&R>0||R>=$.width*$.height||R>=M.width*M.height}):[]},isNodeIntersecting:(x,_,C=!0)=>{const M=$h(x)?x:v(x);if(!M)return!1;const T=Ia(M,_);return C&&T>0||T>=_.width*_.height||T>=M.width*M.height},updateNode:b,updateNodeData:(x,_,C={replace:!1})=>{b(x,j=>{const M=typeof _=="function"?_(j):_;return C.replace?{...j,data:M}:{...j,data:{...j.data,...M}}},C)},updateEdge:S,updateEdgeData:(x,_,C={replace:!1})=>{S(x,j=>{const M=typeof _=="function"?_(j):_;return C.replace?{...j,data:M}:{...j,data:{...j.data,...M}}},C)},getNodesBounds:x=>{const{nodeLookup:_,nodeOrigin:C}=r.getState();return z1(x,{nodeLookup:_,nodeOrigin:C})},getHandleConnections:({type:x,id:_,nodeId:C})=>{var j;return Array.from(((j=r.getState().connectionLookup.get(`${C}-${x}${_?`-${_}`:""}`))==null?void 0:j.values())??[])},getNodeConnections:({type:x,handleId:_,nodeId:C})=>{var j;return Array.from(((j=r.getState().connectionLookup.get(`${C}${x?_?`-${x}-${_}`:`-${x}`:""}`))==null?void 0:j.values())??[])},fitView:async x=>{const _=r.getState().fitViewResolver??W1();return r.setState({fitViewQueued:!0,fitViewOptions:x,fitViewResolver:_}),i.nodeQueue.push(C=>[...C]),_.promise}}},[]);return H.useMemo(()=>({...l,...t,viewportInitialized:s}),[s])}const sm=t=>t.selected,x_=typeof window<"u"?window:void 0;function w_({deleteKeyCode:t,multiSelectionKeyCode:r}){const i=Mt(),{deleteElements:s}=od(),l=Aa(t,{actInsideInputWithModifier:!1}),c=Aa(r,{target:x_});H.useEffect(()=>{if(l){const{edges:d,nodes:h}=i.getState();s({nodes:h.filter(sm),edges:d.filter(sm)}),i.setState({nodesSelectionActive:!1})}},[l]),H.useEffect(()=>{i.setState({multiSelectionActive:c})},[c])}function b_(t){const r=Mt();H.useEffect(()=>{const i=()=>{var l,c,d,h;if(!t.current||!(((c=(l=t.current).checkVisibility)==null?void 0:c.call(l))??!0))return!1;const s=Jf(t.current);(s.height===0||s.width===0)&&((h=(d=r.getState()).onError)==null||h.call(d,"004",io.error004())),r.setState({width:s.width||500,height:s.height||500})};if(t.current){i(),window.addEventListener("resize",i);const s=new ResizeObserver(()=>i());return s.observe(t.current),()=>{window.removeEventListener("resize",i),s&&t.current&&s.unobserve(t.current)}}},[])}const Ou={position:"absolute",width:"100%",height:"100%",top:0,left:0},__=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function S_({onPaneContextMenu:t,zoomOnScroll:r=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:l=.5,panOnScrollMode:c=zi.Free,zoomOnDoubleClick:d=!0,panOnDrag:h=!0,defaultViewport:v,translateExtent:b,minZoom:S,maxZoom:x,zoomActivationKeyCode:_,preventScrolling:C=!0,children:j,noWheelClassName:M,noPanClassName:T,onViewportChange:P,isControlledViewport:F,paneClickDistance:$,selectionOnDrag:R}){const V=Mt(),K=H.useRef(null),{userSelectionActive:W,lib:Q,connectionInProgress:pe}=vt(__,Rt),ke=Aa(_),X=H.useRef();b_(K);const ue=H.useCallback(ve=>{P==null||P({x:ve[0],y:ve[1],zoom:ve[2]}),F||V.setState({transform:ve})},[P,F]);return H.useEffect(()=>{if(K.current){X.current=Pb({domNode:K.current,minZoom:S,maxZoom:x,translateExtent:b,viewport:v,onDraggingChange:J=>V.setState(ae=>ae.paneDragging===J?ae:{paneDragging:J}),onPanZoomStart:(J,ae)=>{const{onViewportChangeStart:B,onMoveStart:q}=V.getState();q==null||q(J,ae),B==null||B(ae)},onPanZoom:(J,ae)=>{const{onViewportChange:B,onMove:q}=V.getState();q==null||q(J,ae),B==null||B(ae)},onPanZoomEnd:(J,ae)=>{const{onViewportChangeEnd:B,onMoveEnd:q}=V.getState();q==null||q(J,ae),B==null||B(ae)}});const{x:ve,y:D,zoom:fe}=X.current.getViewport();return V.setState({panZoom:X.current,transform:[ve,D,fe],domNode:K.current.closest(".react-flow")}),()=>{var J;(J=X.current)==null||J.destroy()}}},[]),H.useEffect(()=>{var ve;(ve=X.current)==null||ve.update({onPaneContextMenu:t,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:s,panOnScrollSpeed:l,panOnScrollMode:c,zoomOnDoubleClick:d,panOnDrag:h,zoomActivationKeyPressed:ke,preventScrolling:C,noPanClassName:T,userSelectionActive:W,noWheelClassName:M,lib:Q,onTransformChange:ue,connectionInProgress:pe,selectionOnDrag:R,paneClickDistance:$})},[t,r,i,s,l,c,d,h,ke,C,T,W,M,Q,ue,pe,R,$]),g.jsx("div",{className:"react-flow__renderer",ref:K,style:Ou,children:j})}const k_=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function N_(){const{userSelectionActive:t,userSelectionRect:r}=vt(k_,Rt);return t&&r?g.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:r.width,height:r.height,transform:`translate(${r.x}px, ${r.y}px)`}}):null}const gf=(t,r)=>i=>{i.target===r.current&&(t==null||t(i))},E_=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function C_({isSelecting:t,selectionKeyPressed:r,selectionMode:i=Ma.Full,panOnDrag:s,paneClickDistance:l,selectionOnDrag:c,onSelectionStart:d,onSelectionEnd:h,onPaneClick:v,onPaneContextMenu:b,onPaneScroll:S,onPaneMouseEnter:x,onPaneMouseMove:_,onPaneMouseLeave:C,children:j}){const M=Mt(),{userSelectionActive:T,elementsSelectable:P,dragging:F,connectionInProgress:$}=vt(E_,Rt),R=P&&(t||T),V=H.useRef(null),K=H.useRef(),W=H.useRef(new Set),Q=H.useRef(new Set),pe=H.useRef(!1),ke=B=>{if(pe.current||$){pe.current=!1;return}v==null||v(B),M.getState().resetSelectedElements(),M.setState({nodesSelectionActive:!1})},X=B=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){B.preventDefault();return}b==null||b(B)},ue=S?B=>S(B):void 0,ve=B=>{pe.current&&(B.stopPropagation(),pe.current=!1)},D=B=>{var Te,Oe;const{domNode:q}=M.getState();if(K.current=q==null?void 0:q.getBoundingClientRect(),!K.current)return;const Z=B.target===V.current;if(!Z&&!!B.target.closest(".nokey")||!t||!(c&&Z||r)||B.button!==0||!B.isPrimary)return;(Oe=(Te=B.target)==null?void 0:Te.setPointerCapture)==null||Oe.call(Te,B.pointerId),pe.current=!1;const{x:de,y:_e}=Ur(B.nativeEvent,K.current);M.setState({userSelectionRect:{width:0,height:0,startX:de,startY:_e,x:de,y:_e}}),Z||(B.stopPropagation(),B.preventDefault())},fe=B=>{const{userSelectionRect:q,transform:Z,nodeLookup:A,edgeLookup:U,connectionLookup:de,triggerNodeChanges:_e,triggerEdgeChanges:Te,defaultEdgeOptions:Oe,resetSelectedElements:Re}=M.getState();if(!K.current||!q)return;const{x:Se,y:De}=Ur(B.nativeEvent,K.current),{startX:Ne,startY:Ze}=q;if(!pe.current){const ct=r?0:l;if(Math.hypot(Se-Ne,De-Ze)<=ct)return;Re(),d==null||d(B)}pe.current=!0;const Be={startX:Ne,startY:Ze,x:Se<Ne?Se:Ne,y:De<Ze?De:Ze,width:Math.abs(Se-Ne),height:Math.abs(De-Ze)},Ue=W.current,qe=Q.current;W.current=new Set(Qf(A,Be,Z,i===Ma.Partial,!0).map(ct=>ct.id)),Q.current=new Set;const nt=(Oe==null?void 0:Oe.selectable)??!0;for(const ct of W.current){const St=de.get(ct);if(St)for(const{edgeId:gn}of St.values()){const Xt=U.get(gn);Xt&&(Xt.selectable??nt)&&Q.current.add(gn)}}if(!Mh(Ue,W.current)){const ct=Es(A,W.current,!0);_e(ct)}if(!Mh(qe,Q.current)){const ct=Es(U,Q.current);Te(ct)}M.setState({userSelectionRect:Be,userSelectionActive:!0,nodesSelectionActive:!1})},J=B=>{var q,Z;B.button===0&&((Z=(q=B.target)==null?void 0:q.releasePointerCapture)==null||Z.call(q,B.pointerId),!T&&B.target===V.current&&M.getState().userSelectionRect&&(ke==null||ke(B)),M.setState({userSelectionActive:!1,userSelectionRect:null}),pe.current&&(h==null||h(B),M.setState({nodesSelectionActive:W.current.size>0})))},ae=s===!0||Array.isArray(s)&&s.includes(0);return g.jsxs("div",{className:tn(["react-flow__pane",{draggable:ae,dragging:F,selection:t}]),onClick:R?void 0:gf(ke,V),onContextMenu:gf(X,V),onWheel:gf(ue,V),onPointerEnter:R?void 0:x,onPointerMove:R?fe:_,onPointerUp:R?J:void 0,onPointerDownCapture:R?D:void 0,onClickCapture:R?ve:void 0,onPointerLeave:C,ref:V,style:Ou,children:[j,g.jsx(N_,{})]})}function zf({id:t,store:r,unselect:i=!1,nodeRef:s}){const{addSelectedNodes:l,unselectNodesAndEdges:c,multiSelectionActive:d,nodeLookup:h,onError:v}=r.getState(),b=h.get(t);if(!b){v==null||v("012",io.error012(t));return}r.setState({nodesSelectionActive:!1}),b.selected?(i||b.selected&&d)&&(c({nodes:[b],edges:[]}),requestAnimationFrame(()=>{var S;return(S=s==null?void 0:s.current)==null?void 0:S.blur()})):l([t])}function q0({nodeRef:t,disabled:r=!1,noDragClassName:i,handleSelector:s,nodeId:l,isSelectable:c,nodeClickDistance:d}){const h=Mt(),[v,b]=H.useState(!1),S=H.useRef();return H.useEffect(()=>{S.current=mb({getStoreItems:()=>h.getState(),onNodeMouseDown:x=>{zf({id:x,store:h,nodeRef:t})},onDragStart:()=>{b(!0)},onDragStop:()=>{b(!1)}})},[]),H.useEffect(()=>{if(!(r||!t.current||!S.current))return S.current.update({noDragClassName:i,handleSelector:s,domNode:t.current,isSelectable:c,nodeId:l,nodeClickDistance:d}),()=>{var x;(x=S.current)==null||x.destroy()}},[i,s,r,c,t,l,d]),v}const j_=t=>r=>r.selected&&(r.draggable||t&&typeof r.draggable>"u");function W0(){const t=Mt();return H.useCallback(i=>{const{nodeExtent:s,snapToGrid:l,snapGrid:c,nodesDraggable:d,onError:h,updateNodePositions:v,nodeLookup:b,nodeOrigin:S}=t.getState(),x=new Map,_=j_(d),C=l?c[0]:5,j=l?c[1]:5,M=i.direction.x*C*i.factor,T=i.direction.y*j*i.factor;for(const[,P]of b){if(!_(P))continue;let F={x:P.internals.positionAbsolute.x+M,y:P.internals.positionAbsolute.y+T};l&&(F=Fa(F,c));const{position:$,positionAbsolute:R}=f0({nodeId:P.id,nextPosition:F,nodeLookup:b,nodeExtent:s,nodeOrigin:S,onError:h});P.position=$,P.internals.positionAbsolute=R,x.set(P.id,P)}v(x)},[])}const id=H.createContext(null),P_=id.Provider;id.Consumer;const Y0=()=>H.useContext(id),$_=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),M_=(t,r,i)=>s=>{const{connectionClickStartHandle:l,connectionMode:c,connection:d}=s,{fromHandle:h,toHandle:v,isValid:b}=d,S=(v==null?void 0:v.nodeId)===t&&(v==null?void 0:v.id)===r&&(v==null?void 0:v.type)===i;return{connectingFrom:(h==null?void 0:h.nodeId)===t&&(h==null?void 0:h.id)===r&&(h==null?void 0:h.type)===i,connectingTo:S,clickConnecting:(l==null?void 0:l.nodeId)===t&&(l==null?void 0:l.id)===r&&(l==null?void 0:l.type)===i,isPossibleEndHandle:c===Is.Strict?(h==null?void 0:h.type)!==i:t!==(h==null?void 0:h.nodeId)||r!==(h==null?void 0:h.id),connectionInProcess:!!h,clickConnectionInProcess:!!l,valid:S&&b}};function I_({type:t="source",position:r=tt.Top,isValidConnection:i,isConnectable:s=!0,isConnectableStart:l=!0,isConnectableEnd:c=!0,id:d,onConnect:h,children:v,className:b,onMouseDown:S,onTouchStart:x,..._},C){var fe,J;const j=d||null,M=t==="target",T=Mt(),P=Y0(),{connectOnClick:F,noPanClassName:$,rfId:R}=vt($_,Rt),{connectingFrom:V,connectingTo:K,clickConnecting:W,isPossibleEndHandle:Q,connectionInProcess:pe,clickConnectionInProcess:ke,valid:X}=vt(M_(P,j,t),Rt);P||(J=(fe=T.getState()).onError)==null||J.call(fe,"010",io.error010());const ue=ae=>{const{defaultEdgeOptions:B,onConnect:q,hasDefaultEdges:Z}=T.getState(),A={...B,...ae};if(Z){const{edges:U,setEdges:de}=T.getState();de(S0(A,U))}q==null||q(A),h==null||h(A)},ve=ae=>{if(!P)return;const B=x0(ae.nativeEvent);if(l&&(B&&ae.button===0||!B)){const q=T.getState();Lf.onPointerDown(ae.nativeEvent,{handleDomNode:ae.currentTarget,autoPanOnConnect:q.autoPanOnConnect,connectionMode:q.connectionMode,connectionRadius:q.connectionRadius,domNode:q.domNode,nodeLookup:q.nodeLookup,lib:q.lib,isTarget:M,handleId:j,nodeId:P,flowId:q.rfId,panBy:q.panBy,cancelConnection:q.cancelConnection,onConnectStart:q.onConnectStart,onConnectEnd:(...Z)=>{var A,U;return(U=(A=T.getState()).onConnectEnd)==null?void 0:U.call(A,...Z)},updateConnection:q.updateConnection,onConnect:ue,isValidConnection:i||((...Z)=>{var A,U;return((U=(A=T.getState()).isValidConnection)==null?void 0:U.call(A,...Z))??!0}),getTransform:()=>T.getState().transform,getFromHandle:()=>T.getState().connection.fromHandle,autoPanSpeed:q.autoPanSpeed,dragThreshold:q.connectionDragThreshold})}B?S==null||S(ae):x==null||x(ae)},D=ae=>{const{onClickConnectStart:B,onClickConnectEnd:q,connectionClickStartHandle:Z,connectionMode:A,isValidConnection:U,lib:de,rfId:_e,nodeLookup:Te,connection:Oe}=T.getState();if(!P||!Z&&!l)return;if(!Z){B==null||B(ae.nativeEvent,{nodeId:P,handleId:j,handleType:t}),T.setState({connectionClickStartHandle:{nodeId:P,type:t,id:j}});return}const Re=y0(ae.target),Se=i||U,{connection:De,isValid:Ne}=Lf.isValid(ae.nativeEvent,{handle:{nodeId:P,id:j,type:t},connectionMode:A,fromNodeId:Z.nodeId,fromHandleId:Z.id||null,fromType:Z.type,isValidConnection:Se,flowId:_e,doc:Re,lib:de,nodeLookup:Te});Ne&&De&&ue(De);const Ze=structuredClone(Oe);delete Ze.inProgress,Ze.toPosition=Ze.toHandle?Ze.toHandle.position:null,q==null||q(ae,Ze),T.setState({connectionClickStartHandle:null})};return g.jsx("div",{"data-handleid":j,"data-nodeid":P,"data-handlepos":r,"data-id":`${R}-${P}-${j}-${t}`,className:tn(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",$,b,{source:!M,target:M,connectable:s,connectablestart:l,connectableend:c,clickconnecting:W,connectingfrom:V,connectingto:K,valid:X,connectionindicator:s&&(!pe||Q)&&(pe||ke?c:l)}]),onMouseDown:ve,onTouchStart:ve,onClick:F?D:void 0,ref:C,..._,children:v})}const Ls=H.memo(U0(I_));function T_({data:t,isConnectable:r,sourcePosition:i=tt.Bottom}){return g.jsxs(g.Fragment,{children:[t==null?void 0:t.label,g.jsx(Ls,{type:"source",position:i,isConnectable:r})]})}function A_({data:t,isConnectable:r,targetPosition:i=tt.Top,sourcePosition:s=tt.Bottom}){return g.jsxs(g.Fragment,{children:[g.jsx(Ls,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label,g.jsx(Ls,{type:"source",position:s,isConnectable:r})]})}function O_(){return null}function R_({data:t,isConnectable:r,targetPosition:i=tt.Top}){return g.jsxs(g.Fragment,{children:[g.jsx(Ls,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label]})}const bu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},am={input:T_,default:A_,output:R_,group:O_};function L_(t){var r,i,s,l;return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??((r=t.style)==null?void 0:r.width),height:t.height??t.initialHeight??((i=t.style)==null?void 0:i.height)}:{width:t.width??((s=t.style)==null?void 0:s.width),height:t.height??((l=t.style)==null?void 0:l.height)}}const D_=t=>{const{width:r,height:i,x:s,y:l}=za(t.nodeLookup,{filter:c=>!!c.selected});return{width:Vr(r)?r:null,height:Vr(i)?i:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${s}px,${l}px)`}};function z_({onSelectionContextMenu:t,noPanClassName:r,disableKeyboardA11y:i}){const s=Mt(),{width:l,height:c,transformString:d,userSelectionActive:h}=vt(D_,Rt),v=W0(),b=H.useRef(null);H.useEffect(()=>{var C;i||(C=b.current)==null||C.focus({preventScroll:!0})},[i]);const S=!h&&l!==null&&c!==null;if(q0({nodeRef:b,disabled:!S}),!S)return null;const x=t?C=>{const j=s.getState().nodes.filter(M=>M.selected);t(C,j)}:void 0,_=C=>{Object.prototype.hasOwnProperty.call(bu,C.key)&&(C.preventDefault(),v({direction:bu[C.key],factor:C.shiftKey?4:1}))};return g.jsx("div",{className:tn(["react-flow__nodesselection","react-flow__container",r]),style:{transform:d},children:g.jsx("div",{ref:b,className:"react-flow__nodesselection-rect",onContextMenu:x,tabIndex:i?void 0:-1,onKeyDown:i?void 0:_,style:{width:l,height:c}})})}const lm=typeof window<"u"?window:void 0,F_=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function X0({children:t,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:l,onPaneContextMenu:c,onPaneScroll:d,paneClickDistance:h,deleteKeyCode:v,selectionKeyCode:b,selectionOnDrag:S,selectionMode:x,onSelectionStart:_,onSelectionEnd:C,multiSelectionKeyCode:j,panActivationKeyCode:M,zoomActivationKeyCode:T,elementsSelectable:P,zoomOnScroll:F,zoomOnPinch:$,panOnScroll:R,panOnScrollSpeed:V,panOnScrollMode:K,zoomOnDoubleClick:W,panOnDrag:Q,defaultViewport:pe,translateExtent:ke,minZoom:X,maxZoom:ue,preventScrolling:ve,onSelectionContextMenu:D,noWheelClassName:fe,noPanClassName:J,disableKeyboardA11y:ae,onViewportChange:B,isControlledViewport:q}){const{nodesSelectionActive:Z,userSelectionActive:A}=vt(F_,Rt),U=Aa(b,{target:lm}),de=Aa(M,{target:lm}),_e=de||Q,Te=de||R,Oe=S&&_e!==!0,Re=U||A||Oe;return w_({deleteKeyCode:v,multiSelectionKeyCode:j}),g.jsx(S_,{onPaneContextMenu:c,elementsSelectable:P,zoomOnScroll:F,zoomOnPinch:$,panOnScroll:Te,panOnScrollSpeed:V,panOnScrollMode:K,zoomOnDoubleClick:W,panOnDrag:!U&&_e,defaultViewport:pe,translateExtent:ke,minZoom:X,maxZoom:ue,zoomActivationKeyCode:T,preventScrolling:ve,noWheelClassName:fe,noPanClassName:J,onViewportChange:B,isControlledViewport:q,paneClickDistance:h,selectionOnDrag:Oe,children:g.jsxs(C_,{onSelectionStart:_,onSelectionEnd:C,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:l,onPaneContextMenu:c,onPaneScroll:d,panOnDrag:_e,isSelecting:!!Re,selectionMode:x,selectionKeyPressed:U,paneClickDistance:h,selectionOnDrag:Oe,children:[t,Z&&g.jsx(z_,{onSelectionContextMenu:D,noPanClassName:J,disableKeyboardA11y:ae})]})})}X0.displayName="FlowRenderer";const B_=H.memo(X0),H_=t=>r=>t?Qf(r.nodeLookup,{x:0,y:0,width:r.width,height:r.height},r.transform,!0).map(i=>i.id):Array.from(r.nodeLookup.keys());function V_(t){return vt(H.useCallback(H_(t),[t]),Rt)}const U_=t=>t.updateNodeInternals;function K_(){const t=vt(U_),[r]=H.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const s=new Map;i.forEach(l=>{const c=l.target.getAttribute("data-id");s.set(c,{id:c,nodeElement:l.target,force:!0})}),t(s)}));return H.useEffect(()=>()=>{r==null||r.disconnect()},[r]),r}function q_({node:t,nodeType:r,hasDimensions:i,resizeObserver:s}){const l=Mt(),c=H.useRef(null),d=H.useRef(null),h=H.useRef(t.sourcePosition),v=H.useRef(t.targetPosition),b=H.useRef(r),S=i&&!!t.internals.handleBounds;return H.useEffect(()=>{c.current&&!t.hidden&&(!S||d.current!==c.current)&&(d.current&&(s==null||s.unobserve(d.current)),s==null||s.observe(c.current),d.current=c.current)},[S,t.hidden]),H.useEffect(()=>()=>{d.current&&(s==null||s.unobserve(d.current),d.current=null)},[]),H.useEffect(()=>{if(c.current){const x=b.current!==r,_=h.current!==t.sourcePosition,C=v.current!==t.targetPosition;(x||_||C)&&(b.current=r,h.current=t.sourcePosition,v.current=t.targetPosition,l.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:c.current,force:!0}]])))}},[t.id,r,t.sourcePosition,t.targetPosition]),c}function W_({id:t,onClick:r,onMouseEnter:i,onMouseMove:s,onMouseLeave:l,onContextMenu:c,onDoubleClick:d,nodesDraggable:h,elementsSelectable:v,nodesConnectable:b,nodesFocusable:S,resizeObserver:x,noDragClassName:_,noPanClassName:C,disableKeyboardA11y:j,rfId:M,nodeTypes:T,nodeClickDistance:P,onError:F}){const{node:$,internals:R,isParent:V}=vt(Se=>{const De=Se.nodeLookup.get(t),Ne=Se.parentLookup.has(t);return{node:De,internals:De.internals,isParent:Ne}},Rt);let K=$.type||"default",W=(T==null?void 0:T[K])||am[K];W===void 0&&(F==null||F("003",io.error003(K)),K="default",W=(T==null?void 0:T.default)||am.default);const Q=!!($.draggable||h&&typeof $.draggable>"u"),pe=!!($.selectable||v&&typeof $.selectable>"u"),ke=!!($.connectable||b&&typeof $.connectable>"u"),X=!!($.focusable||S&&typeof $.focusable>"u"),ue=Mt(),ve=m0($),D=q_({node:$,nodeType:K,hasDimensions:ve,resizeObserver:x}),fe=q0({nodeRef:D,disabled:$.hidden||!Q,noDragClassName:_,handleSelector:$.dragHandle,nodeId:t,isSelectable:pe,nodeClickDistance:P}),J=W0();if($.hidden)return null;const ae=Lo($),B=L_($),q=pe||Q||r||i||s||l,Z=i?Se=>i(Se,{...R.userNode}):void 0,A=s?Se=>s(Se,{...R.userNode}):void 0,U=l?Se=>l(Se,{...R.userNode}):void 0,de=c?Se=>c(Se,{...R.userNode}):void 0,_e=d?Se=>d(Se,{...R.userNode}):void 0,Te=Se=>{const{selectNodesOnDrag:De,nodeDragThreshold:Ne}=ue.getState();pe&&(!De||!Q||Ne>0)&&zf({id:t,store:ue,nodeRef:D}),r&&r(Se,{...R.userNode})},Oe=Se=>{if(!(v0(Se.nativeEvent)||j)){if(s0.includes(Se.key)&&pe){const De=Se.key==="Escape";zf({id:t,store:ue,unselect:De,nodeRef:D})}else if(Q&&$.selected&&Object.prototype.hasOwnProperty.call(bu,Se.key)){Se.preventDefault();const{ariaLabelConfig:De}=ue.getState();ue.setState({ariaLiveMessage:De["node.a11yDescription.ariaLiveMessage"]({direction:Se.key.replace("Arrow","").toLowerCase(),x:~~R.positionAbsolute.x,y:~~R.positionAbsolute.y})}),J({direction:bu[Se.key],factor:Se.shiftKey?4:1})}}},Re=()=>{var qe;if(j||!((qe=D.current)!=null&&qe.matches(":focus-visible")))return;const{transform:Se,width:De,height:Ne,autoPanOnNodeFocus:Ze,setCenter:Be}=ue.getState();if(!Ze)return;Qf(new Map([[t,$]]),{x:0,y:0,width:De,height:Ne},Se,!0).length>0||Be($.position.x+ae.width/2,$.position.y+ae.height/2,{zoom:Se[2]})};return g.jsx("div",{className:tn(["react-flow__node",`react-flow__node-${K}`,{[C]:Q},$.className,{selected:$.selected,selectable:pe,parent:V,draggable:Q,dragging:fe}]),ref:D,style:{zIndex:R.z,transform:`translate(${R.positionAbsolute.x}px,${R.positionAbsolute.y}px)`,pointerEvents:q?"all":"none",visibility:ve?"visible":"hidden",...$.style,...B},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:Z,onMouseMove:A,onMouseLeave:U,onContextMenu:de,onClick:Te,onDoubleClick:_e,onKeyDown:X?Oe:void 0,tabIndex:X?0:void 0,onFocus:X?Re:void 0,role:$.ariaRole??(X?"group":void 0),"aria-roledescription":"node","aria-describedby":j?void 0:`${D0}-${M}`,"aria-label":$.ariaLabel,...$.domAttributes,children:g.jsx(P_,{value:t,children:g.jsx(W,{id:t,data:$.data,type:K,positionAbsoluteX:R.positionAbsolute.x,positionAbsoluteY:R.positionAbsolute.y,selected:$.selected??!1,selectable:pe,draggable:Q,deletable:$.deletable??!0,isConnectable:ke,sourcePosition:$.sourcePosition,targetPosition:$.targetPosition,dragging:fe,dragHandle:$.dragHandle,zIndex:R.z,parentId:$.parentId,...ae})})})}var Y_=H.memo(W_);const X_=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function Q0(t){const{nodesDraggable:r,nodesConnectable:i,nodesFocusable:s,elementsSelectable:l,onError:c}=vt(X_,Rt),d=V_(t.onlyRenderVisibleElements),h=K_();return g.jsx("div",{className:"react-flow__nodes",style:Ou,children:d.map(v=>g.jsx(Y_,{id:v,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:h,nodesDraggable:r,nodesConnectable:i,nodesFocusable:s,elementsSelectable:l,nodeClickDistance:t.nodeClickDistance,onError:c},v))})}Q0.displayName="NodeRenderer";const Q_=H.memo(Q0);function G_(t){return vt(H.useCallback(i=>{if(!t)return i.edges.map(l=>l.id);const s=[];if(i.width&&i.height)for(const l of i.edges){const c=i.nodeLookup.get(l.source),d=i.nodeLookup.get(l.target);c&&d&&G1({sourceNode:c,targetNode:d,width:i.width,height:i.height,transform:i.transform})&&s.push(l.id)}return s},[t]),Rt)}const J_=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t}};return g.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Z_=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t,fill:t}};return g.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},um={[vu.Arrow]:J_,[vu.ArrowClosed]:Z_};function eS(t){const r=Mt();return H.useMemo(()=>{var l,c;return Object.prototype.hasOwnProperty.call(um,t)?um[t]:((c=(l=r.getState()).onError)==null||c.call(l,"009",io.error009(t)),null)},[t])}const tS=({id:t,type:r,color:i,width:s=12.5,height:l=12.5,markerUnits:c="strokeWidth",strokeWidth:d,orient:h="auto-start-reverse"})=>{const v=eS(r);return v?g.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${s}`,markerHeight:`${l}`,viewBox:"-10 -10 20 20",markerUnits:c,orient:h,refX:"0",refY:"0",children:g.jsx(v,{color:i,strokeWidth:d})}):null},G0=({defaultColor:t,rfId:r})=>{const i=vt(c=>c.edges),s=vt(c=>c.defaultEdgeOptions),l=H.useMemo(()=>ob(i,{id:r,defaultColor:t,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[i,s,r,t]);return l.length?g.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:g.jsx("defs",{children:l.map(c=>g.jsx(tS,{id:c.id,type:c.type,color:c.color,width:c.width,height:c.height,markerUnits:c.markerUnits,strokeWidth:c.strokeWidth,orient:c.orient},c.id))})}):null};G0.displayName="MarkerDefinitions";var nS=H.memo(G0);function J0({x:t,y:r,label:i,labelStyle:s,labelShowBg:l=!0,labelBgStyle:c,labelBgPadding:d=[2,4],labelBgBorderRadius:h=2,children:v,className:b,...S}){const[x,_]=H.useState({x:1,y:0,width:0,height:0}),C=tn(["react-flow__edge-textwrapper",b]),j=H.useRef(null);return H.useEffect(()=>{if(j.current){const M=j.current.getBBox();_({x:M.x,y:M.y,width:M.width,height:M.height})}},[i]),i?g.jsxs("g",{transform:`translate(${t-x.width/2} ${r-x.height/2})`,className:C,visibility:x.width?"visible":"hidden",...S,children:[l&&g.jsx("rect",{width:x.width+2*d[0],x:-d[0],y:-d[1],height:x.height+2*d[1],className:"react-flow__edge-textbg",style:c,rx:h,ry:h}),g.jsx("text",{className:"react-flow__edge-text",y:x.height/2,dy:"0.3em",ref:j,style:s,children:i}),v]}):null}J0.displayName="EdgeText";const rS=H.memo(J0);function Ru({path:t,labelX:r,labelY:i,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:v,interactionWidth:b=20,...S}){return g.jsxs(g.Fragment,{children:[g.jsx("path",{...S,d:t,fill:"none",className:tn(["react-flow__edge-path",S.className])}),b?g.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:b,className:"react-flow__edge-interaction"}):null,s&&Vr(r)&&Vr(i)?g.jsx(rS,{x:r,y:i,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:v}):null]})}function cm({pos:t,x1:r,y1:i,x2:s,y2:l}){return t===tt.Left||t===tt.Right?[.5*(r+s),i]:[r,.5*(i+l)]}function Z0({sourceX:t,sourceY:r,sourcePosition:i=tt.Bottom,targetX:s,targetY:l,targetPosition:c=tt.Top}){const[d,h]=cm({pos:i,x1:t,y1:r,x2:s,y2:l}),[v,b]=cm({pos:c,x1:s,y1:l,x2:t,y2:r}),[S,x,_,C]=w0({sourceX:t,sourceY:r,targetX:s,targetY:l,sourceControlX:d,sourceControlY:h,targetControlX:v,targetControlY:b});return[`M${t},${r} C${d},${h} ${v},${b} ${s},${l}`,S,x,_,C]}function eg(t){return H.memo(({id:r,sourceX:i,sourceY:s,targetX:l,targetY:c,sourcePosition:d,targetPosition:h,label:v,labelStyle:b,labelShowBg:S,labelBgStyle:x,labelBgPadding:_,labelBgBorderRadius:C,style:j,markerEnd:M,markerStart:T,interactionWidth:P})=>{const[F,$,R]=Z0({sourceX:i,sourceY:s,sourcePosition:d,targetX:l,targetY:c,targetPosition:h}),V=t.isInternal?void 0:r;return g.jsx(Ru,{id:V,path:F,labelX:$,labelY:R,label:v,labelStyle:b,labelShowBg:S,labelBgStyle:x,labelBgPadding:_,labelBgBorderRadius:C,style:j,markerEnd:M,markerStart:T,interactionWidth:P})})}const oS=eg({isInternal:!1}),tg=eg({isInternal:!0});oS.displayName="SimpleBezierEdge";tg.displayName="SimpleBezierEdgeInternal";function ng(t){return H.memo(({id:r,sourceX:i,sourceY:s,targetX:l,targetY:c,label:d,labelStyle:h,labelShowBg:v,labelBgStyle:b,labelBgPadding:S,labelBgBorderRadius:x,style:_,sourcePosition:C=tt.Bottom,targetPosition:j=tt.Top,markerEnd:M,markerStart:T,pathOptions:P,interactionWidth:F})=>{const[$,R,V]=Af({sourceX:i,sourceY:s,sourcePosition:C,targetX:l,targetY:c,targetPosition:j,borderRadius:P==null?void 0:P.borderRadius,offset:P==null?void 0:P.offset,stepPosition:P==null?void 0:P.stepPosition}),K=t.isInternal?void 0:r;return g.jsx(Ru,{id:K,path:$,labelX:R,labelY:V,label:d,labelStyle:h,labelShowBg:v,labelBgStyle:b,labelBgPadding:S,labelBgBorderRadius:x,style:_,markerEnd:M,markerStart:T,interactionWidth:F})})}const rg=ng({isInternal:!1}),og=ng({isInternal:!0});rg.displayName="SmoothStepEdge";og.displayName="SmoothStepEdgeInternal";function ig(t){return H.memo(({id:r,...i})=>{var l;const s=t.isInternal?void 0:r;return g.jsx(rg,{...i,id:s,pathOptions:H.useMemo(()=>{var c;return{borderRadius:0,offset:(c=i.pathOptions)==null?void 0:c.offset}},[(l=i.pathOptions)==null?void 0:l.offset])})})}const iS=ig({isInternal:!1}),sg=ig({isInternal:!0});iS.displayName="StepEdge";sg.displayName="StepEdgeInternal";function ag(t){return H.memo(({id:r,sourceX:i,sourceY:s,targetX:l,targetY:c,label:d,labelStyle:h,labelShowBg:v,labelBgStyle:b,labelBgPadding:S,labelBgBorderRadius:x,style:_,markerEnd:C,markerStart:j,interactionWidth:M})=>{const[T,P,F]=k0({sourceX:i,sourceY:s,targetX:l,targetY:c}),$=t.isInternal?void 0:r;return g.jsx(Ru,{id:$,path:T,labelX:P,labelY:F,label:d,labelStyle:h,labelShowBg:v,labelBgStyle:b,labelBgPadding:S,labelBgBorderRadius:x,style:_,markerEnd:C,markerStart:j,interactionWidth:M})})}const sS=ag({isInternal:!1}),lg=ag({isInternal:!0});sS.displayName="StraightEdge";lg.displayName="StraightEdgeInternal";function ug(t){return H.memo(({id:r,sourceX:i,sourceY:s,targetX:l,targetY:c,sourcePosition:d=tt.Bottom,targetPosition:h=tt.Top,label:v,labelStyle:b,labelShowBg:S,labelBgStyle:x,labelBgPadding:_,labelBgBorderRadius:C,style:j,markerEnd:M,markerStart:T,pathOptions:P,interactionWidth:F})=>{const[$,R,V]=b0({sourceX:i,sourceY:s,sourcePosition:d,targetX:l,targetY:c,targetPosition:h,curvature:P==null?void 0:P.curvature}),K=t.isInternal?void 0:r;return g.jsx(Ru,{id:K,path:$,labelX:R,labelY:V,label:v,labelStyle:b,labelShowBg:S,labelBgStyle:x,labelBgPadding:_,labelBgBorderRadius:C,style:j,markerEnd:M,markerStart:T,interactionWidth:F})})}const aS=ug({isInternal:!1}),cg=ug({isInternal:!0});aS.displayName="BezierEdge";cg.displayName="BezierEdgeInternal";const fm={default:cg,straight:lg,step:sg,smoothstep:og,simplebezier:tg},dm={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},lS=(t,r,i)=>i===tt.Left?t-r:i===tt.Right?t+r:t,uS=(t,r,i)=>i===tt.Top?t-r:i===tt.Bottom?t+r:t,pm="react-flow__edgeupdater";function hm({position:t,centerX:r,centerY:i,radius:s=10,onMouseDown:l,onMouseEnter:c,onMouseOut:d,type:h}){return g.jsx("circle",{onMouseDown:l,onMouseEnter:c,onMouseOut:d,className:tn([pm,`${pm}-${h}`]),cx:lS(r,s,t),cy:uS(i,s,t),r:s,stroke:"transparent",fill:"transparent"})}function cS({isReconnectable:t,reconnectRadius:r,edge:i,sourceX:s,sourceY:l,targetX:c,targetY:d,sourcePosition:h,targetPosition:v,onReconnect:b,onReconnectStart:S,onReconnectEnd:x,setReconnecting:_,setUpdateHover:C}){const j=Mt(),M=(R,V)=>{if(R.button!==0)return;const{autoPanOnConnect:K,domNode:W,connectionMode:Q,connectionRadius:pe,lib:ke,onConnectStart:X,cancelConnection:ue,nodeLookup:ve,rfId:D,panBy:fe,updateConnection:J}=j.getState(),ae=V.type==="target",B=(A,U)=>{_(!1),x==null||x(A,i,V.type,U)},q=A=>b==null?void 0:b(i,A),Z=(A,U)=>{_(!0),S==null||S(R,i,V.type),X==null||X(A,U)};Lf.onPointerDown(R.nativeEvent,{autoPanOnConnect:K,connectionMode:Q,connectionRadius:pe,domNode:W,handleId:V.id,nodeId:V.nodeId,nodeLookup:ve,isTarget:ae,edgeUpdaterType:V.type,lib:ke,flowId:D,cancelConnection:ue,panBy:fe,isValidConnection:(...A)=>{var U,de;return((de=(U=j.getState()).isValidConnection)==null?void 0:de.call(U,...A))??!0},onConnect:q,onConnectStart:Z,onConnectEnd:(...A)=>{var U,de;return(de=(U=j.getState()).onConnectEnd)==null?void 0:de.call(U,...A)},onReconnectEnd:B,updateConnection:J,getTransform:()=>j.getState().transform,getFromHandle:()=>j.getState().connection.fromHandle,dragThreshold:j.getState().connectionDragThreshold,handleDomNode:R.currentTarget})},T=R=>M(R,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),P=R=>M(R,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),F=()=>C(!0),$=()=>C(!1);return g.jsxs(g.Fragment,{children:[(t===!0||t==="source")&&g.jsx(hm,{position:h,centerX:s,centerY:l,radius:r,onMouseDown:T,onMouseEnter:F,onMouseOut:$,type:"source"}),(t===!0||t==="target")&&g.jsx(hm,{position:v,centerX:c,centerY:d,radius:r,onMouseDown:P,onMouseEnter:F,onMouseOut:$,type:"target"})]})}function fS({id:t,edgesFocusable:r,edgesReconnectable:i,elementsSelectable:s,onClick:l,onDoubleClick:c,onContextMenu:d,onMouseEnter:h,onMouseMove:v,onMouseLeave:b,reconnectRadius:S,onReconnect:x,onReconnectStart:_,onReconnectEnd:C,rfId:j,edgeTypes:M,noPanClassName:T,onError:P,disableKeyboardA11y:F}){let $=vt(Be=>Be.edgeLookup.get(t));const R=vt(Be=>Be.defaultEdgeOptions);$=R?{...R,...$}:$;let V=$.type||"default",K=(M==null?void 0:M[V])||fm[V];K===void 0&&(P==null||P("011",io.error011(V)),V="default",K=(M==null?void 0:M.default)||fm.default);const W=!!($.focusable||r&&typeof $.focusable>"u"),Q=typeof x<"u"&&($.reconnectable||i&&typeof $.reconnectable>"u"),pe=!!($.selectable||s&&typeof $.selectable>"u"),ke=H.useRef(null),[X,ue]=H.useState(!1),[ve,D]=H.useState(!1),fe=Mt(),{zIndex:J,sourceX:ae,sourceY:B,targetX:q,targetY:Z,sourcePosition:A,targetPosition:U}=vt(H.useCallback(Be=>{const Ue=Be.nodeLookup.get($.source),qe=Be.nodeLookup.get($.target);if(!Ue||!qe)return{zIndex:$.zIndex,...dm};const nt=rb({id:t,sourceNode:Ue,targetNode:qe,sourceHandle:$.sourceHandle||null,targetHandle:$.targetHandle||null,connectionMode:Be.connectionMode,onError:P});return{zIndex:Q1({selected:$.selected,zIndex:$.zIndex,sourceNode:Ue,targetNode:qe,elevateOnSelect:Be.elevateEdgesOnSelect,zIndexMode:Be.zIndexMode}),...nt||dm}},[$.source,$.target,$.sourceHandle,$.targetHandle,$.selected,$.zIndex]),Rt),de=H.useMemo(()=>$.markerStart?`url('#${Of($.markerStart,j)}')`:void 0,[$.markerStart,j]),_e=H.useMemo(()=>$.markerEnd?`url('#${Of($.markerEnd,j)}')`:void 0,[$.markerEnd,j]);if($.hidden||ae===null||B===null||q===null||Z===null)return null;const Te=Be=>{var ct;const{addSelectedEdges:Ue,unselectNodesAndEdges:qe,multiSelectionActive:nt}=fe.getState();pe&&(fe.setState({nodesSelectionActive:!1}),$.selected&&nt?(qe({nodes:[],edges:[$]}),(ct=ke.current)==null||ct.blur()):Ue([t])),l&&l(Be,$)},Oe=c?Be=>{c(Be,{...$})}:void 0,Re=d?Be=>{d(Be,{...$})}:void 0,Se=h?Be=>{h(Be,{...$})}:void 0,De=v?Be=>{v(Be,{...$})}:void 0,Ne=b?Be=>{b(Be,{...$})}:void 0,Ze=Be=>{var Ue;if(!F&&s0.includes(Be.key)&&pe){const{unselectNodesAndEdges:qe,addSelectedEdges:nt}=fe.getState();Be.key==="Escape"?((Ue=ke.current)==null||Ue.blur(),qe({edges:[$]})):nt([t])}};return g.jsx("svg",{style:{zIndex:J},children:g.jsxs("g",{className:tn(["react-flow__edge",`react-flow__edge-${V}`,$.className,T,{selected:$.selected,animated:$.animated,inactive:!pe&&!l,updating:X,selectable:pe}]),onClick:Te,onDoubleClick:Oe,onContextMenu:Re,onMouseEnter:Se,onMouseMove:De,onMouseLeave:Ne,onKeyDown:W?Ze:void 0,tabIndex:W?0:void 0,role:$.ariaRole??(W?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":$.ariaLabel===null?void 0:$.ariaLabel||`Edge from ${$.source} to ${$.target}`,"aria-describedby":W?`${z0}-${j}`:void 0,ref:ke,...$.domAttributes,children:[!ve&&g.jsx(K,{id:t,source:$.source,target:$.target,type:$.type,selected:$.selected,animated:$.animated,selectable:pe,deletable:$.deletable??!0,label:$.label,labelStyle:$.labelStyle,labelShowBg:$.labelShowBg,labelBgStyle:$.labelBgStyle,labelBgPadding:$.labelBgPadding,labelBgBorderRadius:$.labelBgBorderRadius,sourceX:ae,sourceY:B,targetX:q,targetY:Z,sourcePosition:A,targetPosition:U,data:$.data,style:$.style,sourceHandleId:$.sourceHandle,targetHandleId:$.targetHandle,markerStart:de,markerEnd:_e,pathOptions:"pathOptions"in $?$.pathOptions:void 0,interactionWidth:$.interactionWidth}),Q&&g.jsx(cS,{edge:$,isReconnectable:Q,reconnectRadius:S,onReconnect:x,onReconnectStart:_,onReconnectEnd:C,sourceX:ae,sourceY:B,targetX:q,targetY:Z,sourcePosition:A,targetPosition:U,setUpdateHover:ue,setReconnecting:D})]})})}var dS=H.memo(fS);const pS=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function fg({defaultMarkerColor:t,onlyRenderVisibleElements:r,rfId:i,edgeTypes:s,noPanClassName:l,onReconnect:c,onEdgeContextMenu:d,onEdgeMouseEnter:h,onEdgeMouseMove:v,onEdgeMouseLeave:b,onEdgeClick:S,reconnectRadius:x,onEdgeDoubleClick:_,onReconnectStart:C,onReconnectEnd:j,disableKeyboardA11y:M}){const{edgesFocusable:T,edgesReconnectable:P,elementsSelectable:F,onError:$}=vt(pS,Rt),R=G_(r);return g.jsxs("div",{className:"react-flow__edges",children:[g.jsx(nS,{defaultColor:t,rfId:i}),R.map(V=>g.jsx(dS,{id:V,edgesFocusable:T,edgesReconnectable:P,elementsSelectable:F,noPanClassName:l,onReconnect:c,onContextMenu:d,onMouseEnter:h,onMouseMove:v,onMouseLeave:b,onClick:S,reconnectRadius:x,onDoubleClick:_,onReconnectStart:C,onReconnectEnd:j,rfId:i,onError:$,edgeTypes:s,disableKeyboardA11y:M},V))]})}fg.displayName="EdgeRenderer";const hS=H.memo(fg),mS=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function gS({children:t}){const r=vt(mS);return g.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:t})}function yS(t){const r=od(),i=H.useRef(!1);H.useEffect(()=>{!i.current&&r.viewportInitialized&&t&&(setTimeout(()=>t(r),1),i.current=!0)},[t,r.viewportInitialized])}const vS=t=>{var r;return(r=t.panZoom)==null?void 0:r.syncViewport};function xS(t){const r=vt(vS),i=Mt();return H.useEffect(()=>{t&&(r==null||r(t),i.setState({transform:[t.x,t.y,t.zoom]}))},[t,r]),null}function wS(t){return t.connection.inProgress?{...t.connection,to:Ba(t.connection.to,t.transform)}:{...t.connection}}function bS(t){return wS}function _S(t){const r=bS();return vt(r,Rt)}const SS=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function kS({containerStyle:t,style:r,type:i,component:s}){const{nodesConnectable:l,width:c,height:d,isValid:h,inProgress:v}=vt(SS,Rt);return!(c&&l&&v)?null:g.jsx("svg",{style:t,width:c,height:d,className:"react-flow__connectionline react-flow__container",children:g.jsx("g",{className:tn(["react-flow__connection",u0(h)]),children:g.jsx(dg,{style:r,type:i,CustomComponent:s,isValid:h})})})}const dg=({style:t,type:r=pi.Bezier,CustomComponent:i,isValid:s})=>{const{inProgress:l,from:c,fromNode:d,fromHandle:h,fromPosition:v,to:b,toNode:S,toHandle:x,toPosition:_,pointer:C}=_S();if(!l)return;if(i)return g.jsx(i,{connectionLineType:r,connectionLineStyle:t,fromNode:d,fromHandle:h,fromX:c.x,fromY:c.y,toX:b.x,toY:b.y,fromPosition:v,toPosition:_,connectionStatus:u0(s),toNode:S,toHandle:x,pointer:C});let j="";const M={sourceX:c.x,sourceY:c.y,sourcePosition:v,targetX:b.x,targetY:b.y,targetPosition:_};switch(r){case pi.Bezier:[j]=b0(M);break;case pi.SimpleBezier:[j]=Z0(M);break;case pi.Step:[j]=Af({...M,borderRadius:0});break;case pi.SmoothStep:[j]=Af(M);break;default:[j]=k0(M)}return g.jsx("path",{d:j,fill:"none",className:"react-flow__connection-path",style:t})};dg.displayName="ConnectionLine";const NS={};function mm(t=NS){H.useRef(t),Mt(),H.useEffect(()=>{},[t])}function ES(){Mt(),H.useRef(!1),H.useEffect(()=>{},[])}function pg({nodeTypes:t,edgeTypes:r,onInit:i,onNodeClick:s,onEdgeClick:l,onNodeDoubleClick:c,onEdgeDoubleClick:d,onNodeMouseEnter:h,onNodeMouseMove:v,onNodeMouseLeave:b,onNodeContextMenu:S,onSelectionContextMenu:x,onSelectionStart:_,onSelectionEnd:C,connectionLineType:j,connectionLineStyle:M,connectionLineComponent:T,connectionLineContainerStyle:P,selectionKeyCode:F,selectionOnDrag:$,selectionMode:R,multiSelectionKeyCode:V,panActivationKeyCode:K,zoomActivationKeyCode:W,deleteKeyCode:Q,onlyRenderVisibleElements:pe,elementsSelectable:ke,defaultViewport:X,translateExtent:ue,minZoom:ve,maxZoom:D,preventScrolling:fe,defaultMarkerColor:J,zoomOnScroll:ae,zoomOnPinch:B,panOnScroll:q,panOnScrollSpeed:Z,panOnScrollMode:A,zoomOnDoubleClick:U,panOnDrag:de,onPaneClick:_e,onPaneMouseEnter:Te,onPaneMouseMove:Oe,onPaneMouseLeave:Re,onPaneScroll:Se,onPaneContextMenu:De,paneClickDistance:Ne,nodeClickDistance:Ze,onEdgeContextMenu:Be,onEdgeMouseEnter:Ue,onEdgeMouseMove:qe,onEdgeMouseLeave:nt,reconnectRadius:ct,onReconnect:St,onReconnectStart:gn,onReconnectEnd:Xt,noDragClassName:Qt,noWheelClassName:kt,noPanClassName:Kt,disableKeyboardA11y:kn,nodeExtent:fr,rfId:an,viewport:Et,onViewportChange:Gt}){return mm(t),mm(r),ES(),yS(i),xS(Et),g.jsx(B_,{onPaneClick:_e,onPaneMouseEnter:Te,onPaneMouseMove:Oe,onPaneMouseLeave:Re,onPaneContextMenu:De,onPaneScroll:Se,paneClickDistance:Ne,deleteKeyCode:Q,selectionKeyCode:F,selectionOnDrag:$,selectionMode:R,onSelectionStart:_,onSelectionEnd:C,multiSelectionKeyCode:V,panActivationKeyCode:K,zoomActivationKeyCode:W,elementsSelectable:ke,zoomOnScroll:ae,zoomOnPinch:B,zoomOnDoubleClick:U,panOnScroll:q,panOnScrollSpeed:Z,panOnScrollMode:A,panOnDrag:de,defaultViewport:X,translateExtent:ue,minZoom:ve,maxZoom:D,onSelectionContextMenu:x,preventScrolling:fe,noDragClassName:Qt,noWheelClassName:kt,noPanClassName:Kt,disableKeyboardA11y:kn,onViewportChange:Gt,isControlledViewport:!!Et,children:g.jsxs(gS,{children:[g.jsx(hS,{edgeTypes:r,onEdgeClick:l,onEdgeDoubleClick:d,onReconnect:St,onReconnectStart:gn,onReconnectEnd:Xt,onlyRenderVisibleElements:pe,onEdgeContextMenu:Be,onEdgeMouseEnter:Ue,onEdgeMouseMove:qe,onEdgeMouseLeave:nt,reconnectRadius:ct,defaultMarkerColor:J,noPanClassName:Kt,disableKeyboardA11y:kn,rfId:an}),g.jsx(kS,{style:M,type:j,component:T,containerStyle:P}),g.jsx("div",{className:"react-flow__edgelabel-renderer"}),g.jsx(Q_,{nodeTypes:t,onNodeClick:s,onNodeDoubleClick:c,onNodeMouseEnter:h,onNodeMouseMove:v,onNodeMouseLeave:b,onNodeContextMenu:S,nodeClickDistance:Ze,onlyRenderVisibleElements:pe,noPanClassName:Kt,noDragClassName:Qt,disableKeyboardA11y:kn,nodeExtent:fr,rfId:an}),g.jsx("div",{className:"react-flow__viewport-portal"})]})})}pg.displayName="GraphView";const CS=H.memo(pg),gm=({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:l,height:c,fitView:d,fitViewOptions:h,minZoom:v=.5,maxZoom:b=2,nodeOrigin:S,nodeExtent:x,zIndexMode:_="basic"}={})=>{const C=new Map,j=new Map,M=new Map,T=new Map,P=s??r??[],F=i??t??[],$=S??[0,0],R=x??$a;C0(M,T,P);const{nodesInitialized:V}=Rf(F,C,j,{nodeOrigin:$,nodeExtent:R,zIndexMode:_});let K=[0,0,1];if(d&&l&&c){const W=za(C,{filter:X=>!!((X.width||X.initialWidth)&&(X.height||X.initialHeight))}),{x:Q,y:pe,zoom:ke}=Gf(W,l,c,v,b,(h==null?void 0:h.padding)??.1);K=[Q,pe,ke]}return{rfId:"1",width:l??0,height:c??0,transform:K,nodes:F,nodesInitialized:V,nodeLookup:C,parentLookup:j,edges:P,edgeLookup:T,connectionLookup:M,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:v,maxZoom:b,translateExtent:$a,nodeExtent:R,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Is.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:$,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:d??!1,fitViewOptions:h,fitViewResolver:null,connection:{...l0},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:U1,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:a0,zIndexMode:_,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},jS=({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:l,height:c,fitView:d,fitViewOptions:h,minZoom:v,maxZoom:b,nodeOrigin:S,nodeExtent:x,zIndexMode:_})=>Wb((C,j)=>{async function M(){const{nodeLookup:T,panZoom:P,fitViewOptions:F,fitViewResolver:$,width:R,height:V,minZoom:K,maxZoom:W}=j();P&&(await H1({nodes:T,width:R,height:V,panZoom:P,minZoom:K,maxZoom:W},F),$==null||$.resolve(!0),C({fitViewResolver:null}))}return{...gm({nodes:t,edges:r,width:l,height:c,fitView:d,fitViewOptions:h,minZoom:v,maxZoom:b,nodeOrigin:S,nodeExtent:x,defaultNodes:i,defaultEdges:s,zIndexMode:_}),setNodes:T=>{const{nodeLookup:P,parentLookup:F,nodeOrigin:$,elevateNodesOnSelect:R,fitViewQueued:V,zIndexMode:K,nodesSelectionActive:W}=j(),{nodesInitialized:Q,hasSelectedNodes:pe}=Rf(T,P,F,{nodeOrigin:$,nodeExtent:x,elevateNodesOnSelect:R,checkEquality:!0,zIndexMode:K}),ke=W&&pe;V&&Q?(M(),C({nodes:T,nodesInitialized:Q,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:ke})):C({nodes:T,nodesInitialized:Q,nodesSelectionActive:ke})},setEdges:T=>{const{connectionLookup:P,edgeLookup:F}=j();C0(P,F,T),C({edges:T})},setDefaultNodesAndEdges:(T,P)=>{if(T){const{setNodes:F}=j();F(T),C({hasDefaultNodes:!0})}if(P){const{setEdges:F}=j();F(P),C({hasDefaultEdges:!0})}},updateNodeInternals:T=>{const{triggerNodeChanges:P,nodeLookup:F,parentLookup:$,domNode:R,nodeOrigin:V,nodeExtent:K,debug:W,fitViewQueued:Q,zIndexMode:pe}=j(),{changes:ke,updatedInternals:X}=fb(T,F,$,R,V,K,pe);X&&(ab(F,$,{nodeOrigin:V,nodeExtent:K,zIndexMode:pe}),Q?(M(),C({fitViewQueued:!1,fitViewOptions:void 0})):C({}),(ke==null?void 0:ke.length)>0&&(W&&console.log("React Flow: trigger node changes",ke),P==null||P(ke)))},updateNodePositions:(T,P=!1)=>{const F=[];let $=[];const{nodeLookup:R,triggerNodeChanges:V,connection:K,updateConnection:W,onNodesChangeMiddlewareMap:Q}=j();for(const[pe,ke]of T){const X=R.get(pe),ue=!!(X!=null&&X.expandParent&&(X!=null&&X.parentId)&&(ke!=null&&ke.position)),ve={id:pe,type:"position",position:ue?{x:Math.max(0,ke.position.x),y:Math.max(0,ke.position.y)}:ke.position,dragging:P};if(X&&K.inProgress&&K.fromNode.id===X.id){const D=Vi(X,K.fromHandle,tt.Left,!0);W({...K,from:D})}ue&&X.parentId&&F.push({id:pe,parentId:X.parentId,rect:{...ke.internals.positionAbsolute,width:ke.measured.width??0,height:ke.measured.height??0}}),$.push(ve)}if(F.length>0){const{parentLookup:pe,nodeOrigin:ke}=j(),X=rd(F,R,pe,ke);$.push(...X)}for(const pe of Q.values())$=pe($);V($)},triggerNodeChanges:T=>{const{onNodesChange:P,setNodes:F,nodes:$,hasDefaultNodes:R,debug:V}=j();if(T!=null&&T.length){if(R){const K=H0(T,$);F(K)}V&&console.log("React Flow: trigger node changes",T),P==null||P(T)}},triggerEdgeChanges:T=>{const{onEdgesChange:P,setEdges:F,edges:$,hasDefaultEdges:R,debug:V}=j();if(T!=null&&T.length){if(R){const K=V0(T,$);F(K)}V&&console.log("React Flow: trigger edge changes",T),P==null||P(T)}},addSelectedNodes:T=>{const{multiSelectionActive:P,edgeLookup:F,nodeLookup:$,triggerNodeChanges:R,triggerEdgeChanges:V}=j();if(P){const K=T.map(W=>Ri(W,!0));R(K);return}R(Es($,new Set([...T]),!0)),V(Es(F))},addSelectedEdges:T=>{const{multiSelectionActive:P,edgeLookup:F,nodeLookup:$,triggerNodeChanges:R,triggerEdgeChanges:V}=j();if(P){const K=T.map(W=>Ri(W,!0));V(K);return}V(Es(F,new Set([...T]))),R(Es($,new Set,!0))},unselectNodesAndEdges:({nodes:T,edges:P}={})=>{const{edges:F,nodes:$,nodeLookup:R,triggerNodeChanges:V,triggerEdgeChanges:K}=j(),W=T||$,Q=P||F,pe=[];for(const X of W){if(!X.selected)continue;const ue=R.get(X.id);ue&&(ue.selected=!1),pe.push(Ri(X.id,!1))}const ke=[];for(const X of Q)X.selected&&ke.push(Ri(X.id,!1));V(pe),K(ke)},setMinZoom:T=>{const{panZoom:P,maxZoom:F}=j();P==null||P.setScaleExtent([T,F]),C({minZoom:T})},setMaxZoom:T=>{const{panZoom:P,minZoom:F}=j();P==null||P.setScaleExtent([F,T]),C({maxZoom:T})},setTranslateExtent:T=>{var P;(P=j().panZoom)==null||P.setTranslateExtent(T),C({translateExtent:T})},resetSelectedElements:()=>{const{edges:T,nodes:P,triggerNodeChanges:F,triggerEdgeChanges:$,elementsSelectable:R}=j();if(!R)return;const V=P.reduce((W,Q)=>Q.selected?[...W,Ri(Q.id,!1)]:W,[]),K=T.reduce((W,Q)=>Q.selected?[...W,Ri(Q.id,!1)]:W,[]);F(V),$(K)},setNodeExtent:T=>{const{nodes:P,nodeLookup:F,parentLookup:$,nodeOrigin:R,elevateNodesOnSelect:V,nodeExtent:K,zIndexMode:W}=j();T[0][0]===K[0][0]&&T[0][1]===K[0][1]&&T[1][0]===K[1][0]&&T[1][1]===K[1][1]||(Rf(P,F,$,{nodeOrigin:R,nodeExtent:T,elevateNodesOnSelect:V,checkEquality:!1,zIndexMode:W}),C({nodeExtent:T}))},panBy:T=>{const{transform:P,width:F,height:$,panZoom:R,translateExtent:V}=j();return db({delta:T,panZoom:R,transform:P,translateExtent:V,width:F,height:$})},setCenter:async(T,P,F)=>{const{width:$,height:R,maxZoom:V,panZoom:K}=j();if(!K)return Promise.resolve(!1);const W=typeof(F==null?void 0:F.zoom)<"u"?F.zoom:V;return await K.setViewport({x:$/2-T*W,y:R/2-P*W,zoom:W},{duration:F==null?void 0:F.duration,ease:F==null?void 0:F.ease,interpolate:F==null?void 0:F.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{C({connection:{...l0}})},updateConnection:T=>{C({connection:T})},reset:()=>C({...gm()})}},Object.is);function PS({initialNodes:t,initialEdges:r,defaultNodes:i,defaultEdges:s,initialWidth:l,initialHeight:c,initialMinZoom:d,initialMaxZoom:h,initialFitViewOptions:v,fitView:b,nodeOrigin:S,nodeExtent:x,zIndexMode:_,children:C}){const[j]=H.useState(()=>jS({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:l,height:c,fitView:b,minZoom:d,maxZoom:h,fitViewOptions:v,nodeOrigin:S,nodeExtent:x,zIndexMode:_}));return g.jsx(Yb,{value:j,children:g.jsx(g_,{children:C})})}function $S({children:t,nodes:r,edges:i,defaultNodes:s,defaultEdges:l,width:c,height:d,fitView:h,fitViewOptions:v,minZoom:b,maxZoom:S,nodeOrigin:x,nodeExtent:_,zIndexMode:C}){return H.useContext(Au)?g.jsx(g.Fragment,{children:t}):g.jsx(PS,{initialNodes:r,initialEdges:i,defaultNodes:s,defaultEdges:l,initialWidth:c,initialHeight:d,fitView:h,initialFitViewOptions:v,initialMinZoom:b,initialMaxZoom:S,nodeOrigin:x,nodeExtent:_,zIndexMode:C,children:t})}const MS={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function IS({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,className:l,nodeTypes:c,edgeTypes:d,onNodeClick:h,onEdgeClick:v,onInit:b,onMove:S,onMoveStart:x,onMoveEnd:_,onConnect:C,onConnectStart:j,onConnectEnd:M,onClickConnectStart:T,onClickConnectEnd:P,onNodeMouseEnter:F,onNodeMouseMove:$,onNodeMouseLeave:R,onNodeContextMenu:V,onNodeDoubleClick:K,onNodeDragStart:W,onNodeDrag:Q,onNodeDragStop:pe,onNodesDelete:ke,onEdgesDelete:X,onDelete:ue,onSelectionChange:ve,onSelectionDragStart:D,onSelectionDrag:fe,onSelectionDragStop:J,onSelectionContextMenu:ae,onSelectionStart:B,onSelectionEnd:q,onBeforeDelete:Z,connectionMode:A,connectionLineType:U=pi.Bezier,connectionLineStyle:de,connectionLineComponent:_e,connectionLineContainerStyle:Te,deleteKeyCode:Oe="Backspace",selectionKeyCode:Re="Shift",selectionOnDrag:Se=!1,selectionMode:De=Ma.Full,panActivationKeyCode:Ne="Space",multiSelectionKeyCode:Ze=Ta()?"Meta":"Control",zoomActivationKeyCode:Be=Ta()?"Meta":"Control",snapToGrid:Ue,snapGrid:qe,onlyRenderVisibleElements:nt=!1,selectNodesOnDrag:ct,nodesDraggable:St,autoPanOnNodeFocus:gn,nodesConnectable:Xt,nodesFocusable:Qt,nodeOrigin:kt=F0,edgesFocusable:Kt,edgesReconnectable:kn,elementsSelectable:fr=!0,defaultViewport:an=a_,minZoom:Et=.5,maxZoom:Gt=2,translateExtent:yn=$a,preventScrolling:er=!0,nodeExtent:nn,defaultMarkerColor:Mn="#b1b1b7",zoomOnScroll:In=!0,zoomOnPinch:dr=!0,panOnScroll:ln=!1,panOnScrollSpeed:rn=.5,panOnScrollMode:Ye=zi.Free,zoomOnDoubleClick:_t=!0,panOnDrag:Tn=!0,onPaneClick:pr,onPaneMouseEnter:He,onPaneMouseMove:un,onPaneMouseLeave:An,onPaneScroll:Cr,onPaneContextMenu:Ht,paneClickDistance:qr=1,nodeClickDistance:Do=0,children:zo,onReconnect:zn,onReconnectStart:tr,onReconnectEnd:Fn,onEdgeContextMenu:hr,onEdgeDoubleClick:yt,onEdgeMouseEnter:It,onEdgeMouseMove:jr,onEdgeMouseLeave:nr,reconnectRadius:cn=10,onNodesChange:Bn,onEdgesChange:hi,noDragClassName:Hn="nodrag",noWheelClassName:mr="nowheel",noPanClassName:qt="nopan",fitView:gr,fitViewOptions:lo,connectOnClick:Vn,attributionPosition:uo,proOptions:On,defaultEdgeOptions:co,elevateNodesOnSelect:Wr=!0,elevateEdgesOnSelect:Nt=!1,disableKeyboardA11y:Un=!1,autoPanOnConnect:pt,autoPanOnNodeDrag:Fo,autoPanSpeed:yr,connectionRadius:Yr,isValidConnection:rr,onError:Rn,style:Xr,id:L,nodeDragThreshold:we,connectionDragThreshold:Ee,viewport:Qe,onViewportChange:Tt,width:Lt,height:Wt,colorMode:Jt="light",debug:Dt,onScroll:Vt,ariaLabelConfig:ht,zIndexMode:or="basic",...vr},vn){const xr=L||"1",fo=f_(Jt),wr=H.useCallback(mi=>{mi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Vt==null||Vt(mi)},[Vt]);return g.jsx("div",{"data-testid":"rf__wrapper",...vr,onScroll:wr,style:{...Xr,...MS},ref:vn,className:tn(["react-flow",l,fo]),id:L,role:"application",children:g.jsxs($S,{nodes:t,edges:r,width:Lt,height:Wt,fitView:gr,fitViewOptions:lo,minZoom:Et,maxZoom:Gt,nodeOrigin:kt,nodeExtent:nn,zIndexMode:or,children:[g.jsx(c_,{nodes:t,edges:r,defaultNodes:i,defaultEdges:s,onConnect:C,onConnectStart:j,onConnectEnd:M,onClickConnectStart:T,onClickConnectEnd:P,nodesDraggable:St,autoPanOnNodeFocus:gn,nodesConnectable:Xt,nodesFocusable:Qt,edgesFocusable:Kt,edgesReconnectable:kn,elementsSelectable:fr,elevateNodesOnSelect:Wr,elevateEdgesOnSelect:Nt,minZoom:Et,maxZoom:Gt,nodeExtent:nn,onNodesChange:Bn,onEdgesChange:hi,snapToGrid:Ue,snapGrid:qe,connectionMode:A,translateExtent:yn,connectOnClick:Vn,defaultEdgeOptions:co,fitView:gr,fitViewOptions:lo,onNodesDelete:ke,onEdgesDelete:X,onDelete:ue,onNodeDragStart:W,onNodeDrag:Q,onNodeDragStop:pe,onSelectionDrag:fe,onSelectionDragStart:D,onSelectionDragStop:J,onMove:S,onMoveStart:x,onMoveEnd:_,noPanClassName:qt,nodeOrigin:kt,rfId:xr,autoPanOnConnect:pt,autoPanOnNodeDrag:Fo,autoPanSpeed:yr,onError:Rn,connectionRadius:Yr,isValidConnection:rr,selectNodesOnDrag:ct,nodeDragThreshold:we,connectionDragThreshold:Ee,onBeforeDelete:Z,debug:Dt,ariaLabelConfig:ht,zIndexMode:or}),g.jsx(CS,{onInit:b,onNodeClick:h,onEdgeClick:v,onNodeMouseEnter:F,onNodeMouseMove:$,onNodeMouseLeave:R,onNodeContextMenu:V,onNodeDoubleClick:K,nodeTypes:c,edgeTypes:d,connectionLineType:U,connectionLineStyle:de,connectionLineComponent:_e,connectionLineContainerStyle:Te,selectionKeyCode:Re,selectionOnDrag:Se,selectionMode:De,deleteKeyCode:Oe,multiSelectionKeyCode:Ze,panActivationKeyCode:Ne,zoomActivationKeyCode:Be,onlyRenderVisibleElements:nt,defaultViewport:an,translateExtent:yn,minZoom:Et,maxZoom:Gt,preventScrolling:er,zoomOnScroll:In,zoomOnPinch:dr,zoomOnDoubleClick:_t,panOnScroll:ln,panOnScrollSpeed:rn,panOnScrollMode:Ye,panOnDrag:Tn,onPaneClick:pr,onPaneMouseEnter:He,onPaneMouseMove:un,onPaneMouseLeave:An,onPaneScroll:Cr,onPaneContextMenu:Ht,paneClickDistance:qr,nodeClickDistance:Do,onSelectionContextMenu:ae,onSelectionStart:B,onSelectionEnd:q,onReconnect:zn,onReconnectStart:tr,onReconnectEnd:Fn,onEdgeContextMenu:hr,onEdgeDoubleClick:yt,onEdgeMouseEnter:It,onEdgeMouseMove:jr,onEdgeMouseLeave:nr,reconnectRadius:cn,defaultMarkerColor:Mn,noDragClassName:Hn,noWheelClassName:mr,noPanClassName:qt,rfId:xr,disableKeyboardA11y:Un,nodeExtent:nn,viewport:Qe,onViewportChange:Tt}),g.jsx(s_,{onSelectionChange:ve}),zo,g.jsx(t_,{proOptions:On,position:uo}),g.jsx(e_,{rfId:xr,disableKeyboardA11y:Un})]})})}var TS=U0(IS);function AS(){const t=Mt();return H.useCallback(r=>{const{domNode:i,updateNodeInternals:s}=t.getState(),l=Array.isArray(r)?r:[r],c=new Map;l.forEach(d=>{const h=i==null?void 0:i.querySelector(`.react-flow__node[data-id="${d}"]`);h&&c.set(d,{id:d,nodeElement:h,force:!0})}),requestAnimationFrame(()=>s(c,{triggerFitView:!1}))},[])}function OS(t){const[r,i]=H.useState(t),s=H.useCallback(l=>i(c=>H0(l,c)),[]);return[r,i,s]}function RS(t){const[r,i]=H.useState(t),s=H.useCallback(l=>i(c=>V0(l,c)),[]);return[r,i,s]}function LS({dimensions:t,lineWidth:r,variant:i,className:s}){return g.jsx("path",{strokeWidth:r,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:tn(["react-flow__background-pattern",i,s])})}function DS({radius:t,className:r}){return g.jsx("circle",{cx:t,cy:t,r:t,className:tn(["react-flow__background-pattern","dots",r])})}var Oo;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Oo||(Oo={}));const zS={[Oo.Dots]:1,[Oo.Lines]:1,[Oo.Cross]:6},FS=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function hg({id:t,variant:r=Oo.Dots,gap:i=20,size:s,lineWidth:l=1,offset:c=0,color:d,bgColor:h,style:v,className:b,patternClassName:S}){const x=H.useRef(null),{transform:_,patternId:C}=vt(FS,Rt),j=s||zS[r],M=r===Oo.Dots,T=r===Oo.Cross,P=Array.isArray(i)?i:[i,i],F=[P[0]*_[2]||1,P[1]*_[2]||1],$=j*_[2],R=Array.isArray(c)?c:[c,c],V=T?[$,$]:F,K=[R[0]*_[2]||1+V[0]/2,R[1]*_[2]||1+V[1]/2],W=`${C}${t||""}`;return g.jsxs("svg",{className:tn(["react-flow__background",b]),style:{...v,...Ou,"--xy-background-color-props":h,"--xy-background-pattern-color-props":d},ref:x,"data-testid":"rf__background",children:[g.jsx("pattern",{id:W,x:_[0]%F[0],y:_[1]%F[1],width:F[0],height:F[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${K[0]},-${K[1]})`,children:M?g.jsx(DS,{radius:$/2,className:S}):g.jsx(LS,{dimensions:V,lineWidth:l,variant:r,className:S})}),g.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${W})`})]})}hg.displayName="Background";const BS=H.memo(hg);function HS(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:g.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function VS(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:g.jsx("path",{d:"M0 0h32v4.2H0z"})})}function US(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:g.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 KS(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:g.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 qS(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:g.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 eu({children:t,className:r,...i}){return g.jsx("button",{type:"button",className:tn(["react-flow__controls-button",r]),...i,children:t})}const WS=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function mg({style:t,showZoom:r=!0,showFitView:i=!0,showInteractive:s=!0,fitViewOptions:l,onZoomIn:c,onZoomOut:d,onFitView:h,onInteractiveChange:v,className:b,children:S,position:x="bottom-left",orientation:_="vertical","aria-label":C}){const j=Mt(),{isInteractive:M,minZoomReached:T,maxZoomReached:P,ariaLabelConfig:F}=vt(WS,Rt),{zoomIn:$,zoomOut:R,fitView:V}=od(),K=()=>{$(),c==null||c()},W=()=>{R(),d==null||d()},Q=()=>{V(l),h==null||h()},pe=()=>{j.setState({nodesDraggable:!M,nodesConnectable:!M,elementsSelectable:!M}),v==null||v(!M)},ke=_==="horizontal"?"horizontal":"vertical";return g.jsxs(Ha,{className:tn(["react-flow__controls",ke,b]),position:x,style:t,"data-testid":"rf__controls","aria-label":C??F["controls.ariaLabel"],children:[r&&g.jsxs(g.Fragment,{children:[g.jsx(eu,{onClick:K,className:"react-flow__controls-zoomin",title:F["controls.zoomIn.ariaLabel"],"aria-label":F["controls.zoomIn.ariaLabel"],disabled:P,children:g.jsx(HS,{})}),g.jsx(eu,{onClick:W,className:"react-flow__controls-zoomout",title:F["controls.zoomOut.ariaLabel"],"aria-label":F["controls.zoomOut.ariaLabel"],disabled:T,children:g.jsx(VS,{})})]}),i&&g.jsx(eu,{className:"react-flow__controls-fitview",onClick:Q,title:F["controls.fitView.ariaLabel"],"aria-label":F["controls.fitView.ariaLabel"],children:g.jsx(US,{})}),s&&g.jsx(eu,{className:"react-flow__controls-interactive",onClick:pe,title:F["controls.interactive.ariaLabel"],"aria-label":F["controls.interactive.ariaLabel"],children:M?g.jsx(qS,{}):g.jsx(KS,{})}),S]})}mg.displayName="Controls";const YS=H.memo(mg);function XS({id:t,x:r,y:i,width:s,height:l,style:c,color:d,strokeColor:h,strokeWidth:v,className:b,borderRadius:S,shapeRendering:x,selected:_,onClick:C}){const{background:j,backgroundColor:M}=c||{},T=d||j||M;return g.jsx("rect",{className:tn(["react-flow__minimap-node",{selected:_},b]),x:r,y:i,rx:S,ry:S,width:s,height:l,style:{fill:T,stroke:h,strokeWidth:v},shapeRendering:x,onClick:C?P=>C(P,t):void 0})}const QS=H.memo(XS),GS=t=>t.nodes.map(r=>r.id),yf=t=>t instanceof Function?t:()=>t;function JS({nodeStrokeColor:t,nodeColor:r,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:l,nodeComponent:c=QS,onClick:d}){const h=vt(GS,Rt),v=yf(r),b=yf(t),S=yf(i),x=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return g.jsx(g.Fragment,{children:h.map(_=>g.jsx(ek,{id:_,nodeColorFunc:v,nodeStrokeColorFunc:b,nodeClassNameFunc:S,nodeBorderRadius:s,nodeStrokeWidth:l,NodeComponent:c,onClick:d,shapeRendering:x},_))})}function ZS({id:t,nodeColorFunc:r,nodeStrokeColorFunc:i,nodeClassNameFunc:s,nodeBorderRadius:l,nodeStrokeWidth:c,shapeRendering:d,NodeComponent:h,onClick:v}){const{node:b,x:S,y:x,width:_,height:C}=vt(j=>{const M=j.nodeLookup.get(t);if(!M)return{node:void 0,x:0,y:0,width:0,height:0};const T=M.internals.userNode,{x:P,y:F}=M.internals.positionAbsolute,{width:$,height:R}=Lo(T);return{node:T,x:P,y:F,width:$,height:R}},Rt);return!b||b.hidden||!m0(b)?null:g.jsx(h,{x:S,y:x,width:_,height:C,style:b.style,selected:!!b.selected,className:s(b),color:r(b),borderRadius:l,strokeColor:i(b),strokeWidth:c,shapeRendering:d,onClick:v,id:b.id})}const ek=H.memo(ZS);var tk=H.memo(JS);const nk=200,rk=150,ok=t=>!t.hidden,ik=t=>{const r={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:r,boundingRect:t.nodeLookup.size>0?h0(za(t.nodeLookup,{filter:ok}),r):r,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},sk="react-flow__minimap-desc";function gg({style:t,className:r,nodeStrokeColor:i,nodeColor:s,nodeClassName:l="",nodeBorderRadius:c=5,nodeStrokeWidth:d,nodeComponent:h,bgColor:v,maskColor:b,maskStrokeColor:S,maskStrokeWidth:x,position:_="bottom-right",onClick:C,onNodeClick:j,pannable:M=!1,zoomable:T=!1,ariaLabel:P,inversePan:F,zoomStep:$=1,offsetScale:R=5}){const V=Mt(),K=H.useRef(null),{boundingRect:W,viewBB:Q,rfId:pe,panZoom:ke,translateExtent:X,flowWidth:ue,flowHeight:ve,ariaLabelConfig:D}=vt(ik,Rt),fe=(t==null?void 0:t.width)??nk,J=(t==null?void 0:t.height)??rk,ae=W.width/fe,B=W.height/J,q=Math.max(ae,B),Z=q*fe,A=q*J,U=R*q,de=W.x-(Z-W.width)/2-U,_e=W.y-(A-W.height)/2-U,Te=Z+U*2,Oe=A+U*2,Re=`${sk}-${pe}`,Se=H.useRef(0),De=H.useRef();Se.current=q,H.useEffect(()=>{if(K.current&&ke)return De.current=bb({domNode:K.current,panZoom:ke,getTransform:()=>V.getState().transform,getViewScale:()=>Se.current}),()=>{var Ue;(Ue=De.current)==null||Ue.destroy()}},[ke]),H.useEffect(()=>{var Ue;(Ue=De.current)==null||Ue.update({translateExtent:X,width:ue,height:ve,inversePan:F,pannable:M,zoomStep:$,zoomable:T})},[M,T,F,$,X,ue,ve]);const Ne=C?Ue=>{var ct;const[qe,nt]=((ct=De.current)==null?void 0:ct.pointer(Ue))||[0,0];C(Ue,{x:qe,y:nt})}:void 0,Ze=j?H.useCallback((Ue,qe)=>{const nt=V.getState().nodeLookup.get(qe).internals.userNode;j(Ue,nt)},[]):void 0,Be=P??D["minimap.ariaLabel"];return g.jsx(Ha,{position:_,style:{...t,"--xy-minimap-background-color-props":typeof v=="string"?v:void 0,"--xy-minimap-mask-background-color-props":typeof b=="string"?b:void 0,"--xy-minimap-mask-stroke-color-props":typeof S=="string"?S:void 0,"--xy-minimap-mask-stroke-width-props":typeof x=="number"?x*q:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-width-props":typeof d=="number"?d:void 0},className:tn(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:g.jsxs("svg",{width:fe,height:J,viewBox:`${de} ${_e} ${Te} ${Oe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Re,ref:K,onClick:Ne,children:[Be&&g.jsx("title",{id:Re,children:Be}),g.jsx(tk,{onClick:Ze,nodeColor:s,nodeStrokeColor:i,nodeBorderRadius:c,nodeClassName:l,nodeStrokeWidth:d,nodeComponent:h}),g.jsx("path",{className:"react-flow__minimap-mask",d:`M${de-U},${_e-U}h${Te+U*2}v${Oe+U*2}h${-Te-U*2}z
|
|
202
|
+
M${Q.x},${Q.y}h${Q.width}v${Q.height}h${-Q.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}gg.displayName="MiniMap";const ak=H.memo(gg),lk=t=>r=>t?`${Math.max(1/r.transform[2],1)}`:void 0,uk={[Rs.Line]:"right",[Rs.Handle]:"bottom-right"};function ck({nodeId:t,position:r,variant:i=Rs.Handle,className:s,style:l=void 0,children:c,color:d,minWidth:h=10,minHeight:v=10,maxWidth:b=Number.MAX_VALUE,maxHeight:S=Number.MAX_VALUE,keepAspectRatio:x=!1,resizeDirection:_,autoScale:C=!0,shouldResize:j,onResizeStart:M,onResize:T,onResizeEnd:P}){const F=Y0(),$=typeof t=="string"?t:F,R=Mt(),V=H.useRef(null),K=i===Rs.Handle,W=vt(H.useCallback(lk(K&&C),[K,C]),Rt),Q=H.useRef(null),pe=r??uk[i];H.useEffect(()=>{if(!(!V.current||!$))return Q.current||(Q.current=Ob({domNode:V.current,nodeId:$,getStoreItems:()=>{const{nodeLookup:X,transform:ue,snapGrid:ve,snapToGrid:D,nodeOrigin:fe,domNode:J}=R.getState();return{nodeLookup:X,transform:ue,snapGrid:ve,snapToGrid:D,nodeOrigin:fe,paneDomNode:J}},onChange:(X,ue)=>{const{triggerNodeChanges:ve,nodeLookup:D,parentLookup:fe,nodeOrigin:J}=R.getState(),ae=[],B={x:X.x,y:X.y},q=D.get($);if(q&&q.expandParent&&q.parentId){const Z=q.origin??J,A=X.width??q.measured.width??0,U=X.height??q.measured.height??0,de={id:q.id,parentId:q.parentId,rect:{width:A,height:U,...g0({x:X.x??q.position.x,y:X.y??q.position.y},{width:A,height:U},q.parentId,D,Z)}},_e=rd([de],D,fe,J);ae.push(..._e),B.x=X.x?Math.max(Z[0]*A,X.x):void 0,B.y=X.y?Math.max(Z[1]*U,X.y):void 0}if(B.x!==void 0&&B.y!==void 0){const Z={id:$,type:"position",position:{...B}};ae.push(Z)}if(X.width!==void 0&&X.height!==void 0){const A={id:$,type:"dimensions",resizing:!0,setAttributes:_?_==="horizontal"?"width":"height":!0,dimensions:{width:X.width,height:X.height}};ae.push(A)}for(const Z of ue){const A={...Z,type:"position"};ae.push(A)}ve(ae)},onEnd:({width:X,height:ue})=>{const ve={id:$,type:"dimensions",resizing:!1,dimensions:{width:X,height:ue}};R.getState().triggerNodeChanges([ve])}})),Q.current.update({controlPosition:pe,boundaries:{minWidth:h,minHeight:v,maxWidth:b,maxHeight:S},keepAspectRatio:x,resizeDirection:_,onResizeStart:M,onResize:T,onResizeEnd:P,shouldResize:j}),()=>{var X;(X=Q.current)==null||X.destroy()}},[pe,h,v,b,S,x,M,T,P,j]);const ke=pe.split("-");return g.jsx("div",{className:tn(["react-flow__resize-control","nodrag",...ke,i,s]),ref:V,style:{...l,scale:W,...d&&{[K?"backgroundColor":"borderColor"]:d}},children:c})}H.memo(ck);const fk={get:"bg-emerald-500/20 text-emerald-200 border-emerald-500/45",post:"bg-sky-500/20 text-sky-200 border-sky-500/45",put:"bg-amber-500/20 text-amber-200 border-amber-500/45",patch:"bg-violet-500/20 text-violet-200 border-violet-500/45",delete:"bg-rose-500/20 text-rose-200 border-rose-500/45",head:"bg-slate-500/25 text-slate-300 border-slate-500/45",options:"bg-slate-500/25 text-slate-300 border-slate-500/45",trace:"bg-slate-500/25 text-slate-300 border-slate-500/45"};function Na({method:t,className:r="",size:i="sm"}){const s=t.toLowerCase().trim(),l=fk[s]??"bg-accent/15 text-accent border-accent/40",c=i==="md"?"text-xs px-2.5 py-1 min-w-[3.25rem] justify-center":"text-[10px] px-1.5 py-0.5 min-w-[2.75rem] justify-center";return g.jsx("span",{className:`inline-flex items-center rounded-md font-semibold uppercase tracking-wide border shrink-0 transition-colors duration-200 ${l} ${c} ${r}`,children:t.toUpperCase()})}function sd(t,r,i){var c,d;const s=r.toLowerCase(),l=(d=(c=t.paths)==null?void 0:c[i])==null?void 0:d[s];return(l==null?void 0:l.summary)??(l==null?void 0:l.operationId)??`${r.toUpperCase()} ${i}`}function ad(t,r,i){var h,v,b,S;const s=r.toLowerCase(),l=(v=(h=t.paths)==null?void 0:h[i])==null?void 0:v[s];if(!(l!=null&&l.requestBody))return"— sin body";const d=(S=(b=l.requestBody.content)==null?void 0:b["application/json"])==null?void 0:S.schema;return d&&"$ref"in d?`body: ${d.$ref}`:"body: JSON"}function ld(t,r,i){var h,v,b,S,x,_;const s=r.toLowerCase(),l=(v=(h=t.paths)==null?void 0:h[i])==null?void 0:v[s],c=((b=l==null?void 0:l.responses)==null?void 0:b["200"])??((S=l==null?void 0:l.responses)==null?void 0:S["201"]);if(!c)return"—";const d=typeof c=="object"&&c&&"content"in c?(_=(x=c.content)==null?void 0:x["application/json"])==null?void 0:_.schema:void 0;return d&&"$ref"in d?String(d.$ref):"JSON"}const uu=()=>({sourceJsonPath:"$",variableName:"v",useInTarget:"vars_only",targetKey:""});function vf(t,r){return`${t.toLowerCase()} ${r}`}function dk(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}const yg=H.createContext(null);function pk(t){const{id:r,selected:i}=t,s=t.data,l=H.useContext(yg),c=AS();return H.useEffect(()=>{c(r)},[s.path,s.method,r,c]),g.jsxs("div",{className:`rounded-xl border bg-surface-950/90 px-3 py-2 min-w-[200px] max-w-[280px] shadow-lg ${i?"border-accent ring-2 ring-accent/40":"border-surface-600"}`,children:[g.jsx(Ls,{type:"target",position:tt.Left,id:"in",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-teal-500"}),g.jsxs("div",{className:"flex items-center gap-2 mb-1 min-w-0",children:[g.jsx(Na,{method:s.method}),g.jsx("span",{className:"text-[10px] text-slate-500 truncate",title:s.summary,children:s.summary})]}),l?g.jsxs("label",{className:"block text-[10px] text-slate-500 mb-1",children:["Endpoint",g.jsx("select",{className:"mt-0.5 w-full bg-surface-900 border border-surface-600 rounded px-1.5 py-1 text-[11px] font-mono",value:vf(s.method,s.path),onChange:d=>{const{method:h,path:v}=dk(d.target.value);l.updateNodeData(r,{method:h,path:v,summary:sd(l.doc,h,v),reqHint:ad(l.doc,h,v),resHint:ld(l.doc,h,v)})},children:l.ops.map(d=>g.jsxs("option",{value:vf(d.method,d.path),children:[d.method.toUpperCase()," ",d.path]},vf(d.method,d.path)))})]}):g.jsx("p",{className:"font-mono text-[11px] text-slate-300 truncate",children:s.path}),g.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-1 text-[9px] text-slate-500 leading-tight",children:[g.jsxs("div",{children:[g.jsx("span",{className:"text-slate-600",children:"req"})," ",s.reqHint]}),g.jsxs("div",{children:[g.jsx("span",{className:"text-slate-600",children:"res"})," ",s.resHint]})]}),g.jsx(Ls,{type:"source",position:tt.Right,id:"out",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-amber-500"})]})}const hk={apiOp:pk};function mk(t,r){const i=r.nodes.map(l=>({id:l.id,type:"apiOp",position:{x:l.x,y:l.y},data:{method:l.method.toLowerCase(),path:l.path,summary:sd(t,l.method,l.path),reqHint:ad(t,l.method,l.path),resHint:ld(t,l.method,l.path)}})),s=r.edges.map(l=>({id:l.id,source:l.source,target:l.target,sourceHandle:"out",targetHandle:"in",data:{mapping:{...l.mapping}},label:l.mapping.variableName,style:{stroke:"rgb(148 163 184 / 0.9)",strokeWidth:2}}));return{nodes:i,edges:s}}function gk(t,r){return{nodes:t.map(i=>({id:i.id,method:i.data.method,path:i.data.path,x:i.position.x,y:i.position.y})),edges:r.map(i=>{var s;return{id:i.id,source:i.source,target:i.target,mapping:((s=i.data)==null?void 0:s.mapping)??uu()}})}}const yk=[{value:"vars_only",label:"Solo variable ({nombre} en la ruta)"},{value:"path_param",label:"Path param {clave}"},{value:"header",label:"Header"},{value:"query",label:"Query string"}];function vk({doc:t,ops:r,graph:i,onGraphChange:s}){var $,R,V,K,W,Q,pe,ke;const l=H.useMemo(()=>mk(t,i),[t,i]),[c,d,h]=OS(l.nodes),[v,b,S]=RS(l.edges),[x,_]=H.useState(null);H.useEffect(()=>{s(gk(c,v))},[c,v,s]);const C=H.useCallback((X,ue)=>{d(ve=>ve.map(D=>D.id===X?{...D,data:{...D.data,...ue}}:D))},[d]),j=H.useMemo(()=>({doc:t,ops:r,updateNodeData:C}),[t,r,C]),M=H.useCallback(X=>{X.sourceHandle!=="out"||X.targetHandle!=="in"||b(ue=>S0({...X,id:`e-${X.source}-${X.target}-${crypto.randomUUID().slice(0,8)}`,sourceHandle:"out",targetHandle:"in",data:{mapping:uu()},label:uu().variableName,style:{stroke:"rgb(148 163 184 / 0.9)",strokeWidth:2}},ue))},[b]),T=v.find(X=>X.id===x),P=X=>{x&&b(ue=>ue.map(ve=>{var fe;if(ve.id!==x)return ve;const D={...((fe=ve.data)==null?void 0:fe.mapping)??uu(),...X};return{...ve,data:{mapping:D},label:D.variableName}}))},F=()=>{const X=c.reduce((ae,B)=>B.position.x>ae?B.position.x:ae,0),ue=r[0];if(!ue)return;const ve=crypto.randomUUID(),D=X>0?X+40:80,J={id:ve,type:"apiOp",position:{x:D,y:120},data:{method:ue.method.toLowerCase(),path:ue.path,summary:sd(t,ue.method,ue.path),reqHint:ad(t,ue.method,ue.path),resHint:ld(t,ue.method,ue.path)}};d(ae=>[...ae,J])};return g.jsx(yg.Provider,{value:j,children:g.jsxs("div",{className:"space-y-3",children:[g.jsx("div",{className:"h-[min(520px,70vh)] w-full rounded-xl border border-surface-700 bg-surface-950",children:g.jsxs(TS,{nodes:c,edges:v,onNodesChange:h,onEdgesChange:S,onConnect:M,nodeTypes:hk,onEdgeClick:(X,ue)=>_(ue.id),onPaneClick:()=>_(null),fitView:!0,minZoom:.4,maxZoom:1.5,proOptions:{hideAttribution:!0},isValidConnection:X=>X.sourceHandle==="out"&&X.targetHandle==="in",children:[g.jsx(BS,{variant:Oo.Dots,gap:16,size:1,color:"rgb(51 65 85 / 0.5)"}),g.jsx(YS,{className:"!bg-surface-900 !border-surface-600 !shadow-lg"}),g.jsx(ak,{className:"!bg-surface-900/95 !border-surface-600",nodeColor:()=>"rgb(45 212 191 / 0.5)"}),g.jsx(Ha,{position:"top-left",children:g.jsx("button",{type:"button",onClick:F,className:"text-xs px-3 py-2 rounded-lg bg-accent/90 text-surface-950 font-medium shadow",children:"+ Nodo (endpoint)"})})]})}),g.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[g.jsx("h4",{className:"text-xs font-semibold text-slate-300",children:"Cable seleccionado (respuesta → request)"}),T?g.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs",children:[g.jsxs("label",{className:"text-slate-500",children:["JSON path en la respuesta",g.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:(($=T.data)==null?void 0:$.mapping.sourceJsonPath)??"$",onChange:X=>P({sourceJsonPath:X.target.value}),placeholder:"$.access_token"})]}),g.jsxs("label",{className:"text-slate-500",children:["Nombre de variable",g.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5",value:((R=T.data)==null?void 0:R.mapping.variableName)??"",onChange:X=>P({variableName:X.target.value}),placeholder:"token"})]}),g.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Cómo se usa en el request del nodo destino",g.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5",value:((V=T.data)==null?void 0:V.mapping.useInTarget)??"vars_only",onChange:X=>P({useInTarget:X.target.value}),children:yk.map(X=>g.jsx("option",{value:X.value,children:X.label},X.value))})]}),(((K=T.data)==null?void 0:K.mapping.useInTarget)==="path_param"||((W=T.data)==null?void 0:W.mapping.useInTarget)==="header"||((Q=T.data)==null?void 0:Q.mapping.useInTarget)==="query")&&g.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Clave (nombre del param / header / query)",g.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:((pe=T.data)==null?void 0:pe.mapping.targetKey)??"",onChange:X=>P({targetKey:X.target.value}),placeholder:"id / Authorization / q"})]}),g.jsxs("p",{className:"sm:col-span-2 text-[11px] text-slate-500 leading-relaxed",children:["El valor extraído se guarda en la variable y, según la opción, se inyecta en la ruta"," ",g.jsx("code",{className:"text-accent",children:"{clave}"}),", en un header, o en query. Con «solo variable», usa"," ",g.jsx("code",{className:"text-accent",children:"{"+(((ke=T.data)==null?void 0:ke.mapping.variableName)||"var")+"}"})," ","en la ruta del endpoint destino."]})]}):g.jsx("p",{className:"text-xs text-slate-500",children:"Conecta la salida derecha (res) de un nodo con la entrada izquierda (req) de otro. Haz clic en un cable para definir el mapeo."})]})]})})}function vg(t,r){const i=new Map(t.map(v=>[v.id,v])),s=new Set(t.map(v=>v.id)),l=new Map,c=new Map;for(const v of s)l.set(v,0),c.set(v,[]);for(const v of r)!s.has(v.source)||!s.has(v.target)||(l.set(v.target,(l.get(v.target)??0)+1),c.get(v.source).push(v.target));const d=[];for(const[v,b]of l)b===0&&d.push(v);d.sort((v,b)=>i.get(v).x-i.get(b).x||i.get(v).y-i.get(b).y);const h=[];for(;d.length;){const v=d.shift();h.push(v);for(const b of c.get(v)??[]){const S=(l.get(b)??0)-1;l.set(b,S),S===0&&(d.push(b),d.sort((x,_)=>i.get(x).x-i.get(_).x||i.get(x).y-i.get(_).y))}}if(h.length<t.length){const v=t.filter(b=>!h.includes(b.id)).sort((b,S)=>b.x-S.x||b.y-S.y);return[...h.map(b=>i.get(b)),...v]}return h.map(v=>i.get(v))}async function ym(t,r,i){var v;const{nodes:s,edges:l}=t;if(s.length===0)return"Sin nodos en el flujo.";const c=vg(s,l),d={};let h="";for(let b=0;b<c.length;b++){const S=c[b];let x=S.path;const _={...i()},C=l.filter(V=>V.target===S.id);for(const V of C){const{mapping:K}=V,W=d[K.variableName];if(W!==void 0)switch(K.useInTarget){case"path_param":K.targetKey&&(x=x.split(`{${K.targetKey}}`).join(W));break;case"header":if(K.targetKey){const Q=K.targetKey;_[Q]=Q.toLowerCase()==="authorization"&&!W.startsWith("Bearer ")?`Bearer ${W}`:W}break;case"query":{const Q=x.includes("?")?"&":"?";x=`${x}${Q}${encodeURIComponent(K.targetKey)}=${encodeURIComponent(W)}`;break}case"vars_only":default:x=x.split(`{${K.variableName}}`).join(W);break}}for(const[V,K]of Object.entries(d))x=x.split(`{${V}}`).join(K);const j=`${r.replace(/\/$/,"")}${x}`,M={method:S.method.toUpperCase(),headers:_},T=S.method.toLowerCase();T!=="get"&&T!=="head"&&(M.body="{}");const P=await fetch(j,{...M,credentials:"include"});let F={};const $=await P.text();try{F=$?JSON.parse($):{}}catch{F={_raw:$}}h+=`▸ ${S.method.toUpperCase()} ${S.path} → ${P.status}
|
|
203
|
+
${JSON.stringify(F,null,2)}
|
|
204
|
+
|
|
205
|
+
`;const R=l.filter(V=>V.source===S.id);for(const V of R){const K=((v=V.mapping.sourceJsonPath)==null?void 0:v.trim())||"$",W=Bf(F,K);W!=null&&(d[V.mapping.variableName]=typeof W=="object"?JSON.stringify(W):String(W))}}return h+=`
|
|
206
|
+
Variables finales: ${JSON.stringify(d,null,2)}`,h}function xk(t){const r=vg(t.nodes,t.edges);return r.map((i,s)=>{const l=r[s+1];if(!l)return{method:i.method,path:i.path};const c=t.edges.find(d=>d.source===i.id&&d.target===l.id);return c?{method:i.method,path:i.path,extract:{varName:c.mapping.variableName,jsonPath:c.mapping.sourceJsonPath||"$"}}:{method:i.method,path:i.path}})}function wk(t){var s;const r=t.map((l,c)=>({id:`n-${c}`,method:l.method,path:l.path,x:40+c*300,y:120})),i=[];for(let l=0;l<t.length-1;l++){const c=(s=t[l])==null?void 0:s.extract;c!=null&&c.jsonPath&&i.push({id:`e-${l}`,source:`n-${l}`,target:`n-${l+1}`,mapping:{sourceJsonPath:c.jsonPath,variableName:c.varName,useInTarget:"vars_only",targetKey:""}})}return{nodes:r,edges:i}}const xg=H.createContext({productName:null,logoDataUrl:null});function bk({value:t,children:r}){return g.jsx(xg.Provider,{value:t,children:r})}function _k(){return H.useContext(xg)}function Sk({data:t,defaultOpenDepth:r=3}){return g.jsx("div",{className:"json-tree text-[11px] font-mono leading-relaxed text-left overflow-auto max-h-80 rounded-lg border border-surface-700 bg-surface-950/80 p-2",children:g.jsx(ud,{value:t,depth:0,defaultOpenDepth:r})})}function ud({value:t,depth:r,defaultOpenDepth:i,name:s}){return t===null||typeof t!="object"?g.jsx(kk,{name:s,value:t}):Array.isArray(t)?g.jsx(Nk,{name:s,value:t,depth:r,defaultOpenDepth:i}):g.jsx(Ek,{name:s,value:t,depth:r,defaultOpenDepth:i})}function kk({name:t,value:r}){return g.jsxs("div",{className:"pl-1 break-all",children:[t!=null&&g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),g.jsx("span",{className:"text-slate-500",children:": "})]}),g.jsx("span",{className:"text-emerald-200/95",children:JSON.stringify(r)})]})}function Nk({name:t,value:r,depth:i,defaultOpenDepth:s}){const l=i<s,[c,d]=H.useState(l);return r.length===0?g.jsxs("div",{className:"pl-1",children:[t!=null&&g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),g.jsx("span",{className:"text-slate-500",children:": "})]}),g.jsx("span",{className:"text-slate-500",children:"[]"})]}):g.jsxs("div",{className:"pl-1",children:[t!=null&&g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),g.jsx("span",{className:"text-slate-500",children:": "})]}),g.jsx("button",{type:"button","aria-expanded":c,onClick:()=>d(!c),className:"inline align-middle text-slate-400 hover:text-slate-200 mr-1 select-none w-4",children:c?"▼":"▶"}),g.jsx("span",{className:"text-slate-500",children:"["}),g.jsx("span",{className:"text-slate-600 text-[10px] ml-1",children:r.length}),c&&g.jsx("ul",{className:"list-none my-0.5 ml-4 border-l border-surface-600 pl-2 space-y-0.5",children:r.map((h,v)=>g.jsxs("li",{children:[g.jsx("span",{className:"text-violet-400/90 mr-1",children:v}),g.jsx(ud,{value:h,depth:i+1,defaultOpenDepth:s})]},v))}),!c&&g.jsx("span",{className:"text-slate-600",children:" … "}),g.jsx("span",{className:"text-slate-500",children:"]"})]})}function Ek({name:t,value:r,depth:i,defaultOpenDepth:s}){const l=Object.keys(r),c=i<s,[d,h]=H.useState(c);return l.length===0?g.jsxs("div",{className:"pl-1",children:[t!=null&&g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),g.jsx("span",{className:"text-slate-500",children:": "})]}),g.jsx("span",{className:"text-slate-500",children:"{}"})]}):g.jsxs("div",{className:"pl-1",children:[t!=null&&g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),g.jsx("span",{className:"text-slate-500",children:": "})]}),g.jsx("button",{type:"button","aria-expanded":d,onClick:()=>h(!d),className:"inline align-middle text-slate-400 hover:text-slate-200 mr-1 select-none w-4",children:d?"▼":"▶"}),g.jsx("span",{className:"text-slate-500",children:"{"}),g.jsx("span",{className:"text-slate-600 text-[10px] ml-1",children:l.length}),d&&g.jsx("ul",{className:"list-none my-0.5 ml-4 border-l border-surface-600 pl-2 space-y-0.5",children:l.map(v=>g.jsx("li",{children:g.jsx(ud,{name:v,value:r[v],depth:i+1,defaultOpenDepth:s})},v))}),!d&&g.jsx("span",{className:"text-slate-600",children:" … "}),g.jsx("span",{className:"text-slate-500",children:"}"})]})}function cd(t,r){if(!r.startsWith("#/"))return;const i=r.slice(2).split("/");let s=t;for(const l of i)if(s&&typeof s=="object"&&l in s)s=s[l];else return;return s}function Ck(t,r){return"$ref"in r?cd(t,r.$ref):r}function vm(t,r){return"$ref"in r?cd(t,r.$ref):r}function wg(t,r,i){var b;const s=(b=t.paths)==null?void 0:b[i],l=s==null?void 0:s[r.toLowerCase()];if(!l)return[];const c=(s==null?void 0:s.parameters)??[],d=l.parameters??[],h=new Set,v=[];for(const S of[...c,...d]){const x=Ck(t,S);if(!x||!["query","path","header","cookie"].includes(x.in))continue;const _=`${x.in}:${x.name}`;h.has(_)||(h.add(_),v.push({name:x.name,in:x.in,required:!!x.required,description:typeof x.description=="string"?x.description:void 0}))}return v}function Ff(t,r,i){var v,b,S,x;const s=(b=(v=t.paths)==null?void 0:v[i])==null?void 0:b[r.toLowerCase()];if(!(s!=null&&s.requestBody))return null;const l=s.requestBody,c="$ref"in l?cd(t,l.$ref):l;if(!((x=(S=c==null?void 0:c.content)==null?void 0:S["application/json"])!=null&&x.schema))return null;const d=c.content["application/json"].schema,h=vm(t,d);if(!h)return null;if(h.type==="object"&&h.properties&&Object.keys(h.properties).length>0){const _=new Set(h.required??[]);return Object.keys(h.properties).map(C=>{const j=h.properties[C],M=j&&"$ref"in j?vm(t,j):j;return{key:C,required:_.has(C),description:M==null?void 0:M.description,format:M==null?void 0:M.format,type:M==null?void 0:M.type}})}return null}function jk(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function bg(t,r){let i=t;for(const[s,l]of Object.entries(r))i=i.replace(new RegExp(`\\{${jk(s)}\\}`,"g"),encodeURIComponent(l));return i}function _g(t,r){const i=new URLSearchParams;for(const l of r){if(l.in!=="query")continue;const c=t[l.name];c!==void 0&&c!==""&&i.set(l.name,c)}const s=i.toString();return s?`?${s}`:""}function fd(t,r){var s;if(!(t!=null&&t.length))return{};const i={};for(const l of t){const c=((s=r[l.key])==null?void 0:s.trim())??"";if(c==="")continue;const d=l.type;if(d==="integer"||d==="number"){const h=Number(c);i[l.key]=Number.isFinite(h)?h:c}else if(d==="boolean")i[l.key]=c==="true"||c==="1";else try{i[l.key]=JSON.parse(c)}catch{i[l.key]=c}}return i}function xm(t,r){const i=fd(t,r);return JSON.stringify(i,null,2)}function Pk(t,r){if(!(t!=null&&t.length))return{};try{const i=JSON.parse(r||"{}"),s={};for(const l of t)if(l.key in i&&i[l.key]!==void 0){const c=i[l.key];s[l.key]=typeof c=="string"?c:JSON.stringify(c)}else s[l.key]="";return s}catch{return Object.fromEntries(t.map(i=>[i.key,""]))}}function Sg(t){return/\{[^/}]+\}/.test(t)}function $k(t,r,i,s,l){var h,v;const c={...t};for(const b of r){const S=(h=i[b.name])==null?void 0:h.trim();S&&(c[b.name]=S)}const d=[];for(const b of s){const S=(v=l[b.name])==null?void 0:v.trim();S&&d.push(`${b.name}=${S}`)}return d.length&&(c.Cookie=c.Cookie?`${c.Cookie}; ${d.join("; ")}`:d.join("; ")),c}function Mk(t,r,i,s,l){var $,R,V,K,W;const c=wg(t,r.method,r.path),d=c.filter(Q=>Q.in==="path"),h=c.filter(Q=>Q.in==="query"),v=c.filter(Q=>Q.in==="header"),b=c.filter(Q=>Q.in==="cookie"),S=Ff(t,r.method,r.path),x=r.method.toLowerCase(),_=x!=="get"&&x!=="head";for(const Q of d)if(Q.required&&!(($=l.pathVals[Q.name])!=null&&$.trim()))return{ok:!1,error:`Parámetro de ruta obligatorio: ${Q.name}`};for(const Q of h)if(Q.required&&!((R=l.queryVals[Q.name])!=null&&R.trim()))return{ok:!1,error:`Query obligatorio: ${Q.name}`};for(const Q of v)if(Q.required&&!((V=l.headerVals[Q.name])!=null&&V.trim()))return{ok:!1,error:`Header obligatorio: ${Q.name}`};for(const Q of b)if(Q.required&&!((K=l.cookieVals[Q.name])!=null&&K.trim()))return{ok:!1,error:`Cookie obligatorio: ${Q.name}`};let C=bg(r.path,l.pathVals);if(Sg(C))return{ok:!1,error:"Quedan placeholders `{…}` en la ruta sin valor."};const j=_g(l.queryVals,c),T=`${To(t,i)}${C}${j}`,P=$k(s(),v,l.headerVals,b,l.cookieVals);let F;if(_)if(l.bodyMode==="fields"&&(S!=null&&S.length)){for(const pe of S)if(pe.required&&!((W=l.bodyVals[pe.key])!=null&&W.trim()))return{ok:!1,error:`Campo de body obligatorio: ${pe.key}`};const Q=fd(S,l.bodyVals);F=JSON.stringify(Q)}else F=l.tryBodyRaw.trim()||"{}";return{ok:!0,url:T,headers:P,body:F,method:r.method.toUpperCase()}}function tu(t){return`'${t.replace(/'/g,"'\\''")}'`}function Ik(t){const r=["curl","-sS","-X",tu(t.method)],i=Object.entries(t.headers);i.sort(([s],[l])=>s.localeCompare(l));for(const[s,l]of i)r.push("-H",tu(`${s}: ${l}`));return t.body!==void 0&&t.body!==""&&r.push("--data",tu(t.body)),r.push(tu(t.url)),r.join(" ")}function xf(t,r,i){var d;const s=r.toLowerCase(),l=(d=t.paths)==null?void 0:d[i];if(!l||typeof l!="object"||"$ref"in l)return!1;const c=l[s];return(c==null?void 0:c.deprecated)===!0}function Tk(t,r,i,s,l){var h,v;const c={...t};for(const b of r){const S=(h=i[b.name])==null?void 0:h.trim();S&&(c[b.name]=S)}const d=[];for(const b of s){const S=(v=l[b.name])==null?void 0:v.trim();S&&d.push(`${b.name}=${S}`)}return d.length&&(c.Cookie=c.Cookie?`${c.Cookie}; ${d.join("; ")}`:d.join("; ")),c}function Ak({doc:t,selectedOp:r,baseUrl:i,buildHeaders:s}){const[l,c]=H.useState({}),[d,h]=H.useState({}),[v,b]=H.useState({}),[S,x]=H.useState({}),[_,C]=H.useState({}),[j,M]=H.useState("{}"),[T,P]=H.useState("raw"),[F,$]=H.useState(null),[R,V]=H.useState(null),[K,W]=H.useState(null),Q=H.useMemo(()=>wg(t,r.method,r.path),[t,r.method,r.path]),pe=H.useMemo(()=>Q.filter(de=>de.in==="path"),[Q]),ke=H.useMemo(()=>Q.filter(de=>de.in==="query"),[Q]),X=H.useMemo(()=>Q.filter(de=>de.in==="header"),[Q]),ue=H.useMemo(()=>Q.filter(de=>de.in==="cookie"),[Q]),ve=H.useMemo(()=>Ff(t,r.method,r.path),[t,r.method,r.path]),D=r.method.toLowerCase(),fe=D!=="get"&&D!=="head";H.useEffect(()=>{c({}),h({}),b({}),x({}),V(null),$(null);const de=Ff(t,r.method,r.path);de!=null&&de.length?(C(Object.fromEntries(de.map(_e=>[_e.key,""]))),P("fields"),M(xm(de,{}))):(C({}),P("raw"),M("{}"))},[t,r.method,r.path]);const J=H.useCallback((de,_e)=>{C(Te=>({...Te,[de]:_e}))},[]),ae=H.useCallback(()=>{ve!=null&&ve.length&&M(xm(ve,_)),P("raw")},[ve,_]),B=H.useCallback(()=>{ve!=null&&ve.length&&C(Pk(ve,j)),P("fields")},[ve,j]),q=async()=>{var De,Ne,Ze,Be,Ue;V(null);const de=To(t,i);for(const qe of pe)if(qe.required&&!((De=l[qe.name])!=null&&De.trim())){V(`Parámetro de ruta obligatorio: ${qe.name}`);return}for(const qe of ke)if(qe.required&&!((Ne=d[qe.name])!=null&&Ne.trim())){V(`Query obligatorio: ${qe.name}`);return}for(const qe of X)if(qe.required&&!((Ze=v[qe.name])!=null&&Ze.trim())){V(`Header obligatorio: ${qe.name}`);return}for(const qe of ue)if(qe.required&&!((Be=S[qe.name])!=null&&Be.trim())){V(`Cookie obligatorio: ${qe.name}`);return}let _e=bg(r.path,l);if(Sg(_e)){V("Quedan placeholders `{…}` en la ruta sin valor.");return}const Te=_g(d,Q),Oe=`${de}${_e}${Te}`,Re=Tk(s(),X,v,ue,S),Se={method:r.method.toUpperCase(),headers:Re,credentials:"include"};if(fe)if(T==="fields"&&(ve!=null&&ve.length)){for(const nt of ve)if(nt.required&&!((Ue=_[nt.key])!=null&&Ue.trim())){V(`Campo de body obligatorio: ${nt.key}`);return}const qe=fd(ve,_);Se.body=JSON.stringify(qe)}else{const qe=j.trim()||"{}";Se.body=qe}try{const qe=await fetch(Oe,Se),nt=await qe.text();let ct=null;try{ct=nt?JSON.parse(nt):null}catch{ct=null}$({status:qe.status,statusText:qe.statusText,bodyText:nt,json:ct})}catch(qe){$(null),V(qe instanceof Error?qe.message:String(qe))}},Z=async()=>{W(null);const de=Mk(t,r,i,s,{pathVals:l,queryVals:d,headerVals:v,cookieVals:S,bodyVals:_,tryBodyRaw:j,bodyMode:T});if(!de.ok){W(de.error);return}const _e=Ik(de);try{await navigator.clipboard.writeText(_e),W("cURL copiado al portapapeles."),window.setTimeout(()=>W(null),2500)}catch{W("No se pudo copiar (permiso del portapapeles).")}},A=(de,_e,Te)=>g.jsxs("label",{className:"block text-xs",children:[g.jsxs("span",{className:"text-slate-400",children:[de.name,de.required?g.jsx("span",{className:"text-rose-400/90",children:" *"}):null,de.in!=="path"?g.jsxs("span",{className:"text-slate-600 ml-1",children:["(",de.in,")"]}):null]}),g.jsx("input",{type:"text",className:"glass-input mt-0.5 w-full min-h-[44px] sm:min-h-0 border rounded-xl px-3 py-2 font-mono text-[11px] text-slate-200 transition-colors duration-150 hover:border-accent/25",value:_e[de.name]??"",onChange:Oe=>Te(Re=>({...Re,[de.name]:Oe.target.value})),placeholder:de.description||(de.in==="path"?`{${de.name}}`:""),autoComplete:"off"})]},`${de.in}:${de.name}`),U=de=>g.jsxs("label",{className:"block text-xs",children:[g.jsxs("span",{className:"text-slate-400",children:[de.key,de.required?g.jsx("span",{className:"text-rose-400/90",children:" *"}):null,de.type?g.jsxs("span",{className:"text-slate-600 ml-1",children:["(",de.type,")"]}):null]}),g.jsx("input",{type:"text",className:"glass-input mt-0.5 w-full min-h-[44px] sm:min-h-0 border rounded-xl px-3 py-2 font-mono text-[11px] text-slate-200 transition-colors duration-150 hover:border-accent/25",value:_[de.key]??"",onChange:_e=>J(de.key,_e.target.value),placeholder:de.description||"valor o JSON para objetos anidados",autoComplete:"off"})]},de.key);return g.jsxs("section",{className:"space-y-4 glass-card p-4",children:[g.jsx("h3",{className:"text-sm font-semibold tracking-tight text-slate-200",children:"Probar"}),(pe.length>0||ke.length>0||X.length>0||ue.length>0)&&g.jsxs("div",{className:"space-y-2 rounded-xl border border-white/[0.07] bg-surface-950/35 backdrop-blur-sm p-3",children:[g.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:"Parámetros"}),g.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[pe.map(de=>A(de,l,c)),ke.map(de=>A(de,d,h)),X.map(de=>A(de,v,b)),ue.map(de=>A(de,S,x))]})]}),fe&&g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g.jsx("span",{className:"text-xs text-slate-400",children:"Body"}),ve!=null&&ve.length?g.jsxs("div",{className:"flex rounded-lg border border-surface-600 overflow-hidden text-xs shadow-inner shadow-black/20",role:"group","aria-label":"Modo de body",children:[g.jsx("button",{type:"button",className:`min-h-[40px] px-3 py-2 transition-colors duration-200 sm:min-h-0 sm:py-1.5 ${T==="fields"?"bg-accent/25 text-accent font-medium":"bg-surface-800 text-slate-400 hover:text-slate-200"}`,onClick:B,children:"Campos"}),g.jsx("button",{type:"button",className:`min-h-[40px] px-3 py-2 transition-colors duration-200 sm:min-h-0 sm:py-1.5 border-l border-surface-600/80 ${T==="raw"?"bg-accent/25 text-accent font-medium":"bg-surface-800 text-slate-400 hover:text-slate-200"}`,onClick:ae,children:"JSON raw"})]}):g.jsx("span",{className:"text-[10px] text-slate-500",children:"(solo JSON — sin propiedades `object` en el spec)"})]}),T==="fields"&&(ve!=null&&ve.length)?g.jsx("div",{className:"grid gap-2 sm:grid-cols-2 rounded-xl border border-white/[0.07] bg-surface-950/35 backdrop-blur-sm p-3",children:ve.map(de=>U(de))}):g.jsx("textarea",{className:"glass-input w-full h-28 min-h-[7rem] border rounded-xl p-3 font-mono text-xs text-slate-200 leading-relaxed transition-colors duration-150 hover:border-accent/25",value:j,onChange:de=>M(de.target.value),placeholder:'{"key": "value"}',spellCheck:!1})]}),R&&g.jsx("p",{role:"alert",className:"text-xs text-rose-200 bg-rose-950/40 border border-rose-700/50 rounded-lg px-3 py-2 leading-relaxed",children:R}),g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g.jsx("button",{type:"button",onClick:()=>void q(),className:"min-h-[48px] sm:min-h-0 px-6 py-3 sm:px-5 sm:py-2.5 rounded-xl bg-accent text-surface-950 font-semibold text-sm shadow-lg shadow-accent/15 transition-[transform,filter] duration-200 hover:brightness-110 active:scale-[0.98] motion-reduce:active:scale-100 cursor-pointer",children:"Ejecutar"}),g.jsx("button",{type:"button",onClick:()=>void Z(),className:"min-h-[48px] sm:min-h-0 px-4 py-3 sm:py-2.5 rounded-xl glass-pill text-slate-200 text-sm font-medium",children:"Copiar cURL"})]}),K?g.jsx("p",{className:"text-xs text-emerald-400/90",role:"status",children:K}):null,g.jsxs("div",{className:"space-y-2",children:[g.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:"Respuesta"}),F?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"text-xs font-mono text-slate-300 bg-surface-900/80 border border-surface-700 rounded-lg px-3 py-2",children:[g.jsx("span",{className:F.status>=200&&F.status<300?"text-emerald-400":F.status>=400?"text-rose-400":"text-amber-300",children:F.status})," ",F.statusText]}),F.json!==null?g.jsx(Sk,{data:F.json,defaultOpenDepth:3}):g.jsx("pre",{className:"text-xs glass-input border rounded-xl p-3 overflow-auto max-h-64 text-emerald-300/90 whitespace-pre-wrap font-mono",children:F.bodyText||"—"})]}):g.jsx("p",{className:"text-xs text-slate-500",children:"—"})]})]})}function Ok(t){const r=t.toLowerCase().trim();return`border-l-[3px] ${r==="get"?"border-l-emerald-400":r==="post"?"border-l-sky-400":r==="put"?"border-l-amber-400":r==="patch"?"border-l-violet-400":r==="delete"?"border-l-rose-400":r==="head"||r==="options"||r==="trace"?"border-l-slate-400":"border-l-cyan-400/80"}`}function Rk(t){return g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[g.jsx("circle",{cx:"11",cy:"11",r:"8"}),g.jsx("path",{d:"m21 21-4.3-4.3"})]})}function Lk(t){return g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[g.jsx("circle",{cx:"18",cy:"5",r:"3"}),g.jsx("circle",{cx:"6",cy:"12",r:"3"}),g.jsx("circle",{cx:"18",cy:"19",r:"3"}),g.jsx("path",{d:"m8.59 13.51 6.83 3.98"}),g.jsx("path",{d:"m15.41 6.51-6.82 3.98"})]})}function Dk(t){return g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[g.jsx("path",{d:"M12 3 2 8l10 5 10-5-10-5Z"}),g.jsx("path",{d:"M2 13 12 18l10-5"}),g.jsx("path",{d:"M2 18 12 23l10-5"})]})}function zk(t){return g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[g.jsx("path",{d:"M9 11l3 3L22 4"}),g.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})}function kg(t){return g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[g.jsx("path",{d:"M12 8V4H8"}),g.jsx("rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"}),g.jsx("path",{d:"M2 14h2"}),g.jsx("path",{d:"M20 14h2"}),g.jsx("path",{d:"M15 13v2"}),g.jsx("path",{d:"M9 13v2"})]})}function Fk(t){return g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[g.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),g.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}function Bk(t){return g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[g.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),g.jsx("polyline",{points:"7 10 12 15 17 10"}),g.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function Hk(t){return g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[g.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),g.jsx("polyline",{points:"17 8 12 3 7 8"}),g.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]})}function Vk(t){return g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[g.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),g.jsx("polyline",{points:"16 17 21 12 16 7"}),g.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]})}function wm(t){return g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[g.jsx("path",{d:"M15 3h6v6"}),g.jsx("path",{d:"M9 21H3v-6"}),g.jsx("path",{d:"M21 3l-7 7"}),g.jsx("path",{d:"M3 21l7-7"})]})}const Uk=["get","post","put","patch","delete","options","head","trace"];function Ng(t,r){const i=t.trim().replace(/\s+/g," ");return i.length<=r?i:`${i.slice(0,r-1)}…`}function Kk(t,r,i,s,l){const c=[`${t.toUpperCase()} ${r}`];return i&&c.push(`— ${Ng(i,140)}`),s!=null&&s.length&&c.push(`[tags: ${s.join(", ")}]`),l&&c.push(`(operationId: ${l})`),c.join(" ")}function qk(t,r){const i=[];let s=0;const l=t.paths;if(!l)return{lines:i,total:0};for(const[c,d]of Object.entries(l)){if(!d||typeof d!="object"||"$ref"in d)continue;const h=d;for(const v of Uk){const b=h[v];if(!(!b||typeof b!="object")&&(s+=1,i.length<r)){const S=b.summary||(b.description?Ng(b.description,200):void 0);i.push(Kk(v,c,S,b.tags,b.operationId))}}}return{lines:i,total:s}}function Wk(t){var i,s,l,c,d,h,v;const r=[`Flujo «${t.name}»`];if((i=t.steps)!=null&&i.length){const b=t.steps.map(x=>`${x.method.toUpperCase()} ${x.path}`).join(" → ");r.push(`secuencia (pasos): ${b}`);const S=t.steps.filter(x=>x.extract).map(x=>`${x.extract.varName} ← ${x.extract.jsonPath}`);S.length&&r.push(`extracciones: ${S.join("; ")}`)}if((l=(s=t.graph)==null?void 0:s.nodes)!=null&&l.length){const b=t.graph.nodes.map(S=>`${S.method.toUpperCase()} ${S.path}`).join(" → ");r.push(`grafo (nodos en orden guardado): ${b}`),(c=t.graph.edges)!=null&&c.length&&r.push(`cables: ${t.graph.edges.length} (mapeo respuesta → siguiente request; detalle en la UI Flujos)`)}return!((d=t.steps)!=null&&d.length)&&!((v=(h=t.graph)==null?void 0:h.nodes)!=null&&v.length)&&r.push("(sin pasos ni nodos)"),r.join(". ")}function Yk(t){var i;if(!((i=t.cases)!=null&&i.length))return`Suite «${t.name}»: sin casos`;const r=t.cases.map(s=>`${s.method.toUpperCase()} ${s.path} → esperado HTTP ${s.expectStatus}`).join("; ");return`Suite «${t.name}» (${t.cases.length} caso(s)): ${r}`}function Xk(t,r){var T,P,F,$;const i=t.info.title??"API",s=t.info.version??"",l=`Documentación OpenAPI «${i}»${s?` v${s}`:""}.`,c=((T=t.servers)==null?void 0:T.map(R=>`${R.url}${R.description?` (${R.description})`:""}`).join(`
|
|
207
|
+
`))||"(sin servers en el spec; usa la Base URL de la barra superior en la UI)",d=(P=t.components)!=null&&P.securitySchemes?Object.entries(t.components.securitySchemes).map(([R,V])=>{if(!V||typeof V!="object"||"$ref"in V)return`${R}: ref`;const K=V.type??"?";return`${R} (${K})`}).join("; "):"",{lines:h,total:v}=qk(t,400),b=v>h.length?`
|
|
208
|
+
… y ${v-h.length} operación(es) más en el spec.`:"";let S="";const x=((F=r==null?void 0:r.savedFlows)==null?void 0:F.filter(R=>R.name))??[];x.length&&(S=`
|
|
209
|
+
|
|
210
|
+
--- Flujos guardados por el usuario en esta app (${x.length}) ---
|
|
211
|
+
${x.map(Wk).join(`
|
|
212
|
+
`)}`);let _="";const C=(($=r==null?void 0:r.testSuites)==null?void 0:$.filter(R=>R.name))??[];C.length&&(_=`
|
|
213
|
+
|
|
214
|
+
--- Suites de tests guardadas (${C.length}) ---
|
|
215
|
+
${C.map(Yk).join(`
|
|
216
|
+
`)}`);let j="";const M=r==null?void 0:r.selectedOperation;return M!=null&&M.path&&(j=`
|
|
217
|
+
|
|
218
|
+
--- Operación enfocada en la UI (Explorar) ---
|
|
219
|
+
${M.method.toUpperCase()} ${M.path}
|
|
220
|
+
(Prioriza explicar esta ruta si el usuario pregunta en genérico «este endpoint».)`),`${l}
|
|
221
|
+
|
|
222
|
+
--- Servidores (servers) ---
|
|
223
|
+
${c}
|
|
224
|
+
|
|
225
|
+
--- Seguridad (components.securitySchemes) ---
|
|
226
|
+
${d||"(ninguno declarado o solo referencias)"}
|
|
227
|
+
|
|
228
|
+
--- Catálogo de endpoints (método, ruta, resumen/tags) ---
|
|
229
|
+
Total de operaciones en el spec: ${v}.
|
|
230
|
+
${h.join(`
|
|
231
|
+
`)}${b}
|
|
232
|
+
${S}
|
|
233
|
+
${_}${j}
|
|
234
|
+
|
|
235
|
+
Instrucciones:
|
|
236
|
+
- Responde en el idioma del usuario. Sé preciso: cita método y ruta cuando hables de un endpoint.
|
|
237
|
+
- Puedes explicar cómo encadenar llamadas (flujos), qué variables extraer entre pasos, y cómo se relacionan con los tests guardados.
|
|
238
|
+
- Para probar requests reales, el usuario debe usar la pestaña Explorar (o Flujos/Tests); tú no ejecutas HTTP.
|
|
239
|
+
- Si falta detalle en este resumen, indica que puede ver el cuerpo completo de la operación en la UI (Explorar) o en el JSON OpenAPI.`}async function Qk(t,r,i,s,l){const c=`${t.replace(/\/?$/,"/")}__chat`,d=await fetch(c,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",[My]:r},body:JSON.stringify({provider:i,model:s,messages:l})}),h=await d.text();if(!d.ok){let v=h;try{const b=JSON.parse(h);v=b.message??b.error??h}catch{}throw new Error(v||`HTTP ${d.status}`)}return JSON.parse(h)}function Gk({doc:t,contextExtras:r,provider:i,model:s,apiKey:l,onOpenLlmSettings:c}){const d="/docs/",[h,v]=H.useState(!1),[b,S]=H.useState([]),[x,_]=H.useState(""),[C,j]=H.useState(!1),[M,T]=H.useState(null),P=H.useRef(null),F=H.useMemo(()=>Xk(t,r),[t,r]);H.useEffect(()=>{var V;(V=P.current)==null||V.scrollIntoView({behavior:"smooth"})},[b]);const $=H.useCallback(async()=>{const V=x.trim();if(!V||C)return;if(!l.trim()){T("Configura tu API key: botón «Asistente: API de IA…» al pie del menú, o el icono del asistente."),c==null||c();return}T(null);const K=s.trim()||nu(i),W={role:"user",content:V},Q=[{role:"system",content:F},...b.filter(pe=>pe.role!=="system"),W];_(""),S(pe=>[...pe,W]),j(!0);try{const pe=await Qk(d,l.trim(),i,K,Q);S(ke=>[...ke,{role:"assistant",content:pe.content??""}])}catch(pe){T(pe instanceof Error?pe.message:String(pe))}finally{j(!1)}},[l,d,x,C,b,s,c,i,F]),R=H.useCallback(()=>{S([]),T(null)},[]);return g.jsxs("div",{className:"fixed bottom-4 right-4 z-[100] flex flex-col items-end gap-2 pointer-events-none [&>*]:pointer-events-auto",style:{paddingBottom:"max(0.5rem, env(safe-area-inset-bottom))"},children:[h?g.jsxs("div",{className:"glass-modal-panel w-[min(100vw-1.5rem,24rem)] h-[min(72vh,28rem)] flex flex-col rounded-2xl overflow-hidden",role:"dialog","aria-label":"Asistente de la API",children:[g.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 border-b border-white/[0.08] bg-surface-950/30",children:[g.jsx("span",{className:"text-sm font-medium text-slate-200",children:"Asistente"}),g.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[g.jsx("button",{type:"button",onClick:R,className:"text-[11px] text-slate-500 hover:text-slate-300 px-2 py-1 rounded-lg glass-pill",children:"Vaciar"}),g.jsx("button",{type:"button",onClick:()=>v(!1),className:"touch-target min-w-[2.25rem] min-h-[2.25rem] rounded-xl text-slate-400 hover:text-white glass-pill text-lg leading-none","aria-label":"Cerrar panel del asistente",children:"×"})]})]}),M?g.jsxs("div",{className:"px-3 py-2 text-xs text-rose-200 bg-rose-950/35 backdrop-blur-sm border-b border-rose-500/20 flex flex-wrap items-center gap-2",children:[g.jsx("span",{className:"flex-1 min-w-0",children:M}),c?g.jsx("button",{type:"button",className:"shrink-0 underline text-accent",onClick:c,children:"Abrir configuración"}):null]}):null,g.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-3 min-h-0",children:[b.length===0?g.jsx("p",{className:"text-xs text-slate-500 text-center py-6 leading-relaxed px-1",children:"Pregunta por endpoints, flujos o tests. Configura el proveedor con «Asistente: API de IA…» en el menú."}):b.map((V,K)=>g.jsxs("div",{className:`text-xs leading-relaxed rounded-xl px-2.5 py-2 backdrop-blur-sm ${V.role==="user"?"bg-accent/15 text-slate-100 ml-3 border border-accent/30 shadow-[0_4px_20px_-8px_rgb(var(--accent)/0.35)]":"bg-surface-800/50 text-slate-200 mr-3 border border-white/[0.08]"}`,children:[g.jsx("span",{className:"text-[10px] uppercase tracking-wider text-slate-500 block mb-0.5",children:V.role==="user"?"Tú":"Asistente"}),g.jsx("div",{className:"whitespace-pre-wrap break-words",children:V.content})]},`${K}-${V.role}`)),g.jsx("div",{ref:P})]}),g.jsxs("div",{className:"p-2.5 border-t border-white/[0.08] flex gap-2 bg-surface-950/25",children:[g.jsx("textarea",{className:"glass-input flex-1 min-h-[44px] max-h-32 border rounded-xl px-2.5 py-2 text-xs text-slate-200 resize-y",rows:2,value:x,onChange:V=>_(V.target.value),onKeyDown:V=>{V.key==="Enter"&&!V.shiftKey&&(V.preventDefault(),$())},placeholder:"Pregunta sobre el spec…",disabled:C}),g.jsx("button",{type:"button",onClick:()=>void $(),disabled:C||!x.trim(),className:"self-end shrink-0 min-h-[44px] px-3 rounded-xl bg-accent text-surface-950 font-semibold text-xs shadow-[0_6px_20px_-6px_rgb(var(--accent)/0.5)] disabled:opacity-40",children:C?"…":"Enviar"})]})]}):null,g.jsx("button",{type:"button",onClick:()=>v(V=>!V),className:`touch-target min-w-[3.25rem] min-h-[3.25rem] rounded-full flex items-center justify-center transition-[transform,box-shadow,filter] duration-200 ${h?"glass-fab-muted scale-95":"glass-fab hover:scale-[1.03] hover:brightness-110"}`,"aria-expanded":h,"aria-label":h?"Ocultar asistente":"Abrir asistente",title:"Asistente",children:g.jsx(kg,{className:h?"opacity-80":void 0})})]})}const Eg="adt-llm-provider",Cg="adt-llm-model",jg="adt-llm-key";function Jk(){try{const t=localStorage.getItem(Eg),r=t==="anthropic"||t==="openai"||t==="openrouter"?t:"openrouter",i=localStorage.getItem(Cg)??"",s=localStorage.getItem(jg)??"";return{provider:r,model:i,apiKey:s}}catch{return{provider:"openrouter",model:"",apiKey:""}}}function Zk(t,r,i){try{localStorage.setItem(Eg,t),localStorage.setItem(Cg,r),localStorage.setItem(jg,i)}catch{}}function e2({open:t,onClose:r,ops:i,onPick:s}){const[l,c]=H.useState(""),d=H.useRef(null),[h,v]=H.useState(0),b=H.useMemo(()=>{const x=l.trim().toLowerCase();return x?i.filter(_=>{const C=(_.operationId??"").toLowerCase(),j=_.path.toLowerCase(),M=_.method.toLowerCase(),T=(_.tags??[]).join(" ").toLowerCase();return j.includes(x)||M.includes(x)||C.includes(x)||T.includes(x)}).slice(0,80):i.slice(0,80)},[i,l]);H.useEffect(()=>{t&&(c(""),v(0),window.setTimeout(()=>{var x;return(x=d.current)==null?void 0:x.focus()},10))},[t]),H.useEffect(()=>{v(0)},[l]);const S=H.useCallback(x=>{s({method:x.method,path:x.path}),r()},[r,s]);return H.useEffect(()=>{if(!t)return;const x=_=>{if(_.key==="Escape"){_.preventDefault(),r();return}_.key==="ArrowDown"&&(_.preventDefault(),v(C=>Math.min(C+1,Math.max(0,b.length-1)))),_.key==="ArrowUp"&&(_.preventDefault(),v(C=>Math.max(0,C-1))),_.key==="Enter"&&b[h]&&(_.preventDefault(),S(b[h]))};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[t,b,h,r,S]),t?g.jsx("div",{className:"glass-modal-backdrop fixed inset-0 z-[120] flex items-start justify-center pt-[12vh] px-3",role:"presentation",onClick:r,children:g.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"Buscar operación",className:"glass-modal-panel w-full max-w-xl rounded-2xl overflow-hidden shadow-2xl",onClick:x=>x.stopPropagation(),children:[g.jsxs("div",{className:"border-b border-white/[0.08] px-3 py-2",children:[g.jsx("input",{ref:d,type:"search",className:"glass-input w-full border-0 rounded-xl px-3 py-2.5 text-sm text-slate-100 placeholder:text-slate-500 focus:ring-2 focus:ring-accent/50",placeholder:"Buscar por ruta, método, operationId o tag…",value:l,onChange:x=>c(x.target.value),autoComplete:"off"}),g.jsxs("p",{className:"text-[10px] text-slate-500 mt-1 px-1",children:["↑↓ navegar · Enter abrir · Esc cerrar ·"," ",g.jsx("kbd",{className:"px-1 rounded bg-surface-800 text-slate-400",children:"⌘K"})," /"," ",g.jsx("kbd",{className:"px-1 rounded bg-surface-800 text-slate-400",children:"Ctrl+K"})]})]}),g.jsx("ul",{className:"max-h-[min(50vh,22rem)] overflow-y-auto py-1",role:"listbox",children:b.length===0?g.jsx("li",{className:"px-4 py-6 text-sm text-slate-500 text-center",children:"Sin coincidencias"}):b.map((x,_)=>g.jsx("li",{children:g.jsxs("button",{type:"button",role:"option","aria-selected":_===h,className:`w-full text-left px-3 py-2.5 flex items-start gap-2 transition-colors ${_===h?"bg-accent/15 text-slate-100":"hover:bg-white/[0.04] text-slate-300"}`,onMouseEnter:()=>v(_),onClick:()=>S(x),children:[g.jsx(Na,{method:x.method,size:"sm"}),g.jsxs("span",{className:"flex-1 min-w-0",children:[g.jsx("span",{className:"font-mono text-xs break-all",children:x.path}),x.operationId?g.jsx("span",{className:"block text-[10px] text-slate-500 mt-0.5",children:x.operationId}):null,x.deprecated?g.jsx("span",{className:"ml-2 text-[10px] uppercase text-amber-400/90",children:"deprecated"}):null]})]})},`${x.method}:${x.path}`))})]})}):null}function t2(t){return typeof t=="object"&&t!==null&&"$ref"in t&&typeof t.$ref=="string"}function n2({doc:t}){const r=H.useMemo(()=>{var h;const d=(h=t.components)==null?void 0:h.schemas;return!d||typeof d!="object"?[]:Object.keys(d).sort((v,b)=>v.localeCompare(b))},[t]),[i,s]=H.useState(null);H.useEffect(()=>{if(r.length===0){s(null);return}(!i||!r.includes(i))&&s(r[0])},[r,i]);const l=H.useMemo(()=>{var h,v;if(!i)return"";const d=(v=(h=t.components)==null?void 0:h.schemas)==null?void 0:v[i];if(d===void 0)return"// (no definido)";try{return JSON.stringify(d,null,2)}catch{return String(d)}},[t,i]),c=async()=>{try{await navigator.clipboard.writeText(l)}catch{}};return r.length===0?g.jsx("div",{className:"p-4 max-w-3xl",children:g.jsxs("p",{className:"text-sm text-slate-500",children:["Este spec no define ",g.jsx("code",{className:"text-accent",children:"components.schemas"}),"."]})}):g.jsxs("div",{className:"p-4 flex flex-col lg:flex-row gap-4 min-h-0 max-w-6xl",children:[g.jsxs("div",{className:"lg:w-56 shrink-0 space-y-2",children:[g.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500",children:"Esquemas"}),g.jsx("ul",{className:"space-y-0.5 max-h-[min(70vh,32rem)] overflow-y-auto rounded-xl border border-white/[0.08] bg-surface-950/30 p-1",children:r.map(d=>{var b,S;const h=(S=(b=t.components)==null?void 0:b.schemas)==null?void 0:S[d],v=t2(h);return g.jsx("li",{children:g.jsxs("button",{type:"button",onClick:()=>s(d),className:`w-full text-left px-2 py-2 rounded-lg text-xs font-mono transition-colors ${i===d?"glass-pill-active text-slate-100":"text-slate-400 hover:bg-white/[0.04] hover:text-slate-200"}`,children:[d,v?g.jsx("span",{className:"block text-[10px] text-slate-500 truncate",title:h.$ref,children:"→ ref"}):null]})},d)})})]}),g.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-2 min-h-0",children:[g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[g.jsx("h3",{className:"text-sm font-medium text-slate-200",children:i?g.jsx(g.Fragment,{children:g.jsx("code",{className:"text-accent",children:i})}):g.jsx("span",{className:"text-slate-500",children:"Selecciona un esquema"})}),i?g.jsx("button",{type:"button",onClick:()=>void c(),className:"text-xs px-3 py-1.5 rounded-lg glass-pill text-slate-300",children:"Copiar JSON"}):null]}),i?g.jsx("pre",{className:"glass-input border rounded-xl p-3 text-xs font-mono text-slate-200 overflow-auto max-h-[min(70vh,36rem)] whitespace-pre",children:l}):g.jsx("p",{className:"text-xs text-slate-500",children:"Los modelos reutilizables del spec aparecen aquí."})]})]})}const wf="op";function r2(t,r){const i=`${t.toLowerCase()} ${r}`;return encodeURIComponent(i)}function o2(t){if(!(t!=null&&t.trim()))return null;try{const r=decodeURIComponent(t),i=r.indexOf(" ");if(i===-1)return null;const s=r.slice(0,i).trim().toLowerCase(),l=r.slice(i+1);return!s||l.length===0?null:{method:s,path:l}}catch{return null}}const Pg=[{value:200,label:"200 OK"},{value:201,label:"201 Created"},{value:202,label:"202 Accepted"},{value:204,label:"204 No Content"},{value:400,label:"400 Bad Request"},{value:401,label:"401 Unauthorized"},{value:403,label:"403 Forbidden"},{value:404,label:"404 Not Found"},{value:409,label:"409 Conflict"},{value:422,label:"422 Unprocessable"},{value:429,label:"429 Too Many Requests"},{value:500,label:"500 Server Error"},{value:502,label:"502 Bad Gateway"},{value:503,label:"503 Unavailable"}];function bm(t){return Pg.some(r=>r.value===t)}const bf=[{id:"typescript",label:"TypeScript"},{id:"javascript",label:"JavaScript"},{id:"python",label:"Python"},{id:"php",label:"PHP"}];function _f(t,r){return`${t.toLowerCase()} ${r}`}function i2(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}async function _m(t){await navigator.clipboard.writeText(t)}function s2(){var Xr;const t=_k(),[r,i]=H.useState(null),[s,l]=H.useState(null),[c,d]=H.useState("server"),[h,v]=H.useState(null),[b,S]=H.useState(null),[x,_]=H.useState("explore"),[C,j]=H.useState(""),[M,T]=H.useState(null),[P,F]=H.useState(null),[$,R]=H.useState("typescript"),[V,K]=H.useState(""),[W,Q]=H.useState(""),[pe,ke]=H.useState("X-Api-Key"),[X,ue]=H.useState({nodes:[],edges:[]}),[ve,D]=H.useState(0),[fe,J]=H.useState("Mi flujo"),[ae,B]=H.useState([]),[q,Z]=H.useState(""),[A,U]=H.useState({name:"Suite 1",cases:[]}),[de,_e]=H.useState([]),[Te,Oe]=H.useState(""),[Re,Se]=H.useState(""),[De,Ne]=H.useState(null),[Ze,Be]=H.useState(null),[Ue,qe]=H.useState(null),[nt,ct]=H.useState("openrouter"),[St,gn]=H.useState(""),[Xt,Qt]=H.useState(""),[kt,Kt]=H.useState(!1),[kn,fr]=H.useState(!1),[an,Et]=H.useState(!1),Gt=(L,we)=>{try{const Ee=sessionStorage.getItem(L);if(Ee==="1")return!0;if(Ee==="0")return!1}catch{}return we},[yn,er]=H.useState(()=>Gt("adt-collapse-main",!1)),[nn,Mn]=H.useState(()=>Gt("adt-collapse-explore",!1)),In="/docs/openapi.json",dr="/docs/preset.json",ln=H.useCallback(async()=>{const[L,we]=await Promise.all([mt.flows.toArray(),mt.testSuites.toArray()]);B(L.sort((Ee,Qe)=>(Ee.name??"").localeCompare(Qe.name??""))),_e(we.sort((Ee,Qe)=>(Ee.name??"").localeCompare(Qe.name??"")))},[]);H.useEffect(()=>{var we,Ee;if(!r)return;const L=((we=t.productName)==null?void 0:we.trim())||((Ee=r.info.title)==null?void 0:Ee.trim())||"API";document.title=L},[r,t.productName]);const rn=H.useCallback(async()=>{v(null);const L=await mt.kv.get(Ps);if(L!=null&&L.value)try{const we=JSON.parse(L.value);sh(we);const Ee=we;i(Ee),j(To(Ee)),l(null),d("local");return}catch{await ch()}try{const we=await fetch(In,{credentials:"include"});if(we.status===401){let Qe="/docs/__auth/login";try{const Tt=await we.json();Tt.loginPath&&(Qe=Tt.loginPath)}catch{}window.location.href=Qe;return}if(!we.ok)throw new Error(`${we.status} ${we.statusText}`);const Ee=await we.json();i(Ee),j(To(Ee)),l(null),d("server")}catch(we){l(we instanceof Error?we.message:String(we))}},[In]);H.useEffect(()=>{rn()},[rn]),H.useEffect(()=>{try{sessionStorage.setItem("adt-collapse-main",yn?"1":"0")}catch{}},[yn]),H.useEffect(()=>{try{sessionStorage.setItem("adt-collapse-explore",nn?"1":"0")}catch{}},[nn]),H.useEffect(()=>{(async()=>{try{const L=await fetch("/docs/__auth/session",{credentials:"include"});if(L.ok){const we=await L.json();qe({username:we.username})}else qe(null)}catch{qe(null)}})()},[]),H.useEffect(()=>{if(!r)return;let L=!1;return(async()=>{try{const we=await fetch(dr,{credentials:"include"});if(!we.ok||L)return;const Ee=await we.json(),Qe=await rv(Ee);!L&&Qe&&await ln()}catch{}})(),()=>{L=!0}},[r,dr,ln]),H.useEffect(()=>{ln(),mt.kv.get("bearer").then(L=>L&&K(L.value)),mt.kv.get("apiKey").then(L=>L&&Q(L.value))},[ln]),H.useEffect(()=>{const L=Jk();ct(L.provider),gn(L.model||nu(L.provider)),Qt(L.apiKey)},[]),H.useEffect(()=>{Et(!1)},[r]);const Ye=H.useMemo(()=>r?Xy(r):[],[r]),_t=H.useMemo(()=>r?so(r):[],[r]),Tn=H.useMemo(()=>r?_t.map(L=>({method:L.method,path:L.path,operationId:L.operationId,tags:L.tags,deprecated:xf(r,L.method,L.path)})):[],[r,_t]);H.useEffect(()=>{if(!r||_t.length===0||an)return;const L=new URLSearchParams(window.location.search),we=o2(L.get(wf));we&&_t.some(Qe=>Qe.method.toLowerCase()===we.method&&Qe.path===we.path)&&(F({method:we.method,path:we.path}),_("explore")),Et(!0)},[r,_t,an]),H.useEffect(()=>{if(!an||!r)return;const L=new URL(window.location.href);x==="explore"&&P?L.searchParams.set(wf,r2(P.method,P.path)):L.searchParams.delete(wf),window.history.replaceState({},"",L.toString())},[an,r,x,P]),H.useEffect(()=>{const L=we=>{(we.metaKey||we.ctrlKey)&&we.key.toLowerCase()==="k"&&(we.preventDefault(),fr(Ee=>!Ee))};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[]);const pr=H.useMemo(()=>({savedFlows:ae,testSuites:de,selectedOperation:P}),[ae,de,P]),He=H.useMemo(()=>M?_t.filter(L=>(L.tags??["default"]).includes(M)):_t,[_t,M]);H.useEffect(()=>{if(_t.length&&!Re){const L=_t[0];Se(_f(L.method,L.path))}},[_t,Re]),H.useEffect(()=>{if(_t.length===0||X.nodes.length>0||x!=="flows"||De!=null)return;const L=_t[0];ue({nodes:[{id:crypto.randomUUID(),method:L.method.toLowerCase(),path:L.path,x:80,y:120}],edges:[]}),D(we=>we+1)},[_t,X.nodes.length,x,De]);const un=H.useCallback(()=>{const L={"Content-Type":"application/json"};return V.trim()&&(L.Authorization=`Bearer ${V.trim()}`),W.trim()&&(L[pe]=W.trim()),L},[V,W,pe]),An=H.useMemo(()=>{if(!r||!P)return null;const L={};for(const{id:we}of bf)L[we]=qy(r,we,P.method,P.path);return L},[r,P]),Cr=H.useMemo(()=>r?Yy(r,$,M):"",[r,$,M]),Ht=H.useMemo(()=>{var Lt,Wt;if(!r||!P)return null;const L=(Lt=r.paths)==null?void 0:Lt[P.path];if(!L||typeof L!="object"||"$ref"in L)return null;const we=L[P.method.toLowerCase()];if(!we)return null;const Ee=typeof we.summary=="string"?we.summary:void 0,Qe=typeof we.description=="string"?we.description:void 0;let Tt=null;try{const Jt=we.requestBody,Dt=(Wt=Jt==null?void 0:Jt.content)==null?void 0:Wt["application/json"];if((Dt==null?void 0:Dt.example)!==void 0)Tt=JSON.stringify(Dt.example,null,2);else if(Dt!=null&&Dt.examples&&typeof Dt.examples=="object"){const Vt=Object.values(Dt.examples)[0];Vt&&Vt.value!==void 0&&(Tt=JSON.stringify(Vt.value,null,2))}}catch{}return{summary:Ee,description:Qe,exampleStr:Tt}},[r,P]),qr=H.useCallback(L=>{F(L),_("explore")},[]),Do=async L=>{var Tt;if(!r)return"";const we={};let Ee="";const Qe=To(r,C);for(let Lt=0;Lt<L.length;Lt++){const Wt=L[Lt];let Jt=Wt.path;for(const[vn,xr]of Object.entries(we))Jt=Jt.replace(`{${vn}}`,xr);const Dt=`${Qe}${Jt}`,Vt={method:Wt.method.toUpperCase(),headers:un()},ht=Wt.method.toLowerCase();ht!=="get"&&ht!=="head"&&(Vt.body="{}");const or=await fetch(Dt,{...Vt,credentials:"include"}),vr=await or.json().catch(()=>({}));if(Ee+=`Paso ${Lt+1}: ${or.status}
|
|
240
|
+
${JSON.stringify(vr,null,2)}
|
|
241
|
+
|
|
242
|
+
`,(Tt=Wt.extract)!=null&&Tt.jsonPath){const vn=Bf(vr,Wt.extract.jsonPath);vn!==void 0&&(we[Wt.extract.varName]=String(vn))}}return Ee},zo=async()=>{if(!r)return;const L=To(r,C);if(X.nodes.length===0){Z("Añade al menos un nodo al flujo.");return}const we=await ym(X,L,un);Z(we)},zn=async L=>{if(!r)return;const we=To(r,C),Ee=L.graph&&L.graph.nodes.length>0?await ym(L.graph,we,un):await Do(L.steps);Z(Ee),_("flows")},tr=L=>{J(L.name),ue(L.graph&&L.graph.nodes.length>0?L.graph:wk(L.steps.length?L.steps:[{method:"get",path:"/"}])),D(we=>we+1),Ne(L.id??null),_("flows")},Fn=()=>{Ne(null),J("Nuevo flujo"),_t[0]?ue({nodes:[{id:crypto.randomUUID(),method:_t[0].method.toLowerCase(),path:_t[0].path,x:80,y:120}],edges:[]}):ue({nodes:[],edges:[]}),D(L=>L+1)},hr=H.useCallback(L=>{ue(L)},[]),yt=async()=>{const L=xk(X);if(De!=null)await mt.flows.update(De,{name:fe,steps:L,graph:X});else{const we=await mt.flows.add({name:fe,steps:L,graph:X});Ne(we)}await ln()},It=async L=>{L!==void 0&&(L===De&&(Ne(null),Fn()),await mt.flows.delete(L),await ln())},jr=()=>{if(!Re)return;const{method:L,path:we}=i2(Re),Ee={id:crypto.randomUUID(),method:L,path:we,expectStatus:200,contains:void 0,jsonPath:void 0,expectJsonValue:void 0};U(Qe=>({...Qe,cases:[...Qe.cases,Ee]}))},nr=L=>{U(we=>({...we,cases:we.cases.filter(Ee=>Ee.id!==L)}))},cn=(L,we)=>{U(Ee=>({...Ee,cases:Ee.cases.map(Qe=>Qe.id===L?{...Qe,...we}:Qe)}))},Bn=async L=>{if(!r)return"";const we=To(r,C);let Ee="";for(const Qe of L){const Tt=`${we}${Qe.path}`,Lt=await fetch(Tt,{method:Qe.method.toUpperCase(),headers:un(),credentials:"include"}),Wt=await Lt.text(),Jt=ov(Qe,Lt.status,Wt),Dt=`${Jt.pass?"PASS":"FAIL"} ${Qe.method.toUpperCase()} ${Qe.path}`;Ee+=`${Dt}
|
|
243
|
+
${Jt.lines.map(Vt=>` ${Vt}`).join(`
|
|
244
|
+
`)}
|
|
245
|
+
|
|
246
|
+
`}return Ee},hi=async()=>{const L=await Bn(A.cases);Oe(L)},Hn=async()=>{if(!r||de.length===0)return;let L="";for(const we of de)L+=`━━━ ${we.name} (${we.cases.length} casos) ━━━
|
|
247
|
+
`,L+=await Bn(we.cases);Oe(L),_("tests")},mr=async L=>{const we=await Bn(L.cases);Oe(we),_("tests")},qt=L=>{U({name:L.name,cases:L.cases.map(we=>({...we,id:we.id&&we.id.length>0?we.id:crypto.randomUUID()}))}),Be(L.id??null),_("tests")},gr=()=>{Be(null),U({name:"Nueva suite",cases:[]})},lo=async()=>{if(Ze!=null)await mt.testSuites.update(Ze,{name:A.name,cases:A.cases});else{const L=await mt.testSuites.add({name:A.name,cases:A.cases});Be(L)}await ln()},Vn=async L=>{L!==void 0&&(L===Ze&&(Be(null),U({name:"Nueva suite",cases:[]})),await mt.testSuites.delete(L),await ln())},uo=async()=>{await mt.kv.put({key:"bearer",value:V}),await mt.kv.put({key:"apiKey",value:W})},On=async()=>{S(null);const L=await nv(),we=new Blob([JSON.stringify(L,null,2)],{type:"application/json"}),Ee=document.createElement("a");Ee.href=URL.createObjectURL(we),Ee.download="api-doc-tor-estado-app.json",Ee.click(),URL.revokeObjectURL(Ee.href)},co=async L=>{var Ee;const we=(Ee=L.target.files)==null?void 0:Ee[0];if(L.target.value="",!!we){S(null);try{const Qe=await we.text(),Tt=JSON.parse(Qe);if(Tt.formatVersion!==1)throw new Error("Se esperaba un export de estado de la app (formatVersion: 1).");await Pm(Tt),await ln(),await rn()}catch(Qe){S(Qe instanceof Error?Qe.message:String(Qe))}}},Wr=H.useCallback(()=>{var Qe;if(!r)return;const L=new Blob([JSON.stringify(r,null,2)],{type:"application/json"}),we=document.createElement("a"),Ee=(((Qe=r.info)==null?void 0:Qe.title)??"openapi").replace(/[^\w\-.]+/g,"-").slice(0,80);we.href=URL.createObjectURL(L),we.download=`${Ee||"openapi"}.json`,we.click(),URL.revokeObjectURL(we.href)},[r]),Nt=async L=>{var Ee;const we=(Ee=L.target.files)==null?void 0:Ee[0];if(L.target.value="",!!we){v(null);try{const Qe=await we.text(),Tt=JSON.parse(Qe);sh(Tt);const Lt=Tt;await tv(Lt),i(Lt),j(To(Lt)),l(null),d("local"),F(null),T(null)}catch(Qe){v(Qe instanceof Error?Qe.message:String(Qe))}}},Un=H.useCallback(async()=>{v(null),await ch(),await rn()},[rn]),pt=async()=>{await fetch("/docs/__auth/logout",{method:"POST",credentials:"include"}),window.location.href="/docs/__auth/login"},Fo=H.useCallback(()=>{Kt(!0)},[]),yr=H.useCallback(()=>{Zk(nt,St.trim(),Xt),Kt(!1)},[Xt,St,nt]);H.useEffect(()=>{if(!kt)return;const L=we=>{we.key==="Escape"&&Kt(!1)};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[kt]);const Yr=()=>{P&&(ue(L=>{const we=L.nodes[L.nodes.length-1],Ee=we?we.x+280:80,Qe=(we==null?void 0:we.y)??120;return{nodes:[...L.nodes,{id:crypto.randomUUID(),method:P.method.toLowerCase(),path:P.path,x:Ee,y:Qe}],edges:L.edges}}),D(L=>L+1),_("flows"))};if(s)return g.jsx("div",{className:"app-glass-bg min-h-screen flex items-center justify-center p-8",children:g.jsxs("div",{role:"alert",className:"glass-card max-w-lg border-red-500/40 bg-red-950/25 p-6 text-red-100",children:[g.jsx("h1",{className:"font-display text-xl font-bold mb-2",children:"No se pudo cargar OpenAPI"}),g.jsx("p",{className:"text-sm opacity-90 leading-relaxed",children:s}),g.jsxs("p",{className:"text-xs mt-4 text-slate-500",children:["URL intentada: ",In]})]})});if(!r)return g.jsx("div",{className:"app-glass-bg min-h-screen flex items-center justify-center p-6",children:g.jsx("div",{className:"glass-card px-8 py-6 border-white/[0.08]",children:g.jsx("p",{className:"text-slate-300 motion-safe:animate-pulse text-sm font-medium",children:"Cargando especificación…"})})});const rr=M===null?"Todos los endpoints (cliente único con todas las operaciones)":`Tag «${M}» (solo operaciones de este grupo)`,Rn=((Xr=t.productName)==null?void 0:Xr.trim())||r.info.title;return g.jsxs("div",{className:"app-glass-bg min-h-screen flex flex-col selection:bg-accent/25 selection:text-slate-50",children:[g.jsx("a",{href:"#main-content",className:"skip-link",children:"Saltar al contenido"}),g.jsxs("div",{className:"flex flex-1 flex-col md:flex-row min-h-0",children:[g.jsxs("aside",{className:`glass-sidebar w-full border-b md:border-b-0 md:border-r border-surface-600/40 shrink-0 transition-[width] duration-200 ease-out flex flex-col overflow-hidden md:rounded-r-3xl ${yn?"md:w-14 md:min-w-[3.5rem]":"md:w-64"}`,children:[g.jsx("input",{id:"adt-state-import",type:"file",accept:"application/json,.json",className:"hidden",onChange:co}),g.jsx("input",{id:"adt-openapi-import",type:"file",accept:"application/json,.json",className:"hidden",onChange:Nt}),g.jsxs("div",{className:yn?"max-md:block md:hidden":"block",children:[g.jsxs("div",{className:"p-4 border-b border-surface-700 flex justify-between items-start gap-2",children:[g.jsxs("div",{className:"min-w-0",children:[t.logoDataUrl?g.jsx("img",{src:t.logoDataUrl,alt:Rn,className:"h-9 max-w-[200px] object-contain object-left mb-2"}):null,g.jsx("h1",{className:"font-display text-lg font-bold text-white tracking-tight",children:Rn}),g.jsx("p",{className:"text-xs text-slate-500 mt-1",children:Rn===r.info.title?`v${r.info.version}`:`${r.info.title} · v${r.info.version}`})]}),g.jsx("button",{type:"button",className:"hidden md:flex shrink-0 touch-target rounded-lg border border-surface-600 bg-surface-800 text-slate-300 hover:bg-surface-700 items-center justify-center text-lg leading-none transition-colors duration-200",onClick:()=>er(!0),"aria-label":"Ocultar menú lateral",title:"Ocultar menú",children:"‹"})]}),g.jsx("nav",{className:"p-2 flex flex-row md:flex-col gap-1 overflow-x-auto","aria-label":"Navegación principal",children:[["explore","Explorar"],["flows",`Flujos (${ae.length})`],["tests",`Tests (${de.length})`],["schemas","Esquemas"],["auth","Auth"]].map(([L,we])=>g.jsx("button",{type:"button",onClick:()=>_(L),className:`text-left px-3 py-2.5 md:py-2 rounded-xl text-sm transition-all duration-200 ease-out min-h-[44px] md:min-h-0 flex items-center ${x===L?"glass-pill-active text-accent":"text-slate-400 glass-pill hover:text-slate-200"}`,children:we},L))}),Ue?g.jsxs("div",{className:"px-3 py-2 border-t border-surface-700 flex items-center justify-between gap-2 text-xs",children:[g.jsx("span",{className:"text-slate-400 truncate",title:Ue.username,children:Ue.username}),g.jsx("button",{type:"button",className:"shrink-0 text-accent hover:underline",onClick:()=>void pt(),children:"Salir"})]}):null,g.jsxs("div",{className:"p-3 border-t border-surface-700 space-y-2",children:[g.jsx("button",{type:"button",onClick:()=>Kt(!0),className:"w-full text-xs py-2.5 rounded-xl glass-pill text-slate-200 hover:text-accent min-h-[44px] md:min-h-0 transition-all duration-200",children:"Asistente: API de IA…"}),b?g.jsx("p",{className:"text-[11px] text-rose-300/95 leading-snug rounded-lg border border-rose-500/35 bg-rose-950/30 px-2 py-2",role:"alert",children:b}):null,g.jsx("button",{type:"button",onClick:()=>void On(),className:"w-full text-xs py-2.5 rounded-xl glass-pill text-slate-300 min-h-[44px] md:min-h-0",children:"Exportar estado (app)"}),g.jsx("label",{htmlFor:"adt-state-import",className:"block w-full text-xs py-2.5 rounded-xl glass-pill text-center text-slate-300 cursor-pointer transition-all duration-200 min-h-[44px] md:min-h-0 flex items-center justify-center",children:"Importar estado (app)"})]})]}),yn?g.jsxs("div",{className:"max-md:hidden md:flex flex-1 flex-col items-stretch py-2 px-1 gap-1 min-h-0 overflow-y-auto overflow-x-hidden",children:[g.jsx("button",{type:"button",className:"touch-target w-11 h-11 mx-auto rounded-lg border border-surface-600 bg-surface-800 text-slate-200 hover:bg-surface-700 flex items-center justify-center shrink-0 transition-colors duration-200",onClick:()=>er(!1),"aria-label":"Mostrar menú lateral completo",title:"Expandir panel completo",children:g.jsx(wm,{className:"text-slate-300"})}),g.jsxs("nav",{className:"flex flex-col gap-0.5 items-center w-full py-1 border-b border-surface-700/80","aria-label":"Secciones",children:[g.jsx("button",{type:"button",onClick:()=>_("explore"),title:"Explorar","aria-current":x==="explore"?"page":void 0,className:`relative touch-target w-11 h-11 rounded-lg border flex items-center justify-center shrink-0 transition-colors duration-200 ${x==="explore"?"border-accent/60 bg-accent/15 text-accent":"border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200"}`,children:g.jsx(Rk,{})}),g.jsxs("button",{type:"button",onClick:()=>_("flows"),title:`Flujos (${ae.length})`,"aria-current":x==="flows"?"page":void 0,className:`relative touch-target w-11 h-11 rounded-lg border flex items-center justify-center shrink-0 transition-colors duration-200 ${x==="flows"?"border-accent/60 bg-accent/15 text-accent":"border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200"}`,children:[g.jsx(Lk,{}),ae.length>0?g.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 min-w-[14px] h-3.5 px-0.5 rounded-full bg-accent text-[8px] font-bold text-surface-950 flex items-center justify-center leading-none",children:ae.length>99?"99+":ae.length}):null]}),g.jsxs("button",{type:"button",onClick:()=>_("tests"),title:`Tests (${de.length})`,"aria-current":x==="tests"?"page":void 0,className:`relative touch-target w-11 h-11 rounded-lg border flex items-center justify-center shrink-0 transition-colors duration-200 ${x==="tests"?"border-accent/60 bg-accent/15 text-accent":"border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200"}`,children:[g.jsx(zk,{}),de.length>0?g.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 min-w-[14px] h-3.5 px-0.5 rounded-full bg-emerald-500 text-[8px] font-bold text-surface-950 flex items-center justify-center leading-none",children:de.length>99?"99+":de.length}):null]}),g.jsx("button",{type:"button",onClick:()=>_("schemas"),title:"Esquemas","aria-current":x==="schemas"?"page":void 0,className:`touch-target w-11 h-11 rounded-lg border flex items-center justify-center shrink-0 transition-colors duration-200 ${x==="schemas"?"border-accent/60 bg-accent/15 text-accent":"border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200"}`,children:g.jsx(Dk,{})}),g.jsx("button",{type:"button",onClick:()=>Kt(!0),title:"Asistente: configurar API de IA",className:"touch-target w-11 h-11 rounded-lg border border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-accent flex items-center justify-center shrink-0 transition-colors duration-200",children:g.jsx(kg,{})}),g.jsxs("button",{type:"button",onClick:()=>_("auth"),title:"Auth","aria-current":x==="auth"?"page":void 0,className:`relative touch-target w-11 h-11 rounded-lg border flex items-center justify-center shrink-0 transition-colors duration-200 ${x==="auth"?"border-accent/60 bg-accent/15 text-accent":"border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200"}`,children:[g.jsx(Fk,{}),Ue?g.jsx("span",{className:"absolute -top-0.5 -right-0.5 w-2 h-2 rounded-full bg-emerald-400 border border-surface-900","aria-hidden":!0}):null]})]}),g.jsxs("div",{className:"flex flex-col gap-0.5 items-center w-full py-1 mt-auto border-t border-surface-700/80",children:[g.jsx("button",{type:"button",onClick:()=>void On(),title:"Exportar estado de la app (flujos, tests, spec local…)",className:"touch-target w-11 h-11 rounded-lg border border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200 flex items-center justify-center transition-colors duration-200",children:g.jsx(Bk,{})}),g.jsx("button",{type:"button",onClick:()=>{var L;return(L=document.getElementById("adt-state-import"))==null?void 0:L.click()},title:"Importar estado de la app",className:"touch-target w-11 h-11 rounded-lg border border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200 flex items-center justify-center transition-colors duration-200",children:g.jsx(Hk,{})}),Ue?g.jsx("button",{type:"button",onClick:()=>void pt(),title:`Salir (${Ue.username})`,className:"touch-target w-11 h-11 rounded-lg border border-transparent bg-surface-800/80 text-rose-400/90 hover:bg-rose-950/50 flex items-center justify-center transition-colors duration-200",children:g.jsx(Vk,{})}):null]})]}):null]}),g.jsxs("main",{id:"main-content",tabIndex:-1,className:"flex-1 flex flex-col min-h-0 outline-none",children:[g.jsx("header",{className:"glass-sticky-header sticky top-0 z-20 px-4 py-3 flex flex-wrap gap-3 items-center",children:g.jsxs("label",{className:"text-xs text-slate-500 flex flex-col gap-1 sm:flex-row sm:items-center",children:[g.jsx("span",{className:"shrink-0 font-medium text-slate-400",children:"Base URL"}),g.jsx("input",{className:"glass-input sm:ml-2 min-h-[44px] sm:min-h-0 border rounded-xl px-3 py-2 text-sm w-full max-w-md text-slate-200 transition-colors duration-200 hover:border-accent/30",value:C,onChange:L=>j(L.target.value),placeholder:"https://api.ejemplo.com",autoComplete:"url",spellCheck:!1})]})}),x==="explore"&&g.jsxs("div",{className:"flex-1 flex flex-col lg:flex-row min-h-0",children:[g.jsxs("div",{className:`glass-explore-rail shrink-0 border-b lg:border-b-0 lg:border-r border-surface-600/35 overflow-auto transition-[width] duration-200 ease-out lg:rounded-r-2xl ${nn?"lg:w-14 lg:min-w-[3.5rem] max-h-16 lg:max-h-none":"lg:w-72 max-h-64 lg:max-h-none"}`,children:[g.jsxs("div",{className:nn?"max-lg:block lg:hidden":"block",children:[g.jsxs("div",{className:"p-2 flex items-start justify-between gap-2 border-b border-surface-700 lg:border-b-0",children:[g.jsx("p",{className:"text-xs uppercase tracking-wider text-slate-500 shrink-0",children:"Tags"}),g.jsx("button",{type:"button",className:"hidden lg:flex shrink-0 touch-target rounded-lg border border-surface-600 bg-surface-800 text-slate-300 hover:bg-surface-700 items-center justify-center text-sm leading-none transition-colors duration-200",onClick:()=>Mn(!0),"aria-label":"Ocultar lista de endpoints",title:"Ocultar endpoints",children:"‹"})]}),g.jsx("div",{className:"p-2 pt-1",children:g.jsxs("div",{className:"flex flex-wrap gap-1",children:[g.jsx("button",{type:"button",onClick:()=>T(null),className:`text-xs px-3 py-2 sm:py-1 rounded-xl min-h-[40px] sm:min-h-0 transition-all duration-200 ${M===null?"glass-pill-active text-slate-100":"glass-pill text-slate-300"}`,children:"Todos"}),Ye.map(L=>g.jsx("button",{type:"button",onClick:()=>T(L),className:`text-xs px-3 py-2 sm:py-1 rounded-xl min-h-[40px] sm:min-h-0 transition-all duration-200 ${M===L?"glass-pill-active text-slate-100":"glass-pill text-slate-300"}`,children:L},L))]})}),g.jsx("ul",{className:"text-sm",children:He.map(L=>g.jsx("li",{children:g.jsxs("button",{type:"button",onClick:()=>F({method:L.method,path:L.path}),className:`w-full text-left px-3 py-2.5 sm:py-2 min-h-[44px] sm:min-h-0 flex gap-2 items-center transition-all duration-150 rounded-r-xl ${(P==null?void 0:P.method)===L.method&&P.path===L.path?"glass-pill-active border-l-2 border-accent ml-0.5":"hover:bg-white/[0.04]"}`,children:[g.jsx(Na,{method:L.method}),g.jsxs("span",{className:"flex-1 min-w-0 flex items-center gap-1.5",children:[g.jsx("span",{className:"truncate text-slate-300",children:L.path}),r&&xf(r,L.method,L.path)?g.jsx("span",{className:"shrink-0 text-[9px] uppercase text-amber-400/90",title:"Deprecated",children:"dep"}):null]})]})},`${L.method}:${L.path}`))})]}),nn?g.jsxs("div",{className:"max-lg:hidden lg:flex flex-1 flex-col items-stretch py-2 px-1 gap-1 min-h-0 min-w-0",children:[g.jsx("button",{type:"button",className:"touch-target w-11 h-11 mx-auto rounded-lg border border-surface-600 bg-surface-800 text-slate-200 hover:bg-surface-700 flex items-center justify-center shrink-0 transition-colors duration-200",onClick:()=>Mn(!1),"aria-label":"Mostrar lista de endpoints completa",title:"Expandir lista de endpoints",children:g.jsx(wm,{className:"text-slate-300"})}),g.jsxs("div",{className:"text-center text-[9px] font-mono text-slate-500 leading-none px-0.5",title:`${He.length} operación(es) (filtro actual)`,children:[g.jsx("span",{className:"block text-slate-400 font-semibold text-[11px]",children:He.length}),g.jsx("span",{className:"text-[8px] uppercase tracking-tighter",children:"ops"})]}),g.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col gap-0.5 min-h-0 max-h-[min(70vh,32rem)] items-center w-full",role:"list","aria-label":"Endpoints numerados",children:He.map((L,we)=>{const Ee=(P==null?void 0:P.method)===L.method&&P.path===L.path;return g.jsx("button",{type:"button",role:"listitem",title:`${L.method.toUpperCase()} ${L.path}`,onClick:()=>F({method:L.method,path:L.path}),className:`touch-target min-h-[40px] min-w-[40px] w-10 h-10 shrink-0 rounded-md border border-surface-700 bg-surface-900 text-[11px] font-mono font-semibold text-slate-200 hover:bg-surface-800 transition-colors duration-150 ${Ok(L.method)} ${Ee?"ring-2 ring-accent/80 shadow-[inset_0_0_0_1px_rgba(56,189,248,0.2)]":""}`,children:we+1},`${L.method}:${L.path}`)})})]}):null]}),g.jsxs("div",{className:"flex-1 p-4 overflow-auto space-y-6",children:[g.jsxs("section",{className:"rounded-2xl border border-surface-600/50 bg-surface-900/45 p-4 space-y-3","aria-labelledby":"adt-openapi-tools-heading",children:[g.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[g.jsxs("div",{children:[g.jsx("h2",{id:"adt-openapi-tools-heading",className:"text-sm font-semibold text-slate-200",children:"Documento OpenAPI"}),g.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:["Fuente actual:"," ",g.jsx("span",{className:"text-slate-300 font-medium",children:c==="local"?"copia local (IndexedDB)":"servidor (openapi.json)"})]})]}),g.jsxs("div",{className:"flex flex-wrap gap-2 justify-end",children:[g.jsx("button",{type:"button",onClick:Wr,className:"text-xs px-3 py-2 rounded-xl glass-pill text-slate-200 min-h-[40px] sm:min-h-0 transition-colors duration-200",children:"Exportar OpenAPI"}),g.jsx("label",{htmlFor:"adt-openapi-import",className:"text-xs px-3 py-2 rounded-xl glass-pill text-slate-200 cursor-pointer min-h-[40px] sm:min-h-0 inline-flex items-center transition-colors duration-200",children:"Importar OpenAPI…"}),c==="local"?g.jsx("button",{type:"button",onClick:()=>void Un(),className:"text-xs px-3 py-2 rounded-xl border border-surface-600 text-slate-300 hover:bg-surface-800 min-h-[40px] sm:min-h-0 transition-colors duration-200",children:"Usar spec del servidor"}):null]})]}),g.jsxs("p",{className:"text-[11px] text-slate-500 leading-relaxed",children:["Importar guarda el JSON en tu navegador y sustituye al spec del servidor hasta que lo descartes. Exportar / importar el"," ",g.jsx("strong",{className:"text-slate-400",children:"estado de la app"})," (flujos, tests, entornos y este spec si existe) está en el menú lateral."]}),h?g.jsx("p",{className:"text-[11px] text-rose-300/95 rounded-lg border border-rose-500/35 bg-rose-950/30 px-3 py-2",role:"alert",children:h}):null]}),P?g.jsxs(g.Fragment,{children:[g.jsxs("div",{children:[g.jsxs("h2",{className:"font-display font-semibold text-white text-lg flex flex-wrap items-center gap-2",children:[g.jsx(Na,{method:P.method,size:"md"}),g.jsx("span",{className:"font-mono text-slate-200 break-all",children:P.path}),r&&xf(r,P.method,P.path)?g.jsx("span",{className:"text-[10px] uppercase px-2 py-0.5 rounded-md border border-amber-500/40 text-amber-300 bg-amber-500/10",children:"deprecated"}):null]}),Ht!=null&&Ht.summary?g.jsx("p",{className:"text-sm text-slate-300 mt-2 leading-relaxed",children:Ht.summary}):null,Ht!=null&&Ht.description&&Ht.description!==Ht.summary?g.jsx("p",{className:"text-xs text-slate-500 mt-2 leading-relaxed whitespace-pre-wrap",children:Ht.description}):null,Ht!=null&&Ht.exampleStr?g.jsxs("details",{className:"mt-3 group",children:[g.jsx("summary",{className:"text-xs text-slate-400 cursor-pointer hover:text-slate-300",children:"Ejemplo de cuerpo (request)"}),g.jsx("pre",{className:"mt-2 glass-input border rounded-xl p-3 text-xs font-mono text-slate-200 overflow-auto max-h-48",children:Ht.exampleStr})]}):null,g.jsxs("p",{className:"text-xs text-slate-500 mt-2",children:["Filtro de exportación de servicio: ",rr]})]}),r?g.jsx(Ak,{doc:r,selectedOp:P,baseUrl:C,buildHeaders:un}):null,g.jsxs("section",{className:"space-y-3",children:[g.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Snippets por lenguaje"}),g.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:An&&bf.map(({id:L,label:we})=>g.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/60 overflow-hidden",children:[g.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-surface-700 bg-surface-800/50",children:[g.jsx("span",{className:"text-xs font-medium text-accent",children:we}),g.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-surface-600",onClick:()=>void _m(An[L]),children:"Copiar"})]}),g.jsx("pre",{className:"text-[11px] p-3 overflow-auto max-h-56 text-slate-300 font-mono whitespace-pre-wrap",children:An[L]})]},L))})]}),g.jsxs("section",{className:"space-y-3 rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[g.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Cliente / servicio generado"}),g.jsx("p",{className:"text-xs text-slate-500",children:rr}),g.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[g.jsxs("label",{className:"text-xs text-slate-400",children:["Lenguaje del archivo",g.jsx("select",{className:"ml-2 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:$,onChange:L=>R(L.target.value),children:bf.map(({id:L,label:we})=>g.jsx("option",{value:L,children:we},L))})]}),g.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg bg-surface-700 hover:bg-surface-600",onClick:()=>void _m(Cr),children:"Copiar servicio"})]}),g.jsx("pre",{className:"text-[11px] bg-surface-950 border border-surface-700 rounded-lg p-3 overflow-auto max-h-96 text-slate-200 font-mono whitespace-pre-wrap",children:Cr})]}),g.jsx("div",{className:"flex flex-wrap gap-2 pt-2 border-t border-surface-800",children:g.jsx("button",{type:"button",className:"text-xs px-3 py-2 rounded-lg bg-surface-800 hover:bg-surface-700",onClick:Yr,children:"Añadir operación actual a un flujo (ve a Flujos)"})})]}):g.jsx("p",{className:"text-slate-500",children:"Selecciona una operación en la lista."})]})]}),x==="schemas"&&g.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:g.jsx(n2,{doc:r})}),x==="flows"&&g.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[g.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4",children:[g.jsx("h3",{className:"text-sm font-semibold text-white mb-3",children:"Flujos guardados"}),ae.length===0?g.jsx("p",{className:"text-sm text-slate-500",children:"Aún no hay flujos. Crea uno en el editor y guarda."}):g.jsx("ul",{className:"space-y-2",children:ae.map(L=>{var we,Ee;return g.jsxs("li",{className:"flex flex-wrap items-center gap-2 justify-between rounded-lg border border-surface-700 bg-surface-950/50 px-3 py-2",children:[g.jsxs("div",{children:[g.jsx("span",{className:"text-sm text-slate-200 font-medium",children:L.name}),g.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[(((Ee=(we=L.graph)==null?void 0:we.nodes)==null?void 0:Ee.length)??L.steps.length)||0," nodo(s)"]})]}),g.jsxs("div",{className:"flex flex-wrap gap-2",children:[g.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded-lg bg-emerald-600/30 text-emerald-300 hover:bg-emerald-600/50",title:"Ejecutar sin cargar el editor",onClick:()=>void zn(L),children:"Play"}),g.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent hover:bg-accent/30",onClick:()=>tr(L),children:"Editar"}),g.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-red-900/40 text-slate-300",onClick:()=>void It(L.id),children:"Eliminar"})]})]},L.id!=null?`flow-${L.id}`:`flow-${L.name}`)})})]}),g.jsxs("section",{className:"space-y-4 max-w-6xl",children:[g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[g.jsx("h3",{className:"text-sm font-semibold text-white",children:"Editor de flujo (nodos y cables)"}),g.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg border border-surface-600 text-slate-300 hover:bg-surface-800",onClick:Fn,children:"Nuevo flujo"})]}),De!=null&&g.jsxs("p",{className:"text-xs text-accent",children:["Editando flujo guardado (#",De,")"]}),g.jsxs("p",{className:"text-sm text-slate-400",children:["Cada nodo es un endpoint del spec. Conecta ",g.jsx("strong",{className:"text-slate-300",children:"res → req"})," ","y define qué campo de la respuesta pasa al siguiente request (JSON path, variable, header, query o ",g.jsx("code",{className:"text-accent",children:"{variable}"})," en la ruta)."]}),g.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm w-full max-w-md",value:fe,onChange:L=>J(L.target.value),placeholder:"Nombre del flujo"}),g.jsx(vk,{doc:r,ops:_t,graph:X,onGraphChange:hr},ve),g.jsxs("div",{className:"flex flex-wrap gap-2",children:[g.jsx("button",{type:"button",className:"px-3 py-2 rounded-lg bg-emerald-600 text-white text-sm font-medium hover:bg-emerald-500",onClick:()=>void zo(),children:"Play (grafo)"}),g.jsx("button",{type:"button",className:"px-3 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void yt(),children:De!=null?"Guardar cambios":"Guardar flujo"})]}),g.jsx("pre",{className:"text-xs bg-surface-950 border border-surface-700 rounded-lg p-3 max-h-64 overflow-auto whitespace-pre-wrap",children:q||"Resultado de la ejecución aquí."})]})]}),x==="tests"&&g.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[g.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[g.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suites guardadas"}),de.length>0&&g.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg bg-emerald-600/80 text-white hover:bg-emerald-500",onClick:()=>void Hn(),children:"Ejecutar todas las suites"})]}),de.length===0?g.jsx("p",{className:"text-sm text-slate-500",children:"Ninguna suite guardada."}):g.jsx("ul",{className:"space-y-2",children:de.map(L=>g.jsxs("li",{className:"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-surface-700 bg-surface-950/50 px-3 py-2",children:[g.jsxs("div",{children:[g.jsx("span",{className:"text-sm text-slate-200 font-medium",children:L.name}),g.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[L.cases.length," caso(s)"]})]}),g.jsxs("div",{className:"flex flex-wrap gap-2",children:[g.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded-lg bg-emerald-600/30 text-emerald-300 hover:bg-emerald-600/50",onClick:()=>void mr(L),children:"Play"}),g.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent",onClick:()=>qt(L),children:"Editar"}),g.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-red-900/40",onClick:()=>void Vn(L.id),children:"Eliminar"})]})]},L.id!=null?`suite-${L.id}`:`suite-${L.name}`))})]}),g.jsxs("section",{className:"space-y-4",children:[g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[g.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suite en edición"}),g.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg border border-surface-600 text-slate-300 hover:bg-surface-800",onClick:gr,children:"Nueva suite"})]}),Ze!=null&&g.jsxs("p",{className:"text-xs text-accent",children:["Editando suite guardada (#",Ze,")"]}),g.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm max-w-md",value:A.name,onChange:L=>U(we=>({...we,name:L.target.value})),placeholder:"Nombre de la suite"}),g.jsxs("div",{className:"flex flex-wrap gap-2 items-end rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[g.jsxs("label",{className:"text-xs text-slate-400 flex-1 min-w-[200px]",children:["Añadir endpoint del spec",g.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm font-mono",value:Re,onChange:L=>Se(L.target.value),children:_t.map(L=>g.jsxs("option",{value:_f(L.method,L.path),children:[L.method.toUpperCase()," ",L.path]},_f(L.method,L.path)))})]}),g.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-800 text-sm hover:bg-surface-700",onClick:jr,children:"Añadir a la suite"})]}),g.jsx("ul",{className:"space-y-4",children:A.cases.map(L=>{const we=bm(L.expectStatus)?String(L.expectStatus):"custom";return g.jsxs("li",{className:"rounded-xl border border-surface-700 bg-surface-950/40 p-4 space-y-3 text-sm",children:[g.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[g.jsxs("span",{className:"flex flex-wrap items-center gap-2 min-w-0",children:[g.jsx(Na,{method:L.method}),g.jsx("span",{className:"font-mono text-xs text-slate-300 break-all",children:L.path})]}),g.jsx("button",{type:"button",className:"text-xs text-red-400 hover:underline shrink-0",onClick:()=>nr(L.id),children:"Quitar"})]}),g.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[g.jsxs("label",{className:"text-xs text-slate-400 block",children:["Código HTTP esperado",g.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[g.jsxs("select",{className:"bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm max-w-[200px]",value:we,onChange:Ee=>{const Qe=Ee.target.value;if(Qe==="custom"){cn(L.id,{expectStatus:bm(L.expectStatus)?1e3:L.expectStatus});return}cn(L.id,{expectStatus:Number(Qe)})},children:[Pg.map(Ee=>g.jsx("option",{value:String(Ee.value),children:Ee.label},Ee.value)),g.jsx("option",{value:"custom",children:"Otro…"})]}),we==="custom"&&g.jsx("input",{type:"number",className:"w-20 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:L.expectStatus,onChange:Ee=>cn(L.id,{expectStatus:Number(Ee.target.value)||0})})]})]}),g.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["El body contiene (opcional)",g.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono text-xs",placeholder:'ej. "ok"',value:L.contains??"",onChange:Ee=>cn(L.id,{contains:Ee.target.value||void 0})})]}),g.jsxs("label",{className:"text-xs text-slate-400 block",children:["JSON path (opcional)",g.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono text-xs",placeholder:"$.data.id",value:L.jsonPath??"",onChange:Ee=>cn(L.id,{jsonPath:Ee.target.value||void 0})})]}),g.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["Valor esperado en JSON path (opcional)",g.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono text-xs",placeholder:"Vacío = solo comprobar que existe",value:L.expectJsonValue??"",onChange:Ee=>cn(L.id,{expectJsonValue:Ee.target.value||void 0})})]})]})]},L.id)})}),g.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[g.jsx("button",{type:"button",className:"px-5 py-2.5 rounded-lg bg-emerald-600 text-white text-sm font-semibold hover:bg-emerald-500 shadow-lg shadow-emerald-900/30",onClick:()=>void hi(),children:"Correr todos los casos (suite actual)"}),g.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void lo(),children:Ze!=null?"Guardar cambios":"Guardar suite"})]}),g.jsx("pre",{className:"text-xs bg-surface-950 border border-surface-700 rounded-lg p-3 whitespace-pre-wrap min-h-[4rem]",children:Te||"—"})]})]}),x==="auth"&&g.jsxs("div",{className:"p-4 space-y-4 max-w-lg",children:[g.jsxs("p",{className:"text-sm text-slate-400",children:["Esquemas en el spec: ",Qy(r).join(", ")||"ninguno"]}),g.jsxs("label",{className:"block text-sm",children:["Bearer token",g.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:V,onChange:L=>K(L.target.value),placeholder:"eyJ..."})]}),g.jsxs("label",{className:"block text-sm",children:["API key header",g.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:pe,onChange:L=>ke(L.target.value)})]}),g.jsxs("label",{className:"block text-sm",children:["API key",g.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:W,onChange:L=>Q(L.target.value),type:"password",autoComplete:"off"})]}),g.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void uo(),children:"Recordar en este navegador"})]})]})]}),g.jsx(e2,{open:kn,onClose:()=>fr(!1),ops:Tn,onPick:qr}),kt?g.jsx("div",{className:"glass-modal-backdrop fixed inset-0 z-[110] flex items-end sm:items-center justify-center p-4 sm:p-6",role:"presentation",onClick:()=>Kt(!1),children:g.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"adt-llm-modal-title",className:"glass-modal-panel w-full max-w-md rounded-2xl max-h-[90vh] overflow-y-auto",onClick:L=>L.stopPropagation(),children:[g.jsxs("div",{className:"flex items-start justify-between gap-2 px-4 py-3 border-b border-white/[0.08]",children:[g.jsx("h2",{id:"adt-llm-modal-title",className:"text-sm font-semibold text-slate-100 pr-2",children:"Asistente: proveedor de IA"}),g.jsx("button",{type:"button",className:"shrink-0 touch-target min-w-[2.25rem] min-h-[2.25rem] rounded-xl text-slate-400 hover:text-white glass-pill text-lg leading-none",onClick:()=>Kt(!1),"aria-label":"Cerrar",children:"×"})]}),g.jsxs("div",{className:"px-4 py-4 space-y-3",children:[g.jsx("p",{className:"text-xs text-slate-400 leading-relaxed",children:"Tu clave se guarda solo en este navegador. El servidor la reenvía al proveedor; no se almacena en el servidor."}),g.jsxs("label",{className:"block text-xs text-slate-400",children:["Proveedor",g.jsxs("select",{className:"glass-input mt-1 w-full border rounded-xl px-3 py-2 text-sm text-slate-200",value:nt,onChange:L=>{const we=L.target.value;ct(we),gn(Ee=>Ee.trim()?Ee:nu(we))},children:[g.jsx("option",{value:"anthropic",children:"Anthropic (Claude)"}),g.jsx("option",{value:"openai",children:"OpenAI"}),g.jsx("option",{value:"openrouter",children:"OpenRouter"})]})]}),g.jsxs("label",{className:"block text-xs text-slate-400",children:["Modelo (opcional)",g.jsx("input",{className:"glass-input mt-1 w-full border rounded-xl px-3 py-2 text-sm font-mono text-slate-200",value:St,onChange:L=>gn(L.target.value),placeholder:nu(nt),spellCheck:!1})]}),g.jsxs("label",{className:"block text-xs text-slate-400",children:["API key",g.jsx("input",{type:"password",className:"glass-input mt-1 w-full border rounded-xl px-3 py-2 text-sm font-mono text-slate-200",value:Xt,onChange:L=>Qt(L.target.value),placeholder:nt==="anthropic"?"sk-ant-…":nt==="openai"?"sk-…":"sk-or-v1-…",autoComplete:"off"})]}),g.jsxs("div",{className:"flex flex-wrap gap-2 pt-1",children:[g.jsx("button",{type:"button",onClick:yr,className:"px-4 py-2.5 rounded-xl bg-accent text-surface-950 text-sm font-medium shadow-[0_8px_24px_-8px_rgb(var(--accent)/0.55)] hover:brightness-110 transition-[filter]",children:"Guardar"}),g.jsx("button",{type:"button",onClick:()=>Kt(!1),className:"px-4 py-2.5 rounded-xl glass-pill text-slate-300 text-sm",children:"Cancelar"})]})]})]})}):null,g.jsx(Gk,{doc:r,contextExtras:pr,provider:nt,model:St,apiKey:Xt,onOpenLlmSettings:Fo}),g.jsx("footer",{className:"glass-footer px-3 py-2.5 text-center text-[11px] text-slate-500 shrink-0",children:"made with ♥ by andres arcila"})]})}const a2={surface950:"#0c0f14",surface900:"#12171f",surface800:"#1a2230",surface700:"#243044",accent:"#38bdf8",accentDim:"#0ea5e9"};function ks(t){const r=t.trim(),i=/^#?([0-9a-f]{6})$/i.exec(r);if(!i)return"12 15 20";const s=parseInt(i[1],16);return`${s>>16&255} ${s>>8&255} ${s&255}`}function l2(t){return{...a2,...t}}function u2(t){var s,l;const r=(s=t.logoBase64)==null?void 0:s.trim();return r?r.startsWith("data:")?r:`data:${((l=t.logoMimeType)==null?void 0:l.trim())||"image/png"};base64,${r}`:null}function c2(t){var i;const r=l2(t==null?void 0:t.colors);return{productName:((i=t==null?void 0:t.productName)==null?void 0:i.trim())||null,logoDataUrl:t?u2(t):null,colors:r,colorsRgb:{surface950:ks(r.surface950),surface900:ks(r.surface900),surface800:ks(r.surface800),surface700:ks(r.surface700),accent:ks(r.accent),accentDim:ks(r.accentDim)}}}const f2={credentials:"include"};function d2(t){const r=document.documentElement;r.style.setProperty("--surface-950",t.surface950),r.style.setProperty("--surface-900",t.surface900),r.style.setProperty("--surface-800",t.surface800),r.style.setProperty("--surface-700",t.surface700),r.style.setProperty("--accent",t.accent),r.style.setProperty("--accent-dim",t.accentDim)}async function p2(){const t=c2(void 0);try{const r=await fetch("/docs/ui-config.json",f2);return r.status===401?{...t,docsAuthRequired:!0}:r.ok?await r.json():t}catch{return t}}(async()=>{const t=await p2();d2(t.colorsRgb),$y.createRoot(document.getElementById("root")).render(g.jsx(Sm.StrictMode,{children:g.jsx(bk,{value:{productName:t.productName,logoDataUrl:t.logoDataUrl},children:g.jsx(s2,{})})}))})();
|