@api-doc-tor/express 0.2.2 → 0.2.7

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 Fy=Object.defineProperty;var By=(e,r,o)=>r in e?Fy(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o;var gs=(e,r,o)=>By(e,typeof r!="symbol"?r+"":r,o);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const c of a)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function o(a){const c={};return a.integrity&&(c.integrity=a.integrity),a.referrerPolicy&&(c.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?c.credentials="include":a.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function i(a){if(a.ep)return;a.ep=!0;const c=o(a);fetch(a.href,c)}})();var Hy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Mu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ld={exports:{}},ja={},ud={exports:{}},bt={};/**
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 ih;function Vy(){if(ih)return bt;ih=1;var e=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),d=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),w=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),x=Symbol.iterator;function k(D){return D===null||typeof D!="object"?null:(D=x&&D[x]||D["@@iterator"],typeof D=="function"?D:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,M={};function A(D,K,Se){this.props=D,this.context=K,this.refs=M,this.updater=Se||_}A.prototype.isReactComponent={},A.prototype.setState=function(D,K){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,K,"setState")},A.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function T(){}T.prototype=A.prototype;function U(D,K,Se){this.props=D,this.context=K,this.refs=M,this.updater=Se||_}var P=U.prototype=new T;P.constructor=U,j(P,A.prototype),P.isPureReactComponent=!0;var $=Array.isArray,R=Object.prototype.hasOwnProperty,F={current:null},W={key:!0,ref:!0,__self:!0,__source:!0};function ue(D,K,Se){var je,Le={},Ie=null,Ee=null;if(K!=null)for(je in K.ref!==void 0&&(Ee=K.ref),K.key!==void 0&&(Ie=""+K.key),K)R.call(K,je)&&!W.hasOwnProperty(je)&&(Le[je]=K[je]);var Ne=arguments.length-2;if(Ne===1)Le.children=Se;else if(1<Ne){for(var Re=Array(Ne),_e=0;_e<Ne;_e++)Re[_e]=arguments[_e+2];Le.children=Re}if(D&&D.defaultProps)for(je in Ne=D.defaultProps,Ne)Le[je]===void 0&&(Le[je]=Ne[je]);return{$$typeof:e,type:D,key:Ie,ref:Ee,props:Le,_owner:F.current}}function ne(D,K){return{$$typeof:e,type:D.type,key:K,ref:D.ref,props:D.props,_owner:D._owner}}function ke(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function Y(D){var K={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(Se){return K[Se]})}var Q=/\/+/g;function ve(D,K){return typeof D=="object"&&D!==null&&D.key!=null?Y(""+D.key):K.toString(36)}function B(D,K,Se,je,Le){var Ie=typeof D;(Ie==="undefined"||Ie==="boolean")&&(D=null);var Ee=!1;if(D===null)Ee=!0;else switch(Ie){case"string":case"number":Ee=!0;break;case"object":switch(D.$$typeof){case e:case r:Ee=!0}}if(Ee)return Ee=D,Le=Le(Ee),D=je===""?"."+ve(Ee,0):je,$(Le)?(Se="",D!=null&&(Se=D.replace(Q,"$&/")+"/"),B(Le,K,Se,"",function(_e){return _e})):Le!=null&&(ke(Le)&&(Le=ne(Le,Se+(!Le.key||Ee&&Ee.key===Le.key?"":(""+Le.key).replace(Q,"$&/")+"/")+D)),K.push(Le)),1;if(Ee=0,je=je===""?".":je+":",$(D))for(var Ne=0;Ne<D.length;Ne++){Ie=D[Ne];var Re=je+ve(Ie,Ne);Ee+=B(Ie,K,Se,Re,Le)}else if(Re=k(D),typeof Re=="function")for(D=Re.call(D),Ne=0;!(Ie=D.next()).done;)Ie=Ie.value,Re=je+ve(Ie,Ne++),Ee+=B(Ie,K,Se,Re,Le);else if(Ie==="object")throw K=String(D),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.");return Ee}function ie(D,K,Se){if(D==null)return D;var je=[],Le=0;return B(D,je,"","",function(Ie){return K.call(Se,Ie,Le++)}),je}function G(D){if(D._status===-1){var K=D._result;K=K(),K.then(function(Se){(D._status===0||D._status===-1)&&(D._status=1,D._result=Se)},function(Se){(D._status===0||D._status===-1)&&(D._status=2,D._result=Se)}),D._status===-1&&(D._status=0,D._result=K)}if(D._status===1)return D._result.default;throw D._result}var se={current:null},H={transition:null},q={ReactCurrentDispatcher:se,ReactCurrentBatchConfig:H,ReactCurrentOwner:F};function J(){throw Error("act(...) is not supported in production builds of React.")}return bt.Children={map:ie,forEach:function(D,K,Se){ie(D,function(){K.apply(this,arguments)},Se)},count:function(D){var K=0;return ie(D,function(){K++}),K},toArray:function(D){return ie(D,function(K){return K})||[]},only:function(D){if(!ke(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},bt.Component=A,bt.Fragment=o,bt.Profiler=a,bt.PureComponent=U,bt.StrictMode=i,bt.Suspense=y,bt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q,bt.act=J,bt.cloneElement=function(D,K,Se){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var je=j({},D.props),Le=D.key,Ie=D.ref,Ee=D._owner;if(K!=null){if(K.ref!==void 0&&(Ie=K.ref,Ee=F.current),K.key!==void 0&&(Le=""+K.key),D.type&&D.type.defaultProps)var Ne=D.type.defaultProps;for(Re in K)R.call(K,Re)&&!W.hasOwnProperty(Re)&&(je[Re]=K[Re]===void 0&&Ne!==void 0?Ne[Re]:K[Re])}var Re=arguments.length-2;if(Re===1)je.children=Se;else if(1<Re){Ne=Array(Re);for(var _e=0;_e<Re;_e++)Ne[_e]=arguments[_e+2];je.children=Ne}return{$$typeof:e,type:D.type,key:Le,ref:Ie,props:je,_owner:Ee}},bt.createContext=function(D){return D={$$typeof:d,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},D.Provider={$$typeof:c,_context:D},D.Consumer=D},bt.createElement=ue,bt.createFactory=function(D){var K=ue.bind(null,D);return K.type=D,K},bt.createRef=function(){return{current:null}},bt.forwardRef=function(D){return{$$typeof:m,render:D}},bt.isValidElement=ke,bt.lazy=function(D){return{$$typeof:S,_payload:{_status:-1,_result:D},_init:G}},bt.memo=function(D,K){return{$$typeof:w,type:D,compare:K===void 0?null:K}},bt.startTransition=function(D){var K=H.transition;H.transition={};try{D()}finally{H.transition=K}},bt.unstable_act=J,bt.useCallback=function(D,K){return se.current.useCallback(D,K)},bt.useContext=function(D){return se.current.useContext(D)},bt.useDebugValue=function(){},bt.useDeferredValue=function(D){return se.current.useDeferredValue(D)},bt.useEffect=function(D,K){return se.current.useEffect(D,K)},bt.useId=function(){return se.current.useId()},bt.useImperativeHandle=function(D,K,Se){return se.current.useImperativeHandle(D,K,Se)},bt.useInsertionEffect=function(D,K){return se.current.useInsertionEffect(D,K)},bt.useLayoutEffect=function(D,K){return se.current.useLayoutEffect(D,K)},bt.useMemo=function(D,K){return se.current.useMemo(D,K)},bt.useReducer=function(D,K,Se){return se.current.useReducer(D,K,Se)},bt.useRef=function(D){return se.current.useRef(D)},bt.useState=function(D){return se.current.useState(D)},bt.useSyncExternalStore=function(D,K,Se){return se.current.useSyncExternalStore(D,K,Se)},bt.useTransition=function(){return se.current.useTransition()},bt.version="18.3.1",bt}var ah;function Ka(){return ah||(ah=1,ud.exports=Vy()),ud.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 lh;function Uy(){if(lh)return ja;lh=1;var e=Ka(),r=Symbol.for("react.element"),o=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function d(m,y,w){var S,x={},k=null,_=null;w!==void 0&&(k=""+w),y.key!==void 0&&(k=""+y.key),y.ref!==void 0&&(_=y.ref);for(S in y)i.call(y,S)&&!c.hasOwnProperty(S)&&(x[S]=y[S]);if(m&&m.defaultProps)for(S in y=m.defaultProps,y)x[S]===void 0&&(x[S]=y[S]);return{$$typeof:r,type:m,key:k,ref:_,props:x,_owner:a.current}}return ja.Fragment=o,ja.jsx=d,ja.jsxs=d,ja}var uh;function Ky(){return uh||(uh=1,ld.exports=Uy()),ld.exports}var p=Ky(),L=Ka();const Dm=Mu(L);var Gl={},cd={exports:{}},sr={},dd={exports:{}},fd={};/**
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 ch;function qy(){return ch||(ch=1,(function(e){function r(H,q){var J=H.length;H.push(q);e:for(;0<J;){var D=J-1>>>1,K=H[D];if(0<a(K,q))H[D]=q,H[J]=K,J=D;else break e}}function o(H){return H.length===0?null:H[0]}function i(H){if(H.length===0)return null;var q=H[0],J=H.pop();if(J!==q){H[0]=J;e:for(var D=0,K=H.length,Se=K>>>1;D<Se;){var je=2*(D+1)-1,Le=H[je],Ie=je+1,Ee=H[Ie];if(0>a(Le,J))Ie<K&&0>a(Ee,Le)?(H[D]=Ee,H[Ie]=J,D=Ie):(H[D]=Le,H[je]=J,D=je);else if(Ie<K&&0>a(Ee,J))H[D]=Ee,H[Ie]=J,D=Ie;else break e}}return q}function a(H,q){var J=H.sortIndex-q.sortIndex;return J!==0?J:H.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,m=d.now();e.unstable_now=function(){return d.now()-m}}var y=[],w=[],S=1,x=null,k=3,_=!1,j=!1,M=!1,A=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,U=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(H){for(var q=o(w);q!==null;){if(q.callback===null)i(w);else if(q.startTime<=H)i(w),q.sortIndex=q.expirationTime,r(y,q);else break;q=o(w)}}function $(H){if(M=!1,P(H),!j)if(o(y)!==null)j=!0,G(R);else{var q=o(w);q!==null&&se($,q.startTime-H)}}function R(H,q){j=!1,M&&(M=!1,T(ue),ue=-1),_=!0;var J=k;try{for(P(q),x=o(y);x!==null&&(!(x.expirationTime>q)||H&&!Y());){var D=x.callback;if(typeof D=="function"){x.callback=null,k=x.priorityLevel;var K=D(x.expirationTime<=q);q=e.unstable_now(),typeof K=="function"?x.callback=K:x===o(y)&&i(y),P(q)}else i(y);x=o(y)}if(x!==null)var Se=!0;else{var je=o(w);je!==null&&se($,je.startTime-q),Se=!1}return Se}finally{x=null,k=J,_=!1}}var F=!1,W=null,ue=-1,ne=5,ke=-1;function Y(){return!(e.unstable_now()-ke<ne)}function Q(){if(W!==null){var H=e.unstable_now();ke=H;var q=!0;try{q=W(!0,H)}finally{q?ve():(F=!1,W=null)}}else F=!1}var ve;if(typeof U=="function")ve=function(){U(Q)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,ie=B.port2;B.port1.onmessage=Q,ve=function(){ie.postMessage(null)}}else ve=function(){A(Q,0)};function G(H){W=H,F||(F=!0,ve())}function se(H,q){ue=A(function(){H(e.unstable_now())},q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(H){H.callback=null},e.unstable_continueExecution=function(){j||_||(j=!0,G(R))},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ne=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return k},e.unstable_getFirstCallbackNode=function(){return o(y)},e.unstable_next=function(H){switch(k){case 1:case 2:case 3:var q=3;break;default:q=k}var J=k;k=q;try{return H()}finally{k=J}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(H,q){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var J=k;k=H;try{return q()}finally{k=J}},e.unstable_scheduleCallback=function(H,q,J){var D=e.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?D+J:D):J=D,H){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=J+K,H={id:S++,callback:q,priorityLevel:H,startTime:J,expirationTime:K,sortIndex:-1},J>D?(H.sortIndex=J,r(w,H),o(y)===null&&H===o(w)&&(M?(T(ue),ue=-1):M=!0,se($,J-D))):(H.sortIndex=K,r(y,H),j||_||(j=!0,G(R))),H},e.unstable_shouldYield=Y,e.unstable_wrapCallback=function(H){var q=k;return function(){var J=k;k=q;try{return H.apply(this,arguments)}finally{k=J}}}})(fd)),fd}var dh;function Wy(){return dh||(dh=1,dd.exports=qy()),dd.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 fh;function Yy(){if(fh)return sr;fh=1;var e=Ka(),r=Wy();function o(t){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+t,s=1;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s]);return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,a={};function c(t,n){d(t,n),d(t+"Capture",n)}function d(t,n){for(a[t]=n,t=0;t<n.length;t++)i.add(n[t])}var m=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),y=Object.prototype.hasOwnProperty,w=/^[: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 k(t){return y.call(x,t)?!0:y.call(S,t)?!1:w.test(t)?x[t]=!0:(S[t]=!0,!1)}function _(t,n,s,u){if(s!==null&&s.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return u?!1:s!==null?!s.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function j(t,n,s,u){if(n===null||typeof n>"u"||_(t,n,s,u))return!0;if(u)return!1;if(s!==null)switch(s.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(t,n,s,u,h,v,C){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=u,this.attributeNamespace=h,this.mustUseProperty=s,this.propertyName=t,this.type=n,this.sanitizeURL=v,this.removeEmptyString=C}var A={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){A[t]=new M(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var n=t[0];A[n]=new M(n,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){A[t]=new M(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){A[t]=new M(t,2,!1,t,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(t){A[t]=new M(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){A[t]=new M(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){A[t]=new M(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){A[t]=new M(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){A[t]=new M(t,5,!1,t.toLowerCase(),null,!1,!1)});var T=/[\-:]([a-z])/g;function U(t){return t[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(t){var n=t.replace(T,U);A[n]=new M(n,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var n=t.replace(T,U);A[n]=new M(n,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var n=t.replace(T,U);A[n]=new M(n,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){A[t]=new M(t,1,!1,t.toLowerCase(),null,!1,!1)}),A.xlinkHref=new M("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){A[t]=new M(t,1,!1,t.toLowerCase(),null,!0,!0)});function P(t,n,s,u){var h=A.hasOwnProperty(n)?A[n]:null;(h!==null?h.type!==0:u||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(j(n,s,h,u)&&(s=null),u||h===null?k(n)&&(s===null?t.removeAttribute(n):t.setAttribute(n,""+s)):h.mustUseProperty?t[h.propertyName]=s===null?h.type===3?!1:"":s:(n=h.attributeName,u=h.attributeNamespace,s===null?t.removeAttribute(n):(h=h.type,s=h===3||h===4&&s===!0?"":""+s,u?t.setAttributeNS(u,n,s):t.setAttribute(n,s))))}var $=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Symbol.for("react.element"),F=Symbol.for("react.portal"),W=Symbol.for("react.fragment"),ue=Symbol.for("react.strict_mode"),ne=Symbol.for("react.profiler"),ke=Symbol.for("react.provider"),Y=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),ve=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),ie=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),se=Symbol.for("react.offscreen"),H=Symbol.iterator;function q(t){return t===null||typeof t!="object"?null:(t=H&&t[H]||t["@@iterator"],typeof t=="function"?t:null)}var J=Object.assign,D;function K(t){if(D===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);D=n&&n[1]||""}return`
34
+ `+D+t}var Se=!1;function je(t,n){if(!t||Se)return"";Se=!0;var s=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(we){var u=we}Reflect.construct(t,[],n)}else{try{n.call()}catch(we){u=we}t.call(n.prototype)}else{try{throw Error()}catch(we){u=we}t()}}catch(we){if(we&&u&&typeof we.stack=="string"){for(var h=we.stack.split(`
35
+ `),v=u.stack.split(`
36
+ `),C=h.length-1,V=v.length-1;1<=C&&0<=V&&h[C]!==v[V];)V--;for(;1<=C&&0<=V;C--,V--)if(h[C]!==v[V]){if(C!==1||V!==1)do if(C--,V--,0>V||h[C]!==v[V]){var X=`
37
+ `+h[C].replace(" at new "," at ");return t.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",t.displayName)),X}while(1<=C&&0<=V);break}}}finally{Se=!1,Error.prepareStackTrace=s}return(t=t?t.displayName||t.name:"")?K(t):""}function Le(t){switch(t.tag){case 5:return K(t.type);case 16:return K("Lazy");case 13:return K("Suspense");case 19:return K("SuspenseList");case 0:case 2:case 15:return t=je(t.type,!1),t;case 11:return t=je(t.type.render,!1),t;case 1:return t=je(t.type,!0),t;default:return""}}function Ie(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case W:return"Fragment";case F:return"Portal";case ne:return"Profiler";case ue:return"StrictMode";case ve:return"Suspense";case B:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Y:return(t.displayName||"Context")+".Consumer";case ke:return(t._context.displayName||"Context")+".Provider";case Q:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case ie:return n=t.displayName||null,n!==null?n:Ie(t.type)||"Memo";case G:n=t._payload,t=t._init;try{return Ie(t(n))}catch{}}return null}function Ee(t){var n=t.type;switch(t.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 t=n.render,t=t.displayName||t.name||"",n.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ie(n);case 8:return n===ue?"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 Ne(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Re(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function _e(t){var n=Re(t)?"checked":"value",s=Object.getOwnPropertyDescriptor(t.constructor.prototype,n),u=""+t[n];if(!t.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var h=s.get,v=s.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return h.call(this)},set:function(C){u=""+C,v.call(this,C)}}),Object.defineProperty(t,n,{enumerable:s.enumerable}),{getValue:function(){return u},setValue:function(C){u=""+C},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function tt(t){t._valueTracker||(t._valueTracker=_e(t))}function Fe(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var s=n.getValue(),u="";return t&&(u=Re(t)?t.checked?"true":"false":t.value),t=u,t!==s?(n.setValue(t),!0):!1}function qe(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function mt(t,n){var s=n.checked;return J({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??t._wrapperState.initialChecked})}function dt(t,n){var s=n.defaultValue==null?"":n.defaultValue,u=n.checked!=null?n.checked:n.defaultChecked;s=Ne(n.value!=null?n.value:s),t._wrapperState={initialChecked:u,initialValue:s,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function gt(t,n){n=n.checked,n!=null&&P(t,"checked",n,!1)}function It(t,n){gt(t,n);var s=Ne(n.value),u=n.type;if(s!=null)u==="number"?(s===0&&t.value===""||t.value!=s)&&(t.value=""+s):t.value!==""+s&&(t.value=""+s);else if(u==="submit"||u==="reset"){t.removeAttribute("value");return}n.hasOwnProperty("value")?Zt(t,n.type,s):n.hasOwnProperty("defaultValue")&&Zt(t,n.type,Ne(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(t.defaultChecked=!!n.defaultChecked)}function mn(t,n,s){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=""+t._wrapperState.initialValue,s||n===t.value||(t.value=n),t.defaultValue=n}s=t.name,s!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,s!==""&&(t.name=s)}function Zt(t,n,s){(n!=="number"||qe(t.ownerDocument)!==t)&&(s==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+s&&(t.defaultValue=""+s))}var en=Array.isArray;function At(t,n,s,u){if(t=t.options,n){n={};for(var h=0;h<s.length;h++)n["$"+s[h]]=!0;for(s=0;s<t.length;s++)h=n.hasOwnProperty("$"+t[s].value),t[s].selected!==h&&(t[s].selected=h),h&&u&&(t[s].defaultSelected=!0)}else{for(s=""+Ne(s),n=null,h=0;h<t.length;h++){if(t[h].value===s){t[h].selected=!0,u&&(t[h].defaultSelected=!0);return}n!==null||t[h].disabled||(n=t[h])}n!==null&&(n.selected=!0)}}function Xt(t,n){if(n.dangerouslySetInnerHTML!=null)throw Error(o(91));return J({},n,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function tn(t,n){var s=n.value;if(s==null){if(s=n.children,n=n.defaultValue,s!=null){if(n!=null)throw Error(o(92));if(en(s)){if(1<s.length)throw Error(o(93));s=s[0]}n=s}n==null&&(n=""),s=n}t._wrapperState={initialValue:Ne(s)}}function Xn(t,n){var s=Ne(n.value),u=Ne(n.defaultValue);s!=null&&(s=""+s,s!==t.value&&(t.value=s),n.defaultValue==null&&t.defaultValue!==s&&(t.defaultValue=s)),u!=null&&(t.defaultValue=""+u)}function un(t){var n=t.textContent;n===t._wrapperState.initialValue&&n!==""&&n!==null&&(t.value=n)}function Mt(t){switch(t){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 on(t,n){return t==null||t==="http://www.w3.org/1999/xhtml"?Mt(n):t==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var cn,xe=(function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,s,u,h){MSApp.execUnsafeLocalFunction(function(){return t(n,s,u,h)})}:t})(function(t,n){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=n;else{for(cn=cn||document.createElement("div"),cn.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=cn.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;n.firstChild;)t.appendChild(n.firstChild)}});function rt(t,n){if(n){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=n;return}}t.textContent=n}var ut={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},Ot=["Webkit","ms","Moz","O"];Object.keys(ut).forEach(function(t){Ot.forEach(function(n){n=n+t.charAt(0).toUpperCase()+t.substring(1),ut[n]=ut[t]})});function xt(t,n,s){return n==null||typeof n=="boolean"||n===""?"":s||typeof n!="number"||n===0||ut.hasOwnProperty(t)&&ut[t]?(""+n).trim():n+"px"}function nn(t,n){t=t.style;for(var s in n)if(n.hasOwnProperty(s)){var u=s.indexOf("--")===0,h=xt(s,n[s],u);s==="float"&&(s="cssFloat"),u?t.setProperty(s,h):t[s]=h}}var ht=J({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 Ue(t,n){if(n){if(ht[t]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(o(137,t));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(o(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(o(61))}if(n.style!=null&&typeof n.style!="object")throw Error(o(62))}}function sn(t,n){if(t.indexOf("-")===-1)return typeof n.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var An=null;function Vn(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ve=null,Un=null,En=null;function Cr(t){if(t=da(t)){if(typeof Ve!="function")throw Error(o(280));var n=t.stateNode;n&&(n=pl(n),Ve(t.stateNode,t.type,n))}}function ar(t){Un?En?En.push(t):En=[t]:Un=t}function Pr(){if(Un){var t=Un,n=En;if(En=Un=null,Cr(t),n)for(t=0;t<n.length;t++)Cr(n[t])}}function mr(t,n){return t(n)}function go(){}var On=!1;function Qn(t,n,s){if(On)return t(n,s);On=!0;try{return mr(t,n,s)}finally{On=!1,(Un!==null||En!==null)&&(go(),Pr())}}function Kn(t,n){var s=t.stateNode;if(s===null)return null;var u=pl(s);if(u===null)return null;s=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)||(t=t.type,u=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!u;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(o(231,n,typeof s));return s}var dn=!1;if(m)try{var vt={};Object.defineProperty(vt,"passive",{get:function(){dn=!0}}),window.addEventListener("test",vt,vt),window.removeEventListener("test",vt,vt)}catch{dn=!1}function Rt(t,n,s,u,h,v,C,V,X){var we=Array.prototype.slice.call(arguments,3);try{n.apply(s,we)}catch(Te){this.onError(Te)}}var et=!1,lr=null,_t=!1,gr=null,ws={onError:function(t){et=!0,lr=t}};function Cn(t,n,s,u,h,v,C,V,X){et=!1,lr=null,Rt.apply(ws,arguments)}function Pn(t,n,s,u,h,v,C,V,X){if(Cn.apply(this,arguments),et){if(et){var we=lr;et=!1,lr=null}else throw Error(o(198));_t||(_t=!0,gr=we)}}function an(t){var n=t,s=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(s=n.return),t=n.return;while(t)}return n.tag===3?s:null}function yr(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function Gr(t){if(an(t)!==t)throw Error(o(188))}function Ln(t){var n=t.alternate;if(!n){if(n=an(t),n===null)throw Error(o(188));return n!==t?null:t}for(var s=t,u=n;;){var h=s.return;if(h===null)break;var v=h.alternate;if(v===null){if(u=h.return,u!==null){s=u;continue}break}if(h.child===v.child){for(v=h.child;v;){if(v===s)return Gr(h),t;if(v===u)return Gr(h),n;v=v.sibling}throw Error(o(188))}if(s.return!==u.return)s=h,u=v;else{for(var C=!1,V=h.child;V;){if(V===s){C=!0,s=h,u=v;break}if(V===u){C=!0,u=h,s=v;break}V=V.sibling}if(!C){for(V=v.child;V;){if(V===s){C=!0,s=v,u=h;break}if(V===u){C=!0,u=v,s=h;break}V=V.sibling}if(!C)throw Error(o(189))}}if(s.alternate!==u)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?t:n}function Zr(t){return t=Ln(t),t!==null?zt(t):null}function zt(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var n=zt(t);if(n!==null)return n;t=t.sibling}return null}var yo=r.unstable_scheduleCallback,eo=r.unstable_cancelCallback,Ft=r.unstable_shouldYield,Jn=r.unstable_requestPaint,jt=r.unstable_now,xo=r.unstable_getCurrentPriorityLevel,xr=r.unstable_ImmediatePriority,to=r.unstable_UserBlockingPriority,vr=r.unstable_NormalPriority,ur=r.unstable_LowPriority,vo=r.unstable_IdlePriority,gn=null,yn=null;function yt(t){if(yn&&typeof yn.onCommitFiberRoot=="function")try{yn.onCommitFiberRoot(gn,t,void 0,(t.current.flags&128)===128)}catch{}}var wn=Math.clz32?Math.clz32:$r,qo=Math.log,no=Math.LN2;function $r(t){return t>>>=0,t===0?32:31-(qo(t)/no|0)|0}var Mr=64,Tr=4194304;function qn(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function St(t,n){var s=t.pendingLanes;if(s===0)return 0;var u=0,h=t.suspendedLanes,v=t.pingedLanes,C=s&268435455;if(C!==0){var V=C&~h;V!==0?u=qn(V):(v&=C,v!==0&&(u=qn(v)))}else C=s&~h,C!==0?u=qn(C):v!==0&&(u=qn(v));if(u===0)return 0;if(n!==0&&n!==u&&(n&h)===0&&(h=u&-u,v=n&-n,h>=v||h===16&&(v&4194240)!==0))return n;if((u&4)!==0&&(u|=s&16),n=t.entangledLanes,n!==0)for(t=t.entanglements,n&=u;0<n;)s=31-wn(n),h=1<<s,u|=t[s],n&=~h;return u}function wr(t,n){switch(t){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 Ir(t,n){for(var s=t.suspendedLanes,u=t.pingedLanes,h=t.expirationTimes,v=t.pendingLanes;0<v;){var C=31-wn(v),V=1<<C,X=h[C];X===-1?((V&s)===0||(V&u)!==0)&&(h[C]=wr(V,n)):X<=n&&(t.expiredLanes|=V),v&=~V}}function Gn(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function br(){var t=Mr;return Mr<<=1,(Mr&4194240)===0&&(Mr=64),t}function Ar(t){for(var n=[],s=0;31>s;s++)n.push(t);return n}function Zn(t,n,s){t.pendingLanes|=n,n!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,n=31-wn(n),t[n]=s}function wo(t,n){var s=t.pendingLanes&~n;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=n,t.mutableReadLanes&=n,t.entangledLanes&=n,n=t.entanglements;var u=t.eventTimes;for(t=t.expirationTimes;0<s;){var h=31-wn(s),v=1<<h;n[h]=0,u[h]=-1,t[h]=-1,s&=~v}}function Or(t,n){var s=t.entangledLanes|=n;for(t=t.entanglements;s;){var u=31-wn(s),h=1<<u;h&n|t[u]&n&&(t[u]|=n),s&=~h}}var Ct=0;function Xs(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var kt,bo,Wo,bs,O,ge=!1,ze=[],We=null,Pt=null,Bt=null,Nt=new Map,Dt=new Map,Lt=[],Rn="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 ko(t,n){switch(t){case"focusin":case"focusout":We=null;break;case"dragenter":case"dragleave":Pt=null;break;case"mouseover":case"mouseout":Bt=null;break;case"pointerover":case"pointerout":Nt.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Dt.delete(n.pointerId)}}function $n(t,n,s,u,h,v){return t===null||t.nativeEvent!==v?(t={blockedOn:n,domEventName:s,eventSystemFlags:u,nativeEvent:v,targetContainers:[h]},n!==null&&(n=da(n),n!==null&&bo(n)),t):(t.eventSystemFlags|=u,n=t.targetContainers,h!==null&&n.indexOf(h)===-1&&n.push(h),t)}function Qs(t,n,s,u,h){switch(n){case"focusin":return We=$n(We,t,n,s,u,h),!0;case"dragenter":return Pt=$n(Pt,t,n,s,u,h),!0;case"mouseover":return Bt=$n(Bt,t,n,s,u,h),!0;case"pointerover":var v=h.pointerId;return Nt.set(v,$n(Nt.get(v)||null,t,n,s,u,h)),!0;case"gotpointercapture":return v=h.pointerId,Dt.set(v,$n(Dt.get(v)||null,t,n,s,u,h)),!0}return!1}function bn(t){var n=Ps(t.target);if(n!==null){var s=an(n);if(s!==null){if(n=s.tag,n===13){if(n=yr(s),n!==null){t.blockedOn=n,O(t.priority,function(){Wo(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function ro(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var s=Yo(t.domEventName,t.eventSystemFlags,n[0],t.nativeEvent);if(s===null){s=t.nativeEvent;var u=new s.constructor(s.type,s);An=u,s.target.dispatchEvent(u),An=null}else return n=da(s),n!==null&&bo(n),t.blockedOn=s,!1;n.shift()}return!0}function Wi(t,n,s){ro(t)&&s.delete(n)}function Yi(){ge=!1,We!==null&&ro(We)&&(We=null),Pt!==null&&ro(Pt)&&(Pt=null),Bt!==null&&ro(Bt)&&(Bt=null),Nt.forEach(Wi),Dt.forEach(Wi)}function Lr(t,n){t.blockedOn===n&&(t.blockedOn=null,ge||(ge=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Yi)))}function So(t){function n(h){return Lr(h,t)}if(0<ze.length){Lr(ze[0],t);for(var s=1;s<ze.length;s++){var u=ze[s];u.blockedOn===t&&(u.blockedOn=null)}}for(We!==null&&Lr(We,t),Pt!==null&&Lr(Pt,t),Bt!==null&&Lr(Bt,t),Nt.forEach(n),Dt.forEach(n),s=0;s<Lt.length;s++)u=Lt[s],u.blockedOn===t&&(u.blockedOn=null);for(;0<Lt.length&&(s=Lt[0],s.blockedOn===null);)bn(s),s.blockedOn===null&&Lt.shift()}var No=$.ReactCurrentBatchConfig,Js=!0;function ks(t,n,s,u){var h=Ct,v=No.transition;No.transition=null;try{Ct=1,Xi(t,n,s,u)}finally{Ct=h,No.transition=v}}function Wu(t,n,s,u){var h=Ct,v=No.transition;No.transition=null;try{Ct=4,Xi(t,n,s,u)}finally{Ct=h,No.transition=v}}function Xi(t,n,s,u){if(Js){var h=Yo(t,n,s,u);if(h===null)Gu(t,n,u,_o,s),ko(t,u);else if(Qs(h,t,n,s,u))u.stopPropagation();else if(ko(t,u),n&4&&-1<Rn.indexOf(t)){for(;h!==null;){var v=da(h);if(v!==null&&kt(v),v=Yo(t,n,s,u),v===null&&Gu(t,n,u,_o,s),v===h)break;h=v}h!==null&&u.stopPropagation()}else Gu(t,n,u,null,s)}}var _o=null;function Yo(t,n,s,u){if(_o=null,t=Vn(u),t=Ps(t),t!==null)if(n=an(t),n===null)t=null;else if(s=n.tag,s===13){if(t=yr(n),t!==null)return t;t=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null);return _o=t,null}function Gs(t){switch(t){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(xo()){case xr:return 1;case to:return 4;case vr:case ur:return 16;case vo:return 536870912;default:return 16}default:return 16}}var oo=null,Qi=null,Zs=null;function ei(){if(Zs)return Zs;var t,n=Qi,s=n.length,u,h="value"in oo?oo.value:oo.textContent,v=h.length;for(t=0;t<s&&n[t]===h[t];t++);var C=s-t;for(u=1;u<=C&&n[s-u]===h[v-u];u++);return Zs=h.slice(t,1<u?1-u:void 0)}function Xo(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function Ss(){return!0}function Ns(){return!1}function kn(t){function n(s,u,h,v,C){this._reactName=s,this._targetInst=h,this.type=u,this.nativeEvent=v,this.target=C,this.currentTarget=null;for(var V in t)t.hasOwnProperty(V)&&(s=t[V],this[V]=s?s(v):v[V]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Ss:Ns,this.isPropagationStopped=Ns,this}return J(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Ss)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Ss)},persist:function(){},isPersistent:Ss}),n}var Rr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ti=kn(Rr),_s=J({},Rr,{view:0,detail:0}),Qo=kn(_s),jo,js,Eo,Jo=J({},_s,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ai,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Eo&&(Eo&&t.type==="mousemove"?(jo=t.screenX-Eo.screenX,js=t.screenY-Eo.screenY):js=jo=0,Eo=t),jo)},movementY:function(t){return"movementY"in t?t.movementY:js}}),ni=kn(Jo),Sn=J({},Jo,{dataTransfer:0}),Es=kn(Sn),Cs=J({},_s,{relatedTarget:0}),ri=kn(Cs),oi=J({},Rr,{animationName:0,elapsedTime:0,pseudoElement:0}),Za=kn(oi),el=J({},Rr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),si=kn(el),Ji=J({},Rr,{data:0}),so=kn(Ji),Gi={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Zi={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"},ii={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ea(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=ii[t])?!!n[t]:!1}function ai(){return ea}var Yu=J({},_s,{key:function(t){if(t.key){var n=Gi[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Xo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Zi[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ai,charCode:function(t){return t.type==="keypress"?Xo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Xo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),ta=kn(Yu),li=J({},Jo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tl=kn(li),na=J({},_s,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ai}),ra=kn(na),Xu=J({},Rr,{propertyName:0,elapsedTime:0,pseudoElement:0}),nl=kn(Xu),Qu=J({},Jo,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),rl=kn(Qu),ol=[9,13,27,32],oa=m&&"CompositionEvent"in window,Go=null;m&&"documentMode"in document&&(Go=document.documentMode);var sa=m&&"TextEvent"in window&&!Go,ia=m&&(!oa||Go&&8<Go&&11>=Go),aa=" ",sl=!1;function il(t,n){switch(t){case"keyup":return ol.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function al(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Dr=!1;function zr(t,n){switch(t){case"compositionend":return al(n);case"keypress":return n.which!==32?null:(sl=!0,aa);case"textInput":return t=n.data,t===aa&&sl?null:t;default:return null}}function Qt(t,n){if(Dr)return t==="compositionend"||!oa&&il(t,n)?(t=ei(),Zs=Qi=oo=null,Dr=!1,t):null;switch(t){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 ia&&n.locale!=="ko"?null:n.data;default:return null}}var ui={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 Co(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!ui[t.type]:n==="textarea"}function ll(t,n,s,u){ar(u),n=cl(n,"onChange"),0<n.length&&(s=new ti("onChange","change",null,s,u),t.push({event:s,listeners:n}))}var Po=null,Zo=null;function $o(t){kf(t,0)}function es(t){var n=pi(t);if(Fe(n))return t}function ts(t,n){if(t==="change")return n}var Fr=!1;if(m){var ci;if(m){var l="oninput"in document;if(!l){var f=document.createElement("div");f.setAttribute("oninput","return;"),l=typeof f.oninput=="function"}ci=l}else ci=!1;Fr=ci&&(!document.documentMode||9<document.documentMode)}function g(){Po&&(Po.detachEvent("onpropertychange",b),Zo=Po=null)}function b(t){if(t.propertyName==="value"&&es(Zo)){var n=[];ll(n,Zo,t,Vn(t)),Qn($o,n)}}function N(t,n,s){t==="focusin"?(g(),Po=n,Zo=s,Po.attachEvent("onpropertychange",b)):t==="focusout"&&g()}function E(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return es(Zo)}function I(t,n){if(t==="click")return es(n)}function z(t,n){if(t==="input"||t==="change")return es(n)}function ee(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var fe=typeof Object.is=="function"?Object.is:ee;function re(t,n){if(fe(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var s=Object.keys(t),u=Object.keys(n);if(s.length!==u.length)return!1;for(u=0;u<s.length;u++){var h=s[u];if(!y.call(n,h)||!fe(t[h],n[h]))return!1}return!0}function Z(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function te(t,n){var s=Z(t);t=0;for(var u;s;){if(s.nodeType===3){if(u=t+s.textContent.length,t<=n&&u>=n)return{node:s,offset:n-t};t=u}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Z(s)}}function de(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?de(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function le(){for(var t=window,n=qe();n instanceof t.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)t=n.contentWindow;else break;n=qe(t.document)}return n}function ae(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}function ce(t){var n=le(),s=t.focusedElem,u=t.selectionRange;if(n!==s&&s&&s.ownerDocument&&de(s.ownerDocument.documentElement,s)){if(u!==null&&ae(s)){if(n=u.start,t=u.end,t===void 0&&(t=n),"selectionStart"in s)s.selectionStart=n,s.selectionEnd=Math.min(t,s.value.length);else if(t=(n=s.ownerDocument||document)&&n.defaultView||window,t.getSelection){t=t.getSelection();var h=s.textContent.length,v=Math.min(u.start,h);u=u.end===void 0?v:Math.min(u.end,h),!t.extend&&v>u&&(h=u,u=v,v=h),h=te(s,v);var C=te(s,u);h&&C&&(t.rangeCount!==1||t.anchorNode!==h.node||t.anchorOffset!==h.offset||t.focusNode!==C.node||t.focusOffset!==C.offset)&&(n=n.createRange(),n.setStart(h.node,h.offset),t.removeAllRanges(),v>u?(t.addRange(n),t.extend(C.node,C.offset)):(n.setEnd(C.node,C.offset),t.addRange(n)))}}for(n=[],t=s;t=t.parentNode;)t.nodeType===1&&n.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<n.length;s++)t=n[s],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var ye=m&&"documentMode"in document&&11>=document.documentMode,pe=null,be=null,Ce=null,$e=!1;function Be(t,n,s){var u=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;$e||pe==null||pe!==qe(u)||(u=pe,"selectionStart"in u&&ae(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&&re(Ce,u)||(Ce=u,u=cl(be,"onSelect"),0<u.length&&(n=new ti("onSelect","select",null,n,s),t.push({event:n,listeners:u}),n.target=pe)))}function Ae(t,n){var s={};return s[t.toLowerCase()]=n.toLowerCase(),s["Webkit"+t]="webkit"+n,s["Moz"+t]="moz"+n,s}var Ke={animationend:Ae("Animation","AnimationEnd"),animationiteration:Ae("Animation","AnimationIteration"),animationstart:Ae("Animation","AnimationStart"),transitionend:Ae("Transition","TransitionEnd")},De={},Xe={};m&&(Xe=document.createElement("div").style,"AnimationEvent"in window||(delete Ke.animationend.animation,delete Ke.animationiteration.animation,delete Ke.animationstart.animation),"TransitionEvent"in window||delete Ke.transitionend.transition);function Pe(t){if(De[t])return De[t];if(!Ke[t])return t;var n=Ke[t],s;for(s in n)if(n.hasOwnProperty(s)&&s in Xe)return De[t]=n[s];return t}var at=Pe("animationend"),lt=Pe("animationiteration"),pt=Pe("animationstart"),wt=Pe("transitionend"),Dn=new Map,ft="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 Vt(t,n){Dn.set(t,n),c(n,[t])}for(var fn=0;fn<ft.length;fn++){var ns=ft[fn],Mn=ns.toLowerCase(),Mo=ns[0].toUpperCase()+ns.slice(1);Vt(Mn,"on"+Mo)}Vt(at,"onAnimationEnd"),Vt(lt,"onAnimationIteration"),Vt(pt,"onAnimationStart"),Vt("dblclick","onDoubleClick"),Vt("focusin","onFocus"),Vt("focusout","onBlur"),Vt(wt,"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 To="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(" "),Jg=new Set("cancel close invalid load scroll toggle".split(" ").concat(To));function bf(t,n,s){var u=t.type||"unknown-event";t.currentTarget=s,Pn(u,n,void 0,t),t.currentTarget=null}function kf(t,n){n=(n&4)!==0;for(var s=0;s<t.length;s++){var u=t[s],h=u.event;u=u.listeners;e:{var v=void 0;if(n)for(var C=u.length-1;0<=C;C--){var V=u[C],X=V.instance,we=V.currentTarget;if(V=V.listener,X!==v&&h.isPropagationStopped())break e;bf(h,V,we),v=X}else for(C=0;C<u.length;C++){if(V=u[C],X=V.instance,we=V.currentTarget,V=V.listener,X!==v&&h.isPropagationStopped())break e;bf(h,V,we),v=X}}}if(_t)throw t=gr,_t=!1,gr=null,t}function Ut(t,n){var s=n[oc];s===void 0&&(s=n[oc]=new Set);var u=t+"__bubble";s.has(u)||(Sf(n,t,2,!1),s.add(u))}function Ju(t,n,s){var u=0;n&&(u|=4),Sf(s,t,u,n)}var ul="_reactListening"+Math.random().toString(36).slice(2);function la(t){if(!t[ul]){t[ul]=!0,i.forEach(function(s){s!=="selectionchange"&&(Jg.has(s)||Ju(s,!1,t),Ju(s,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[ul]||(n[ul]=!0,Ju("selectionchange",!1,n))}}function Sf(t,n,s,u){switch(Gs(n)){case 1:var h=ks;break;case 4:h=Wu;break;default:h=Xi}s=h.bind(null,n,s,t),h=void 0,!dn||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(h=!0),u?h!==void 0?t.addEventListener(n,s,{capture:!0,passive:h}):t.addEventListener(n,s,!0):h!==void 0?t.addEventListener(n,s,{passive:h}):t.addEventListener(n,s,!1)}function Gu(t,n,s,u,h){var v=u;if((n&1)===0&&(n&2)===0&&u!==null)e:for(;;){if(u===null)return;var C=u.tag;if(C===3||C===4){var V=u.stateNode.containerInfo;if(V===h||V.nodeType===8&&V.parentNode===h)break;if(C===4)for(C=u.return;C!==null;){var X=C.tag;if((X===3||X===4)&&(X=C.stateNode.containerInfo,X===h||X.nodeType===8&&X.parentNode===h))return;C=C.return}for(;V!==null;){if(C=Ps(V),C===null)return;if(X=C.tag,X===5||X===6){u=v=C;continue e}V=V.parentNode}}u=u.return}Qn(function(){var we=v,Te=Vn(s),Oe=[];e:{var Me=Dn.get(t);if(Me!==void 0){var Ye=ti,Je=t;switch(t){case"keypress":if(Xo(s)===0)break e;case"keydown":case"keyup":Ye=ta;break;case"focusin":Je="focus",Ye=ri;break;case"focusout":Je="blur",Ye=ri;break;case"beforeblur":case"afterblur":Ye=ri;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ye=ni;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ye=Es;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ye=ra;break;case at:case lt:case pt:Ye=Za;break;case wt:Ye=nl;break;case"scroll":Ye=Qo;break;case"wheel":Ye=rl;break;case"copy":case"cut":case"paste":Ye=si;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ye=tl}var Ze=(n&4)!==0,ln=!Ze&&t==="scroll",he=Ze?Me!==null?Me+"Capture":null:Me;Ze=[];for(var oe=we,me;oe!==null;){me=oe;var He=me.stateNode;if(me.tag===5&&He!==null&&(me=He,he!==null&&(He=Kn(oe,he),He!=null&&Ze.push(ua(oe,He,me)))),ln)break;oe=oe.return}0<Ze.length&&(Me=new Ye(Me,Je,null,s,Te),Oe.push({event:Me,listeners:Ze}))}}if((n&7)===0){e:{if(Me=t==="mouseover"||t==="pointerover",Ye=t==="mouseout"||t==="pointerout",Me&&s!==An&&(Je=s.relatedTarget||s.fromElement)&&(Ps(Je)||Je[Io]))break e;if((Ye||Me)&&(Me=Te.window===Te?Te:(Me=Te.ownerDocument)?Me.defaultView||Me.parentWindow:window,Ye?(Je=s.relatedTarget||s.toElement,Ye=we,Je=Je?Ps(Je):null,Je!==null&&(ln=an(Je),Je!==ln||Je.tag!==5&&Je.tag!==6)&&(Je=null)):(Ye=null,Je=we),Ye!==Je)){if(Ze=ni,He="onMouseLeave",he="onMouseEnter",oe="mouse",(t==="pointerout"||t==="pointerover")&&(Ze=tl,He="onPointerLeave",he="onPointerEnter",oe="pointer"),ln=Ye==null?Me:pi(Ye),me=Je==null?Me:pi(Je),Me=new Ze(He,oe+"leave",Ye,s,Te),Me.target=ln,Me.relatedTarget=me,He=null,Ps(Te)===we&&(Ze=new Ze(he,oe+"enter",Je,s,Te),Ze.target=me,Ze.relatedTarget=ln,He=Ze),ln=He,Ye&&Je)t:{for(Ze=Ye,he=Je,oe=0,me=Ze;me;me=di(me))oe++;for(me=0,He=he;He;He=di(He))me++;for(;0<oe-me;)Ze=di(Ze),oe--;for(;0<me-oe;)he=di(he),me--;for(;oe--;){if(Ze===he||he!==null&&Ze===he.alternate)break t;Ze=di(Ze),he=di(he)}Ze=null}else Ze=null;Ye!==null&&Nf(Oe,Me,Ye,Ze,!1),Je!==null&&ln!==null&&Nf(Oe,ln,Je,Ze,!0)}}e:{if(Me=we?pi(we):window,Ye=Me.nodeName&&Me.nodeName.toLowerCase(),Ye==="select"||Ye==="input"&&Me.type==="file")var nt=ts;else if(Co(Me))if(Fr)nt=z;else{nt=E;var st=N}else(Ye=Me.nodeName)&&Ye.toLowerCase()==="input"&&(Me.type==="checkbox"||Me.type==="radio")&&(nt=I);if(nt&&(nt=nt(t,we))){ll(Oe,nt,s,Te);break e}st&&st(t,Me,we),t==="focusout"&&(st=Me._wrapperState)&&st.controlled&&Me.type==="number"&&Zt(Me,"number",Me.value)}switch(st=we?pi(we):window,t){case"focusin":(Co(st)||st.contentEditable==="true")&&(pe=st,be=we,Ce=null);break;case"focusout":Ce=be=pe=null;break;case"mousedown":$e=!0;break;case"contextmenu":case"mouseup":case"dragend":$e=!1,Be(Oe,s,Te);break;case"selectionchange":if(ye)break;case"keydown":case"keyup":Be(Oe,s,Te)}var it;if(oa)e:{switch(t){case"compositionstart":var ct="onCompositionStart";break e;case"compositionend":ct="onCompositionEnd";break e;case"compositionupdate":ct="onCompositionUpdate";break e}ct=void 0}else Dr?il(t,s)&&(ct="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(ct="onCompositionStart");ct&&(ia&&s.locale!=="ko"&&(Dr||ct!=="onCompositionStart"?ct==="onCompositionEnd"&&Dr&&(it=ei()):(oo=Te,Qi="value"in oo?oo.value:oo.textContent,Dr=!0)),st=cl(we,ct),0<st.length&&(ct=new so(ct,t,null,s,Te),Oe.push({event:ct,listeners:st}),it?ct.data=it:(it=al(s),it!==null&&(ct.data=it)))),(it=sa?zr(t,s):Qt(t,s))&&(we=cl(we,"onBeforeInput"),0<we.length&&(Te=new so("onBeforeInput","beforeinput",null,s,Te),Oe.push({event:Te,listeners:we}),Te.data=it))}kf(Oe,n)})}function ua(t,n,s){return{instance:t,listener:n,currentTarget:s}}function cl(t,n){for(var s=n+"Capture",u=[];t!==null;){var h=t,v=h.stateNode;h.tag===5&&v!==null&&(h=v,v=Kn(t,s),v!=null&&u.unshift(ua(t,v,h)),v=Kn(t,n),v!=null&&u.push(ua(t,v,h))),t=t.return}return u}function di(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Nf(t,n,s,u,h){for(var v=n._reactName,C=[];s!==null&&s!==u;){var V=s,X=V.alternate,we=V.stateNode;if(X!==null&&X===u)break;V.tag===5&&we!==null&&(V=we,h?(X=Kn(s,v),X!=null&&C.unshift(ua(s,X,V))):h||(X=Kn(s,v),X!=null&&C.push(ua(s,X,V)))),s=s.return}C.length!==0&&t.push({event:n,listeners:C})}var Gg=/\r\n?/g,Zg=/\u0000|\uFFFD/g;function _f(t){return(typeof t=="string"?t:""+t).replace(Gg,`
38
+ `).replace(Zg,"")}function dl(t,n,s){if(n=_f(n),_f(t)!==n&&s)throw Error(o(425))}function fl(){}var Zu=null,ec=null;function tc(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var nc=typeof setTimeout=="function"?setTimeout:void 0,ey=typeof clearTimeout=="function"?clearTimeout:void 0,jf=typeof Promise=="function"?Promise:void 0,ty=typeof queueMicrotask=="function"?queueMicrotask:typeof jf<"u"?function(t){return jf.resolve(null).then(t).catch(ny)}:nc;function ny(t){setTimeout(function(){throw t})}function rc(t,n){var s=n,u=0;do{var h=s.nextSibling;if(t.removeChild(s),h&&h.nodeType===8)if(s=h.data,s==="/$"){if(u===0){t.removeChild(h),So(n);return}u--}else s!=="$"&&s!=="$?"&&s!=="$!"||u++;s=h}while(s);So(n)}function rs(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return t}function Ef(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"){if(n===0)return t;n--}else s==="/$"&&n++}t=t.previousSibling}return null}var fi=Math.random().toString(36).slice(2),io="__reactFiber$"+fi,ca="__reactProps$"+fi,Io="__reactContainer$"+fi,oc="__reactEvents$"+fi,ry="__reactListeners$"+fi,oy="__reactHandles$"+fi;function Ps(t){var n=t[io];if(n)return n;for(var s=t.parentNode;s;){if(n=s[Io]||s[io]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(t=Ef(t);t!==null;){if(s=t[io])return s;t=Ef(t)}return n}t=s,s=t.parentNode}return null}function da(t){return t=t[io]||t[Io],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function pi(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(o(33))}function pl(t){return t[ca]||null}var sc=[],hi=-1;function os(t){return{current:t}}function Kt(t){0>hi||(t.current=sc[hi],sc[hi]=null,hi--)}function Ht(t,n){hi++,sc[hi]=t.current,t.current=n}var ss={},zn=os(ss),er=os(!1),$s=ss;function mi(t,n){var s=t.type.contextTypes;if(!s)return ss;var u=t.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===n)return u.__reactInternalMemoizedMaskedChildContext;var h={},v;for(v in s)h[v]=n[v];return u&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=n,t.__reactInternalMemoizedMaskedChildContext=h),h}function tr(t){return t=t.childContextTypes,t!=null}function hl(){Kt(er),Kt(zn)}function Cf(t,n,s){if(zn.current!==ss)throw Error(o(168));Ht(zn,n),Ht(er,s)}function Pf(t,n,s){var u=t.stateNode;if(n=n.childContextTypes,typeof u.getChildContext!="function")return s;u=u.getChildContext();for(var h in u)if(!(h in n))throw Error(o(108,Ee(t)||"Unknown",h));return J({},s,u)}function ml(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ss,$s=zn.current,Ht(zn,t),Ht(er,er.current),!0}function $f(t,n,s){var u=t.stateNode;if(!u)throw Error(o(169));s?(t=Pf(t,n,$s),u.__reactInternalMemoizedMergedChildContext=t,Kt(er),Kt(zn),Ht(zn,t)):Kt(er),Ht(er,s)}var Ao=null,gl=!1,ic=!1;function Mf(t){Ao===null?Ao=[t]:Ao.push(t)}function sy(t){gl=!0,Mf(t)}function is(){if(!ic&&Ao!==null){ic=!0;var t=0,n=Ct;try{var s=Ao;for(Ct=1;t<s.length;t++){var u=s[t];do u=u(!0);while(u!==null)}Ao=null,gl=!1}catch(h){throw Ao!==null&&(Ao=Ao.slice(t+1)),yo(xr,is),h}finally{Ct=n,ic=!1}}return null}var gi=[],yi=0,yl=null,xl=0,kr=[],Sr=0,Ms=null,Oo=1,Lo="";function Ts(t,n){gi[yi++]=xl,gi[yi++]=yl,yl=t,xl=n}function Tf(t,n,s){kr[Sr++]=Oo,kr[Sr++]=Lo,kr[Sr++]=Ms,Ms=t;var u=Oo;t=Lo;var h=32-wn(u)-1;u&=~(1<<h),s+=1;var v=32-wn(n)+h;if(30<v){var C=h-h%5;v=(u&(1<<C)-1).toString(32),u>>=C,h-=C,Oo=1<<32-wn(n)+h|s<<h|u,Lo=v+t}else Oo=1<<v|s<<h|u,Lo=t}function ac(t){t.return!==null&&(Ts(t,1),Tf(t,1,0))}function lc(t){for(;t===yl;)yl=gi[--yi],gi[yi]=null,xl=gi[--yi],gi[yi]=null;for(;t===Ms;)Ms=kr[--Sr],kr[Sr]=null,Lo=kr[--Sr],kr[Sr]=null,Oo=kr[--Sr],kr[Sr]=null}var cr=null,dr=null,Wt=!1,Br=null;function If(t,n){var s=Er(5,null,null,0);s.elementType="DELETED",s.stateNode=n,s.return=t,n=t.deletions,n===null?(t.deletions=[s],t.flags|=16):n.push(s)}function Af(t,n){switch(t.tag){case 5:var s=t.type;return n=n.nodeType!==1||s.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(t.stateNode=n,cr=t,dr=rs(n.firstChild),!0):!1;case 6:return n=t.pendingProps===""||n.nodeType!==3?null:n,n!==null?(t.stateNode=n,cr=t,dr=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(s=Ms!==null?{id:Oo,overflow:Lo}:null,t.memoizedState={dehydrated:n,treeContext:s,retryLane:1073741824},s=Er(18,null,null,0),s.stateNode=n,s.return=t,t.child=s,cr=t,dr=null,!0):!1;default:return!1}}function uc(t){return(t.mode&1)!==0&&(t.flags&128)===0}function cc(t){if(Wt){var n=dr;if(n){var s=n;if(!Af(t,n)){if(uc(t))throw Error(o(418));n=rs(s.nextSibling);var u=cr;n&&Af(t,n)?If(u,s):(t.flags=t.flags&-4097|2,Wt=!1,cr=t)}}else{if(uc(t))throw Error(o(418));t.flags=t.flags&-4097|2,Wt=!1,cr=t}}}function Of(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;cr=t}function vl(t){if(t!==cr)return!1;if(!Wt)return Of(t),Wt=!0,!1;var n;if((n=t.tag!==3)&&!(n=t.tag!==5)&&(n=t.type,n=n!=="head"&&n!=="body"&&!tc(t.type,t.memoizedProps)),n&&(n=dr)){if(uc(t))throw Lf(),Error(o(418));for(;n;)If(t,n),n=rs(n.nextSibling)}if(Of(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(317));e:{for(t=t.nextSibling,n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"){if(n===0){dr=rs(t.nextSibling);break e}n--}else s!=="$"&&s!=="$!"&&s!=="$?"||n++}t=t.nextSibling}dr=null}}else dr=cr?rs(t.stateNode.nextSibling):null;return!0}function Lf(){for(var t=dr;t;)t=rs(t.nextSibling)}function xi(){dr=cr=null,Wt=!1}function dc(t){Br===null?Br=[t]:Br.push(t)}var iy=$.ReactCurrentBatchConfig;function fa(t,n,s){if(t=s.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(s._owner){if(s=s._owner,s){if(s.tag!==1)throw Error(o(309));var u=s.stateNode}if(!u)throw Error(o(147,t));var h=u,v=""+t;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===v?n.ref:(n=function(C){var V=h.refs;C===null?delete V[v]:V[v]=C},n._stringRef=v,n)}if(typeof t!="string")throw Error(o(284));if(!s._owner)throw Error(o(290,t))}return t}function wl(t,n){throw t=Object.prototype.toString.call(n),Error(o(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t))}function Rf(t){var n=t._init;return n(t._payload)}function Df(t){function n(he,oe){if(t){var me=he.deletions;me===null?(he.deletions=[oe],he.flags|=16):me.push(oe)}}function s(he,oe){if(!t)return null;for(;oe!==null;)n(he,oe),oe=oe.sibling;return null}function u(he,oe){for(he=new Map;oe!==null;)oe.key!==null?he.set(oe.key,oe):he.set(oe.index,oe),oe=oe.sibling;return he}function h(he,oe){return he=hs(he,oe),he.index=0,he.sibling=null,he}function v(he,oe,me){return he.index=me,t?(me=he.alternate,me!==null?(me=me.index,me<oe?(he.flags|=2,oe):me):(he.flags|=2,oe)):(he.flags|=1048576,oe)}function C(he){return t&&he.alternate===null&&(he.flags|=2),he}function V(he,oe,me,He){return oe===null||oe.tag!==6?(oe=nd(me,he.mode,He),oe.return=he,oe):(oe=h(oe,me),oe.return=he,oe)}function X(he,oe,me,He){var nt=me.type;return nt===W?Te(he,oe,me.props.children,He,me.key):oe!==null&&(oe.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===G&&Rf(nt)===oe.type)?(He=h(oe,me.props),He.ref=fa(he,oe,me),He.return=he,He):(He=Ul(me.type,me.key,me.props,null,he.mode,He),He.ref=fa(he,oe,me),He.return=he,He)}function we(he,oe,me,He){return oe===null||oe.tag!==4||oe.stateNode.containerInfo!==me.containerInfo||oe.stateNode.implementation!==me.implementation?(oe=rd(me,he.mode,He),oe.return=he,oe):(oe=h(oe,me.children||[]),oe.return=he,oe)}function Te(he,oe,me,He,nt){return oe===null||oe.tag!==7?(oe=Fs(me,he.mode,He,nt),oe.return=he,oe):(oe=h(oe,me),oe.return=he,oe)}function Oe(he,oe,me){if(typeof oe=="string"&&oe!==""||typeof oe=="number")return oe=nd(""+oe,he.mode,me),oe.return=he,oe;if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case R:return me=Ul(oe.type,oe.key,oe.props,null,he.mode,me),me.ref=fa(he,null,oe),me.return=he,me;case F:return oe=rd(oe,he.mode,me),oe.return=he,oe;case G:var He=oe._init;return Oe(he,He(oe._payload),me)}if(en(oe)||q(oe))return oe=Fs(oe,he.mode,me,null),oe.return=he,oe;wl(he,oe)}return null}function Me(he,oe,me,He){var nt=oe!==null?oe.key:null;if(typeof me=="string"&&me!==""||typeof me=="number")return nt!==null?null:V(he,oe,""+me,He);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case R:return me.key===nt?X(he,oe,me,He):null;case F:return me.key===nt?we(he,oe,me,He):null;case G:return nt=me._init,Me(he,oe,nt(me._payload),He)}if(en(me)||q(me))return nt!==null?null:Te(he,oe,me,He,null);wl(he,me)}return null}function Ye(he,oe,me,He,nt){if(typeof He=="string"&&He!==""||typeof He=="number")return he=he.get(me)||null,V(oe,he,""+He,nt);if(typeof He=="object"&&He!==null){switch(He.$$typeof){case R:return he=he.get(He.key===null?me:He.key)||null,X(oe,he,He,nt);case F:return he=he.get(He.key===null?me:He.key)||null,we(oe,he,He,nt);case G:var st=He._init;return Ye(he,oe,me,st(He._payload),nt)}if(en(He)||q(He))return he=he.get(me)||null,Te(oe,he,He,nt,null);wl(oe,He)}return null}function Je(he,oe,me,He){for(var nt=null,st=null,it=oe,ct=oe=0,jn=null;it!==null&&ct<me.length;ct++){it.index>ct?(jn=it,it=null):jn=it.sibling;var Tt=Me(he,it,me[ct],He);if(Tt===null){it===null&&(it=jn);break}t&&it&&Tt.alternate===null&&n(he,it),oe=v(Tt,oe,ct),st===null?nt=Tt:st.sibling=Tt,st=Tt,it=jn}if(ct===me.length)return s(he,it),Wt&&Ts(he,ct),nt;if(it===null){for(;ct<me.length;ct++)it=Oe(he,me[ct],He),it!==null&&(oe=v(it,oe,ct),st===null?nt=it:st.sibling=it,st=it);return Wt&&Ts(he,ct),nt}for(it=u(he,it);ct<me.length;ct++)jn=Ye(it,he,ct,me[ct],He),jn!==null&&(t&&jn.alternate!==null&&it.delete(jn.key===null?ct:jn.key),oe=v(jn,oe,ct),st===null?nt=jn:st.sibling=jn,st=jn);return t&&it.forEach(function(ms){return n(he,ms)}),Wt&&Ts(he,ct),nt}function Ze(he,oe,me,He){var nt=q(me);if(typeof nt!="function")throw Error(o(150));if(me=nt.call(me),me==null)throw Error(o(151));for(var st=nt=null,it=oe,ct=oe=0,jn=null,Tt=me.next();it!==null&&!Tt.done;ct++,Tt=me.next()){it.index>ct?(jn=it,it=null):jn=it.sibling;var ms=Me(he,it,Tt.value,He);if(ms===null){it===null&&(it=jn);break}t&&it&&ms.alternate===null&&n(he,it),oe=v(ms,oe,ct),st===null?nt=ms:st.sibling=ms,st=ms,it=jn}if(Tt.done)return s(he,it),Wt&&Ts(he,ct),nt;if(it===null){for(;!Tt.done;ct++,Tt=me.next())Tt=Oe(he,Tt.value,He),Tt!==null&&(oe=v(Tt,oe,ct),st===null?nt=Tt:st.sibling=Tt,st=Tt);return Wt&&Ts(he,ct),nt}for(it=u(he,it);!Tt.done;ct++,Tt=me.next())Tt=Ye(it,he,ct,Tt.value,He),Tt!==null&&(t&&Tt.alternate!==null&&it.delete(Tt.key===null?ct:Tt.key),oe=v(Tt,oe,ct),st===null?nt=Tt:st.sibling=Tt,st=Tt);return t&&it.forEach(function(zy){return n(he,zy)}),Wt&&Ts(he,ct),nt}function ln(he,oe,me,He){if(typeof me=="object"&&me!==null&&me.type===W&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case R:e:{for(var nt=me.key,st=oe;st!==null;){if(st.key===nt){if(nt=me.type,nt===W){if(st.tag===7){s(he,st.sibling),oe=h(st,me.props.children),oe.return=he,he=oe;break e}}else if(st.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===G&&Rf(nt)===st.type){s(he,st.sibling),oe=h(st,me.props),oe.ref=fa(he,st,me),oe.return=he,he=oe;break e}s(he,st);break}else n(he,st);st=st.sibling}me.type===W?(oe=Fs(me.props.children,he.mode,He,me.key),oe.return=he,he=oe):(He=Ul(me.type,me.key,me.props,null,he.mode,He),He.ref=fa(he,oe,me),He.return=he,he=He)}return C(he);case F:e:{for(st=me.key;oe!==null;){if(oe.key===st)if(oe.tag===4&&oe.stateNode.containerInfo===me.containerInfo&&oe.stateNode.implementation===me.implementation){s(he,oe.sibling),oe=h(oe,me.children||[]),oe.return=he,he=oe;break e}else{s(he,oe);break}else n(he,oe);oe=oe.sibling}oe=rd(me,he.mode,He),oe.return=he,he=oe}return C(he);case G:return st=me._init,ln(he,oe,st(me._payload),He)}if(en(me))return Je(he,oe,me,He);if(q(me))return Ze(he,oe,me,He);wl(he,me)}return typeof me=="string"&&me!==""||typeof me=="number"?(me=""+me,oe!==null&&oe.tag===6?(s(he,oe.sibling),oe=h(oe,me),oe.return=he,he=oe):(s(he,oe),oe=nd(me,he.mode,He),oe.return=he,he=oe),C(he)):s(he,oe)}return ln}var vi=Df(!0),zf=Df(!1),bl=os(null),kl=null,wi=null,fc=null;function pc(){fc=wi=kl=null}function hc(t){var n=bl.current;Kt(bl),t._currentValue=n}function mc(t,n,s){for(;t!==null;){var u=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,u!==null&&(u.childLanes|=n)):u!==null&&(u.childLanes&n)!==n&&(u.childLanes|=n),t===s)break;t=t.return}}function bi(t,n){kl=t,fc=wi=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&n)!==0&&(nr=!0),t.firstContext=null)}function Nr(t){var n=t._currentValue;if(fc!==t)if(t={context:t,memoizedValue:n,next:null},wi===null){if(kl===null)throw Error(o(308));wi=t,kl.dependencies={lanes:0,firstContext:t}}else wi=wi.next=t;return n}var Is=null;function gc(t){Is===null?Is=[t]:Is.push(t)}function Ff(t,n,s,u){var h=n.interleaved;return h===null?(s.next=s,gc(n)):(s.next=h.next,h.next=s),n.interleaved=s,Ro(t,u)}function Ro(t,n){t.lanes|=n;var s=t.alternate;for(s!==null&&(s.lanes|=n),s=t,t=t.return;t!==null;)t.childLanes|=n,s=t.alternate,s!==null&&(s.childLanes|=n),s=t,t=t.return;return s.tag===3?s.stateNode:null}var as=!1;function yc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Bf(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Do(t,n){return{eventTime:t,lane:n,tag:0,payload:null,callback:null,next:null}}function ls(t,n,s){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,($t&2)!==0){var h=u.pending;return h===null?n.next=n:(n.next=h.next,h.next=n),u.pending=n,Ro(t,s)}return h=u.interleaved,h===null?(n.next=n,gc(u)):(n.next=h.next,h.next=n),u.interleaved=n,Ro(t,s)}function Sl(t,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194240)!==0)){var u=n.lanes;u&=t.pendingLanes,s|=u,n.lanes=s,Or(t,s)}}function Hf(t,n){var s=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,s===u)){var h=null,v=null;if(s=s.firstBaseUpdate,s!==null){do{var C={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};v===null?h=v=C:v=v.next=C,s=s.next}while(s!==null);v===null?h=v=n:v=v.next=n}else h=v=n;s={baseState:u.baseState,firstBaseUpdate:h,lastBaseUpdate:v,shared:u.shared,effects:u.effects},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=n:t.next=n,s.lastBaseUpdate=n}function Nl(t,n,s,u){var h=t.updateQueue;as=!1;var v=h.firstBaseUpdate,C=h.lastBaseUpdate,V=h.shared.pending;if(V!==null){h.shared.pending=null;var X=V,we=X.next;X.next=null,C===null?v=we:C.next=we,C=X;var Te=t.alternate;Te!==null&&(Te=Te.updateQueue,V=Te.lastBaseUpdate,V!==C&&(V===null?Te.firstBaseUpdate=we:V.next=we,Te.lastBaseUpdate=X))}if(v!==null){var Oe=h.baseState;C=0,Te=we=X=null,V=v;do{var Me=V.lane,Ye=V.eventTime;if((u&Me)===Me){Te!==null&&(Te=Te.next={eventTime:Ye,lane:0,tag:V.tag,payload:V.payload,callback:V.callback,next:null});e:{var Je=t,Ze=V;switch(Me=n,Ye=s,Ze.tag){case 1:if(Je=Ze.payload,typeof Je=="function"){Oe=Je.call(Ye,Oe,Me);break e}Oe=Je;break e;case 3:Je.flags=Je.flags&-65537|128;case 0:if(Je=Ze.payload,Me=typeof Je=="function"?Je.call(Ye,Oe,Me):Je,Me==null)break e;Oe=J({},Oe,Me);break e;case 2:as=!0}}V.callback!==null&&V.lane!==0&&(t.flags|=64,Me=h.effects,Me===null?h.effects=[V]:Me.push(V))}else Ye={eventTime:Ye,lane:Me,tag:V.tag,payload:V.payload,callback:V.callback,next:null},Te===null?(we=Te=Ye,X=Oe):Te=Te.next=Ye,C|=Me;if(V=V.next,V===null){if(V=h.shared.pending,V===null)break;Me=V,V=Me.next,Me.next=null,h.lastBaseUpdate=Me,h.shared.pending=null}}while(!0);if(Te===null&&(X=Oe),h.baseState=X,h.firstBaseUpdate=we,h.lastBaseUpdate=Te,n=h.shared.interleaved,n!==null){h=n;do C|=h.lane,h=h.next;while(h!==n)}else v===null&&(h.shared.lanes=0);Ls|=C,t.lanes=C,t.memoizedState=Oe}}function Vf(t,n,s){if(t=n.effects,n.effects=null,t!==null)for(n=0;n<t.length;n++){var u=t[n],h=u.callback;if(h!==null){if(u.callback=null,u=s,typeof h!="function")throw Error(o(191,h));h.call(u)}}}var pa={},ao=os(pa),ha=os(pa),ma=os(pa);function As(t){if(t===pa)throw Error(o(174));return t}function xc(t,n){switch(Ht(ma,n),Ht(ha,t),Ht(ao,pa),t=n.nodeType,t){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:on(null,"");break;default:t=t===8?n.parentNode:n,n=t.namespaceURI||null,t=t.tagName,n=on(n,t)}Kt(ao),Ht(ao,n)}function ki(){Kt(ao),Kt(ha),Kt(ma)}function Uf(t){As(ma.current);var n=As(ao.current),s=on(n,t.type);n!==s&&(Ht(ha,t),Ht(ao,s))}function vc(t){ha.current===t&&(Kt(ao),Kt(ha))}var Jt=os(0);function _l(t){for(var n=t;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||s.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===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var wc=[];function bc(){for(var t=0;t<wc.length;t++)wc[t]._workInProgressVersionPrimary=null;wc.length=0}var jl=$.ReactCurrentDispatcher,kc=$.ReactCurrentBatchConfig,Os=0,Gt=null,xn=null,Nn=null,El=!1,ga=!1,ya=0,ay=0;function Fn(){throw Error(o(321))}function Sc(t,n){if(n===null)return!1;for(var s=0;s<n.length&&s<t.length;s++)if(!fe(t[s],n[s]))return!1;return!0}function Nc(t,n,s,u,h,v){if(Os=v,Gt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,jl.current=t===null||t.memoizedState===null?dy:fy,t=s(u,h),ga){v=0;do{if(ga=!1,ya=0,25<=v)throw Error(o(301));v+=1,Nn=xn=null,n.updateQueue=null,jl.current=py,t=s(u,h)}while(ga)}if(jl.current=$l,n=xn!==null&&xn.next!==null,Os=0,Nn=xn=Gt=null,El=!1,n)throw Error(o(300));return t}function _c(){var t=ya!==0;return ya=0,t}function lo(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nn===null?Gt.memoizedState=Nn=t:Nn=Nn.next=t,Nn}function _r(){if(xn===null){var t=Gt.alternate;t=t!==null?t.memoizedState:null}else t=xn.next;var n=Nn===null?Gt.memoizedState:Nn.next;if(n!==null)Nn=n,xn=t;else{if(t===null)throw Error(o(310));xn=t,t={memoizedState:xn.memoizedState,baseState:xn.baseState,baseQueue:xn.baseQueue,queue:xn.queue,next:null},Nn===null?Gt.memoizedState=Nn=t:Nn=Nn.next=t}return Nn}function xa(t,n){return typeof n=="function"?n(t):n}function jc(t){var n=_r(),s=n.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=t;var u=xn,h=u.baseQueue,v=s.pending;if(v!==null){if(h!==null){var C=h.next;h.next=v.next,v.next=C}u.baseQueue=h=v,s.pending=null}if(h!==null){v=h.next,u=u.baseState;var V=C=null,X=null,we=v;do{var Te=we.lane;if((Os&Te)===Te)X!==null&&(X=X.next={lane:0,action:we.action,hasEagerState:we.hasEagerState,eagerState:we.eagerState,next:null}),u=we.hasEagerState?we.eagerState:t(u,we.action);else{var Oe={lane:Te,action:we.action,hasEagerState:we.hasEagerState,eagerState:we.eagerState,next:null};X===null?(V=X=Oe,C=u):X=X.next=Oe,Gt.lanes|=Te,Ls|=Te}we=we.next}while(we!==null&&we!==v);X===null?C=u:X.next=V,fe(u,n.memoizedState)||(nr=!0),n.memoizedState=u,n.baseState=C,n.baseQueue=X,s.lastRenderedState=u}if(t=s.interleaved,t!==null){h=t;do v=h.lane,Gt.lanes|=v,Ls|=v,h=h.next;while(h!==t)}else h===null&&(s.lanes=0);return[n.memoizedState,s.dispatch]}function Ec(t){var n=_r(),s=n.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=t;var u=s.dispatch,h=s.pending,v=n.memoizedState;if(h!==null){s.pending=null;var C=h=h.next;do v=t(v,C.action),C=C.next;while(C!==h);fe(v,n.memoizedState)||(nr=!0),n.memoizedState=v,n.baseQueue===null&&(n.baseState=v),s.lastRenderedState=v}return[v,u]}function Kf(){}function qf(t,n){var s=Gt,u=_r(),h=n(),v=!fe(u.memoizedState,h);if(v&&(u.memoizedState=h,nr=!0),u=u.queue,Cc(Xf.bind(null,s,u,t),[t]),u.getSnapshot!==n||v||Nn!==null&&Nn.memoizedState.tag&1){if(s.flags|=2048,va(9,Yf.bind(null,s,u,h,n),void 0,null),_n===null)throw Error(o(349));(Os&30)!==0||Wf(s,n,h)}return h}function Wf(t,n,s){t.flags|=16384,t={getSnapshot:n,value:s},n=Gt.updateQueue,n===null?(n={lastEffect:null,stores:null},Gt.updateQueue=n,n.stores=[t]):(s=n.stores,s===null?n.stores=[t]:s.push(t))}function Yf(t,n,s,u){n.value=s,n.getSnapshot=u,Qf(n)&&Jf(t)}function Xf(t,n,s){return s(function(){Qf(n)&&Jf(t)})}function Qf(t){var n=t.getSnapshot;t=t.value;try{var s=n();return!fe(t,s)}catch{return!0}}function Jf(t){var n=Ro(t,1);n!==null&&Kr(n,t,1,-1)}function Gf(t){var n=lo();return typeof t=="function"&&(t=t()),n.memoizedState=n.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:t},n.queue=t,t=t.dispatch=cy.bind(null,Gt,t),[n.memoizedState,t]}function va(t,n,s,u){return t={tag:t,create:n,destroy:s,deps:u,next:null},n=Gt.updateQueue,n===null?(n={lastEffect:null,stores:null},Gt.updateQueue=n,n.lastEffect=t.next=t):(s=n.lastEffect,s===null?n.lastEffect=t.next=t:(u=s.next,s.next=t,t.next=u,n.lastEffect=t)),t}function Zf(){return _r().memoizedState}function Cl(t,n,s,u){var h=lo();Gt.flags|=t,h.memoizedState=va(1|n,s,void 0,u===void 0?null:u)}function Pl(t,n,s,u){var h=_r();u=u===void 0?null:u;var v=void 0;if(xn!==null){var C=xn.memoizedState;if(v=C.destroy,u!==null&&Sc(u,C.deps)){h.memoizedState=va(n,s,v,u);return}}Gt.flags|=t,h.memoizedState=va(1|n,s,v,u)}function ep(t,n){return Cl(8390656,8,t,n)}function Cc(t,n){return Pl(2048,8,t,n)}function tp(t,n){return Pl(4,2,t,n)}function np(t,n){return Pl(4,4,t,n)}function rp(t,n){if(typeof n=="function")return t=t(),n(t),function(){n(null)};if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function op(t,n,s){return s=s!=null?s.concat([t]):null,Pl(4,4,rp.bind(null,n,t),s)}function Pc(){}function sp(t,n){var s=_r();n=n===void 0?null:n;var u=s.memoizedState;return u!==null&&n!==null&&Sc(n,u[1])?u[0]:(s.memoizedState=[t,n],t)}function ip(t,n){var s=_r();n=n===void 0?null:n;var u=s.memoizedState;return u!==null&&n!==null&&Sc(n,u[1])?u[0]:(t=t(),s.memoizedState=[t,n],t)}function ap(t,n,s){return(Os&21)===0?(t.baseState&&(t.baseState=!1,nr=!0),t.memoizedState=s):(fe(s,n)||(s=br(),Gt.lanes|=s,Ls|=s,t.baseState=!0),n)}function ly(t,n){var s=Ct;Ct=s!==0&&4>s?s:4,t(!0);var u=kc.transition;kc.transition={};try{t(!1),n()}finally{Ct=s,kc.transition=u}}function lp(){return _r().memoizedState}function uy(t,n,s){var u=fs(t);if(s={lane:u,action:s,hasEagerState:!1,eagerState:null,next:null},up(t))cp(n,s);else if(s=Ff(t,n,s,u),s!==null){var h=Yn();Kr(s,t,u,h),dp(s,n,u)}}function cy(t,n,s){var u=fs(t),h={lane:u,action:s,hasEagerState:!1,eagerState:null,next:null};if(up(t))cp(n,h);else{var v=t.alternate;if(t.lanes===0&&(v===null||v.lanes===0)&&(v=n.lastRenderedReducer,v!==null))try{var C=n.lastRenderedState,V=v(C,s);if(h.hasEagerState=!0,h.eagerState=V,fe(V,C)){var X=n.interleaved;X===null?(h.next=h,gc(n)):(h.next=X.next,X.next=h),n.interleaved=h;return}}catch{}finally{}s=Ff(t,n,h,u),s!==null&&(h=Yn(),Kr(s,t,u,h),dp(s,n,u))}}function up(t){var n=t.alternate;return t===Gt||n!==null&&n===Gt}function cp(t,n){ga=El=!0;var s=t.pending;s===null?n.next=n:(n.next=s.next,s.next=n),t.pending=n}function dp(t,n,s){if((s&4194240)!==0){var u=n.lanes;u&=t.pendingLanes,s|=u,n.lanes=s,Or(t,s)}}var $l={readContext:Nr,useCallback:Fn,useContext:Fn,useEffect:Fn,useImperativeHandle:Fn,useInsertionEffect:Fn,useLayoutEffect:Fn,useMemo:Fn,useReducer:Fn,useRef:Fn,useState:Fn,useDebugValue:Fn,useDeferredValue:Fn,useTransition:Fn,useMutableSource:Fn,useSyncExternalStore:Fn,useId:Fn,unstable_isNewReconciler:!1},dy={readContext:Nr,useCallback:function(t,n){return lo().memoizedState=[t,n===void 0?null:n],t},useContext:Nr,useEffect:ep,useImperativeHandle:function(t,n,s){return s=s!=null?s.concat([t]):null,Cl(4194308,4,rp.bind(null,n,t),s)},useLayoutEffect:function(t,n){return Cl(4194308,4,t,n)},useInsertionEffect:function(t,n){return Cl(4,2,t,n)},useMemo:function(t,n){var s=lo();return n=n===void 0?null:n,t=t(),s.memoizedState=[t,n],t},useReducer:function(t,n,s){var u=lo();return n=s!==void 0?s(n):n,u.memoizedState=u.baseState=n,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:n},u.queue=t,t=t.dispatch=uy.bind(null,Gt,t),[u.memoizedState,t]},useRef:function(t){var n=lo();return t={current:t},n.memoizedState=t},useState:Gf,useDebugValue:Pc,useDeferredValue:function(t){return lo().memoizedState=t},useTransition:function(){var t=Gf(!1),n=t[0];return t=ly.bind(null,t[1]),lo().memoizedState=t,[n,t]},useMutableSource:function(){},useSyncExternalStore:function(t,n,s){var u=Gt,h=lo();if(Wt){if(s===void 0)throw Error(o(407));s=s()}else{if(s=n(),_n===null)throw Error(o(349));(Os&30)!==0||Wf(u,n,s)}h.memoizedState=s;var v={value:s,getSnapshot:n};return h.queue=v,ep(Xf.bind(null,u,v,t),[t]),u.flags|=2048,va(9,Yf.bind(null,u,v,s,n),void 0,null),s},useId:function(){var t=lo(),n=_n.identifierPrefix;if(Wt){var s=Lo,u=Oo;s=(u&~(1<<32-wn(u)-1)).toString(32)+s,n=":"+n+"R"+s,s=ya++,0<s&&(n+="H"+s.toString(32)),n+=":"}else s=ay++,n=":"+n+"r"+s.toString(32)+":";return t.memoizedState=n},unstable_isNewReconciler:!1},fy={readContext:Nr,useCallback:sp,useContext:Nr,useEffect:Cc,useImperativeHandle:op,useInsertionEffect:tp,useLayoutEffect:np,useMemo:ip,useReducer:jc,useRef:Zf,useState:function(){return jc(xa)},useDebugValue:Pc,useDeferredValue:function(t){var n=_r();return ap(n,xn.memoizedState,t)},useTransition:function(){var t=jc(xa)[0],n=_r().memoizedState;return[t,n]},useMutableSource:Kf,useSyncExternalStore:qf,useId:lp,unstable_isNewReconciler:!1},py={readContext:Nr,useCallback:sp,useContext:Nr,useEffect:Cc,useImperativeHandle:op,useInsertionEffect:tp,useLayoutEffect:np,useMemo:ip,useReducer:Ec,useRef:Zf,useState:function(){return Ec(xa)},useDebugValue:Pc,useDeferredValue:function(t){var n=_r();return xn===null?n.memoizedState=t:ap(n,xn.memoizedState,t)},useTransition:function(){var t=Ec(xa)[0],n=_r().memoizedState;return[t,n]},useMutableSource:Kf,useSyncExternalStore:qf,useId:lp,unstable_isNewReconciler:!1};function Hr(t,n){if(t&&t.defaultProps){n=J({},n),t=t.defaultProps;for(var s in t)n[s]===void 0&&(n[s]=t[s]);return n}return n}function $c(t,n,s,u){n=t.memoizedState,s=s(u,n),s=s==null?n:J({},n,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var Ml={isMounted:function(t){return(t=t._reactInternals)?an(t)===t:!1},enqueueSetState:function(t,n,s){t=t._reactInternals;var u=Yn(),h=fs(t),v=Do(u,h);v.payload=n,s!=null&&(v.callback=s),n=ls(t,v,h),n!==null&&(Kr(n,t,h,u),Sl(n,t,h))},enqueueReplaceState:function(t,n,s){t=t._reactInternals;var u=Yn(),h=fs(t),v=Do(u,h);v.tag=1,v.payload=n,s!=null&&(v.callback=s),n=ls(t,v,h),n!==null&&(Kr(n,t,h,u),Sl(n,t,h))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var s=Yn(),u=fs(t),h=Do(s,u);h.tag=2,n!=null&&(h.callback=n),n=ls(t,h,u),n!==null&&(Kr(n,t,u,s),Sl(n,t,u))}};function fp(t,n,s,u,h,v,C){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(u,v,C):n.prototype&&n.prototype.isPureReactComponent?!re(s,u)||!re(h,v):!0}function pp(t,n,s){var u=!1,h=ss,v=n.contextType;return typeof v=="object"&&v!==null?v=Nr(v):(h=tr(n)?$s:zn.current,u=n.contextTypes,v=(u=u!=null)?mi(t,h):ss),n=new n(s,v),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=Ml,t.stateNode=n,n._reactInternals=t,u&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=h,t.__reactInternalMemoizedMaskedChildContext=v),n}function hp(t,n,s,u){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,u),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,u),n.state!==t&&Ml.enqueueReplaceState(n,n.state,null)}function Mc(t,n,s,u){var h=t.stateNode;h.props=s,h.state=t.memoizedState,h.refs={},yc(t);var v=n.contextType;typeof v=="object"&&v!==null?h.context=Nr(v):(v=tr(n)?$s:zn.current,h.context=mi(t,v)),h.state=t.memoizedState,v=n.getDerivedStateFromProps,typeof v=="function"&&($c(t,n,v,s),h.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(n=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),n!==h.state&&Ml.enqueueReplaceState(h,h.state,null),Nl(t,s,h,u),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308)}function Si(t,n){try{var s="",u=n;do s+=Le(u),u=u.return;while(u);var h=s}catch(v){h=`
39
+ Error generating stack: `+v.message+`
40
+ `+v.stack}return{value:t,source:n,stack:h,digest:null}}function Tc(t,n,s){return{value:t,source:null,stack:s??null,digest:n??null}}function Ic(t,n){try{console.error(n.value)}catch(s){setTimeout(function(){throw s})}}var hy=typeof WeakMap=="function"?WeakMap:Map;function mp(t,n,s){s=Do(-1,s),s.tag=3,s.payload={element:null};var u=n.value;return s.callback=function(){Dl||(Dl=!0,Yc=u),Ic(t,n)},s}function gp(t,n,s){s=Do(-1,s),s.tag=3;var u=t.type.getDerivedStateFromError;if(typeof u=="function"){var h=n.value;s.payload=function(){return u(h)},s.callback=function(){Ic(t,n)}}var v=t.stateNode;return v!==null&&typeof v.componentDidCatch=="function"&&(s.callback=function(){Ic(t,n),typeof u!="function"&&(cs===null?cs=new Set([this]):cs.add(this));var C=n.stack;this.componentDidCatch(n.value,{componentStack:C!==null?C:""})}),s}function yp(t,n,s){var u=t.pingCache;if(u===null){u=t.pingCache=new hy;var h=new Set;u.set(n,h)}else h=u.get(n),h===void 0&&(h=new Set,u.set(n,h));h.has(s)||(h.add(s),t=Cy.bind(null,t,n,s),n.then(t,t))}function xp(t){do{var n;if((n=t.tag===13)&&(n=t.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return t;t=t.return}while(t!==null);return null}function vp(t,n,s,u,h){return(t.mode&1)===0?(t===n?t.flags|=65536:(t.flags|=128,s.flags|=131072,s.flags&=-52805,s.tag===1&&(s.alternate===null?s.tag=17:(n=Do(-1,1),n.tag=2,ls(s,n,1))),s.lanes|=1),t):(t.flags|=65536,t.lanes=h,t)}var my=$.ReactCurrentOwner,nr=!1;function Wn(t,n,s,u){n.child=t===null?zf(n,null,s,u):vi(n,t.child,s,u)}function wp(t,n,s,u,h){s=s.render;var v=n.ref;return bi(n,h),u=Nc(t,n,s,u,v,h),s=_c(),t!==null&&!nr?(n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~h,zo(t,n,h)):(Wt&&s&&ac(n),n.flags|=1,Wn(t,n,u,h),n.child)}function bp(t,n,s,u,h){if(t===null){var v=s.type;return typeof v=="function"&&!td(v)&&v.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(n.tag=15,n.type=v,kp(t,n,v,u,h)):(t=Ul(s.type,null,u,n,n.mode,h),t.ref=n.ref,t.return=n,n.child=t)}if(v=t.child,(t.lanes&h)===0){var C=v.memoizedProps;if(s=s.compare,s=s!==null?s:re,s(C,u)&&t.ref===n.ref)return zo(t,n,h)}return n.flags|=1,t=hs(v,u),t.ref=n.ref,t.return=n,n.child=t}function kp(t,n,s,u,h){if(t!==null){var v=t.memoizedProps;if(re(v,u)&&t.ref===n.ref)if(nr=!1,n.pendingProps=u=v,(t.lanes&h)!==0)(t.flags&131072)!==0&&(nr=!0);else return n.lanes=t.lanes,zo(t,n,h)}return Ac(t,n,s,u,h)}function Sp(t,n,s){var u=n.pendingProps,h=u.children,v=t!==null?t.memoizedState:null;if(u.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ht(_i,fr),fr|=s;else{if((s&1073741824)===0)return t=v!==null?v.baseLanes|s:s,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:t,cachePool:null,transitions:null},n.updateQueue=null,Ht(_i,fr),fr|=t,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},u=v!==null?v.baseLanes:s,Ht(_i,fr),fr|=u}else v!==null?(u=v.baseLanes|s,n.memoizedState=null):u=s,Ht(_i,fr),fr|=u;return Wn(t,n,h,s),n.child}function Np(t,n){var s=n.ref;(t===null&&s!==null||t!==null&&t.ref!==s)&&(n.flags|=512,n.flags|=2097152)}function Ac(t,n,s,u,h){var v=tr(s)?$s:zn.current;return v=mi(n,v),bi(n,h),s=Nc(t,n,s,u,v,h),u=_c(),t!==null&&!nr?(n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~h,zo(t,n,h)):(Wt&&u&&ac(n),n.flags|=1,Wn(t,n,s,h),n.child)}function _p(t,n,s,u,h){if(tr(s)){var v=!0;ml(n)}else v=!1;if(bi(n,h),n.stateNode===null)Il(t,n),pp(n,s,u),Mc(n,s,u,h),u=!0;else if(t===null){var C=n.stateNode,V=n.memoizedProps;C.props=V;var X=C.context,we=s.contextType;typeof we=="object"&&we!==null?we=Nr(we):(we=tr(s)?$s:zn.current,we=mi(n,we));var Te=s.getDerivedStateFromProps,Oe=typeof Te=="function"||typeof C.getSnapshotBeforeUpdate=="function";Oe||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(V!==u||X!==we)&&hp(n,C,u,we),as=!1;var Me=n.memoizedState;C.state=Me,Nl(n,u,C,h),X=n.memoizedState,V!==u||Me!==X||er.current||as?(typeof Te=="function"&&($c(n,s,Te,u),X=n.memoizedState),(V=as||fp(n,s,V,u,Me,X,we))?(Oe||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(n.flags|=4194308)):(typeof C.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=u,n.memoizedState=X),C.props=u,C.state=X,C.context=we,u=V):(typeof C.componentDidMount=="function"&&(n.flags|=4194308),u=!1)}else{C=n.stateNode,Bf(t,n),V=n.memoizedProps,we=n.type===n.elementType?V:Hr(n.type,V),C.props=we,Oe=n.pendingProps,Me=C.context,X=s.contextType,typeof X=="object"&&X!==null?X=Nr(X):(X=tr(s)?$s:zn.current,X=mi(n,X));var Ye=s.getDerivedStateFromProps;(Te=typeof Ye=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(V!==Oe||Me!==X)&&hp(n,C,u,X),as=!1,Me=n.memoizedState,C.state=Me,Nl(n,u,C,h);var Je=n.memoizedState;V!==Oe||Me!==Je||er.current||as?(typeof Ye=="function"&&($c(n,s,Ye,u),Je=n.memoizedState),(we=as||fp(n,s,we,u,Me,Je,X)||!1)?(Te||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(u,Je,X),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(u,Je,X)),typeof C.componentDidUpdate=="function"&&(n.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof C.componentDidUpdate!="function"||V===t.memoizedProps&&Me===t.memoizedState||(n.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||V===t.memoizedProps&&Me===t.memoizedState||(n.flags|=1024),n.memoizedProps=u,n.memoizedState=Je),C.props=u,C.state=Je,C.context=X,u=we):(typeof C.componentDidUpdate!="function"||V===t.memoizedProps&&Me===t.memoizedState||(n.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||V===t.memoizedProps&&Me===t.memoizedState||(n.flags|=1024),u=!1)}return Oc(t,n,s,u,v,h)}function Oc(t,n,s,u,h,v){Np(t,n);var C=(n.flags&128)!==0;if(!u&&!C)return h&&$f(n,s,!1),zo(t,n,v);u=n.stateNode,my.current=n;var V=C&&typeof s.getDerivedStateFromError!="function"?null:u.render();return n.flags|=1,t!==null&&C?(n.child=vi(n,t.child,null,v),n.child=vi(n,null,V,v)):Wn(t,n,V,v),n.memoizedState=u.state,h&&$f(n,s,!0),n.child}function jp(t){var n=t.stateNode;n.pendingContext?Cf(t,n.pendingContext,n.pendingContext!==n.context):n.context&&Cf(t,n.context,!1),xc(t,n.containerInfo)}function Ep(t,n,s,u,h){return xi(),dc(h),n.flags|=256,Wn(t,n,s,u),n.child}var Lc={dehydrated:null,treeContext:null,retryLane:0};function Rc(t){return{baseLanes:t,cachePool:null,transitions:null}}function Cp(t,n,s){var u=n.pendingProps,h=Jt.current,v=!1,C=(n.flags&128)!==0,V;if((V=C)||(V=t!==null&&t.memoizedState===null?!1:(h&2)!==0),V?(v=!0,n.flags&=-129):(t===null||t.memoizedState!==null)&&(h|=1),Ht(Jt,h&1),t===null)return cc(n),t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?((n.mode&1)===0?n.lanes=1:t.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(C=u.children,t=u.fallback,v?(u=n.mode,v=n.child,C={mode:"hidden",children:C},(u&1)===0&&v!==null?(v.childLanes=0,v.pendingProps=C):v=Kl(C,u,0,null),t=Fs(t,u,s,null),v.return=n,t.return=n,v.sibling=t,n.child=v,n.child.memoizedState=Rc(s),n.memoizedState=Lc,t):Dc(n,C));if(h=t.memoizedState,h!==null&&(V=h.dehydrated,V!==null))return gy(t,n,C,u,V,h,s);if(v){v=u.fallback,C=n.mode,h=t.child,V=h.sibling;var X={mode:"hidden",children:u.children};return(C&1)===0&&n.child!==h?(u=n.child,u.childLanes=0,u.pendingProps=X,n.deletions=null):(u=hs(h,X),u.subtreeFlags=h.subtreeFlags&14680064),V!==null?v=hs(V,v):(v=Fs(v,C,s,null),v.flags|=2),v.return=n,u.return=n,u.sibling=v,n.child=u,u=v,v=n.child,C=t.child.memoizedState,C=C===null?Rc(s):{baseLanes:C.baseLanes|s,cachePool:null,transitions:C.transitions},v.memoizedState=C,v.childLanes=t.childLanes&~s,n.memoizedState=Lc,u}return v=t.child,t=v.sibling,u=hs(v,{mode:"visible",children:u.children}),(n.mode&1)===0&&(u.lanes=s),u.return=n,u.sibling=null,t!==null&&(s=n.deletions,s===null?(n.deletions=[t],n.flags|=16):s.push(t)),n.child=u,n.memoizedState=null,u}function Dc(t,n){return n=Kl({mode:"visible",children:n},t.mode,0,null),n.return=t,t.child=n}function Tl(t,n,s,u){return u!==null&&dc(u),vi(n,t.child,null,s),t=Dc(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function gy(t,n,s,u,h,v,C){if(s)return n.flags&256?(n.flags&=-257,u=Tc(Error(o(422))),Tl(t,n,C,u)):n.memoizedState!==null?(n.child=t.child,n.flags|=128,null):(v=u.fallback,h=n.mode,u=Kl({mode:"visible",children:u.children},h,0,null),v=Fs(v,h,C,null),v.flags|=2,u.return=n,v.return=n,u.sibling=v,n.child=u,(n.mode&1)!==0&&vi(n,t.child,null,C),n.child.memoizedState=Rc(C),n.memoizedState=Lc,v);if((n.mode&1)===0)return Tl(t,n,C,null);if(h.data==="$!"){if(u=h.nextSibling&&h.nextSibling.dataset,u)var V=u.dgst;return u=V,v=Error(o(419)),u=Tc(v,u,void 0),Tl(t,n,C,u)}if(V=(C&t.childLanes)!==0,nr||V){if(u=_n,u!==null){switch(C&-C){case 4:h=2;break;case 16:h=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:h=32;break;case 536870912:h=268435456;break;default:h=0}h=(h&(u.suspendedLanes|C))!==0?0:h,h!==0&&h!==v.retryLane&&(v.retryLane=h,Ro(t,h),Kr(u,t,h,-1))}return ed(),u=Tc(Error(o(421))),Tl(t,n,C,u)}return h.data==="$?"?(n.flags|=128,n.child=t.child,n=Py.bind(null,t),h._reactRetry=n,null):(t=v.treeContext,dr=rs(h.nextSibling),cr=n,Wt=!0,Br=null,t!==null&&(kr[Sr++]=Oo,kr[Sr++]=Lo,kr[Sr++]=Ms,Oo=t.id,Lo=t.overflow,Ms=n),n=Dc(n,u.children),n.flags|=4096,n)}function Pp(t,n,s){t.lanes|=n;var u=t.alternate;u!==null&&(u.lanes|=n),mc(t.return,n,s)}function zc(t,n,s,u,h){var v=t.memoizedState;v===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:u,tail:s,tailMode:h}:(v.isBackwards=n,v.rendering=null,v.renderingStartTime=0,v.last=u,v.tail=s,v.tailMode=h)}function $p(t,n,s){var u=n.pendingProps,h=u.revealOrder,v=u.tail;if(Wn(t,n,u.children,s),u=Jt.current,(u&2)!==0)u=u&1|2,n.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Pp(t,s,n);else if(t.tag===19)Pp(t,s,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}u&=1}if(Ht(Jt,u),(n.mode&1)===0)n.memoizedState=null;else switch(h){case"forwards":for(s=n.child,h=null;s!==null;)t=s.alternate,t!==null&&_l(t)===null&&(h=s),s=s.sibling;s=h,s===null?(h=n.child,n.child=null):(h=s.sibling,s.sibling=null),zc(n,!1,h,s,v);break;case"backwards":for(s=null,h=n.child,n.child=null;h!==null;){if(t=h.alternate,t!==null&&_l(t)===null){n.child=h;break}t=h.sibling,h.sibling=s,s=h,h=t}zc(n,!0,s,null,v);break;case"together":zc(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function Il(t,n){(n.mode&1)===0&&t!==null&&(t.alternate=null,n.alternate=null,n.flags|=2)}function zo(t,n,s){if(t!==null&&(n.dependencies=t.dependencies),Ls|=n.lanes,(s&n.childLanes)===0)return null;if(t!==null&&n.child!==t.child)throw Error(o(153));if(n.child!==null){for(t=n.child,s=hs(t,t.pendingProps),n.child=s,s.return=n;t.sibling!==null;)t=t.sibling,s=s.sibling=hs(t,t.pendingProps),s.return=n;s.sibling=null}return n.child}function yy(t,n,s){switch(n.tag){case 3:jp(n),xi();break;case 5:Uf(n);break;case 1:tr(n.type)&&ml(n);break;case 4:xc(n,n.stateNode.containerInfo);break;case 10:var u=n.type._context,h=n.memoizedProps.value;Ht(bl,u._currentValue),u._currentValue=h;break;case 13:if(u=n.memoizedState,u!==null)return u.dehydrated!==null?(Ht(Jt,Jt.current&1),n.flags|=128,null):(s&n.child.childLanes)!==0?Cp(t,n,s):(Ht(Jt,Jt.current&1),t=zo(t,n,s),t!==null?t.sibling:null);Ht(Jt,Jt.current&1);break;case 19:if(u=(s&n.childLanes)!==0,(t.flags&128)!==0){if(u)return $p(t,n,s);n.flags|=128}if(h=n.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),Ht(Jt,Jt.current),u)break;return null;case 22:case 23:return n.lanes=0,Sp(t,n,s)}return zo(t,n,s)}var Mp,Fc,Tp,Ip;Mp=function(t,n){for(var s=n.child;s!==null;){if(s.tag===5||s.tag===6)t.appendChild(s.stateNode);else if(s.tag!==4&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return;s=s.return}s.sibling.return=s.return,s=s.sibling}},Fc=function(){},Tp=function(t,n,s,u){var h=t.memoizedProps;if(h!==u){t=n.stateNode,As(ao.current);var v=null;switch(s){case"input":h=mt(t,h),u=mt(t,u),v=[];break;case"select":h=J({},h,{value:void 0}),u=J({},u,{value:void 0}),v=[];break;case"textarea":h=Xt(t,h),u=Xt(t,u),v=[];break;default:typeof h.onClick!="function"&&typeof u.onClick=="function"&&(t.onclick=fl)}Ue(s,u);var C;s=null;for(we in h)if(!u.hasOwnProperty(we)&&h.hasOwnProperty(we)&&h[we]!=null)if(we==="style"){var V=h[we];for(C in V)V.hasOwnProperty(C)&&(s||(s={}),s[C]="")}else we!=="dangerouslySetInnerHTML"&&we!=="children"&&we!=="suppressContentEditableWarning"&&we!=="suppressHydrationWarning"&&we!=="autoFocus"&&(a.hasOwnProperty(we)?v||(v=[]):(v=v||[]).push(we,null));for(we in u){var X=u[we];if(V=h!=null?h[we]:void 0,u.hasOwnProperty(we)&&X!==V&&(X!=null||V!=null))if(we==="style")if(V){for(C in V)!V.hasOwnProperty(C)||X&&X.hasOwnProperty(C)||(s||(s={}),s[C]="");for(C in X)X.hasOwnProperty(C)&&V[C]!==X[C]&&(s||(s={}),s[C]=X[C])}else s||(v||(v=[]),v.push(we,s)),s=X;else we==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,V=V?V.__html:void 0,X!=null&&V!==X&&(v=v||[]).push(we,X)):we==="children"?typeof X!="string"&&typeof X!="number"||(v=v||[]).push(we,""+X):we!=="suppressContentEditableWarning"&&we!=="suppressHydrationWarning"&&(a.hasOwnProperty(we)?(X!=null&&we==="onScroll"&&Ut("scroll",t),v||V===X||(v=[])):(v=v||[]).push(we,X))}s&&(v=v||[]).push("style",s);var we=v;(n.updateQueue=we)&&(n.flags|=4)}},Ip=function(t,n,s,u){s!==u&&(n.flags|=4)};function wa(t,n){if(!Wt)switch(t.tailMode){case"hidden":n=t.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:u.sibling=null}}function Bn(t){var n=t.alternate!==null&&t.alternate.child===t.child,s=0,u=0;if(n)for(var h=t.child;h!==null;)s|=h.lanes|h.childLanes,u|=h.subtreeFlags&14680064,u|=h.flags&14680064,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)s|=h.lanes|h.childLanes,u|=h.subtreeFlags,u|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=u,t.childLanes=s,n}function xy(t,n,s){var u=n.pendingProps;switch(lc(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bn(n),null;case 1:return tr(n.type)&&hl(),Bn(n),null;case 3:return u=n.stateNode,ki(),Kt(er),Kt(zn),bc(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(t===null||t.child===null)&&(vl(n)?n.flags|=4:t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Br!==null&&(Jc(Br),Br=null))),Fc(t,n),Bn(n),null;case 5:vc(n);var h=As(ma.current);if(s=n.type,t!==null&&n.stateNode!=null)Tp(t,n,s,u,h),t.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!u){if(n.stateNode===null)throw Error(o(166));return Bn(n),null}if(t=As(ao.current),vl(n)){u=n.stateNode,s=n.type;var v=n.memoizedProps;switch(u[io]=n,u[ca]=v,t=(n.mode&1)!==0,s){case"dialog":Ut("cancel",u),Ut("close",u);break;case"iframe":case"object":case"embed":Ut("load",u);break;case"video":case"audio":for(h=0;h<To.length;h++)Ut(To[h],u);break;case"source":Ut("error",u);break;case"img":case"image":case"link":Ut("error",u),Ut("load",u);break;case"details":Ut("toggle",u);break;case"input":dt(u,v),Ut("invalid",u);break;case"select":u._wrapperState={wasMultiple:!!v.multiple},Ut("invalid",u);break;case"textarea":tn(u,v),Ut("invalid",u)}Ue(s,v),h=null;for(var C in v)if(v.hasOwnProperty(C)){var V=v[C];C==="children"?typeof V=="string"?u.textContent!==V&&(v.suppressHydrationWarning!==!0&&dl(u.textContent,V,t),h=["children",V]):typeof V=="number"&&u.textContent!==""+V&&(v.suppressHydrationWarning!==!0&&dl(u.textContent,V,t),h=["children",""+V]):a.hasOwnProperty(C)&&V!=null&&C==="onScroll"&&Ut("scroll",u)}switch(s){case"input":tt(u),mn(u,v,!0);break;case"textarea":tt(u),un(u);break;case"select":case"option":break;default:typeof v.onClick=="function"&&(u.onclick=fl)}u=h,n.updateQueue=u,u!==null&&(n.flags|=4)}else{C=h.nodeType===9?h:h.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=Mt(s)),t==="http://www.w3.org/1999/xhtml"?s==="script"?(t=C.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof u.is=="string"?t=C.createElement(s,{is:u.is}):(t=C.createElement(s),s==="select"&&(C=t,u.multiple?C.multiple=!0:u.size&&(C.size=u.size))):t=C.createElementNS(t,s),t[io]=n,t[ca]=u,Mp(t,n,!1,!1),n.stateNode=t;e:{switch(C=sn(s,u),s){case"dialog":Ut("cancel",t),Ut("close",t),h=u;break;case"iframe":case"object":case"embed":Ut("load",t),h=u;break;case"video":case"audio":for(h=0;h<To.length;h++)Ut(To[h],t);h=u;break;case"source":Ut("error",t),h=u;break;case"img":case"image":case"link":Ut("error",t),Ut("load",t),h=u;break;case"details":Ut("toggle",t),h=u;break;case"input":dt(t,u),h=mt(t,u),Ut("invalid",t);break;case"option":h=u;break;case"select":t._wrapperState={wasMultiple:!!u.multiple},h=J({},u,{value:void 0}),Ut("invalid",t);break;case"textarea":tn(t,u),h=Xt(t,u),Ut("invalid",t);break;default:h=u}Ue(s,h),V=h;for(v in V)if(V.hasOwnProperty(v)){var X=V[v];v==="style"?nn(t,X):v==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,X!=null&&xe(t,X)):v==="children"?typeof X=="string"?(s!=="textarea"||X!=="")&&rt(t,X):typeof X=="number"&&rt(t,""+X):v!=="suppressContentEditableWarning"&&v!=="suppressHydrationWarning"&&v!=="autoFocus"&&(a.hasOwnProperty(v)?X!=null&&v==="onScroll"&&Ut("scroll",t):X!=null&&P(t,v,X,C))}switch(s){case"input":tt(t),mn(t,u,!1);break;case"textarea":tt(t),un(t);break;case"option":u.value!=null&&t.setAttribute("value",""+Ne(u.value));break;case"select":t.multiple=!!u.multiple,v=u.value,v!=null?At(t,!!u.multiple,v,!1):u.defaultValue!=null&&At(t,!!u.multiple,u.defaultValue,!0);break;default:typeof h.onClick=="function"&&(t.onclick=fl)}switch(s){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 Bn(n),null;case 6:if(t&&n.stateNode!=null)Ip(t,n,t.memoizedProps,u);else{if(typeof u!="string"&&n.stateNode===null)throw Error(o(166));if(s=As(ma.current),As(ao.current),vl(n)){if(u=n.stateNode,s=n.memoizedProps,u[io]=n,(v=u.nodeValue!==s)&&(t=cr,t!==null))switch(t.tag){case 3:dl(u.nodeValue,s,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&dl(u.nodeValue,s,(t.mode&1)!==0)}v&&(n.flags|=4)}else u=(s.nodeType===9?s:s.ownerDocument).createTextNode(u),u[io]=n,n.stateNode=u}return Bn(n),null;case 13:if(Kt(Jt),u=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Wt&&dr!==null&&(n.mode&1)!==0&&(n.flags&128)===0)Lf(),xi(),n.flags|=98560,v=!1;else if(v=vl(n),u!==null&&u.dehydrated!==null){if(t===null){if(!v)throw Error(o(318));if(v=n.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(o(317));v[io]=n}else xi(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Bn(n),v=!1}else Br!==null&&(Jc(Br),Br=null),v=!0;if(!v)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=s,n):(u=u!==null,u!==(t!==null&&t.memoizedState!==null)&&u&&(n.child.flags|=8192,(n.mode&1)!==0&&(t===null||(Jt.current&1)!==0?vn===0&&(vn=3):ed())),n.updateQueue!==null&&(n.flags|=4),Bn(n),null);case 4:return ki(),Fc(t,n),t===null&&la(n.stateNode.containerInfo),Bn(n),null;case 10:return hc(n.type._context),Bn(n),null;case 17:return tr(n.type)&&hl(),Bn(n),null;case 19:if(Kt(Jt),v=n.memoizedState,v===null)return Bn(n),null;if(u=(n.flags&128)!==0,C=v.rendering,C===null)if(u)wa(v,!1);else{if(vn!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(C=_l(t),C!==null){for(n.flags|=128,wa(v,!1),u=C.updateQueue,u!==null&&(n.updateQueue=u,n.flags|=4),n.subtreeFlags=0,u=s,s=n.child;s!==null;)v=s,t=u,v.flags&=14680066,C=v.alternate,C===null?(v.childLanes=0,v.lanes=t,v.child=null,v.subtreeFlags=0,v.memoizedProps=null,v.memoizedState=null,v.updateQueue=null,v.dependencies=null,v.stateNode=null):(v.childLanes=C.childLanes,v.lanes=C.lanes,v.child=C.child,v.subtreeFlags=0,v.deletions=null,v.memoizedProps=C.memoizedProps,v.memoizedState=C.memoizedState,v.updateQueue=C.updateQueue,v.type=C.type,t=C.dependencies,v.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),s=s.sibling;return Ht(Jt,Jt.current&1|2),n.child}t=t.sibling}v.tail!==null&&jt()>ji&&(n.flags|=128,u=!0,wa(v,!1),n.lanes=4194304)}else{if(!u)if(t=_l(C),t!==null){if(n.flags|=128,u=!0,s=t.updateQueue,s!==null&&(n.updateQueue=s,n.flags|=4),wa(v,!0),v.tail===null&&v.tailMode==="hidden"&&!C.alternate&&!Wt)return Bn(n),null}else 2*jt()-v.renderingStartTime>ji&&s!==1073741824&&(n.flags|=128,u=!0,wa(v,!1),n.lanes=4194304);v.isBackwards?(C.sibling=n.child,n.child=C):(s=v.last,s!==null?s.sibling=C:n.child=C,v.last=C)}return v.tail!==null?(n=v.tail,v.rendering=n,v.tail=n.sibling,v.renderingStartTime=jt(),n.sibling=null,s=Jt.current,Ht(Jt,u?s&1|2:s&1),n):(Bn(n),null);case 22:case 23:return Zc(),u=n.memoizedState!==null,t!==null&&t.memoizedState!==null!==u&&(n.flags|=8192),u&&(n.mode&1)!==0?(fr&1073741824)!==0&&(Bn(n),n.subtreeFlags&6&&(n.flags|=8192)):Bn(n),null;case 24:return null;case 25:return null}throw Error(o(156,n.tag))}function vy(t,n){switch(lc(n),n.tag){case 1:return tr(n.type)&&hl(),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return ki(),Kt(er),Kt(zn),bc(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 5:return vc(n),null;case 13:if(Kt(Jt),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(o(340));xi()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return Kt(Jt),null;case 4:return ki(),null;case 10:return hc(n.type._context),null;case 22:case 23:return Zc(),null;case 24:return null;default:return null}}var Al=!1,Hn=!1,wy=typeof WeakSet=="function"?WeakSet:Set,Qe=null;function Ni(t,n){var s=t.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(u){rn(t,n,u)}else s.current=null}function Bc(t,n,s){try{s()}catch(u){rn(t,n,u)}}var Ap=!1;function by(t,n){if(Zu=Js,t=le(),ae(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var u=s.getSelection&&s.getSelection();if(u&&u.rangeCount!==0){s=u.anchorNode;var h=u.anchorOffset,v=u.focusNode;u=u.focusOffset;try{s.nodeType,v.nodeType}catch{s=null;break e}var C=0,V=-1,X=-1,we=0,Te=0,Oe=t,Me=null;t:for(;;){for(var Ye;Oe!==s||h!==0&&Oe.nodeType!==3||(V=C+h),Oe!==v||u!==0&&Oe.nodeType!==3||(X=C+u),Oe.nodeType===3&&(C+=Oe.nodeValue.length),(Ye=Oe.firstChild)!==null;)Me=Oe,Oe=Ye;for(;;){if(Oe===t)break t;if(Me===s&&++we===h&&(V=C),Me===v&&++Te===u&&(X=C),(Ye=Oe.nextSibling)!==null)break;Oe=Me,Me=Oe.parentNode}Oe=Ye}s=V===-1||X===-1?null:{start:V,end:X}}else s=null}s=s||{start:0,end:0}}else s=null;for(ec={focusedElem:t,selectionRange:s},Js=!1,Qe=n;Qe!==null;)if(n=Qe,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Qe=t;else for(;Qe!==null;){n=Qe;try{var Je=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(Je!==null){var Ze=Je.memoizedProps,ln=Je.memoizedState,he=n.stateNode,oe=he.getSnapshotBeforeUpdate(n.elementType===n.type?Ze:Hr(n.type,Ze),ln);he.__reactInternalSnapshotBeforeUpdate=oe}break;case 3:var me=n.stateNode.containerInfo;me.nodeType===1?me.textContent="":me.nodeType===9&&me.documentElement&&me.removeChild(me.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(He){rn(n,n.return,He)}if(t=n.sibling,t!==null){t.return=n.return,Qe=t;break}Qe=n.return}return Je=Ap,Ap=!1,Je}function ba(t,n,s){var u=n.updateQueue;if(u=u!==null?u.lastEffect:null,u!==null){var h=u=u.next;do{if((h.tag&t)===t){var v=h.destroy;h.destroy=void 0,v!==void 0&&Bc(n,s,v)}h=h.next}while(h!==u)}}function Ol(t,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&t)===t){var u=s.create;s.destroy=u()}s=s.next}while(s!==n)}}function Hc(t){var n=t.ref;if(n!==null){var s=t.stateNode;switch(t.tag){case 5:t=s;break;default:t=s}typeof n=="function"?n(t):n.current=t}}function Op(t){var n=t.alternate;n!==null&&(t.alternate=null,Op(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&(delete n[io],delete n[ca],delete n[oc],delete n[ry],delete n[oy])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Lp(t){return t.tag===5||t.tag===3||t.tag===4}function Rp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Lp(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Vc(t,n,s){var u=t.tag;if(u===5||u===6)t=t.stateNode,n?s.nodeType===8?s.parentNode.insertBefore(t,n):s.insertBefore(t,n):(s.nodeType===8?(n=s.parentNode,n.insertBefore(t,s)):(n=s,n.appendChild(t)),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=fl));else if(u!==4&&(t=t.child,t!==null))for(Vc(t,n,s),t=t.sibling;t!==null;)Vc(t,n,s),t=t.sibling}function Uc(t,n,s){var u=t.tag;if(u===5||u===6)t=t.stateNode,n?s.insertBefore(t,n):s.appendChild(t);else if(u!==4&&(t=t.child,t!==null))for(Uc(t,n,s),t=t.sibling;t!==null;)Uc(t,n,s),t=t.sibling}var Tn=null,Vr=!1;function us(t,n,s){for(s=s.child;s!==null;)Dp(t,n,s),s=s.sibling}function Dp(t,n,s){if(yn&&typeof yn.onCommitFiberUnmount=="function")try{yn.onCommitFiberUnmount(gn,s)}catch{}switch(s.tag){case 5:Hn||Ni(s,n);case 6:var u=Tn,h=Vr;Tn=null,us(t,n,s),Tn=u,Vr=h,Tn!==null&&(Vr?(t=Tn,s=s.stateNode,t.nodeType===8?t.parentNode.removeChild(s):t.removeChild(s)):Tn.removeChild(s.stateNode));break;case 18:Tn!==null&&(Vr?(t=Tn,s=s.stateNode,t.nodeType===8?rc(t.parentNode,s):t.nodeType===1&&rc(t,s),So(t)):rc(Tn,s.stateNode));break;case 4:u=Tn,h=Vr,Tn=s.stateNode.containerInfo,Vr=!0,us(t,n,s),Tn=u,Vr=h;break;case 0:case 11:case 14:case 15:if(!Hn&&(u=s.updateQueue,u!==null&&(u=u.lastEffect,u!==null))){h=u=u.next;do{var v=h,C=v.destroy;v=v.tag,C!==void 0&&((v&2)!==0||(v&4)!==0)&&Bc(s,n,C),h=h.next}while(h!==u)}us(t,n,s);break;case 1:if(!Hn&&(Ni(s,n),u=s.stateNode,typeof u.componentWillUnmount=="function"))try{u.props=s.memoizedProps,u.state=s.memoizedState,u.componentWillUnmount()}catch(V){rn(s,n,V)}us(t,n,s);break;case 21:us(t,n,s);break;case 22:s.mode&1?(Hn=(u=Hn)||s.memoizedState!==null,us(t,n,s),Hn=u):us(t,n,s);break;default:us(t,n,s)}}function zp(t){var n=t.updateQueue;if(n!==null){t.updateQueue=null;var s=t.stateNode;s===null&&(s=t.stateNode=new wy),n.forEach(function(u){var h=$y.bind(null,t,u);s.has(u)||(s.add(u),u.then(h,h))})}}function Ur(t,n){var s=n.deletions;if(s!==null)for(var u=0;u<s.length;u++){var h=s[u];try{var v=t,C=n,V=C;e:for(;V!==null;){switch(V.tag){case 5:Tn=V.stateNode,Vr=!1;break e;case 3:Tn=V.stateNode.containerInfo,Vr=!0;break e;case 4:Tn=V.stateNode.containerInfo,Vr=!0;break e}V=V.return}if(Tn===null)throw Error(o(160));Dp(v,C,h),Tn=null,Vr=!1;var X=h.alternate;X!==null&&(X.return=null),h.return=null}catch(we){rn(h,n,we)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)Fp(n,t),n=n.sibling}function Fp(t,n){var s=t.alternate,u=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Ur(n,t),uo(t),u&4){try{ba(3,t,t.return),Ol(3,t)}catch(Ze){rn(t,t.return,Ze)}try{ba(5,t,t.return)}catch(Ze){rn(t,t.return,Ze)}}break;case 1:Ur(n,t),uo(t),u&512&&s!==null&&Ni(s,s.return);break;case 5:if(Ur(n,t),uo(t),u&512&&s!==null&&Ni(s,s.return),t.flags&32){var h=t.stateNode;try{rt(h,"")}catch(Ze){rn(t,t.return,Ze)}}if(u&4&&(h=t.stateNode,h!=null)){var v=t.memoizedProps,C=s!==null?s.memoizedProps:v,V=t.type,X=t.updateQueue;if(t.updateQueue=null,X!==null)try{V==="input"&&v.type==="radio"&&v.name!=null&&gt(h,v),sn(V,C);var we=sn(V,v);for(C=0;C<X.length;C+=2){var Te=X[C],Oe=X[C+1];Te==="style"?nn(h,Oe):Te==="dangerouslySetInnerHTML"?xe(h,Oe):Te==="children"?rt(h,Oe):P(h,Te,Oe,we)}switch(V){case"input":It(h,v);break;case"textarea":Xn(h,v);break;case"select":var Me=h._wrapperState.wasMultiple;h._wrapperState.wasMultiple=!!v.multiple;var Ye=v.value;Ye!=null?At(h,!!v.multiple,Ye,!1):Me!==!!v.multiple&&(v.defaultValue!=null?At(h,!!v.multiple,v.defaultValue,!0):At(h,!!v.multiple,v.multiple?[]:"",!1))}h[ca]=v}catch(Ze){rn(t,t.return,Ze)}}break;case 6:if(Ur(n,t),uo(t),u&4){if(t.stateNode===null)throw Error(o(162));h=t.stateNode,v=t.memoizedProps;try{h.nodeValue=v}catch(Ze){rn(t,t.return,Ze)}}break;case 3:if(Ur(n,t),uo(t),u&4&&s!==null&&s.memoizedState.isDehydrated)try{So(n.containerInfo)}catch(Ze){rn(t,t.return,Ze)}break;case 4:Ur(n,t),uo(t);break;case 13:Ur(n,t),uo(t),h=t.child,h.flags&8192&&(v=h.memoizedState!==null,h.stateNode.isHidden=v,!v||h.alternate!==null&&h.alternate.memoizedState!==null||(Wc=jt())),u&4&&zp(t);break;case 22:if(Te=s!==null&&s.memoizedState!==null,t.mode&1?(Hn=(we=Hn)||Te,Ur(n,t),Hn=we):Ur(n,t),uo(t),u&8192){if(we=t.memoizedState!==null,(t.stateNode.isHidden=we)&&!Te&&(t.mode&1)!==0)for(Qe=t,Te=t.child;Te!==null;){for(Oe=Qe=Te;Qe!==null;){switch(Me=Qe,Ye=Me.child,Me.tag){case 0:case 11:case 14:case 15:ba(4,Me,Me.return);break;case 1:Ni(Me,Me.return);var Je=Me.stateNode;if(typeof Je.componentWillUnmount=="function"){u=Me,s=Me.return;try{n=u,Je.props=n.memoizedProps,Je.state=n.memoizedState,Je.componentWillUnmount()}catch(Ze){rn(u,s,Ze)}}break;case 5:Ni(Me,Me.return);break;case 22:if(Me.memoizedState!==null){Vp(Oe);continue}}Ye!==null?(Ye.return=Me,Qe=Ye):Vp(Oe)}Te=Te.sibling}e:for(Te=null,Oe=t;;){if(Oe.tag===5){if(Te===null){Te=Oe;try{h=Oe.stateNode,we?(v=h.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none"):(V=Oe.stateNode,X=Oe.memoizedProps.style,C=X!=null&&X.hasOwnProperty("display")?X.display:null,V.style.display=xt("display",C))}catch(Ze){rn(t,t.return,Ze)}}}else if(Oe.tag===6){if(Te===null)try{Oe.stateNode.nodeValue=we?"":Oe.memoizedProps}catch(Ze){rn(t,t.return,Ze)}}else if((Oe.tag!==22&&Oe.tag!==23||Oe.memoizedState===null||Oe===t)&&Oe.child!==null){Oe.child.return=Oe,Oe=Oe.child;continue}if(Oe===t)break e;for(;Oe.sibling===null;){if(Oe.return===null||Oe.return===t)break e;Te===Oe&&(Te=null),Oe=Oe.return}Te===Oe&&(Te=null),Oe.sibling.return=Oe.return,Oe=Oe.sibling}}break;case 19:Ur(n,t),uo(t),u&4&&zp(t);break;case 21:break;default:Ur(n,t),uo(t)}}function uo(t){var n=t.flags;if(n&2){try{e:{for(var s=t.return;s!==null;){if(Lp(s)){var u=s;break e}s=s.return}throw Error(o(160))}switch(u.tag){case 5:var h=u.stateNode;u.flags&32&&(rt(h,""),u.flags&=-33);var v=Rp(t);Uc(t,v,h);break;case 3:case 4:var C=u.stateNode.containerInfo,V=Rp(t);Vc(t,V,C);break;default:throw Error(o(161))}}catch(X){rn(t,t.return,X)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function ky(t,n,s){Qe=t,Bp(t)}function Bp(t,n,s){for(var u=(t.mode&1)!==0;Qe!==null;){var h=Qe,v=h.child;if(h.tag===22&&u){var C=h.memoizedState!==null||Al;if(!C){var V=h.alternate,X=V!==null&&V.memoizedState!==null||Hn;V=Al;var we=Hn;if(Al=C,(Hn=X)&&!we)for(Qe=h;Qe!==null;)C=Qe,X=C.child,C.tag===22&&C.memoizedState!==null?Up(h):X!==null?(X.return=C,Qe=X):Up(h);for(;v!==null;)Qe=v,Bp(v),v=v.sibling;Qe=h,Al=V,Hn=we}Hp(t)}else(h.subtreeFlags&8772)!==0&&v!==null?(v.return=h,Qe=v):Hp(t)}}function Hp(t){for(;Qe!==null;){var n=Qe;if((n.flags&8772)!==0){var s=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:Hn||Ol(5,n);break;case 1:var u=n.stateNode;if(n.flags&4&&!Hn)if(s===null)u.componentDidMount();else{var h=n.elementType===n.type?s.memoizedProps:Hr(n.type,s.memoizedProps);u.componentDidUpdate(h,s.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}var v=n.updateQueue;v!==null&&Vf(n,v,u);break;case 3:var C=n.updateQueue;if(C!==null){if(s=null,n.child!==null)switch(n.child.tag){case 5:s=n.child.stateNode;break;case 1:s=n.child.stateNode}Vf(n,C,s)}break;case 5:var V=n.stateNode;if(s===null&&n.flags&4){s=V;var X=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":X.autoFocus&&s.focus();break;case"img":X.src&&(s.src=X.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var we=n.alternate;if(we!==null){var Te=we.memoizedState;if(Te!==null){var Oe=Te.dehydrated;Oe!==null&&So(Oe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}Hn||n.flags&512&&Hc(n)}catch(Me){rn(n,n.return,Me)}}if(n===t){Qe=null;break}if(s=n.sibling,s!==null){s.return=n.return,Qe=s;break}Qe=n.return}}function Vp(t){for(;Qe!==null;){var n=Qe;if(n===t){Qe=null;break}var s=n.sibling;if(s!==null){s.return=n.return,Qe=s;break}Qe=n.return}}function Up(t){for(;Qe!==null;){var n=Qe;try{switch(n.tag){case 0:case 11:case 15:var s=n.return;try{Ol(4,n)}catch(X){rn(n,s,X)}break;case 1:var u=n.stateNode;if(typeof u.componentDidMount=="function"){var h=n.return;try{u.componentDidMount()}catch(X){rn(n,h,X)}}var v=n.return;try{Hc(n)}catch(X){rn(n,v,X)}break;case 5:var C=n.return;try{Hc(n)}catch(X){rn(n,C,X)}}}catch(X){rn(n,n.return,X)}if(n===t){Qe=null;break}var V=n.sibling;if(V!==null){V.return=n.return,Qe=V;break}Qe=n.return}}var Sy=Math.ceil,Ll=$.ReactCurrentDispatcher,Kc=$.ReactCurrentOwner,jr=$.ReactCurrentBatchConfig,$t=0,_n=null,pn=null,In=0,fr=0,_i=os(0),vn=0,ka=null,Ls=0,Rl=0,qc=0,Sa=null,rr=null,Wc=0,ji=1/0,Fo=null,Dl=!1,Yc=null,cs=null,zl=!1,ds=null,Fl=0,Na=0,Xc=null,Bl=-1,Hl=0;function Yn(){return($t&6)!==0?jt():Bl!==-1?Bl:Bl=jt()}function fs(t){return(t.mode&1)===0?1:($t&2)!==0&&In!==0?In&-In:iy.transition!==null?(Hl===0&&(Hl=br()),Hl):(t=Ct,t!==0||(t=window.event,t=t===void 0?16:Gs(t.type)),t)}function Kr(t,n,s,u){if(50<Na)throw Na=0,Xc=null,Error(o(185));Zn(t,s,u),(($t&2)===0||t!==_n)&&(t===_n&&(($t&2)===0&&(Rl|=s),vn===4&&ps(t,In)),or(t,u),s===1&&$t===0&&(n.mode&1)===0&&(ji=jt()+500,gl&&is()))}function or(t,n){var s=t.callbackNode;Ir(t,n);var u=St(t,t===_n?In:0);if(u===0)s!==null&&eo(s),t.callbackNode=null,t.callbackPriority=0;else if(n=u&-u,t.callbackPriority!==n){if(s!=null&&eo(s),n===1)t.tag===0?sy(qp.bind(null,t)):Mf(qp.bind(null,t)),ty(function(){($t&6)===0&&is()}),s=null;else{switch(Xs(u)){case 1:s=xr;break;case 4:s=to;break;case 16:s=vr;break;case 536870912:s=vo;break;default:s=vr}s=eh(s,Kp.bind(null,t))}t.callbackPriority=n,t.callbackNode=s}}function Kp(t,n){if(Bl=-1,Hl=0,($t&6)!==0)throw Error(o(327));var s=t.callbackNode;if(Ei()&&t.callbackNode!==s)return null;var u=St(t,t===_n?In:0);if(u===0)return null;if((u&30)!==0||(u&t.expiredLanes)!==0||n)n=Vl(t,u);else{n=u;var h=$t;$t|=2;var v=Yp();(_n!==t||In!==n)&&(Fo=null,ji=jt()+500,Ds(t,n));do try{jy();break}catch(V){Wp(t,V)}while(!0);pc(),Ll.current=v,$t=h,pn!==null?n=0:(_n=null,In=0,n=vn)}if(n!==0){if(n===2&&(h=Gn(t),h!==0&&(u=h,n=Qc(t,h))),n===1)throw s=ka,Ds(t,0),ps(t,u),or(t,jt()),s;if(n===6)ps(t,u);else{if(h=t.current.alternate,(u&30)===0&&!Ny(h)&&(n=Vl(t,u),n===2&&(v=Gn(t),v!==0&&(u=v,n=Qc(t,v))),n===1))throw s=ka,Ds(t,0),ps(t,u),or(t,jt()),s;switch(t.finishedWork=h,t.finishedLanes=u,n){case 0:case 1:throw Error(o(345));case 2:zs(t,rr,Fo);break;case 3:if(ps(t,u),(u&130023424)===u&&(n=Wc+500-jt(),10<n)){if(St(t,0)!==0)break;if(h=t.suspendedLanes,(h&u)!==u){Yn(),t.pingedLanes|=t.suspendedLanes&h;break}t.timeoutHandle=nc(zs.bind(null,t,rr,Fo),n);break}zs(t,rr,Fo);break;case 4:if(ps(t,u),(u&4194240)===u)break;for(n=t.eventTimes,h=-1;0<u;){var C=31-wn(u);v=1<<C,C=n[C],C>h&&(h=C),u&=~v}if(u=h,u=jt()-u,u=(120>u?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*Sy(u/1960))-u,10<u){t.timeoutHandle=nc(zs.bind(null,t,rr,Fo),u);break}zs(t,rr,Fo);break;case 5:zs(t,rr,Fo);break;default:throw Error(o(329))}}}return or(t,jt()),t.callbackNode===s?Kp.bind(null,t):null}function Qc(t,n){var s=Sa;return t.current.memoizedState.isDehydrated&&(Ds(t,n).flags|=256),t=Vl(t,n),t!==2&&(n=rr,rr=s,n!==null&&Jc(n)),t}function Jc(t){rr===null?rr=t:rr.push.apply(rr,t)}function Ny(t){for(var n=t;;){if(n.flags&16384){var s=n.updateQueue;if(s!==null&&(s=s.stores,s!==null))for(var u=0;u<s.length;u++){var h=s[u],v=h.getSnapshot;h=h.value;try{if(!fe(v(),h))return!1}catch{return!1}}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function ps(t,n){for(n&=~qc,n&=~Rl,t.suspendedLanes|=n,t.pingedLanes&=~n,t=t.expirationTimes;0<n;){var s=31-wn(n),u=1<<s;t[s]=-1,n&=~u}}function qp(t){if(($t&6)!==0)throw Error(o(327));Ei();var n=St(t,0);if((n&1)===0)return or(t,jt()),null;var s=Vl(t,n);if(t.tag!==0&&s===2){var u=Gn(t);u!==0&&(n=u,s=Qc(t,u))}if(s===1)throw s=ka,Ds(t,0),ps(t,n),or(t,jt()),s;if(s===6)throw Error(o(345));return t.finishedWork=t.current.alternate,t.finishedLanes=n,zs(t,rr,Fo),or(t,jt()),null}function Gc(t,n){var s=$t;$t|=1;try{return t(n)}finally{$t=s,$t===0&&(ji=jt()+500,gl&&is())}}function Rs(t){ds!==null&&ds.tag===0&&($t&6)===0&&Ei();var n=$t;$t|=1;var s=jr.transition,u=Ct;try{if(jr.transition=null,Ct=1,t)return t()}finally{Ct=u,jr.transition=s,$t=n,($t&6)===0&&is()}}function Zc(){fr=_i.current,Kt(_i)}function Ds(t,n){t.finishedWork=null,t.finishedLanes=0;var s=t.timeoutHandle;if(s!==-1&&(t.timeoutHandle=-1,ey(s)),pn!==null)for(s=pn.return;s!==null;){var u=s;switch(lc(u),u.tag){case 1:u=u.type.childContextTypes,u!=null&&hl();break;case 3:ki(),Kt(er),Kt(zn),bc();break;case 5:vc(u);break;case 4:ki();break;case 13:Kt(Jt);break;case 19:Kt(Jt);break;case 10:hc(u.type._context);break;case 22:case 23:Zc()}s=s.return}if(_n=t,pn=t=hs(t.current,null),In=fr=n,vn=0,ka=null,qc=Rl=Ls=0,rr=Sa=null,Is!==null){for(n=0;n<Is.length;n++)if(s=Is[n],u=s.interleaved,u!==null){s.interleaved=null;var h=u.next,v=s.pending;if(v!==null){var C=v.next;v.next=h,u.next=C}s.pending=u}Is=null}return t}function Wp(t,n){do{var s=pn;try{if(pc(),jl.current=$l,El){for(var u=Gt.memoizedState;u!==null;){var h=u.queue;h!==null&&(h.pending=null),u=u.next}El=!1}if(Os=0,Nn=xn=Gt=null,ga=!1,ya=0,Kc.current=null,s===null||s.return===null){vn=1,ka=n,pn=null;break}e:{var v=t,C=s.return,V=s,X=n;if(n=In,V.flags|=32768,X!==null&&typeof X=="object"&&typeof X.then=="function"){var we=X,Te=V,Oe=Te.tag;if((Te.mode&1)===0&&(Oe===0||Oe===11||Oe===15)){var Me=Te.alternate;Me?(Te.updateQueue=Me.updateQueue,Te.memoizedState=Me.memoizedState,Te.lanes=Me.lanes):(Te.updateQueue=null,Te.memoizedState=null)}var Ye=xp(C);if(Ye!==null){Ye.flags&=-257,vp(Ye,C,V,v,n),Ye.mode&1&&yp(v,we,n),n=Ye,X=we;var Je=n.updateQueue;if(Je===null){var Ze=new Set;Ze.add(X),n.updateQueue=Ze}else Je.add(X);break e}else{if((n&1)===0){yp(v,we,n),ed();break e}X=Error(o(426))}}else if(Wt&&V.mode&1){var ln=xp(C);if(ln!==null){(ln.flags&65536)===0&&(ln.flags|=256),vp(ln,C,V,v,n),dc(Si(X,V));break e}}v=X=Si(X,V),vn!==4&&(vn=2),Sa===null?Sa=[v]:Sa.push(v),v=C;do{switch(v.tag){case 3:v.flags|=65536,n&=-n,v.lanes|=n;var he=mp(v,X,n);Hf(v,he);break e;case 1:V=X;var oe=v.type,me=v.stateNode;if((v.flags&128)===0&&(typeof oe.getDerivedStateFromError=="function"||me!==null&&typeof me.componentDidCatch=="function"&&(cs===null||!cs.has(me)))){v.flags|=65536,n&=-n,v.lanes|=n;var He=gp(v,V,n);Hf(v,He);break e}}v=v.return}while(v!==null)}Qp(s)}catch(nt){n=nt,pn===s&&s!==null&&(pn=s=s.return);continue}break}while(!0)}function Yp(){var t=Ll.current;return Ll.current=$l,t===null?$l:t}function ed(){(vn===0||vn===3||vn===2)&&(vn=4),_n===null||(Ls&268435455)===0&&(Rl&268435455)===0||ps(_n,In)}function Vl(t,n){var s=$t;$t|=2;var u=Yp();(_n!==t||In!==n)&&(Fo=null,Ds(t,n));do try{_y();break}catch(h){Wp(t,h)}while(!0);if(pc(),$t=s,Ll.current=u,pn!==null)throw Error(o(261));return _n=null,In=0,vn}function _y(){for(;pn!==null;)Xp(pn)}function jy(){for(;pn!==null&&!Ft();)Xp(pn)}function Xp(t){var n=Zp(t.alternate,t,fr);t.memoizedProps=t.pendingProps,n===null?Qp(t):pn=n,Kc.current=null}function Qp(t){var n=t;do{var s=n.alternate;if(t=n.return,(n.flags&32768)===0){if(s=xy(s,n,fr),s!==null){pn=s;return}}else{if(s=vy(s,n),s!==null){s.flags&=32767,pn=s;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{vn=6,pn=null;return}}if(n=n.sibling,n!==null){pn=n;return}pn=n=t}while(n!==null);vn===0&&(vn=5)}function zs(t,n,s){var u=Ct,h=jr.transition;try{jr.transition=null,Ct=1,Ey(t,n,s,u)}finally{jr.transition=h,Ct=u}return null}function Ey(t,n,s,u){do Ei();while(ds!==null);if(($t&6)!==0)throw Error(o(327));s=t.finishedWork;var h=t.finishedLanes;if(s===null)return null;if(t.finishedWork=null,t.finishedLanes=0,s===t.current)throw Error(o(177));t.callbackNode=null,t.callbackPriority=0;var v=s.lanes|s.childLanes;if(wo(t,v),t===_n&&(pn=_n=null,In=0),(s.subtreeFlags&2064)===0&&(s.flags&2064)===0||zl||(zl=!0,eh(vr,function(){return Ei(),null})),v=(s.flags&15990)!==0,(s.subtreeFlags&15990)!==0||v){v=jr.transition,jr.transition=null;var C=Ct;Ct=1;var V=$t;$t|=4,Kc.current=null,by(t,s),Fp(s,t),ce(ec),Js=!!Zu,ec=Zu=null,t.current=s,ky(s),Jn(),$t=V,Ct=C,jr.transition=v}else t.current=s;if(zl&&(zl=!1,ds=t,Fl=h),v=t.pendingLanes,v===0&&(cs=null),yt(s.stateNode),or(t,jt()),n!==null)for(u=t.onRecoverableError,s=0;s<n.length;s++)h=n[s],u(h.value,{componentStack:h.stack,digest:h.digest});if(Dl)throw Dl=!1,t=Yc,Yc=null,t;return(Fl&1)!==0&&t.tag!==0&&Ei(),v=t.pendingLanes,(v&1)!==0?t===Xc?Na++:(Na=0,Xc=t):Na=0,is(),null}function Ei(){if(ds!==null){var t=Xs(Fl),n=jr.transition,s=Ct;try{if(jr.transition=null,Ct=16>t?16:t,ds===null)var u=!1;else{if(t=ds,ds=null,Fl=0,($t&6)!==0)throw Error(o(331));var h=$t;for($t|=4,Qe=t.current;Qe!==null;){var v=Qe,C=v.child;if((Qe.flags&16)!==0){var V=v.deletions;if(V!==null){for(var X=0;X<V.length;X++){var we=V[X];for(Qe=we;Qe!==null;){var Te=Qe;switch(Te.tag){case 0:case 11:case 15:ba(8,Te,v)}var Oe=Te.child;if(Oe!==null)Oe.return=Te,Qe=Oe;else for(;Qe!==null;){Te=Qe;var Me=Te.sibling,Ye=Te.return;if(Op(Te),Te===we){Qe=null;break}if(Me!==null){Me.return=Ye,Qe=Me;break}Qe=Ye}}}var Je=v.alternate;if(Je!==null){var Ze=Je.child;if(Ze!==null){Je.child=null;do{var ln=Ze.sibling;Ze.sibling=null,Ze=ln}while(Ze!==null)}}Qe=v}}if((v.subtreeFlags&2064)!==0&&C!==null)C.return=v,Qe=C;else e:for(;Qe!==null;){if(v=Qe,(v.flags&2048)!==0)switch(v.tag){case 0:case 11:case 15:ba(9,v,v.return)}var he=v.sibling;if(he!==null){he.return=v.return,Qe=he;break e}Qe=v.return}}var oe=t.current;for(Qe=oe;Qe!==null;){C=Qe;var me=C.child;if((C.subtreeFlags&2064)!==0&&me!==null)me.return=C,Qe=me;else e:for(C=oe;Qe!==null;){if(V=Qe,(V.flags&2048)!==0)try{switch(V.tag){case 0:case 11:case 15:Ol(9,V)}}catch(nt){rn(V,V.return,nt)}if(V===C){Qe=null;break e}var He=V.sibling;if(He!==null){He.return=V.return,Qe=He;break e}Qe=V.return}}if($t=h,is(),yn&&typeof yn.onPostCommitFiberRoot=="function")try{yn.onPostCommitFiberRoot(gn,t)}catch{}u=!0}return u}finally{Ct=s,jr.transition=n}}return!1}function Jp(t,n,s){n=Si(s,n),n=mp(t,n,1),t=ls(t,n,1),n=Yn(),t!==null&&(Zn(t,1,n),or(t,n))}function rn(t,n,s){if(t.tag===3)Jp(t,t,s);else for(;n!==null;){if(n.tag===3){Jp(n,t,s);break}else if(n.tag===1){var u=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(cs===null||!cs.has(u))){t=Si(s,t),t=gp(n,t,1),n=ls(n,t,1),t=Yn(),n!==null&&(Zn(n,1,t),or(n,t));break}}n=n.return}}function Cy(t,n,s){var u=t.pingCache;u!==null&&u.delete(n),n=Yn(),t.pingedLanes|=t.suspendedLanes&s,_n===t&&(In&s)===s&&(vn===4||vn===3&&(In&130023424)===In&&500>jt()-Wc?Ds(t,0):qc|=s),or(t,n)}function Gp(t,n){n===0&&((t.mode&1)===0?n=1:(n=Tr,Tr<<=1,(Tr&130023424)===0&&(Tr=4194304)));var s=Yn();t=Ro(t,n),t!==null&&(Zn(t,n,s),or(t,s))}function Py(t){var n=t.memoizedState,s=0;n!==null&&(s=n.retryLane),Gp(t,s)}function $y(t,n){var s=0;switch(t.tag){case 13:var u=t.stateNode,h=t.memoizedState;h!==null&&(s=h.retryLane);break;case 19:u=t.stateNode;break;default:throw Error(o(314))}u!==null&&u.delete(n),Gp(t,s)}var Zp;Zp=function(t,n,s){if(t!==null)if(t.memoizedProps!==n.pendingProps||er.current)nr=!0;else{if((t.lanes&s)===0&&(n.flags&128)===0)return nr=!1,yy(t,n,s);nr=(t.flags&131072)!==0}else nr=!1,Wt&&(n.flags&1048576)!==0&&Tf(n,xl,n.index);switch(n.lanes=0,n.tag){case 2:var u=n.type;Il(t,n),t=n.pendingProps;var h=mi(n,zn.current);bi(n,s),h=Nc(null,n,u,t,h,s);var v=_c();return n.flags|=1,typeof h=="object"&&h!==null&&typeof h.render=="function"&&h.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,tr(u)?(v=!0,ml(n)):v=!1,n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,yc(n),h.updater=Ml,n.stateNode=h,h._reactInternals=n,Mc(n,u,t,s),n=Oc(null,n,u,!0,v,s)):(n.tag=0,Wt&&v&&ac(n),Wn(null,n,h,s),n=n.child),n;case 16:u=n.elementType;e:{switch(Il(t,n),t=n.pendingProps,h=u._init,u=h(u._payload),n.type=u,h=n.tag=Ty(u),t=Hr(u,t),h){case 0:n=Ac(null,n,u,t,s);break e;case 1:n=_p(null,n,u,t,s);break e;case 11:n=wp(null,n,u,t,s);break e;case 14:n=bp(null,n,u,Hr(u.type,t),s);break e}throw Error(o(306,u,""))}return n;case 0:return u=n.type,h=n.pendingProps,h=n.elementType===u?h:Hr(u,h),Ac(t,n,u,h,s);case 1:return u=n.type,h=n.pendingProps,h=n.elementType===u?h:Hr(u,h),_p(t,n,u,h,s);case 3:e:{if(jp(n),t===null)throw Error(o(387));u=n.pendingProps,v=n.memoizedState,h=v.element,Bf(t,n),Nl(n,u,null,s);var C=n.memoizedState;if(u=C.element,v.isDehydrated)if(v={element:u,isDehydrated:!1,cache:C.cache,pendingSuspenseBoundaries:C.pendingSuspenseBoundaries,transitions:C.transitions},n.updateQueue.baseState=v,n.memoizedState=v,n.flags&256){h=Si(Error(o(423)),n),n=Ep(t,n,u,s,h);break e}else if(u!==h){h=Si(Error(o(424)),n),n=Ep(t,n,u,s,h);break e}else for(dr=rs(n.stateNode.containerInfo.firstChild),cr=n,Wt=!0,Br=null,s=zf(n,null,u,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(xi(),u===h){n=zo(t,n,s);break e}Wn(t,n,u,s)}n=n.child}return n;case 5:return Uf(n),t===null&&cc(n),u=n.type,h=n.pendingProps,v=t!==null?t.memoizedProps:null,C=h.children,tc(u,h)?C=null:v!==null&&tc(u,v)&&(n.flags|=32),Np(t,n),Wn(t,n,C,s),n.child;case 6:return t===null&&cc(n),null;case 13:return Cp(t,n,s);case 4:return xc(n,n.stateNode.containerInfo),u=n.pendingProps,t===null?n.child=vi(n,null,u,s):Wn(t,n,u,s),n.child;case 11:return u=n.type,h=n.pendingProps,h=n.elementType===u?h:Hr(u,h),wp(t,n,u,h,s);case 7:return Wn(t,n,n.pendingProps,s),n.child;case 8:return Wn(t,n,n.pendingProps.children,s),n.child;case 12:return Wn(t,n,n.pendingProps.children,s),n.child;case 10:e:{if(u=n.type._context,h=n.pendingProps,v=n.memoizedProps,C=h.value,Ht(bl,u._currentValue),u._currentValue=C,v!==null)if(fe(v.value,C)){if(v.children===h.children&&!er.current){n=zo(t,n,s);break e}}else for(v=n.child,v!==null&&(v.return=n);v!==null;){var V=v.dependencies;if(V!==null){C=v.child;for(var X=V.firstContext;X!==null;){if(X.context===u){if(v.tag===1){X=Do(-1,s&-s),X.tag=2;var we=v.updateQueue;if(we!==null){we=we.shared;var Te=we.pending;Te===null?X.next=X:(X.next=Te.next,Te.next=X),we.pending=X}}v.lanes|=s,X=v.alternate,X!==null&&(X.lanes|=s),mc(v.return,s,n),V.lanes|=s;break}X=X.next}}else if(v.tag===10)C=v.type===n.type?null:v.child;else if(v.tag===18){if(C=v.return,C===null)throw Error(o(341));C.lanes|=s,V=C.alternate,V!==null&&(V.lanes|=s),mc(C,s,n),C=v.sibling}else C=v.child;if(C!==null)C.return=v;else for(C=v;C!==null;){if(C===n){C=null;break}if(v=C.sibling,v!==null){v.return=C.return,C=v;break}C=C.return}v=C}Wn(t,n,h.children,s),n=n.child}return n;case 9:return h=n.type,u=n.pendingProps.children,bi(n,s),h=Nr(h),u=u(h),n.flags|=1,Wn(t,n,u,s),n.child;case 14:return u=n.type,h=Hr(u,n.pendingProps),h=Hr(u.type,h),bp(t,n,u,h,s);case 15:return kp(t,n,n.type,n.pendingProps,s);case 17:return u=n.type,h=n.pendingProps,h=n.elementType===u?h:Hr(u,h),Il(t,n),n.tag=1,tr(u)?(t=!0,ml(n)):t=!1,bi(n,s),pp(n,u,h),Mc(n,u,h,s),Oc(null,n,u,!0,t,s);case 19:return $p(t,n,s);case 22:return Sp(t,n,s)}throw Error(o(156,n.tag))};function eh(t,n){return yo(t,n)}function My(t,n,s,u){this.tag=t,this.key=s,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(t,n,s,u){return new My(t,n,s,u)}function td(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Ty(t){if(typeof t=="function")return td(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Q)return 11;if(t===ie)return 14}return 2}function hs(t,n){var s=t.alternate;return s===null?(s=Er(t.tag,n,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=n,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&14680064,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,n=t.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s}function Ul(t,n,s,u,h,v){var C=2;if(u=t,typeof t=="function")td(t)&&(C=1);else if(typeof t=="string")C=5;else e:switch(t){case W:return Fs(s.children,h,v,n);case ue:C=8,h|=8;break;case ne:return t=Er(12,s,n,h|2),t.elementType=ne,t.lanes=v,t;case ve:return t=Er(13,s,n,h),t.elementType=ve,t.lanes=v,t;case B:return t=Er(19,s,n,h),t.elementType=B,t.lanes=v,t;case se:return Kl(s,h,v,n);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case ke:C=10;break e;case Y:C=9;break e;case Q:C=11;break e;case ie:C=14;break e;case G:C=16,u=null;break e}throw Error(o(130,t==null?t:typeof t,""))}return n=Er(C,s,n,h),n.elementType=t,n.type=u,n.lanes=v,n}function Fs(t,n,s,u){return t=Er(7,t,u,n),t.lanes=s,t}function Kl(t,n,s,u){return t=Er(22,t,u,n),t.elementType=se,t.lanes=s,t.stateNode={isHidden:!1},t}function nd(t,n,s){return t=Er(6,t,null,n),t.lanes=s,t}function rd(t,n,s){return n=Er(4,t.children!==null?t.children:[],t.key,n),n.lanes=s,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}function Iy(t,n,s,u,h){this.tag=n,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ar(0),this.expirationTimes=Ar(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ar(0),this.identifierPrefix=u,this.onRecoverableError=h,this.mutableSourceEagerHydrationData=null}function od(t,n,s,u,h,v,C,V,X){return t=new Iy(t,n,s,V,X),n===1?(n=1,v===!0&&(n|=8)):n=0,v=Er(3,null,null,n),t.current=v,v.stateNode=t,v.memoizedState={element:u,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},yc(v),t}function Ay(t,n,s){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:F,key:u==null?null:""+u,children:t,containerInfo:n,implementation:s}}function th(t){if(!t)return ss;t=t._reactInternals;e:{if(an(t)!==t||t.tag!==1)throw Error(o(170));var n=t;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(tr(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(o(171))}if(t.tag===1){var s=t.type;if(tr(s))return Pf(t,s,n)}return n}function nh(t,n,s,u,h,v,C,V,X){return t=od(s,u,!0,t,h,v,C,V,X),t.context=th(null),s=t.current,u=Yn(),h=fs(s),v=Do(u,h),v.callback=n??null,ls(s,v,h),t.current.lanes=h,Zn(t,h,u),or(t,u),t}function ql(t,n,s,u){var h=n.current,v=Yn(),C=fs(h);return s=th(s),n.context===null?n.context=s:n.pendingContext=s,n=Do(v,C),n.payload={element:t},u=u===void 0?null:u,u!==null&&(n.callback=u),t=ls(h,n,C),t!==null&&(Kr(t,h,C,v),Sl(t,h,C)),C}function Wl(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function rh(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<n?s:n}}function sd(t,n){rh(t,n),(t=t.alternate)&&rh(t,n)}function Oy(){return null}var oh=typeof reportError=="function"?reportError:function(t){console.error(t)};function id(t){this._internalRoot=t}Yl.prototype.render=id.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(o(409));ql(t,n,null,null)},Yl.prototype.unmount=id.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;Rs(function(){ql(null,t,null,null)}),n[Io]=null}};function Yl(t){this._internalRoot=t}Yl.prototype.unstable_scheduleHydration=function(t){if(t){var n=bs();t={blockedOn:null,target:t,priority:n};for(var s=0;s<Lt.length&&n!==0&&n<Lt[s].priority;s++);Lt.splice(s,0,t),s===0&&bn(t)}};function ad(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Xl(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function sh(){}function Ly(t,n,s,u,h){if(h){if(typeof u=="function"){var v=u;u=function(){var we=Wl(C);v.call(we)}}var C=nh(n,u,t,0,null,!1,!1,"",sh);return t._reactRootContainer=C,t[Io]=C.current,la(t.nodeType===8?t.parentNode:t),Rs(),C}for(;h=t.lastChild;)t.removeChild(h);if(typeof u=="function"){var V=u;u=function(){var we=Wl(X);V.call(we)}}var X=od(t,0,!1,null,null,!1,!1,"",sh);return t._reactRootContainer=X,t[Io]=X.current,la(t.nodeType===8?t.parentNode:t),Rs(function(){ql(n,X,s,u)}),X}function Ql(t,n,s,u,h){var v=s._reactRootContainer;if(v){var C=v;if(typeof h=="function"){var V=h;h=function(){var X=Wl(C);V.call(X)}}ql(n,C,t,h)}else C=Ly(s,n,t,h,u);return Wl(C)}kt=function(t){switch(t.tag){case 3:var n=t.stateNode;if(n.current.memoizedState.isDehydrated){var s=qn(n.pendingLanes);s!==0&&(Or(n,s|1),or(n,jt()),($t&6)===0&&(ji=jt()+500,is()))}break;case 13:Rs(function(){var u=Ro(t,1);if(u!==null){var h=Yn();Kr(u,t,1,h)}}),sd(t,1)}},bo=function(t){if(t.tag===13){var n=Ro(t,134217728);if(n!==null){var s=Yn();Kr(n,t,134217728,s)}sd(t,134217728)}},Wo=function(t){if(t.tag===13){var n=fs(t),s=Ro(t,n);if(s!==null){var u=Yn();Kr(s,t,n,u)}sd(t,n)}},bs=function(){return Ct},O=function(t,n){var s=Ct;try{return Ct=t,n()}finally{Ct=s}},Ve=function(t,n,s){switch(n){case"input":if(It(t,s),n=s.name,s.type==="radio"&&n!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<s.length;n++){var u=s[n];if(u!==t&&u.form===t.form){var h=pl(u);if(!h)throw Error(o(90));Fe(u),It(u,h)}}}break;case"textarea":Xn(t,s);break;case"select":n=s.value,n!=null&&At(t,!!s.multiple,n,!1)}},mr=Gc,go=Rs;var Ry={usingClientEntryPoint:!1,Events:[da,pi,pl,ar,Pr,Gc]},_a={findFiberByHostInstance:Ps,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Dy={bundleType:_a.bundleType,version:_a.version,rendererPackageName:_a.rendererPackageName,rendererConfig:_a.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:$.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Zr(t),t===null?null:t.stateNode},findFiberByHostInstance:_a.findFiberByHostInstance||Oy,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 Jl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jl.isDisabled&&Jl.supportsFiber)try{gn=Jl.inject(Dy),yn=Jl}catch{}}return sr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ry,sr.createPortal=function(t,n){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ad(n))throw Error(o(200));return Ay(t,n,null,s)},sr.createRoot=function(t,n){if(!ad(t))throw Error(o(299));var s=!1,u="",h=oh;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onRecoverableError!==void 0&&(h=n.onRecoverableError)),n=od(t,1,!1,null,null,s,!1,u,h),t[Io]=n.current,la(t.nodeType===8?t.parentNode:t),new id(n)},sr.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(o(188)):(t=Object.keys(t).join(","),Error(o(268,t)));return t=Zr(n),t=t===null?null:t.stateNode,t},sr.flushSync=function(t){return Rs(t)},sr.hydrate=function(t,n,s){if(!Xl(n))throw Error(o(200));return Ql(null,t,n,!0,s)},sr.hydrateRoot=function(t,n,s){if(!ad(t))throw Error(o(405));var u=s!=null&&s.hydratedSources||null,h=!1,v="",C=oh;if(s!=null&&(s.unstable_strictMode===!0&&(h=!0),s.identifierPrefix!==void 0&&(v=s.identifierPrefix),s.onRecoverableError!==void 0&&(C=s.onRecoverableError)),n=nh(n,null,t,1,s??null,h,!1,v,C),t[Io]=n.current,la(t),u)for(t=0;t<u.length;t++)s=u[t],h=s._getVersion,h=h(s._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[s,h]:n.mutableSourceEagerHydrationData.push(s,h);return new Yl(n)},sr.render=function(t,n,s){if(!Xl(n))throw Error(o(200));return Ql(null,t,n,!1,s)},sr.unmountComponentAtNode=function(t){if(!Xl(t))throw Error(o(40));return t._reactRootContainer?(Rs(function(){Ql(null,null,t,!1,function(){t._reactRootContainer=null,t[Io]=null})}),!0):!1},sr.unstable_batchedUpdates=Gc,sr.unstable_renderSubtreeIntoContainer=function(t,n,s,u){if(!Xl(s))throw Error(o(200));if(t==null||t._reactInternals===void 0)throw Error(o(38));return Ql(t,n,s,!1,u)},sr.version="18.3.1-next-f1338f8080-20240426",sr}var ph;function zm(){if(ph)return cd.exports;ph=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),cd.exports=Yy(),cd.exports}var hh;function Xy(){if(hh)return Gl;hh=1;var e=zm();return Gl.createRoot=e.createRoot,Gl.hydrateRoot=e.hydrateRoot,Gl}var Qy=Xy();const Jy=Mu(Qy);function pd(e){if(!e||typeof e!="object")throw new Error("OpenAPI: expected object");const r=e;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 Gy="x-api-doc-tor-llm-key";function cu(e){switch(e){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 Zy=["get","post","put","patch","delete","options","head","trace"];function mh(e){return e.replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_|_$/g,"").replace(/_+/g,"_")}function Tu(e,r,o,i){if(o)return mh(o).replace(/^[0-9]/,"_$&")||`op_${i}`;const a=mh(r.replace(/[{}]/g,""));return`${e}_${a}`||`op_${i}`}function Iu(e){var i;return`${(((i=e.info)==null?void 0:i.title)??"Api").replace(/[^a-zA-Z0-9]+/g," ").trim().split(/\s+/).filter(Boolean).map(a=>a.charAt(0).toUpperCase()+a.slice(1).toLowerCase()).join("")||"Api"}Client`}function Au(e){return(e.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(o=>o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()).join("")||"Api")+"Service"}function ho(e){const r=[];if(!e.paths)return r;for(const[o,i]of Object.entries(e.paths)){if(!i||typeof i!="object"||"$ref"in i)continue;const a=i;for(const c of Zy){const d=a[c];d&&typeof d=="object"&&r.push({method:c,path:o,operationId:d.operationId,tags:d.tags})}}return r}function ex(e,r,o,i="baseUrl"){var c,d;const a=r.toUpperCase();return`const ${i} = "${((d=(c=e.servers)==null?void 0:c[0])==null?void 0:d.url)??"http://localhost:3000"}";
41
+ /** @returns {Promise<unknown>} */
42
+ const res = await fetch(\`${i}${o}\`, {
43
+ method: "${a}",
44
+ headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
45
+ ${a==="GET"||a==="HEAD"?"":"body: JSON.stringify({}),"}
46
+ });
47
+ const data = await res.json();
48
+ `}function Fm(e,r){const o=e.map((i,a)=>` /**
49
+ * @param {{ headers?: Record<string, string> }} [options]
50
+ * @returns {Promise<unknown>}
51
+ */
52
+ async ${Tu(i.method,i.path,i.operationId,a)}(options) {
53
+ const res = await fetch(\`\${this.baseUrl}${i.path}\`, {
54
+ method: "${i.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
+ ${o.join(`
69
+
70
+ `)}
71
+ }
72
+ `}function tx(e){return Fm(ho(e),Iu(e))}function nx(e,r){const o=Au(r),i=ho(e).filter(a=>{var c;return(c=a.tags)==null?void 0:c.includes(r)});return Fm(i,o)}function rx(e,r,o){var c,d;const i=((d=(c=e.servers)==null?void 0:c[0])==null?void 0:d.url)??"http://localhost:3000",a=r.toUpperCase();return`<?php
73
+ $baseUrl = '${i}';
74
+ $url = $baseUrl . '${o}';
75
+ $opts = [
76
+ 'http' => [
77
+ 'method' => '${a}',
78
+ 'header' => "Content-Type: application/json\\r\\nAuthorization: Bearer {$token}\\r\\n",
79
+ ${a==="GET"||a==="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 Bm(e,r){const o=e.map((i,a)=>` public function ${Tu(i.method,i.path,i.operationId,a)}(array $extraHeaders = []): array
86
+ {
87
+ $url = $this->baseUrl . '${i.path}';
88
+ $headers = array_merge($this->defaultHeaders, $extraHeaders);
89
+ $opts = [
90
+ 'http' => [
91
+ 'method' => '${i.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
+ ${o.join(`
123
+
124
+ `)}
125
+ }
126
+ `}function ox(e){return Bm(ho(e),Iu(e))}function sx(e,r){const o=Au(r),i=ho(e).filter(a=>{var c;return(c=a.tags)==null?void 0:c.includes(r)});return Bm(i,o)}function ix(e,r,o){var d,m;const i=((m=(d=e.servers)==null?void 0:d[0])==null?void 0:m.url)??"http://localhost:3000",a=r.toLowerCase();return`import httpx
127
+
128
+ base_url = "${i}"
129
+ url = f"{base_url}${o}"
130
+ headers = {"Authorization": f"Bearer {token}"}
131
+ with httpx.Client() as client:
132
+ response = client.${a}(url, headers=headers${a==="get"||a==="head"?"":", json={}"})
133
+ data = response.json()
134
+ `}function Hm(e,r){const o=e.map((i,a)=>{const c=Tu(i.method,i.path,i.operationId,a),d=i.method.toLowerCase(),m=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}${i.path}", headers=h${m})
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
+ ${o.join(`
150
+
151
+ `)}
152
+ `}function ax(e){return Hm(ho(e),Iu(e))}function lx(e,r){const o=Au(r),i=ho(e).filter(a=>{var c;return(c=a.tags)==null?void 0:c.includes(r)});return Hm(i,o)}function ux(e){const r=e.split("/");return(r[r.length-1]??"Unknown").replace(/[^a-zA-Z0-9_]/g,"_")}function Md(e){if(!e)return"unknown";if("$ref"in e&&e.$ref)return ux(e.$ref);const r=e;return r.type==="string"?"string":r.type==="number"||r.type==="integer"?"number":r.type==="boolean"?"boolean":r.type==="array"&&r.items?`${Md(r.items)}[]`:r.type==="object"&&r.properties?`{
153
+ ${Object.entries(r.properties).map(([i,a])=>` ${JSON.stringify(i)}?: ${Md(a)};`).join(`
154
+ `)}
155
+ }`:"Record<string, unknown>"}function cx(e,r,o,i="baseUrl"){var w,S,x,k,_,j;const a=(S=(w=e.paths)==null?void 0:w[o])==null?void 0:S[r],c=a==null?void 0:a.requestBody;let d;if((k=(x=c==null?void 0:c.content)==null?void 0:x["application/json"])!=null&&k.schema){const M=c.content["application/json"].schema;M&&!("$ref"in M)&&(d=M)}const m=d?Md(d):"Record<string, unknown>",y=r.toUpperCase();return`const ${i} = "${((j=(_=e.servers)==null?void 0:_[0])==null?void 0:j.url)??"http://localhost:3000"}";
156
+ const res = await fetch(\`${i}${o}\`, {
157
+ method: "${y}",
158
+ headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
159
+ ${y==="GET"||y==="HEAD"?"":`body: JSON.stringify({} as ${m}),`}
160
+ });
161
+ const data = await res.json() as unknown;
162
+ `}function Vm(e,r){const o=e.map((i,a)=>` async ${Tu(i.method,i.path,i.operationId,a)}(options?: { headers?: Record<string, string> }): Promise<unknown> {
163
+ const res = await fetch(\`\${this.baseUrl}${i.path}\`, {
164
+ method: "${i.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
+ ${o.join(`
175
+
176
+ `)}
177
+ }
178
+ `}function dx(e){const r=ho(e),o=Iu(e);return Vm(r,o)}function fx(e,r){const o=Au(r),i=ho(e).filter(a=>{var c;return(c=a.tags)==null?void 0:c.includes(r)});return Vm(i,o)}function px(e,r,o,i){switch(r){case"typescript":return cx(e,o,i);case"javascript":return ex(e,o,i);case"python":return ix(e,o,i);case"php":return rx(e,o,i);default:{const a=r;throw new Error(`Unsupported language: ${a}`)}}}function hx(e,r,o){switch(r){case"typescript":return fx(e,o);case"javascript":return nx(e,o);case"python":return lx(e,o);case"php":return sx(e,o);default:{const i=r;throw new Error(`Unsupported language: ${i}`)}}}function mx(e,r,o){if(o===null)switch(r){case"typescript":return dx(e);case"javascript":return tx(e);case"python":return ax(e);case"php":return ox(e);default:{const i=r;throw new Error(`Unsupported language: ${i}`)}}return hx(e,r,o)}function gx(e){const r=new Set;for(const o of ho(e))for(const i of o.tags??[])r.add(i);return r.size===0&&r.add("default"),[...r].sort()}function qr(e,r){var o,i,a;return r!=null&&r.trim()?r.replace(/\/$/,""):((a=(i=(o=e.servers)==null?void 0:o[0])==null?void 0:i.url)==null?void 0:a.replace(/\/$/,""))??window.location.origin}function yx(e){var o;const r=(o=e.components)==null?void 0:o.securitySchemes;return r?Object.keys(r):[]}function Ou(e,r){if(!r.startsWith("$"))return;let o=e;const i=r.slice(1);if(i.startsWith(".")){for(const a of i.slice(1).split("."))if(o&&typeof o=="object"&&a in o)o=o[a];else return;return o}return o}function Aa(e){if(typeof window>"u")return"omit";try{return new URL(e).origin===window.location.origin?"include":"omit"}catch{return"omit"}}var du={exports:{}},xx=du.exports,gh;function vx(){return gh||(gh=1,(function(e,r){((o,i)=>{e.exports=i()})(xx,function(){var o=function(l,f){return(o=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(g,b){g.__proto__=b}:function(g,b){for(var N in b)Object.prototype.hasOwnProperty.call(b,N)&&(g[N]=b[N])}))(l,f)},i=function(){return(i=Object.assign||function(l){for(var f,g=1,b=arguments.length;g<b;g++)for(var N in f=arguments[g])Object.prototype.hasOwnProperty.call(f,N)&&(l[N]=f[N]);return l}).apply(this,arguments)};function a(l,f,g){for(var b,N=0,E=f.length;N<E;N++)!b&&N in f||((b=b||Array.prototype.slice.call(f,0,N))[N]=f[N]);return l.concat(b||Array.prototype.slice.call(f))}var c=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Hy,d=Object.keys,m=Array.isArray;function y(l,f){return typeof f=="object"&&d(f).forEach(function(g){l[g]=f[g]}),l}typeof Promise>"u"||c.Promise||(c.Promise=Promise);var w=Object.getPrototypeOf,S={}.hasOwnProperty;function x(l,f){return S.call(l,f)}function k(l,f){typeof f=="function"&&(f=f(w(l))),(typeof Reflect>"u"?d:Reflect.ownKeys)(f).forEach(function(g){j(l,g,f[g])})}var _=Object.defineProperty;function j(l,f,g,b){_(l,f,y(g&&x(g,"get")&&typeof g.get=="function"?{get:g.get,set:g.set,configurable:!0}:{value:g,configurable:!0,writable:!0},b))}function M(l){return{from:function(f){return l.prototype=Object.create(f.prototype),j(l.prototype,"constructor",l),{extend:k.bind(null,l.prototype)}}}}var A=Object.getOwnPropertyDescriptor,T=[].slice;function U(l,f,g){return T.call(l,f,g)}function P(l,f){return f(l)}function $(l){if(!l)throw new Error("Assertion Failed")}function R(l){c.setImmediate?setImmediate(l):setTimeout(l,0)}function F(l,f){if(typeof f=="string"&&x(l,f))return l[f];if(!f)return l;if(typeof f!="string"){for(var g=[],b=0,N=f.length;b<N;++b){var E=F(l,f[b]);g.push(E)}return g}var I,z=f.indexOf(".");return z===-1||(I=l[f.substr(0,z)])==null?void 0:F(I,f.substr(z+1))}function W(l,f,g){if(l&&f!==void 0&&!("isFrozen"in Object&&Object.isFrozen(l)))if(typeof f!="string"&&"length"in f){$(typeof g!="string"&&"length"in g);for(var b=0,N=f.length;b<N;++b)W(l,f[b],g[b])}else{var E,I,z=f.indexOf(".");z!==-1?(E=f.substr(0,z),(z=f.substr(z+1))===""?g===void 0?m(l)&&!isNaN(parseInt(E))?l.splice(E,1):delete l[E]:l[E]=g:W(I=(I=l[E])&&x(l,E)?I:l[E]={},z,g)):g===void 0?m(l)&&!isNaN(parseInt(f))?l.splice(f,1):delete l[f]:l[f]=g}}function ue(l){var f,g={};for(f in l)x(l,f)&&(g[f]=l[f]);return g}var ne=[].concat;function ke(l){return ne.apply([],l)}var K="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(l){return["Int","Uint","Float"].map(function(f){return f+l+"Array"})}))).filter(function(l){return c[l]}),Y=new Set(K.map(function(l){return c[l]})),Q=null;function ve(l){return Q=new WeakMap,l=(function f(g){if(!g||typeof g!="object")return g;var b=Q.get(g);if(b)return b;if(m(g)){b=[],Q.set(g,b);for(var N=0,E=g.length;N<E;++N)b.push(f(g[N]))}else if(Y.has(g.constructor))b=g;else{var I,z=w(g);for(I in b=z===Object.prototype?{}:Object.create(z),Q.set(g,b),g)x(g,I)&&(b[I]=f(g[I]))}return b})(l),Q=null,l}var B={}.toString;function ie(l){return B.call(l).slice(8,-1)}var G=typeof Symbol<"u"?Symbol.iterator:"@@iterator",se=typeof G=="symbol"?function(l){var f;return l!=null&&(f=l[G])&&f.apply(l)}:function(){return null};function H(l,f){f=l.indexOf(f),0<=f&&l.splice(f,1)}var q={};function J(l){var f,g,b,N;if(arguments.length===1){if(m(l))return l.slice();if(this===q&&typeof l=="string")return[l];if(N=se(l))for(g=[];!(b=N.next()).done;)g.push(b.value);else{if(l==null)return[l];if(typeof(f=l.length)!="number")return[l];for(g=new Array(f);f--;)g[f]=l[f]}}else for(f=arguments.length,g=new Array(f);f--;)g[f]=arguments[f];return g}var D=typeof Symbol<"u"?function(l){return l[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},K=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Mt=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(K),Se={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 je(l,f){this.name=l,this.message=f}function Le(l,f){return l+". Errors: "+Object.keys(f).map(function(g){return f[g].toString()}).filter(function(g,b,N){return N.indexOf(g)===b}).join(`
179
+ `)}function Ie(l,f,g,b){this.failures=f,this.failedKeys=b,this.successCount=g,this.message=Le(l,f)}function Ee(l,f){this.name="BulkError",this.failures=Object.keys(f).map(function(g){return f[g]}),this.failuresByPos=f,this.message=Le(l,this.failures)}M(je).from(Error).extend({toString:function(){return this.name+": "+this.message}}),M(Ie).from(je),M(Ee).from(je);var Ne=Mt.reduce(function(l,f){return l[f]=f+"Error",l},{}),Re=je,_e=Mt.reduce(function(l,f){var g=f+"Error";function b(N,E){this.name=g,N?typeof N=="string"?(this.message="".concat(N).concat(E?`
180
+ `+E:""),this.inner=E||null):typeof N=="object"&&(this.message="".concat(N.name," ").concat(N.message),this.inner=N):(this.message=Se[f]||g,this.inner=null)}return M(b).from(Re),l[f]=b,l},{}),tt=(_e.Syntax=SyntaxError,_e.Type=TypeError,_e.Range=RangeError,K.reduce(function(l,f){return l[f+"Error"]=_e[f],l},{}));K=Mt.reduce(function(l,f){return["Syntax","Type","Range"].indexOf(f)===-1&&(l[f+"Error"]=_e[f]),l},{});function Fe(){}function qe(l){return l}function mt(l,f){return l==null||l===qe?f:function(g){return f(l(g))}}function dt(l,f){return function(){l.apply(this,arguments),f.apply(this,arguments)}}function gt(l,f){return l===Fe?f:function(){var g=l.apply(this,arguments),b=(g!==void 0&&(arguments[0]=g),this.onsuccess),N=this.onerror,E=(this.onsuccess=null,this.onerror=null,f.apply(this,arguments));return b&&(this.onsuccess=this.onsuccess?dt(b,this.onsuccess):b),N&&(this.onerror=this.onerror?dt(N,this.onerror):N),E!==void 0?E:g}}function It(l,f){return l===Fe?f:function(){l.apply(this,arguments);var g=this.onsuccess,b=this.onerror;this.onsuccess=this.onerror=null,f.apply(this,arguments),g&&(this.onsuccess=this.onsuccess?dt(g,this.onsuccess):g),b&&(this.onerror=this.onerror?dt(b,this.onerror):b)}}function mn(l,f){return l===Fe?f:function(N){var b=l.apply(this,arguments),N=(y(N,b),this.onsuccess),E=this.onerror,I=(this.onsuccess=null,this.onerror=null,f.apply(this,arguments));return N&&(this.onsuccess=this.onsuccess?dt(N,this.onsuccess):N),E&&(this.onerror=this.onerror?dt(E,this.onerror):E),b===void 0?I===void 0?void 0:I:y(b,I)}}function Zt(l,f){return l===Fe?f:function(){return f.apply(this,arguments)!==!1&&l.apply(this,arguments)}}function en(l,f){return l===Fe?f:function(){var g=l.apply(this,arguments);if(g&&typeof g.then=="function"){for(var b=this,N=arguments.length,E=new Array(N);N--;)E[N]=arguments[N];return g.then(function(){return f.apply(b,E)})}return f.apply(this,arguments)}}K.ModifyError=Ie,K.DexieError=je,K.BulkError=Ee;var At=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Xt(l){At=l}var tn={},Xn=100,un=typeof Promise>"u"?[]:(Mt=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[un=crypto.subtle.digest("SHA-512",new Uint8Array([0])),w(un),Mt]:[Mt,w(Mt),Mt]),Mt=un[0],Co=un[1],Co=Co&&Co.then,on=Mt&&Mt.constructor,cn=!!un[2],xe=function(l,f){sn.push([l,f]),ut&&(queueMicrotask(go),ut=!1)},rt=!0,ut=!0,Ot=[],xt=[],nn=qe,ht={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Fe,pgp:!1,env:{},finalize:Fe},Ue=ht,sn=[],An=0,Vn=[];function Ve(l){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var f=this._PSD=Ue;if(typeof l!="function"){if(l!==tn)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 g(b,N){try{N(function(E){if(b._state===null){if(E===b)throw new TypeError("A promise cannot be resolved with itself.");var I=b._lib&&On();E&&typeof E.then=="function"?g(b,function(z,ee){E instanceof Ve?E._then(z,ee):E.then(z,ee)}):(b._state=!0,b._value=E,ar(b)),I&&Qn()}},Cr.bind(null,b))}catch(E){Cr(b,E)}})(this,l)}var Un={get:function(){var l=Ue,f=gr;function g(b,N){var E=this,I=!l.global&&(l!==Ue||f!==gr),z=I&&!an(),ee=new Ve(function(fe,re){Pr(E,new En(yo(b,l,I,z),yo(N,l,I,z),fe,re,l))});return this._consoleTask&&(ee._consoleTask=this._consoleTask),ee}return g.prototype=tn,g},set:function(l){j(this,"then",l&&l.prototype===tn?Un:{get:function(){return l},set:Un.set})}};function En(l,f,g,b,N){this.onFulfilled=typeof l=="function"?l:null,this.onRejected=typeof f=="function"?f:null,this.resolve=g,this.reject=b,this.psd=N}function Cr(l,f){var g,b;xt.push(f),l._state===null&&(g=l._lib&&On(),f=nn(f),l._state=!1,l._value=f,b=l,Ot.some(function(N){return N._value===b._value})||Ot.push(b),ar(l),g)&&Qn()}function ar(l){var f=l._listeners;l._listeners=[];for(var g=0,b=f.length;g<b;++g)Pr(l,f[g]);var N=l._PSD;--N.ref||N.finalize(),An===0&&(++An,xe(function(){--An==0&&Kn()},[]))}function Pr(l,f){if(l._state===null)l._listeners.push(f);else{var g=l._state?f.onFulfilled:f.onRejected;if(g===null)return(l._state?f.resolve:f.reject)(l._value);++f.psd.ref,++An,xe(mr,[g,l,f])}}function mr(l,f,g){try{var b,N=f._value;!f._state&&xt.length&&(xt=[]),b=At&&f._consoleTask?f._consoleTask.run(function(){return l(N)}):l(N),f._state||xt.indexOf(N)!==-1||(E=>{for(var I=Ot.length;I;)if(Ot[--I]._value===E._value)return Ot.splice(I,1)})(f),g.resolve(b)}catch(E){g.reject(E)}finally{--An==0&&Kn(),--g.psd.ref||g.psd.finalize()}}function go(){zt(ht,function(){On()&&Qn()})}function On(){var l=rt;return ut=rt=!1,l}function Qn(){var l,f,g;do for(;0<sn.length;)for(l=sn,sn=[],g=l.length,f=0;f<g;++f){var b=l[f];b[0].apply(null,b[1])}while(0<sn.length);ut=rt=!0}function Kn(){for(var l=Ot,f=(Ot=[],l.forEach(function(b){b._PSD.onunhandled.call(null,b._value,b)}),Vn.slice(0)),g=f.length;g;)f[--g]()}function dn(l){return new Ve(tn,!1,l)}function vt(l,f){var g=Ue;return function(){var b=On(),N=Ue;try{return Ln(g,!0),l.apply(this,arguments)}catch(E){f&&f(E)}finally{Ln(N,!1),b&&Qn()}}}k(Ve.prototype,{then:Un,_then:function(l,f){Pr(this,new En(null,null,l,f,Ue))},catch:function(l){var f,g;return arguments.length===1?this.then(null,l):(f=l,g=arguments[1],typeof f=="function"?this.then(null,function(b){return(b instanceof f?g:dn)(b)}):this.then(null,function(b){return(b&&b.name===f?g:dn)(b)}))},finally:function(l){return this.then(function(f){return Ve.resolve(l()).then(function(){return f})},function(f){return Ve.resolve(l()).then(function(){return dn(f)})})},timeout:function(l,f){var g=this;return l<1/0?new Ve(function(b,N){var E=setTimeout(function(){return N(new _e.Timeout(f))},l);g.then(b,N).finally(clearTimeout.bind(null,E))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&j(Ve.prototype,Symbol.toStringTag,"Dexie.Promise"),ht.env=Zr(),k(Ve,{all:function(){var l=J.apply(null,arguments).map(yr);return new Ve(function(f,g){l.length===0&&f([]);var b=l.length;l.forEach(function(N,E){return Ve.resolve(N).then(function(I){l[E]=I,--b||f(l)},g)})})},resolve:function(l){return l instanceof Ve?l:l&&typeof l.then=="function"?new Ve(function(f,g){l.then(f,g)}):new Ve(tn,!0,l)},reject:dn,race:function(){var l=J.apply(null,arguments).map(yr);return new Ve(function(f,g){l.map(function(b){return Ve.resolve(b).then(f,g)})})},PSD:{get:function(){return Ue},set:function(l){return Ue=l}},totalEchoes:{get:function(){return gr}},newPSD:Cn,usePSD:zt,scheduler:{get:function(){return xe},set:function(l){xe=l}},rejectionMapper:{get:function(){return nn},set:function(l){nn=l}},follow:function(l,f){return new Ve(function(g,b){return Cn(function(N,E){var I=Ue;I.unhandleds=[],I.onunhandled=E,I.finalize=dt(function(){var z,ee=this;z=function(){ee.unhandleds.length===0?N():E(ee.unhandleds[0])},Vn.push(function fe(){z(),Vn.splice(Vn.indexOf(fe),1)}),++An,xe(function(){--An==0&&Kn()},[])},I.finalize),l()},f,g,b)})}}),on&&(on.allSettled&&j(Ve,"allSettled",function(){var l=J.apply(null,arguments).map(yr);return new Ve(function(f){l.length===0&&f([]);var g=l.length,b=new Array(g);l.forEach(function(N,E){return Ve.resolve(N).then(function(I){return b[E]={status:"fulfilled",value:I}},function(I){return b[E]={status:"rejected",reason:I}}).then(function(){return--g||f(b)})})})}),on.any&&typeof AggregateError<"u"&&j(Ve,"any",function(){var l=J.apply(null,arguments).map(yr);return new Ve(function(f,g){l.length===0&&g(new AggregateError([]));var b=l.length,N=new Array(b);l.forEach(function(E,I){return Ve.resolve(E).then(function(z){return f(z)},function(z){N[I]=z,--b||g(new AggregateError(N))})})})}),on.withResolvers)&&(Ve.withResolvers=on.withResolvers);var Rt={awaits:0,echoes:0,id:0},et=0,lr=[],_t=0,gr=0,ws=0;function Cn(l,I,g,b){var N=Ue,E=Object.create(N),I=(E.parent=N,E.ref=0,E.global=!1,E.id=++ws,ht.env,E.env=cn?{Promise:Ve,PromiseProp:{value:Ve,configurable:!0,writable:!0},all:Ve.all,race:Ve.race,allSettled:Ve.allSettled,any:Ve.any,resolve:Ve.resolve,reject:Ve.reject}:{},I&&y(E,I),++N.ref,E.finalize=function(){--this.parent.ref||this.parent.finalize()},zt(E,l,g,b));return E.ref===0&&E.finalize(),I}function Pn(){return Rt.id||(Rt.id=++et),++Rt.awaits,Rt.echoes+=Xn,Rt.id}function an(){return!!Rt.awaits&&(--Rt.awaits==0&&(Rt.id=0),Rt.echoes=Rt.awaits*Xn,!0)}function yr(l){return Rt.echoes&&l&&l.constructor===on?(Pn(),l.then(function(f){return an(),f},function(f){return an(),Ft(f)})):l}function Gr(){var l=lr[lr.length-1];lr.pop(),Ln(l,!1)}function Ln(l,f){var g,b,N=Ue;(f?!Rt.echoes||_t++&&l===Ue:!_t||--_t&&l===Ue)||queueMicrotask(f?(function(E){++gr,Rt.echoes&&--Rt.echoes!=0||(Rt.echoes=Rt.awaits=Rt.id=0),lr.push(Ue),Ln(E,!0)}).bind(null,l):Gr),l!==Ue&&(Ue=l,N===ht&&(ht.env=Zr()),cn)&&(g=ht.env.Promise,b=l.env,N.global||l.global)&&(Object.defineProperty(c,"Promise",b.PromiseProp),g.all=b.all,g.race=b.race,g.resolve=b.resolve,g.reject=b.reject,b.allSettled&&(g.allSettled=b.allSettled),b.any)&&(g.any=b.any)}function Zr(){var l=c.Promise;return cn?{Promise:l,PromiseProp:Object.getOwnPropertyDescriptor(c,"Promise"),all:l.all,race:l.race,allSettled:l.allSettled,any:l.any,resolve:l.resolve,reject:l.reject}:{}}function zt(l,f,g,b,N){var E=Ue;try{return Ln(l,!0),f(g,b,N)}finally{Ln(E,!1)}}function yo(l,f,g,b){return typeof l!="function"?l:function(){var N=Ue;g&&Pn(),Ln(f,!0);try{return l.apply(this,arguments)}finally{Ln(N,!1),b&&queueMicrotask(an)}}}function eo(l){Promise===on&&Rt.echoes===0?_t===0?l():enqueueNativeMicroTask(l):setTimeout(l,0)}(""+Co).indexOf("[native code]")===-1&&(Pn=an=Fe);var Ft=Ve.reject,Jn="￿",jt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",xo="String expected.",xr="__dbnames",to="readonly",vr="readwrite";function ur(l,f){return l?f?function(){return l.apply(this,arguments)&&f.apply(this,arguments)}:l:f}var vo={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function gn(l){return typeof l!="string"||/\./.test(l)?function(f){return f}:function(f){return f[l]===void 0&&l in f&&delete(f=ve(f))[l],f}}function yn(){throw _e.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function yt(l,f){try{var g=wn(l),b=wn(f);if(g!==b)return g==="Array"?1:b==="Array"?-1:g==="binary"?1:b==="binary"?-1:g==="string"?1:b==="string"?-1:g==="Date"?1:b!=="Date"?NaN:-1;switch(g){case"number":case"Date":case"string":return f<l?1:l<f?-1:0;case"binary":for(var N=qo(l),E=qo(f),I=N.length,z=E.length,ee=I<z?I:z,fe=0;fe<ee;++fe)if(N[fe]!==E[fe])return N[fe]<E[fe]?-1:1;return I===z?0:I<z?-1:1;case"Array":for(var re=l,Z=f,te=re.length,de=Z.length,le=te<de?te:de,ae=0;ae<le;++ae){var ce=yt(re[ae],Z[ae]);if(ce!==0)return ce}return te===de?0:te<de?-1:1}}catch{}return NaN}function wn(l){var f=typeof l;return f=="object"&&(ArrayBuffer.isView(l)||(f=ie(l))==="ArrayBuffer")?"binary":f}function qo(l){return l instanceof Uint8Array?l:ArrayBuffer.isView(l)?new Uint8Array(l.buffer,l.byteOffset,l.byteLength):new Uint8Array(l)}function no(l,f,g){var b=l.schema.yProps;return b?(f&&0<g.numFailures&&(f=f.filter(function(N,E){return!g.failures[E]})),Promise.all(b.map(function(N){return N=N.updatesTable,f?l.db.table(N).where("k").anyOf(f).delete():l.db.table(N).clear()})).then(function(){return g})):g}Mr.prototype.execute=function(l){var f=this["@@propmod"];if(f.add!==void 0){var g=f.add;if(m(g))return a(a([],m(l)?l:[],!0),g).sort();if(typeof g=="number")return(Number(l)||0)+g;if(typeof g=="bigint")try{return BigInt(l)+g}catch{return BigInt(0)+g}throw new TypeError("Invalid term ".concat(g))}if(f.remove!==void 0){var b=f.remove;if(m(b))return m(l)?l.filter(function(N){return!b.includes(N)}).sort():[];if(typeof b=="number")return Number(l)-b;if(typeof b=="bigint")try{return BigInt(l)-b}catch{return BigInt(0)-b}throw new TypeError("Invalid subtrahend ".concat(b))}return g=(g=f.replacePrefix)==null?void 0:g[0],g&&typeof l=="string"&&l.startsWith(g)?f.replacePrefix[1]+l.substring(g.length):l};var $r=Mr;function Mr(l){this["@@propmod"]=l}function Tr(l,f){for(var g=d(f),b=g.length,N=!1,E=0;E<b;++E){var I=g[E],z=f[I],ee=F(l,I);z instanceof $r?(W(l,I,z.execute(ee)),N=!0):ee!==z&&(W(l,I,z),N=!0)}return N}St.prototype._trans=function(l,f,g){var b=this._tx||Ue.trans,N=this.name,E=At&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(l==="readonly"?"read":"write"," ").concat(this.name));function I(fe,re,Z){if(Z.schema[N])return f(Z.idbtrans,Z);throw new _e.NotFound("Table "+N+" not part of transaction")}var z=On();try{var ee=b&&b.db._novip===this.db._novip?b===Ue.trans?b._promise(l,I,g):Cn(function(){return b._promise(l,I,g)},{trans:b,transless:Ue.transless||Ue}):(function fe(re,Z,te,de){if(re.idbdb&&(re._state.openComplete||Ue.letThrough||re._vip)){var le=re._createTransaction(Z,te,re._dbSchema);try{le.create(),re._state.PR1398_maxLoop=3}catch(ae){return ae.name===Ne.InvalidState&&re.isOpen()&&0<--re._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),re.close({disableAutoOpen:!1}),re.open().then(function(){return fe(re,Z,te,de)})):Ft(ae)}return le._promise(Z,function(ae,ce){return Cn(function(){return Ue.trans=le,de(ae,ce,le)})}).then(function(ae){if(Z==="readwrite")try{le.idbtrans.commit()}catch{}return Z==="readonly"?ae:le._completion.then(function(){return ae})})}if(re._state.openComplete)return Ft(new _e.DatabaseClosed(re._state.dbOpenError));if(!re._state.isBeingOpened){if(!re._state.autoOpen)return Ft(new _e.DatabaseClosed);re.open().catch(Fe)}return re._state.dbReadyPromise.then(function(){return fe(re,Z,te,de)})})(this.db,l,[this.name],I);return E&&(ee._consoleTask=E,ee=ee.catch(function(fe){return console.trace(fe),Ft(fe)})),ee}finally{z&&Qn()}},St.prototype.get=function(l,f){var g=this;return l&&l.constructor===Object?this.where(l).first(f):l==null?Ft(new _e.Type("Invalid argument to Table.get()")):this._trans("readonly",function(b){return g.core.get({trans:b,key:l}).then(function(N){return g.hook.reading.fire(N)})}).then(f)},St.prototype.where=function(l){if(typeof l=="string")return new this.db.WhereClause(this,l);if(m(l))return new this.db.WhereClause(this,"[".concat(l.join("+"),"]"));var f=d(l);if(f.length===1)return this.where(f[0]).equals(l[f[0]]);var g=this.schema.indexes.concat(this.schema.primKey).filter(function(z){if(z.compound&&f.every(function(fe){return 0<=z.keyPath.indexOf(fe)})){for(var ee=0;ee<f.length;++ee)if(f.indexOf(z.keyPath[ee])===-1)return!1;return!0}return!1}).sort(function(z,ee){return z.keyPath.length-ee.keyPath.length})[0];if(g&&this.db._maxKey!==Jn)return I=g.keyPath.slice(0,f.length),this.where(I).equals(I.map(function(z){return l[z]}));!g&&At&&console.warn("The query ".concat(JSON.stringify(l)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(f.join("+"),"]"));var b=this.schema.idxByName;function N(z,ee){return yt(z,ee)===0}var I=f.reduce(function(re,ee){var fe=re[0],re=re[1],Z=b[ee],te=l[ee];return[fe||Z,fe||!Z?ur(re,Z&&Z.multi?function(de){return de=F(de,ee),m(de)&&de.some(function(le){return N(te,le)})}:function(de){return N(te,F(de,ee))}):re]},[null,null]),E=I[0],I=I[1];return E?this.where(E.name).equals(l[E.keyPath]).filter(I):g?this.filter(I):this.where(f).equals("")},St.prototype.filter=function(l){return this.toCollection().and(l)},St.prototype.count=function(l){return this.toCollection().count(l)},St.prototype.offset=function(l){return this.toCollection().offset(l)},St.prototype.limit=function(l){return this.toCollection().limit(l)},St.prototype.each=function(l){return this.toCollection().each(l)},St.prototype.toArray=function(l){return this.toCollection().toArray(l)},St.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},St.prototype.orderBy=function(l){return new this.db.Collection(new this.db.WhereClause(this,m(l)?"[".concat(l.join("+"),"]"):l))},St.prototype.reverse=function(){return this.toCollection().reverse()},St.prototype.mapToClass=function(l){for(var f=this.db,g=this.name,b=((this.schema.mappedClass=l).prototype instanceof yn&&(l=(I=>{var z=re,ee=I;if(typeof ee!="function"&&ee!==null)throw new TypeError("Class extends value "+String(ee)+" is not a constructor or null");function fe(){this.constructor=z}function re(){return I!==null&&I.apply(this,arguments)||this}return o(z,ee),z.prototype=ee===null?Object.create(ee):(fe.prototype=ee.prototype,new fe),Object.defineProperty(re.prototype,"db",{get:function(){return f},enumerable:!1,configurable:!0}),re.prototype.table=function(){return g},re})(l)),new Set),N=l.prototype;N;N=w(N))Object.getOwnPropertyNames(N).forEach(function(I){return b.add(I)});function E(I){if(!I)return I;var z,ee=Object.create(l.prototype);for(z in I)if(!b.has(z))try{ee[z]=I[z]}catch{}return ee}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=E,this.hook("reading",E),l},St.prototype.defineClass=function(){return this.mapToClass(function(l){y(this,l)})},St.prototype.add=function(l,f){var g=this,b=this.schema.primKey,N=b.auto,E=b.keyPath,I=l;return E&&N&&(I=gn(E)(l)),this._trans("readwrite",function(z){return g.core.mutate({trans:z,type:"add",keys:f!=null?[f]:null,values:[I]})}).then(function(z){return z.numFailures?Ve.reject(z.failures[0]):z.lastResult}).then(function(z){if(E)try{W(l,E,z)}catch{}return z})},St.prototype.upsert=function(l,f){var g=this,b=this.schema.primKey.keyPath;return this._trans("readwrite",function(N){return g.core.get({trans:N,key:l}).then(function(E){var I=E??{};return Tr(I,f),b&&W(I,b,l),g.core.mutate({trans:N,type:"put",values:[I],keys:[l],upsert:!0,updates:{keys:[l],changeSpecs:[f]}}).then(function(z){return z.numFailures?Ve.reject(z.failures[0]):!!E})})})},St.prototype.update=function(l,f){return typeof l!="object"||m(l)?this.where(":id").equals(l).modify(f):(l=F(l,this.schema.primKey.keyPath))===void 0?Ft(new _e.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(l).modify(f)},St.prototype.put=function(l,f){var g=this,b=this.schema.primKey,N=b.auto,E=b.keyPath,I=l;return E&&N&&(I=gn(E)(l)),this._trans("readwrite",function(z){return g.core.mutate({trans:z,type:"put",values:[I],keys:f!=null?[f]:null})}).then(function(z){return z.numFailures?Ve.reject(z.failures[0]):z.lastResult}).then(function(z){if(E)try{W(l,E,z)}catch{}return z})},St.prototype.delete=function(l){var f=this;return this._trans("readwrite",function(g){return f.core.mutate({trans:g,type:"delete",keys:[l]}).then(function(b){return no(f,[l],b)}).then(function(b){return b.numFailures?Ve.reject(b.failures[0]):void 0})})},St.prototype.clear=function(){var l=this;return this._trans("readwrite",function(f){return l.core.mutate({trans:f,type:"deleteRange",range:vo}).then(function(g){return no(l,null,g)})}).then(function(f){return f.numFailures?Ve.reject(f.failures[0]):void 0})},St.prototype.bulkGet=function(l){var f=this;return this._trans("readonly",function(g){return f.core.getMany({keys:l,trans:g}).then(function(b){return b.map(function(N){return f.hook.reading.fire(N)})})})},St.prototype.bulkAdd=function(l,f,g){var b=this,N=Array.isArray(f)?f:void 0,E=(g=g||(N?void 0:f))?g.allKeys:void 0;return this._trans("readwrite",function(I){var z=b.schema.primKey,fe=z.auto,z=z.keyPath;if(z&&N)throw new _e.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(N&&N.length!==l.length)throw new _e.InvalidArgument("Arguments objects and keys must have the same length");var ee=l.length,fe=z&&fe?l.map(gn(z)):l;return b.core.mutate({trans:I,type:"add",keys:N,values:fe,wantResults:E}).then(function(re){var Z=re.numFailures,te=re.failures;if(Z===0)return E?re.results:re.lastResult;throw new Ee("".concat(b.name,".bulkAdd(): ").concat(Z," of ").concat(ee," operations failed"),te)})})},St.prototype.bulkPut=function(l,f,g){var b=this,N=Array.isArray(f)?f:void 0,E=(g=g||(N?void 0:f))?g.allKeys:void 0;return this._trans("readwrite",function(I){var z=b.schema.primKey,fe=z.auto,z=z.keyPath;if(z&&N)throw new _e.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(N&&N.length!==l.length)throw new _e.InvalidArgument("Arguments objects and keys must have the same length");var ee=l.length,fe=z&&fe?l.map(gn(z)):l;return b.core.mutate({trans:I,type:"put",keys:N,values:fe,wantResults:E}).then(function(re){var Z=re.numFailures,te=re.failures;if(Z===0)return E?re.results:re.lastResult;throw new Ee("".concat(b.name,".bulkPut(): ").concat(Z," of ").concat(ee," operations failed"),te)})})},St.prototype.bulkUpdate=function(l){var f=this,g=this.core,b=l.map(function(I){return I.key}),N=l.map(function(I){return I.changes}),E=[];return this._trans("readwrite",function(I){return g.getMany({trans:I,keys:b,cache:"clone"}).then(function(z){var ee=[],fe=[],re=(l.forEach(function(Z,te){var de=Z.key,le=Z.changes,ae=z[te];if(ae){for(var ce=0,ye=Object.keys(le);ce<ye.length;ce++){var pe=ye[ce],be=le[pe];if(pe===f.schema.primKey.keyPath){if(yt(be,de)!==0)throw new _e.Constraint("Cannot update primary key in bulkUpdate()")}else W(ae,pe,be)}E.push(te),ee.push(de),fe.push(ae)}}),ee.length);return g.mutate({trans:I,type:"put",keys:ee,values:fe,updates:{keys:b,changeSpecs:N}}).then(function(Z){var te=Z.numFailures,de=Z.failures;if(te===0)return re;for(var le=0,ae=Object.keys(de);le<ae.length;le++){var ce,ye=ae[le],pe=E[Number(ye)];pe!=null&&(ce=de[ye],delete de[ye],de[pe]=ce)}throw new Ee("".concat(f.name,".bulkUpdate(): ").concat(te," of ").concat(re," operations failed"),de)})})})},St.prototype.bulkDelete=function(l){var f=this,g=l.length;return this._trans("readwrite",function(b){return f.core.mutate({trans:b,type:"delete",keys:l}).then(function(N){return no(f,l,N)})}).then(function(b){var N=b.numFailures,E=b.failures;if(N===0)return b.lastResult;throw new Ee("".concat(f.name,".bulkDelete(): ").concat(N," of ").concat(g," operations failed"),E)})};var qn=St;function St(){}function wr(l){function f(I,z){if(z){for(var ee=arguments.length,fe=new Array(ee-1);--ee;)fe[ee-1]=arguments[ee];return g[I].subscribe.apply(null,fe),l}if(typeof I=="string")return g[I]}var g={};f.addEventType=E;for(var b=1,N=arguments.length;b<N;++b)E(arguments[b]);return f;function E(I,z,ee){var fe,re;if(typeof I!="object")return z=z||Zt,re={subscribers:[],fire:ee=ee||Fe,subscribe:function(Z){re.subscribers.indexOf(Z)===-1&&(re.subscribers.push(Z),re.fire=z(re.fire,Z))},unsubscribe:function(Z){re.subscribers=re.subscribers.filter(function(te){return te!==Z}),re.fire=re.subscribers.reduce(z,ee)}},g[I]=f[I]=re;d(fe=I).forEach(function(Z){var te=fe[Z];if(m(te))E(Z,fe[Z][0],fe[Z][1]);else{if(te!=="asap")throw new _e.InvalidArgument("Invalid event config");var de=E(Z,qe,function(){for(var le=arguments.length,ae=new Array(le);le--;)ae[le]=arguments[le];de.subscribers.forEach(function(ce){R(function(){ce.apply(null,ae)})})})}})}}function Ir(l,f){return M(f).from({prototype:l}),f}function Gn(l,f){return!(l.filter||l.algorithm||l.or)&&(f?l.justLimit:!l.replayFilter)}function br(l,f){l.filter=ur(l.filter,f)}function Ar(l,f,g){var b=l.replayFilter;l.replayFilter=b?function(){return ur(b(),f())}:f,l.justLimit=g&&!b}function Zn(l,f){if(l.isPrimKey)return f.primaryKey;var g=f.getIndexByKeyPath(l.index);if(g)return g;throw new _e.Schema("KeyPath "+l.index+" on object store "+f.name+" is not indexed")}function wo(l,f,g){var b=Zn(l,f.schema);return f.openCursor({trans:g,values:!l.keysOnly,reverse:l.dir==="prev",unique:!!l.unique,query:{index:b,range:l.range}})}function Or(l,f,g,b){var N,E,I=l.replayFilter?ur(l.filter,l.replayFilter()):l.filter;return l.or?(N={},E=function(z,ee,fe){var re,Z;I&&!I(ee,fe,function(te){return ee.stop(te)},function(te){return ee.fail(te)})||((Z=""+(re=ee.primaryKey))=="[object ArrayBuffer]"&&(Z=""+new Uint8Array(re)),x(N,Z))||(N[Z]=!0,f(z,ee,fe))},Promise.all([l.or._iterate(E,g),Ct(wo(l,b,g),l.algorithm,E,!l.keysOnly&&l.valueMapper)])):Ct(wo(l,b,g),ur(l.algorithm,I),f,!l.keysOnly&&l.valueMapper)}function Ct(l,f,g,b){var N=vt(b?function(E,I,z){return g(b(E),I,z)}:g);return l.then(function(E){if(E)return E.start(function(){var I=function(){return E.continue()};f&&!f(E,function(z){return I=z},function(z){E.stop(z),I=Fe},function(z){E.fail(z),I=Fe})||N(E.value,E,function(z){return I=z}),I()})})}kt.prototype._read=function(l,f){var g=this._ctx;return g.error?g.table._trans(null,Ft.bind(null,g.error)):g.table._trans("readonly",l).then(f)},kt.prototype._write=function(l){var f=this._ctx;return f.error?f.table._trans(null,Ft.bind(null,f.error)):f.table._trans("readwrite",l,"locked")},kt.prototype._addAlgorithm=function(l){var f=this._ctx;f.algorithm=ur(f.algorithm,l)},kt.prototype._iterate=function(l,f){return Or(this._ctx,l,f,this._ctx.table.core)},kt.prototype.clone=function(l){var f=Object.create(this.constructor.prototype),g=Object.create(this._ctx);return l&&y(g,l),f._ctx=g,f},kt.prototype.raw=function(){return this._ctx.valueMapper=null,this},kt.prototype.each=function(l){var f=this._ctx;return this._read(function(g){return Or(f,l,g,f.table.core)})},kt.prototype.count=function(l){var f=this;return this._read(function(g){var b,N=f._ctx,E=N.table.core;return Gn(N,!0)?E.count({trans:g,query:{index:Zn(N,E.schema),range:N.range}}).then(function(I){return Math.min(I,N.limit)}):(b=0,Or(N,function(){return++b,!1},g,E).then(function(){return b}))}).then(l)},kt.prototype.sortBy=function(l,f){var g=l.split(".").reverse(),b=g[0],N=g.length-1;function E(ee,fe){return fe?E(ee[g[fe]],fe-1):ee[b]}var I=this._ctx.dir==="next"?1:-1;function z(ee,fe){return yt(E(ee,N),E(fe,N))*I}return this.toArray(function(ee){return ee.sort(z)}).then(f)},kt.prototype.toArray=function(l){var f=this;return this._read(function(g){var b,N,E,I=f._ctx;return Gn(I,!0)&&0<I.limit?(b=I.valueMapper,N=Zn(I,I.table.core.schema),I.table.core.query({trans:g,limit:I.limit,values:!0,direction:I.dir==="prev"?"prev":void 0,query:{index:N,range:I.range}}).then(function(z){return z=z.result,b?z.map(b):z})):(E=[],Or(I,function(z){return E.push(z)},g,I.table.core).then(function(){return E}))},l)},kt.prototype.offset=function(l){var f=this._ctx;return l<=0||(f.offset+=l,Gn(f)?Ar(f,function(){var g=l;return function(b,N){return g===0||(g===1?--g:N(function(){b.advance(g),g=0}),!1)}}):Ar(f,function(){var g=l;return function(){return--g<0}})),this},kt.prototype.limit=function(l){return this._ctx.limit=Math.min(this._ctx.limit,l),Ar(this._ctx,function(){var f=l;return function(g,b,N){return--f<=0&&b(N),0<=f}},!0),this},kt.prototype.until=function(l,f){return br(this._ctx,function(g,b,N){return!l(g.value)||(b(N),f)}),this},kt.prototype.first=function(l){return this.limit(1).toArray(function(f){return f[0]}).then(l)},kt.prototype.last=function(l){return this.reverse().first(l)},kt.prototype.filter=function(l){var f;return br(this._ctx,function(g){return l(g.value)}),(f=this._ctx).isMatch=ur(f.isMatch,l),this},kt.prototype.and=function(l){return this.filter(l)},kt.prototype.or=function(l){return new this.db.WhereClause(this._ctx.table,l,this)},kt.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},kt.prototype.desc=function(){return this.reverse()},kt.prototype.eachKey=function(l){var f=this._ctx;return f.keysOnly=!f.isMatch,this.each(function(g,b){l(b.key,b)})},kt.prototype.eachUniqueKey=function(l){return this._ctx.unique="unique",this.eachKey(l)},kt.prototype.eachPrimaryKey=function(l){var f=this._ctx;return f.keysOnly=!f.isMatch,this.each(function(g,b){l(b.primaryKey,b)})},kt.prototype.keys=function(l){var f=this._ctx,g=(f.keysOnly=!f.isMatch,[]);return this.each(function(b,N){g.push(N.key)}).then(function(){return g}).then(l)},kt.prototype.primaryKeys=function(l){var f=this._ctx;if(Gn(f,!0)&&0<f.limit)return this._read(function(b){var N=Zn(f,f.table.core.schema);return f.table.core.query({trans:b,values:!1,limit:f.limit,direction:f.dir==="prev"?"prev":void 0,query:{index:N,range:f.range}})}).then(function(b){return b.result}).then(l);f.keysOnly=!f.isMatch;var g=[];return this.each(function(b,N){g.push(N.primaryKey)}).then(function(){return g}).then(l)},kt.prototype.uniqueKeys=function(l){return this._ctx.unique="unique",this.keys(l)},kt.prototype.firstKey=function(l){return this.limit(1).keys(function(f){return f[0]}).then(l)},kt.prototype.lastKey=function(l){return this.reverse().firstKey(l)},kt.prototype.distinct=function(){var l,f=this._ctx,f=f.index&&f.table.schema.idxByName[f.index];return f&&f.multi&&(l={},br(this._ctx,function(b){var b=b.primaryKey.toString(),N=x(l,b);return l[b]=!0,!N})),this},kt.prototype.modify=function(l){var f=this,g=this._ctx;return this._write(function(b){function N(ae,ce){var ye=ce.failures;te+=ae-ce.numFailures;for(var pe=0,be=d(ye);pe<be.length;pe++){var Ce=be[pe];Z.push(ye[Ce])}}var E=typeof l=="function"?l:function(ae){return Tr(ae,l)},I=g.table.core,re=I.schema.primaryKey,z=re.outbound,ee=re.extractKey,fe=200,re=f.db._options.modifyChunkSize,Z=(re&&(fe=typeof re=="object"?re[I.name]||re["*"]||200:re),[]),te=0,de=[],le=l===bo;return f.clone().primaryKeys().then(function(ae){function ce(pe){var be=Math.min(fe,ae.length-pe),Ce=ae.slice(pe,pe+be);return(le?Promise.resolve([]):I.getMany({trans:b,keys:Ce,cache:"immutable"})).then(function($e){var Be=[],Ae=[],Ke=z?[]:null,De=le?Ce:[];if(!le)for(var Xe=0;Xe<be;++Xe){var Pe=$e[Xe],at={value:ve(Pe),primKey:ae[pe+Xe]};E.call(at,at.value,at)!==!1&&(at.value==null?De.push(ae[pe+Xe]):z||yt(ee(Pe),ee(at.value))===0?(Ae.push(at.value),z&&Ke.push(ae[pe+Xe])):(De.push(ae[pe+Xe]),Be.push(at.value)))}return Promise.resolve(0<Be.length&&I.mutate({trans:b,type:"add",values:Be}).then(function(lt){for(var pt in lt.failures)De.splice(parseInt(pt),1);N(Be.length,lt)})).then(function(){return(0<Ae.length||ye&&typeof l=="object")&&I.mutate({trans:b,type:"put",keys:Ke,values:Ae,criteria:ye,changeSpec:typeof l!="function"&&l,isAdditionalChunk:0<pe}).then(function(lt){return N(Ae.length,lt)})}).then(function(){return(0<De.length||ye&&le)&&I.mutate({trans:b,type:"delete",keys:De,criteria:ye,isAdditionalChunk:0<pe}).then(function(lt){return no(g.table,De,lt)}).then(function(lt){return N(De.length,lt)})}).then(function(){return ae.length>pe+be&&ce(pe+fe)})})}var ye=Gn(g)&&g.limit===1/0&&(typeof l!="function"||le)&&{index:g.index,range:g.range};return ce(0).then(function(){if(0<Z.length)throw new Ie("Error modifying one or more objects",Z,te,de);return ae.length})})})},kt.prototype.delete=function(){var l=this._ctx,f=l.range;return!Gn(l)||l.table.schema.yProps||!l.isPrimKey&&f.type!==3?this.modify(bo):this._write(function(g){var b=l.table.core.schema.primaryKey,N=f;return l.table.core.count({trans:g,query:{index:b,range:N}}).then(function(E){return l.table.core.mutate({trans:g,type:"deleteRange",range:N}).then(function(ee){var z=ee.failures,ee=ee.numFailures;if(ee)throw new Ie("Could not delete some values",Object.keys(z).map(function(fe){return z[fe]}),E-ee);return E-ee})})})};var Xs=kt;function kt(){}var bo=function(l,f){return f.value=null};function Wo(l,f){return l<f?-1:l===f?0:1}function bs(l,f){return f<l?-1:l===f?0:1}function O(l,f,g){return l=l instanceof Bt?new l.Collection(l):l,l._ctx.error=new(g||TypeError)(f),l}function ge(l){return new l.Collection(l,function(){return Pt("")}).limit(0)}function ze(de,f,g,b){var N,E,I,z,ee,fe,re,Z=g.length;if(!g.every(function(ae){return typeof ae=="string"}))return O(de,xo);function te(ae){N=ae==="next"?function(ye){return ye.toUpperCase()}:function(ye){return ye.toLowerCase()},E=ae==="next"?function(ye){return ye.toLowerCase()}:function(ye){return ye.toUpperCase()},I=ae==="next"?Wo:bs;var ce=g.map(function(ye){return{lower:E(ye),upper:N(ye)}}).sort(function(ye,pe){return I(ye.lower,pe.lower)});z=ce.map(function(ye){return ye.upper}),ee=ce.map(function(ye){return ye.lower}),re=(fe=ae)==="next"?"":b}te("next");var de=new de.Collection(de,function(){return We(z[0],ee[Z-1]+b)}),le=(de._ondirectionchange=function(ae){te(ae)},0);return de._addAlgorithm(function(ae,ce,ye){var pe=ae.key;if(typeof pe=="string"){var be=E(pe);if(f(be,ee,le))return!0;for(var Ce=null,$e=le;$e<Z;++$e){var Be=((Ae,Ke,De,Xe,Pe,at)=>{for(var lt=Math.min(Ae.length,Xe.length),pt=-1,wt=0;wt<lt;++wt){var Dn=Ke[wt];if(Dn!==Xe[wt])return Pe(Ae[wt],De[wt])<0?Ae.substr(0,wt)+De[wt]+De.substr(wt+1):Pe(Ae[wt],Xe[wt])<0?Ae.substr(0,wt)+Xe[wt]+De.substr(wt+1):0<=pt?Ae.substr(0,pt)+Ke[pt]+De.substr(pt+1):null;Pe(Ae[wt],Dn)<0&&(pt=wt)}return lt<Xe.length&&at==="next"?Ae+De.substr(Ae.length):lt<Ae.length&&at==="prev"?Ae.substr(0,De.length):pt<0?null:Ae.substr(0,pt)+Xe[pt]+De.substr(pt+1)})(pe,be,z[$e],ee[$e],I,fe);Be===null&&Ce===null?le=$e+1:(Ce===null||0<I(Ce,Be))&&(Ce=Be)}ce(Ce!==null?function(){ae.continue(Ce+re)}:ye)}return!1}),de}function We(l,f,g,b){return{type:2,lower:l,upper:f,lowerOpen:g,upperOpen:b}}function Pt(l){return{type:1,lower:l,upper:l}}Object.defineProperty(Nt.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Nt.prototype.between=function(l,f,g,b){g=g!==!1,b=b===!0;try{return 0<this._cmp(l,f)||this._cmp(l,f)===0&&(g||b)&&(!g||!b)?ge(this):new this.Collection(this,function(){return We(l,f,!g,!b)})}catch{return O(this,jt)}},Nt.prototype.equals=function(l){return l==null?O(this,jt):new this.Collection(this,function(){return Pt(l)})},Nt.prototype.above=function(l){return l==null?O(this,jt):new this.Collection(this,function(){return We(l,void 0,!0)})},Nt.prototype.aboveOrEqual=function(l){return l==null?O(this,jt):new this.Collection(this,function(){return We(l,void 0,!1)})},Nt.prototype.below=function(l){return l==null?O(this,jt):new this.Collection(this,function(){return We(void 0,l,!1,!0)})},Nt.prototype.belowOrEqual=function(l){return l==null?O(this,jt):new this.Collection(this,function(){return We(void 0,l)})},Nt.prototype.startsWith=function(l){return typeof l!="string"?O(this,xo):this.between(l,l+Jn,!0,!0)},Nt.prototype.startsWithIgnoreCase=function(l){return l===""?this.startsWith(l):ze(this,function(f,g){return f.indexOf(g[0])===0},[l],Jn)},Nt.prototype.equalsIgnoreCase=function(l){return ze(this,function(f,g){return f===g[0]},[l],"")},Nt.prototype.anyOfIgnoreCase=function(){var l=J.apply(q,arguments);return l.length===0?ge(this):ze(this,function(f,g){return g.indexOf(f)!==-1},l,"")},Nt.prototype.startsWithAnyOfIgnoreCase=function(){var l=J.apply(q,arguments);return l.length===0?ge(this):ze(this,function(f,g){return g.some(function(b){return f.indexOf(b)===0})},l,Jn)},Nt.prototype.anyOf=function(){var l,f,g=this,b=J.apply(q,arguments),N=this._cmp;try{b.sort(N)}catch{return O(this,jt)}return b.length===0?ge(this):((l=new this.Collection(this,function(){return We(b[0],b[b.length-1])}))._ondirectionchange=function(E){N=E==="next"?g._ascending:g._descending,b.sort(N)},f=0,l._addAlgorithm(function(E,I,z){for(var ee=E.key;0<N(ee,b[f]);)if(++f===b.length)return I(z),!1;return N(ee,b[f])===0||(I(function(){E.continue(b[f])}),!1)}),l)},Nt.prototype.notEqual=function(l){return this.inAnyRange([[-1/0,l],[l,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Nt.prototype.noneOf=function(){var l=J.apply(q,arguments);if(l.length===0)return new this.Collection(this);try{l.sort(this._ascending)}catch{return O(this,jt)}var f=l.reduce(function(g,b){return g?g.concat([[g[g.length-1][1],b]]):[[-1/0,b]]},null);return f.push([l[l.length-1],this.db._maxKey]),this.inAnyRange(f,{includeLowers:!1,includeUppers:!1})},Nt.prototype.inAnyRange=function(l,ye){var g=this,b=this._cmp,N=this._ascending,E=this._descending,I=this._min,z=this._max;if(l.length===0)return ge(this);if(!l.every(function(pe){return pe[0]!==void 0&&pe[1]!==void 0&&N(pe[0],pe[1])<=0}))return O(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",_e.InvalidArgument);var ee=!ye||ye.includeLowers!==!1,fe=ye&&ye.includeUppers===!0,re,Z=N;function te(pe,be){return Z(pe[0],be[0])}try{(re=l.reduce(function(pe,be){for(var Ce=0,$e=pe.length;Ce<$e;++Ce){var Be=pe[Ce];if(b(be[0],Be[1])<0&&0<b(be[1],Be[0])){Be[0]=I(Be[0],be[0]),Be[1]=z(Be[1],be[1]);break}}return Ce===$e&&pe.push(be),pe},[])).sort(te)}catch{return O(this,jt)}var de=0,le=fe?function(pe){return 0<N(pe,re[de][1])}:function(pe){return 0<=N(pe,re[de][1])},ae=ee?function(pe){return 0<E(pe,re[de][0])}:function(pe){return 0<=E(pe,re[de][0])},ce=le,ye=new this.Collection(this,function(){return We(re[0][0],re[re.length-1][1],!ee,!fe)});return ye._ondirectionchange=function(pe){Z=pe==="next"?(ce=le,N):(ce=ae,E),re.sort(te)},ye._addAlgorithm(function(pe,be,Ce){for(var $e,Be=pe.key;ce(Be);)if(++de===re.length)return be(Ce),!1;return!le($e=Be)&&!ae($e)||(g._cmp(Be,re[de][1])===0||g._cmp(Be,re[de][0])===0||be(function(){Z===N?pe.continue(re[de][0]):pe.continue(re[de][1])}),!1)}),ye},Nt.prototype.startsWithAnyOf=function(){var l=J.apply(q,arguments);return l.every(function(f){return typeof f=="string"})?l.length===0?ge(this):this.inAnyRange(l.map(function(f){return[f,f+Jn]})):O(this,"startsWithAnyOf() only works with strings")};var Bt=Nt;function Nt(){}function Dt(l){return vt(function(f){return Lt(f),l(f.target.error),!1})}function Lt(l){l.stopPropagation&&l.stopPropagation(),l.preventDefault&&l.preventDefault()}var Rn="storagemutated",ko="x-storagemutated-1",$n=wr(null,Rn),Qs=(bn.prototype._lock=function(){return $(!Ue.global),++this._reculock,this._reculock!==1||Ue.global||(Ue.lockOwnerFor=this),this},bn.prototype._unlock=function(){if($(!Ue.global),--this._reculock==0)for(Ue.global||(Ue.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var l=this._blockedFuncs.shift();try{zt(l[1],l[0])}catch{}}return this},bn.prototype._locked=function(){return this._reculock&&Ue.lockOwnerFor!==this},bn.prototype.create=function(l){var f=this;if(this.mode){var g=this.db.idbdb,b=this.db._state.dbOpenError;if($(!this.idbtrans),!l&&!g)switch(b&&b.name){case"DatabaseClosedError":throw new _e.DatabaseClosed(b);case"MissingAPIError":throw new _e.MissingAPI(b.message,b);default:throw new _e.OpenFailed(b)}if(!this.active)throw new _e.TransactionInactive;$(this._completion._state===null),(l=this.idbtrans=l||(this.db.core||g).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=vt(function(N){Lt(N),f._reject(l.error)}),l.onabort=vt(function(N){Lt(N),f.active&&f._reject(new _e.Abort(l.error)),f.active=!1,f.on("abort").fire(N)}),l.oncomplete=vt(function(){f.active=!1,f._resolve(),"mutatedParts"in l&&$n.storagemutated.fire(l.mutatedParts)})}return this},bn.prototype._promise=function(l,f,g){var b,N=this;return l==="readwrite"&&this.mode!=="readwrite"?Ft(new _e.ReadOnly("Transaction is readonly")):this.active?this._locked()?new Ve(function(E,I){N._blockedFuncs.push([function(){N._promise(l,f,g).then(E,I)},Ue])}):g?Cn(function(){var E=new Ve(function(I,z){N._lock();var ee=f(I,z,N);ee&&ee.then&&ee.then(I,z)});return E.finally(function(){return N._unlock()}),E._lib=!0,E}):((b=new Ve(function(E,I){var z=f(E,I,N);z&&z.then&&z.then(E,I)}))._lib=!0,b):Ft(new _e.TransactionInactive)},bn.prototype._root=function(){return this.parent?this.parent._root():this},bn.prototype.waitFor=function(l){var f,g=this._root(),b=Ve.resolve(l),N=(g._waitingFor?g._waitingFor=g._waitingFor.then(function(){return b}):(g._waitingFor=b,g._waitingQueue=[],f=g.idbtrans.objectStore(g.storeNames[0]),(function E(){for(++g._spinCount;g._waitingQueue.length;)g._waitingQueue.shift()();g._waitingFor&&(f.get(-1/0).onsuccess=E)})()),g._waitingFor);return new Ve(function(E,I){b.then(function(z){return g._waitingQueue.push(vt(E.bind(null,z)))},function(z){return g._waitingQueue.push(vt(I.bind(null,z)))}).finally(function(){g._waitingFor===N&&(g._waitingFor=null)})})},bn.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new _e.Abort))},bn.prototype.table=function(l){var f=this._memoizedTables||(this._memoizedTables={});if(x(f,l))return f[l];var g=this.schema[l];if(g)return(g=new this.db.Table(l,g,this)).core=this.db.core.table(l),f[l]=g;throw new _e.NotFound("Table "+l+" not part of transaction")},bn);function bn(){}function ro(l,f,g,b,N,E,I,z){return{name:l,keyPath:f,unique:g,multi:b,auto:N,compound:E,src:(g&&!I?"&":"")+(b?"*":"")+(N?"++":"")+Wi(f),type:z}}function Wi(l){return typeof l=="string"?l:l?"["+[].join.call(l,"+")+"]":""}function Yi(l,f,g){return{name:l,primKey:f,indexes:g,mappedClass:null,idxByName:(b=function(N){return[N.name,N]},g.reduce(function(N,E,I){return E=b(E,I),E&&(N[E[0]]=E[1]),N},{}))};var b}var Lr=function(l){try{return l.only([[]]),Lr=function(){return[[]]},[[]]}catch{return Lr=function(){return Jn},Jn}};function So(l){return l==null?function(){}:typeof l=="string"?(f=l).split(".").length===1?function(g){return g[f]}:function(g){return F(g,f)}:function(g){return F(g,l)};var f}function No(l){return[].slice.call(l)}var Js=0;function ks(l){return l==null?":id":typeof l=="string"?l:"[".concat(l.join("+"),"]")}function Wu(l,f,I){function b(ce){if(ce.type===3)return null;if(ce.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var de=ce.lower,le=ce.upper,ae=ce.lowerOpen,ce=ce.upperOpen;return de===void 0?le===void 0?null:f.upperBound(le,!!ce):le===void 0?f.lowerBound(de,!!ae):f.bound(de,le,!!ae,!!ce)}function N(te){var de,le,ae=te.name;return{name:ae,schema:te,mutate:function(ce){var ye=ce.trans,pe=ce.type,be=ce.keys,Ce=ce.values,$e=ce.range;return new Promise(function(Be,Ae){Be=vt(Be);var Ke=ye.objectStore(ae),De=Ke.keyPath==null,Xe=pe==="put"||pe==="add";if(!Xe&&pe!=="delete"&&pe!=="deleteRange")throw new Error("Invalid operation type: "+pe);var Pe,at=(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(at===0)return Be({numFailures:0,failures:{},results:[],lastResult:void 0});function lt(Mn){++Dn,Lt(Mn)}var pt=[],wt=[],Dn=0;if(pe==="deleteRange"){if($e.type===4)return Be({numFailures:Dn,failures:wt,results:[],lastResult:void 0});$e.type===3?pt.push(Pe=Ke.clear()):pt.push(Pe=Ke.delete(b($e)))}else{var De=Xe?De?[Ce,be]:[Ce,null]:[be,null],ft=De[0],Vt=De[1];if(Xe)for(var fn=0;fn<at;++fn)pt.push(Pe=Vt&&Vt[fn]!==void 0?Ke[pe](ft[fn],Vt[fn]):Ke[pe](ft[fn])),Pe.onerror=lt;else for(fn=0;fn<at;++fn)pt.push(Pe=Ke[pe](ft[fn])),Pe.onerror=lt}function ns(Mn){Mn=Mn.target.result,pt.forEach(function(Mo,To){return Mo.error!=null&&(wt[To]=Mo.error)}),Be({numFailures:Dn,failures:wt,results:pe==="delete"?be:pt.map(function(Mo){return Mo.result}),lastResult:Mn})}Pe.onerror=function(Mn){lt(Mn),ns(Mn)},Pe.onsuccess=ns})},getMany:function(ce){var ye=ce.trans,pe=ce.keys;return new Promise(function(be,Ce){be=vt(be);for(var $e,Be=ye.objectStore(ae),Ae=pe.length,Ke=new Array(Ae),De=0,Xe=0,Pe=function(pt){pt=pt.target,Ke[pt._pos]=pt.result,++Xe===De&&be(Ke)},at=Dt(Ce),lt=0;lt<Ae;++lt)pe[lt]!=null&&(($e=Be.get(pe[lt]))._pos=lt,$e.onsuccess=Pe,$e.onerror=at,++De);De===0&&be(Ke)})},get:function(ce){var ye=ce.trans,pe=ce.key;return new Promise(function(be,Ce){be=vt(be);var $e=ye.objectStore(ae).get(pe);$e.onsuccess=function(Be){return be(Be.target.result)},$e.onerror=Dt(Ce)})},query:(de=ee,le=fe,function(ce){return new Promise(function(ye,pe){ye=vt(ye);var be,Ce,$e,Be,at=ce.trans,Ae=ce.values,Ke=ce.limit,Pe=ce.query,De=(De=ce.direction)!=null?De:"next",Xe=Ke===1/0?void 0:Ke,lt=Pe.index,Pe=Pe.range,at=at.objectStore(ae),at=lt.isPrimaryKey?at:at.index(lt.name),lt=b(Pe);if(Ke===0)return ye({result:[]});le?(Pe={query:lt,count:Xe,direction:De},(be=Ae?at.getAll(Pe):at.getAllKeys(Pe)).onsuccess=function(pt){return ye({result:pt.target.result})},be.onerror=Dt(pe)):de&&De==="next"?((be=Ae?at.getAll(lt,Xe):at.getAllKeys(lt,Xe)).onsuccess=function(pt){return ye({result:pt.target.result})},be.onerror=Dt(pe)):(Ce=0,$e=!Ae&&"openKeyCursor"in at?at.openKeyCursor(lt,De):at.openCursor(lt,De),Be=[],$e.onsuccess=function(){var pt=$e.result;return!pt||(Be.push(Ae?pt.value:pt.primaryKey),++Ce===Ke)?ye({result:Be}):void pt.continue()},$e.onerror=Dt(pe))})}),openCursor:function(ce){var ye=ce.trans,pe=ce.values,be=ce.query,Ce=ce.reverse,$e=ce.unique;return new Promise(function(Be,Ae){Be=vt(Be);var Xe=be.index,Ke=be.range,De=ye.objectStore(ae),De=Xe.isPrimaryKey?De:De.index(Xe.name),Xe=Ce?$e?"prevunique":"prev":$e?"nextunique":"next",Pe=!pe&&"openKeyCursor"in De?De.openKeyCursor(b(Ke),Xe):De.openCursor(b(Ke),Xe);Pe.onerror=Dt(Ae),Pe.onsuccess=vt(function(at){var lt,pt,wt,Dn,ft=Pe.result;ft?(ft.___id=++Js,ft.done=!1,lt=ft.continue.bind(ft),pt=(pt=ft.continuePrimaryKey)&&pt.bind(ft),wt=ft.advance.bind(ft),Dn=function(){throw new Error("Cursor not stopped")},ft.trans=ye,ft.stop=ft.continue=ft.continuePrimaryKey=ft.advance=function(){throw new Error("Cursor not started")},ft.fail=vt(Ae),ft.next=function(){var Vt=this,fn=1;return this.start(function(){return fn--?Vt.continue():Vt.stop()}).then(function(){return Vt})},ft.start=function(Vt){function fn(){if(Pe.result)try{Vt()}catch(Mn){ft.fail(Mn)}else ft.done=!0,ft.start=function(){throw new Error("Cursor behind last entry")},ft.stop()}var ns=new Promise(function(Mn,Mo){Mn=vt(Mn),Pe.onerror=Dt(Mo),ft.fail=Mo,ft.stop=function(To){ft.stop=ft.continue=ft.continuePrimaryKey=ft.advance=Dn,Mn(To)}});return Pe.onsuccess=vt(function(Mn){Pe.onsuccess=fn,fn()}),ft.continue=lt,ft.continuePrimaryKey=pt,ft.advance=wt,fn(),ns},Be(ft)):Be(null)},Ae)})},count:function(ce){var ye=ce.query,pe=ce.trans,be=ye.index,Ce=ye.range;return new Promise(function($e,Be){var Ae=pe.objectStore(ae),Ae=be.isPrimaryKey?Ae:Ae.index(be.name),Ke=b(Ce),Ke=Ke?Ae.count(Ke):Ae.count();Ke.onsuccess=vt(function(De){return $e(De.target.result)}),Ke.onerror=Dt(Be)})}}}E=I,z=No((I=l).objectStoreNames),re=0<z.length?E.objectStore(z[0]):{};var E,I={schema:{name:I.name,tables:z.map(function(te){return E.objectStore(te)}).map(function(te){var de=te.keyPath,le=te.autoIncrement,ce=m(de),ae={},ce={name:te.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:de==null,compound:ce,keyPath:de,autoIncrement:le,unique:!0,extractKey:So(de)},indexes:No(te.indexNames).map(function(ye){return te.index(ye)}).map(function(Ce){var $e=Ce.name,pe=Ce.unique,be=Ce.multiEntry,Ce=Ce.keyPath,$e={name:$e,compound:m(Ce),keyPath:Ce,unique:pe,multiEntry:be,extractKey:So(Ce)};return ae[ks(Ce)]=$e}),getIndexByKeyPath:function(ye){return ae[ks(ye)]}};return ae[":id"]=ce.primaryKey,de!=null&&(ae[ks(de)]=ce.primaryKey),ce})},hasGetAll:0<z.length&&"getAll"in re&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604),hasIdb3Features:"getAllRecords"in re},z=I.schema,ee=I.hasGetAll,fe=I.hasIdb3Features,re=z.tables.map(N),Z={};return re.forEach(function(te){return Z[te.name]=te}),{stack:"dbcore",transaction:l.transaction.bind(l),table:function(te){if(Z[te])return Z[te];throw new Error("Table '".concat(te,"' not found"))},MIN_KEY:-1/0,MAX_KEY:Lr(f),schema:z}}function Xi(l,f,g,b){return g=g.IDBKeyRange,f=Wu(f,g,b),{dbcore:l.dbcore.reduce(function(N,E){return E=E.create,i(i({},N),E(N))},f)}}function _o(l,f){var g=f.db,g=Xi(l._middlewares,g,l._deps,f);l.core=g.dbcore,l.tables.forEach(function(b){var N=b.name;l.core.schema.tables.some(function(E){return E.name===N})&&(b.core=l.core.table(N),l[N]instanceof l.Table)&&(l[N].core=b.core)})}function Yo(l,f,g,b){g.forEach(function(N){var E=b[N];f.forEach(function(I){var z=(function ee(fe,re){return A(fe,re)||(fe=w(fe))&&ee(fe,re)})(I,N);(!z||"value"in z&&z.value===void 0)&&(I===l.Transaction.prototype||I instanceof l.Transaction?j(I,N,{get:function(){return this.table(N)},set:function(ee){_(this,N,{value:ee,writable:!0,configurable:!0,enumerable:!0})}}):I[N]=new l.Table(N,E))})})}function Gs(l,f){f.forEach(function(g){for(var b in g)g[b]instanceof l.Table&&delete g[b]})}function oo(l,f){return l._cfg.version-f._cfg.version}function Qi(l,f,g,b){var N=l._dbSchema,E=(g.objectStoreNames.contains("$meta")&&!N.$meta&&(N.$meta=Yi("$meta",ti("")[0],[]),l._storeNames.push("$meta")),l._createTransaction("readwrite",l._storeNames,N)),I=(E.create(g),E._completion.catch(b),E._reject.bind(E)),z=Ue.transless||Ue;Cn(function(){if(Ue.trans=E,Ue.transless=z,f!==0)return _o(l,g),fe=f,((ee=E).storeNames.includes("$meta")?ee.table("$meta").get("version").then(function(re){return re??fe}):Ve.resolve(fe)).then(function(ce){var Z=l,te=ce,de=E,le=g,ae=[],ce=Z._versions,ye=Z._dbSchema=kn(0,Z.idbdb,le);return(ce=ce.filter(function(pe){return pe._cfg.version>=te})).length===0?Ve.resolve():(ce.forEach(function(pe){ae.push(function(){var be,Ce,$e,Be=ye,Ae=pe._cfg.dbschema,Ke=(Rr(Z,Be,le),Rr(Z,Ae,le),ye=Z._dbSchema=Ae,ei(Be,Ae)),De=(Ke.add.forEach(function(Xe){Xo(le,Xe[0],Xe[1].primKey,Xe[1].indexes)}),Ke.change.forEach(function(Xe){if(Xe.recreate)throw new _e.Upgrade("Not yet support for changing primary key");var Pe=le.objectStore(Xe.name);Xe.add.forEach(function(at){return Ns(Pe,at)}),Xe.change.forEach(function(at){Pe.deleteIndex(at.name),Ns(Pe,at)}),Xe.del.forEach(function(at){return Pe.deleteIndex(at)})}),pe._cfg.contentUpgrade);if(De&&pe._cfg.version>te)return _o(Z,le),de._memoizedTables={},be=ue(Ae),Ke.del.forEach(function(Xe){be[Xe]=Be[Xe]}),Gs(Z,[Z.Transaction.prototype]),Yo(Z,[Z.Transaction.prototype],d(be),be),de.schema=be,(Ce=D(De))&&Pn(),Ae=Ve.follow(function(){var Xe;($e=De(de))&&Ce&&(Xe=an.bind(null,null),$e.then(Xe,Xe))}),$e&&typeof $e.then=="function"?Ve.resolve($e):Ae.then(function(){return $e})}),ae.push(function(be){var Ce,$e,Be=pe._cfg.dbschema;Ce=Be,$e=be,[].slice.call($e.db.objectStoreNames).forEach(function(Ae){return Ce[Ae]==null&&$e.db.deleteObjectStore(Ae)}),Gs(Z,[Z.Transaction.prototype]),Yo(Z,[Z.Transaction.prototype],Z._storeNames,Z._dbSchema),de.schema=Z._dbSchema}),ae.push(function(be){Z.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(Z.idbdb.version/10)===pe._cfg.version?(Z.idbdb.deleteObjectStore("$meta"),delete Z._dbSchema.$meta,Z._storeNames=Z._storeNames.filter(function(Ce){return Ce!=="$meta"})):be.objectStore("$meta").put(pe._cfg.version,"version"))})}),(function pe(){return ae.length?Ve.resolve(ae.shift()(de.idbtrans)).then(pe):Ve.resolve()})().then(function(){Ss(ye,le)}))}).catch(I);var ee,fe;d(N).forEach(function(re){Xo(g,re,N[re].primKey,N[re].indexes)}),_o(l,g),Ve.follow(function(){return l.on.populate.fire(E)}).catch(I)})}function Zs(l,f){Ss(l._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 g=kn(0,l.idbdb,f);Rr(l,l._dbSchema,f);for(var b=0,N=ei(g,l._dbSchema).change;b<N.length;b++){var E=(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 z=f.objectStore(I.name);I.add.forEach(function(ee){At&&console.debug("Dexie upgrade patch: Creating missing index ".concat(I.name,".").concat(ee.src)),Ns(z,ee)})})(N[b]);if(typeof E=="object")return E.value}}function ei(l,f){var g,b={del:[],add:[],change:[]};for(g in l)f[g]||b.del.push(g);for(g in f){var N=l[g],E=f[g];if(N){var I={name:g,def:E,recreate:!1,del:[],add:[],change:[]};if(""+(N.primKey.keyPath||"")!=""+(E.primKey.keyPath||"")||N.primKey.auto!==E.primKey.auto)I.recreate=!0,b.change.push(I);else{var z=N.idxByName,ee=E.idxByName,fe=void 0;for(fe in z)ee[fe]||I.del.push(fe);for(fe in ee){var re=z[fe],Z=ee[fe];re?re.src!==Z.src&&I.change.push(Z):I.add.push(Z)}(0<I.del.length||0<I.add.length||0<I.change.length)&&b.change.push(I)}}else b.add.push([g,E])}return b}function Xo(l,f,g,b){var N=l.db.createObjectStore(f,g.keyPath?{keyPath:g.keyPath,autoIncrement:g.auto}:{autoIncrement:g.auto});b.forEach(function(E){return Ns(N,E)})}function Ss(l,f){d(l).forEach(function(g){f.db.objectStoreNames.contains(g)||(At&&console.debug("Dexie: Creating missing table",g),Xo(f,g,l[g].primKey,l[g].indexes))})}function Ns(l,f){l.createIndex(f.name,f.keyPath,{unique:f.unique,multiEntry:f.multi})}function kn(l,f,g){var b={};return U(f.objectStoreNames,0).forEach(function(N){for(var E=g.objectStore(N),I=ro(Wi(fe=E.keyPath),fe||"",!0,!1,!!E.autoIncrement,fe&&typeof fe!="string",!0),z=[],ee=0;ee<E.indexNames.length;++ee){var re=E.index(E.indexNames[ee]),fe=re.keyPath,re=ro(re.name,fe,!!re.unique,!!re.multiEntry,!1,fe&&typeof fe!="string",!1);z.push(re)}b[N]=Yi(N,I,z)}),b}function Rr(l,f,g){for(var b=g.db.objectStoreNames,N=0;N<b.length;++N){var E=b[N],I=g.objectStore(E);l._hasGetAll="getAll"in I;for(var z=0;z<I.indexNames.length;++z){var ee,fe=I.indexNames[z],re=I.index(fe).keyPath,re=typeof re=="string"?re:"["+U(re).join("+")+"]";f[E]&&(ee=f[E].idxByName[re])&&(ee.name=fe,delete f[E].idxByName[re],f[E].idxByName[fe]=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&&(l._hasGetAll=!1)}function ti(l){return l.split(",").map(function(f,g){var N=f.split(":"),b=(b=N[1])==null?void 0:b.trim(),N=(f=N[0].trim()).replace(/([&*]|\+\+)/g,""),E=/^\[/.test(N)?N.match(/^\[(.*)\]$/)[1].split("+"):N;return ro(N,E||null,/\&/.test(f),/\*/.test(f),/\+\+/.test(f),m(E),g===0,b)})}Qo.prototype._createTableSchema=Yi,Qo.prototype._parseIndexSyntax=ti,Qo.prototype._parseStoresSpec=function(l,f){var g=this;d(l).forEach(function(b){if(l[b]!==null){var N=g._parseIndexSyntax(l[b]),E=N.shift();if(!E)throw new _e.Schema("Invalid schema for table "+b+": "+l[b]);if(E.unique=!0,E.multi)throw new _e.Schema("Primary key cannot be multiEntry*");N.forEach(function(I){if(I.auto)throw new _e.Schema("Only primary key can be marked as autoIncrement (++)");if(!I.keyPath)throw new _e.Schema("Index must have a name and cannot be an empty string")}),E=g._createTableSchema(b,E,N),f[b]=E}})},Qo.prototype.stores=function(g){var f=this.db,g=(this._cfg.storesSource=this._cfg.storesSource?y(this._cfg.storesSource,g):g,f._versions),b={},N={};return g.forEach(function(E){y(b,E._cfg.storesSource),N=E._cfg.dbschema={},E._parseStoresSpec(b,N)}),f._dbSchema=N,Gs(f,[f._allTables,f,f.Transaction.prototype]),Yo(f,[f._allTables,f,f.Transaction.prototype,this._cfg.tables],d(N),N),f._storeNames=d(N),this},Qo.prototype.upgrade=function(l){return this._cfg.contentUpgrade=en(this._cfg.contentUpgrade||Fe,l),this};var _s=Qo;function Qo(){}var jo=(()=>{var l,f,g;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(l=new Set,f=new FinalizationRegistry(function(b){l.delete(b)}),{toArray:function(){return Array.from(l).map(function(b){return b.deref()}).filter(function(b){return b!==void 0})},add:function(b){var N=new WeakRef(b._novip);l.add(N),f.register(b._novip,N,N),l.size>b._options.maxConnections&&(N=l.values().next().value,l.delete(N),f.unregister(N))},remove:function(b){if(b)for(var N=l.values(),E=N.next();!E.done;){var I=E.value;if(I.deref()===b._novip)return l.delete(I),void f.unregister(I);E=N.next()}}}):(g=[],{toArray:function(){return g},add:function(b){g.push(b._novip)},remove:function(b){b&&(b=g.indexOf(b._novip))!==-1&&g.splice(b,1)}})})();function js(l,f){var g=l._dbNamesDB;return g||(g=l._dbNamesDB=new zr(xr,{addons:[],indexedDB:l,IDBKeyRange:f})).version(1).stores({dbnames:"name"}),g.table("dbnames")}function Eo(l){return l&&typeof l.databases=="function"}function Jo(l){return Cn(function(){return Ue.letThrough=!0,l()})}function ni(l){return!("from"in l)}var Sn=function(l,f){var g;if(!this)return g=new Sn,l&&"d"in l&&y(g,l),g;y(this,arguments.length?{d:1,from:l,to:1<arguments.length?f:l}:{d:0})};function Es(l,f,g){var b=yt(f,g);if(!isNaN(b)){if(0<b)throw RangeError();if(ni(l))return y(l,{from:f,to:g,d:1});var b=l.l,N=l.r;if(yt(g,l.from)<0)return b?Es(b,f,g):l.l={from:f,to:g,d:1,l:null,r:null},Za(l);if(0<yt(f,l.to))return N?Es(N,f,g):l.r={from:f,to:g,d:1,l:null,r:null},Za(l);yt(f,l.from)<0&&(l.from=f,l.l=null,l.d=N?N.d+1:1),0<yt(g,l.to)&&(l.to=g,l.r=null,l.d=l.l?l.l.d+1:1),f=!l.r,b&&!l.l&&Cs(l,b),N&&f&&Cs(l,N)}}function Cs(l,f){ni(f)||(function g(b,N){var E=N.from,I=N.l,z=N.r;Es(b,E,N.to),I&&g(b,I),z&&g(b,z)})(l,f)}function ri(l,f){var g=oi(f),b=g.next();if(!b.done)for(var N=b.value,E=oi(l),I=E.next(N.from),z=I.value;!b.done&&!I.done;){if(yt(z.from,N.to)<=0&&0<=yt(z.to,N.from))return!0;yt(N.from,z.from)<0?N=(b=g.next(z.from)).value:z=(I=E.next(N.from)).value}return!1}function oi(l){var f=ni(l)?null:{s:0,n:l};return{next:function(g){for(var b=0<arguments.length;f;)switch(f.s){case 0:if(f.s=1,b)for(;f.n.l&&yt(g,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,!b||yt(g,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 Za(l){var f,g,b,N=(((N=l.r)==null?void 0:N.d)||0)-(((N=l.l)==null?void 0:N.d)||0),N=1<N?"r":N<-1?"l":"";N&&(f=N=="r"?"l":"r",g=i({},l),b=l[N],l.from=b.from,l.to=b.to,l[N]=b[N],g[N]=b[f],(l[f]=g).d=el(g)),l.d=el(l)}function el(g){var f=g.r,g=g.l;return(f?g?Math.max(f.d,g.d):f.d:g?g.d:0)+1}function si(l,f){return d(f).forEach(function(g){l[g]?Cs(l[g],f[g]):l[g]=(function b(N){var E,I,z={};for(E in N)x(N,E)&&(I=N[E],z[E]=!I||typeof I!="object"||Y.has(I.constructor)?I:b(I));return z})(f[g])}),l}function Ji(l,f){return l.all||f.all||Object.keys(l).some(function(g){return f[g]&&ri(f[g],l[g])})}k(Sn.prototype,((Mt={add:function(l){return Cs(this,l),this},addKey:function(l){return Es(this,l,l),this},addKeys:function(l){var f=this;return l.forEach(function(g){return Es(f,g,g)}),this},hasKey:function(l){var f=oi(this).next(l).value;return f&&yt(f.from,l)<=0&&0<=yt(f.to,l)}})[G]=function(){return oi(this)},Mt));var so={},Gi={},Zi=!1;function ii(l){si(Gi,l),Zi||(Zi=!0,setTimeout(function(){Zi=!1,ea(Gi,!(Gi={}))},0))}function ea(l,f){f===void 0&&(f=!1);var g=new Set;if(l.all)for(var b=0,N=Object.values(so);b<N.length;b++)ai(z=N[b],l,g,f);else for(var E in l){var I,z,E=/^idb\:\/\/(.*)\/(.*)\//.exec(E);E&&(I=E[1],E=E[2],z=so["idb://".concat(I,"/").concat(E)])&&ai(z,l,g,f)}g.forEach(function(ee){return ee()})}function ai(l,f,g,b){for(var N=[],E=0,I=Object.entries(l.queries.query);E<I.length;E++){for(var z=I[E],ee=z[0],fe=[],re=0,Z=z[1];re<Z.length;re++){var te=Z[re];Ji(f,te.obsSet)?te.subscribers.forEach(function(ce){return g.add(ce)}):b&&fe.push(te)}b&&N.push([ee,fe])}if(b)for(var de=0,le=N;de<le.length;de++){var ae=le[de],ee=ae[0],fe=ae[1];l.queries.query[ee]=fe}}function Yu(l){var f=l._state,g=l._deps.indexedDB;if(f.isBeingOpened||l.idbdb)return f.dbReadyPromise.then(function(){return f.dbOpenError?Ft(f.dbOpenError):l});f.isBeingOpened=!0,f.dbOpenError=null,f.openComplete=!1;var b=f.openCanceller,N=Math.round(10*l.verno),E=!1;function I(){if(f.openCanceller!==b)throw new _e.DatabaseClosed("db.open() was cancelled")}function z(){return new Ve(function(te,de){if(I(),!g)throw new _e.MissingAPI;var le=l.name,ae=f.autoSchema||!N?g.open(le):g.open(le,N);if(!ae)throw new _e.MissingAPI;ae.onerror=Dt(de),ae.onblocked=vt(l._fireOnBlocked),ae.onupgradeneeded=vt(function(ce){var ye;re=ae.transaction,f.autoSchema&&!l._options.allowEmptyDB?(ae.onerror=Lt,re.abort(),ae.result.close(),(ye=g.deleteDatabase(le)).onsuccess=ye.onerror=vt(function(){de(new _e.NoSuchDatabase("Database ".concat(le," doesnt exist")))})):(re.onerror=Dt(de),ye=ce.oldVersion>Math.pow(2,62)?0:ce.oldVersion,Z=ye<1,l.idbdb=ae.result,E&&Zs(l,re),Qi(l,ye/10,re,de))},de),ae.onsuccess=vt(function(){re=null;var ce,ye,pe,be,Ce,$e,Be=l.idbdb=ae.result,Ae=U(Be.objectStoreNames);if(0<Ae.length)try{var Ke=Be.transaction((Ce=Ae).length===1?Ce[0]:Ce,"readonly");if(f.autoSchema)$e=Be,be=Ke,(pe=l).verno=$e.version/10,be=pe._dbSchema=kn(0,$e,be),pe._storeNames=U($e.objectStoreNames,0),Yo(pe,[pe._allTables],d(be),be);else if(Rr(l,l._dbSchema,Ke),ye=Ke,((ye=ei(kn(0,(ce=l).idbdb,ye),ce._dbSchema)).add.length||ye.change.some(function(De){return De.add.length||De.change.length}))&&!E)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."),Be.close(),N=Be.version+1,E=!0,te(z());_o(l,Ke)}catch{}jo.add(l),Be.onversionchange=vt(function(De){f.vcFired=!0,l.on("versionchange").fire(De)}),Be.onclose=vt(function(){l.close({disableAutoOpen:!1})}),Z&&(Ae=l._deps,Ce=le,Eo($e=Ae.indexedDB)||Ce===xr||js($e,Ae.IDBKeyRange).put({name:Ce}).catch(Fe)),te()},de)}).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()"),z();break;case"VersionError":if(0<N)return N=0,z()}return Ve.reject(te)})}var ee,fe=f.dbReadyResolve,re=null,Z=!1;return Ve.race([b,(typeof navigator>"u"?Ve.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(te){function de(){return indexedDB.databases().finally(te)}ee=setInterval(de,100),de()}).finally(function(){return clearInterval(ee)}):Promise.resolve()).then(z)]).then(function(){return I(),f.onReadyBeingFired=[],Ve.resolve(Jo(function(){return l.on.ready.fire(l.vip)})).then(function te(){var de;if(0<f.onReadyBeingFired.length)return de=f.onReadyBeingFired.reduce(en,Fe),f.onReadyBeingFired=[],Ve.resolve(Jo(function(){return de(l.vip)})).then(te)})}).finally(function(){f.openCanceller===b&&(f.onReadyBeingFired=null,f.isBeingOpened=!1)}).catch(function(te){f.dbOpenError=te;try{re&&re.abort()}catch{}return b===f.openCanceller&&l._close(),Ft(te)}).finally(function(){f.openComplete=!0,fe()}).then(function(){var te;return Z&&(te={},l.tables.forEach(function(de){de.schema.indexes.forEach(function(le){le.name&&(te["idb://".concat(l.name,"/").concat(de.name,"/").concat(le.name)]=new Sn(-1/0,[[[]]]))}),te["idb://".concat(l.name,"/").concat(de.name,"/")]=te["idb://".concat(l.name,"/").concat(de.name,"/:dels")]=new Sn(-1/0,[[[]]])}),$n(Rn).fire(te),ea(te,!0)),l})}function ta(l){function f(E){return l.next(E)}var g=N(f),b=N(function(E){return l.throw(E)});function N(E){return function(z){var z=E(z),ee=z.value;return z.done?ee:ee&&typeof ee.then=="function"?ee.then(g,b):m(ee)?Promise.all(ee).then(g,b):g(ee)}}return N(f)()}function li(l,f,g){for(var b=m(l)?l.slice():[l],N=0;N<g;++N)b.push(f);return b}var tl={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(l){return i(i({},l),{table:function(b){var g=l.table(b),b=g.schema,N={},E=[];function I(te,de,le){var pe=ks(te),ae=N[pe]=N[pe]||[],ce=te==null?0:typeof te=="string"?1:te.length,ye=0<de,pe=i(i({},le),{name:ye?"".concat(pe,"(virtual-from:").concat(le.name,")"):le.name,lowLevelIndex:le,isVirtual:ye,keyTail:de,keyLength:ce,extractKey:So(te),unique:!ye&&le.unique});return ae.push(pe),pe.isPrimaryKey||E.push(pe),1<ce&&I(ce===2?te[0]:te.slice(0,ce-1),de+1,le),ae.sort(function(be,Ce){return be.keyTail-Ce.keyTail}),pe}var z=I(b.primaryKey.keyPath,0,b.primaryKey);N[":id"]=[z];for(var ee=0,fe=b.indexes;ee<fe.length;ee++){var re=fe[ee];I(re.keyPath,0,re)}function Z(te){var de,le=te.query.index;return le.isVirtual?i(i({},te),{query:{index:le.lowLevelIndex,range:(de=te.query.range,le=le.keyTail,{type:de.type===1?2:de.type,lower:li(de.lower,de.lowerOpen?l.MAX_KEY:l.MIN_KEY,le),lowerOpen:!0,upper:li(de.upper,de.upperOpen?l.MIN_KEY:l.MAX_KEY,le),upperOpen:!0})}}):te}return i(i({},g),{schema:i(i({},b),{primaryKey:z,indexes:E,getIndexByKeyPath:function(te){return(te=N[ks(te)])&&te[0]}}),count:function(te){return g.count(Z(te))},query:function(te){return g.query(Z(te))},openCursor:function(te){var de=te.query.index,le=de.keyTail,ae=de.keyLength;return de.isVirtual?g.openCursor(Z(te)).then(function(ye){return ye&&ce(ye)}):g.openCursor(te);function ce(ye){return Object.create(ye,{continue:{value:function(pe){pe!=null?ye.continue(li(pe,te.reverse?l.MAX_KEY:l.MIN_KEY,le)):te.unique?ye.continue(ye.key.slice(0,ae).concat(te.reverse?l.MIN_KEY:l.MAX_KEY,le)):ye.continue()}},continuePrimaryKey:{value:function(pe,be){ye.continuePrimaryKey(li(pe,l.MAX_KEY,le),be)}},primaryKey:{get:function(){return ye.primaryKey}},key:{get:function(){var pe=ye.key;return ae===1?pe[0]:pe.slice(0,ae)}},value:{get:function(){return ye.value}}})}}})}})}};function na(l,f,g,b){return g=g||{},b=b||"",d(l).forEach(function(N){var E,I,z;x(f,N)?(E=l[N],I=f[N],typeof E=="object"&&typeof I=="object"&&E&&I?(z=ie(E))!==ie(I)?g[b+N]=f[N]:z==="Object"?na(E,I,g,b+N+"."):E!==I&&(g[b+N]=f[N]):E!==I&&(g[b+N]=f[N])):g[b+N]=void 0}),d(f).forEach(function(N){x(l,N)||(g[b+N]=f[N])}),g}function ra(l,f){return f.type==="delete"?f.keys:f.keys||f.values.map(l.extractKey)}var Xu={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(l){return i(i({},l),{table:function(f){var g=l.table(f),b=g.schema.primaryKey;return i(i({},g),{mutate:function(N){var E=Ue.trans,I=E.table(f).hook,z=I.deleting,ee=I.creating,fe=I.updating;switch(N.type){case"add":if(ee.fire===Fe)break;return E._promise("readwrite",function(){return re(N)},!0);case"put":if(ee.fire===Fe&&fe.fire===Fe)break;return E._promise("readwrite",function(){return re(N)},!0);case"delete":if(z.fire===Fe)break;return E._promise("readwrite",function(){return re(N)},!0);case"deleteRange":if(z.fire===Fe)break;return E._promise("readwrite",function(){return(function Z(te,de,le){return g.query({trans:te,values:!1,query:{index:b,range:de},limit:le}).then(function(ae){var ce=ae.result;return re({type:"delete",keys:ce,trans:te}).then(function(ye){return 0<ye.numFailures?Promise.reject(ye.failures[0]):ce.length<le?{failures:[],numFailures:0,lastResult:void 0}:Z(te,i(i({},de),{lower:ce[ce.length-1],lowerOpen:!0}),le)})})})(N.trans,N.range,1e4)},!0)}return g.mutate(N);function re(Z){var te,de,le,ae=Ue.trans,ce=Z.keys||ra(b,Z);if(ce)return(Z=Z.type==="add"||Z.type==="put"?i(i({},Z),{keys:ce}):i({},Z)).type!=="delete"&&(Z.values=a([],Z.values)),Z.keys&&(Z.keys=a([],Z.keys)),te=g,le=ce,((de=Z).type==="add"?Promise.resolve([]):te.getMany({trans:de.trans,keys:le,cache:"immutable"})).then(function(ye){var pe=ce.map(function(be,Ce){var $e,Be,Ae,Ke=ye[Ce],De={onerror:null,onsuccess:null};return Z.type==="delete"?z.fire.call(De,be,Ke,ae):Z.type==="add"||Ke===void 0?($e=ee.fire.call(De,be,Z.values[Ce],ae),be==null&&$e!=null&&(Z.keys[Ce]=be=$e,b.outbound||W(Z.values[Ce],b.keyPath,be))):($e=na(Ke,Z.values[Ce]),(Be=fe.fire.call(De,$e,be,Ke,ae))&&(Ae=Z.values[Ce],Object.keys(Be).forEach(function(Xe){x(Ae,Xe)?Ae[Xe]=Be[Xe]:W(Ae,Xe,Be[Xe])}))),De});return g.mutate(Z).then(function(be){for(var Ce=be.failures,$e=be.results,Be=be.numFailures,be=be.lastResult,Ae=0;Ae<ce.length;++Ae){var Ke=($e||ce)[Ae],De=pe[Ae];Ke==null?De.onerror&&De.onerror(Ce[Ae]):De.onsuccess&&De.onsuccess(Z.type==="put"&&ye[Ae]?Z.values[Ae]:Ke)}return{failures:Ce,results:$e,numFailures:Be,lastResult:be}}).catch(function(be){return pe.forEach(function(Ce){return Ce.onerror&&Ce.onerror(be)}),Promise.reject(be)})});throw new Error("Keys missing")}}})}})}};function nl(l,f,g){try{if(!f||f.keys.length<l.length)return null;for(var b=[],N=0,E=0;N<f.keys.length&&E<l.length;++N)yt(f.keys[N],l[E])===0&&(b.push(g?ve(f.values[N]):f.values[N]),++E);return b.length===l.length?b:null}catch{return null}}var Qu={stack:"dbcore",level:-1,create:function(l){return{table:function(f){var g=l.table(f);return i(i({},g),{getMany:function(b){var N;return b.cache?(N=nl(b.keys,b.trans._cache,b.cache==="clone"))?Ve.resolve(N):g.getMany(b).then(function(E){return b.trans._cache={keys:b.keys,values:b.cache==="clone"?ve(E):E},E}):g.getMany(b)},mutate:function(b){return b.type!=="add"&&(b.trans._cache=null),g.mutate(b)}})}}}};function rl(l,f){return l.trans.mode==="readonly"&&!!l.subscr&&!l.trans.explicit&&l.trans.db._options.cache!=="disabled"&&!f.schema.primaryKey.outbound}function ol(l,f){switch(l){case"query":return f.values&&!f.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var oa={stack:"dbcore",level:0,name:"Observability",create:function(l){var f=l.schema.name,g=new Sn(l.MIN_KEY,l.MAX_KEY);return i(i({},l),{transaction:function(b,N,E){if(Ue.subscr&&N!=="readonly")throw new _e.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Ue.querier));return l.transaction(b,N,E)},table:function(b){function N(ce){var ae,ce=ce.query;return[ae=ce.index,new Sn((ae=(ce=ce.range).lower)!=null?ae:l.MIN_KEY,(ae=ce.upper)!=null?ae:l.MAX_KEY)]}var E=l.table(b),I=E.schema,z=I.primaryKey,ee=I.indexes,fe=z.extractKey,re=z.outbound,Z=z.autoIncrement&&ee.filter(function(le){return le.compound&&le.keyPath.includes(z.keyPath)}),te=i(i({},E),{mutate:function(le){function ae(Pe){return Pe="idb://".concat(f,"/").concat(b,"/").concat(Pe),Ce[Pe]||(Ce[Pe]=new Sn)}var ce,ye,pe,be=le.trans,Ce=le.mutatedParts||(le.mutatedParts={}),$e=ae(""),Be=ae(":dels"),Ae=le.type,De=le.type==="deleteRange"?[le.range]:le.type==="delete"?[le.keys]:le.values.length<50?[ra(z,le).filter(function(Pe){return Pe}),le.values]:[],Ke=De[0],De=De[1],Xe=le.trans._cache;return m(Ke)?($e.addKeys(Ke),(Ae=Ae==="delete"||Ke.length===De.length?nl(Ke,Xe):null)||Be.addKeys(Ke),(Ae||De)&&(ce=ae,ye=Ae,pe=De,I.indexes.forEach(function(Pe){var at=ce(Pe.name||"");function lt(wt){return wt!=null?Pe.extractKey(wt):null}function pt(wt){Pe.multiEntry&&m(wt)?wt.forEach(function(Dn){return at.addKey(Dn)}):at.addKey(wt)}(ye||pe).forEach(function(wt,Vt){var ft=ye&&lt(ye[Vt]),Vt=pe&&lt(pe[Vt]);yt(ft,Vt)!==0&&(ft!=null&&pt(ft),Vt!=null)&&pt(Vt)})}))):Ke?(De={from:(Xe=Ke.lower)!=null?Xe:l.MIN_KEY,to:(Ae=Ke.upper)!=null?Ae:l.MAX_KEY},Be.add(De),$e.add(De)):($e.add(g),Be.add(g),I.indexes.forEach(function(Pe){return ae(Pe.name).add(g)})),E.mutate(le).then(function(Pe){return!Ke||le.type!=="add"&&le.type!=="put"||($e.addKeys(Pe.results),Z&&Z.forEach(function(at){for(var lt=le.values.map(function(ft){return at.extractKey(ft)}),pt=at.keyPath.findIndex(function(ft){return ft===z.keyPath}),wt=0,Dn=Pe.results.length;wt<Dn;++wt)lt[wt][pt]=Pe.results[wt];ae(at.name).addKeys(lt)})),be.mutatedParts=si(be.mutatedParts||{},Ce),Pe})}}),de={get:function(le){return[z,new Sn(le.key)]},getMany:function(le){return[z,new Sn().addKeys(le.keys)]},count:N,query:N,openCursor:N};return d(de).forEach(function(le){te[le]=function(ae){var ce=Ue.subscr,ye=!!ce,pe=rl(Ue,E)&&ol(le,ae)?ae.obsSet={}:ce;if(ye){var be,ce=function(De){return De="idb://".concat(f,"/").concat(b,"/").concat(De),pe[De]||(pe[De]=new Sn)},Ce=ce(""),$e=ce(":dels"),ye=de[le](ae),Be=ye[0],ye=ye[1];if((le==="query"&&Be.isPrimaryKey&&!ae.values?$e:ce(Be.name||"")).add(ye),!Be.isPrimaryKey){if(le!=="count")return be=le==="query"&&re&&ae.values&&E.query(i(i({},ae),{values:!1})),E[le].apply(this,arguments).then(function(De){if(le==="query"){if(re&&ae.values)return be.then(function(lt){return lt=lt.result,Ce.addKeys(lt),De});var Xe=ae.values?De.result.map(fe):De.result;(ae.values?Ce:$e).addKeys(Xe)}else{var Pe,at;if(le==="openCursor")return at=ae.values,(Pe=De)&&Object.create(Pe,{key:{get:function(){return $e.addKey(Pe.primaryKey),Pe.key}},primaryKey:{get:function(){var lt=Pe.primaryKey;return $e.addKey(lt),lt}},value:{get:function(){return at&&Ce.addKey(Pe.primaryKey),Pe.value}}})}return De});$e.add(g)}}return E[le].apply(this,arguments)}}),te}})}};function Go(l,f,g){var b;return g.numFailures===0?f:f.type==="deleteRange"||(b=f.keys?f.keys.length:"values"in f&&f.values?f.values.length:1,g.numFailures===b)?null:(b=i({},f),m(b.keys)&&(b.keys=b.keys.filter(function(N,E){return!(E in g.failures)})),"values"in b&&m(b.values)&&(b.values=b.values.filter(function(N,E){return!(E in g.failures)})),b)}function sa(l,f){return g=l,((b=f).lower===void 0||(b.lowerOpen?0<yt(g,b.lower):0<=yt(g,b.lower)))&&(g=l,(b=f).upper===void 0||(b.upperOpen?yt(g,b.upper)<0:yt(g,b.upper)<=0));var g,b}function ia(l,f,g,b,N,E){var I,z,ee,fe,re,Z,te;return!g||g.length===0||(I=f.query.index,z=I.multiEntry,ee=f.query.range,fe=b.schema.primaryKey.extractKey,re=I.extractKey,Z=(I.lowLevelIndex||I).extractKey,(b=g.reduce(function(de,le){var ae=de,ce=[];if(le.type==="add"||le.type==="put")for(var ye=new Sn,pe=le.values.length-1;0<=pe;--pe){var be,Ce=le.values[pe],$e=fe(Ce);!ye.hasKey($e)&&(be=re(Ce),z&&m(be)?be.some(function(Xe){return sa(Xe,ee)}):sa(be,ee))&&(ye.addKey($e),ce.push(Ce))}switch(le.type){case"add":var Be=new Sn().addKeys(f.values?de.map(function(Pe){return fe(Pe)}):de),ae=de.concat(f.values?ce.filter(function(Pe){return Pe=fe(Pe),!Be.hasKey(Pe)&&(Be.addKey(Pe),!0)}):ce.map(function(Pe){return fe(Pe)}).filter(function(Pe){return!Be.hasKey(Pe)&&(Be.addKey(Pe),!0)}));break;case"put":var Ae=new Sn().addKeys(le.values.map(function(Pe){return fe(Pe)}));ae=de.filter(function(Pe){return!Ae.hasKey(f.values?fe(Pe):Pe)}).concat(f.values?ce:ce.map(function(Pe){return fe(Pe)}));break;case"delete":var Ke=new Sn().addKeys(le.keys);ae=de.filter(function(Pe){return!Ke.hasKey(f.values?fe(Pe):Pe)});break;case"deleteRange":var De=le.range;ae=de.filter(function(Pe){return!sa(fe(Pe),De)})}return ae},l))===l)?l:(te=function(de,le){return yt(Z(de),Z(le))||yt(fe(de),fe(le))},b.sort(f.direction==="prev"||f.direction==="prevunique"?function(de,le){return te(le,de)}:te),f.limit&&f.limit<1/0&&(b.length>f.limit?b.length=f.limit:l.length===f.limit&&b.length<f.limit&&(N.dirty=!0)),E?Object.freeze(b):b)}function aa(l,f){return yt(l.lower,f.lower)===0&&yt(l.upper,f.upper)===0&&!!l.lowerOpen==!!f.lowerOpen&&!!l.upperOpen==!!f.upperOpen}function sl(l,f){return((g,b,N,E)=>{if(g===void 0)return b!==void 0?-1:0;if(b===void 0)return 1;if((g=yt(g,b))===0){if(N&&E)return 0;if(N)return 1;if(E)return-1}return g})(l.lower,f.lower,l.lowerOpen,f.lowerOpen)<=0&&0<=((g,b,N,E)=>{if(g===void 0)return b!==void 0?1:0;if(b===void 0)return-1;if((g=yt(g,b))===0){if(N&&E)return 0;if(N)return-1;if(E)return 1}return g})(l.upper,f.upper,l.upperOpen,f.upperOpen)}function il(l,f,g,b){l.subscribers.add(g),b.addEventListener("abort",function(){var N,E;l.subscribers.delete(g),l.subscribers.size===0&&(N=l,E=f,setTimeout(function(){N.subscribers.size===0&&H(E,N)},3e3))})}var al={stack:"dbcore",level:0,name:"Cache",create:function(l){var f=l.schema.name;return i(i({},l),{transaction:function(g,b,N){var E,I,z=l.transaction(g,b,N);return b==="readwrite"&&(N=(E=new AbortController).signal,z.addEventListener("abort",(I=function(ee){return function(){if(E.abort(),b==="readwrite"){for(var fe=new Set,re=0,Z=g;re<Z.length;re++){var te=Z[re],de=so["idb://".concat(f,"/").concat(te)];if(de){var le=l.table(te),ae=de.optimisticOps.filter(function(Pe){return Pe.trans===z});if(z._explicit&&ee&&z.mutatedParts)for(var ce=0,ye=Object.values(de.queries.query);ce<ye.length;ce++)for(var pe=0,be=(Be=ye[ce]).slice();pe<be.length;pe++)Ji((Ae=be[pe]).obsSet,z.mutatedParts)&&(H(Be,Ae),Ae.subscribers.forEach(function(Pe){return fe.add(Pe)}));else if(0<ae.length){de.optimisticOps=de.optimisticOps.filter(function(Pe){return Pe.trans!==z});for(var Ce=0,$e=Object.values(de.queries.query);Ce<$e.length;Ce++)for(var Be,Ae,Ke,De=0,Xe=(Be=$e[Ce]).slice();De<Xe.length;De++)(Ae=Xe[De]).res!=null&&z.mutatedParts&&(ee&&!Ae.dirty?(Ke=Object.isFrozen(Ae.res),Ke=ia(Ae.res,Ae.req,ae,le,Ae,Ke),Ae.dirty?(H(Be,Ae),Ae.subscribers.forEach(function(Pe){return fe.add(Pe)})):Ke!==Ae.res&&(Ae.res=Ke,Ae.promise=Ve.resolve({result:Ke}))):(Ae.dirty&&H(Be,Ae),Ae.subscribers.forEach(function(Pe){return fe.add(Pe)})))}}}fe.forEach(function(Pe){return Pe()})}}})(!1),{signal:N}),z.addEventListener("error",I(!1),{signal:N}),z.addEventListener("complete",I(!0),{signal:N})),z},table:function(g){var b=l.table(g),N=b.schema.primaryKey;return i(i({},b),{mutate:function(E){var I,z=Ue.trans;return!N.outbound&&z.db._options.cache!=="disabled"&&!z.explicit&&z.idbtrans.mode==="readwrite"&&(I=so["idb://".concat(f,"/").concat(g)])?(z=b.mutate(E),E.type!=="add"&&E.type!=="put"||!(50<=E.values.length||ra(N,E).some(function(ee){return ee==null}))?(I.optimisticOps.push(E),E.mutatedParts&&ii(E.mutatedParts),z.then(function(ee){0<ee.numFailures&&(H(I.optimisticOps,E),(ee=Go(0,E,ee))&&I.optimisticOps.push(ee),E.mutatedParts)&&ii(E.mutatedParts)}),z.catch(function(){H(I.optimisticOps,E),E.mutatedParts&&ii(E.mutatedParts)})):z.then(function(ee){var fe=Go(0,i(i({},E),{values:E.values.map(function(re,Z){var te;return ee.failures[Z]?re:(W(te=(te=N.keyPath)!=null&&te.includes(".")?ve(re):i({},re),N.keyPath,ee.results[Z]),te)})}),ee);I.optimisticOps.push(fe),queueMicrotask(function(){return E.mutatedParts&&ii(E.mutatedParts)})}),z):b.mutate(E)},query:function(E){var I,z,ee,fe,re,Z,te;return rl(Ue,b)&&ol("query",E)?(I=((ee=Ue.trans)==null?void 0:ee.db._options.cache)==="immutable",z=(ee=Ue).requery,ee=ee.signal,Z=((de,le,ae,ce)=>{var ye=so["idb://".concat(de,"/").concat(le)];if(!ye)return[];if(!(de=ye.queries[ae]))return[null,!1,ye,null];var pe=de[(ce.query?ce.query.index.name:null)||""];if(!pe)return[null,!1,ye,null];switch(ae){case"query":var be=(Ce=ce.direction)!=null?Ce:"next",Ce=pe.find(function($e){var Be;return $e.req.limit===ce.limit&&$e.req.values===ce.values&&((Be=$e.req.direction)!=null?Be:"next")===be&&aa($e.req.query.range,ce.query.range)});return Ce?[Ce,!0,ye,pe]:[pe.find(function($e){var Be;return("limit"in $e.req?$e.req.limit:1/0)>=ce.limit&&((Be=$e.req.direction)!=null?Be:"next")===be&&(!ce.values||$e.req.values)&&sl($e.req.query.range,ce.query.range)}),!1,ye,pe];case"count":return Ce=pe.find(function($e){return aa($e.req.query.range,ce.query.range)}),[Ce,!!Ce,ye,pe]}})(f,g,"query",E),te=Z[0],fe=Z[2],re=Z[3],te&&Z[1]?te.obsSet=E.obsSet:(Z=b.query(E).then(function(de){var le=de.result;if(te&&(te.res=le),I){for(var ae=0,ce=le.length;ae<ce;++ae)Object.freeze(le[ae]);Object.freeze(le)}else de.result=ve(le);return de}).catch(function(de){return re&&te&&H(re,te),Promise.reject(de)}),te={obsSet:E.obsSet,promise:Z,subscribers:new Set,type:"query",req:E,dirty:!1},re?re.push(te):(re=[te],(fe=fe||(so["idb://".concat(f,"/").concat(g)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[E.query.index.name||""]=re)),il(te,re,z,ee),te.promise.then(function(de){return{result:ia(de.result,E,fe==null?void 0:fe.optimisticOps,b,te,I)}})):b.query(E)}})}})}};function Dr(l,f){return new Proxy(l,{get:function(g,b,N){return b==="db"?f:Reflect.get(g,b,N)}})}Qt.prototype.version=function(l){if(isNaN(l)||l<.1)throw new _e.Type("Given version is not a positive number");if(l=Math.round(10*l)/10,this.idbdb||this._state.isBeingOpened)throw new _e.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,l);var f=this._versions,g=f.filter(function(b){return b._cfg.version===l})[0];return g||(g=new this.Version(l),f.push(g),f.sort(oo),g.stores({}),this._state.autoSchema=!1),g},Qt.prototype._whenReady=function(l){var f=this;return this.idbdb&&(this._state.openComplete||Ue.letThrough||this._vip)?l():new Ve(function(g,b){if(f._state.openComplete)return b(new _e.DatabaseClosed(f._state.dbOpenError));if(!f._state.isBeingOpened){if(!f._state.autoOpen)return void b(new _e.DatabaseClosed);f.open().catch(Fe)}f._state.dbReadyPromise.then(g,b)}).then(l)},Qt.prototype.use=function(N){var f=N.stack,g=N.create,b=N.level,N=N.name,E=(N&&this.unuse({stack:f,name:N}),this._middlewares[f]||(this._middlewares[f]=[]));return E.push({stack:f,create:g,level:b??10,name:N}),E.sort(function(I,z){return I.level-z.level}),this},Qt.prototype.unuse=function(l){var f=l.stack,g=l.name,b=l.create;return f&&this._middlewares[f]&&(this._middlewares[f]=this._middlewares[f].filter(function(N){return b?N.create!==b:!!g&&N.name!==g})),this},Qt.prototype.open=function(){var l=this;return zt(ht,function(){return Yu(l)})},Qt.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var l=this._state;if(jo.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}l.isBeingOpened||(l.dbReadyPromise=new Ve(function(f){l.dbReadyResolve=f}),l.openCanceller=new Ve(function(f,g){l.cancelOpen=g}))},Qt.prototype.close=function(f){var f=(f===void 0?{disableAutoOpen:!0}:f).disableAutoOpen,g=this._state;f?(g.isBeingOpened&&g.cancelOpen(new _e.DatabaseClosed),this._close(),g.autoOpen=!1,g.dbOpenError=new _e.DatabaseClosed):(this._close(),g.autoOpen=this._options.autoOpen||g.isBeingOpened,g.openComplete=!1,g.dbOpenError=null)},Qt.prototype.delete=function(l){var f=this,g=(l===void 0&&(l={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),b=this._state;return new Ve(function(N,E){function I(){f.close(l);var z=f._deps.indexedDB.deleteDatabase(f.name);z.onsuccess=vt(function(){var ee,fe,re;ee=f._deps,fe=f.name,Eo(re=ee.indexedDB)||fe===xr||js(re,ee.IDBKeyRange).delete(fe).catch(Fe),N()}),z.onerror=Dt(E),z.onblocked=f._fireOnBlocked}if(g)throw new _e.InvalidArgument("Invalid closeOptions argument to db.delete()");b.isBeingOpened?b.dbReadyPromise.then(I):I()})},Qt.prototype.backendDB=function(){return this.idbdb},Qt.prototype.isOpen=function(){return this.idbdb!==null},Qt.prototype.hasBeenClosed=function(){var l=this._state.dbOpenError;return l&&l.name==="DatabaseClosed"},Qt.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Qt.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Qt.prototype,"tables",{get:function(){var l=this;return d(this._allTables).map(function(f){return l._allTables[f]})},enumerable:!1,configurable:!0}),Qt.prototype.transaction=function(){var l=(function(f,g,b){var N=arguments.length;if(N<2)throw new _e.InvalidArgument("Too few arguments");for(var E=new Array(N-1);--N;)E[N-1]=arguments[N];return b=E.pop(),[f,ke(E),b]}).apply(this,arguments);return this._transaction.apply(this,l)},Qt.prototype._transaction=function(l,f,g){var b,N,E=this,I=Ue.trans,z=(I&&I.db===this&&l.indexOf("!")===-1||(I=null),l.indexOf("?")!==-1);l=l.replace("!","").replace("?","");try{if(N=f.map(function(fe){if(fe=fe instanceof E.Table?fe.name:fe,typeof fe!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return fe}),l=="r"||l===to)b=to;else{if(l!="rw"&&l!=vr)throw new _e.InvalidArgument("Invalid transaction mode: "+l);b=vr}if(I){if(I.mode===to&&b===vr){if(!z)throw new _e.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");I=null}I&&N.forEach(function(fe){if(I&&I.storeNames.indexOf(fe)===-1){if(!z)throw new _e.SubTransaction("Table "+fe+" not included in parent transaction.");I=null}}),z&&I&&!I.active&&(I=null)}}catch(fe){return I?I._promise(null,function(re,Z){Z(fe)}):Ft(fe)}var ee=(function fe(re,Z,te,de,le){return Ve.resolve().then(function(){var pe=Ue.transless||Ue,ae=re._createTransaction(Z,te,re._dbSchema,de),pe=(ae.explicit=!0,{trans:ae,transless:pe});if(de)ae.idbtrans=de.idbtrans;else try{ae.create(),ae.idbtrans._explicit=!0,re._state.PR1398_maxLoop=3}catch(be){return be.name===Ne.InvalidState&&re.isOpen()&&0<--re._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),re.close({disableAutoOpen:!1}),re.open().then(function(){return fe(re,Z,te,null,le)})):Ft(be)}var ce,ye=D(le),pe=(ye&&Pn(),Ve.follow(function(){var be;(ce=le.call(ae,ae))&&(ye?(be=an.bind(null,null),ce.then(be,be)):typeof ce.next=="function"&&typeof ce.throw=="function"&&(ce=ta(ce)))},pe));return(ce&&typeof ce.then=="function"?Ve.resolve(ce).then(function(be){return ae.active?be:Ft(new _e.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):pe.then(function(){return ce})).then(function(be){return de&&ae._resolve(),ae._completion.then(function(){return be})}).catch(function(be){return ae._reject(be),Ft(be)})})}).bind(null,this,b,N,I,g);return I?I._promise(b,ee,"lock"):Ue.trans?zt(Ue.transless,function(){return E._whenReady(ee)}):this._whenReady(ee)},Qt.prototype.table=function(l){if(x(this._allTables,l))return this._allTables[l];throw new _e.InvalidTable("Table ".concat(l," does not exist"))};var zr=Qt;function Qt(l,f){var g,b,N,E,I,z=this,ee=(this._middlewares={},this.verno=0,Qt.dependencies),ee=(this._options=f=i({addons:Qt.addons,autoOpen:!0,indexedDB:ee.indexedDB,IDBKeyRange:ee.IDBKeyRange,cache:"cloned",maxConnections:1e3},f),this._deps={indexedDB:f.indexedDB,IDBKeyRange:f.IDBKeyRange},f.addons),fe=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Fe,dbReadyPromise:null,cancelOpen:Fe,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:f.autoOpen}),re=(fe.dbReadyPromise=new Ve(function(Z){fe.dbReadyResolve=Z}),fe.openCanceller=new Ve(function(Z,te){fe.cancelOpen=te}),this._state=fe,this.name=l,this.on=wr(this,"populate","blocked","versionchange","close",{ready:[en,Fe]}),this.once=function(Z,te){var de=function(){for(var le=[],ae=0;ae<arguments.length;ae++)le[ae]=arguments[ae];z.on(Z).unsubscribe(de),te.apply(z,le)};return z.on(Z,de)},this.on.ready.subscribe=P(this.on.ready.subscribe,function(Z){return function(te,de){Qt.vip(function(){var le,ae=z._state;ae.openComplete?(ae.dbOpenError||Ve.resolve().then(te),de&&Z(te)):ae.onReadyBeingFired?(ae.onReadyBeingFired.push(te),de&&Z(te)):(Z(te),le=z,de||Z(function ce(){le.on.ready.unsubscribe(te),le.on.ready.unsubscribe(ce)}))})}}),this.Collection=(g=this,Ir(Xs.prototype,function(ce,ae){this.db=g;var de=vo,le=null;if(ae)try{de=ae()}catch(pe){le=pe}var ae=ce._ctx,ce=ae.table,ye=ce.hook.reading.fire;this._ctx={table:ce,index:ae.index,isPrimKey:!ae.index||ce.schema.primKey.keyPath&&ae.index===ce.schema.primKey.name,range:de,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:le,or:ae.or,valueMapper:ye!==qe?ye:null}})),this.Table=(b=this,Ir(qn.prototype,function(Z,te,de){this.db=b,this._tx=de,this.name=Z,this.schema=te,this.hook=b._allTables[Z]?b._allTables[Z].hook:wr(null,{creating:[gt,Fe],reading:[mt,qe],updating:[mn,Fe],deleting:[It,Fe]})})),this.Transaction=(N=this,Ir(Qs.prototype,function(Z,te,de,le,ae){var ce=this;Z!=="readonly"&&te.forEach(function(ye){ye=(ye=de[ye])==null?void 0:ye.yProps,ye&&(te=te.concat(ye.map(function(pe){return pe.updatesTable})))}),this.db=N,this.mode=Z,this.storeNames=te,this.schema=de,this.chromeTransactionDurability=le,this.idbtrans=null,this.on=wr(this,"complete","error","abort"),this.parent=ae||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 Ve(function(ye,pe){ce._resolve=ye,ce._reject=pe}),this._completion.then(function(){ce.active=!1,ce.on.complete.fire()},function(ye){var pe=ce.active;return ce.active=!1,ce.on.error.fire(ye),ce.parent?ce.parent._reject(ye):pe&&ce.idbtrans&&ce.idbtrans.abort(),Ft(ye)})})),this.Version=(E=this,Ir(_s.prototype,function(Z){this.db=E,this._cfg={version:Z,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(I=this,Ir(Bt.prototype,function(Z,te,de){if(this.db=I,this._ctx={table:Z,index:te===":id"?null:te,or:de},this._cmp=this._ascending=yt,this._descending=function(le,ae){return yt(ae,le)},this._max=function(le,ae){return 0<yt(le,ae)?le:ae},this._min=function(le,ae){return yt(le,ae)<0?le:ae},this._IDBKeyRange=I._deps.IDBKeyRange,!this._IDBKeyRange)throw new _e.MissingAPI})),this.on("versionchange",function(Z){0<Z.newVersion?console.warn("Another connection wants to upgrade database '".concat(z.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(z.name,"'. Closing db now to resume the delete request.")),z.close({disableAutoOpen:!1})}),this.on("blocked",function(Z){!Z.newVersion||Z.newVersion<Z.oldVersion?console.warn("Dexie.delete('".concat(z.name,"') was blocked")):console.warn("Upgrade '".concat(z.name,"' blocked by other connection holding version ").concat(Z.oldVersion/10))}),this._maxKey=Lr(f.IDBKeyRange),this._createTransaction=function(Z,te,de,le){return new z.Transaction(Z,te,de,z._options.chromeTransactionDurability,le)},this._fireOnBlocked=function(Z){z.on("blocked").fire(Z),jo.toArray().filter(function(te){return te.name===z.name&&te!==z&&!te._state.vcFired}).map(function(te){return te.on("versionchange").fire(Z)})},this.use(Qu),this.use(al),this.use(oa),this.use(tl),this.use(Xu),new Proxy(this,{get:function(Z,te,de){var le;return te==="_vip"||(te==="table"?function(ae){return Dr(z.table(ae),re)}:(le=Reflect.get(Z,te,de))instanceof qn?Dr(le,re):te==="tables"?le.map(function(ae){return Dr(ae,re)}):te==="_createTransaction"?function(){return Dr(le.apply(this,arguments),re)}:le)}}));this.vip=re,ee.forEach(function(Z){return Z(z)})}var ui,Co=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",ll=(Po.prototype.subscribe=function(l,f,g){return this._subscribe(l&&typeof l!="function"?l:{next:l,error:f,complete:g})},Po.prototype[Co]=function(){return this},Po);function Po(l){this._subscribe=l}try{ui={indexedDB:c.indexedDB||c.mozIndexedDB||c.webkitIndexedDB||c.msIndexedDB,IDBKeyRange:c.IDBKeyRange||c.webkitIDBKeyRange}}catch{ui={indexedDB:null,IDBKeyRange:null}}function Zo(l){var f,g=!1,b=new ll(function(N){var E=D(l),I,z=!1,ee={},fe={},re={get closed(){return z},unsubscribe:function(){z||(z=!0,I&&I.abort(),Z&&$n.storagemutated.unsubscribe(le))}},Z=(N.start&&N.start(re),!1),te=function(){return eo(ae)};function de(){return Ji(fe,ee)}var le=function(ce){si(ee,ce),de()&&te()},ae=function(){var ce,ye,pe;!z&&ui.indexedDB&&(ee={},ce={},I&&I.abort(),I=new AbortController,pe=(be=>{var Ce=On();try{E&&Pn();var $e=Cn(l,be);return $e=E?$e.finally(an):$e}finally{Ce&&Qn()}})(ye={subscr:ce,signal:I.signal,requery:te,querier:l,trans:null}),Z||($n(Rn,le),Z=!0),Promise.resolve(pe).then(function(be){g=!0,f=be,z||ye.signal.aborted||(de()||(fe=ce,de())?te():(ee={},eo(function(){return!z&&N.next&&N.next(be)})))},function(be){g=!1,["DatabaseClosedError","AbortError"].includes(be==null?void 0:be.name)||z||eo(function(){z||N.error&&N.error(be)})}))};return setTimeout(te,0),re});return b.hasValue=function(){return g},b.getValue=function(){return f},b}var $o=zr;function es(l){var f=Fr;try{Fr=!0,$n.storagemutated.fire(l),ea(l,!0)}finally{Fr=f}}k($o,i(i({},K),{delete:function(l){return new $o(l,{addons:[]}).delete()},exists:function(l){return new $o(l,{addons:[]}).open().then(function(f){return f.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(l){try{return f=$o.dependencies,g=f.indexedDB,f=f.IDBKeyRange,(Eo(g)?Promise.resolve(g.databases()).then(function(b){return b.map(function(N){return N.name}).filter(function(N){return N!==xr})}):js(g,f).toCollection().primaryKeys()).then(l)}catch{return Ft(new _e.MissingAPI)}var f,g},defineClass:function(){return function(l){y(this,l)}},ignoreTransaction:function(l){return Ue.trans?zt(Ue.transless||ht,l):l()},vip:Jo,async:function(l){return function(){try{var f=ta(l.apply(this,arguments));return f&&typeof f.then=="function"?f:Ve.resolve(f)}catch(g){return Ft(g)}}},spawn:function(l,f,g){try{var b=ta(l.apply(g,f||[]));return b&&typeof b.then=="function"?b:Ve.resolve(b)}catch(N){return Ft(N)}},currentTransaction:{get:function(){return Ue.trans||null}},waitFor:function(l,f){return l=Ve.resolve(typeof l=="function"?$o.ignoreTransaction(l):l).timeout(f||6e4),Ue.trans?Ue.trans.waitFor(l):l},Promise:Ve,debug:{get:function(){return At},set:function(l){Xt(l)}},derive:M,extend:y,props:k,override:P,Events:wr,on:$n,liveQuery:Zo,extendObservabilitySet:si,getByKeyPath:F,setByKeyPath:W,delByKeyPath:function(l,f){typeof f=="string"?W(l,f,void 0):"length"in f&&[].map.call(f,function(g){W(l,g,void 0)})},shallowClone:ue,deepClone:ve,getObjectDiff:na,cmp:yt,asap:R,minKey:-1/0,addons:[],connections:{get:jo.toArray},errnames:Ne,dependencies:ui,cache:so,semVer:"4.4.2",version:"4.4.2".split(".").map(function(l){return parseInt(l)}).reduce(function(l,f,g){return l+f/Math.pow(10,2*g)})})),$o.maxKey=Lr($o.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&($n(Rn,function(l){Fr||(l=new CustomEvent(ko,{detail:l}),Fr=!0,dispatchEvent(l),Fr=!1)}),addEventListener(ko,function(l){l=l.detail,Fr||es(l)}));var ts,Fr=!1,ci=function(){};return typeof BroadcastChannel<"u"&&((ci=function(){(ts=new BroadcastChannel(ko)).onmessage=function(l){return l.data&&es(l.data)}})(),typeof ts.unref=="function"&&ts.unref(),$n(Rn,function(l){Fr||ts.postMessage(l)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(l){if(!zr.disableBfCache&&l.persisted){At&&console.debug("Dexie: handling persisted pagehide"),ts!=null&&ts.close();for(var f=0,g=jo.toArray();f<g.length;f++)g[f].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(l){!zr.disableBfCache&&l.persisted&&(At&&console.debug("Dexie: handling persisted pageshow"),ci(),es({all:new Sn(-1/0,[[]])}))})),Ve.rejectionMapper=function(l,f){return!l||l instanceof je||l instanceof TypeError||l instanceof SyntaxError||!l.name||!tt[l.name]?l:(f=new tt[l.name](f||l.message,l),"stack"in l&&j(f,"stack",{get:function(){return this.inner.stack}}),f)},Xt(At),i(zr,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:zr,Entity:yn,PropModification:$r,RangeSet:Sn,add:function(l){return new $r({add:l})},cmp:yt,default:zr,liveQuery:Zo,mergeRanges:Cs,rangesOverlap:ri,remove:function(l){return new $r({remove:l})},replacePrefix:function(l,f){return new $r({replacePrefix:[l,f]})}}),{default:zr}),zr})})(du)),du.exports}var wx=vx();const Td=Mu(wx),yh=Symbol.for("Dexie"),xu=globalThis[yh]||(globalThis[yh]=Td);if(Td.semVer!==xu.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Td.semVer} and ${xu.semVer}`);const{liveQuery:m_,mergeRanges:g_,rangesOverlap:y_,RangeSet:x_,cmp:v_,Entity:w_,PropModification:b_,replacePrefix:k_,add:S_,remove:N_,DexieYProvider:__}=xu,Id=500;class bx extends xu{constructor(){super("api-doc-tor");gs(this,"flows");gs(this,"testSuites");gs(this,"environments");gs(this,"requestPresets");gs(this,"tryHistory");gs(this,"playgroundManualEndpoints");gs(this,"kv");this.version(1).stores({flows:"++id, name",testSuites:"++id, name",environments:"++id, name",kv:"key"}),this.version(2).stores({flows:"++id, name",testSuites:"++id, name",environments:"++id, name",requestPresets:"++id, method, path, name",tryHistory:"++id, at, method, path",kv:"key"}),this.version(3).stores({flows:"++id, name",testSuites:"++id, name",environments:"++id, name",requestPresets:"++id, method, path, name",tryHistory:"++id, at, method, path",playgroundManualEndpoints:"id, method, path",kv:"key"})}}const Ge=new bx,Ri="openapiOverride";async function kx(e){await Ge.kv.put({key:Ri,value:JSON.stringify(e)})}async function xh(){await Ge.kv.delete(Ri)}function Um(e){return{name:e.name,method:e.method,path:e.path,pathVals:{...e.pathVals},queryVals:{...e.queryVals},headerVals:{...e.headerVals},cookieVals:{...e.cookieVals},bodyMode:e.bodyMode,tryBodyRaw:e.tryBodyRaw,bodyVals:{...e.bodyVals}}}function Km(e){return{at:e.at,method:e.method,path:e.path,baseUrl:e.baseUrl,url:e.url,requestHeaders:{...e.requestHeaders},requestBody:e.requestBody,credentials:e.credentials,...e.status!==void 0?{status:e.status}:{},...e.statusText!==void 0?{statusText:e.statusText}:{},...e.responseHeaders!==void 0?{responseHeaders:{...e.responseHeaders}}:{},...e.responseBodyText!==void 0?{responseBodyText:e.responseBodyText}:{},...e.networkError!==void 0?{networkError:e.networkError}:{},...e.tryForm!==void 0?{tryForm:{pathVals:{...e.tryForm.pathVals},queryVals:{...e.tryForm.queryVals},headerVals:{...e.tryForm.headerVals},cookieVals:{...e.tryForm.cookieVals},bodyMode:e.tryForm.bodyMode,tryBodyRaw:e.tryForm.tryBodyRaw,bodyVals:{...e.tryForm.bodyVals}}}:{}}}async function Sx(e,r){const o=e.toLowerCase();return Ge.requestPresets.where("path").equals(r).filter(i=>i.method.toLowerCase()===o).toArray()}async function Nx(e){return Ge.requestPresets.add(e)}async function _x(e){await Ge.requestPresets.delete(e)}async function qm(){const e=await Ge.tryHistory.count();if(e<=Id)return;const r=e-Id,o=await Ge.tryHistory.orderBy("at").limit(r).primaryKeys();await Ge.tryHistory.bulkDelete(o)}async function vh(e){await Ge.tryHistory.add(e),await qm()}async function jx(){return Ge.tryHistory.orderBy("at").reverse().toArray()}async function Ex(){await Ge.tryHistory.clear()}async function Cx(e){await Ge.tryHistory.delete(e)}async function Px(){return Ge.playgroundManualEndpoints.toArray()}async function $x(e){const r=e.id??crypto.randomUUID();return await Ge.playgroundManualEndpoints.put({...e,id:r}),r}async function Mx(e){await Ge.playgroundManualEndpoints.delete(e)}async function Tx(){const[e,r,o,i,a,c,d]=await Promise.all([Ge.flows.toArray(),Ge.testSuites.toArray(),Ge.environments.toArray(),Ge.requestPresets.toArray(),Ge.tryHistory.toArray(),Ge.playgroundManualEndpoints.toArray(),Ge.kv.get(Ri)]),m=await Ge.kv.get("authTokens");let y;try{y=m!=null&&m.value?JSON.parse(m.value):void 0}catch{y=void 0}let w;if(d!=null&&d.value)try{w=JSON.parse(d.value)}catch{w=void 0}return{formatVersion:1,exportedAt:new Date().toISOString(),flows:e,testSuites:r,environments:o,authTokens:y,requestPresets:i.map(Um),tryHistory:a.map(Km),...w!==void 0?{importedOpenApi:w}:{},...c.length>0?{playgroundManualEndpoints:c}:{}}}async function Wm(e){await Ge.transaction("rw",[Ge.flows,Ge.testSuites,Ge.environments,Ge.requestPresets,Ge.tryHistory,Ge.playgroundManualEndpoints,Ge.kv],async()=>{var r;await Ge.flows.clear(),await Ge.testSuites.clear(),await Ge.environments.clear(),await Ge.requestPresets.clear(),await Ge.tryHistory.clear(),await Ge.playgroundManualEndpoints.clear();for(const o of e.flows)await Ge.flows.add({name:o.name,steps:o.steps,graph:o.graph});for(const o of e.testSuites)await Ge.testSuites.add({name:o.name,cases:o.cases});for(const o of e.environments)await Ge.environments.add({name:o.name,baseUrl:o.baseUrl,vars:o.vars??{}});for(const o of e.requestPresets??[])await Ge.requestPresets.add(Um(o));for(const o of e.tryHistory??[])await Ge.tryHistory.add(Km(o));if(await qm(),e.authTokens&&await Ge.kv.put({key:"authTokens",value:JSON.stringify(e.authTokens)}),Object.prototype.hasOwnProperty.call(e,"importedOpenApi")&&(e.importedOpenApi===null?await Ge.kv.delete(Ri):e.importedOpenApi!==void 0&&await Ge.kv.put({key:Ri,value:JSON.stringify(e.importedOpenApi)})),(r=e.playgroundManualEndpoints)!=null&&r.length)for(const o of e.playgroundManualEndpoints)typeof o.id=="string"&&o.method&&o.path&&await Ge.playgroundManualEndpoints.put(o)})}async function Ix(e){if(e.formatVersion!==1)return!1;const[r,o,i,a,c]=await Promise.all([Ge.flows.count(),Ge.testSuites.count(),Ge.requestPresets.count(),Ge.tryHistory.count(),Ge.playgroundManualEndpoints.count()]);return r>0||o>0||i>0||a>0||c>0?!1:(await Wm(e),!0)}const Ax="Manual";function vu(e){const r=e.trim();return r?r.startsWith("/")?r:`/${r}`:"/"}function Ox(e,r,o){var d;const i=vu(o),a=r.toLowerCase(),c=(d=e.paths)==null?void 0:d[i];return!c||typeof c!="object"||"$ref"in c?!1:typeof c[a]=="object"}function Lx(e,r){var i,a;if(r.length===0)return e;const o={...e.paths??{}};for(const c of r){const d=vu(c.path),m=c.method.toLowerCase(),y=o[d];let w;y&&typeof y=="object"&&!("$ref"in y)?w={...y}:w={};const S=(((i=c.summary)==null?void 0:i.trim())||`${m.toUpperCase()} ${d}`).slice(0,512);w[m]={summary:S,...(a=c.description)!=null&&a.trim()?{description:c.description.trim()}:{},tags:[Ax],responses:{200:{description:"OK (endpoint añadido en playground)"}},"x-api-doc-tor-manual":!0},o[d]=w}return{...e,paths:o}}function Rx(e,r,o){var d,m;const i=[],a=r===e.expectStatus;if(i.push(`HTTP ${r} ${a?"✓":`✗ (esperado ${e.expectStatus})`}`),!a)return{pass:!1,lines:i};if((d=e.contains)!=null&&d.trim()){const y=o.includes(e.contains);if(i.push(`Contiene texto "${e.contains}": ${y?"✓":"✗"}`),!y)return{pass:!1,lines:i}}const c=(m=e.jsonPath)==null?void 0:m.trim();if(c){let y;try{y=JSON.parse(o)}catch{return i.push("Body no es JSON válido: ✗"),{pass:!1,lines:i}}const w=Ou(y,c),S=e.expectJsonValue;if(S!==void 0&&S!==""){const x=w==null?String(w):typeof w=="object"?JSON.stringify(w):String(w),k=S.trim(),_=x===k||String(w)===k;if(i.push(`JSON path ${c} → ${x} vs "${k}": ${_?"✓":"✗"}`),!_)return{pass:!1,lines:i}}else{const x=w!=null;if(i.push(`JSON path ${c} existe: ${x?"✓":"✗"}`),!x)return{pass:!1,lines:i}}}return{pass:!0,lines:i}}function hn(e){if(typeof e=="string"||typeof e=="number")return""+e;let r="";if(Array.isArray(e))for(let o=0,i;o<e.length;o++)(i=hn(e[o]))!==""&&(r+=(r&&" ")+i);else for(let o in e)e[o]&&(r+=(r&&" ")+o);return r}var Dx={value:()=>{}};function Lu(){for(var e=0,r=arguments.length,o={},i;e<r;++e){if(!(i=arguments[e]+"")||i in o||/[\s.]/.test(i))throw new Error("illegal type: "+i);o[i]=[]}return new fu(o)}function fu(e){this._=e}function zx(e,r){return e.trim().split(/^|\s+/).map(function(o){var i="",a=o.indexOf(".");if(a>=0&&(i=o.slice(a+1),o=o.slice(0,a)),o&&!r.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:i}})}fu.prototype=Lu.prototype={constructor:fu,on:function(e,r){var o=this._,i=zx(e+"",o),a,c=-1,d=i.length;if(arguments.length<2){for(;++c<d;)if((a=(e=i[c]).type)&&(a=Fx(o[a],e.name)))return a;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++c<d;)if(a=(e=i[c]).type)o[a]=wh(o[a],e.name,r);else if(r==null)for(a in o)o[a]=wh(o[a],e.name,null);return this},copy:function(){var e={},r=this._;for(var o in r)e[o]=r[o].slice();return new fu(e)},call:function(e,r){if((a=arguments.length-2)>0)for(var o=new Array(a),i=0,a,c;i<a;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(c=this._[e],i=0,a=c.length;i<a;++i)c[i].value.apply(r,o)},apply:function(e,r,o){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],a=0,c=i.length;a<c;++a)i[a].value.apply(r,o)}};function Fx(e,r){for(var o=0,i=e.length,a;o<i;++o)if((a=e[o]).name===r)return a.value}function wh(e,r,o){for(var i=0,a=e.length;i<a;++i)if(e[i].name===r){e[i]=Dx,e=e.slice(0,i).concat(e.slice(i+1));break}return o!=null&&e.push({name:r,value:o}),e}var Ad="http://www.w3.org/1999/xhtml";const bh={svg:"http://www.w3.org/2000/svg",xhtml:Ad,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ru(e){var r=e+="",o=r.indexOf(":");return o>=0&&(r=e.slice(0,o))!=="xmlns"&&(e=e.slice(o+1)),bh.hasOwnProperty(r)?{space:bh[r],local:e}:e}function Bx(e){return function(){var r=this.ownerDocument,o=this.namespaceURI;return o===Ad&&r.documentElement.namespaceURI===Ad?r.createElement(e):r.createElementNS(o,e)}}function Hx(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ym(e){var r=Ru(e);return(r.local?Hx:Bx)(r)}function Vx(){}function Qd(e){return e==null?Vx:function(){return this.querySelector(e)}}function Ux(e){typeof e!="function"&&(e=Qd(e));for(var r=this._groups,o=r.length,i=new Array(o),a=0;a<o;++a)for(var c=r[a],d=c.length,m=i[a]=new Array(d),y,w,S=0;S<d;++S)(y=c[S])&&(w=e.call(y,y.__data__,S,c))&&("__data__"in y&&(w.__data__=y.__data__),m[S]=w);return new hr(i,this._parents)}function Kx(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function qx(){return[]}function Xm(e){return e==null?qx:function(){return this.querySelectorAll(e)}}function Wx(e){return function(){return Kx(e.apply(this,arguments))}}function Yx(e){typeof e=="function"?e=Wx(e):e=Xm(e);for(var r=this._groups,o=r.length,i=[],a=[],c=0;c<o;++c)for(var d=r[c],m=d.length,y,w=0;w<m;++w)(y=d[w])&&(i.push(e.call(y,y.__data__,w,d)),a.push(y));return new hr(i,a)}function Qm(e){return function(){return this.matches(e)}}function Jm(e){return function(r){return r.matches(e)}}var Xx=Array.prototype.find;function Qx(e){return function(){return Xx.call(this.children,e)}}function Jx(){return this.firstElementChild}function Gx(e){return this.select(e==null?Jx:Qx(typeof e=="function"?e:Jm(e)))}var Zx=Array.prototype.filter;function ev(){return Array.from(this.children)}function tv(e){return function(){return Zx.call(this.children,e)}}function nv(e){return this.selectAll(e==null?ev:tv(typeof e=="function"?e:Jm(e)))}function rv(e){typeof e!="function"&&(e=Qm(e));for(var r=this._groups,o=r.length,i=new Array(o),a=0;a<o;++a)for(var c=r[a],d=c.length,m=i[a]=[],y,w=0;w<d;++w)(y=c[w])&&e.call(y,y.__data__,w,c)&&m.push(y);return new hr(i,this._parents)}function Gm(e){return new Array(e.length)}function ov(){return new hr(this._enter||this._groups.map(Gm),this._parents)}function wu(e,r){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=r}wu.prototype={constructor:wu,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,r){return this._parent.insertBefore(e,r)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function sv(e){return function(){return e}}function iv(e,r,o,i,a,c){for(var d=0,m,y=r.length,w=c.length;d<w;++d)(m=r[d])?(m.__data__=c[d],i[d]=m):o[d]=new wu(e,c[d]);for(;d<y;++d)(m=r[d])&&(a[d]=m)}function av(e,r,o,i,a,c,d){var m,y,w=new Map,S=r.length,x=c.length,k=new Array(S),_;for(m=0;m<S;++m)(y=r[m])&&(k[m]=_=d.call(y,y.__data__,m,r)+"",w.has(_)?a[m]=y:w.set(_,y));for(m=0;m<x;++m)_=d.call(e,c[m],m,c)+"",(y=w.get(_))?(i[m]=y,y.__data__=c[m],w.delete(_)):o[m]=new wu(e,c[m]);for(m=0;m<S;++m)(y=r[m])&&w.get(k[m])===y&&(a[m]=y)}function lv(e){return e.__data__}function uv(e,r){if(!arguments.length)return Array.from(this,lv);var o=r?av:iv,i=this._parents,a=this._groups;typeof e!="function"&&(e=sv(e));for(var c=a.length,d=new Array(c),m=new Array(c),y=new Array(c),w=0;w<c;++w){var S=i[w],x=a[w],k=x.length,_=cv(e.call(S,S&&S.__data__,w,i)),j=_.length,M=m[w]=new Array(j),A=d[w]=new Array(j),T=y[w]=new Array(k);o(S,x,M,A,T,_,r);for(var U=0,P=0,$,R;U<j;++U)if($=M[U]){for(U>=P&&(P=U+1);!(R=A[P])&&++P<j;);$._next=R||null}}return d=new hr(d,i),d._enter=m,d._exit=y,d}function cv(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function dv(){return new hr(this._exit||this._groups.map(Gm),this._parents)}function fv(e,r,o){var i=this.enter(),a=this,c=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),r!=null&&(a=r(a),a&&(a=a.selection())),o==null?c.remove():o(c),i&&a?i.merge(a).order():a}function pv(e){for(var r=e.selection?e.selection():e,o=this._groups,i=r._groups,a=o.length,c=i.length,d=Math.min(a,c),m=new Array(a),y=0;y<d;++y)for(var w=o[y],S=i[y],x=w.length,k=m[y]=new Array(x),_,j=0;j<x;++j)(_=w[j]||S[j])&&(k[j]=_);for(;y<a;++y)m[y]=o[y];return new hr(m,this._parents)}function hv(){for(var e=this._groups,r=-1,o=e.length;++r<o;)for(var i=e[r],a=i.length-1,c=i[a],d;--a>=0;)(d=i[a])&&(c&&d.compareDocumentPosition(c)^4&&c.parentNode.insertBefore(d,c),c=d);return this}function mv(e){e||(e=gv);function r(x,k){return x&&k?e(x.__data__,k.__data__):!x-!k}for(var o=this._groups,i=o.length,a=new Array(i),c=0;c<i;++c){for(var d=o[c],m=d.length,y=a[c]=new Array(m),w,S=0;S<m;++S)(w=d[S])&&(y[S]=w);y.sort(r)}return new hr(a,this._parents).order()}function gv(e,r){return e<r?-1:e>r?1:e>=r?0:NaN}function yv(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function xv(){return Array.from(this)}function vv(){for(var e=this._groups,r=0,o=e.length;r<o;++r)for(var i=e[r],a=0,c=i.length;a<c;++a){var d=i[a];if(d)return d}return null}function wv(){let e=0;for(const r of this)++e;return e}function bv(){return!this.node()}function kv(e){for(var r=this._groups,o=0,i=r.length;o<i;++o)for(var a=r[o],c=0,d=a.length,m;c<d;++c)(m=a[c])&&e.call(m,m.__data__,c,a);return this}function Sv(e){return function(){this.removeAttribute(e)}}function Nv(e){return function(){this.removeAttributeNS(e.space,e.local)}}function _v(e,r){return function(){this.setAttribute(e,r)}}function jv(e,r){return function(){this.setAttributeNS(e.space,e.local,r)}}function Ev(e,r){return function(){var o=r.apply(this,arguments);o==null?this.removeAttribute(e):this.setAttribute(e,o)}}function Cv(e,r){return function(){var o=r.apply(this,arguments);o==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,o)}}function Pv(e,r){var o=Ru(e);if(arguments.length<2){var i=this.node();return o.local?i.getAttributeNS(o.space,o.local):i.getAttribute(o)}return this.each((r==null?o.local?Nv:Sv:typeof r=="function"?o.local?Cv:Ev:o.local?jv:_v)(o,r))}function Zm(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function $v(e){return function(){this.style.removeProperty(e)}}function Mv(e,r,o){return function(){this.style.setProperty(e,r,o)}}function Tv(e,r,o){return function(){var i=r.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,o)}}function Iv(e,r,o){return arguments.length>1?this.each((r==null?$v:typeof r=="function"?Tv:Mv)(e,r,o??"")):Di(this.node(),e)}function Di(e,r){return e.style.getPropertyValue(r)||Zm(e).getComputedStyle(e,null).getPropertyValue(r)}function Av(e){return function(){delete this[e]}}function Ov(e,r){return function(){this[e]=r}}function Lv(e,r){return function(){var o=r.apply(this,arguments);o==null?delete this[e]:this[e]=o}}function Rv(e,r){return arguments.length>1?this.each((r==null?Av:typeof r=="function"?Lv:Ov)(e,r)):this.node()[e]}function e0(e){return e.trim().split(/^|\s+/)}function Jd(e){return e.classList||new t0(e)}function t0(e){this._node=e,this._names=e0(e.getAttribute("class")||"")}t0.prototype={add:function(e){var r=this._names.indexOf(e);r<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var r=this._names.indexOf(e);r>=0&&(this._names.splice(r,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function n0(e,r){for(var o=Jd(e),i=-1,a=r.length;++i<a;)o.add(r[i])}function r0(e,r){for(var o=Jd(e),i=-1,a=r.length;++i<a;)o.remove(r[i])}function Dv(e){return function(){n0(this,e)}}function zv(e){return function(){r0(this,e)}}function Fv(e,r){return function(){(r.apply(this,arguments)?n0:r0)(this,e)}}function Bv(e,r){var o=e0(e+"");if(arguments.length<2){for(var i=Jd(this.node()),a=-1,c=o.length;++a<c;)if(!i.contains(o[a]))return!1;return!0}return this.each((typeof r=="function"?Fv:r?Dv:zv)(o,r))}function Hv(){this.textContent=""}function Vv(e){return function(){this.textContent=e}}function Uv(e){return function(){var r=e.apply(this,arguments);this.textContent=r??""}}function Kv(e){return arguments.length?this.each(e==null?Hv:(typeof e=="function"?Uv:Vv)(e)):this.node().textContent}function qv(){this.innerHTML=""}function Wv(e){return function(){this.innerHTML=e}}function Yv(e){return function(){var r=e.apply(this,arguments);this.innerHTML=r??""}}function Xv(e){return arguments.length?this.each(e==null?qv:(typeof e=="function"?Yv:Wv)(e)):this.node().innerHTML}function Qv(){this.nextSibling&&this.parentNode.appendChild(this)}function Jv(){return this.each(Qv)}function Gv(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Zv(){return this.each(Gv)}function ew(e){var r=typeof e=="function"?e:Ym(e);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function tw(){return null}function nw(e,r){var o=typeof e=="function"?e:Ym(e),i=r==null?tw:typeof r=="function"?r:Qd(r);return this.select(function(){return this.insertBefore(o.apply(this,arguments),i.apply(this,arguments)||null)})}function rw(){var e=this.parentNode;e&&e.removeChild(this)}function ow(){return this.each(rw)}function sw(){var e=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(e,this.nextSibling):e}function iw(){var e=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(e,this.nextSibling):e}function aw(e){return this.select(e?iw:sw)}function lw(e){return arguments.length?this.property("__data__",e):this.node().__data__}function uw(e){return function(r){e.call(this,r,this.__data__)}}function cw(e){return e.trim().split(/^|\s+/).map(function(r){var o="",i=r.indexOf(".");return i>=0&&(o=r.slice(i+1),r=r.slice(0,i)),{type:r,name:o}})}function dw(e){return function(){var r=this.__on;if(r){for(var o=0,i=-1,a=r.length,c;o<a;++o)c=r[o],(!e.type||c.type===e.type)&&c.name===e.name?this.removeEventListener(c.type,c.listener,c.options):r[++i]=c;++i?r.length=i:delete this.__on}}}function fw(e,r,o){return function(){var i=this.__on,a,c=uw(r);if(i){for(var d=0,m=i.length;d<m;++d)if((a=i[d]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=c,a.options=o),a.value=r;return}}this.addEventListener(e.type,c,o),a={type:e.type,name:e.name,value:r,listener:c,options:o},i?i.push(a):this.__on=[a]}}function pw(e,r,o){var i=cw(e+""),a,c=i.length,d;if(arguments.length<2){var m=this.node().__on;if(m){for(var y=0,w=m.length,S;y<w;++y)for(a=0,S=m[y];a<c;++a)if((d=i[a]).type===S.type&&d.name===S.name)return S.value}return}for(m=r?fw:dw,a=0;a<c;++a)this.each(m(i[a],r,o));return this}function o0(e,r,o){var i=Zm(e),a=i.CustomEvent;typeof a=="function"?a=new a(r,o):(a=i.document.createEvent("Event"),o?(a.initEvent(r,o.bubbles,o.cancelable),a.detail=o.detail):a.initEvent(r,!1,!1)),e.dispatchEvent(a)}function hw(e,r){return function(){return o0(this,e,r)}}function mw(e,r){return function(){return o0(this,e,r.apply(this,arguments))}}function gw(e,r){return this.each((typeof r=="function"?mw:hw)(e,r))}function*yw(){for(var e=this._groups,r=0,o=e.length;r<o;++r)for(var i=e[r],a=0,c=i.length,d;a<c;++a)(d=i[a])&&(yield d)}var s0=[null];function hr(e,r){this._groups=e,this._parents=r}function qa(){return new hr([[document.documentElement]],s0)}function xw(){return this}hr.prototype=qa.prototype={constructor:hr,select:Ux,selectAll:Yx,selectChild:Gx,selectChildren:nv,filter:rv,data:uv,enter:ov,exit:dv,join:fv,merge:pv,selection:xw,order:hv,sort:mv,call:yv,nodes:xv,node:vv,size:wv,empty:bv,each:kv,attr:Pv,style:Iv,property:Rv,classed:Bv,text:Kv,html:Xv,raise:Jv,lower:Zv,append:ew,insert:nw,remove:ow,clone:aw,datum:lw,on:pw,dispatch:gw,[Symbol.iterator]:yw};function pr(e){return typeof e=="string"?new hr([[document.querySelector(e)]],[document.documentElement]):new hr([[e]],s0)}function vw(e){let r;for(;r=e.sourceEvent;)e=r;return e}function Wr(e,r){if(e=vw(e),r===void 0&&(r=e.currentTarget),r){var o=r.ownerSVGElement||r;if(o.createSVGPoint){var i=o.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(r.getScreenCTM().inverse()),[i.x,i.y]}if(r.getBoundingClientRect){var a=r.getBoundingClientRect();return[e.clientX-a.left-r.clientLeft,e.clientY-a.top-r.clientTop]}}return[e.pageX,e.pageY]}const ww={passive:!1},Oa={capture:!0,passive:!1};function hd(e){e.stopImmediatePropagation()}function Ii(e){e.preventDefault(),e.stopImmediatePropagation()}function i0(e){var r=e.document.documentElement,o=pr(e).on("dragstart.drag",Ii,Oa);"onselectstart"in r?o.on("selectstart.drag",Ii,Oa):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function a0(e,r){var o=e.document.documentElement,i=pr(e).on("dragstart.drag",null);r&&(i.on("click.drag",Ii,Oa),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in o?i.on("selectstart.drag",null):(o.style.MozUserSelect=o.__noselect,delete o.__noselect)}const Zl=e=>()=>e;function Od(e,{sourceEvent:r,subject:o,target:i,identifier:a,active:c,x:d,y:m,dx:y,dy:w,dispatch:S}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},subject:{value:o,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:c,enumerable:!0,configurable:!0},x:{value:d,enumerable:!0,configurable:!0},y:{value:m,enumerable:!0,configurable:!0},dx:{value:y,enumerable:!0,configurable:!0},dy:{value:w,enumerable:!0,configurable:!0},_:{value:S}})}Od.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function bw(e){return!e.ctrlKey&&!e.button}function kw(){return this.parentNode}function Sw(e,r){return r??{x:e.x,y:e.y}}function Nw(){return navigator.maxTouchPoints||"ontouchstart"in this}function l0(){var e=bw,r=kw,o=Sw,i=Nw,a={},c=Lu("start","drag","end"),d=0,m,y,w,S,x=0;function k($){$.on("mousedown.drag",_).filter(i).on("touchstart.drag",A).on("touchmove.drag",T,ww).on("touchend.drag touchcancel.drag",U).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _($,R){if(!(S||!e.call(this,$,R))){var F=P(this,r.call(this,$,R),$,R,"mouse");F&&(pr($.view).on("mousemove.drag",j,Oa).on("mouseup.drag",M,Oa),i0($.view),hd($),w=!1,m=$.clientX,y=$.clientY,F("start",$))}}function j($){if(Ii($),!w){var R=$.clientX-m,F=$.clientY-y;w=R*R+F*F>x}a.mouse("drag",$)}function M($){pr($.view).on("mousemove.drag mouseup.drag",null),a0($.view,w),Ii($),a.mouse("end",$)}function A($,R){if(e.call(this,$,R)){var F=$.changedTouches,W=r.call(this,$,R),ue=F.length,ne,ke;for(ne=0;ne<ue;++ne)(ke=P(this,W,$,R,F[ne].identifier,F[ne]))&&(hd($),ke("start",$,F[ne]))}}function T($){var R=$.changedTouches,F=R.length,W,ue;for(W=0;W<F;++W)(ue=a[R[W].identifier])&&(Ii($),ue("drag",$,R[W]))}function U($){var R=$.changedTouches,F=R.length,W,ue;for(S&&clearTimeout(S),S=setTimeout(function(){S=null},500),W=0;W<F;++W)(ue=a[R[W].identifier])&&(hd($),ue("end",$,R[W]))}function P($,R,F,W,ue,ne){var ke=c.copy(),Y=Wr(ne||F,R),Q,ve,B;if((B=o.call($,new Od("beforestart",{sourceEvent:F,target:k,identifier:ue,active:d,x:Y[0],y:Y[1],dx:0,dy:0,dispatch:ke}),W))!=null)return Q=B.x-Y[0]||0,ve=B.y-Y[1]||0,function ie(G,se,H){var q=Y,J;switch(G){case"start":a[ue]=ie,J=d++;break;case"end":delete a[ue],--d;case"drag":Y=Wr(H||se,R),J=d;break}ke.call(G,$,new Od(G,{sourceEvent:se,subject:B,target:k,identifier:ue,active:J,x:Y[0]+Q,y:Y[1]+ve,dx:Y[0]-q[0],dy:Y[1]-q[1],dispatch:ke}),W)}}return k.filter=function($){return arguments.length?(e=typeof $=="function"?$:Zl(!!$),k):e},k.container=function($){return arguments.length?(r=typeof $=="function"?$:Zl($),k):r},k.subject=function($){return arguments.length?(o=typeof $=="function"?$:Zl($),k):o},k.touchable=function($){return arguments.length?(i=typeof $=="function"?$:Zl(!!$),k):i},k.on=function(){var $=c.on.apply(c,arguments);return $===c?k:$},k.clickDistance=function($){return arguments.length?(x=($=+$)*$,k):Math.sqrt(x)},k}function Gd(e,r,o){e.prototype=r.prototype=o,o.constructor=e}function u0(e,r){var o=Object.create(e.prototype);for(var i in r)o[i]=r[i];return o}function Wa(){}var La=.7,bu=1/La,Ai="\\s*([+-]?\\d+)\\s*",Ra="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",_w=/^#([0-9a-f]{3,8})$/,jw=new RegExp(`^rgb\\(${Ai},${Ai},${Ai}\\)$`),Ew=new RegExp(`^rgb\\(${fo},${fo},${fo}\\)$`),Cw=new RegExp(`^rgba\\(${Ai},${Ai},${Ai},${Ra}\\)$`),Pw=new RegExp(`^rgba\\(${fo},${fo},${fo},${Ra}\\)$`),$w=new RegExp(`^hsl\\(${Ra},${fo},${fo}\\)$`),Mw=new RegExp(`^hsla\\(${Ra},${fo},${fo},${Ra}\\)$`),kh={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};Gd(Wa,Ks,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Sh,formatHex:Sh,formatHex8:Tw,formatHsl:Iw,formatRgb:Nh,toString:Nh});function Sh(){return this.rgb().formatHex()}function Tw(){return this.rgb().formatHex8()}function Iw(){return c0(this).formatHsl()}function Nh(){return this.rgb().formatRgb()}function Ks(e){var r,o;return e=(e+"").trim().toLowerCase(),(r=_w.exec(e))?(o=r[1].length,r=parseInt(r[1],16),o===6?_h(r):o===3?new ir(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):o===8?eu(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):o===4?eu(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=jw.exec(e))?new ir(r[1],r[2],r[3],1):(r=Ew.exec(e))?new ir(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=Cw.exec(e))?eu(r[1],r[2],r[3],r[4]):(r=Pw.exec(e))?eu(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=$w.exec(e))?Ch(r[1],r[2]/100,r[3]/100,1):(r=Mw.exec(e))?Ch(r[1],r[2]/100,r[3]/100,r[4]):kh.hasOwnProperty(e)?_h(kh[e]):e==="transparent"?new ir(NaN,NaN,NaN,0):null}function _h(e){return new ir(e>>16&255,e>>8&255,e&255,1)}function eu(e,r,o,i){return i<=0&&(e=r=o=NaN),new ir(e,r,o,i)}function Aw(e){return e instanceof Wa||(e=Ks(e)),e?(e=e.rgb(),new ir(e.r,e.g,e.b,e.opacity)):new ir}function Ld(e,r,o,i){return arguments.length===1?Aw(e):new ir(e,r,o,i??1)}function ir(e,r,o,i){this.r=+e,this.g=+r,this.b=+o,this.opacity=+i}Gd(ir,Ld,u0(Wa,{brighter(e){return e=e==null?bu:Math.pow(bu,e),new ir(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?La:Math.pow(La,e),new ir(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ir(Vs(this.r),Vs(this.g),Vs(this.b),ku(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:jh,formatHex:jh,formatHex8:Ow,formatRgb:Eh,toString:Eh}));function jh(){return`#${Hs(this.r)}${Hs(this.g)}${Hs(this.b)}`}function Ow(){return`#${Hs(this.r)}${Hs(this.g)}${Hs(this.b)}${Hs((isNaN(this.opacity)?1:this.opacity)*255)}`}function Eh(){const e=ku(this.opacity);return`${e===1?"rgb(":"rgba("}${Vs(this.r)}, ${Vs(this.g)}, ${Vs(this.b)}${e===1?")":`, ${e})`}`}function ku(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Vs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Hs(e){return e=Vs(e),(e<16?"0":"")+e.toString(16)}function Ch(e,r,o,i){return i<=0?e=r=o=NaN:o<=0||o>=1?e=r=NaN:r<=0&&(e=NaN),new Yr(e,r,o,i)}function c0(e){if(e instanceof Yr)return new Yr(e.h,e.s,e.l,e.opacity);if(e instanceof Wa||(e=Ks(e)),!e)return new Yr;if(e instanceof Yr)return e;e=e.rgb();var r=e.r/255,o=e.g/255,i=e.b/255,a=Math.min(r,o,i),c=Math.max(r,o,i),d=NaN,m=c-a,y=(c+a)/2;return m?(r===c?d=(o-i)/m+(o<i)*6:o===c?d=(i-r)/m+2:d=(r-o)/m+4,m/=y<.5?c+a:2-c-a,d*=60):m=y>0&&y<1?0:d,new Yr(d,m,y,e.opacity)}function Lw(e,r,o,i){return arguments.length===1?c0(e):new Yr(e,r,o,i??1)}function Yr(e,r,o,i){this.h=+e,this.s=+r,this.l=+o,this.opacity=+i}Gd(Yr,Lw,u0(Wa,{brighter(e){return e=e==null?bu:Math.pow(bu,e),new Yr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?La:Math.pow(La,e),new Yr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,r=isNaN(e)||isNaN(this.s)?0:this.s,o=this.l,i=o+(o<.5?o:1-o)*r,a=2*o-i;return new ir(md(e>=240?e-240:e+120,a,i),md(e,a,i),md(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new Yr(Ph(this.h),tu(this.s),tu(this.l),ku(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=ku(this.opacity);return`${e===1?"hsl(":"hsla("}${Ph(this.h)}, ${tu(this.s)*100}%, ${tu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ph(e){return e=(e||0)%360,e<0?e+360:e}function tu(e){return Math.max(0,Math.min(1,e||0))}function md(e,r,o){return(e<60?r+(o-r)*e/60:e<180?o:e<240?r+(o-r)*(240-e)/60:r)*255}const Zd=e=>()=>e;function Rw(e,r){return function(o){return e+o*r}}function Dw(e,r,o){return e=Math.pow(e,o),r=Math.pow(r,o)-e,o=1/o,function(i){return Math.pow(e+i*r,o)}}function zw(e){return(e=+e)==1?d0:function(r,o){return o-r?Dw(r,o,e):Zd(isNaN(r)?o:r)}}function d0(e,r){var o=r-e;return o?Rw(e,o):Zd(isNaN(e)?r:e)}const Su=(function e(r){var o=zw(r);function i(a,c){var d=o((a=Ld(a)).r,(c=Ld(c)).r),m=o(a.g,c.g),y=o(a.b,c.b),w=d0(a.opacity,c.opacity);return function(S){return a.r=d(S),a.g=m(S),a.b=y(S),a.opacity=w(S),a+""}}return i.gamma=e,i})(1);function Fw(e,r){r||(r=[]);var o=e?Math.min(r.length,e.length):0,i=r.slice(),a;return function(c){for(a=0;a<o;++a)i[a]=e[a]*(1-c)+r[a]*c;return i}}function Bw(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Hw(e,r){var o=r?r.length:0,i=e?Math.min(o,e.length):0,a=new Array(i),c=new Array(o),d;for(d=0;d<i;++d)a[d]=Ma(e[d],r[d]);for(;d<o;++d)c[d]=r[d];return function(m){for(d=0;d<i;++d)c[d]=a[d](m);return c}}function Vw(e,r){var o=new Date;return e=+e,r=+r,function(i){return o.setTime(e*(1-i)+r*i),o}}function co(e,r){return e=+e,r=+r,function(o){return e*(1-o)+r*o}}function Uw(e,r){var o={},i={},a;(e===null||typeof e!="object")&&(e={}),(r===null||typeof r!="object")&&(r={});for(a in r)a in e?o[a]=Ma(e[a],r[a]):i[a]=r[a];return function(c){for(a in o)i[a]=o[a](c);return i}}var Rd=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,gd=new RegExp(Rd.source,"g");function Kw(e){return function(){return e}}function qw(e){return function(r){return e(r)+""}}function f0(e,r){var o=Rd.lastIndex=gd.lastIndex=0,i,a,c,d=-1,m=[],y=[];for(e=e+"",r=r+"";(i=Rd.exec(e))&&(a=gd.exec(r));)(c=a.index)>o&&(c=r.slice(o,c),m[d]?m[d]+=c:m[++d]=c),(i=i[0])===(a=a[0])?m[d]?m[d]+=a:m[++d]=a:(m[++d]=null,y.push({i:d,x:co(i,a)})),o=gd.lastIndex;return o<r.length&&(c=r.slice(o),m[d]?m[d]+=c:m[++d]=c),m.length<2?y[0]?qw(y[0].x):Kw(r):(r=y.length,function(w){for(var S=0,x;S<r;++S)m[(x=y[S]).i]=x.x(w);return m.join("")})}function Ma(e,r){var o=typeof r,i;return r==null||o==="boolean"?Zd(r):(o==="number"?co:o==="string"?(i=Ks(r))?(r=i,Su):f0:r instanceof Ks?Su:r instanceof Date?Vw:Bw(r)?Fw:Array.isArray(r)?Hw:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Uw:co)(e,r)}var $h=180/Math.PI,Dd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function p0(e,r,o,i,a,c){var d,m,y;return(d=Math.sqrt(e*e+r*r))&&(e/=d,r/=d),(y=e*o+r*i)&&(o-=e*y,i-=r*y),(m=Math.sqrt(o*o+i*i))&&(o/=m,i/=m,y/=m),e*i<r*o&&(e=-e,r=-r,y=-y,d=-d),{translateX:a,translateY:c,rotate:Math.atan2(r,e)*$h,skewX:Math.atan(y)*$h,scaleX:d,scaleY:m}}var nu;function Ww(e){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return r.isIdentity?Dd:p0(r.a,r.b,r.c,r.d,r.e,r.f)}function Yw(e){return e==null||(nu||(nu=document.createElementNS("http://www.w3.org/2000/svg","g")),nu.setAttribute("transform",e),!(e=nu.transform.baseVal.consolidate()))?Dd:(e=e.matrix,p0(e.a,e.b,e.c,e.d,e.e,e.f))}function h0(e,r,o,i){function a(w){return w.length?w.pop()+" ":""}function c(w,S,x,k,_,j){if(w!==x||S!==k){var M=_.push("translate(",null,r,null,o);j.push({i:M-4,x:co(w,x)},{i:M-2,x:co(S,k)})}else(x||k)&&_.push("translate("+x+r+k+o)}function d(w,S,x,k){w!==S?(w-S>180?S+=360:S-w>180&&(w+=360),k.push({i:x.push(a(x)+"rotate(",null,i)-2,x:co(w,S)})):S&&x.push(a(x)+"rotate("+S+i)}function m(w,S,x,k){w!==S?k.push({i:x.push(a(x)+"skewX(",null,i)-2,x:co(w,S)}):S&&x.push(a(x)+"skewX("+S+i)}function y(w,S,x,k,_,j){if(w!==x||S!==k){var M=_.push(a(_)+"scale(",null,",",null,")");j.push({i:M-4,x:co(w,x)},{i:M-2,x:co(S,k)})}else(x!==1||k!==1)&&_.push(a(_)+"scale("+x+","+k+")")}return function(w,S){var x=[],k=[];return w=e(w),S=e(S),c(w.translateX,w.translateY,S.translateX,S.translateY,x,k),d(w.rotate,S.rotate,x,k),m(w.skewX,S.skewX,x,k),y(w.scaleX,w.scaleY,S.scaleX,S.scaleY,x,k),w=S=null,function(_){for(var j=-1,M=k.length,A;++j<M;)x[(A=k[j]).i]=A.x(_);return x.join("")}}}var Xw=h0(Ww,"px, ","px)","deg)"),Qw=h0(Yw,", ",")",")"),Jw=1e-12;function Mh(e){return((e=Math.exp(e))+1/e)/2}function Gw(e){return((e=Math.exp(e))-1/e)/2}function Zw(e){return((e=Math.exp(2*e))-1)/(e+1)}const pu=(function e(r,o,i){function a(c,d){var m=c[0],y=c[1],w=c[2],S=d[0],x=d[1],k=d[2],_=S-m,j=x-y,M=_*_+j*j,A,T;if(M<Jw)T=Math.log(k/w)/r,A=function(W){return[m+W*_,y+W*j,w*Math.exp(r*W*T)]};else{var U=Math.sqrt(M),P=(k*k-w*w+i*M)/(2*w*o*U),$=(k*k-w*w-i*M)/(2*k*o*U),R=Math.log(Math.sqrt(P*P+1)-P),F=Math.log(Math.sqrt($*$+1)-$);T=(F-R)/r,A=function(W){var ue=W*T,ne=Mh(R),ke=w/(o*U)*(ne*Zw(r*ue+R)-Gw(R));return[m+ke*_,y+ke*j,w*ne/Mh(r*ue+R)]}}return A.duration=T*1e3*r/Math.SQRT2,A}return a.rho=function(c){var d=Math.max(.001,+c),m=d*d,y=m*m;return e(d,m,y)},a})(Math.SQRT2,2,4);var zi=0,Pa=0,Ea=0,m0=1e3,Nu,$a,_u=0,qs=0,Du=0,Da=typeof performance=="object"&&performance.now?performance:Date,g0=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ef(){return qs||(g0(e1),qs=Da.now()+Du)}function e1(){qs=0}function ju(){this._call=this._time=this._next=null}ju.prototype=y0.prototype={constructor:ju,restart:function(e,r,o){if(typeof e!="function")throw new TypeError("callback is not a function");o=(o==null?ef():+o)+(r==null?0:+r),!this._next&&$a!==this&&($a?$a._next=this:Nu=this,$a=this),this._call=e,this._time=o,zd()},stop:function(){this._call&&(this._call=null,this._time=1/0,zd())}};function y0(e,r,o){var i=new ju;return i.restart(e,r,o),i}function t1(){ef(),++zi;for(var e=Nu,r;e;)(r=qs-e._time)>=0&&e._call.call(void 0,r),e=e._next;--zi}function Th(){qs=(_u=Da.now())+Du,zi=Pa=0;try{t1()}finally{zi=0,r1(),qs=0}}function n1(){var e=Da.now(),r=e-_u;r>m0&&(Du-=r,_u=e)}function r1(){for(var e,r=Nu,o,i=1/0;r;)r._call?(i>r._time&&(i=r._time),e=r,r=r._next):(o=r._next,r._next=null,r=e?e._next=o:Nu=o);$a=e,zd(i)}function zd(e){if(!zi){Pa&&(Pa=clearTimeout(Pa));var r=e-qs;r>24?(e<1/0&&(Pa=setTimeout(Th,e-Da.now()-Du)),Ea&&(Ea=clearInterval(Ea))):(Ea||(_u=Da.now(),Ea=setInterval(n1,m0)),zi=1,g0(Th))}}function Ih(e,r,o){var i=new ju;return r=r==null?0:+r,i.restart(a=>{i.stop(),e(a+r)},r,o),i}var o1=Lu("start","end","cancel","interrupt"),s1=[],x0=0,Ah=1,Fd=2,hu=3,Oh=4,Bd=5,mu=6;function zu(e,r,o,i,a,c){var d=e.__transition;if(!d)e.__transition={};else if(o in d)return;i1(e,o,{name:r,index:i,group:a,on:o1,tween:s1,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:x0})}function tf(e,r){var o=Jr(e,r);if(o.state>x0)throw new Error("too late; already scheduled");return o}function mo(e,r){var o=Jr(e,r);if(o.state>hu)throw new Error("too late; already running");return o}function Jr(e,r){var o=e.__transition;if(!o||!(o=o[r]))throw new Error("transition not found");return o}function i1(e,r,o){var i=e.__transition,a;i[r]=o,o.timer=y0(c,0,o.time);function c(w){o.state=Ah,o.timer.restart(d,o.delay,o.time),o.delay<=w&&d(w-o.delay)}function d(w){var S,x,k,_;if(o.state!==Ah)return y();for(S in i)if(_=i[S],_.name===o.name){if(_.state===hu)return Ih(d);_.state===Oh?(_.state=mu,_.timer.stop(),_.on.call("interrupt",e,e.__data__,_.index,_.group),delete i[S]):+S<r&&(_.state=mu,_.timer.stop(),_.on.call("cancel",e,e.__data__,_.index,_.group),delete i[S])}if(Ih(function(){o.state===hu&&(o.state=Oh,o.timer.restart(m,o.delay,o.time),m(w))}),o.state=Fd,o.on.call("start",e,e.__data__,o.index,o.group),o.state===Fd){for(o.state=hu,a=new Array(k=o.tween.length),S=0,x=-1;S<k;++S)(_=o.tween[S].value.call(e,e.__data__,o.index,o.group))&&(a[++x]=_);a.length=x+1}}function m(w){for(var S=w<o.duration?o.ease.call(null,w/o.duration):(o.timer.restart(y),o.state=Bd,1),x=-1,k=a.length;++x<k;)a[x].call(e,S);o.state===Bd&&(o.on.call("end",e,e.__data__,o.index,o.group),y())}function y(){o.state=mu,o.timer.stop(),delete i[r];for(var w in i)return;delete e.__transition}}function gu(e,r){var o=e.__transition,i,a,c=!0,d;if(o){r=r==null?null:r+"";for(d in o){if((i=o[d]).name!==r){c=!1;continue}a=i.state>Fd&&i.state<Bd,i.state=mu,i.timer.stop(),i.on.call(a?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete o[d]}c&&delete e.__transition}}function a1(e){return this.each(function(){gu(this,e)})}function l1(e,r){var o,i;return function(){var a=mo(this,e),c=a.tween;if(c!==o){i=o=c;for(var d=0,m=i.length;d<m;++d)if(i[d].name===r){i=i.slice(),i.splice(d,1);break}}a.tween=i}}function u1(e,r,o){var i,a;if(typeof o!="function")throw new Error;return function(){var c=mo(this,e),d=c.tween;if(d!==i){a=(i=d).slice();for(var m={name:r,value:o},y=0,w=a.length;y<w;++y)if(a[y].name===r){a[y]=m;break}y===w&&a.push(m)}c.tween=a}}function c1(e,r){var o=this._id;if(e+="",arguments.length<2){for(var i=Jr(this.node(),o).tween,a=0,c=i.length,d;a<c;++a)if((d=i[a]).name===e)return d.value;return null}return this.each((r==null?l1:u1)(o,e,r))}function nf(e,r,o){var i=e._id;return e.each(function(){var a=mo(this,i);(a.value||(a.value={}))[r]=o.apply(this,arguments)}),function(a){return Jr(a,i).value[r]}}function v0(e,r){var o;return(typeof r=="number"?co:r instanceof Ks?Su:(o=Ks(r))?(r=o,Su):f0)(e,r)}function d1(e){return function(){this.removeAttribute(e)}}function f1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function p1(e,r,o){var i,a=o+"",c;return function(){var d=this.getAttribute(e);return d===a?null:d===i?c:c=r(i=d,o)}}function h1(e,r,o){var i,a=o+"",c;return function(){var d=this.getAttributeNS(e.space,e.local);return d===a?null:d===i?c:c=r(i=d,o)}}function m1(e,r,o){var i,a,c;return function(){var d,m=o(this),y;return m==null?void this.removeAttribute(e):(d=this.getAttribute(e),y=m+"",d===y?null:d===i&&y===a?c:(a=y,c=r(i=d,m)))}}function g1(e,r,o){var i,a,c;return function(){var d,m=o(this),y;return m==null?void this.removeAttributeNS(e.space,e.local):(d=this.getAttributeNS(e.space,e.local),y=m+"",d===y?null:d===i&&y===a?c:(a=y,c=r(i=d,m)))}}function y1(e,r){var o=Ru(e),i=o==="transform"?Qw:v0;return this.attrTween(e,typeof r=="function"?(o.local?g1:m1)(o,i,nf(this,"attr."+e,r)):r==null?(o.local?f1:d1)(o):(o.local?h1:p1)(o,i,r))}function x1(e,r){return function(o){this.setAttribute(e,r.call(this,o))}}function v1(e,r){return function(o){this.setAttributeNS(e.space,e.local,r.call(this,o))}}function w1(e,r){var o,i;function a(){var c=r.apply(this,arguments);return c!==i&&(o=(i=c)&&v1(e,c)),o}return a._value=r,a}function b1(e,r){var o,i;function a(){var c=r.apply(this,arguments);return c!==i&&(o=(i=c)&&x1(e,c)),o}return a._value=r,a}function k1(e,r){var o="attr."+e;if(arguments.length<2)return(o=this.tween(o))&&o._value;if(r==null)return this.tween(o,null);if(typeof r!="function")throw new Error;var i=Ru(e);return this.tween(o,(i.local?w1:b1)(i,r))}function S1(e,r){return function(){tf(this,e).delay=+r.apply(this,arguments)}}function N1(e,r){return r=+r,function(){tf(this,e).delay=r}}function _1(e){var r=this._id;return arguments.length?this.each((typeof e=="function"?S1:N1)(r,e)):Jr(this.node(),r).delay}function j1(e,r){return function(){mo(this,e).duration=+r.apply(this,arguments)}}function E1(e,r){return r=+r,function(){mo(this,e).duration=r}}function C1(e){var r=this._id;return arguments.length?this.each((typeof e=="function"?j1:E1)(r,e)):Jr(this.node(),r).duration}function P1(e,r){if(typeof r!="function")throw new Error;return function(){mo(this,e).ease=r}}function $1(e){var r=this._id;return arguments.length?this.each(P1(r,e)):Jr(this.node(),r).ease}function M1(e,r){return function(){var o=r.apply(this,arguments);if(typeof o!="function")throw new Error;mo(this,e).ease=o}}function T1(e){if(typeof e!="function")throw new Error;return this.each(M1(this._id,e))}function I1(e){typeof e!="function"&&(e=Qm(e));for(var r=this._groups,o=r.length,i=new Array(o),a=0;a<o;++a)for(var c=r[a],d=c.length,m=i[a]=[],y,w=0;w<d;++w)(y=c[w])&&e.call(y,y.__data__,w,c)&&m.push(y);return new Uo(i,this._parents,this._name,this._id)}function A1(e){if(e._id!==this._id)throw new Error;for(var r=this._groups,o=e._groups,i=r.length,a=o.length,c=Math.min(i,a),d=new Array(i),m=0;m<c;++m)for(var y=r[m],w=o[m],S=y.length,x=d[m]=new Array(S),k,_=0;_<S;++_)(k=y[_]||w[_])&&(x[_]=k);for(;m<i;++m)d[m]=r[m];return new Uo(d,this._parents,this._name,this._id)}function O1(e){return(e+"").trim().split(/^|\s+/).every(function(r){var o=r.indexOf(".");return o>=0&&(r=r.slice(0,o)),!r||r==="start"})}function L1(e,r,o){var i,a,c=O1(r)?tf:mo;return function(){var d=c(this,e),m=d.on;m!==i&&(a=(i=m).copy()).on(r,o),d.on=a}}function R1(e,r){var o=this._id;return arguments.length<2?Jr(this.node(),o).on.on(e):this.each(L1(o,e,r))}function D1(e){return function(){var r=this.parentNode;for(var o in this.__transition)if(+o!==e)return;r&&r.removeChild(this)}}function z1(){return this.on("end.remove",D1(this._id))}function F1(e){var r=this._name,o=this._id;typeof e!="function"&&(e=Qd(e));for(var i=this._groups,a=i.length,c=new Array(a),d=0;d<a;++d)for(var m=i[d],y=m.length,w=c[d]=new Array(y),S,x,k=0;k<y;++k)(S=m[k])&&(x=e.call(S,S.__data__,k,m))&&("__data__"in S&&(x.__data__=S.__data__),w[k]=x,zu(w[k],r,o,k,w,Jr(S,o)));return new Uo(c,this._parents,r,o)}function B1(e){var r=this._name,o=this._id;typeof e!="function"&&(e=Xm(e));for(var i=this._groups,a=i.length,c=[],d=[],m=0;m<a;++m)for(var y=i[m],w=y.length,S,x=0;x<w;++x)if(S=y[x]){for(var k=e.call(S,S.__data__,x,y),_,j=Jr(S,o),M=0,A=k.length;M<A;++M)(_=k[M])&&zu(_,r,o,M,k,j);c.push(k),d.push(S)}return new Uo(c,d,r,o)}var H1=qa.prototype.constructor;function V1(){return new H1(this._groups,this._parents)}function U1(e,r){var o,i,a;return function(){var c=Di(this,e),d=(this.style.removeProperty(e),Di(this,e));return c===d?null:c===o&&d===i?a:a=r(o=c,i=d)}}function w0(e){return function(){this.style.removeProperty(e)}}function K1(e,r,o){var i,a=o+"",c;return function(){var d=Di(this,e);return d===a?null:d===i?c:c=r(i=d,o)}}function q1(e,r,o){var i,a,c;return function(){var d=Di(this,e),m=o(this),y=m+"";return m==null&&(y=m=(this.style.removeProperty(e),Di(this,e))),d===y?null:d===i&&y===a?c:(a=y,c=r(i=d,m))}}function W1(e,r){var o,i,a,c="style."+r,d="end."+c,m;return function(){var y=mo(this,e),w=y.on,S=y.value[c]==null?m||(m=w0(r)):void 0;(w!==o||a!==S)&&(i=(o=w).copy()).on(d,a=S),y.on=i}}function Y1(e,r,o){var i=(e+="")=="transform"?Xw:v0;return r==null?this.styleTween(e,U1(e,i)).on("end.style."+e,w0(e)):typeof r=="function"?this.styleTween(e,q1(e,i,nf(this,"style."+e,r))).each(W1(this._id,e)):this.styleTween(e,K1(e,i,r),o).on("end.style."+e,null)}function X1(e,r,o){return function(i){this.style.setProperty(e,r.call(this,i),o)}}function Q1(e,r,o){var i,a;function c(){var d=r.apply(this,arguments);return d!==a&&(i=(a=d)&&X1(e,d,o)),i}return c._value=r,c}function J1(e,r,o){var i="style."+(e+="");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;return this.tween(i,Q1(e,r,o??""))}function G1(e){return function(){this.textContent=e}}function Z1(e){return function(){var r=e(this);this.textContent=r??""}}function eb(e){return this.tween("text",typeof e=="function"?Z1(nf(this,"text",e)):G1(e==null?"":e+""))}function tb(e){return function(r){this.textContent=e.call(this,r)}}function nb(e){var r,o;function i(){var a=e.apply(this,arguments);return a!==o&&(r=(o=a)&&tb(a)),r}return i._value=e,i}function rb(e){var r="text";if(arguments.length<1)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,nb(e))}function ob(){for(var e=this._name,r=this._id,o=b0(),i=this._groups,a=i.length,c=0;c<a;++c)for(var d=i[c],m=d.length,y,w=0;w<m;++w)if(y=d[w]){var S=Jr(y,r);zu(y,e,o,w,d,{time:S.time+S.delay+S.duration,delay:0,duration:S.duration,ease:S.ease})}return new Uo(i,this._parents,e,o)}function sb(){var e,r,o=this,i=o._id,a=o.size();return new Promise(function(c,d){var m={value:d},y={value:function(){--a===0&&c()}};o.each(function(){var w=mo(this,i),S=w.on;S!==e&&(r=(e=S).copy(),r._.cancel.push(m),r._.interrupt.push(m),r._.end.push(y)),w.on=r}),a===0&&c()})}var ib=0;function Uo(e,r,o,i){this._groups=e,this._parents=r,this._name=o,this._id=i}function b0(){return++ib}var Bo=qa.prototype;Uo.prototype={constructor:Uo,select:F1,selectAll:B1,selectChild:Bo.selectChild,selectChildren:Bo.selectChildren,filter:I1,merge:A1,selection:V1,transition:ob,call:Bo.call,nodes:Bo.nodes,node:Bo.node,size:Bo.size,empty:Bo.empty,each:Bo.each,on:R1,attr:y1,attrTween:k1,style:Y1,styleTween:J1,text:eb,textTween:rb,remove:z1,tween:c1,delay:_1,duration:C1,ease:$1,easeVarying:T1,end:sb,[Symbol.iterator]:Bo[Symbol.iterator]};function ab(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var lb={time:null,delay:0,duration:250,ease:ab};function ub(e,r){for(var o;!(o=e.__transition)||!(o=o[r]);)if(!(e=e.parentNode))throw new Error(`transition ${r} not found`);return o}function cb(e){var r,o;e instanceof Uo?(r=e._id,e=e._name):(r=b0(),(o=lb).time=ef(),e=e==null?null:e+"");for(var i=this._groups,a=i.length,c=0;c<a;++c)for(var d=i[c],m=d.length,y,w=0;w<m;++w)(y=d[w])&&zu(y,e,r,w,d,o||ub(y,r));return new Uo(i,this._parents,e,r)}qa.prototype.interrupt=a1;qa.prototype.transition=cb;const ru=e=>()=>e;function db(e,{sourceEvent:r,target:o,transform:i,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:a}})}function Ho(e,r,o){this.k=e,this.x=r,this.y=o}Ho.prototype={constructor:Ho,scale:function(e){return e===1?this:new Ho(this.k*e,this.x,this.y)},translate:function(e,r){return e===0&r===0?this:new Ho(this.k,this.x+this.k*e,this.y+this.k*r)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Fu=new Ho(1,0,0);k0.prototype=Ho.prototype;function k0(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Fu;return e.__zoom}function yd(e){e.stopImmediatePropagation()}function Ca(e){e.preventDefault(),e.stopImmediatePropagation()}function fb(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function pb(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Lh(){return this.__zoom||Fu}function hb(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function mb(){return navigator.maxTouchPoints||"ontouchstart"in this}function gb(e,r,o){var i=e.invertX(r[0][0])-o[0][0],a=e.invertX(r[1][0])-o[1][0],c=e.invertY(r[0][1])-o[0][1],d=e.invertY(r[1][1])-o[1][1];return e.translate(a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a),d>c?(c+d)/2:Math.min(0,c)||Math.max(0,d))}function S0(){var e=fb,r=pb,o=gb,i=hb,a=mb,c=[0,1/0],d=[[-1/0,-1/0],[1/0,1/0]],m=250,y=pu,w=Lu("start","zoom","end"),S,x,k,_=500,j=150,M=0,A=10;function T(B){B.property("__zoom",Lh).on("wheel.zoom",ue,{passive:!1}).on("mousedown.zoom",ne).on("dblclick.zoom",ke).filter(a).on("touchstart.zoom",Y).on("touchmove.zoom",Q).on("touchend.zoom touchcancel.zoom",ve).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}T.transform=function(B,ie,G,se){var H=B.selection?B.selection():B;H.property("__zoom",Lh),B!==H?R(B,ie,G,se):H.interrupt().each(function(){F(this,arguments).event(se).start().zoom(null,typeof ie=="function"?ie.apply(this,arguments):ie).end()})},T.scaleBy=function(B,ie,G,se){T.scaleTo(B,function(){var H=this.__zoom.k,q=typeof ie=="function"?ie.apply(this,arguments):ie;return H*q},G,se)},T.scaleTo=function(B,ie,G,se){T.transform(B,function(){var H=r.apply(this,arguments),q=this.__zoom,J=G==null?$(H):typeof G=="function"?G.apply(this,arguments):G,D=q.invert(J),K=typeof ie=="function"?ie.apply(this,arguments):ie;return o(P(U(q,K),J,D),H,d)},G,se)},T.translateBy=function(B,ie,G,se){T.transform(B,function(){return o(this.__zoom.translate(typeof ie=="function"?ie.apply(this,arguments):ie,typeof G=="function"?G.apply(this,arguments):G),r.apply(this,arguments),d)},null,se)},T.translateTo=function(B,ie,G,se,H){T.transform(B,function(){var q=r.apply(this,arguments),J=this.__zoom,D=se==null?$(q):typeof se=="function"?se.apply(this,arguments):se;return o(Fu.translate(D[0],D[1]).scale(J.k).translate(typeof ie=="function"?-ie.apply(this,arguments):-ie,typeof G=="function"?-G.apply(this,arguments):-G),q,d)},se,H)};function U(B,ie){return ie=Math.max(c[0],Math.min(c[1],ie)),ie===B.k?B:new Ho(ie,B.x,B.y)}function P(B,ie,G){var se=ie[0]-G[0]*B.k,H=ie[1]-G[1]*B.k;return se===B.x&&H===B.y?B:new Ho(B.k,se,H)}function $(B){return[(+B[0][0]+ +B[1][0])/2,(+B[0][1]+ +B[1][1])/2]}function R(B,ie,G,se){B.on("start.zoom",function(){F(this,arguments).event(se).start()}).on("interrupt.zoom end.zoom",function(){F(this,arguments).event(se).end()}).tween("zoom",function(){var H=this,q=arguments,J=F(H,q).event(se),D=r.apply(H,q),K=G==null?$(D):typeof G=="function"?G.apply(H,q):G,Se=Math.max(D[1][0]-D[0][0],D[1][1]-D[0][1]),je=H.__zoom,Le=typeof ie=="function"?ie.apply(H,q):ie,Ie=y(je.invert(K).concat(Se/je.k),Le.invert(K).concat(Se/Le.k));return function(Ee){if(Ee===1)Ee=Le;else{var Ne=Ie(Ee),Re=Se/Ne[2];Ee=new Ho(Re,K[0]-Ne[0]*Re,K[1]-Ne[1]*Re)}J.zoom(null,Ee)}})}function F(B,ie,G){return!G&&B.__zooming||new W(B,ie)}function W(B,ie){this.that=B,this.args=ie,this.active=0,this.sourceEvent=null,this.extent=r.apply(B,ie),this.taps=0}W.prototype={event:function(B){return B&&(this.sourceEvent=B),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(B,ie){return this.mouse&&B!=="mouse"&&(this.mouse[1]=ie.invert(this.mouse[0])),this.touch0&&B!=="touch"&&(this.touch0[1]=ie.invert(this.touch0[0])),this.touch1&&B!=="touch"&&(this.touch1[1]=ie.invert(this.touch1[0])),this.that.__zoom=ie,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(B){var ie=pr(this.that).datum();w.call(B,this.that,new db(B,{sourceEvent:this.sourceEvent,target:T,transform:this.that.__zoom,dispatch:w}),ie)}};function ue(B,...ie){if(!e.apply(this,arguments))return;var G=F(this,ie).event(B),se=this.__zoom,H=Math.max(c[0],Math.min(c[1],se.k*Math.pow(2,i.apply(this,arguments)))),q=Wr(B);if(G.wheel)(G.mouse[0][0]!==q[0]||G.mouse[0][1]!==q[1])&&(G.mouse[1]=se.invert(G.mouse[0]=q)),clearTimeout(G.wheel);else{if(se.k===H)return;G.mouse=[q,se.invert(q)],gu(this),G.start()}Ca(B),G.wheel=setTimeout(J,j),G.zoom("mouse",o(P(U(se,H),G.mouse[0],G.mouse[1]),G.extent,d));function J(){G.wheel=null,G.end()}}function ne(B,...ie){if(k||!e.apply(this,arguments))return;var G=B.currentTarget,se=F(this,ie,!0).event(B),H=pr(B.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",Se,!0),q=Wr(B,G),J=B.clientX,D=B.clientY;i0(B.view),yd(B),se.mouse=[q,this.__zoom.invert(q)],gu(this),se.start();function K(je){if(Ca(je),!se.moved){var Le=je.clientX-J,Ie=je.clientY-D;se.moved=Le*Le+Ie*Ie>M}se.event(je).zoom("mouse",o(P(se.that.__zoom,se.mouse[0]=Wr(je,G),se.mouse[1]),se.extent,d))}function Se(je){H.on("mousemove.zoom mouseup.zoom",null),a0(je.view,se.moved),Ca(je),se.event(je).end()}}function ke(B,...ie){if(e.apply(this,arguments)){var G=this.__zoom,se=Wr(B.changedTouches?B.changedTouches[0]:B,this),H=G.invert(se),q=G.k*(B.shiftKey?.5:2),J=o(P(U(G,q),se,H),r.apply(this,ie),d);Ca(B),m>0?pr(this).transition().duration(m).call(R,J,se,B):pr(this).call(T.transform,J,se,B)}}function Y(B,...ie){if(e.apply(this,arguments)){var G=B.touches,se=G.length,H=F(this,ie,B.changedTouches.length===se).event(B),q,J,D,K;for(yd(B),J=0;J<se;++J)D=G[J],K=Wr(D,this),K=[K,this.__zoom.invert(K),D.identifier],H.touch0?!H.touch1&&H.touch0[2]!==K[2]&&(H.touch1=K,H.taps=0):(H.touch0=K,q=!0,H.taps=1+!!S);S&&(S=clearTimeout(S)),q&&(H.taps<2&&(x=K[0],S=setTimeout(function(){S=null},_)),gu(this),H.start())}}function Q(B,...ie){if(this.__zooming){var G=F(this,ie).event(B),se=B.changedTouches,H=se.length,q,J,D,K;for(Ca(B),q=0;q<H;++q)J=se[q],D=Wr(J,this),G.touch0&&G.touch0[2]===J.identifier?G.touch0[0]=D:G.touch1&&G.touch1[2]===J.identifier&&(G.touch1[0]=D);if(J=G.that.__zoom,G.touch1){var Se=G.touch0[0],je=G.touch0[1],Le=G.touch1[0],Ie=G.touch1[1],Ee=(Ee=Le[0]-Se[0])*Ee+(Ee=Le[1]-Se[1])*Ee,Ne=(Ne=Ie[0]-je[0])*Ne+(Ne=Ie[1]-je[1])*Ne;J=U(J,Math.sqrt(Ee/Ne)),D=[(Se[0]+Le[0])/2,(Se[1]+Le[1])/2],K=[(je[0]+Ie[0])/2,(je[1]+Ie[1])/2]}else if(G.touch0)D=G.touch0[0],K=G.touch0[1];else return;G.zoom("touch",o(P(J,D,K),G.extent,d))}}function ve(B,...ie){if(this.__zooming){var G=F(this,ie).event(B),se=B.changedTouches,H=se.length,q,J;for(yd(B),k&&clearTimeout(k),k=setTimeout(function(){k=null},_),q=0;q<H;++q)J=se[q],G.touch0&&G.touch0[2]===J.identifier?delete G.touch0:G.touch1&&G.touch1[2]===J.identifier&&delete G.touch1;if(G.touch1&&!G.touch0&&(G.touch0=G.touch1,delete G.touch1),G.touch0)G.touch0[1]=this.__zoom.invert(G.touch0[0]);else if(G.end(),G.taps===2&&(J=Wr(J,this),Math.hypot(x[0]-J[0],x[1]-J[1])<A)){var D=pr(this).on("dblclick.zoom");D&&D.apply(this,arguments)}}}return T.wheelDelta=function(B){return arguments.length?(i=typeof B=="function"?B:ru(+B),T):i},T.filter=function(B){return arguments.length?(e=typeof B=="function"?B:ru(!!B),T):e},T.touchable=function(B){return arguments.length?(a=typeof B=="function"?B:ru(!!B),T):a},T.extent=function(B){return arguments.length?(r=typeof B=="function"?B:ru([[+B[0][0],+B[0][1]],[+B[1][0],+B[1][1]]]),T):r},T.scaleExtent=function(B){return arguments.length?(c[0]=+B[0],c[1]=+B[1],T):[c[0],c[1]]},T.translateExtent=function(B){return arguments.length?(d[0][0]=+B[0][0],d[1][0]=+B[1][0],d[0][1]=+B[0][1],d[1][1]=+B[1][1],T):[[d[0][0],d[0][1]],[d[1][0],d[1][1]]]},T.constrain=function(B){return arguments.length?(o=B,T):o},T.duration=function(B){return arguments.length?(m=+B,T):m},T.interpolate=function(B){return arguments.length?(y=B,T):y},T.on=function(){var B=w.on.apply(w,arguments);return B===w?T:B},T.clickDistance=function(B){return arguments.length?(M=(B=+B)*B,T):Math.sqrt(M)},T.tapDistance=function(B){return arguments.length?(A=+B,T):A},T}const po={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:r,sourceHandle:o,targetHandle:i})=>`Couldn't create edge for ${e} handle id: "${e==="source"?o:i}", edge id: ${r}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},za=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],N0=["Enter"," ","Escape"],_0={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:r,y:o})=>`Moved selected node ${e}. New position, x: ${r}, y: ${o}`,"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 Fi;(function(e){e.Strict="strict",e.Loose="loose"})(Fi||(Fi={}));var Us;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Us||(Us={}));var Fa;(function(e){e.Partial="partial",e.Full="full"})(Fa||(Fa={}));const j0={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var vs;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(vs||(vs={}));var Eu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Eu||(Eu={}));var ot;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(ot||(ot={}));const Rh={[ot.Left]:ot.Right,[ot.Right]:ot.Left,[ot.Top]:ot.Bottom,[ot.Bottom]:ot.Top};function E0(e){return e===null?null:e?"valid":"invalid"}const C0=e=>"id"in e&&"source"in e&&"target"in e,yb=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),rf=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ya=(e,r=[0,0])=>{const{width:o,height:i}=Ko(e),a=e.origin??r,c=o*a[0],d=i*a[1];return{x:e.position.x-c,y:e.position.y-d}},xb=(e,r={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const o=e.reduce((i,a)=>{const c=typeof a=="string";let d=!r.nodeLookup&&!c?a:void 0;r.nodeLookup&&(d=c?r.nodeLookup.get(a):rf(a)?a:r.nodeLookup.get(a.id));const m=d?Cu(d,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Bu(i,m)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Hu(o)},Xa=(e,r={})=>{let o={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return e.forEach(a=>{(r.filter===void 0||r.filter(a))&&(o=Bu(o,Cu(a)),i=!0)}),i?Hu(o):{x:0,y:0,width:0,height:0}},of=(e,r,[o,i,a]=[0,0,1],c=!1,d=!1)=>{const m={...Ja(r,[o,i,a]),width:r.width/a,height:r.height/a},y=[];for(const w of e.values()){const{measured:S,selectable:x=!0,hidden:k=!1}=w;if(d&&!x||k)continue;const _=S.width??w.width??w.initialWidth??null,j=S.height??w.height??w.initialHeight??null,M=Ba(m,Hi(w)),A=(_??0)*(j??0),T=c&&M>0;(!w.internals.handleBounds||T||M>=A||w.dragging)&&y.push(w)}return y},vb=(e,r)=>{const o=new Set;return e.forEach(i=>{o.add(i.id)}),r.filter(i=>o.has(i.source)||o.has(i.target))};function wb(e,r){const o=new Map,i=r!=null&&r.nodes?new Set(r.nodes.map(a=>a.id)):null;return e.forEach(a=>{a.measured.width&&a.measured.height&&((r==null?void 0:r.includeHiddenNodes)||!a.hidden)&&(!i||i.has(a.id))&&o.set(a.id,a)}),o}async function bb({nodes:e,width:r,height:o,panZoom:i,minZoom:a,maxZoom:c},d){if(e.size===0)return Promise.resolve(!0);const m=wb(e,d),y=Xa(m),w=sf(y,r,o,(d==null?void 0:d.minZoom)??a,(d==null?void 0:d.maxZoom)??c,(d==null?void 0:d.padding)??.1);return await i.setViewport(w,{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 P0({nodeId:e,nextPosition:r,nodeLookup:o,nodeOrigin:i=[0,0],nodeExtent:a,onError:c}){const d=o.get(e),m=d.parentId?o.get(d.parentId):void 0,{x:y,y:w}=m?m.internals.positionAbsolute:{x:0,y:0},S=d.origin??i;let x=d.extent||a;if(d.extent==="parent"&&!d.expandParent)if(!m)c==null||c("005",po.error005());else{const _=m.measured.width,j=m.measured.height;_&&j&&(x=[[y,w],[y+_,w+j]])}else m&&Vi(d.extent)&&(x=[[d.extent[0][0]+y,d.extent[0][1]+w],[d.extent[1][0]+y,d.extent[1][1]+w]]);const k=Vi(x)?Ws(r,x,d.measured):r;return(d.measured.width===void 0||d.measured.height===void 0)&&(c==null||c("015",po.error015())),{position:{x:k.x-y+(d.measured.width??0)*S[0],y:k.y-w+(d.measured.height??0)*S[1]},positionAbsolute:k}}async function kb({nodesToRemove:e=[],edgesToRemove:r=[],nodes:o,edges:i,onBeforeDelete:a}){const c=new Set(e.map(k=>k.id)),d=[];for(const k of o){if(k.deletable===!1)continue;const _=c.has(k.id),j=!_&&k.parentId&&d.find(M=>M.id===k.parentId);(_||j)&&d.push(k)}const m=new Set(r.map(k=>k.id)),y=i.filter(k=>k.deletable!==!1),S=vb(d,y);for(const k of y)m.has(k.id)&&!S.find(j=>j.id===k.id)&&S.push(k);if(!a)return{edges:S,nodes:d};const x=await a({nodes:d,edges:S});return typeof x=="boolean"?x?{edges:S,nodes:d}:{edges:[],nodes:[]}:x}const Bi=(e,r=0,o=1)=>Math.min(Math.max(e,r),o),Ws=(e={x:0,y:0},r,o)=>({x:Bi(e.x,r[0][0],r[1][0]-((o==null?void 0:o.width)??0)),y:Bi(e.y,r[0][1],r[1][1]-((o==null?void 0:o.height)??0))});function $0(e,r,o){const{width:i,height:a}=Ko(o),{x:c,y:d}=o.internals.positionAbsolute;return Ws(e,[[c,d],[c+i,d+a]],r)}const Dh=(e,r,o)=>e<r?Bi(Math.abs(e-r),1,r)/r:e>o?-Bi(Math.abs(e-o),1,r)/r:0,M0=(e,r,o=15,i=40)=>{const a=Dh(e.x,i,r.width-i)*o,c=Dh(e.y,i,r.height-i)*o;return[a,c]},Bu=(e,r)=>({x:Math.min(e.x,r.x),y:Math.min(e.y,r.y),x2:Math.max(e.x2,r.x2),y2:Math.max(e.y2,r.y2)}),Hd=({x:e,y:r,width:o,height:i})=>({x:e,y:r,x2:e+o,y2:r+i}),Hu=({x:e,y:r,x2:o,y2:i})=>({x:e,y:r,width:o-e,height:i-r}),Hi=(e,r=[0,0])=>{var a,c;const{x:o,y:i}=rf(e)?e.internals.positionAbsolute:Ya(e,r);return{x:o,y:i,width:((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0,height:((c=e.measured)==null?void 0:c.height)??e.height??e.initialHeight??0}},Cu=(e,r=[0,0])=>{var a,c;const{x:o,y:i}=rf(e)?e.internals.positionAbsolute:Ya(e,r);return{x:o,y:i,x2:o+(((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0),y2:i+(((c=e.measured)==null?void 0:c.height)??e.height??e.initialHeight??0)}},T0=(e,r)=>Hu(Bu(Hd(e),Hd(r))),Ba=(e,r)=>{const o=Math.max(0,Math.min(e.x+e.width,r.x+r.width)-Math.max(e.x,r.x)),i=Math.max(0,Math.min(e.y+e.height,r.y+r.height)-Math.max(e.y,r.y));return Math.ceil(o*i)},zh=e=>Xr(e.width)&&Xr(e.height)&&Xr(e.x)&&Xr(e.y),Xr=e=>!isNaN(e)&&isFinite(e),Sb=(e,r)=>{},Qa=(e,r=[1,1])=>({x:r[0]*Math.round(e.x/r[0]),y:r[1]*Math.round(e.y/r[1])}),Ja=({x:e,y:r},[o,i,a],c=!1,d=[1,1])=>{const m={x:(e-o)/a,y:(r-i)/a};return c?Qa(m,d):m},Pu=({x:e,y:r},[o,i,a])=>({x:e*a+o,y:r*a+i});function Ci(e,r){if(typeof e=="number")return Math.floor((r-r/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const o=parseFloat(e);if(!Number.isNaN(o))return Math.floor(o)}if(typeof e=="string"&&e.endsWith("%")){const o=parseFloat(e);if(!Number.isNaN(o))return Math.floor(r*o*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Nb(e,r,o){if(typeof e=="string"||typeof e=="number"){const i=Ci(e,o),a=Ci(e,r);return{top:i,right:a,bottom:i,left:a,x:a*2,y:i*2}}if(typeof e=="object"){const i=Ci(e.top??e.y??0,o),a=Ci(e.bottom??e.y??0,o),c=Ci(e.left??e.x??0,r),d=Ci(e.right??e.x??0,r);return{top:i,right:d,bottom:a,left:c,x:c+d,y:i+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function _b(e,r,o,i,a,c){const{x:d,y:m}=Pu(e,[r,o,i]),{x:y,y:w}=Pu({x:e.x+e.width,y:e.y+e.height},[r,o,i]),S=a-y,x=c-w;return{left:Math.floor(d),top:Math.floor(m),right:Math.floor(S),bottom:Math.floor(x)}}const sf=(e,r,o,i,a,c)=>{const d=Nb(c,r,o),m=(r-d.x)/e.width,y=(o-d.y)/e.height,w=Math.min(m,y),S=Bi(w,i,a),x=e.x+e.width/2,k=e.y+e.height/2,_=r/2-x*S,j=o/2-k*S,M=_b(e,_,j,S,r,o),A={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:_-A.left+A.right,y:j-A.top+A.bottom,zoom:S}},Ha=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Vi(e){return e!=null&&e!=="parent"}function Ko(e){var r,o;return{width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}}function I0(e){var r,o;return(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth)!==void 0&&(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight)!==void 0}function A0(e,r={width:0,height:0},o,i,a){const c={...e},d=i.get(o);if(d){const m=d.origin||a;c.x+=d.internals.positionAbsolute.x-(r.width??0)*m[0],c.y+=d.internals.positionAbsolute.y-(r.height??0)*m[1]}return c}function Fh(e,r){if(e.size!==r.size)return!1;for(const o of e)if(!r.has(o))return!1;return!0}function jb(){let e,r;return{promise:new Promise((i,a)=>{e=i,r=a}),resolve:e,reject:r}}function Eb(e){return{..._0,...e||{}}}function Ta(e,{snapGrid:r=[0,0],snapToGrid:o=!1,transform:i,containerBounds:a}){const{x:c,y:d}=Qr(e),m=Ja({x:c-((a==null?void 0:a.left)??0),y:d-((a==null?void 0:a.top)??0)},i),{x:y,y:w}=o?Qa(m,r):m;return{xSnapped:y,ySnapped:w,...m}}const af=e=>({width:e.offsetWidth,height:e.offsetHeight}),O0=e=>{var r;return((r=e==null?void 0:e.getRootNode)==null?void 0:r.call(e))||(window==null?void 0:window.document)},Cb=["INPUT","SELECT","TEXTAREA"];function L0(e){var i,a;const r=((a=(i=e.composedPath)==null?void 0:i.call(e))==null?void 0:a[0])||e.target;return(r==null?void 0:r.nodeType)!==1?!1:Cb.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const R0=e=>"clientX"in e,Qr=(e,r)=>{var c,d;const o=R0(e),i=o?e.clientX:(c=e.touches)==null?void 0:c[0].clientX,a=o?e.clientY:(d=e.touches)==null?void 0:d[0].clientY;return{x:i-((r==null?void 0:r.left)??0),y:a-((r==null?void 0:r.top)??0)}},Bh=(e,r,o,i,a)=>{const c=r.querySelectorAll(`.${e}`);return!c||!c.length?null:Array.from(c).map(d=>{const m=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),type:e,nodeId:a,position:d.getAttribute("data-handlepos"),x:(m.left-o.left)/i,y:(m.top-o.top)/i,...af(d)}})};function D0({sourceX:e,sourceY:r,targetX:o,targetY:i,sourceControlX:a,sourceControlY:c,targetControlX:d,targetControlY:m}){const y=e*.125+a*.375+d*.375+o*.125,w=r*.125+c*.375+m*.375+i*.125,S=Math.abs(y-e),x=Math.abs(w-r);return[y,w,S,x]}function ou(e,r){return e>=0?.5*e:r*25*Math.sqrt(-e)}function Hh({pos:e,x1:r,y1:o,x2:i,y2:a,c}){switch(e){case ot.Left:return[r-ou(r-i,c),o];case ot.Right:return[r+ou(i-r,c),o];case ot.Top:return[r,o-ou(o-a,c)];case ot.Bottom:return[r,o+ou(a-o,c)]}}function lf({sourceX:e,sourceY:r,sourcePosition:o=ot.Bottom,targetX:i,targetY:a,targetPosition:c=ot.Top,curvature:d=.25}){const[m,y]=Hh({pos:o,x1:e,y1:r,x2:i,y2:a,c:d}),[w,S]=Hh({pos:c,x1:i,y1:a,x2:e,y2:r,c:d}),[x,k,_,j]=D0({sourceX:e,sourceY:r,targetX:i,targetY:a,sourceControlX:m,sourceControlY:y,targetControlX:w,targetControlY:S});return[`M${e},${r} C${m},${y} ${w},${S} ${i},${a}`,x,k,_,j]}function z0({sourceX:e,sourceY:r,targetX:o,targetY:i}){const a=Math.abs(o-e)/2,c=o<e?o+a:o-a,d=Math.abs(i-r)/2,m=i<r?i+d:i-d;return[c,m,a,d]}function Pb({sourceNode:e,targetNode:r,selected:o=!1,zIndex:i=0,elevateOnSelect:a=!1,zIndexMode:c="basic"}){if(c==="manual")return i;const d=a&&o?i+1e3:i,m=Math.max(e.parentId||a&&e.selected?e.internals.z:0,r.parentId||a&&r.selected?r.internals.z:0);return d+m}function $b({sourceNode:e,targetNode:r,width:o,height:i,transform:a}){const c=Bu(Cu(e),Cu(r));c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const d={x:-a[0]/a[2],y:-a[1]/a[2],width:o/a[2],height:i/a[2]};return Ba(d,Hu(c))>0}const Mb=({source:e,sourceHandle:r,target:o,targetHandle:i})=>`xy-edge__${e}${r||""}-${o}${i||""}`,Tb=(e,r)=>r.some(o=>o.source===e.source&&o.target===e.target&&(o.sourceHandle===e.sourceHandle||!o.sourceHandle&&!e.sourceHandle)&&(o.targetHandle===e.targetHandle||!o.targetHandle&&!e.targetHandle)),F0=(e,r,o={})=>{if(!e.source||!e.target)return r;const i=o.getEdgeId||Mb;let a;return C0(e)?a={...e}:a={...e,id:i(e)},Tb(a,r)?r:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,r.concat(a))};function B0({sourceX:e,sourceY:r,targetX:o,targetY:i}){const[a,c,d,m]=z0({sourceX:e,sourceY:r,targetX:o,targetY:i});return[`M ${e},${r}L ${o},${i}`,a,c,d,m]}const Vh={[ot.Left]:{x:-1,y:0},[ot.Right]:{x:1,y:0},[ot.Top]:{x:0,y:-1},[ot.Bottom]:{x:0,y:1}},Ib=({source:e,sourcePosition:r=ot.Bottom,target:o})=>r===ot.Left||r===ot.Right?e.x<o.x?{x:1,y:0}:{x:-1,y:0}:e.y<o.y?{x:0,y:1}:{x:0,y:-1},Uh=(e,r)=>Math.sqrt(Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2));function Ab({source:e,sourcePosition:r=ot.Bottom,target:o,targetPosition:i=ot.Top,center:a,offset:c,stepPosition:d}){const m=Vh[r],y=Vh[i],w={x:e.x+m.x*c,y:e.y+m.y*c},S={x:o.x+y.x*c,y:o.y+y.y*c},x=Ib({source:w,sourcePosition:r,target:S}),k=x.x!==0?"x":"y",_=x[k];let j=[],M,A;const T={x:0,y:0},U={x:0,y:0},[,,P,$]=z0({sourceX:e.x,sourceY:e.y,targetX:o.x,targetY:o.y});if(m[k]*y[k]===-1){k==="x"?(M=a.x??w.x+(S.x-w.x)*d,A=a.y??(w.y+S.y)/2):(M=a.x??(w.x+S.x)/2,A=a.y??w.y+(S.y-w.y)*d);const ue=[{x:M,y:w.y},{x:M,y:S.y}],ne=[{x:w.x,y:A},{x:S.x,y:A}];m[k]===_?j=k==="x"?ue:ne:j=k==="x"?ne:ue}else{const ue=[{x:w.x,y:S.y}],ne=[{x:S.x,y:w.y}];if(k==="x"?j=m.x===_?ne:ue:j=m.y===_?ue:ne,r===i){const B=Math.abs(e[k]-o[k]);if(B<=c){const ie=Math.min(c-1,c-B);m[k]===_?T[k]=(w[k]>e[k]?-1:1)*ie:U[k]=(S[k]>o[k]?-1:1)*ie}}if(r!==i){const B=k==="x"?"y":"x",ie=m[k]===y[B],G=w[B]>S[B],se=w[B]<S[B];(m[k]===1&&(!ie&&G||ie&&se)||m[k]!==1&&(!ie&&se||ie&&G))&&(j=k==="x"?ue:ne)}const ke={x:w.x+T.x,y:w.y+T.y},Y={x:S.x+U.x,y:S.y+U.y},Q=Math.max(Math.abs(ke.x-j[0].x),Math.abs(Y.x-j[0].x)),ve=Math.max(Math.abs(ke.y-j[0].y),Math.abs(Y.y-j[0].y));Q>=ve?(M=(ke.x+Y.x)/2,A=j[0].y):(M=j[0].x,A=(ke.y+Y.y)/2)}const R={x:w.x+T.x,y:w.y+T.y},F={x:S.x+U.x,y:S.y+U.y};return[[e,...R.x!==j[0].x||R.y!==j[0].y?[R]:[],...j,...F.x!==j[j.length-1].x||F.y!==j[j.length-1].y?[F]:[],o],M,A,P,$]}function Ob(e,r,o,i){const a=Math.min(Uh(e,r)/2,Uh(r,o)/2,i),{x:c,y:d}=r;if(e.x===c&&c===o.x||e.y===d&&d===o.y)return`L${c} ${d}`;if(e.y===d){const w=e.x<o.x?-1:1,S=e.y<o.y?1:-1;return`L ${c+a*w},${d}Q ${c},${d} ${c},${d+a*S}`}const m=e.x<o.x?1:-1,y=e.y<o.y?-1:1;return`L ${c},${d+a*y}Q ${c},${d} ${c+a*m},${d}`}function Vd({sourceX:e,sourceY:r,sourcePosition:o=ot.Bottom,targetX:i,targetY:a,targetPosition:c=ot.Top,borderRadius:d=5,centerX:m,centerY:y,offset:w=20,stepPosition:S=.5}){const[x,k,_,j,M]=Ab({source:{x:e,y:r},sourcePosition:o,target:{x:i,y:a},targetPosition:c,center:{x:m,y},offset:w,stepPosition:S});let A=`M${x[0].x} ${x[0].y}`;for(let T=1;T<x.length-1;T++)A+=Ob(x[T-1],x[T],x[T+1],d);return A+=`L${x[x.length-1].x} ${x[x.length-1].y}`,[A,k,_,j,M]}function Kh(e){var r;return e&&!!(e.internals.handleBounds||(r=e.handles)!=null&&r.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Lb(e){var x;const{sourceNode:r,targetNode:o}=e;if(!Kh(r)||!Kh(o))return null;const i=r.internals.handleBounds||qh(r.handles),a=o.internals.handleBounds||qh(o.handles),c=Wh((i==null?void 0:i.source)??[],e.sourceHandle),d=Wh(e.connectionMode===Fi.Strict?(a==null?void 0:a.target)??[]:((a==null?void 0:a.target)??[]).concat((a==null?void 0:a.source)??[]),e.targetHandle);if(!c||!d)return(x=e.onError)==null||x.call(e,"008",po.error008(c?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const m=(c==null?void 0:c.position)||ot.Bottom,y=(d==null?void 0:d.position)||ot.Top,w=Ys(r,c,m),S=Ys(o,d,y);return{sourceX:w.x,sourceY:w.y,targetX:S.x,targetY:S.y,sourcePosition:m,targetPosition:y}}function qh(e){if(!e)return null;const r=[],o=[];for(const i of e)i.width=i.width??1,i.height=i.height??1,i.type==="source"?r.push(i):i.type==="target"&&o.push(i);return{source:r,target:o}}function Ys(e,r,o=ot.Left,i=!1){const a=((r==null?void 0:r.x)??0)+e.internals.positionAbsolute.x,c=((r==null?void 0:r.y)??0)+e.internals.positionAbsolute.y,{width:d,height:m}=r??Ko(e);if(i)return{x:a+d/2,y:c+m/2};switch((r==null?void 0:r.position)??o){case ot.Top:return{x:a+d/2,y:c};case ot.Right:return{x:a+d,y:c+m/2};case ot.Bottom:return{x:a+d/2,y:c+m};case ot.Left:return{x:a,y:c+m/2}}}function Wh(e,r){return e&&(r?e.find(o=>o.id===r):e[0])||null}function Ud(e,r){return e?typeof e=="string"?e:`${r?`${r}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function Rb(e,{id:r,defaultColor:o,defaultMarkerStart:i,defaultMarkerEnd:a}){const c=new Set;return e.reduce((d,m)=>([m.markerStart||i,m.markerEnd||a].forEach(y=>{if(y&&typeof y=="object"){const w=Ud(y,r);c.has(w)||(d.push({id:w,color:y.color||o,...y}),c.add(w))}}),d),[]).sort((d,m)=>d.id.localeCompare(m.id))}const H0=1e3,Db=10,uf={nodeOrigin:[0,0],nodeExtent:za,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},zb={...uf,checkEquality:!0};function cf(e,r){const o={...e};for(const i in r)r[i]!==void 0&&(o[i]=r[i]);return o}function Fb(e,r,o){const i=cf(uf,o);for(const a of e.values())if(a.parentId)ff(a,e,r,i);else{const c=Ya(a,i.nodeOrigin),d=Vi(a.extent)?a.extent:i.nodeExtent,m=Ws(c,d,Ko(a));a.internals.positionAbsolute=m}}function Bb(e,r){if(!e.handles)return e.measured?r==null?void 0:r.internals.handleBounds:void 0;const o=[],i=[];for(const a of e.handles){const c={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?o.push(c):a.type==="target"&&i.push(c)}return{source:o,target:i}}function df(e){return e==="manual"}function Kd(e,r,o,i={}){var S,x;const a=cf(zb,i),c={i:0},d=new Map(r),m=a!=null&&a.elevateNodesOnSelect&&!df(a.zIndexMode)?H0:0;let y=e.length>0,w=!1;r.clear(),o.clear();for(const k of e){let _=d.get(k.id);if(a.checkEquality&&k===(_==null?void 0:_.internals.userNode))r.set(k.id,_);else{const j=Ya(k,a.nodeOrigin),M=Vi(k.extent)?k.extent:a.nodeExtent,A=Ws(j,M,Ko(k));_={...a.defaults,...k,measured:{width:(S=k.measured)==null?void 0:S.width,height:(x=k.measured)==null?void 0:x.height},internals:{positionAbsolute:A,handleBounds:Bb(k,_),z:V0(k,m,a.zIndexMode),userNode:k}},r.set(k.id,_)}(_.measured===void 0||_.measured.width===void 0||_.measured.height===void 0)&&!_.hidden&&(y=!1),k.parentId&&ff(_,r,o,i,c),w||(w=k.selected??!1)}return{nodesInitialized:y,hasSelectedNodes:w}}function Hb(e,r){if(!e.parentId)return;const o=r.get(e.parentId);o?o.set(e.id,e):r.set(e.parentId,new Map([[e.id,e]]))}function ff(e,r,o,i,a){const{elevateNodesOnSelect:c,nodeOrigin:d,nodeExtent:m,zIndexMode:y}=cf(uf,i),w=e.parentId,S=r.get(w);if(!S){console.warn(`Parent node ${w} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Hb(e,o),a&&!S.parentId&&S.internals.rootParentIndex===void 0&&y==="auto"&&(S.internals.rootParentIndex=++a.i,S.internals.z=S.internals.z+a.i*Db),a&&S.internals.rootParentIndex!==void 0&&(a.i=S.internals.rootParentIndex);const x=c&&!df(y)?H0:0,{x:k,y:_,z:j}=Vb(e,S,d,m,x,y),{positionAbsolute:M}=e.internals,A=k!==M.x||_!==M.y;(A||j!==e.internals.z)&&r.set(e.id,{...e,internals:{...e.internals,positionAbsolute:A?{x:k,y:_}:M,z:j}})}function V0(e,r,o){const i=Xr(e.zIndex)?e.zIndex:0;return df(o)?i:i+(e.selected?r:0)}function Vb(e,r,o,i,a,c){const{x:d,y:m}=r.internals.positionAbsolute,y=Ko(e),w=Ya(e,o),S=Vi(e.extent)?Ws(w,e.extent,y):w;let x=Ws({x:d+S.x,y:m+S.y},i,y);e.extent==="parent"&&(x=$0(x,y,r));const k=V0(e,a,c),_=r.internals.z??0;return{x:x.x,y:x.y,z:_>=k?_+1:k}}function pf(e,r,o,i=[0,0]){var d;const a=[],c=new Map;for(const m of e){const y=r.get(m.parentId);if(!y)continue;const w=((d=c.get(m.parentId))==null?void 0:d.expandedRect)??Hi(y),S=T0(w,m.rect);c.set(m.parentId,{expandedRect:S,parent:y})}return c.size>0&&c.forEach(({expandedRect:m,parent:y},w)=>{var P;const S=y.internals.positionAbsolute,x=Ko(y),k=y.origin??i,_=m.x<S.x?Math.round(Math.abs(S.x-m.x)):0,j=m.y<S.y?Math.round(Math.abs(S.y-m.y)):0,M=Math.max(x.width,Math.round(m.width)),A=Math.max(x.height,Math.round(m.height)),T=(M-x.width)*k[0],U=(A-x.height)*k[1];(_>0||j>0||T||U)&&(a.push({id:w,type:"position",position:{x:y.position.x-_+T,y:y.position.y-j+U}}),(P=o.get(w))==null||P.forEach($=>{e.some(R=>R.id===$.id)||a.push({id:$.id,type:"position",position:{x:$.position.x+_,y:$.position.y+j}})})),(x.width<m.width||x.height<m.height||_||j)&&a.push({id:w,type:"dimensions",setAttributes:!0,dimensions:{width:M+(_?k[0]*_-T:0),height:A+(j?k[1]*j-U:0)}})}),a}function Ub(e,r,o,i,a,c,d){const m=i==null?void 0:i.querySelector(".xyflow__viewport");let y=!1;if(!m)return{changes:[],updatedInternals:y};const w=[],S=window.getComputedStyle(m),{m22:x}=new window.DOMMatrixReadOnly(S.transform),k=[];for(const _ of e.values()){const j=r.get(_.id);if(!j)continue;if(j.hidden){r.set(j.id,{...j,internals:{...j.internals,handleBounds:void 0}}),y=!0;continue}const M=af(_.nodeElement),A=j.measured.width!==M.width||j.measured.height!==M.height;if(!!(M.width&&M.height&&(A||!j.internals.handleBounds||_.force))){const U=_.nodeElement.getBoundingClientRect(),P=Vi(j.extent)?j.extent:c;let{positionAbsolute:$}=j.internals;j.parentId&&j.extent==="parent"?$=$0($,M,r.get(j.parentId)):P&&($=Ws($,P,M));const R={...j,measured:M,internals:{...j.internals,positionAbsolute:$,handleBounds:{source:Bh("source",_.nodeElement,U,x,j.id),target:Bh("target",_.nodeElement,U,x,j.id)}}};r.set(j.id,R),j.parentId&&ff(R,r,o,{nodeOrigin:a,zIndexMode:d}),y=!0,A&&(w.push({id:j.id,type:"dimensions",dimensions:M}),j.expandParent&&j.parentId&&k.push({id:j.id,parentId:j.parentId,rect:Hi(R,a)}))}}if(k.length>0){const _=pf(k,r,o,a);w.push(..._)}return{changes:w,updatedInternals:y}}async function Kb({delta:e,panZoom:r,transform:o,translateExtent:i,width:a,height:c}){if(!r||!e.x&&!e.y)return Promise.resolve(!1);const d=await r.setViewportConstrained({x:o[0]+e.x,y:o[1]+e.y,zoom:o[2]},[[0,0],[a,c]],i),m=!!d&&(d.x!==o[0]||d.y!==o[1]||d.k!==o[2]);return Promise.resolve(m)}function Yh(e,r,o,i,a,c){let d=a;const m=i.get(d)||new Map;i.set(d,m.set(o,r)),d=`${a}-${e}`;const y=i.get(d)||new Map;if(i.set(d,y.set(o,r)),c){d=`${a}-${e}-${c}`;const w=i.get(d)||new Map;i.set(d,w.set(o,r))}}function U0(e,r,o){e.clear(),r.clear();for(const i of o){const{source:a,target:c,sourceHandle:d=null,targetHandle:m=null}=i,y={edgeId:i.id,source:a,target:c,sourceHandle:d,targetHandle:m},w=`${a}-${d}--${c}-${m}`,S=`${c}-${m}--${a}-${d}`;Yh("source",y,S,e,a,d),Yh("target",y,w,e,c,m),r.set(i.id,i)}}function K0(e,r){if(!e.parentId)return!1;const o=r.get(e.parentId);return o?o.selected?!0:K0(o,r):!1}function Xh(e,r,o){var a;let i=e;do{if((a=i==null?void 0:i.matches)!=null&&a.call(i,r))return!0;if(i===o)return!1;i=i==null?void 0:i.parentElement}while(i);return!1}function qb(e,r,o,i){const a=new Map;for(const[c,d]of e)if((d.selected||d.id===i)&&(!d.parentId||!K0(d,e))&&(d.draggable||r&&typeof d.draggable>"u")){const m=e.get(c);m&&a.set(c,{id:c,position:m.position||{x:0,y:0},distance:{x:o.x-m.internals.positionAbsolute.x,y:o.y-m.internals.positionAbsolute.y},extent:m.extent,parentId:m.parentId,origin:m.origin,expandParent:m.expandParent,internals:{positionAbsolute:m.internals.positionAbsolute||{x:0,y:0}},measured:{width:m.measured.width??0,height:m.measured.height??0}})}return a}function xd({nodeId:e,dragItems:r,nodeLookup:o,dragging:i=!0}){var d,m,y;const a=[];for(const[w,S]of r){const x=(d=o.get(w))==null?void 0:d.internals.userNode;x&&a.push({...x,position:S.position,dragging:i})}if(!e)return[a[0],a];const c=(m=o.get(e))==null?void 0:m.internals.userNode;return[c?{...c,position:((y=r.get(e))==null?void 0:y.position)||c.position,dragging:i}:a[0],a]}function Wb({dragItems:e,snapGrid:r,x:o,y:i}){const a=e.values().next().value;if(!a)return null;const c={x:o-a.distance.x,y:i-a.distance.y},d=Qa(c,r);return{x:d.x-c.x,y:d.y-c.y}}function Yb({onNodeMouseDown:e,getStoreItems:r,onDragStart:o,onDrag:i,onDragStop:a}){let c={x:null,y:null},d=0,m=new Map,y=!1,w={x:0,y:0},S=null,x=!1,k=null,_=!1,j=!1,M=null;function A({noDragClassName:U,handleSelector:P,domNode:$,isSelectable:R,nodeId:F,nodeClickDistance:W=0}){k=pr($);function ue({x:Q,y:ve}){const{nodeLookup:B,nodeExtent:ie,snapGrid:G,snapToGrid:se,nodeOrigin:H,onNodeDrag:q,onSelectionDrag:J,onError:D,updateNodePositions:K}=r();c={x:Q,y:ve};let Se=!1;const je=m.size>1,Le=je&&ie?Hd(Xa(m)):null,Ie=je&&se?Wb({dragItems:m,snapGrid:G,x:Q,y:ve}):null;for(const[Ee,Ne]of m){if(!B.has(Ee))continue;let Re={x:Q-Ne.distance.x,y:ve-Ne.distance.y};se&&(Re=Ie?{x:Math.round(Re.x+Ie.x),y:Math.round(Re.y+Ie.y)}:Qa(Re,G));let _e=null;if(je&&ie&&!Ne.extent&&Le){const{positionAbsolute:qe}=Ne.internals,mt=qe.x-Le.x+ie[0][0],dt=qe.x+Ne.measured.width-Le.x2+ie[1][0],gt=qe.y-Le.y+ie[0][1],It=qe.y+Ne.measured.height-Le.y2+ie[1][1];_e=[[mt,gt],[dt,It]]}const{position:tt,positionAbsolute:Fe}=P0({nodeId:Ee,nextPosition:Re,nodeLookup:B,nodeExtent:_e||ie,nodeOrigin:H,onError:D});Se=Se||Ne.position.x!==tt.x||Ne.position.y!==tt.y,Ne.position=tt,Ne.internals.positionAbsolute=Fe}if(j=j||Se,!!Se&&(K(m,!0),M&&(i||q||!F&&J))){const[Ee,Ne]=xd({nodeId:F,dragItems:m,nodeLookup:B});i==null||i(M,m,Ee,Ne),q==null||q(M,Ee,Ne),F||J==null||J(M,Ne)}}async function ne(){if(!S)return;const{transform:Q,panBy:ve,autoPanSpeed:B,autoPanOnNodeDrag:ie}=r();if(!ie){y=!1,cancelAnimationFrame(d);return}const[G,se]=M0(w,S,B);(G!==0||se!==0)&&(c.x=(c.x??0)-G/Q[2],c.y=(c.y??0)-se/Q[2],await ve({x:G,y:se})&&ue(c)),d=requestAnimationFrame(ne)}function ke(Q){var je;const{nodeLookup:ve,multiSelectionActive:B,nodesDraggable:ie,transform:G,snapGrid:se,snapToGrid:H,selectNodesOnDrag:q,onNodeDragStart:J,onSelectionDragStart:D,unselectNodesAndEdges:K}=r();x=!0,(!q||!R)&&!B&&F&&((je=ve.get(F))!=null&&je.selected||K()),R&&q&&F&&(e==null||e(F));const Se=Ta(Q.sourceEvent,{transform:G,snapGrid:se,snapToGrid:H,containerBounds:S});if(c=Se,m=qb(ve,ie,Se,F),m.size>0&&(o||J||!F&&D)){const[Le,Ie]=xd({nodeId:F,dragItems:m,nodeLookup:ve});o==null||o(Q.sourceEvent,m,Le,Ie),J==null||J(Q.sourceEvent,Le,Ie),F||D==null||D(Q.sourceEvent,Ie)}}const Y=l0().clickDistance(W).on("start",Q=>{const{domNode:ve,nodeDragThreshold:B,transform:ie,snapGrid:G,snapToGrid:se}=r();S=(ve==null?void 0:ve.getBoundingClientRect())||null,_=!1,j=!1,M=Q.sourceEvent,B===0&&ke(Q),c=Ta(Q.sourceEvent,{transform:ie,snapGrid:G,snapToGrid:se,containerBounds:S}),w=Qr(Q.sourceEvent,S)}).on("drag",Q=>{const{autoPanOnNodeDrag:ve,transform:B,snapGrid:ie,snapToGrid:G,nodeDragThreshold:se,nodeLookup:H}=r(),q=Ta(Q.sourceEvent,{transform:B,snapGrid:ie,snapToGrid:G,containerBounds:S});if(M=Q.sourceEvent,(Q.sourceEvent.type==="touchmove"&&Q.sourceEvent.touches.length>1||F&&!H.has(F))&&(_=!0),!_){if(!y&&ve&&x&&(y=!0,ne()),!x){const J=Qr(Q.sourceEvent,S),D=J.x-w.x,K=J.y-w.y;Math.sqrt(D*D+K*K)>se&&ke(Q)}(c.x!==q.xSnapped||c.y!==q.ySnapped)&&m&&x&&(w=Qr(Q.sourceEvent,S),ue(q))}}).on("end",Q=>{if(!(!x||_)&&(y=!1,x=!1,cancelAnimationFrame(d),m.size>0)){const{nodeLookup:ve,updateNodePositions:B,onNodeDragStop:ie,onSelectionDragStop:G}=r();if(j&&(B(m,!1),j=!1),a||ie||!F&&G){const[se,H]=xd({nodeId:F,dragItems:m,nodeLookup:ve,dragging:!1});a==null||a(Q.sourceEvent,m,se,H),ie==null||ie(Q.sourceEvent,se,H),F||G==null||G(Q.sourceEvent,H)}}}).filter(Q=>{const ve=Q.target;return!Q.button&&(!U||!Xh(ve,`.${U}`,$))&&(!P||Xh(ve,P,$))});k.call(Y)}function T(){k==null||k.on(".drag",null)}return{update:A,destroy:T}}function Xb(e,r,o){const i=[],a={x:e.x-o,y:e.y-o,width:o*2,height:o*2};for(const c of r.values())Ba(a,Hi(c))>0&&i.push(c);return i}const Qb=250;function Jb(e,r,o,i){var m,y;let a=[],c=1/0;const d=Xb(e,o,r+Qb);for(const w of d){const S=[...((m=w.internals.handleBounds)==null?void 0:m.source)??[],...((y=w.internals.handleBounds)==null?void 0:y.target)??[]];for(const x of S){if(i.nodeId===x.nodeId&&i.type===x.type&&i.id===x.id)continue;const{x:k,y:_}=Ys(w,x,x.position,!0),j=Math.sqrt(Math.pow(k-e.x,2)+Math.pow(_-e.y,2));j>r||(j<c?(a=[{...x,x:k,y:_}],c=j):j===c&&a.push({...x,x:k,y:_}))}}if(!a.length)return null;if(a.length>1){const w=i.type==="source"?"target":"source";return a.find(S=>S.type===w)??a[0]}return a[0]}function q0(e,r,o,i,a,c=!1){var w,S,x;const d=i.get(e);if(!d)return null;const m=a==="strict"?(w=d.internals.handleBounds)==null?void 0:w[r]:[...((S=d.internals.handleBounds)==null?void 0:S.source)??[],...((x=d.internals.handleBounds)==null?void 0:x.target)??[]],y=(o?m==null?void 0:m.find(k=>k.id===o):m==null?void 0:m[0])??null;return y&&c?{...y,...Ys(d,y,y.position,!0)}:y}function W0(e,r){return e||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function Gb(e,r){let o=null;return r?o=!0:e&&!r&&(o=!1),o}const Y0=()=>!0;function Zb(e,{connectionMode:r,connectionRadius:o,handleId:i,nodeId:a,edgeUpdaterType:c,isTarget:d,domNode:m,nodeLookup:y,lib:w,autoPanOnConnect:S,flowId:x,panBy:k,cancelConnection:_,onConnectStart:j,onConnect:M,onConnectEnd:A,isValidConnection:T=Y0,onReconnectEnd:U,updateConnection:P,getTransform:$,getFromHandle:R,autoPanSpeed:F,dragThreshold:W=1,handleDomNode:ue}){const ne=O0(e.target);let ke=0,Y;const{x:Q,y:ve}=Qr(e),B=W0(c,ue),ie=m==null?void 0:m.getBoundingClientRect();let G=!1;if(!ie||!B)return;const se=q0(a,B,i,y,r);if(!se)return;let H=Qr(e,ie),q=!1,J=null,D=!1,K=null;function Se(){if(!S||!ie)return;const[tt,Fe]=M0(H,ie,F);k({x:tt,y:Fe}),ke=requestAnimationFrame(Se)}const je={...se,nodeId:a,type:B,position:se.position},Le=y.get(a);let Ee={inProgress:!0,isValid:null,from:Ys(Le,je,ot.Left,!0),fromHandle:je,fromPosition:je.position,fromNode:Le,to:H,toHandle:null,toPosition:Rh[je.position],toNode:null,pointer:H};function Ne(){G=!0,P(Ee),j==null||j(e,{nodeId:a,handleId:i,handleType:B})}W===0&&Ne();function Re(tt){if(!G){const{x:It,y:mn}=Qr(tt),Zt=It-Q,en=mn-ve;if(!(Zt*Zt+en*en>W*W))return;Ne()}if(!R()||!je){_e(tt);return}const Fe=$();H=Qr(tt,ie),Y=Jb(Ja(H,Fe,!1,[1,1]),o,y,je),q||(Se(),q=!0);const qe=X0(tt,{handle:Y,connectionMode:r,fromNodeId:a,fromHandleId:i,fromType:d?"target":"source",isValidConnection:T,doc:ne,lib:w,flowId:x,nodeLookup:y});K=qe.handleDomNode,J=qe.connection,D=Gb(!!Y,qe.isValid);const mt=y.get(a),dt=mt?Ys(mt,je,ot.Left,!0):Ee.from,gt={...Ee,from:dt,isValid:D,to:qe.toHandle&&D?Pu({x:qe.toHandle.x,y:qe.toHandle.y},Fe):H,toHandle:qe.toHandle,toPosition:D&&qe.toHandle?qe.toHandle.position:Rh[je.position],toNode:qe.toHandle?y.get(qe.toHandle.nodeId):null,pointer:H};P(gt),Ee=gt}function _e(tt){if(!("touches"in tt&&tt.touches.length>0)){if(G){(Y||K)&&J&&D&&(M==null||M(J));const{inProgress:Fe,...qe}=Ee,mt={...qe,toPosition:Ee.toHandle?Ee.toPosition:null};A==null||A(tt,mt),c&&(U==null||U(tt,mt))}_(),cancelAnimationFrame(ke),q=!1,D=!1,J=null,K=null,ne.removeEventListener("mousemove",Re),ne.removeEventListener("mouseup",_e),ne.removeEventListener("touchmove",Re),ne.removeEventListener("touchend",_e)}}ne.addEventListener("mousemove",Re),ne.addEventListener("mouseup",_e),ne.addEventListener("touchmove",Re),ne.addEventListener("touchend",_e)}function X0(e,{handle:r,connectionMode:o,fromNodeId:i,fromHandleId:a,fromType:c,doc:d,lib:m,flowId:y,isValidConnection:w=Y0,nodeLookup:S}){const x=c==="target",k=r?d.querySelector(`.${m}-flow__handle[data-id="${y}-${r==null?void 0:r.nodeId}-${r==null?void 0:r.id}-${r==null?void 0:r.type}"]`):null,{x:_,y:j}=Qr(e),M=d.elementFromPoint(_,j),A=M!=null&&M.classList.contains(`${m}-flow__handle`)?M:k,T={handleDomNode:A,isValid:!1,connection:null,toHandle:null};if(A){const U=W0(void 0,A),P=A.getAttribute("data-nodeid"),$=A.getAttribute("data-handleid"),R=A.classList.contains("connectable"),F=A.classList.contains("connectableend");if(!P||!U)return T;const W={source:x?P:i,sourceHandle:x?$:a,target:x?i:P,targetHandle:x?a:$};T.connection=W;const ne=R&&F&&(o===Fi.Strict?x&&U==="source"||!x&&U==="target":P!==i||$!==a);T.isValid=ne&&w(W),T.toHandle=q0(P,U,$,S,o,!0)}return T}const qd={onPointerDown:Zb,isValid:X0};function ek({domNode:e,panZoom:r,getTransform:o,getViewScale:i}){const a=pr(e);function c({translateExtent:m,width:y,height:w,zoomStep:S=1,pannable:x=!0,zoomable:k=!0,inversePan:_=!1}){const j=P=>{if(P.sourceEvent.type!=="wheel"||!r)return;const $=o(),R=P.sourceEvent.ctrlKey&&Ha()?10:1,F=-P.sourceEvent.deltaY*(P.sourceEvent.deltaMode===1?.05:P.sourceEvent.deltaMode?1:.002)*S,W=$[2]*Math.pow(2,F*R);r.scaleTo(W)};let M=[0,0];const A=P=>{(P.sourceEvent.type==="mousedown"||P.sourceEvent.type==="touchstart")&&(M=[P.sourceEvent.clientX??P.sourceEvent.touches[0].clientX,P.sourceEvent.clientY??P.sourceEvent.touches[0].clientY])},T=P=>{const $=o();if(P.sourceEvent.type!=="mousemove"&&P.sourceEvent.type!=="touchmove"||!r)return;const R=[P.sourceEvent.clientX??P.sourceEvent.touches[0].clientX,P.sourceEvent.clientY??P.sourceEvent.touches[0].clientY],F=[R[0]-M[0],R[1]-M[1]];M=R;const W=i()*Math.max($[2],Math.log($[2]))*(_?-1:1),ue={x:$[0]-F[0]*W,y:$[1]-F[1]*W},ne=[[0,0],[y,w]];r.setViewportConstrained({x:ue.x,y:ue.y,zoom:$[2]},ne,m)},U=S0().on("start",A).on("zoom",x?T:null).on("zoom.wheel",k?j:null);a.call(U,{})}function d(){a.on("zoom",null)}return{update:c,destroy:d,pointer:Wr}}const Vu=e=>({x:e.x,y:e.y,zoom:e.k}),vd=({x:e,y:r,zoom:o})=>Fu.translate(e,r).scale(o),Mi=(e,r)=>e.target.closest(`.${r}`),Q0=(e,r)=>r===2&&Array.isArray(e)&&e.includes(2),tk=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,wd=(e,r=0,o=tk,i=()=>{})=>{const a=typeof r=="number"&&r>0;return a||i(),a?e.transition().duration(r).ease(o).on("end",i):e},J0=e=>{const r=e.ctrlKey&&Ha()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*r};function nk({zoomPanValues:e,noWheelClassName:r,d3Selection:o,d3Zoom:i,panOnScrollMode:a,panOnScrollSpeed:c,zoomOnPinch:d,onPanZoomStart:m,onPanZoom:y,onPanZoomEnd:w}){return S=>{if(Mi(S,r))return S.ctrlKey&&S.preventDefault(),!1;S.preventDefault(),S.stopImmediatePropagation();const x=o.property("__zoom").k||1;if(S.ctrlKey&&d){const A=Wr(S),T=J0(S),U=x*Math.pow(2,T);i.scaleTo(o,U,A,S);return}const k=S.deltaMode===1?20:1;let _=a===Us.Vertical?0:S.deltaX*k,j=a===Us.Horizontal?0:S.deltaY*k;!Ha()&&S.shiftKey&&a!==Us.Vertical&&(_=S.deltaY*k,j=0),i.translateBy(o,-(_/x)*c,-(j/x)*c,{internal:!0});const M=Vu(o.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(y==null||y(S,M),e.panScrollTimeout=setTimeout(()=>{w==null||w(S,M),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,m==null||m(S,M))}}function rk({noWheelClassName:e,preventScrolling:r,d3ZoomHandler:o}){return function(i,a){const c=i.type==="wheel",d=!r&&c&&!i.ctrlKey,m=Mi(i,e);if(i.ctrlKey&&c&&m&&i.preventDefault(),d||m)return null;i.preventDefault(),o.call(this,i,a)}}function ok({zoomPanValues:e,onDraggingChange:r,onPanZoomStart:o}){return i=>{var c,d,m;if((c=i.sourceEvent)!=null&&c.internal)return;const a=Vu(i.transform);e.mouseButton=((d=i.sourceEvent)==null?void 0:d.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,((m=i.sourceEvent)==null?void 0:m.type)==="mousedown"&&r(!0),o&&(o==null||o(i.sourceEvent,a))}}function sk({zoomPanValues:e,panOnDrag:r,onPaneContextMenu:o,onTransformChange:i,onPanZoom:a}){return c=>{var d,m;e.usedRightMouseButton=!!(o&&Q0(r,e.mouseButton??0)),(d=c.sourceEvent)!=null&&d.sync||i([c.transform.x,c.transform.y,c.transform.k]),a&&!((m=c.sourceEvent)!=null&&m.internal)&&(a==null||a(c.sourceEvent,Vu(c.transform)))}}function ik({zoomPanValues:e,panOnDrag:r,panOnScroll:o,onDraggingChange:i,onPanZoomEnd:a,onPaneContextMenu:c}){return d=>{var m;if(!((m=d.sourceEvent)!=null&&m.internal)&&(e.isZoomingOrPanning=!1,c&&Q0(r,e.mouseButton??0)&&!e.usedRightMouseButton&&d.sourceEvent&&c(d.sourceEvent),e.usedRightMouseButton=!1,i(!1),a)){const y=Vu(d.transform);e.prevViewport=y,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(d.sourceEvent,y)},o?150:0)}}}function ak({zoomActivationKeyPressed:e,zoomOnScroll:r,zoomOnPinch:o,panOnDrag:i,panOnScroll:a,zoomOnDoubleClick:c,userSelectionActive:d,noWheelClassName:m,noPanClassName:y,lib:w,connectionInProgress:S}){return x=>{var A;const k=e||r,_=o&&x.ctrlKey,j=x.type==="wheel";if(x.button===1&&x.type==="mousedown"&&(Mi(x,`${w}-flow__node`)||Mi(x,`${w}-flow__edge`)))return!0;if(!i&&!k&&!a&&!c&&!o||d||S&&!j||Mi(x,m)&&j||Mi(x,y)&&(!j||a&&j&&!e)||!o&&x.ctrlKey&&j)return!1;if(!o&&x.type==="touchstart"&&((A=x.touches)==null?void 0:A.length)>1)return x.preventDefault(),!1;if(!k&&!a&&!_&&j||!i&&(x.type==="mousedown"||x.type==="touchstart")||Array.isArray(i)&&!i.includes(x.button)&&x.type==="mousedown")return!1;const M=Array.isArray(i)&&i.includes(x.button)||!x.button||x.button<=1;return(!x.ctrlKey||j)&&M}}function lk({domNode:e,minZoom:r,maxZoom:o,translateExtent:i,viewport:a,onPanZoom:c,onPanZoomStart:d,onPanZoomEnd:m,onDraggingChange:y}){const w={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},S=e.getBoundingClientRect(),x=S0().scaleExtent([r,o]).translateExtent(i),k=pr(e).call(x);U({x:a.x,y:a.y,zoom:Bi(a.zoom,r,o)},[[0,0],[S.width,S.height]],i);const _=k.on("wheel.zoom"),j=k.on("dblclick.zoom");x.wheelDelta(J0);function M(Y,Q){return k?new Promise(ve=>{x==null||x.interpolate((Q==null?void 0:Q.interpolate)==="linear"?Ma:pu).transform(wd(k,Q==null?void 0:Q.duration,Q==null?void 0:Q.ease,()=>ve(!0)),Y)}):Promise.resolve(!1)}function A({noWheelClassName:Y,noPanClassName:Q,onPaneContextMenu:ve,userSelectionActive:B,panOnScroll:ie,panOnDrag:G,panOnScrollMode:se,panOnScrollSpeed:H,preventScrolling:q,zoomOnPinch:J,zoomOnScroll:D,zoomOnDoubleClick:K,zoomActivationKeyPressed:Se,lib:je,onTransformChange:Le,connectionInProgress:Ie,paneClickDistance:Ee,selectionOnDrag:Ne}){B&&!w.isZoomingOrPanning&&T();const Re=ie&&!Se&&!B;x.clickDistance(Ne?1/0:!Xr(Ee)||Ee<0?0:Ee);const _e=Re?nk({zoomPanValues:w,noWheelClassName:Y,d3Selection:k,d3Zoom:x,panOnScrollMode:se,panOnScrollSpeed:H,zoomOnPinch:J,onPanZoomStart:d,onPanZoom:c,onPanZoomEnd:m}):rk({noWheelClassName:Y,preventScrolling:q,d3ZoomHandler:_});if(k.on("wheel.zoom",_e,{passive:!1}),!B){const Fe=ok({zoomPanValues:w,onDraggingChange:y,onPanZoomStart:d});x.on("start",Fe);const qe=sk({zoomPanValues:w,panOnDrag:G,onPaneContextMenu:!!ve,onPanZoom:c,onTransformChange:Le});x.on("zoom",qe);const mt=ik({zoomPanValues:w,panOnDrag:G,panOnScroll:ie,onPaneContextMenu:ve,onPanZoomEnd:m,onDraggingChange:y});x.on("end",mt)}const tt=ak({zoomActivationKeyPressed:Se,panOnDrag:G,zoomOnScroll:D,panOnScroll:ie,zoomOnDoubleClick:K,zoomOnPinch:J,userSelectionActive:B,noPanClassName:Q,noWheelClassName:Y,lib:je,connectionInProgress:Ie});x.filter(tt),K?k.on("dblclick.zoom",j):k.on("dblclick.zoom",null)}function T(){x.on("zoom",null)}async function U(Y,Q,ve){const B=vd(Y),ie=x==null?void 0:x.constrain()(B,Q,ve);return ie&&await M(ie),new Promise(G=>G(ie))}async function P(Y,Q){const ve=vd(Y);return await M(ve,Q),new Promise(B=>B(ve))}function $(Y){if(k){const Q=vd(Y),ve=k.property("__zoom");(ve.k!==Y.zoom||ve.x!==Y.x||ve.y!==Y.y)&&(x==null||x.transform(k,Q,null,{sync:!0}))}}function R(){const Y=k?k0(k.node()):{x:0,y:0,k:1};return{x:Y.x,y:Y.y,zoom:Y.k}}function F(Y,Q){return k?new Promise(ve=>{x==null||x.interpolate((Q==null?void 0:Q.interpolate)==="linear"?Ma:pu).scaleTo(wd(k,Q==null?void 0:Q.duration,Q==null?void 0:Q.ease,()=>ve(!0)),Y)}):Promise.resolve(!1)}function W(Y,Q){return k?new Promise(ve=>{x==null||x.interpolate((Q==null?void 0:Q.interpolate)==="linear"?Ma:pu).scaleBy(wd(k,Q==null?void 0:Q.duration,Q==null?void 0:Q.ease,()=>ve(!0)),Y)}):Promise.resolve(!1)}function ue(Y){x==null||x.scaleExtent(Y)}function ne(Y){x==null||x.translateExtent(Y)}function ke(Y){const Q=!Xr(Y)||Y<0?0:Y;x==null||x.clickDistance(Q)}return{update:A,destroy:T,setViewport:P,setViewportConstrained:U,getViewport:R,scaleTo:F,scaleBy:W,setScaleExtent:ue,setTranslateExtent:ne,syncViewport:$,setClickDistance:ke}}var Ui;(function(e){e.Line="line",e.Handle="handle"})(Ui||(Ui={}));function uk({width:e,prevWidth:r,height:o,prevHeight:i,affectsX:a,affectsY:c}){const d=e-r,m=o-i,y=[d>0?1:d<0?-1:0,m>0?1:m<0?-1:0];return d&&a&&(y[0]=y[0]*-1),m&&c&&(y[1]=y[1]*-1),y}function Qh(e){const r=e.includes("right")||e.includes("left"),o=e.includes("bottom")||e.includes("top"),i=e.includes("left"),a=e.includes("top");return{isHorizontal:r,isVertical:o,affectsX:i,affectsY:a}}function ys(e,r){return Math.max(0,r-e)}function xs(e,r){return Math.max(0,e-r)}function su(e,r,o){return Math.max(0,r-e,e-o)}function Jh(e,r){return e?!r:r}function ck(e,r,o,i,a,c,d,m){let{affectsX:y,affectsY:w}=r;const{isHorizontal:S,isVertical:x}=r,k=S&&x,{xSnapped:_,ySnapped:j}=o,{minWidth:M,maxWidth:A,minHeight:T,maxHeight:U}=i,{x:P,y:$,width:R,height:F,aspectRatio:W}=e;let ue=Math.floor(S?_-e.pointerX:0),ne=Math.floor(x?j-e.pointerY:0);const ke=R+(y?-ue:ue),Y=F+(w?-ne:ne),Q=-c[0]*R,ve=-c[1]*F;let B=su(ke,M,A),ie=su(Y,T,U);if(d){let H=0,q=0;y&&ue<0?H=ys(P+ue+Q,d[0][0]):!y&&ue>0&&(H=xs(P+ke+Q,d[1][0])),w&&ne<0?q=ys($+ne+ve,d[0][1]):!w&&ne>0&&(q=xs($+Y+ve,d[1][1])),B=Math.max(B,H),ie=Math.max(ie,q)}if(m){let H=0,q=0;y&&ue>0?H=xs(P+ue,m[0][0]):!y&&ue<0&&(H=ys(P+ke,m[1][0])),w&&ne>0?q=xs($+ne,m[0][1]):!w&&ne<0&&(q=ys($+Y,m[1][1])),B=Math.max(B,H),ie=Math.max(ie,q)}if(a){if(S){const H=su(ke/W,T,U)*W;if(B=Math.max(B,H),d){let q=0;!y&&!w||y&&!w&&k?q=xs($+ve+ke/W,d[1][1])*W:q=ys($+ve+(y?ue:-ue)/W,d[0][1])*W,B=Math.max(B,q)}if(m){let q=0;!y&&!w||y&&!w&&k?q=ys($+ke/W,m[1][1])*W:q=xs($+(y?ue:-ue)/W,m[0][1])*W,B=Math.max(B,q)}}if(x){const H=su(Y*W,M,A)/W;if(ie=Math.max(ie,H),d){let q=0;!y&&!w||w&&!y&&k?q=xs(P+Y*W+Q,d[1][0])/W:q=ys(P+(w?ne:-ne)*W+Q,d[0][0])/W,ie=Math.max(ie,q)}if(m){let q=0;!y&&!w||w&&!y&&k?q=ys(P+Y*W,m[1][0])/W:q=xs(P+(w?ne:-ne)*W,m[0][0])/W,ie=Math.max(ie,q)}}}ne=ne+(ne<0?ie:-ie),ue=ue+(ue<0?B:-B),a&&(k?ke>Y*W?ne=(Jh(y,w)?-ue:ue)/W:ue=(Jh(y,w)?-ne:ne)*W:S?(ne=ue/W,w=y):(ue=ne*W,y=w));const G=y?P+ue:P,se=w?$+ne:$;return{width:R+(y?-ue:ue),height:F+(w?-ne:ne),x:c[0]*ue*(y?-1:1)+G,y:c[1]*ne*(w?-1:1)+se}}const G0={width:0,height:0,x:0,y:0},dk={...G0,pointerX:0,pointerY:0,aspectRatio:1};function fk(e){return[[0,0],[e.measured.width,e.measured.height]]}function pk(e,r,o){const i=r.position.x+e.position.x,a=r.position.y+e.position.y,c=e.measured.width??0,d=e.measured.height??0,m=o[0]*c,y=o[1]*d;return[[i-m,a-y],[i+c-m,a+d-y]]}function hk({domNode:e,nodeId:r,getStoreItems:o,onChange:i,onEnd:a}){const c=pr(e);let d={controlDirection:Qh("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function m({controlPosition:w,boundaries:S,keepAspectRatio:x,resizeDirection:k,onResizeStart:_,onResize:j,onResizeEnd:M,shouldResize:A}){let T={...G0},U={...dk};d={boundaries:S,resizeDirection:k,keepAspectRatio:x,controlDirection:Qh(w)};let P,$=null,R=[],F,W,ue,ne=!1;const ke=l0().on("start",Y=>{const{nodeLookup:Q,transform:ve,snapGrid:B,snapToGrid:ie,nodeOrigin:G,paneDomNode:se}=o();if(P=Q.get(r),!P)return;$=(se==null?void 0:se.getBoundingClientRect())??null;const{xSnapped:H,ySnapped:q}=Ta(Y.sourceEvent,{transform:ve,snapGrid:B,snapToGrid:ie,containerBounds:$});T={width:P.measured.width??0,height:P.measured.height??0,x:P.position.x??0,y:P.position.y??0},U={...T,pointerX:H,pointerY:q,aspectRatio:T.width/T.height},F=void 0,P.parentId&&(P.extent==="parent"||P.expandParent)&&(F=Q.get(P.parentId),W=F&&P.extent==="parent"?fk(F):void 0),R=[],ue=void 0;for(const[J,D]of Q)if(D.parentId===r&&(R.push({id:J,position:{...D.position},extent:D.extent}),D.extent==="parent"||D.expandParent)){const K=pk(D,P,D.origin??G);ue?ue=[[Math.min(K[0][0],ue[0][0]),Math.min(K[0][1],ue[0][1])],[Math.max(K[1][0],ue[1][0]),Math.max(K[1][1],ue[1][1])]]:ue=K}_==null||_(Y,{...T})}).on("drag",Y=>{const{transform:Q,snapGrid:ve,snapToGrid:B,nodeOrigin:ie}=o(),G=Ta(Y.sourceEvent,{transform:Q,snapGrid:ve,snapToGrid:B,containerBounds:$}),se=[];if(!P)return;const{x:H,y:q,width:J,height:D}=T,K={},Se=P.origin??ie,{width:je,height:Le,x:Ie,y:Ee}=ck(U,d.controlDirection,G,d.boundaries,d.keepAspectRatio,Se,W,ue),Ne=je!==J,Re=Le!==D,_e=Ie!==H&&Ne,tt=Ee!==q&&Re;if(!_e&&!tt&&!Ne&&!Re)return;if((_e||tt||Se[0]===1||Se[1]===1)&&(K.x=_e?Ie:T.x,K.y=tt?Ee:T.y,T.x=K.x,T.y=K.y,R.length>0)){const dt=Ie-H,gt=Ee-q;for(const It of R)It.position={x:It.position.x-dt+Se[0]*(je-J),y:It.position.y-gt+Se[1]*(Le-D)},se.push(It)}if((Ne||Re)&&(K.width=Ne&&(!d.resizeDirection||d.resizeDirection==="horizontal")?je:T.width,K.height=Re&&(!d.resizeDirection||d.resizeDirection==="vertical")?Le:T.height,T.width=K.width,T.height=K.height),F&&P.expandParent){const dt=Se[0]*(K.width??0);K.x&&K.x<dt&&(T.x=dt,U.x=U.x-(K.x-dt));const gt=Se[1]*(K.height??0);K.y&&K.y<gt&&(T.y=gt,U.y=U.y-(K.y-gt))}const Fe=uk({width:T.width,prevWidth:J,height:T.height,prevHeight:D,affectsX:d.controlDirection.affectsX,affectsY:d.controlDirection.affectsY}),qe={...T,direction:Fe};(A==null?void 0:A(Y,qe))!==!1&&(ne=!0,j==null||j(Y,qe),i(K,se))}).on("end",Y=>{ne&&(M==null||M(Y,{...T}),a==null||a({...T}),ne=!1)});c.call(ke)}function y(){c.on(".drag",null)}return{update:m,destroy:y}}var bd={exports:{}},kd={},Sd={exports:{}},Nd={};/**
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 Gh;function mk(){if(Gh)return Nd;Gh=1;var e=Ka();function r(x,k){return x===k&&(x!==0||1/x===1/k)||x!==x&&k!==k}var o=typeof Object.is=="function"?Object.is:r,i=e.useState,a=e.useEffect,c=e.useLayoutEffect,d=e.useDebugValue;function m(x,k){var _=k(),j=i({inst:{value:_,getSnapshot:k}}),M=j[0].inst,A=j[1];return c(function(){M.value=_,M.getSnapshot=k,y(M)&&A({inst:M})},[x,_,k]),a(function(){return y(M)&&A({inst:M}),x(function(){y(M)&&A({inst:M})})},[x]),d(_),_}function y(x){var k=x.getSnapshot;x=x.value;try{var _=k();return!o(x,_)}catch{return!0}}function w(x,k){return k()}var S=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?w:m;return Nd.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:S,Nd}var Zh;function gk(){return Zh||(Zh=1,Sd.exports=mk()),Sd.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 em;function yk(){if(em)return kd;em=1;var e=Ka(),r=gk();function o(w,S){return w===S&&(w!==0||1/w===1/S)||w!==w&&S!==S}var i=typeof Object.is=="function"?Object.is:o,a=r.useSyncExternalStore,c=e.useRef,d=e.useEffect,m=e.useMemo,y=e.useDebugValue;return kd.useSyncExternalStoreWithSelector=function(w,S,x,k,_){var j=c(null);if(j.current===null){var M={hasValue:!1,value:null};j.current=M}else M=j.current;j=m(function(){function T(F){if(!U){if(U=!0,P=F,F=k(F),_!==void 0&&M.hasValue){var W=M.value;if(_(W,F))return $=W}return $=F}if(W=$,i(P,F))return W;var ue=k(F);return _!==void 0&&_(W,ue)?(P=F,W):(P=F,$=ue)}var U=!1,P,$,R=x===void 0?null:x;return[function(){return T(S())},R===null?void 0:function(){return T(R())}]},[S,x,k,_]);var A=a(w,j[0],j[1]);return d(function(){M.hasValue=!0,M.value=A},[A]),y(A),A},kd}var tm;function xk(){return tm||(tm=1,bd.exports=yk()),bd.exports}var vk=xk();const wk=Mu(vk),bk={},nm=e=>{let r;const o=new Set,i=(S,x)=>{const k=typeof S=="function"?S(r):S;if(!Object.is(k,r)){const _=r;r=x??(typeof k!="object"||k===null)?k:Object.assign({},r,k),o.forEach(j=>j(r,_))}},a=()=>r,y={setState:i,getState:a,getInitialState:()=>w,subscribe:S=>(o.add(S),()=>o.delete(S)),destroy:()=>{(bk?"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."),o.clear()}},w=r=e(i,a,y);return y},kk=e=>e?nm(e):nm,{useDebugValue:Sk}=Dm,{useSyncExternalStoreWithSelector:Nk}=wk,_k=e=>e;function Z0(e,r=_k,o){const i=Nk(e.subscribe,e.getState,e.getServerState||e.getInitialState,r,o);return Sk(i),i}const rm=(e,r)=>{const o=kk(e),i=(a,c=r)=>Z0(o,a,c);return Object.assign(i,o),i},jk=(e,r)=>e?rm(e,r):rm;function Yt(e,r){if(Object.is(e,r))return!0;if(typeof e!="object"||e===null||typeof r!="object"||r===null)return!1;if(e instanceof Map&&r instanceof Map){if(e.size!==r.size)return!1;for(const[i,a]of e)if(!Object.is(a,r.get(i)))return!1;return!0}if(e instanceof Set&&r instanceof Set){if(e.size!==r.size)return!1;for(const i of e)if(!r.has(i))return!1;return!0}const o=Object.keys(e);if(o.length!==Object.keys(r).length)return!1;for(const i of o)if(!Object.prototype.hasOwnProperty.call(r,i)||!Object.is(e[i],r[i]))return!1;return!0}var eg=zm();const Uu=L.createContext(null),Ek=Uu.Provider,tg=po.error001();function Et(e,r){const o=L.useContext(Uu);if(o===null)throw new Error(tg);return Z0(o,e,r)}function qt(){const e=L.useContext(Uu);if(e===null)throw new Error(tg);return L.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const om={display:"none"},Ck={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ng="react-flow__node-desc",rg="react-flow__edge-desc",Pk="react-flow__aria-live",$k=e=>e.ariaLiveMessage,Mk=e=>e.ariaLabelConfig;function Tk({rfId:e}){const r=Et($k);return p.jsx("div",{id:`${Pk}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Ck,children:r})}function Ik({rfId:e,disableKeyboardA11y:r}){const o=Et(Mk);return p.jsxs(p.Fragment,{children:[p.jsx("div",{id:`${ng}-${e}`,style:om,children:r?o["node.a11yDescription.default"]:o["node.a11yDescription.keyboardDisabled"]}),p.jsx("div",{id:`${rg}-${e}`,style:om,children:o["edge.a11yDescription.default"]}),!r&&p.jsx(Tk,{rfId:e})]})}const Ga=L.forwardRef(({position:e="top-left",children:r,className:o,style:i,...a},c)=>{const d=`${e}`.split("-");return p.jsx("div",{className:hn(["react-flow__panel",o,...d]),style:i,ref:c,...a,children:r})});Ga.displayName="Panel";function Ak({proOptions:e,position:r="bottom-right"}){return e!=null&&e.hideAttribution?null:p.jsx(Ga,{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:p.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Ok=e=>{const r=[],o=[];for(const[,i]of e.nodeLookup)i.selected&&r.push(i.internals.userNode);for(const[,i]of e.edgeLookup)i.selected&&o.push(i);return{selectedNodes:r,selectedEdges:o}},iu=e=>e.id;function Lk(e,r){return Yt(e.selectedNodes.map(iu),r.selectedNodes.map(iu))&&Yt(e.selectedEdges.map(iu),r.selectedEdges.map(iu))}function Rk({onSelectionChange:e}){const r=qt(),{selectedNodes:o,selectedEdges:i}=Et(Ok,Lk);return L.useEffect(()=>{const a={nodes:o,edges:i};e==null||e(a),r.getState().onSelectionChangeHandlers.forEach(c=>c(a))},[o,i,e]),null}const Dk=e=>!!e.onSelectionChangeHandlers;function zk({onSelectionChange:e}){const r=Et(Dk);return e||r?p.jsx(Rk,{onSelectionChange:e}):null}const Wd=typeof window<"u"?L.useLayoutEffect:L.useEffect,og=[0,0],Fk={x:0,y:0,zoom:1},Bk=["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"],sm=[...Bk,"rfId"],Hk=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),im={translateExtent:za,nodeOrigin:og,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Vk(e){const{setNodes:r,setEdges:o,setMinZoom:i,setMaxZoom:a,setTranslateExtent:c,setNodeExtent:d,reset:m,setDefaultNodesAndEdges:y}=Et(Hk,Yt),w=qt();Wd(()=>(y(e.defaultNodes,e.defaultEdges),()=>{S.current=im,m()}),[]);const S=L.useRef(im);return Wd(()=>{for(const x of sm){const k=e[x],_=S.current[x];k!==_&&(typeof e[x]>"u"||(x==="nodes"?r(k):x==="edges"?o(k):x==="minZoom"?i(k):x==="maxZoom"?a(k):x==="translateExtent"?c(k):x==="nodeExtent"?d(k):x==="ariaLabelConfig"?w.setState({ariaLabelConfig:Eb(k)}):x==="fitView"?w.setState({fitViewQueued:k}):x==="fitViewOptions"?w.setState({fitViewOptions:k}):w.setState({[x]:k})))}S.current=e},sm.map(x=>e[x])),null}function am(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Uk(e){var i;const[r,o]=L.useState(e==="system"?null:e);return L.useEffect(()=>{if(e!=="system"){o(e);return}const a=am(),c=()=>o(a!=null&&a.matches?"dark":"light");return c(),a==null||a.addEventListener("change",c),()=>{a==null||a.removeEventListener("change",c)}},[e]),r!==null?r:(i=am())!=null&&i.matches?"dark":"light"}const lm=typeof document<"u"?document:null;function Va(e=null,r={target:lm,actInsideInputWithModifier:!0}){const[o,i]=L.useState(!1),a=L.useRef(!1),c=L.useRef(new Set([])),[d,m]=L.useMemo(()=>{if(e!==null){const w=(Array.isArray(e)?e:[e]).filter(x=>typeof x=="string").map(x=>x.replace("+",`
197
+ `).replace(`
198
+
199
+ `,`
200
+ +`).split(`
201
+ `)),S=w.reduce((x,k)=>x.concat(...k),[]);return[w,S]}return[[],[]]},[e]);return L.useEffect(()=>{const y=(r==null?void 0:r.target)??lm,w=(r==null?void 0:r.actInsideInputWithModifier)??!0;if(e!==null){const S=_=>{var A,T;if(a.current=_.ctrlKey||_.metaKey||_.shiftKey||_.altKey,(!a.current||a.current&&!w)&&L0(_))return!1;const M=cm(_.code,m);if(c.current.add(_[M]),um(d,c.current,!1)){const U=((T=(A=_.composedPath)==null?void 0:A.call(_))==null?void 0:T[0])||_.target,P=(U==null?void 0:U.nodeName)==="BUTTON"||(U==null?void 0:U.nodeName)==="A";r.preventDefault!==!1&&(a.current||!P)&&_.preventDefault(),i(!0)}},x=_=>{const j=cm(_.code,m);um(d,c.current,!0)?(i(!1),c.current.clear()):c.current.delete(_[j]),_.key==="Meta"&&c.current.clear(),a.current=!1},k=()=>{c.current.clear(),i(!1)};return y==null||y.addEventListener("keydown",S),y==null||y.addEventListener("keyup",x),window.addEventListener("blur",k),window.addEventListener("contextmenu",k),()=>{y==null||y.removeEventListener("keydown",S),y==null||y.removeEventListener("keyup",x),window.removeEventListener("blur",k),window.removeEventListener("contextmenu",k)}}},[e,i]),o}function um(e,r,o){return e.filter(i=>o||i.length===r.size).some(i=>i.every(a=>r.has(a)))}function cm(e,r){return r.includes(e)?"code":"key"}const Kk=()=>{const e=qt();return L.useMemo(()=>({zoomIn:r=>{const{panZoom:o}=e.getState();return o?o.scaleBy(1.2,r):Promise.resolve(!1)},zoomOut:r=>{const{panZoom:o}=e.getState();return o?o.scaleBy(1/1.2,r):Promise.resolve(!1)},zoomTo:(r,o)=>{const{panZoom:i}=e.getState();return i?i.scaleTo(r,o):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(r,o)=>{const{transform:[i,a,c],panZoom:d}=e.getState();return d?(await d.setViewport({x:r.x??i,y:r.y??a,zoom:r.zoom??c},o),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[r,o,i]=e.getState().transform;return{x:r,y:o,zoom:i}},setCenter:async(r,o,i)=>e.getState().setCenter(r,o,i),fitBounds:async(r,o)=>{const{width:i,height:a,minZoom:c,maxZoom:d,panZoom:m}=e.getState(),y=sf(r,i,a,c,d,(o==null?void 0:o.padding)??.1);return m?(await m.setViewport(y,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(r,o={})=>{const{transform:i,snapGrid:a,snapToGrid:c,domNode:d}=e.getState();if(!d)return r;const{x:m,y}=d.getBoundingClientRect(),w={x:r.x-m,y:r.y-y},S=o.snapGrid??a,x=o.snapToGrid??c;return Ja(w,i,x,S)},flowToScreenPosition:r=>{const{transform:o,domNode:i}=e.getState();if(!i)return r;const{x:a,y:c}=i.getBoundingClientRect(),d=Pu(r,o);return{x:d.x+a,y:d.y+c}}}),[])};function sg(e,r){const o=[],i=new Map,a=[];for(const c of e)if(c.type==="add"){a.push(c);continue}else if(c.type==="remove"||c.type==="replace")i.set(c.id,[c]);else{const d=i.get(c.id);d?d.push(c):i.set(c.id,[c])}for(const c of r){const d=i.get(c.id);if(!d){o.push(c);continue}if(d[0].type==="remove")continue;if(d[0].type==="replace"){o.push({...d[0].item});continue}const m={...c};for(const y of d)qk(y,m);o.push(m)}return a.length&&a.forEach(c=>{c.index!==void 0?o.splice(c.index,0,{...c.item}):o.push({...c.item})}),o}function qk(e,r){switch(e.type){case"select":{r.selected=e.selected;break}case"position":{typeof e.position<"u"&&(r.position=e.position),typeof e.dragging<"u"&&(r.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(r.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(r.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(r.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(r.resizing=e.resizing);break}}}function ig(e,r){return sg(e,r)}function ag(e,r){return sg(e,r)}function Bs(e,r){return{id:e,type:"select",selected:r}}function Ti(e,r=new Set,o=!1){const i=[];for(const[a,c]of e){const d=r.has(a);!(c.selected===void 0&&!d)&&c.selected!==d&&(o&&(c.selected=d),i.push(Bs(c.id,d)))}return i}function dm({items:e=[],lookup:r}){var a;const o=[],i=new Map(e.map(c=>[c.id,c]));for(const[c,d]of e.entries()){const m=r.get(d.id),y=((a=m==null?void 0:m.internals)==null?void 0:a.userNode)??m;y!==void 0&&y!==d&&o.push({id:d.id,item:d,type:"replace"}),y===void 0&&o.push({item:d,type:"add",index:c})}for(const[c]of r)i.get(c)===void 0&&o.push({id:c,type:"remove"});return o}function fm(e){return{id:e.id,type:"remove"}}const pm=e=>yb(e),Wk=e=>C0(e);function lg(e){return L.forwardRef(e)}function hm(e){const[r,o]=L.useState(BigInt(0)),[i]=L.useState(()=>Yk(()=>o(a=>a+BigInt(1))));return Wd(()=>{const a=i.get();a.length&&(e(a),i.reset())},[r]),i}function Yk(e){let r=[];return{get:()=>r,reset:()=>{r=[]},push:o=>{r.push(o),e()}}}const ug=L.createContext(null);function Xk({children:e}){const r=qt(),o=L.useCallback(m=>{const{nodes:y=[],setNodes:w,hasDefaultNodes:S,onNodesChange:x,nodeLookup:k,fitViewQueued:_,onNodesChangeMiddlewareMap:j}=r.getState();let M=y;for(const T of m)M=typeof T=="function"?T(M):T;let A=dm({items:M,lookup:k});for(const T of j.values())A=T(A);S&&w(M),A.length>0?x==null||x(A):_&&window.requestAnimationFrame(()=>{const{fitViewQueued:T,nodes:U,setNodes:P}=r.getState();T&&P(U)})},[]),i=hm(o),a=L.useCallback(m=>{const{edges:y=[],setEdges:w,hasDefaultEdges:S,onEdgesChange:x,edgeLookup:k}=r.getState();let _=y;for(const j of m)_=typeof j=="function"?j(_):j;S?w(_):x&&x(dm({items:_,lookup:k}))},[]),c=hm(a),d=L.useMemo(()=>({nodeQueue:i,edgeQueue:c}),[]);return p.jsx(ug.Provider,{value:d,children:e})}function Qk(){const e=L.useContext(ug);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Jk=e=>!!e.panZoom;function hf(){const e=Kk(),r=qt(),o=Qk(),i=Et(Jk),a=L.useMemo(()=>{const c=x=>r.getState().nodeLookup.get(x),d=x=>{o.nodeQueue.push(x)},m=x=>{o.edgeQueue.push(x)},y=x=>{var T,U;const{nodeLookup:k,nodeOrigin:_}=r.getState(),j=pm(x)?x:k.get(x.id),M=j.parentId?A0(j.position,j.measured,j.parentId,k,_):j.position,A={...j,position:M,width:((T=j.measured)==null?void 0:T.width)??j.width,height:((U=j.measured)==null?void 0:U.height)??j.height};return Hi(A)},w=(x,k,_={replace:!1})=>{d(j=>j.map(M=>{if(M.id===x){const A=typeof k=="function"?k(M):k;return _.replace&&pm(A)?A:{...M,...A}}return M}))},S=(x,k,_={replace:!1})=>{m(j=>j.map(M=>{if(M.id===x){const A=typeof k=="function"?k(M):k;return _.replace&&Wk(A)?A:{...M,...A}}return M}))};return{getNodes:()=>r.getState().nodes.map(x=>({...x})),getNode:x=>{var k;return(k=c(x))==null?void 0:k.internals.userNode},getInternalNode:c,getEdges:()=>{const{edges:x=[]}=r.getState();return x.map(k=>({...k}))},getEdge:x=>r.getState().edgeLookup.get(x),setNodes:d,setEdges:m,addNodes:x=>{const k=Array.isArray(x)?x:[x];o.nodeQueue.push(_=>[..._,...k])},addEdges:x=>{const k=Array.isArray(x)?x:[x];o.edgeQueue.push(_=>[..._,...k])},toObject:()=>{const{nodes:x=[],edges:k=[],transform:_}=r.getState(),[j,M,A]=_;return{nodes:x.map(T=>({...T})),edges:k.map(T=>({...T})),viewport:{x:j,y:M,zoom:A}}},deleteElements:async({nodes:x=[],edges:k=[]})=>{const{nodes:_,edges:j,onNodesDelete:M,onEdgesDelete:A,triggerNodeChanges:T,triggerEdgeChanges:U,onDelete:P,onBeforeDelete:$}=r.getState(),{nodes:R,edges:F}=await kb({nodesToRemove:x,edgesToRemove:k,nodes:_,edges:j,onBeforeDelete:$}),W=F.length>0,ue=R.length>0;if(W){const ne=F.map(fm);A==null||A(F),U(ne)}if(ue){const ne=R.map(fm);M==null||M(R),T(ne)}return(ue||W)&&(P==null||P({nodes:R,edges:F})),{deletedNodes:R,deletedEdges:F}},getIntersectingNodes:(x,k=!0,_)=>{const j=zh(x),M=j?x:y(x),A=_!==void 0;return M?(_||r.getState().nodes).filter(T=>{const U=r.getState().nodeLookup.get(T.id);if(U&&!j&&(T.id===x.id||!U.internals.positionAbsolute))return!1;const P=Hi(A?T:U),$=Ba(P,M);return k&&$>0||$>=P.width*P.height||$>=M.width*M.height}):[]},isNodeIntersecting:(x,k,_=!0)=>{const M=zh(x)?x:y(x);if(!M)return!1;const A=Ba(M,k);return _&&A>0||A>=k.width*k.height||A>=M.width*M.height},updateNode:w,updateNodeData:(x,k,_={replace:!1})=>{w(x,j=>{const M=typeof k=="function"?k(j):k;return _.replace?{...j,data:M}:{...j,data:{...j.data,...M}}},_)},updateEdge:S,updateEdgeData:(x,k,_={replace:!1})=>{S(x,j=>{const M=typeof k=="function"?k(j):k;return _.replace?{...j,data:M}:{...j,data:{...j.data,...M}}},_)},getNodesBounds:x=>{const{nodeLookup:k,nodeOrigin:_}=r.getState();return xb(x,{nodeLookup:k,nodeOrigin:_})},getHandleConnections:({type:x,id:k,nodeId:_})=>{var j;return Array.from(((j=r.getState().connectionLookup.get(`${_}-${x}${k?`-${k}`:""}`))==null?void 0:j.values())??[])},getNodeConnections:({type:x,handleId:k,nodeId:_})=>{var j;return Array.from(((j=r.getState().connectionLookup.get(`${_}${x?k?`-${x}-${k}`:`-${x}`:""}`))==null?void 0:j.values())??[])},fitView:async x=>{const k=r.getState().fitViewResolver??jb();return r.setState({fitViewQueued:!0,fitViewOptions:x,fitViewResolver:k}),o.nodeQueue.push(_=>[..._]),k.promise}}},[]);return L.useMemo(()=>({...a,...e,viewportInitialized:i}),[i])}const mm=e=>e.selected,Gk=typeof window<"u"?window:void 0;function Zk({deleteKeyCode:e,multiSelectionKeyCode:r}){const o=qt(),{deleteElements:i}=hf(),a=Va(e,{actInsideInputWithModifier:!1}),c=Va(r,{target:Gk});L.useEffect(()=>{if(a){const{edges:d,nodes:m}=o.getState();i({nodes:m.filter(mm),edges:d.filter(mm)}),o.setState({nodesSelectionActive:!1})}},[a]),L.useEffect(()=>{o.setState({multiSelectionActive:c})},[c])}function eS(e){const r=qt();L.useEffect(()=>{const o=()=>{var a,c,d,m;if(!e.current||!(((c=(a=e.current).checkVisibility)==null?void 0:c.call(a))??!0))return!1;const i=af(e.current);(i.height===0||i.width===0)&&((m=(d=r.getState()).onError)==null||m.call(d,"004",po.error004())),r.setState({width:i.width||500,height:i.height||500})};if(e.current){o(),window.addEventListener("resize",o);const i=new ResizeObserver(()=>o());return i.observe(e.current),()=>{window.removeEventListener("resize",o),i&&e.current&&i.unobserve(e.current)}}},[])}const Ku={position:"absolute",width:"100%",height:"100%",top:0,left:0},tS=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function nS({onPaneContextMenu:e,zoomOnScroll:r=!0,zoomOnPinch:o=!0,panOnScroll:i=!1,panOnScrollSpeed:a=.5,panOnScrollMode:c=Us.Free,zoomOnDoubleClick:d=!0,panOnDrag:m=!0,defaultViewport:y,translateExtent:w,minZoom:S,maxZoom:x,zoomActivationKeyCode:k,preventScrolling:_=!0,children:j,noWheelClassName:M,noPanClassName:A,onViewportChange:T,isControlledViewport:U,paneClickDistance:P,selectionOnDrag:$}){const R=qt(),F=L.useRef(null),{userSelectionActive:W,lib:ue,connectionInProgress:ne}=Et(tS,Yt),ke=Va(k),Y=L.useRef();eS(F);const Q=L.useCallback(ve=>{T==null||T({x:ve[0],y:ve[1],zoom:ve[2]}),U||R.setState({transform:ve})},[T,U]);return L.useEffect(()=>{if(F.current){Y.current=lk({domNode:F.current,minZoom:S,maxZoom:x,translateExtent:w,viewport:y,onDraggingChange:G=>R.setState(se=>se.paneDragging===G?se:{paneDragging:G}),onPanZoomStart:(G,se)=>{const{onViewportChangeStart:H,onMoveStart:q}=R.getState();q==null||q(G,se),H==null||H(se)},onPanZoom:(G,se)=>{const{onViewportChange:H,onMove:q}=R.getState();q==null||q(G,se),H==null||H(se)},onPanZoomEnd:(G,se)=>{const{onViewportChangeEnd:H,onMoveEnd:q}=R.getState();q==null||q(G,se),H==null||H(se)}});const{x:ve,y:B,zoom:ie}=Y.current.getViewport();return R.setState({panZoom:Y.current,transform:[ve,B,ie],domNode:F.current.closest(".react-flow")}),()=>{var G;(G=Y.current)==null||G.destroy()}}},[]),L.useEffect(()=>{var ve;(ve=Y.current)==null||ve.update({onPaneContextMenu:e,zoomOnScroll:r,zoomOnPinch:o,panOnScroll:i,panOnScrollSpeed:a,panOnScrollMode:c,zoomOnDoubleClick:d,panOnDrag:m,zoomActivationKeyPressed:ke,preventScrolling:_,noPanClassName:A,userSelectionActive:W,noWheelClassName:M,lib:ue,onTransformChange:Q,connectionInProgress:ne,selectionOnDrag:$,paneClickDistance:P})},[e,r,o,i,a,c,d,m,ke,_,A,W,M,ue,Q,ne,$,P]),p.jsx("div",{className:"react-flow__renderer",ref:F,style:Ku,children:j})}const rS=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function oS(){const{userSelectionActive:e,userSelectionRect:r}=Et(rS,Yt);return e&&r?p.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 _d=(e,r)=>o=>{o.target===r.current&&(e==null||e(o))},sS=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function iS({isSelecting:e,selectionKeyPressed:r,selectionMode:o=Fa.Full,panOnDrag:i,paneClickDistance:a,selectionOnDrag:c,onSelectionStart:d,onSelectionEnd:m,onPaneClick:y,onPaneContextMenu:w,onPaneScroll:S,onPaneMouseEnter:x,onPaneMouseMove:k,onPaneMouseLeave:_,children:j}){const M=qt(),{userSelectionActive:A,elementsSelectable:T,dragging:U,connectionInProgress:P}=Et(sS,Yt),$=T&&(e||A),R=L.useRef(null),F=L.useRef(),W=L.useRef(new Set),ue=L.useRef(new Set),ne=L.useRef(!1),ke=H=>{if(ne.current||P){ne.current=!1;return}y==null||y(H),M.getState().resetSelectedElements(),M.setState({nodesSelectionActive:!1})},Y=H=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){H.preventDefault();return}w==null||w(H)},Q=S?H=>S(H):void 0,ve=H=>{ne.current&&(H.stopPropagation(),ne.current=!1)},B=H=>{var Le,Ie;const{domNode:q}=M.getState();if(F.current=q==null?void 0:q.getBoundingClientRect(),!F.current)return;const J=H.target===R.current;if(!J&&!!H.target.closest(".nokey")||!e||!(c&&J||r)||H.button!==0||!H.isPrimary)return;(Ie=(Le=H.target)==null?void 0:Le.setPointerCapture)==null||Ie.call(Le,H.pointerId),ne.current=!1;const{x:Se,y:je}=Qr(H.nativeEvent,F.current);M.setState({userSelectionRect:{width:0,height:0,startX:Se,startY:je,x:Se,y:je}}),J||(H.stopPropagation(),H.preventDefault())},ie=H=>{const{userSelectionRect:q,transform:J,nodeLookup:D,edgeLookup:K,connectionLookup:Se,triggerNodeChanges:je,triggerEdgeChanges:Le,defaultEdgeOptions:Ie,resetSelectedElements:Ee}=M.getState();if(!F.current||!q)return;const{x:Ne,y:Re}=Qr(H.nativeEvent,F.current),{startX:_e,startY:tt}=q;if(!ne.current){const gt=r?0:a;if(Math.hypot(Ne-_e,Re-tt)<=gt)return;Ee(),d==null||d(H)}ne.current=!0;const Fe={startX:_e,startY:tt,x:Ne<_e?Ne:_e,y:Re<tt?Re:tt,width:Math.abs(Ne-_e),height:Math.abs(Re-tt)},qe=W.current,mt=ue.current;W.current=new Set(of(D,Fe,J,o===Fa.Partial,!0).map(gt=>gt.id)),ue.current=new Set;const dt=(Ie==null?void 0:Ie.selectable)??!0;for(const gt of W.current){const It=Se.get(gt);if(It)for(const{edgeId:mn}of It.values()){const Zt=K.get(mn);Zt&&(Zt.selectable??dt)&&ue.current.add(mn)}}if(!Fh(qe,W.current)){const gt=Ti(D,W.current,!0);je(gt)}if(!Fh(mt,ue.current)){const gt=Ti(K,ue.current);Le(gt)}M.setState({userSelectionRect:Fe,userSelectionActive:!0,nodesSelectionActive:!1})},G=H=>{var q,J;H.button===0&&((J=(q=H.target)==null?void 0:q.releasePointerCapture)==null||J.call(q,H.pointerId),!A&&H.target===R.current&&M.getState().userSelectionRect&&(ke==null||ke(H)),M.setState({userSelectionActive:!1,userSelectionRect:null}),ne.current&&(m==null||m(H),M.setState({nodesSelectionActive:W.current.size>0})))},se=i===!0||Array.isArray(i)&&i.includes(0);return p.jsxs("div",{className:hn(["react-flow__pane",{draggable:se,dragging:U,selection:e}]),onClick:$?void 0:_d(ke,R),onContextMenu:_d(Y,R),onWheel:_d(Q,R),onPointerEnter:$?void 0:x,onPointerMove:$?ie:k,onPointerUp:$?G:void 0,onPointerDownCapture:$?B:void 0,onClickCapture:$?ve:void 0,onPointerLeave:_,ref:R,style:Ku,children:[j,p.jsx(oS,{})]})}function Yd({id:e,store:r,unselect:o=!1,nodeRef:i}){const{addSelectedNodes:a,unselectNodesAndEdges:c,multiSelectionActive:d,nodeLookup:m,onError:y}=r.getState(),w=m.get(e);if(!w){y==null||y("012",po.error012(e));return}r.setState({nodesSelectionActive:!1}),w.selected?(o||w.selected&&d)&&(c({nodes:[w],edges:[]}),requestAnimationFrame(()=>{var S;return(S=i==null?void 0:i.current)==null?void 0:S.blur()})):a([e])}function cg({nodeRef:e,disabled:r=!1,noDragClassName:o,handleSelector:i,nodeId:a,isSelectable:c,nodeClickDistance:d}){const m=qt(),[y,w]=L.useState(!1),S=L.useRef();return L.useEffect(()=>{S.current=Yb({getStoreItems:()=>m.getState(),onNodeMouseDown:x=>{Yd({id:x,store:m,nodeRef:e})},onDragStart:()=>{w(!0)},onDragStop:()=>{w(!1)}})},[]),L.useEffect(()=>{if(!(r||!e.current||!S.current))return S.current.update({noDragClassName:o,handleSelector:i,domNode:e.current,isSelectable:c,nodeId:a,nodeClickDistance:d}),()=>{var x;(x=S.current)==null||x.destroy()}},[o,i,r,c,e,a,d]),y}const aS=e=>r=>r.selected&&(r.draggable||e&&typeof r.draggable>"u");function dg(){const e=qt();return L.useCallback(o=>{const{nodeExtent:i,snapToGrid:a,snapGrid:c,nodesDraggable:d,onError:m,updateNodePositions:y,nodeLookup:w,nodeOrigin:S}=e.getState(),x=new Map,k=aS(d),_=a?c[0]:5,j=a?c[1]:5,M=o.direction.x*_*o.factor,A=o.direction.y*j*o.factor;for(const[,T]of w){if(!k(T))continue;let U={x:T.internals.positionAbsolute.x+M,y:T.internals.positionAbsolute.y+A};a&&(U=Qa(U,c));const{position:P,positionAbsolute:$}=P0({nodeId:T.id,nextPosition:U,nodeLookup:w,nodeExtent:i,nodeOrigin:S,onError:m});T.position=P,T.internals.positionAbsolute=$,x.set(T.id,T)}y(x)},[])}const mf=L.createContext(null),lS=mf.Provider;mf.Consumer;const fg=()=>L.useContext(mf),uS=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),cS=(e,r,o)=>i=>{const{connectionClickStartHandle:a,connectionMode:c,connection:d}=i,{fromHandle:m,toHandle:y,isValid:w}=d,S=(y==null?void 0:y.nodeId)===e&&(y==null?void 0:y.id)===r&&(y==null?void 0:y.type)===o;return{connectingFrom:(m==null?void 0:m.nodeId)===e&&(m==null?void 0:m.id)===r&&(m==null?void 0:m.type)===o,connectingTo:S,clickConnecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===r&&(a==null?void 0:a.type)===o,isPossibleEndHandle:c===Fi.Strict?(m==null?void 0:m.type)!==o:e!==(m==null?void 0:m.nodeId)||r!==(m==null?void 0:m.id),connectionInProcess:!!m,clickConnectionInProcess:!!a,valid:S&&w}};function dS({type:e="source",position:r=ot.Top,isValidConnection:o,isConnectable:i=!0,isConnectableStart:a=!0,isConnectableEnd:c=!0,id:d,onConnect:m,children:y,className:w,onMouseDown:S,onTouchStart:x,...k},_){var ie,G;const j=d||null,M=e==="target",A=qt(),T=fg(),{connectOnClick:U,noPanClassName:P,rfId:$}=Et(uS,Yt),{connectingFrom:R,connectingTo:F,clickConnecting:W,isPossibleEndHandle:ue,connectionInProcess:ne,clickConnectionInProcess:ke,valid:Y}=Et(cS(T,j,e),Yt);T||(G=(ie=A.getState()).onError)==null||G.call(ie,"010",po.error010());const Q=se=>{const{defaultEdgeOptions:H,onConnect:q,hasDefaultEdges:J}=A.getState(),D={...H,...se};if(J){const{edges:K,setEdges:Se}=A.getState();Se(F0(D,K))}q==null||q(D),m==null||m(D)},ve=se=>{if(!T)return;const H=R0(se.nativeEvent);if(a&&(H&&se.button===0||!H)){const q=A.getState();qd.onPointerDown(se.nativeEvent,{handleDomNode:se.currentTarget,autoPanOnConnect:q.autoPanOnConnect,connectionMode:q.connectionMode,connectionRadius:q.connectionRadius,domNode:q.domNode,nodeLookup:q.nodeLookup,lib:q.lib,isTarget:M,handleId:j,nodeId:T,flowId:q.rfId,panBy:q.panBy,cancelConnection:q.cancelConnection,onConnectStart:q.onConnectStart,onConnectEnd:(...J)=>{var D,K;return(K=(D=A.getState()).onConnectEnd)==null?void 0:K.call(D,...J)},updateConnection:q.updateConnection,onConnect:Q,isValidConnection:o||((...J)=>{var D,K;return((K=(D=A.getState()).isValidConnection)==null?void 0:K.call(D,...J))??!0}),getTransform:()=>A.getState().transform,getFromHandle:()=>A.getState().connection.fromHandle,autoPanSpeed:q.autoPanSpeed,dragThreshold:q.connectionDragThreshold})}H?S==null||S(se):x==null||x(se)},B=se=>{const{onClickConnectStart:H,onClickConnectEnd:q,connectionClickStartHandle:J,connectionMode:D,isValidConnection:K,lib:Se,rfId:je,nodeLookup:Le,connection:Ie}=A.getState();if(!T||!J&&!a)return;if(!J){H==null||H(se.nativeEvent,{nodeId:T,handleId:j,handleType:e}),A.setState({connectionClickStartHandle:{nodeId:T,type:e,id:j}});return}const Ee=O0(se.target),Ne=o||K,{connection:Re,isValid:_e}=qd.isValid(se.nativeEvent,{handle:{nodeId:T,id:j,type:e},connectionMode:D,fromNodeId:J.nodeId,fromHandleId:J.id||null,fromType:J.type,isValidConnection:Ne,flowId:je,doc:Ee,lib:Se,nodeLookup:Le});_e&&Re&&Q(Re);const tt=structuredClone(Ie);delete tt.inProgress,tt.toPosition=tt.toHandle?tt.toHandle.position:null,q==null||q(se,tt),A.setState({connectionClickStartHandle:null})};return p.jsx("div",{"data-handleid":j,"data-nodeid":T,"data-handlepos":r,"data-id":`${$}-${T}-${j}-${e}`,className:hn(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",P,w,{source:!M,target:M,connectable:i,connectablestart:a,connectableend:c,clickconnecting:W,connectingfrom:R,connectingto:F,valid:Y,connectionindicator:i&&(!ne||ue)&&(ne||ke?c:a)}]),onMouseDown:ve,onTouchStart:ve,onClick:U?B:void 0,ref:_,...k,children:y})}const Ki=L.memo(lg(dS));function fS({data:e,isConnectable:r,sourcePosition:o=ot.Bottom}){return p.jsxs(p.Fragment,{children:[e==null?void 0:e.label,p.jsx(Ki,{type:"source",position:o,isConnectable:r})]})}function pS({data:e,isConnectable:r,targetPosition:o=ot.Top,sourcePosition:i=ot.Bottom}){return p.jsxs(p.Fragment,{children:[p.jsx(Ki,{type:"target",position:o,isConnectable:r}),e==null?void 0:e.label,p.jsx(Ki,{type:"source",position:i,isConnectable:r})]})}function hS(){return null}function mS({data:e,isConnectable:r,targetPosition:o=ot.Top}){return p.jsxs(p.Fragment,{children:[p.jsx(Ki,{type:"target",position:o,isConnectable:r}),e==null?void 0:e.label]})}const $u={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},gm={input:fS,default:pS,output:mS,group:hS};function gS(e){var r,o,i,a;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((r=e.style)==null?void 0:r.width),height:e.height??e.initialHeight??((o=e.style)==null?void 0:o.height)}:{width:e.width??((i=e.style)==null?void 0:i.width),height:e.height??((a=e.style)==null?void 0:a.height)}}const yS=e=>{const{width:r,height:o,x:i,y:a}=Xa(e.nodeLookup,{filter:c=>!!c.selected});return{width:Xr(r)?r:null,height:Xr(o)?o:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${i}px,${a}px)`}};function xS({onSelectionContextMenu:e,noPanClassName:r,disableKeyboardA11y:o}){const i=qt(),{width:a,height:c,transformString:d,userSelectionActive:m}=Et(yS,Yt),y=dg(),w=L.useRef(null);L.useEffect(()=>{var _;o||(_=w.current)==null||_.focus({preventScroll:!0})},[o]);const S=!m&&a!==null&&c!==null;if(cg({nodeRef:w,disabled:!S}),!S)return null;const x=e?_=>{const j=i.getState().nodes.filter(M=>M.selected);e(_,j)}:void 0,k=_=>{Object.prototype.hasOwnProperty.call($u,_.key)&&(_.preventDefault(),y({direction:$u[_.key],factor:_.shiftKey?4:1}))};return p.jsx("div",{className:hn(["react-flow__nodesselection","react-flow__container",r]),style:{transform:d},children:p.jsx("div",{ref:w,className:"react-flow__nodesselection-rect",onContextMenu:x,tabIndex:o?void 0:-1,onKeyDown:o?void 0:k,style:{width:a,height:c}})})}const ym=typeof window<"u"?window:void 0,vS=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function pg({children:e,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:i,onPaneMouseLeave:a,onPaneContextMenu:c,onPaneScroll:d,paneClickDistance:m,deleteKeyCode:y,selectionKeyCode:w,selectionOnDrag:S,selectionMode:x,onSelectionStart:k,onSelectionEnd:_,multiSelectionKeyCode:j,panActivationKeyCode:M,zoomActivationKeyCode:A,elementsSelectable:T,zoomOnScroll:U,zoomOnPinch:P,panOnScroll:$,panOnScrollSpeed:R,panOnScrollMode:F,zoomOnDoubleClick:W,panOnDrag:ue,defaultViewport:ne,translateExtent:ke,minZoom:Y,maxZoom:Q,preventScrolling:ve,onSelectionContextMenu:B,noWheelClassName:ie,noPanClassName:G,disableKeyboardA11y:se,onViewportChange:H,isControlledViewport:q}){const{nodesSelectionActive:J,userSelectionActive:D}=Et(vS,Yt),K=Va(w,{target:ym}),Se=Va(M,{target:ym}),je=Se||ue,Le=Se||$,Ie=S&&je!==!0,Ee=K||D||Ie;return Zk({deleteKeyCode:y,multiSelectionKeyCode:j}),p.jsx(nS,{onPaneContextMenu:c,elementsSelectable:T,zoomOnScroll:U,zoomOnPinch:P,panOnScroll:Le,panOnScrollSpeed:R,panOnScrollMode:F,zoomOnDoubleClick:W,panOnDrag:!K&&je,defaultViewport:ne,translateExtent:ke,minZoom:Y,maxZoom:Q,zoomActivationKeyCode:A,preventScrolling:ve,noWheelClassName:ie,noPanClassName:G,onViewportChange:H,isControlledViewport:q,paneClickDistance:m,selectionOnDrag:Ie,children:p.jsxs(iS,{onSelectionStart:k,onSelectionEnd:_,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:i,onPaneMouseLeave:a,onPaneContextMenu:c,onPaneScroll:d,panOnDrag:je,isSelecting:!!Ee,selectionMode:x,selectionKeyPressed:K,paneClickDistance:m,selectionOnDrag:Ie,children:[e,J&&p.jsx(xS,{onSelectionContextMenu:B,noPanClassName:G,disableKeyboardA11y:se})]})})}pg.displayName="FlowRenderer";const wS=L.memo(pg),bS=e=>r=>e?of(r.nodeLookup,{x:0,y:0,width:r.width,height:r.height},r.transform,!0).map(o=>o.id):Array.from(r.nodeLookup.keys());function kS(e){return Et(L.useCallback(bS(e),[e]),Yt)}const SS=e=>e.updateNodeInternals;function NS(){const e=Et(SS),[r]=L.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(o=>{const i=new Map;o.forEach(a=>{const c=a.target.getAttribute("data-id");i.set(c,{id:c,nodeElement:a.target,force:!0})}),e(i)}));return L.useEffect(()=>()=>{r==null||r.disconnect()},[r]),r}function _S({node:e,nodeType:r,hasDimensions:o,resizeObserver:i}){const a=qt(),c=L.useRef(null),d=L.useRef(null),m=L.useRef(e.sourcePosition),y=L.useRef(e.targetPosition),w=L.useRef(r),S=o&&!!e.internals.handleBounds;return L.useEffect(()=>{c.current&&!e.hidden&&(!S||d.current!==c.current)&&(d.current&&(i==null||i.unobserve(d.current)),i==null||i.observe(c.current),d.current=c.current)},[S,e.hidden]),L.useEffect(()=>()=>{d.current&&(i==null||i.unobserve(d.current),d.current=null)},[]),L.useEffect(()=>{if(c.current){const x=w.current!==r,k=m.current!==e.sourcePosition,_=y.current!==e.targetPosition;(x||k||_)&&(w.current=r,m.current=e.sourcePosition,y.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:c.current,force:!0}]])))}},[e.id,r,e.sourcePosition,e.targetPosition]),c}function jS({id:e,onClick:r,onMouseEnter:o,onMouseMove:i,onMouseLeave:a,onContextMenu:c,onDoubleClick:d,nodesDraggable:m,elementsSelectable:y,nodesConnectable:w,nodesFocusable:S,resizeObserver:x,noDragClassName:k,noPanClassName:_,disableKeyboardA11y:j,rfId:M,nodeTypes:A,nodeClickDistance:T,onError:U}){const{node:P,internals:$,isParent:R}=Et(Ne=>{const Re=Ne.nodeLookup.get(e),_e=Ne.parentLookup.has(e);return{node:Re,internals:Re.internals,isParent:_e}},Yt);let F=P.type||"default",W=(A==null?void 0:A[F])||gm[F];W===void 0&&(U==null||U("003",po.error003(F)),F="default",W=(A==null?void 0:A.default)||gm.default);const ue=!!(P.draggable||m&&typeof P.draggable>"u"),ne=!!(P.selectable||y&&typeof P.selectable>"u"),ke=!!(P.connectable||w&&typeof P.connectable>"u"),Y=!!(P.focusable||S&&typeof P.focusable>"u"),Q=qt(),ve=I0(P),B=_S({node:P,nodeType:F,hasDimensions:ve,resizeObserver:x}),ie=cg({nodeRef:B,disabled:P.hidden||!ue,noDragClassName:k,handleSelector:P.dragHandle,nodeId:e,isSelectable:ne,nodeClickDistance:T}),G=dg();if(P.hidden)return null;const se=Ko(P),H=gS(P),q=ne||ue||r||o||i||a,J=o?Ne=>o(Ne,{...$.userNode}):void 0,D=i?Ne=>i(Ne,{...$.userNode}):void 0,K=a?Ne=>a(Ne,{...$.userNode}):void 0,Se=c?Ne=>c(Ne,{...$.userNode}):void 0,je=d?Ne=>d(Ne,{...$.userNode}):void 0,Le=Ne=>{const{selectNodesOnDrag:Re,nodeDragThreshold:_e}=Q.getState();ne&&(!Re||!ue||_e>0)&&Yd({id:e,store:Q,nodeRef:B}),r&&r(Ne,{...$.userNode})},Ie=Ne=>{if(!(L0(Ne.nativeEvent)||j)){if(N0.includes(Ne.key)&&ne){const Re=Ne.key==="Escape";Yd({id:e,store:Q,unselect:Re,nodeRef:B})}else if(ue&&P.selected&&Object.prototype.hasOwnProperty.call($u,Ne.key)){Ne.preventDefault();const{ariaLabelConfig:Re}=Q.getState();Q.setState({ariaLiveMessage:Re["node.a11yDescription.ariaLiveMessage"]({direction:Ne.key.replace("Arrow","").toLowerCase(),x:~~$.positionAbsolute.x,y:~~$.positionAbsolute.y})}),G({direction:$u[Ne.key],factor:Ne.shiftKey?4:1})}}},Ee=()=>{var mt;if(j||!((mt=B.current)!=null&&mt.matches(":focus-visible")))return;const{transform:Ne,width:Re,height:_e,autoPanOnNodeFocus:tt,setCenter:Fe}=Q.getState();if(!tt)return;of(new Map([[e,P]]),{x:0,y:0,width:Re,height:_e},Ne,!0).length>0||Fe(P.position.x+se.width/2,P.position.y+se.height/2,{zoom:Ne[2]})};return p.jsx("div",{className:hn(["react-flow__node",`react-flow__node-${F}`,{[_]:ue},P.className,{selected:P.selected,selectable:ne,parent:R,draggable:ue,dragging:ie}]),ref:B,style:{zIndex:$.z,transform:`translate(${$.positionAbsolute.x}px,${$.positionAbsolute.y}px)`,pointerEvents:q?"all":"none",visibility:ve?"visible":"hidden",...P.style,...H},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:J,onMouseMove:D,onMouseLeave:K,onContextMenu:Se,onClick:Le,onDoubleClick:je,onKeyDown:Y?Ie:void 0,tabIndex:Y?0:void 0,onFocus:Y?Ee:void 0,role:P.ariaRole??(Y?"group":void 0),"aria-roledescription":"node","aria-describedby":j?void 0:`${ng}-${M}`,"aria-label":P.ariaLabel,...P.domAttributes,children:p.jsx(lS,{value:e,children:p.jsx(W,{id:e,data:P.data,type:F,positionAbsoluteX:$.positionAbsolute.x,positionAbsoluteY:$.positionAbsolute.y,selected:P.selected??!1,selectable:ne,draggable:ue,deletable:P.deletable??!0,isConnectable:ke,sourcePosition:P.sourcePosition,targetPosition:P.targetPosition,dragging:ie,dragHandle:P.dragHandle,zIndex:$.z,parentId:P.parentId,...se})})})}var ES=L.memo(jS);const CS=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function hg(e){const{nodesDraggable:r,nodesConnectable:o,nodesFocusable:i,elementsSelectable:a,onError:c}=Et(CS,Yt),d=kS(e.onlyRenderVisibleElements),m=NS();return p.jsx("div",{className:"react-flow__nodes",style:Ku,children:d.map(y=>p.jsx(ES,{id:y,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:m,nodesDraggable:r,nodesConnectable:o,nodesFocusable:i,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:c},y))})}hg.displayName="NodeRenderer";const PS=L.memo(hg);function $S(e){return Et(L.useCallback(o=>{if(!e)return o.edges.map(a=>a.id);const i=[];if(o.width&&o.height)for(const a of o.edges){const c=o.nodeLookup.get(a.source),d=o.nodeLookup.get(a.target);c&&d&&$b({sourceNode:c,targetNode:d,width:o.width,height:o.height,transform:o.transform})&&i.push(a.id)}return i},[e]),Yt)}const MS=({color:e="none",strokeWidth:r=1})=>{const o={strokeWidth:r,...e&&{stroke:e}};return p.jsx("polyline",{className:"arrow",style:o,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},TS=({color:e="none",strokeWidth:r=1})=>{const o={strokeWidth:r,...e&&{stroke:e,fill:e}};return p.jsx("polyline",{className:"arrowclosed",style:o,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},xm={[Eu.Arrow]:MS,[Eu.ArrowClosed]:TS};function IS(e){const r=qt();return L.useMemo(()=>{var a,c;return Object.prototype.hasOwnProperty.call(xm,e)?xm[e]:((c=(a=r.getState()).onError)==null||c.call(a,"009",po.error009(e)),null)},[e])}const AS=({id:e,type:r,color:o,width:i=12.5,height:a=12.5,markerUnits:c="strokeWidth",strokeWidth:d,orient:m="auto-start-reverse"})=>{const y=IS(r);return y?p.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:c,orient:m,refX:"0",refY:"0",children:p.jsx(y,{color:o,strokeWidth:d})}):null},mg=({defaultColor:e,rfId:r})=>{const o=Et(c=>c.edges),i=Et(c=>c.defaultEdgeOptions),a=L.useMemo(()=>Rb(o,{id:r,defaultColor:e,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[o,i,r,e]);return a.length?p.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:p.jsx("defs",{children:a.map(c=>p.jsx(AS,{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};mg.displayName="MarkerDefinitions";var OS=L.memo(mg);function gg({x:e,y:r,label:o,labelStyle:i,labelShowBg:a=!0,labelBgStyle:c,labelBgPadding:d=[2,4],labelBgBorderRadius:m=2,children:y,className:w,...S}){const[x,k]=L.useState({x:1,y:0,width:0,height:0}),_=hn(["react-flow__edge-textwrapper",w]),j=L.useRef(null);return L.useEffect(()=>{if(j.current){const M=j.current.getBBox();k({x:M.x,y:M.y,width:M.width,height:M.height})}},[o]),o?p.jsxs("g",{transform:`translate(${e-x.width/2} ${r-x.height/2})`,className:_,visibility:x.width?"visible":"hidden",...S,children:[a&&p.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:m,ry:m}),p.jsx("text",{className:"react-flow__edge-text",y:x.height/2,dy:"0.3em",ref:j,style:i,children:o}),y]}):null}gg.displayName="EdgeText";const LS=L.memo(gg);function qi({path:e,labelX:r,labelY:o,label:i,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:y,interactionWidth:w=20,...S}){return p.jsxs(p.Fragment,{children:[p.jsx("path",{...S,d:e,fill:"none",className:hn(["react-flow__edge-path",S.className])}),w?p.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:w,className:"react-flow__edge-interaction"}):null,i&&Xr(r)&&Xr(o)?p.jsx(LS,{x:r,y:o,label:i,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:y}):null]})}function vm({pos:e,x1:r,y1:o,x2:i,y2:a}){return e===ot.Left||e===ot.Right?[.5*(r+i),o]:[r,.5*(o+a)]}function yg({sourceX:e,sourceY:r,sourcePosition:o=ot.Bottom,targetX:i,targetY:a,targetPosition:c=ot.Top}){const[d,m]=vm({pos:o,x1:e,y1:r,x2:i,y2:a}),[y,w]=vm({pos:c,x1:i,y1:a,x2:e,y2:r}),[S,x,k,_]=D0({sourceX:e,sourceY:r,targetX:i,targetY:a,sourceControlX:d,sourceControlY:m,targetControlX:y,targetControlY:w});return[`M${e},${r} C${d},${m} ${y},${w} ${i},${a}`,S,x,k,_]}function xg(e){return L.memo(({id:r,sourceX:o,sourceY:i,targetX:a,targetY:c,sourcePosition:d,targetPosition:m,label:y,labelStyle:w,labelShowBg:S,labelBgStyle:x,labelBgPadding:k,labelBgBorderRadius:_,style:j,markerEnd:M,markerStart:A,interactionWidth:T})=>{const[U,P,$]=yg({sourceX:o,sourceY:i,sourcePosition:d,targetX:a,targetY:c,targetPosition:m}),R=e.isInternal?void 0:r;return p.jsx(qi,{id:R,path:U,labelX:P,labelY:$,label:y,labelStyle:w,labelShowBg:S,labelBgStyle:x,labelBgPadding:k,labelBgBorderRadius:_,style:j,markerEnd:M,markerStart:A,interactionWidth:T})})}const RS=xg({isInternal:!1}),vg=xg({isInternal:!0});RS.displayName="SimpleBezierEdge";vg.displayName="SimpleBezierEdgeInternal";function wg(e){return L.memo(({id:r,sourceX:o,sourceY:i,targetX:a,targetY:c,label:d,labelStyle:m,labelShowBg:y,labelBgStyle:w,labelBgPadding:S,labelBgBorderRadius:x,style:k,sourcePosition:_=ot.Bottom,targetPosition:j=ot.Top,markerEnd:M,markerStart:A,pathOptions:T,interactionWidth:U})=>{const[P,$,R]=Vd({sourceX:o,sourceY:i,sourcePosition:_,targetX:a,targetY:c,targetPosition:j,borderRadius:T==null?void 0:T.borderRadius,offset:T==null?void 0:T.offset,stepPosition:T==null?void 0:T.stepPosition}),F=e.isInternal?void 0:r;return p.jsx(qi,{id:F,path:P,labelX:$,labelY:R,label:d,labelStyle:m,labelShowBg:y,labelBgStyle:w,labelBgPadding:S,labelBgBorderRadius:x,style:k,markerEnd:M,markerStart:A,interactionWidth:U})})}const bg=wg({isInternal:!1}),kg=wg({isInternal:!0});bg.displayName="SmoothStepEdge";kg.displayName="SmoothStepEdgeInternal";function Sg(e){return L.memo(({id:r,...o})=>{var a;const i=e.isInternal?void 0:r;return p.jsx(bg,{...o,id:i,pathOptions:L.useMemo(()=>{var c;return{borderRadius:0,offset:(c=o.pathOptions)==null?void 0:c.offset}},[(a=o.pathOptions)==null?void 0:a.offset])})})}const DS=Sg({isInternal:!1}),Ng=Sg({isInternal:!0});DS.displayName="StepEdge";Ng.displayName="StepEdgeInternal";function _g(e){return L.memo(({id:r,sourceX:o,sourceY:i,targetX:a,targetY:c,label:d,labelStyle:m,labelShowBg:y,labelBgStyle:w,labelBgPadding:S,labelBgBorderRadius:x,style:k,markerEnd:_,markerStart:j,interactionWidth:M})=>{const[A,T,U]=B0({sourceX:o,sourceY:i,targetX:a,targetY:c}),P=e.isInternal?void 0:r;return p.jsx(qi,{id:P,path:A,labelX:T,labelY:U,label:d,labelStyle:m,labelShowBg:y,labelBgStyle:w,labelBgPadding:S,labelBgBorderRadius:x,style:k,markerEnd:_,markerStart:j,interactionWidth:M})})}const zS=_g({isInternal:!1}),jg=_g({isInternal:!0});zS.displayName="StraightEdge";jg.displayName="StraightEdgeInternal";function Eg(e){return L.memo(({id:r,sourceX:o,sourceY:i,targetX:a,targetY:c,sourcePosition:d=ot.Bottom,targetPosition:m=ot.Top,label:y,labelStyle:w,labelShowBg:S,labelBgStyle:x,labelBgPadding:k,labelBgBorderRadius:_,style:j,markerEnd:M,markerStart:A,pathOptions:T,interactionWidth:U})=>{const[P,$,R]=lf({sourceX:o,sourceY:i,sourcePosition:d,targetX:a,targetY:c,targetPosition:m,curvature:T==null?void 0:T.curvature}),F=e.isInternal?void 0:r;return p.jsx(qi,{id:F,path:P,labelX:$,labelY:R,label:y,labelStyle:w,labelShowBg:S,labelBgStyle:x,labelBgPadding:k,labelBgBorderRadius:_,style:j,markerEnd:M,markerStart:A,interactionWidth:U})})}const FS=Eg({isInternal:!1}),Cg=Eg({isInternal:!0});FS.displayName="BezierEdge";Cg.displayName="BezierEdgeInternal";const wm={default:Cg,straight:jg,step:Ng,smoothstep:kg,simplebezier:vg},bm={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},BS=(e,r,o)=>o===ot.Left?e-r:o===ot.Right?e+r:e,HS=(e,r,o)=>o===ot.Top?e-r:o===ot.Bottom?e+r:e,km="react-flow__edgeupdater";function Sm({position:e,centerX:r,centerY:o,radius:i=10,onMouseDown:a,onMouseEnter:c,onMouseOut:d,type:m}){return p.jsx("circle",{onMouseDown:a,onMouseEnter:c,onMouseOut:d,className:hn([km,`${km}-${m}`]),cx:BS(r,i,e),cy:HS(o,i,e),r:i,stroke:"transparent",fill:"transparent"})}function VS({isReconnectable:e,reconnectRadius:r,edge:o,sourceX:i,sourceY:a,targetX:c,targetY:d,sourcePosition:m,targetPosition:y,onReconnect:w,onReconnectStart:S,onReconnectEnd:x,setReconnecting:k,setUpdateHover:_}){const j=qt(),M=($,R)=>{if($.button!==0)return;const{autoPanOnConnect:F,domNode:W,connectionMode:ue,connectionRadius:ne,lib:ke,onConnectStart:Y,cancelConnection:Q,nodeLookup:ve,rfId:B,panBy:ie,updateConnection:G}=j.getState(),se=R.type==="target",H=(D,K)=>{k(!1),x==null||x(D,o,R.type,K)},q=D=>w==null?void 0:w(o,D),J=(D,K)=>{k(!0),S==null||S($,o,R.type),Y==null||Y(D,K)};qd.onPointerDown($.nativeEvent,{autoPanOnConnect:F,connectionMode:ue,connectionRadius:ne,domNode:W,handleId:R.id,nodeId:R.nodeId,nodeLookup:ve,isTarget:se,edgeUpdaterType:R.type,lib:ke,flowId:B,cancelConnection:Q,panBy:ie,isValidConnection:(...D)=>{var K,Se;return((Se=(K=j.getState()).isValidConnection)==null?void 0:Se.call(K,...D))??!0},onConnect:q,onConnectStart:J,onConnectEnd:(...D)=>{var K,Se;return(Se=(K=j.getState()).onConnectEnd)==null?void 0:Se.call(K,...D)},onReconnectEnd:H,updateConnection:G,getTransform:()=>j.getState().transform,getFromHandle:()=>j.getState().connection.fromHandle,dragThreshold:j.getState().connectionDragThreshold,handleDomNode:$.currentTarget})},A=$=>M($,{nodeId:o.target,id:o.targetHandle??null,type:"target"}),T=$=>M($,{nodeId:o.source,id:o.sourceHandle??null,type:"source"}),U=()=>_(!0),P=()=>_(!1);return p.jsxs(p.Fragment,{children:[(e===!0||e==="source")&&p.jsx(Sm,{position:m,centerX:i,centerY:a,radius:r,onMouseDown:A,onMouseEnter:U,onMouseOut:P,type:"source"}),(e===!0||e==="target")&&p.jsx(Sm,{position:y,centerX:c,centerY:d,radius:r,onMouseDown:T,onMouseEnter:U,onMouseOut:P,type:"target"})]})}function US({id:e,edgesFocusable:r,edgesReconnectable:o,elementsSelectable:i,onClick:a,onDoubleClick:c,onContextMenu:d,onMouseEnter:m,onMouseMove:y,onMouseLeave:w,reconnectRadius:S,onReconnect:x,onReconnectStart:k,onReconnectEnd:_,rfId:j,edgeTypes:M,noPanClassName:A,onError:T,disableKeyboardA11y:U}){let P=Et(Fe=>Fe.edgeLookup.get(e));const $=Et(Fe=>Fe.defaultEdgeOptions);P=$?{...$,...P}:P;let R=P.type||"default",F=(M==null?void 0:M[R])||wm[R];F===void 0&&(T==null||T("011",po.error011(R)),R="default",F=(M==null?void 0:M.default)||wm.default);const W=!!(P.focusable||r&&typeof P.focusable>"u"),ue=typeof x<"u"&&(P.reconnectable||o&&typeof P.reconnectable>"u"),ne=!!(P.selectable||i&&typeof P.selectable>"u"),ke=L.useRef(null),[Y,Q]=L.useState(!1),[ve,B]=L.useState(!1),ie=qt(),{zIndex:G,sourceX:se,sourceY:H,targetX:q,targetY:J,sourcePosition:D,targetPosition:K}=Et(L.useCallback(Fe=>{const qe=Fe.nodeLookup.get(P.source),mt=Fe.nodeLookup.get(P.target);if(!qe||!mt)return{zIndex:P.zIndex,...bm};const dt=Lb({id:e,sourceNode:qe,targetNode:mt,sourceHandle:P.sourceHandle||null,targetHandle:P.targetHandle||null,connectionMode:Fe.connectionMode,onError:T});return{zIndex:Pb({selected:P.selected,zIndex:P.zIndex,sourceNode:qe,targetNode:mt,elevateOnSelect:Fe.elevateEdgesOnSelect,zIndexMode:Fe.zIndexMode}),...dt||bm}},[P.source,P.target,P.sourceHandle,P.targetHandle,P.selected,P.zIndex]),Yt),Se=L.useMemo(()=>P.markerStart?`url('#${Ud(P.markerStart,j)}')`:void 0,[P.markerStart,j]),je=L.useMemo(()=>P.markerEnd?`url('#${Ud(P.markerEnd,j)}')`:void 0,[P.markerEnd,j]);if(P.hidden||se===null||H===null||q===null||J===null)return null;const Le=Fe=>{var gt;const{addSelectedEdges:qe,unselectNodesAndEdges:mt,multiSelectionActive:dt}=ie.getState();ne&&(ie.setState({nodesSelectionActive:!1}),P.selected&&dt?(mt({nodes:[],edges:[P]}),(gt=ke.current)==null||gt.blur()):qe([e])),a&&a(Fe,P)},Ie=c?Fe=>{c(Fe,{...P})}:void 0,Ee=d?Fe=>{d(Fe,{...P})}:void 0,Ne=m?Fe=>{m(Fe,{...P})}:void 0,Re=y?Fe=>{y(Fe,{...P})}:void 0,_e=w?Fe=>{w(Fe,{...P})}:void 0,tt=Fe=>{var qe;if(!U&&N0.includes(Fe.key)&&ne){const{unselectNodesAndEdges:mt,addSelectedEdges:dt}=ie.getState();Fe.key==="Escape"?((qe=ke.current)==null||qe.blur(),mt({edges:[P]})):dt([e])}};return p.jsx("svg",{style:{zIndex:G},children:p.jsxs("g",{className:hn(["react-flow__edge",`react-flow__edge-${R}`,P.className,A,{selected:P.selected,animated:P.animated,inactive:!ne&&!a,updating:Y,selectable:ne}]),onClick:Le,onDoubleClick:Ie,onContextMenu:Ee,onMouseEnter:Ne,onMouseMove:Re,onMouseLeave:_e,onKeyDown:W?tt:void 0,tabIndex:W?0:void 0,role:P.ariaRole??(W?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":P.ariaLabel===null?void 0:P.ariaLabel||`Edge from ${P.source} to ${P.target}`,"aria-describedby":W?`${rg}-${j}`:void 0,ref:ke,...P.domAttributes,children:[!ve&&p.jsx(F,{id:e,source:P.source,target:P.target,type:P.type,selected:P.selected,animated:P.animated,selectable:ne,deletable:P.deletable??!0,label:P.label,labelStyle:P.labelStyle,labelShowBg:P.labelShowBg,labelBgStyle:P.labelBgStyle,labelBgPadding:P.labelBgPadding,labelBgBorderRadius:P.labelBgBorderRadius,sourceX:se,sourceY:H,targetX:q,targetY:J,sourcePosition:D,targetPosition:K,data:P.data,style:P.style,sourceHandleId:P.sourceHandle,targetHandleId:P.targetHandle,markerStart:Se,markerEnd:je,pathOptions:"pathOptions"in P?P.pathOptions:void 0,interactionWidth:P.interactionWidth}),ue&&p.jsx(VS,{edge:P,isReconnectable:ue,reconnectRadius:S,onReconnect:x,onReconnectStart:k,onReconnectEnd:_,sourceX:se,sourceY:H,targetX:q,targetY:J,sourcePosition:D,targetPosition:K,setUpdateHover:Q,setReconnecting:B})]})})}var KS=L.memo(US);const qS=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Pg({defaultMarkerColor:e,onlyRenderVisibleElements:r,rfId:o,edgeTypes:i,noPanClassName:a,onReconnect:c,onEdgeContextMenu:d,onEdgeMouseEnter:m,onEdgeMouseMove:y,onEdgeMouseLeave:w,onEdgeClick:S,reconnectRadius:x,onEdgeDoubleClick:k,onReconnectStart:_,onReconnectEnd:j,disableKeyboardA11y:M}){const{edgesFocusable:A,edgesReconnectable:T,elementsSelectable:U,onError:P}=Et(qS,Yt),$=$S(r);return p.jsxs("div",{className:"react-flow__edges",children:[p.jsx(OS,{defaultColor:e,rfId:o}),$.map(R=>p.jsx(KS,{id:R,edgesFocusable:A,edgesReconnectable:T,elementsSelectable:U,noPanClassName:a,onReconnect:c,onContextMenu:d,onMouseEnter:m,onMouseMove:y,onMouseLeave:w,onClick:S,reconnectRadius:x,onDoubleClick:k,onReconnectStart:_,onReconnectEnd:j,rfId:o,onError:P,edgeTypes:i,disableKeyboardA11y:M},R))]})}Pg.displayName="EdgeRenderer";const WS=L.memo(Pg),YS=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function XS({children:e}){const r=Et(YS);return p.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:e})}function QS(e){const r=hf(),o=L.useRef(!1);L.useEffect(()=>{!o.current&&r.viewportInitialized&&e&&(setTimeout(()=>e(r),1),o.current=!0)},[e,r.viewportInitialized])}const JS=e=>{var r;return(r=e.panZoom)==null?void 0:r.syncViewport};function GS(e){const r=Et(JS),o=qt();return L.useEffect(()=>{e&&(r==null||r(e),o.setState({transform:[e.x,e.y,e.zoom]}))},[e,r]),null}function ZS(e){return e.connection.inProgress?{...e.connection,to:Ja(e.connection.to,e.transform)}:{...e.connection}}function e2(e){return ZS}function t2(e){const r=e2();return Et(r,Yt)}const n2=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function r2({containerStyle:e,style:r,type:o,component:i}){const{nodesConnectable:a,width:c,height:d,isValid:m,inProgress:y}=Et(n2,Yt);return!(c&&a&&y)?null:p.jsx("svg",{style:e,width:c,height:d,className:"react-flow__connectionline react-flow__container",children:p.jsx("g",{className:hn(["react-flow__connection",E0(m)]),children:p.jsx($g,{style:r,type:o,CustomComponent:i,isValid:m})})})}const $g=({style:e,type:r=vs.Bezier,CustomComponent:o,isValid:i})=>{const{inProgress:a,from:c,fromNode:d,fromHandle:m,fromPosition:y,to:w,toNode:S,toHandle:x,toPosition:k,pointer:_}=t2();if(!a)return;if(o)return p.jsx(o,{connectionLineType:r,connectionLineStyle:e,fromNode:d,fromHandle:m,fromX:c.x,fromY:c.y,toX:w.x,toY:w.y,fromPosition:y,toPosition:k,connectionStatus:E0(i),toNode:S,toHandle:x,pointer:_});let j="";const M={sourceX:c.x,sourceY:c.y,sourcePosition:y,targetX:w.x,targetY:w.y,targetPosition:k};switch(r){case vs.Bezier:[j]=lf(M);break;case vs.SimpleBezier:[j]=yg(M);break;case vs.Step:[j]=Vd({...M,borderRadius:0});break;case vs.SmoothStep:[j]=Vd(M);break;default:[j]=B0(M)}return p.jsx("path",{d:j,fill:"none",className:"react-flow__connection-path",style:e})};$g.displayName="ConnectionLine";const o2={};function Nm(e=o2){L.useRef(e),qt(),L.useEffect(()=>{},[e])}function s2(){qt(),L.useRef(!1),L.useEffect(()=>{},[])}function Mg({nodeTypes:e,edgeTypes:r,onInit:o,onNodeClick:i,onEdgeClick:a,onNodeDoubleClick:c,onEdgeDoubleClick:d,onNodeMouseEnter:m,onNodeMouseMove:y,onNodeMouseLeave:w,onNodeContextMenu:S,onSelectionContextMenu:x,onSelectionStart:k,onSelectionEnd:_,connectionLineType:j,connectionLineStyle:M,connectionLineComponent:A,connectionLineContainerStyle:T,selectionKeyCode:U,selectionOnDrag:P,selectionMode:$,multiSelectionKeyCode:R,panActivationKeyCode:F,zoomActivationKeyCode:W,deleteKeyCode:ue,onlyRenderVisibleElements:ne,elementsSelectable:ke,defaultViewport:Y,translateExtent:Q,minZoom:ve,maxZoom:B,preventScrolling:ie,defaultMarkerColor:G,zoomOnScroll:se,zoomOnPinch:H,panOnScroll:q,panOnScrollSpeed:J,panOnScrollMode:D,zoomOnDoubleClick:K,panOnDrag:Se,onPaneClick:je,onPaneMouseEnter:Le,onPaneMouseMove:Ie,onPaneMouseLeave:Ee,onPaneScroll:Ne,onPaneContextMenu:Re,paneClickDistance:_e,nodeClickDistance:tt,onEdgeContextMenu:Fe,onEdgeMouseEnter:qe,onEdgeMouseMove:mt,onEdgeMouseLeave:dt,reconnectRadius:gt,onReconnect:It,onReconnectStart:mn,onReconnectEnd:Zt,noDragClassName:en,noWheelClassName:At,noPanClassName:Xt,disableKeyboardA11y:tn,nodeExtent:Xn,rfId:un,viewport:Mt,onViewportChange:on}){return Nm(e),Nm(r),s2(),QS(o),GS(Mt),p.jsx(wS,{onPaneClick:je,onPaneMouseEnter:Le,onPaneMouseMove:Ie,onPaneMouseLeave:Ee,onPaneContextMenu:Re,onPaneScroll:Ne,paneClickDistance:_e,deleteKeyCode:ue,selectionKeyCode:U,selectionOnDrag:P,selectionMode:$,onSelectionStart:k,onSelectionEnd:_,multiSelectionKeyCode:R,panActivationKeyCode:F,zoomActivationKeyCode:W,elementsSelectable:ke,zoomOnScroll:se,zoomOnPinch:H,zoomOnDoubleClick:K,panOnScroll:q,panOnScrollSpeed:J,panOnScrollMode:D,panOnDrag:Se,defaultViewport:Y,translateExtent:Q,minZoom:ve,maxZoom:B,onSelectionContextMenu:x,preventScrolling:ie,noDragClassName:en,noWheelClassName:At,noPanClassName:Xt,disableKeyboardA11y:tn,onViewportChange:on,isControlledViewport:!!Mt,children:p.jsxs(XS,{children:[p.jsx(WS,{edgeTypes:r,onEdgeClick:a,onEdgeDoubleClick:d,onReconnect:It,onReconnectStart:mn,onReconnectEnd:Zt,onlyRenderVisibleElements:ne,onEdgeContextMenu:Fe,onEdgeMouseEnter:qe,onEdgeMouseMove:mt,onEdgeMouseLeave:dt,reconnectRadius:gt,defaultMarkerColor:G,noPanClassName:Xt,disableKeyboardA11y:tn,rfId:un}),p.jsx(r2,{style:M,type:j,component:A,containerStyle:T}),p.jsx("div",{className:"react-flow__edgelabel-renderer"}),p.jsx(PS,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:c,onNodeMouseEnter:m,onNodeMouseMove:y,onNodeMouseLeave:w,onNodeContextMenu:S,nodeClickDistance:tt,onlyRenderVisibleElements:ne,noPanClassName:Xt,noDragClassName:en,disableKeyboardA11y:tn,nodeExtent:Xn,rfId:un}),p.jsx("div",{className:"react-flow__viewport-portal"})]})})}Mg.displayName="GraphView";const i2=L.memo(Mg),_m=({nodes:e,edges:r,defaultNodes:o,defaultEdges:i,width:a,height:c,fitView:d,fitViewOptions:m,minZoom:y=.5,maxZoom:w=2,nodeOrigin:S,nodeExtent:x,zIndexMode:k="basic"}={})=>{const _=new Map,j=new Map,M=new Map,A=new Map,T=i??r??[],U=o??e??[],P=S??[0,0],$=x??za;U0(M,A,T);const{nodesInitialized:R}=Kd(U,_,j,{nodeOrigin:P,nodeExtent:$,zIndexMode:k});let F=[0,0,1];if(d&&a&&c){const W=Xa(_,{filter:Y=>!!((Y.width||Y.initialWidth)&&(Y.height||Y.initialHeight))}),{x:ue,y:ne,zoom:ke}=sf(W,a,c,y,w,(m==null?void 0:m.padding)??.1);F=[ue,ne,ke]}return{rfId:"1",width:a??0,height:c??0,transform:F,nodes:U,nodesInitialized:R,nodeLookup:_,parentLookup:j,edges:T,edgeLookup:A,connectionLookup:M,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:o!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:y,maxZoom:w,translateExtent:za,nodeExtent:$,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Fi.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:P,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:m,fitViewResolver:null,connection:{...j0},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Sb,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:_0,zIndexMode:k,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},a2=({nodes:e,edges:r,defaultNodes:o,defaultEdges:i,width:a,height:c,fitView:d,fitViewOptions:m,minZoom:y,maxZoom:w,nodeOrigin:S,nodeExtent:x,zIndexMode:k})=>jk((_,j)=>{async function M(){const{nodeLookup:A,panZoom:T,fitViewOptions:U,fitViewResolver:P,width:$,height:R,minZoom:F,maxZoom:W}=j();T&&(await bb({nodes:A,width:$,height:R,panZoom:T,minZoom:F,maxZoom:W},U),P==null||P.resolve(!0),_({fitViewResolver:null}))}return{..._m({nodes:e,edges:r,width:a,height:c,fitView:d,fitViewOptions:m,minZoom:y,maxZoom:w,nodeOrigin:S,nodeExtent:x,defaultNodes:o,defaultEdges:i,zIndexMode:k}),setNodes:A=>{const{nodeLookup:T,parentLookup:U,nodeOrigin:P,elevateNodesOnSelect:$,fitViewQueued:R,zIndexMode:F,nodesSelectionActive:W}=j(),{nodesInitialized:ue,hasSelectedNodes:ne}=Kd(A,T,U,{nodeOrigin:P,nodeExtent:x,elevateNodesOnSelect:$,checkEquality:!0,zIndexMode:F}),ke=W&&ne;R&&ue?(M(),_({nodes:A,nodesInitialized:ue,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:ke})):_({nodes:A,nodesInitialized:ue,nodesSelectionActive:ke})},setEdges:A=>{const{connectionLookup:T,edgeLookup:U}=j();U0(T,U,A),_({edges:A})},setDefaultNodesAndEdges:(A,T)=>{if(A){const{setNodes:U}=j();U(A),_({hasDefaultNodes:!0})}if(T){const{setEdges:U}=j();U(T),_({hasDefaultEdges:!0})}},updateNodeInternals:A=>{const{triggerNodeChanges:T,nodeLookup:U,parentLookup:P,domNode:$,nodeOrigin:R,nodeExtent:F,debug:W,fitViewQueued:ue,zIndexMode:ne}=j(),{changes:ke,updatedInternals:Y}=Ub(A,U,P,$,R,F,ne);Y&&(Fb(U,P,{nodeOrigin:R,nodeExtent:F,zIndexMode:ne}),ue?(M(),_({fitViewQueued:!1,fitViewOptions:void 0})):_({}),(ke==null?void 0:ke.length)>0&&(W&&console.log("React Flow: trigger node changes",ke),T==null||T(ke)))},updateNodePositions:(A,T=!1)=>{const U=[];let P=[];const{nodeLookup:$,triggerNodeChanges:R,connection:F,updateConnection:W,onNodesChangeMiddlewareMap:ue}=j();for(const[ne,ke]of A){const Y=$.get(ne),Q=!!(Y!=null&&Y.expandParent&&(Y!=null&&Y.parentId)&&(ke!=null&&ke.position)),ve={id:ne,type:"position",position:Q?{x:Math.max(0,ke.position.x),y:Math.max(0,ke.position.y)}:ke.position,dragging:T};if(Y&&F.inProgress&&F.fromNode.id===Y.id){const B=Ys(Y,F.fromHandle,ot.Left,!0);W({...F,from:B})}Q&&Y.parentId&&U.push({id:ne,parentId:Y.parentId,rect:{...ke.internals.positionAbsolute,width:ke.measured.width??0,height:ke.measured.height??0}}),P.push(ve)}if(U.length>0){const{parentLookup:ne,nodeOrigin:ke}=j(),Y=pf(U,$,ne,ke);P.push(...Y)}for(const ne of ue.values())P=ne(P);R(P)},triggerNodeChanges:A=>{const{onNodesChange:T,setNodes:U,nodes:P,hasDefaultNodes:$,debug:R}=j();if(A!=null&&A.length){if($){const F=ig(A,P);U(F)}R&&console.log("React Flow: trigger node changes",A),T==null||T(A)}},triggerEdgeChanges:A=>{const{onEdgesChange:T,setEdges:U,edges:P,hasDefaultEdges:$,debug:R}=j();if(A!=null&&A.length){if($){const F=ag(A,P);U(F)}R&&console.log("React Flow: trigger edge changes",A),T==null||T(A)}},addSelectedNodes:A=>{const{multiSelectionActive:T,edgeLookup:U,nodeLookup:P,triggerNodeChanges:$,triggerEdgeChanges:R}=j();if(T){const F=A.map(W=>Bs(W,!0));$(F);return}$(Ti(P,new Set([...A]),!0)),R(Ti(U))},addSelectedEdges:A=>{const{multiSelectionActive:T,edgeLookup:U,nodeLookup:P,triggerNodeChanges:$,triggerEdgeChanges:R}=j();if(T){const F=A.map(W=>Bs(W,!0));R(F);return}R(Ti(U,new Set([...A]))),$(Ti(P,new Set,!0))},unselectNodesAndEdges:({nodes:A,edges:T}={})=>{const{edges:U,nodes:P,nodeLookup:$,triggerNodeChanges:R,triggerEdgeChanges:F}=j(),W=A||P,ue=T||U,ne=[];for(const Y of W){if(!Y.selected)continue;const Q=$.get(Y.id);Q&&(Q.selected=!1),ne.push(Bs(Y.id,!1))}const ke=[];for(const Y of ue)Y.selected&&ke.push(Bs(Y.id,!1));R(ne),F(ke)},setMinZoom:A=>{const{panZoom:T,maxZoom:U}=j();T==null||T.setScaleExtent([A,U]),_({minZoom:A})},setMaxZoom:A=>{const{panZoom:T,minZoom:U}=j();T==null||T.setScaleExtent([U,A]),_({maxZoom:A})},setTranslateExtent:A=>{var T;(T=j().panZoom)==null||T.setTranslateExtent(A),_({translateExtent:A})},resetSelectedElements:()=>{const{edges:A,nodes:T,triggerNodeChanges:U,triggerEdgeChanges:P,elementsSelectable:$}=j();if(!$)return;const R=T.reduce((W,ue)=>ue.selected?[...W,Bs(ue.id,!1)]:W,[]),F=A.reduce((W,ue)=>ue.selected?[...W,Bs(ue.id,!1)]:W,[]);U(R),P(F)},setNodeExtent:A=>{const{nodes:T,nodeLookup:U,parentLookup:P,nodeOrigin:$,elevateNodesOnSelect:R,nodeExtent:F,zIndexMode:W}=j();A[0][0]===F[0][0]&&A[0][1]===F[0][1]&&A[1][0]===F[1][0]&&A[1][1]===F[1][1]||(Kd(T,U,P,{nodeOrigin:$,nodeExtent:A,elevateNodesOnSelect:R,checkEquality:!1,zIndexMode:W}),_({nodeExtent:A}))},panBy:A=>{const{transform:T,width:U,height:P,panZoom:$,translateExtent:R}=j();return Kb({delta:A,panZoom:$,transform:T,translateExtent:R,width:U,height:P})},setCenter:async(A,T,U)=>{const{width:P,height:$,maxZoom:R,panZoom:F}=j();if(!F)return Promise.resolve(!1);const W=typeof(U==null?void 0:U.zoom)<"u"?U.zoom:R;return await F.setViewport({x:P/2-A*W,y:$/2-T*W,zoom:W},{duration:U==null?void 0:U.duration,ease:U==null?void 0:U.ease,interpolate:U==null?void 0:U.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{_({connection:{...j0}})},updateConnection:A=>{_({connection:A})},reset:()=>_({..._m()})}},Object.is);function l2({initialNodes:e,initialEdges:r,defaultNodes:o,defaultEdges:i,initialWidth:a,initialHeight:c,initialMinZoom:d,initialMaxZoom:m,initialFitViewOptions:y,fitView:w,nodeOrigin:S,nodeExtent:x,zIndexMode:k,children:_}){const[j]=L.useState(()=>a2({nodes:e,edges:r,defaultNodes:o,defaultEdges:i,width:a,height:c,fitView:w,minZoom:d,maxZoom:m,fitViewOptions:y,nodeOrigin:S,nodeExtent:x,zIndexMode:k}));return p.jsx(Ek,{value:j,children:p.jsx(Xk,{children:_})})}function u2({children:e,nodes:r,edges:o,defaultNodes:i,defaultEdges:a,width:c,height:d,fitView:m,fitViewOptions:y,minZoom:w,maxZoom:S,nodeOrigin:x,nodeExtent:k,zIndexMode:_}){return L.useContext(Uu)?p.jsx(p.Fragment,{children:e}):p.jsx(l2,{initialNodes:r,initialEdges:o,defaultNodes:i,defaultEdges:a,initialWidth:c,initialHeight:d,fitView:m,initialFitViewOptions:y,initialMinZoom:w,initialMaxZoom:S,nodeOrigin:x,nodeExtent:k,zIndexMode:_,children:e})}const c2={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function d2({nodes:e,edges:r,defaultNodes:o,defaultEdges:i,className:a,nodeTypes:c,edgeTypes:d,onNodeClick:m,onEdgeClick:y,onInit:w,onMove:S,onMoveStart:x,onMoveEnd:k,onConnect:_,onConnectStart:j,onConnectEnd:M,onClickConnectStart:A,onClickConnectEnd:T,onNodeMouseEnter:U,onNodeMouseMove:P,onNodeMouseLeave:$,onNodeContextMenu:R,onNodeDoubleClick:F,onNodeDragStart:W,onNodeDrag:ue,onNodeDragStop:ne,onNodesDelete:ke,onEdgesDelete:Y,onDelete:Q,onSelectionChange:ve,onSelectionDragStart:B,onSelectionDrag:ie,onSelectionDragStop:G,onSelectionContextMenu:se,onSelectionStart:H,onSelectionEnd:q,onBeforeDelete:J,connectionMode:D,connectionLineType:K=vs.Bezier,connectionLineStyle:Se,connectionLineComponent:je,connectionLineContainerStyle:Le,deleteKeyCode:Ie="Backspace",selectionKeyCode:Ee="Shift",selectionOnDrag:Ne=!1,selectionMode:Re=Fa.Full,panActivationKeyCode:_e="Space",multiSelectionKeyCode:tt=Ha()?"Meta":"Control",zoomActivationKeyCode:Fe=Ha()?"Meta":"Control",snapToGrid:qe,snapGrid:mt,onlyRenderVisibleElements:dt=!1,selectNodesOnDrag:gt,nodesDraggable:It,autoPanOnNodeFocus:mn,nodesConnectable:Zt,nodesFocusable:en,nodeOrigin:At=og,edgesFocusable:Xt,edgesReconnectable:tn,elementsSelectable:Xn=!0,defaultViewport:un=Fk,minZoom:Mt=.5,maxZoom:on=2,translateExtent:cn=za,preventScrolling:xe=!0,nodeExtent:rt,defaultMarkerColor:ut="#b1b1b7",zoomOnScroll:Ot=!0,zoomOnPinch:xt=!0,panOnScroll:nn=!1,panOnScrollSpeed:ht=.5,panOnScrollMode:Ue=Us.Free,zoomOnDoubleClick:sn=!0,panOnDrag:An=!0,onPaneClick:Vn,onPaneMouseEnter:Ve,onPaneMouseMove:Un,onPaneMouseLeave:En,onPaneScroll:Cr,onPaneContextMenu:ar,paneClickDistance:Pr=1,nodeClickDistance:mr=0,children:go,onReconnect:On,onReconnectStart:Qn,onReconnectEnd:Kn,onEdgeContextMenu:dn,onEdgeDoubleClick:vt,onEdgeMouseEnter:Rt,onEdgeMouseMove:et,onEdgeMouseLeave:lr,reconnectRadius:_t=10,onNodesChange:gr,onEdgesChange:ws,noDragClassName:Cn="nodrag",noWheelClassName:Pn="nowheel",noPanClassName:an="nopan",fitView:yr,fitViewOptions:Gr,connectOnClick:Ln,attributionPosition:Zr,proOptions:zt,defaultEdgeOptions:yo,elevateNodesOnSelect:eo=!0,elevateEdgesOnSelect:Ft=!1,disableKeyboardA11y:Jn=!1,autoPanOnConnect:jt,autoPanOnNodeDrag:xo,autoPanSpeed:xr,connectionRadius:to,isValidConnection:vr,onError:ur,style:vo,id:gn,nodeDragThreshold:yn,connectionDragThreshold:yt,viewport:wn,onViewportChange:qo,width:no,height:$r,colorMode:Mr="light",debug:Tr,onScroll:qn,ariaLabelConfig:St,zIndexMode:wr="basic",...Ir},Gn){const br=gn||"1",Ar=Uk(Mr),Zn=L.useCallback(wo=>{wo.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),qn==null||qn(wo)},[qn]);return p.jsx("div",{"data-testid":"rf__wrapper",...Ir,onScroll:Zn,style:{...vo,...c2},ref:Gn,className:hn(["react-flow",a,Ar]),id:gn,role:"application",children:p.jsxs(u2,{nodes:e,edges:r,width:no,height:$r,fitView:yr,fitViewOptions:Gr,minZoom:Mt,maxZoom:on,nodeOrigin:At,nodeExtent:rt,zIndexMode:wr,children:[p.jsx(Vk,{nodes:e,edges:r,defaultNodes:o,defaultEdges:i,onConnect:_,onConnectStart:j,onConnectEnd:M,onClickConnectStart:A,onClickConnectEnd:T,nodesDraggable:It,autoPanOnNodeFocus:mn,nodesConnectable:Zt,nodesFocusable:en,edgesFocusable:Xt,edgesReconnectable:tn,elementsSelectable:Xn,elevateNodesOnSelect:eo,elevateEdgesOnSelect:Ft,minZoom:Mt,maxZoom:on,nodeExtent:rt,onNodesChange:gr,onEdgesChange:ws,snapToGrid:qe,snapGrid:mt,connectionMode:D,translateExtent:cn,connectOnClick:Ln,defaultEdgeOptions:yo,fitView:yr,fitViewOptions:Gr,onNodesDelete:ke,onEdgesDelete:Y,onDelete:Q,onNodeDragStart:W,onNodeDrag:ue,onNodeDragStop:ne,onSelectionDrag:ie,onSelectionDragStart:B,onSelectionDragStop:G,onMove:S,onMoveStart:x,onMoveEnd:k,noPanClassName:an,nodeOrigin:At,rfId:br,autoPanOnConnect:jt,autoPanOnNodeDrag:xo,autoPanSpeed:xr,onError:ur,connectionRadius:to,isValidConnection:vr,selectNodesOnDrag:gt,nodeDragThreshold:yn,connectionDragThreshold:yt,onBeforeDelete:J,debug:Tr,ariaLabelConfig:St,zIndexMode:wr}),p.jsx(i2,{onInit:w,onNodeClick:m,onEdgeClick:y,onNodeMouseEnter:U,onNodeMouseMove:P,onNodeMouseLeave:$,onNodeContextMenu:R,onNodeDoubleClick:F,nodeTypes:c,edgeTypes:d,connectionLineType:K,connectionLineStyle:Se,connectionLineComponent:je,connectionLineContainerStyle:Le,selectionKeyCode:Ee,selectionOnDrag:Ne,selectionMode:Re,deleteKeyCode:Ie,multiSelectionKeyCode:tt,panActivationKeyCode:_e,zoomActivationKeyCode:Fe,onlyRenderVisibleElements:dt,defaultViewport:un,translateExtent:cn,minZoom:Mt,maxZoom:on,preventScrolling:xe,zoomOnScroll:Ot,zoomOnPinch:xt,zoomOnDoubleClick:sn,panOnScroll:nn,panOnScrollSpeed:ht,panOnScrollMode:Ue,panOnDrag:An,onPaneClick:Vn,onPaneMouseEnter:Ve,onPaneMouseMove:Un,onPaneMouseLeave:En,onPaneScroll:Cr,onPaneContextMenu:ar,paneClickDistance:Pr,nodeClickDistance:mr,onSelectionContextMenu:se,onSelectionStart:H,onSelectionEnd:q,onReconnect:On,onReconnectStart:Qn,onReconnectEnd:Kn,onEdgeContextMenu:dn,onEdgeDoubleClick:vt,onEdgeMouseEnter:Rt,onEdgeMouseMove:et,onEdgeMouseLeave:lr,reconnectRadius:_t,defaultMarkerColor:ut,noDragClassName:Cn,noWheelClassName:Pn,noPanClassName:an,rfId:br,disableKeyboardA11y:Jn,nodeExtent:rt,viewport:wn,onViewportChange:qo}),p.jsx(zk,{onSelectionChange:ve}),go,p.jsx(Ak,{proOptions:zt,position:Zr}),p.jsx(Ik,{rfId:br,disableKeyboardA11y:Jn})]})})}var f2=lg(d2);const p2=e=>{var r;return(r=e.domNode)==null?void 0:r.querySelector(".react-flow__edgelabel-renderer")};function h2({children:e}){const r=Et(p2);return r?eg.createPortal(e,r):null}function m2(){const e=qt();return L.useCallback(r=>{const{domNode:o,updateNodeInternals:i}=e.getState(),a=Array.isArray(r)?r:[r],c=new Map;a.forEach(d=>{const m=o==null?void 0:o.querySelector(`.react-flow__node[data-id="${d}"]`);m&&c.set(d,{id:d,nodeElement:m,force:!0})}),requestAnimationFrame(()=>i(c,{triggerFitView:!1}))},[])}function g2(e){const[r,o]=L.useState(e),i=L.useCallback(a=>o(c=>ig(a,c)),[]);return[r,o,i]}function y2(e){const[r,o]=L.useState(e),i=L.useCallback(a=>o(c=>ag(a,c)),[]);return[r,o,i]}function x2({dimensions:e,lineWidth:r,variant:o,className:i}){return p.jsx("path",{strokeWidth:r,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:hn(["react-flow__background-pattern",o,i])})}function v2({radius:e,className:r}){return p.jsx("circle",{cx:e,cy:e,r:e,className:hn(["react-flow__background-pattern","dots",r])})}var Vo;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Vo||(Vo={}));const w2={[Vo.Dots]:1,[Vo.Lines]:1,[Vo.Cross]:6},b2=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Tg({id:e,variant:r=Vo.Dots,gap:o=20,size:i,lineWidth:a=1,offset:c=0,color:d,bgColor:m,style:y,className:w,patternClassName:S}){const x=L.useRef(null),{transform:k,patternId:_}=Et(b2,Yt),j=i||w2[r],M=r===Vo.Dots,A=r===Vo.Cross,T=Array.isArray(o)?o:[o,o],U=[T[0]*k[2]||1,T[1]*k[2]||1],P=j*k[2],$=Array.isArray(c)?c:[c,c],R=A?[P,P]:U,F=[$[0]*k[2]||1+R[0]/2,$[1]*k[2]||1+R[1]/2],W=`${_}${e||""}`;return p.jsxs("svg",{className:hn(["react-flow__background",w]),style:{...y,...Ku,"--xy-background-color-props":m,"--xy-background-pattern-color-props":d},ref:x,"data-testid":"rf__background",children:[p.jsx("pattern",{id:W,x:k[0]%U[0],y:k[1]%U[1],width:U[0],height:U[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${F[0]},-${F[1]})`,children:M?p.jsx(v2,{radius:P/2,className:S}):p.jsx(x2,{dimensions:R,lineWidth:a,variant:r,className:S})}),p.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${W})`})]})}Tg.displayName="Background";const k2=L.memo(Tg);function S2(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:p.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function N2(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:p.jsx("path",{d:"M0 0h32v4.2H0z"})})}function _2(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:p.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 j2(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:p.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 E2(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:p.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 au({children:e,className:r,...o}){return p.jsx("button",{type:"button",className:hn(["react-flow__controls-button",r]),...o,children:e})}const C2=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Ig({style:e,showZoom:r=!0,showFitView:o=!0,showInteractive:i=!0,fitViewOptions:a,onZoomIn:c,onZoomOut:d,onFitView:m,onInteractiveChange:y,className:w,children:S,position:x="bottom-left",orientation:k="vertical","aria-label":_}){const j=qt(),{isInteractive:M,minZoomReached:A,maxZoomReached:T,ariaLabelConfig:U}=Et(C2,Yt),{zoomIn:P,zoomOut:$,fitView:R}=hf(),F=()=>{P(),c==null||c()},W=()=>{$(),d==null||d()},ue=()=>{R(a),m==null||m()},ne=()=>{j.setState({nodesDraggable:!M,nodesConnectable:!M,elementsSelectable:!M}),y==null||y(!M)},ke=k==="horizontal"?"horizontal":"vertical";return p.jsxs(Ga,{className:hn(["react-flow__controls",ke,w]),position:x,style:e,"data-testid":"rf__controls","aria-label":_??U["controls.ariaLabel"],children:[r&&p.jsxs(p.Fragment,{children:[p.jsx(au,{onClick:F,className:"react-flow__controls-zoomin",title:U["controls.zoomIn.ariaLabel"],"aria-label":U["controls.zoomIn.ariaLabel"],disabled:T,children:p.jsx(S2,{})}),p.jsx(au,{onClick:W,className:"react-flow__controls-zoomout",title:U["controls.zoomOut.ariaLabel"],"aria-label":U["controls.zoomOut.ariaLabel"],disabled:A,children:p.jsx(N2,{})})]}),o&&p.jsx(au,{className:"react-flow__controls-fitview",onClick:ue,title:U["controls.fitView.ariaLabel"],"aria-label":U["controls.fitView.ariaLabel"],children:p.jsx(_2,{})}),i&&p.jsx(au,{className:"react-flow__controls-interactive",onClick:ne,title:U["controls.interactive.ariaLabel"],"aria-label":U["controls.interactive.ariaLabel"],children:M?p.jsx(E2,{}):p.jsx(j2,{})}),S]})}Ig.displayName="Controls";const P2=L.memo(Ig);function $2({id:e,x:r,y:o,width:i,height:a,style:c,color:d,strokeColor:m,strokeWidth:y,className:w,borderRadius:S,shapeRendering:x,selected:k,onClick:_}){const{background:j,backgroundColor:M}=c||{},A=d||j||M;return p.jsx("rect",{className:hn(["react-flow__minimap-node",{selected:k},w]),x:r,y:o,rx:S,ry:S,width:i,height:a,style:{fill:A,stroke:m,strokeWidth:y},shapeRendering:x,onClick:_?T=>_(T,e):void 0})}const M2=L.memo($2),T2=e=>e.nodes.map(r=>r.id),jd=e=>e instanceof Function?e:()=>e;function I2({nodeStrokeColor:e,nodeColor:r,nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:c=M2,onClick:d}){const m=Et(T2,Yt),y=jd(r),w=jd(e),S=jd(o),x=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return p.jsx(p.Fragment,{children:m.map(k=>p.jsx(O2,{id:k,nodeColorFunc:y,nodeStrokeColorFunc:w,nodeClassNameFunc:S,nodeBorderRadius:i,nodeStrokeWidth:a,NodeComponent:c,onClick:d,shapeRendering:x},k))})}function A2({id:e,nodeColorFunc:r,nodeStrokeColorFunc:o,nodeClassNameFunc:i,nodeBorderRadius:a,nodeStrokeWidth:c,shapeRendering:d,NodeComponent:m,onClick:y}){const{node:w,x:S,y:x,width:k,height:_}=Et(j=>{const M=j.nodeLookup.get(e);if(!M)return{node:void 0,x:0,y:0,width:0,height:0};const A=M.internals.userNode,{x:T,y:U}=M.internals.positionAbsolute,{width:P,height:$}=Ko(A);return{node:A,x:T,y:U,width:P,height:$}},Yt);return!w||w.hidden||!I0(w)?null:p.jsx(m,{x:S,y:x,width:k,height:_,style:w.style,selected:!!w.selected,className:i(w),color:r(w),borderRadius:a,strokeColor:o(w),strokeWidth:c,shapeRendering:d,onClick:y,id:w.id})}const O2=L.memo(A2);var L2=L.memo(I2);const R2=200,D2=150,z2=e=>!e.hidden,F2=e=>{const r={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:r,boundingRect:e.nodeLookup.size>0?T0(Xa(e.nodeLookup,{filter:z2}),r):r,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},B2="react-flow__minimap-desc";function Ag({style:e,className:r,nodeStrokeColor:o,nodeColor:i,nodeClassName:a="",nodeBorderRadius:c=5,nodeStrokeWidth:d,nodeComponent:m,bgColor:y,maskColor:w,maskStrokeColor:S,maskStrokeWidth:x,position:k="bottom-right",onClick:_,onNodeClick:j,pannable:M=!1,zoomable:A=!1,ariaLabel:T,inversePan:U,zoomStep:P=1,offsetScale:$=5}){const R=qt(),F=L.useRef(null),{boundingRect:W,viewBB:ue,rfId:ne,panZoom:ke,translateExtent:Y,flowWidth:Q,flowHeight:ve,ariaLabelConfig:B}=Et(F2,Yt),ie=(e==null?void 0:e.width)??R2,G=(e==null?void 0:e.height)??D2,se=W.width/ie,H=W.height/G,q=Math.max(se,H),J=q*ie,D=q*G,K=$*q,Se=W.x-(J-W.width)/2-K,je=W.y-(D-W.height)/2-K,Le=J+K*2,Ie=D+K*2,Ee=`${B2}-${ne}`,Ne=L.useRef(0),Re=L.useRef();Ne.current=q,L.useEffect(()=>{if(F.current&&ke)return Re.current=ek({domNode:F.current,panZoom:ke,getTransform:()=>R.getState().transform,getViewScale:()=>Ne.current}),()=>{var qe;(qe=Re.current)==null||qe.destroy()}},[ke]),L.useEffect(()=>{var qe;(qe=Re.current)==null||qe.update({translateExtent:Y,width:Q,height:ve,inversePan:U,pannable:M,zoomStep:P,zoomable:A})},[M,A,U,P,Y,Q,ve]);const _e=_?qe=>{var gt;const[mt,dt]=((gt=Re.current)==null?void 0:gt.pointer(qe))||[0,0];_(qe,{x:mt,y:dt})}:void 0,tt=j?L.useCallback((qe,mt)=>{const dt=R.getState().nodeLookup.get(mt).internals.userNode;j(qe,dt)},[]):void 0,Fe=T??B["minimap.ariaLabel"];return p.jsx(Ga,{position:k,style:{...e,"--xy-minimap-background-color-props":typeof y=="string"?y:void 0,"--xy-minimap-mask-background-color-props":typeof w=="string"?w: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 i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-width-props":typeof d=="number"?d:void 0},className:hn(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:p.jsxs("svg",{width:ie,height:G,viewBox:`${Se} ${je} ${Le} ${Ie}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Ee,ref:F,onClick:_e,children:[Fe&&p.jsx("title",{id:Ee,children:Fe}),p.jsx(L2,{onClick:tt,nodeColor:i,nodeStrokeColor:o,nodeBorderRadius:c,nodeClassName:a,nodeStrokeWidth:d,nodeComponent:m}),p.jsx("path",{className:"react-flow__minimap-mask",d:`M${Se-K},${je-K}h${Le+K*2}v${Ie+K*2}h${-Le-K*2}z
202
+ M${ue.x},${ue.y}h${ue.width}v${ue.height}h${-ue.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Ag.displayName="MiniMap";const H2=L.memo(Ag),V2=e=>r=>e?`${Math.max(1/r.transform[2],1)}`:void 0,U2={[Ui.Line]:"right",[Ui.Handle]:"bottom-right"};function K2({nodeId:e,position:r,variant:o=Ui.Handle,className:i,style:a=void 0,children:c,color:d,minWidth:m=10,minHeight:y=10,maxWidth:w=Number.MAX_VALUE,maxHeight:S=Number.MAX_VALUE,keepAspectRatio:x=!1,resizeDirection:k,autoScale:_=!0,shouldResize:j,onResizeStart:M,onResize:A,onResizeEnd:T}){const U=fg(),P=typeof e=="string"?e:U,$=qt(),R=L.useRef(null),F=o===Ui.Handle,W=Et(L.useCallback(V2(F&&_),[F,_]),Yt),ue=L.useRef(null),ne=r??U2[o];L.useEffect(()=>{if(!(!R.current||!P))return ue.current||(ue.current=hk({domNode:R.current,nodeId:P,getStoreItems:()=>{const{nodeLookup:Y,transform:Q,snapGrid:ve,snapToGrid:B,nodeOrigin:ie,domNode:G}=$.getState();return{nodeLookup:Y,transform:Q,snapGrid:ve,snapToGrid:B,nodeOrigin:ie,paneDomNode:G}},onChange:(Y,Q)=>{const{triggerNodeChanges:ve,nodeLookup:B,parentLookup:ie,nodeOrigin:G}=$.getState(),se=[],H={x:Y.x,y:Y.y},q=B.get(P);if(q&&q.expandParent&&q.parentId){const J=q.origin??G,D=Y.width??q.measured.width??0,K=Y.height??q.measured.height??0,Se={id:q.id,parentId:q.parentId,rect:{width:D,height:K,...A0({x:Y.x??q.position.x,y:Y.y??q.position.y},{width:D,height:K},q.parentId,B,J)}},je=pf([Se],B,ie,G);se.push(...je),H.x=Y.x?Math.max(J[0]*D,Y.x):void 0,H.y=Y.y?Math.max(J[1]*K,Y.y):void 0}if(H.x!==void 0&&H.y!==void 0){const J={id:P,type:"position",position:{...H}};se.push(J)}if(Y.width!==void 0&&Y.height!==void 0){const D={id:P,type:"dimensions",resizing:!0,setAttributes:k?k==="horizontal"?"width":"height":!0,dimensions:{width:Y.width,height:Y.height}};se.push(D)}for(const J of Q){const D={...J,type:"position"};se.push(D)}ve(se)},onEnd:({width:Y,height:Q})=>{const ve={id:P,type:"dimensions",resizing:!1,dimensions:{width:Y,height:Q}};$.getState().triggerNodeChanges([ve])}})),ue.current.update({controlPosition:ne,boundaries:{minWidth:m,minHeight:y,maxWidth:w,maxHeight:S},keepAspectRatio:x,resizeDirection:k,onResizeStart:M,onResize:A,onResizeEnd:T,shouldResize:j}),()=>{var Y;(Y=ue.current)==null||Y.destroy()}},[ne,m,y,w,S,x,M,A,T,j]);const ke=ne.split("-");return p.jsx("div",{className:hn(["react-flow__resize-control","nodrag",...ke,o,i]),ref:R,style:{...a,scale:W,...d&&{[F?"backgroundColor":"borderColor"]:d}},children:c})}L.memo(K2);const q2={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 Oi({method:e,className:r="",size:o="sm"}){const i=e.toLowerCase().trim(),a=q2[i]??"bg-accent/15 text-accent border-accent/40",c=o==="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 p.jsx("span",{className:`inline-flex items-center rounded-md font-semibold uppercase tracking-wide border shrink-0 transition-colors duration-200 ${a} ${c} ${r}`,children:e.toUpperCase()})}function Xd(e,r){if(r.length===0)return[...e??[]];const o=new Map;for(const i of e??[])o.set(`${i.targetSlot}:${i.targetKey}`,i);return r.map(i=>{const a=`${i.slot}:${i.key}`,c=o.get(a);return c?{...c}:{targetSlot:i.slot,targetKey:i.key,mode:"from_response",sourceJsonPath:"$",literal:""}})}function W2(e){return e!=null&&e.length?e.length===1?e[0].targetKey||"→":`${e.length} campos`:"v"}async function jm(e,r,o,i,a){const c=qr(e,r),d=a.replace(/\{[^{}]+\}/g,"1"),m=`${c}${d}`,y=i.toLowerCase(),w={method:y.toUpperCase(),headers:{...o()},credentials:Aa(m)};y!=="get"&&y!=="head"&&(w.body="{}");try{const S=await fetch(m,w),x=await S.text();let k;try{k=x?JSON.parse(x):null}catch{return{ok:!1,error:`HTTP ${S.status}: la respuesta no es JSON`}}return{ok:!0,json:k,httpStatus:S.status,httpOk:S.ok}}catch(S){return{ok:!1,error:S instanceof Error?S.message:String(S)}}}function Em(e,r){const a=new Set;function c(d,m,y){if(a.size>=200||(a.add(m),y>=6||d===null||typeof d!="object"))return;if(Array.isArray(d)){const S=`${m}[0]`;a.add(S),d.length>0&&c(d[0],S,y+1);return}const w=d;for(const S of Object.keys(w))c(w[S],`${m}.${S}`,y+1)}return c(e,"$",0),[...a].sort((d,m)=>d.length-m.length||d.localeCompare(m))}function qu(e,r){if(!r.startsWith("#/"))return;const o=r.slice(2).split("/");let i=e;for(const a of o)if(i&&typeof i=="object"&&a in i)i=i[a];else return;return i}function Y2(e,r){return"$ref"in r?qu(e,r.$ref):r}function Ua(e,r){return"$ref"in r?qu(e,r.$ref):r}function X2(e,r){const o=r.schema;if(!o){const w=r.example;return{...w!=null?{exampleHint:String(w)}:{}}}const i=Ua(e,o);if(!i){const w=r.example;return{...w!=null?{exampleHint:String(w)}:{}}}const a=Array.isArray(i.enum)?i.enum.map(w=>String(w)):void 0,c=i.default,d=c!=null?String(c):void 0,m=r.example!==void 0?r.example:i.example,y=m!=null?String(m):void 0;return{schemaType:typeof i.type=="string"?i.type:void 0,format:typeof i.format=="string"?i.format:void 0,enumOptions:a,defaultLabel:d,exampleHint:y}}function gf(e,r,o){var w;const i=(w=e.paths)==null?void 0:w[o],a=i==null?void 0:i[r.toLowerCase()];if(!a)return[];const c=(i==null?void 0:i.parameters)??[],d=a.parameters??[],m=new Set,y=[];for(const S of[...c,...d]){const x=Y2(e,S);if(!x||!["query","path","header","cookie"].includes(x.in))continue;const k=`${x.in}:${x.name}`;m.has(k)||(m.add(k),y.push({name:x.name,in:x.in,required:!!x.required,description:typeof x.description=="string"?x.description:void 0,...X2(e,x)}))}return y}function Ia(e,r,o){var y,w,S,x;const i=(w=(y=e.paths)==null?void 0:y[o])==null?void 0:w[r.toLowerCase()];if(!(i!=null&&i.requestBody))return null;const a=i.requestBody,c="$ref"in a?qu(e,a.$ref):a;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,m=Ua(e,d);if(!m)return null;if(m.type==="object"&&m.properties&&Object.keys(m.properties).length>0){const k=new Set(m.required??[]);return Object.keys(m.properties).map(_=>{const j=m.properties[_],M=j&&"$ref"in j?Ua(e,j):j;return Og(_,k.has(_),M,!1)})}return null}function Og(e,r,o,i){const a=o&&Array.isArray(o.enum)?o.enum.map(w=>String(w)):void 0,c=o==null?void 0:o.default,d=c!=null?String(c):void 0,m=o==null?void 0:o.example,y=m!=null?String(m):void 0;return{key:e,required:r,description:o==null?void 0:o.description,format:o==null?void 0:o.format,type:o==null?void 0:o.type,isFile:i,enumOptions:a,defaultLabel:d,exampleHint:y}}function yu(e,r,o){var y,w,S,x;const i=(w=(y=e.paths)==null?void 0:y[o])==null?void 0:w[r.toLowerCase()];if(!(i!=null&&i.requestBody))return null;const a=i.requestBody,c="$ref"in a?qu(e,a.$ref):a;if(!((x=(S=c==null?void 0:c.content)==null?void 0:S["multipart/form-data"])!=null&&x.schema))return null;const d=c.content["multipart/form-data"].schema,m=Ua(e,d);if(!m)return null;if(m.type==="object"&&m.properties&&Object.keys(m.properties).length>0){const k=new Set(m.required??[]);return Object.keys(m.properties).map(_=>{const j=m.properties[_],M=j&&"$ref"in j?Ua(e,j):j,A=(M==null?void 0:M.type)==="string"&&(M==null?void 0:M.format)==="binary";return Og(_,k.has(_),M,A)})}return null}function Q2(e,r,o){const i=new FormData;for(const a of e)if(a.isFile){const c=o[a.key];c&&i.append(a.key,c,c.name)}else{const c=r[a.key]??"";if(c.trim()==="")continue;i.append(a.key,c)}return i}function J2(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Lg(e,r){let o=e;for(const[i,a]of Object.entries(r))o=o.replace(new RegExp(`\\{${J2(i)}\\}`,"g"),encodeURIComponent(a));return o}function Rg(e,r){const o=new URLSearchParams;for(const a of r){if(a.in!=="query")continue;const c=e[a.name];c!==void 0&&c!==""&&o.set(a.name,c)}const i=o.toString();return i?`?${i}`:""}function Dg(e,r){var i;if(!(e!=null&&e.length))return{};const o={};for(const a of e){const c=((i=r[a.key])==null?void 0:i.trim())??"";if(c==="")continue;const d=a.type;if(d==="integer"||d==="number"){const m=Number(c);o[a.key]=Number.isFinite(m)?m:c}else if(d==="boolean")o[a.key]=c==="true"||c==="1";else try{o[a.key]=JSON.parse(c)}catch{o[a.key]=c}}return o}function Cm(e,r){const o=Dg(e,r);return JSON.stringify(o,null,2)}function G2(e,r){if(!(e!=null&&e.length))return{};try{const o=JSON.parse(r||"{}"),i={};for(const a of e)if(a.key in o&&o[a.key]!==void 0){const c=o[a.key];i[a.key]=typeof c=="string"?c:JSON.stringify(c)}else i[a.key]="";return i}catch{return Object.fromEntries(e.map(o=>[o.key,""]))}}function zg(e){return/\{[^/}]+\}/.test(e)}function Z2(e){const r=[],o=/\{([^}]+)\}/g;let i;for(;(i=o.exec(e))!==null;)r.push(i[1]);return r}const Pm={path:0,query:1,header:2,cookie:3,body:4};function Fg(e,r,o){const i=new Map,a=gf(e,r,o);for(const d of a){const m=d.in==="path"?"path":d.in==="query"?"query":d.in==="header"?"header":"cookie",y=`${m}:${d.name}`;i.set(y,{slot:m,key:d.name,required:d.required,description:d.description})}for(const d of Z2(o)){const m=`path:${d}`;i.has(m)||i.set(m,{slot:"path",key:d,required:!0})}const c=Ia(e,r,o);if(c)for(const d of c)i.set(`body:${d.key}`,{slot:"body",key:d.key,required:d.required,description:d.description});return[...i.values()].sort((d,m)=>Pm[d.slot]-Pm[m.slot]||d.key.localeCompare(m.key))}const eN={path:"Path",query:"Query",header:"Header",cookie:"Cookie",body:"Body JSON"};function tN(e,r){return e.find(o=>o.slot===r.targetSlot&&o.key===r.targetKey)}function nN(e){return e.mode==="literal"?!!e.literal&&e.literal.trim()!=="":!!e.sourceJsonPath&&e.sourceJsonPath.trim()!==""}function rN({doc:e,edgeId:r,mapping:o,sourceData:i,targetData:a,baseUrl:c,buildHeaders:d,onPatchMapping:m,onReplaceBindings:y}){const[w,S]=L.useState(!1),[x,k]=L.useState([]),[_,j]=L.useState(null),M=L.useRef(d);M.current=d;const A=L.useMemo(()=>a?Fg(e,a.method,a.path):[],[e,a]),T=L.useMemo(()=>Xd(o.bindings,A),[o.bindings,A]),U=a?`${a.method} ${a.path}`:"";L.useEffect(()=>{if(!a||A.length===0)return;const R=Xd(o.bindings,A);JSON.stringify(R)!==JSON.stringify(o.bindings??[])&&y(R)},[r,U]),L.useEffect(()=>{if(!i){k([]),j(null),S(!1);return}let R=!1;return S(!0),k([]),j(null),jm(e,c,()=>M.current(),i.method,i.path).then(F=>{if(!R){if(S(!1),!F.ok){j(F.error);return}k(Em(F.json)),j(F.httpOk?`Respuesta de muestra HTTP ${F.httpStatus}`:`HTTP ${F.httpStatus} (no OK), JSON analizable`)}}),()=>{R=!0}},[e,c,i==null?void 0:i.method,i==null?void 0:i.path,r]);const P=(R,F,W)=>{const ue=T.map(ne=>ne.targetSlot===R&&ne.targetKey===F?{...ne,...W}:ne);y(ue)},$=()=>{i&&(S(!0),k([]),j(null),jm(e,c,()=>M.current(),i.method,i.path).then(R=>{if(S(!1),!R.ok){j(R.error);return}k(Em(R.json)),j(R.httpOk?`Respuesta de muestra HTTP ${R.httpStatus}`:`HTTP ${R.httpStatus} (no OK), JSON analizable`)}))};return T.length===0?p.jsxs("div",{className:"space-y-3 text-xs",children:[p.jsx("p",{className:"text-slate-500",children:"Este cable no tiene filas multi-campo (spec sin params/body o flujo antiguo). Usa el modo clásico."}),p.jsx($m,{mapping:o,onPatchMapping:m})]}):p.jsxs("div",{className:"space-y-4 text-xs",children:[i?p.jsxs("div",{className:"rounded-lg border border-surface-700/90 bg-surface-950/50 p-3 space-y-2",children:[p.jsxs("p",{className:"text-[11px] text-slate-400",children:[p.jsx("span",{className:"text-slate-600",children:"Origen (se llama al abrir el modal del cable):"})," ",p.jsxs("span",{className:"font-mono text-slate-200",children:[i.method.toUpperCase()," ",i.path]})]}),p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.jsx("button",{type:"button",disabled:w,onClick:()=>$(),className:"min-h-[40px] rounded-lg bg-sky-600/90 px-3 py-2 text-xs font-medium text-white transition hover:bg-sky-500 disabled:opacity-50 cursor-pointer",children:w?"Obteniendo…":"Actualizar muestra del origen"}),_?p.jsx("span",{className:"text-[11px] text-slate-400",children:_}):null]})]}):null,a?p.jsxs("p",{className:"text-[11px] text-slate-500",children:[p.jsx("span",{className:"text-slate-600",children:"Destino:"})," ",p.jsxs("span",{className:"font-mono text-slate-300",children:[a.method.toUpperCase()," ",a.path]})]}):null,p.jsx("p",{className:"text-[11px] text-slate-500",children:"Cada fila es un campo del request destino. * = obligatorio en el OpenAPI. Elige valor desde la respuesta (JSON path) o fijo."}),p.jsx("ul",{className:"space-y-3",children:T.map(R=>{const F=tN(A,R),W=(F==null?void 0:F.required)??!1,ue=!W||nN(R);return p.jsxs("li",{className:`rounded-lg border p-3 space-y-2 ${ue?"border-surface-700 bg-surface-900/40":"border-rose-700/60 bg-rose-950/20"}`,children:[p.jsxs("div",{className:"flex flex-wrap items-baseline gap-2",children:[p.jsx("span",{className:"rounded bg-surface-800 px-1.5 py-0.5 text-[10px] font-semibold text-accent",children:eN[R.targetSlot]}),p.jsx("span",{className:"font-mono text-[12px] text-slate-200",children:R.targetKey}),W?p.jsx("span",{className:"text-rose-400",children:"*"}):null,F!=null&&F.description?p.jsx("span",{className:"text-[10px] text-slate-500 truncate max-w-full",children:F.description}):null]}),p.jsxs("label",{className:"block text-slate-500",children:["Origen del valor",p.jsxs("select",{className:"mt-1 w-full max-w-xs bg-surface-800 border border-surface-600 rounded px-2 py-2 cursor-pointer",value:R.mode,onChange:ne=>P(R.targetSlot,R.targetKey,{mode:ne.target.value}),children:[p.jsx("option",{value:"from_response",children:"Desde JSON de la respuesta"}),p.jsx("option",{value:"literal",children:"Valor fijo"})]})]}),R.mode==="from_response"?p.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[x.length>0?p.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Campos detectados en la respuesta",p.jsxs("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-2 font-mono text-[11px] cursor-pointer",value:x.includes(R.sourceJsonPath)?R.sourceJsonPath:"",onChange:ne=>{const ke=ne.target.value;ke&&P(R.targetSlot,R.targetKey,{sourceJsonPath:ke})},children:[p.jsx("option",{value:"",children:"— Escribir JSON path manual —"}),x.map(ne=>p.jsx("option",{value:ne,children:ne},ne))]})]}):null,p.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["JSON path",p.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-2 font-mono text-[11px]",value:R.sourceJsonPath,onChange:ne=>P(R.targetSlot,R.targetKey,{sourceJsonPath:ne.target.value}),placeholder:"$.id"})]})]}):p.jsxs("label",{className:"block text-slate-500",children:["Valor fijo",p.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-2 font-mono text-[11px]",value:R.literal??"",onChange:ne=>P(R.targetSlot,R.targetKey,{literal:ne.target.value}),placeholder:'texto o {"a":1}'})]})]},`${R.targetSlot}:${R.targetKey}`)})}),p.jsxs("details",{className:"rounded-lg border border-surface-700/80 bg-surface-950/30 p-2",children:[p.jsx("summary",{className:"cursor-pointer text-[11px] text-slate-400 select-none",children:"Modo clásico (una variable + JSON path)"}),p.jsx("div",{className:"mt-2 pt-2 border-t border-surface-700/60",children:p.jsx($m,{mapping:o,onPatchMapping:m})})]})]})}function $m({mapping:e,onPatchMapping:r}){return p.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[p.jsxs("label",{className:"text-slate-500",children:["JSON path",p.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:e.sourceJsonPath??"$",onChange:o=>r({sourceJsonPath:o.target.value})})]}),p.jsxs("label",{className:"text-slate-500",children:["Variable",p.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5",value:e.variableName??"",onChange:o=>r({variableName:o.target.value})})]}),p.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Uso en destino",p.jsxs("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 cursor-pointer",value:e.useInTarget??"vars_only",onChange:o=>r({useInTarget:o.target.value}),children:[p.jsx("option",{value:"vars_only",children:"{variable} en la ruta"}),p.jsx("option",{value:"path_param",children:"Path param"}),p.jsx("option",{value:"header",children:"Header"}),p.jsx("option",{value:"query",children:"Query"})]})]}),(e.useInTarget==="path_param"||e.useInTarget==="header"||e.useInTarget==="query")&&p.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Clave",p.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:e.targetKey??"",onChange:o=>r({targetKey:o.target.value})})]})]})}const Bg=L.createContext(null);function oN(){return L.useContext(Bg)}const Li=()=>({sourceJsonPath:"$",variableName:"v",useInTarget:"vars_only",targetKey:""});function sN(e){var ue;const{id:r,sourceX:o,sourceY:i,targetX:a,targetY:c,sourcePosition:d,targetPosition:m,data:y,selected:w,style:S,markerStart:x,markerEnd:k,interactionWidth:_}=e,j=y,M=oN(),[A,T,U]=lf({sourceX:o,sourceY:i,sourcePosition:d,targetX:a,targetY:c,targetPosition:m}),P=(j==null?void 0:j.mapping)??Li(),$=(ue=P.bindings)!=null&&ue.length?W2(P.bindings):P.variableName||"→",R=(M==null?void 0:M.selectedEdgeId)===r,F=w||R,W={stroke:F?"rgb(56 189 248 / 0.95)":"rgb(148 163 184 / 0.9)",strokeWidth:F?2.5:2};return M?p.jsxs(p.Fragment,{children:[p.jsx(qi,{id:r,path:A,markerStart:x,markerEnd:k,interactionWidth:_,style:{...W,...S}}),p.jsx(h2,{children:p.jsx("div",{style:{position:"absolute",transform:`translate(-50%, -100%) translate(${T}px,${U}px)`,pointerEvents:"all",marginTop:-6},className:"nodrag nopan",children:p.jsx("button",{type:"button",onClick:ne=>{ne.stopPropagation(),M.setSelectedEdgeId(r)},className:"max-w-[140px] truncate rounded-full border border-surface-600 bg-surface-900/95 px-2.5 py-1.5 text-[10px] font-medium text-slate-200 shadow-lg transition hover:border-accent/50 hover:bg-surface-800 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/70 focus-visible:ring-offset-2 focus-visible:ring-offset-surface-950",title:"Abrir configuración del cable (modal)",children:$})})})]}):p.jsx(qi,{id:r,path:A,markerStart:x,markerEnd:k,interactionWidth:_,style:{...W,...S}})}function yf(e,r,o){var c,d;const i=r.toLowerCase(),a=(d=(c=e.paths)==null?void 0:c[o])==null?void 0:d[i];return(a==null?void 0:a.summary)??(a==null?void 0:a.operationId)??`${r.toUpperCase()} ${o}`}function xf(e,r,o){var m,y,w,S;const i=r.toLowerCase(),a=(y=(m=e.paths)==null?void 0:m[o])==null?void 0:y[i];if(!(a!=null&&a.requestBody))return"— sin body";const d=(S=(w=a.requestBody.content)==null?void 0:w["application/json"])==null?void 0:S.schema;return d&&"$ref"in d?`body: ${d.$ref}`:"body: JSON"}function vf(e,r,o){var m,y,w,S,x,k;const i=r.toLowerCase(),a=(y=(m=e.paths)==null?void 0:m[o])==null?void 0:y[i],c=((w=a==null?void 0:a.responses)==null?void 0:w["200"])??((S=a==null?void 0:a.responses)==null?void 0:S["201"]);if(!c)return"—";const d=typeof c=="object"&&c&&"content"in c?(k=(x=c.content)==null?void 0:x["application/json"])==null?void 0:k.schema:void 0;return d&&"$ref"in d?String(d.$ref):"JSON"}function Ed(e,r){return`${e.toLowerCase()} ${r}`}function iN(e){const r=e.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:e.slice(0,r),path:e.slice(r+1)}}const Hg=L.createContext(null);function aN(e){const{id:r,selected:o}=e,i=e.data,a=L.useContext(Hg),c=m2();return L.useEffect(()=>{c(r)},[i.path,i.method,r,c]),p.jsxs("div",{className:`rounded-xl border bg-surface-950/90 px-3 py-2 min-w-[200px] max-w-[280px] shadow-lg ${o?"border-accent ring-2 ring-accent/40":"border-surface-600"}`,children:[p.jsx(Ki,{type:"target",position:ot.Left,id:"in",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-teal-500"}),p.jsxs("div",{className:"flex items-center gap-2 mb-1 min-w-0",children:[p.jsx(Oi,{method:i.method}),p.jsx("span",{className:"text-[10px] text-slate-500 truncate",title:i.summary,children:i.summary})]}),a?p.jsxs("label",{className:"block text-[10px] text-slate-500 mb-1",children:["Endpoint",p.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:Ed(i.method,i.path),onChange:d=>{const{method:m,path:y}=iN(d.target.value);a.updateNodeData(r,{method:m,path:y,summary:yf(a.doc,m,y),reqHint:xf(a.doc,m,y),resHint:vf(a.doc,m,y)})},children:a.ops.map(d=>p.jsxs("option",{value:Ed(d.method,d.path),children:[d.method.toUpperCase()," ",d.path]},Ed(d.method,d.path)))})]}):p.jsx("p",{className:"font-mono text-[11px] text-slate-300 truncate",children:i.path}),p.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-1 text-[9px] text-slate-500 leading-tight",children:[p.jsxs("div",{children:[p.jsx("span",{className:"text-slate-600",children:"req"})," ",i.reqHint]}),p.jsxs("div",{children:[p.jsx("span",{className:"text-slate-600",children:"res"})," ",i.resHint]})]}),p.jsx(Ki,{type:"source",position:ot.Right,id:"out",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-amber-500"})]})}const lN={apiOp:aN},uN={binding:sN};function cN(e,r){const o=Li();if(!r)return o;const{method:i,path:a}=r.data,c=Fg(e,i,a);return c.length===0?o:{...o,bindings:Xd(void 0,c)}}function dN(e,r){const o=r.nodes.map(a=>({id:a.id,type:"apiOp",position:{x:a.x,y:a.y},data:{method:a.method.toLowerCase(),path:a.path,summary:yf(e,a.method,a.path),reqHint:xf(e,a.method,a.path),resHint:vf(e,a.method,a.path)}})),i=r.edges.map(a=>({id:a.id,type:"binding",source:a.source,target:a.target,sourceHandle:"out",targetHandle:"in",data:{mapping:{...a.mapping}}}));return{nodes:o,edges:i}}function fN(e,r){return{nodes:e.map(o=>({id:o.id,method:o.data.method,path:o.data.path,x:o.position.x,y:o.position.y})),edges:r.map(o=>{var i;return{id:o.id,source:o.source,target:o.target,mapping:((i=o.data)==null?void 0:i.mapping)??Li()}})}}function pN({doc:e,ops:r,graph:o,onGraphChange:i,baseUrl:a,buildHeaders:c}){var Y;const d=L.useMemo(()=>dN(e,o),[e,o]),[m,y,w]=g2(d.nodes),[S,x,k]=y2(d.edges),[_,j]=L.useState(null);L.useEffect(()=>{i(fN(m,S))},[m,S,i]);const M=L.useCallback((Q,ve)=>{y(B=>B.map(ie=>ie.id===Q?{...ie,data:{...ie.data,...ve}}:ie))},[y]),A=L.useMemo(()=>({doc:e,ops:r,updateNodeData:M}),[e,r,M]),T=L.useCallback(Q=>{Q.sourceHandle!=="out"||Q.targetHandle!=="in"||x(ve=>{const B=m.find(G=>G.id===Q.target),ie=cN(e,B);return F0({...Q,type:"binding",id:`e-${Q.source}-${Q.target}-${crypto.randomUUID().slice(0,8)}`,sourceHandle:"out",targetHandle:"in",data:{mapping:ie}},ve)})},[x,m,e]),U=L.useCallback((Q,ve)=>{x(B=>B.map(ie=>{var se;if(ie.id!==Q)return ie;const G={...((se=ie.data)==null?void 0:se.mapping)??Li(),...ve};return{...ie,data:{mapping:G}}}))},[x]),P=L.useCallback((Q,ve)=>{x(B=>B.map(ie=>{var H;if(ie.id!==Q)return ie;const se={...((H=ie.data)==null?void 0:H.mapping)??Li(),bindings:ve};return{...ie,data:{mapping:se}}}))},[x]),$=L.useMemo(()=>({selectedEdgeId:_,setSelectedEdgeId:j}),[_,j]),R=S.find(Q=>Q.id===_),F=R?m.find(Q=>Q.id===R.source):void 0,W=R?m.find(Q=>Q.id===R.target):void 0,ue=F==null?void 0:F.data,ne=W==null?void 0:W.data;L.useEffect(()=>{_&&!S.some(Q=>Q.id===_)&&j(null)},[S,_]),L.useEffect(()=>{if(!_)return;const Q=ve=>{ve.key==="Escape"&&j(null)};return window.addEventListener("keydown",Q),()=>window.removeEventListener("keydown",Q)},[_]),L.useEffect(()=>{if(!_)return;const Q=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Q}},[_]);const ke=()=>{const Q=m.reduce((H,q)=>q.position.x>H?q.position.x:H,0),ve=r[0];if(!ve)return;const B=crypto.randomUUID(),ie=Q>0?Q+40:80,se={id:B,type:"apiOp",position:{x:ie,y:120},data:{method:ve.method.toLowerCase(),path:ve.path,summary:yf(e,ve.method,ve.path),reqHint:xf(e,ve.method,ve.path),resHint:vf(e,ve.method,ve.path)}};y(H=>[...H,se])};return p.jsx(Hg.Provider,{value:A,children:p.jsx(Bg.Provider,{value:$,children:p.jsxs("div",{className:"space-y-3",children:[p.jsx("div",{className:"h-[min(520px,70vh)] w-full rounded-xl border border-surface-700 bg-surface-950",children:p.jsxs(f2,{nodes:m,edges:S,onNodesChange:w,onEdgesChange:k,onConnect:T,nodeTypes:lN,edgeTypes:uN,onEdgeClick:(Q,ve)=>j(ve.id),onPaneClick:()=>j(null),fitView:!0,minZoom:.4,maxZoom:1.5,proOptions:{hideAttribution:!0},isValidConnection:Q=>Q.sourceHandle==="out"&&Q.targetHandle==="in",children:[p.jsx(k2,{variant:Vo.Dots,gap:16,size:1,color:"rgb(51 65 85 / 0.5)"}),p.jsx(P2,{className:"!bg-surface-900 !border-surface-600 !shadow-lg"}),p.jsx(H2,{className:"!bg-surface-900/95 !border-surface-600",nodeColor:()=>"rgb(45 212 191 / 0.5)"}),p.jsx(Ga,{position:"top-left",children:p.jsx("button",{type:"button",onClick:ke,className:"text-xs px-3 py-2 rounded-lg bg-accent/90 text-surface-950 font-medium shadow",children:"+ Nodo (endpoint)"})})]})}),p.jsx("p",{className:"text-xs text-slate-500 px-0.5",children:"Conecta la salida (res) con la entrada (req) de otro nodo. Pulsa el cable o la etiqueta sobre la línea para abrir un modal a pantalla completa con el mapeo. Clic fuera del cuadro o Escape lo cierra."}),typeof document<"u"&&_&&R&&eg.createPortal(p.jsx("div",{role:"presentation",className:"fixed inset-0 z-[300] flex items-start justify-center overflow-y-auto bg-black/65 px-4 py-8 backdrop-blur-sm sm:items-center sm:py-10",onClick:()=>j(null),children:p.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"flow-edge-modal-title",className:"relative flex w-full max-w-2xl max-h-[min(92vh,880px)] flex-col rounded-2xl border border-surface-600 bg-surface-900 shadow-2xl ring-1 ring-surface-700/80",onClick:Q=>Q.stopPropagation(),children:[p.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-surface-700 px-4 py-3",children:[p.jsx("h2",{id:"flow-edge-modal-title",className:"text-sm font-semibold text-slate-100",children:"Cable: respuesta → request"}),p.jsx("button",{type:"button",className:"min-h-[44px] min-w-[44px] shrink-0 rounded-lg border border-surface-600 px-3 text-sm text-slate-300 transition-colors hover:bg-surface-800 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/70",onClick:()=>j(null),"aria-label":"Cerrar modal",children:"Cerrar"})]}),p.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto overflow-x-hidden p-4",children:p.jsx(rN,{doc:e,edgeId:R.id,mapping:((Y=R.data)==null?void 0:Y.mapping)??Li(),sourceData:ue,targetData:ne,baseUrl:a,buildHeaders:c,onPatchMapping:Q=>U(R.id,Q),onReplaceBindings:Q=>P(R.id,Q)})})]})}),document.body)]})})})}function Vg(e,r){const o=new Map(e.map(y=>[y.id,y])),i=new Set(e.map(y=>y.id)),a=new Map,c=new Map;for(const y of i)a.set(y,0),c.set(y,[]);for(const y of r)!i.has(y.source)||!i.has(y.target)||(a.set(y.target,(a.get(y.target)??0)+1),c.get(y.source).push(y.target));const d=[];for(const[y,w]of a)w===0&&d.push(y);d.sort((y,w)=>o.get(y).x-o.get(w).x||o.get(y).y-o.get(w).y);const m=[];for(;d.length;){const y=d.shift();m.push(y);for(const w of c.get(y)??[]){const S=(a.get(w)??0)-1;a.set(w,S),S===0&&(d.push(w),d.sort((x,k)=>o.get(x).x-o.get(k).x||o.get(x).y-o.get(k).y))}}if(m.length<e.length){const y=e.filter(w=>!m.includes(w.id)).sort((w,S)=>w.x-S.x||w.y-S.y);return[...m.map(w=>o.get(w)),...y]}return m.map(y=>o.get(y))}function hN(e,r){if(r.mode==="literal")return r.literal===void 0||r.literal.trim()===""?void 0:r.literal;const o=(r.sourceJsonPath??"$").trim()||"$",i=Ou(e,o);if(i!=null)return typeof i=="object"?JSON.stringify(i):String(i)}function mN(e,r,o,i,a,c){switch(i){case"path":e.value=e.value.split(`{${a}}`).join(encodeURIComponent(c));break;case"query":{const d=e.value.includes("?")?"&":"?";e.value=`${e.value}${d}${encodeURIComponent(a)}=${encodeURIComponent(c)}`;break}case"header":{r[a]=a.toLowerCase()==="authorization"&&!c.startsWith("Bearer ")?`Bearer ${c}`:c;break}case"cookie":{const d=`${a}=${c}`;r.Cookie=r.Cookie?`${r.Cookie}; ${d}`:d;break}case"body":{let d=c;try{d=JSON.parse(c)}catch{d=c}o[a]=d;break}}}function gN(e,r,o,i){if(i!==void 0)switch(o.useInTarget){case"path_param":o.targetKey&&(e.value=e.value.split(`{${o.targetKey}}`).join(encodeURIComponent(i)));break;case"header":if(o.targetKey){const a=o.targetKey;r[a]=a.toLowerCase()==="authorization"&&!i.startsWith("Bearer ")?`Bearer ${i}`:i}break;case"query":{if(!o.targetKey)break;const a=e.value.includes("?")?"&":"?";e.value=`${e.value}${a}${encodeURIComponent(o.targetKey)}=${encodeURIComponent(i)}`;break}case"vars_only":default:e.value=e.value.split(`{${o.variableName}}`).join(i);break}}async function Mm(e,r,o){var w;const{nodes:i,edges:a}=e;if(i.length===0)return"Sin nodos en el flujo.";const c=Vg(i,a),d={},m={};let y="";for(let S=0;S<c.length;S++){const x=c[S],k={value:x.path},_={...o()},j={},M=a.filter(W=>W.target===x.id);for(const W of M){const ue=W.mapping,ne=m[W.source];if(ue.bindings&&ue.bindings.length>0)for(const ke of ue.bindings){const Y=hN(ne,ke);Y!==void 0&&mN(k,_,j,ke.targetSlot,ke.targetKey,Y)}else{const ke=d[ue.variableName];gN(k,_,ue,ke)}}for(const[W,ue]of Object.entries(d))k.value=k.value.split(`{${W}}`).join(ue);const A=`${r.replace(/\/$/,"")}${k.value}`,T={method:x.method.toUpperCase(),headers:_},U=x.method.toLowerCase();U!=="get"&&U!=="head"&&(T.body=Object.keys(j).length>0?JSON.stringify(j):"{}");const P=await fetch(A,{...T,credentials:Aa(A)});let $={};const R=await P.text();try{$=R?JSON.parse(R):{}}catch{$={_raw:R}}m[x.id]=$,y+=`▸ ${x.method.toUpperCase()} ${x.path} → ${P.status}
203
+ ${JSON.stringify($,null,2)}
204
+
205
+ `;const F=a.filter(W=>W.source===x.id);for(const W of F){const ue=W.mapping;if(ue.bindings&&ue.bindings.length>0)continue;const ne=((w=ue.sourceJsonPath)==null?void 0:w.trim())||"$",ke=Ou($,ne);ke!=null&&(d[ue.variableName]=typeof ke=="object"?JSON.stringify(ke):String(ke))}}return y+=`
206
+ Variables finales: ${JSON.stringify(d,null,2)}`,y}function yN(e){const r=Vg(e.nodes,e.edges);return r.map((o,i)=>{const a=r[i+1];if(!a)return{method:o.method,path:o.path};const c=e.edges.find(m=>m.source===o.id&&m.target===a.id);if(!c)return{method:o.method,path:o.path};const d=c.mapping;if(d.bindings&&d.bindings.length>0){const m=d.bindings.find(y=>y.mode==="from_response")??d.bindings[0];return{method:o.method,path:o.path,extract:{varName:m.targetKey||"v",jsonPath:m.sourceJsonPath||"$"}}}return{method:o.method,path:o.path,extract:{varName:d.variableName,jsonPath:d.sourceJsonPath||"$"}}})}function xN(e){var i;const r=e.map((a,c)=>({id:`n-${c}`,method:a.method,path:a.path,x:40+c*300,y:120})),o=[];for(let a=0;a<e.length-1;a++){const c=(i=e[a])==null?void 0:i.extract;c!=null&&c.jsonPath&&o.push({id:`e-${a}`,source:`n-${a}`,target:`n-${a+1}`,mapping:{sourceJsonPath:c.jsonPath,variableName:c.varName,useInTarget:"vars_only",targetKey:""}})}return{nodes:r,edges:o}}const Ug=L.createContext({productName:null,logoDataUrl:null});function vN({value:e,children:r}){return p.jsx(Ug.Provider,{value:e,children:r})}function wN(){return L.useContext(Ug)}function bN({data:e,defaultOpenDepth:r=3}){return p.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:p.jsx(wf,{value:e,depth:0,defaultOpenDepth:r})})}function wf({value:e,depth:r,defaultOpenDepth:o,name:i}){return e===null||typeof e!="object"?p.jsx(kN,{name:i,value:e}):Array.isArray(e)?p.jsx(SN,{name:i,value:e,depth:r,defaultOpenDepth:o}):p.jsx(NN,{name:i,value:e,depth:r,defaultOpenDepth:o})}function kN({name:e,value:r}){return p.jsxs("div",{className:"pl-1 break-all",children:[e!=null&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(e)}),p.jsx("span",{className:"text-slate-500",children:": "})]}),p.jsx("span",{className:"text-emerald-200/95",children:JSON.stringify(r)})]})}function SN({name:e,value:r,depth:o,defaultOpenDepth:i}){const a=o<i,[c,d]=L.useState(a);return r.length===0?p.jsxs("div",{className:"pl-1",children:[e!=null&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(e)}),p.jsx("span",{className:"text-slate-500",children:": "})]}),p.jsx("span",{className:"text-slate-500",children:"[]"})]}):p.jsxs("div",{className:"pl-1",children:[e!=null&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(e)}),p.jsx("span",{className:"text-slate-500",children:": "})]}),p.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?"▼":"▶"}),p.jsx("span",{className:"text-slate-500",children:"["}),p.jsx("span",{className:"text-slate-600 text-[10px] ml-1",children:r.length}),c&&p.jsx("ul",{className:"list-none my-0.5 ml-4 border-l border-surface-600 pl-2 space-y-0.5",children:r.map((m,y)=>p.jsxs("li",{children:[p.jsx("span",{className:"text-violet-400/90 mr-1",children:y}),p.jsx(wf,{value:m,depth:o+1,defaultOpenDepth:i})]},y))}),!c&&p.jsx("span",{className:"text-slate-600",children:" … "}),p.jsx("span",{className:"text-slate-500",children:"]"})]})}function NN({name:e,value:r,depth:o,defaultOpenDepth:i}){const a=Object.keys(r),c=o<i,[d,m]=L.useState(c);return a.length===0?p.jsxs("div",{className:"pl-1",children:[e!=null&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(e)}),p.jsx("span",{className:"text-slate-500",children:": "})]}),p.jsx("span",{className:"text-slate-500",children:"{}"})]}):p.jsxs("div",{className:"pl-1",children:[e!=null&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(e)}),p.jsx("span",{className:"text-slate-500",children:": "})]}),p.jsx("button",{type:"button","aria-expanded":d,onClick:()=>m(!d),className:"inline align-middle text-slate-400 hover:text-slate-200 mr-1 select-none w-4",children:d?"▼":"▶"}),p.jsx("span",{className:"text-slate-500",children:"{"}),p.jsx("span",{className:"text-slate-600 text-[10px] ml-1",children:a.length}),d&&p.jsx("ul",{className:"list-none my-0.5 ml-4 border-l border-surface-600 pl-2 space-y-0.5",children:a.map(y=>p.jsx("li",{children:p.jsx(wf,{name:y,value:r[y],depth:o+1,defaultOpenDepth:i})},y))}),!d&&p.jsx("span",{className:"text-slate-600",children:" … "}),p.jsx("span",{className:"text-slate-500",children:"}"})]})}function _N(e,r,o,i,a){var m,y;const c={...e};for(const w of r){const S=(m=o[w.name])==null?void 0:m.trim();S&&(c[w.name]=S)}const d=[];for(const w of i){const S=(y=a[w.name])==null?void 0:y.trim();S&&d.push(`${w.name}=${S}`)}return d.length&&(c.Cookie=c.Cookie?`${c.Cookie}; ${d.join("; ")}`:d.join("; ")),c}function Tm(e,r,o,i,a){var R,F,W,ue,ne,ke;const c=gf(e,r.method,r.path),d=c.filter(Y=>Y.in==="path"),m=c.filter(Y=>Y.in==="query"),y=c.filter(Y=>Y.in==="header"),w=c.filter(Y=>Y.in==="cookie"),S=Ia(e,r.method,r.path),x=yu(e,r.method,r.path),k=x!=null&&x.length&&x.length>0?x:S,_=r.method.toLowerCase(),j=_!=="get"&&_!=="head";for(const Y of d)if(Y.required&&!((R=a.pathVals[Y.name])!=null&&R.trim()))return{ok:!1,error:`Parámetro de ruta obligatorio: ${Y.name}`};for(const Y of m)if(Y.required&&!((F=a.queryVals[Y.name])!=null&&F.trim()))return{ok:!1,error:`Query obligatorio: ${Y.name}`};for(const Y of y)if(Y.required&&!((W=a.headerVals[Y.name])!=null&&W.trim()))return{ok:!1,error:`Header obligatorio: ${Y.name}`};for(const Y of w)if(Y.required&&!((ue=a.cookieVals[Y.name])!=null&&ue.trim()))return{ok:!1,error:`Cookie obligatorio: ${Y.name}`};let M=Lg(r.path,a.pathVals);if(zg(M))return{ok:!1,error:"Quedan placeholders `{…}` en la ruta sin valor."};const A=Rg(a.queryVals,c),U=`${qr(e,o)}${M}${A}`,P=_N(i(),y,a.headerVals,w,a.cookieVals);let $;if(j)if(!!(x!=null&&x.length&&x.length>0)&&a.bodyMode==="fields"&&(k!=null&&k.length)){for(const Q of k)if(Q.isFile){if(Q.required&&!a.multipartFiles[Q.key])return{ok:!1,error:`Archivo obligatorio: ${Q.key}`}}else if(Q.required&&!((ne=a.bodyVals[Q.key])!=null&&ne.trim()))return{ok:!1,error:`Campo de body obligatorio: ${Q.key}`};$=Q2(k,a.bodyVals,a.multipartFiles)}else if(a.bodyMode==="fields"&&(k!=null&&k.length)){for(const ve of k)if(ve.required&&!((ke=a.bodyVals[ve.key])!=null&&ke.trim()))return{ok:!1,error:`Campo de body obligatorio: ${ve.key}`};const Q=Dg(k,a.bodyVals);$=JSON.stringify(Q)}else $=a.tryBodyRaw.trim()||"{}";return $ instanceof FormData&&(delete P["Content-Type"],delete P["content-type"]),{ok:!0,url:U,headers:P,body:$,method:r.method.toUpperCase()}}function Pi(e){return`'${e.replace(/'/g,"'\\''")}'`}function jN(e){const r={};return e.forEach((o,i)=>{r[i]=o}),r}function EN(e){const r=["curl","-sS","-X",Pi(e.method)],o=Object.entries(e.headers);o.sort(([i],[a])=>i.localeCompare(a));for(const[i,a]of o)r.push("-H",Pi(`${i}: ${a}`));if(e.body instanceof FormData)for(const[i,a]of e.body.entries())a instanceof File?r.push("-F",Pi(`${i}=@./${a.name}`)):r.push("-F",Pi(`${i}=${a}`));else e.body!==void 0&&e.body!==""&&r.push("--data",Pi(e.body));return r.push(Pi(e.url)),r.join(" ")}function CN(e){const r=[];return e.forEach((o,i)=>{o instanceof File?r.push(`${i}=<File:${o.name}, ${o.size} bytes>`):r.push(`${i}=${String(o)}`)}),r.length>0?`[multipart/form-data] ${r.join("; ")}`:"[multipart/form-data]"}function Cd(e,r,o){var d;const i=r.toLowerCase(),a=(d=e.paths)==null?void 0:d[o];if(!a||typeof a!="object"||"$ref"in a)return!1;const c=a[i];return(c==null?void 0:c.deprecated)===!0}function PN(e,r,o,i,a,c,d){return{pathVals:{...e},queryVals:{...r},headerVals:{...o},cookieVals:{...i},bodyMode:a,tryBodyRaw:c,bodyVals:{...d}}}function $N({doc:e,selectedOp:r,baseUrl:o,buildHeaders:i,hydrateEntry:a,onHydrateConsumed:c}){const[d,m]=L.useState({}),[y,w]=L.useState({}),[S,x]=L.useState({}),[k,_]=L.useState({}),[j,M]=L.useState({}),[A,T]=L.useState({}),[U,P]=L.useState("{}"),[$,R]=L.useState("raw"),[F,W]=L.useState(null),[ue,ne]=L.useState(null),[ke,Y]=L.useState(null),[Q,ve]=L.useState([]),[B,ie]=L.useState(""),[G,se]=L.useState(null),[H,q]=L.useState(null),J=L.useMemo(()=>gf(e,r.method,r.path),[e,r.method,r.path]),D=L.useMemo(()=>J.filter(xe=>xe.in==="path"),[J]),K=L.useMemo(()=>J.filter(xe=>xe.in==="query"),[J]),Se=L.useMemo(()=>J.filter(xe=>xe.in==="header"),[J]),je=L.useMemo(()=>J.filter(xe=>xe.in==="cookie"),[J]),Le=L.useMemo(()=>Ia(e,r.method,r.path),[e,r.method,r.path]),Ie=L.useMemo(()=>yu(e,r.method,r.path),[e,r.method,r.path]),Ee=Ie!=null&&Ie.length?Ie:Le,Ne=!!(Ie!=null&&Ie.length),Re=L.useMemo(()=>{const xe=qr(e,o),rt=Lg(r.path,d),ut=Rg(y,J),Ot=zg(rt);return{href:`${xe}${rt}${ut}`,unresolved:Ot}},[e,o,r.path,d,y,J]),_e=r.method.toLowerCase(),tt=_e!=="get"&&_e!=="head",Fe=L.useCallback(async()=>{const xe=await Sx(r.method,r.path);ve(xe.sort((rt,ut)=>rt.name.localeCompare(ut.name)))},[r.method,r.path]);L.useEffect(()=>{Fe()},[Fe]),L.useEffect(()=>{m({}),w({}),x({}),_({}),ne(null),W(null),se(null);const xe=yu(e,r.method,r.path),rt=Ia(e,r.method,r.path),ut=xe!=null&&xe.length?xe:rt;T({}),ut!=null&&ut.length?(M(Object.fromEntries(ut.map(Ot=>[Ot.key,""]))),R("fields"),P(Cm(ut,{}))):(M({}),R("raw"),P("{}"))},[e,r.method,r.path]),L.useEffect(()=>{if(!a)return;if(!(a.method.toLowerCase()===r.method.toLowerCase()&&a.path===r.path)){c==null||c();return}const rt=a.tryForm;if(rt){m({...rt.pathVals}),w({...rt.queryVals}),x({...rt.headerVals}),_({...rt.cookieVals}),R(rt.bodyMode),P(rt.tryBodyRaw);const ut=yu(e,r.method,r.path),Ot=Ia(e,r.method,r.path),xt=ut!=null&&ut.length?ut:Ot;if(T({}),xt!=null&&xt.length&&rt.bodyMode==="fields"){const nn={};for(const ht of xt)nn[ht.key]=rt.bodyVals[ht.key]??"";M(nn)}else M({...rt.bodyVals});ne(null),W(null)}c==null||c()},[a,r.method,r.path,e,c]);const qe=L.useCallback((xe,rt)=>{M(ut=>({...ut,[xe]:rt}))},[]),mt=L.useCallback(()=>{Ee!=null&&Ee.length&&P(Cm(Ee,j)),R("raw")},[Ee,j]),dt=L.useCallback(()=>{Ee!=null&&Ee.length&&M(G2(Ee,U)),R("fields")},[Ee,U]),gt=L.useMemo(()=>({pathVals:d,queryVals:y,headerVals:S,cookieVals:k,bodyVals:j,tryBodyRaw:U,bodyMode:$,multipartFiles:A}),[d,y,S,k,j,U,$,A]),It=async()=>{ne(null);const xe=Tm(e,r,o,i,gt);if(!xe.ok){ne(xe.error);return}const rt=Aa(xe.url),ut={method:xe.method,headers:xe.headers,credentials:rt};xe.body!==void 0&&(ut.body=xe.body);const Ot=PN(d,y,S,k,$,U,j),xt=xe.body instanceof FormData?CN(xe.body):xe.body??null,nn={at:new Date().toISOString(),method:r.method,path:r.path,baseUrl:o,url:xe.url,requestHeaders:{...xe.headers},requestBody:xt,credentials:rt,tryForm:Ot};try{const ht=await fetch(xe.url,ut),Ue=await ht.text();let sn=null;try{sn=Ue?JSON.parse(Ue):null}catch{sn=null}W({status:ht.status,statusText:ht.statusText,bodyText:Ue,json:sn});try{await vh({...nn,status:ht.status,statusText:ht.statusText,responseHeaders:jN(ht.headers),responseBodyText:Ue})}catch{}}catch(ht){W(null);const Ue=ht instanceof Error?ht.message:String(ht);ne(Ue);try{await vh({...nn,networkError:Ue})}catch{}}},mn=async()=>{se(null);const xe=B.trim();if(!xe){se("Escribe un nombre para la plantilla.");return}await Nx({name:xe,method:r.method,path:r.path,pathVals:{...d},queryVals:{...y},headerVals:{...S},cookieVals:{...k},bodyMode:$,tryBodyRaw:U,bodyVals:{...j}}),ie(""),se("Plantilla guardada."),await Fe(),window.setTimeout(()=>se(null),2500)},Zt=xe=>{if(m({...xe.pathVals}),w({...xe.queryVals}),x({...xe.headerVals}),_({...xe.cookieVals}),T({}),R(Ne?"fields":xe.bodyMode),P(xe.tryBodyRaw),Ee!=null&&Ee.length&&(Ne||xe.bodyMode==="fields")){const rt={};for(const ut of Ee)rt[ut.key]=xe.bodyVals[ut.key]??"";M(rt)}else M({...xe.bodyVals});se(null)},en=async xe=>{await _x(xe),await Fe()},At=async()=>{q(null);try{await navigator.clipboard.writeText(Re.href),q("URL copiada."),window.setTimeout(()=>q(null),2e3)}catch{q("No se pudo copiar la URL.")}},Xt=async()=>{Y(null);const xe=Tm(e,r,o,i,gt);if(!xe.ok){Y(xe.error);return}const rt=EN(xe);try{await navigator.clipboard.writeText(rt),Y("cURL copiado al portapapeles."),window.setTimeout(()=>Y(null),2500)}catch{Y("No se pudo copiar (permiso del portapapeles).")}},tn="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 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/35 focus-visible:border-accent/40 bg-surface-950/80",Xn=xe=>{const rt=[xe.defaultLabel?`def.: ${xe.defaultLabel}`:"",xe.exampleHint?`ej.: ${xe.exampleHint}`:""].filter(Boolean);return rt.length?rt.join(" · "):xe.in==="path"?`{${xe.name}}`:""},un=(xe,rt,ut)=>{const Ot=rt[xe.name]??"",xt=[xe.schemaType,xe.format].filter(Boolean).join(" · "),nn=xe.enumOptions&&xe.enumOptions.length>0;return p.jsxs("div",{className:"space-y-1.5",children:[p.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[p.jsx("span",{className:"text-slate-200 text-xs font-medium tracking-tight",children:xe.name}),xe.required?p.jsx("span",{className:"text-[10px] uppercase tracking-wide text-rose-400/85",children:"obligatorio"}):p.jsx("span",{className:"text-[10px] text-slate-600",children:"opcional"}),xt?p.jsx("span",{className:"text-[10px] font-mono text-slate-500",title:"Tipo en el spec",children:xt}):null]}),xe.description?p.jsx("p",{className:"text-[10px] text-slate-500 leading-relaxed line-clamp-4",title:xe.description,children:xe.description}):null,nn?p.jsxs("select",{className:`${tn} cursor-pointer appearance-auto`,value:Ot,onChange:ht=>ut(Ue=>({...Ue,[xe.name]:ht.target.value})),"aria-label":xe.name,children:[xe.required?null:p.jsx("option",{value:"",children:"— elegir —"}),xe.enumOptions.map(ht=>p.jsx("option",{value:ht,children:ht},ht))]}):p.jsx("input",{type:"text",className:tn,value:Ot,onChange:ht=>ut(Ue=>({...Ue,[xe.name]:ht.target.value})),placeholder:Xn(xe),autoComplete:"off",name:`param-${xe.in}-${xe.name}`,id:`param-${xe.in}-${xe.name}`})]},`${xe.in}:${xe.name}`)},Mt=(xe,rt,ut,Ot,xt,nn)=>Ot.length===0?null:p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[p.jsx("span",{className:`inline-flex items-center rounded-md border px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${ut}`,children:xe}),p.jsx("span",{className:"text-[10px] text-slate-500",children:rt})]}),p.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:Ot.map(ht=>un(ht,xt,nn))})]}),on=xe=>{const rt=[xe.defaultLabel?`def.: ${xe.defaultLabel}`:"",xe.exampleHint?`ej.: ${xe.exampleHint}`:""].filter(Boolean);return rt.length?rt.join(" · "):"valor o JSON para objetos anidados"},cn=xe=>{if(xe.isFile){const xt=A[xe.key];return p.jsxs("div",{className:"space-y-1.5",children:[p.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[p.jsx("span",{className:"text-slate-200 text-xs font-medium tracking-tight",children:xe.key}),xe.required?p.jsx("span",{className:"text-[10px] uppercase tracking-wide text-rose-400/85",children:"obligatorio"}):p.jsx("span",{className:"text-[10px] text-slate-600",children:"opcional"}),p.jsx("span",{className:"text-[10px] font-mono text-slate-500",children:"archivo · multipart"})]}),xe.description?p.jsx("p",{className:"text-[10px] text-slate-500 leading-relaxed",children:xe.description}):null,p.jsx("input",{type:"file",className:"glass-input mt-0.5 w-full min-h-[44px] sm:min-h-0 border border-dashed border-accent/20 rounded-xl px-3 py-2 font-mono text-[11px] text-slate-200 file:mr-3 file:rounded-lg file:border-0 file:bg-accent/20 file:px-3 file:py-1.5 file:text-xs file:text-accent file:font-medium transition-colors duration-150 hover:border-accent/35 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/35 bg-surface-950/80",onChange:nn=>{var Ue;const ht=((Ue=nn.target.files)==null?void 0:Ue[0])??null;T(sn=>({...sn,[xe.key]:ht}))},"aria-label":xe.description||xe.key}),xt?p.jsxs("p",{className:"text-[10px] text-slate-400 font-mono truncate",title:xt.name,children:[xt.name," · ",(xt.size/1024).toFixed(1)," KiB"]}):null]},xe.key)}const rt=[xe.type,xe.format].filter(Boolean).join(" · "),ut=xe.enumOptions&&xe.enumOptions.length>0,Ot=xe.type==="boolean";return p.jsxs("div",{className:"space-y-1.5",children:[p.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[p.jsx("span",{className:"text-slate-200 text-xs font-medium tracking-tight",children:xe.key}),xe.required?p.jsx("span",{className:"text-[10px] uppercase tracking-wide text-rose-400/85",children:"obligatorio"}):p.jsx("span",{className:"text-[10px] text-slate-600",children:"opcional"}),rt?p.jsx("span",{className:"text-[10px] font-mono text-slate-500",children:rt}):null]}),xe.description?p.jsx("p",{className:"text-[10px] text-slate-500 leading-relaxed line-clamp-4",title:xe.description,children:xe.description}):null,ut?p.jsxs("select",{className:`${tn} cursor-pointer appearance-auto`,value:j[xe.key]??"",onChange:xt=>qe(xe.key,xt.target.value),"aria-label":xe.key,children:[xe.required?null:p.jsx("option",{value:"",children:"— elegir —"}),xe.enumOptions.map(xt=>p.jsx("option",{value:xt,children:xt},xt))]}):Ot?p.jsxs("select",{className:`${tn} cursor-pointer appearance-auto`,value:j[xe.key]??"",onChange:xt=>qe(xe.key,xt.target.value),"aria-label":xe.key,children:[xe.required?null:p.jsx("option",{value:"",children:"—"}),p.jsx("option",{value:"true",children:"true"}),p.jsx("option",{value:"false",children:"false"})]}):p.jsx("input",{type:"text",className:tn,value:j[xe.key]??"",onChange:xt=>qe(xe.key,xt.target.value),placeholder:on(xe),autoComplete:"off",name:`body-${xe.key}`,id:`body-${xe.key}`})]},xe.key)};return p.jsxs("section",{className:"space-y-4 glass-card p-4",children:[p.jsx("h3",{className:"text-sm font-semibold tracking-tight text-slate-200",children:"Probar"}),p.jsxs("div",{className:"rounded-xl border border-white/[0.07] bg-surface-900/40 backdrop-blur-sm p-3 space-y-2",children:[p.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[p.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:"URL de la petición"}),p.jsx("span",{className:"font-mono text-[10px] font-bold text-accent px-2 py-0.5 rounded-md bg-accent/10 border border-accent/25",children:r.method.toUpperCase()})]}),p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start",children:[p.jsx("p",{className:"flex-1 min-w-0 break-all text-[11px] font-mono text-slate-300/95 leading-relaxed rounded-lg bg-surface-950/90 border border-surface-700/80 px-3 py-2.5",title:Re.href,children:Re.href}),p.jsx("button",{type:"button",onClick:()=>void At(),className:"shrink-0 min-h-[44px] sm:min-h-0 px-3 py-2.5 rounded-xl glass-pill text-slate-200 text-xs font-medium cursor-pointer transition-colors duration-200 hover:border-accent/30",children:"Copiar URL"})]}),Re.unresolved?p.jsxs("p",{className:"text-[10px] text-amber-300/95",role:"status",children:["La ruta aún contiene ",p.jsx("code",{className:"text-amber-200/90",children:"{…}"}),": completa los parámetros de ruta antes de ejecutar."]}):null,H?p.jsx("p",{className:"text-[10px] text-emerald-400/90",role:"status",children:H}):null]}),p.jsxs("div",{className:"space-y-2 rounded-xl border border-white/[0.07] bg-surface-950/35 backdrop-blur-sm p-3",children:[p.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:"Plantillas"}),p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-end",children:[p.jsxs("label",{className:"block text-xs flex-1 min-w-[12rem]",children:[p.jsx("span",{className:"text-slate-400",children:"Nombre nueva plantilla"}),p.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",value:B,onChange:xe=>ie(xe.target.value),placeholder:"p. ej. Staging · usuario demo",autoComplete:"off"})]}),p.jsx("button",{type:"button",onClick:()=>void mn(),className:"min-h-[44px] sm:min-h-0 px-4 py-2.5 rounded-xl glass-pill text-slate-200 text-sm font-medium cursor-pointer transition-colors duration-200 hover:border-accent/30",children:"Guardar plantilla"})]}),G?p.jsx("p",{className:"text-xs text-emerald-400/90",role:"status",children:G}):null,Q.length>0?p.jsx("ul",{className:"space-y-1.5 text-xs",children:Q.map(xe=>p.jsxs("li",{className:"flex flex-wrap items-center gap-2 rounded-lg border border-surface-700/60 bg-surface-900/40 px-2 py-2",children:[p.jsx("span",{className:"text-slate-300 font-medium truncate flex-1 min-w-0",children:xe.name}),p.jsx("button",{type:"button",onClick:()=>Zt(xe),className:"min-h-[44px] sm:min-h-0 shrink-0 px-3 py-2 rounded-lg glass-pill text-accent cursor-pointer transition-colors duration-200",children:"Cargar"}),xe.id!==void 0?p.jsx("button",{type:"button",onClick:()=>void en(xe.id),className:"min-h-[44px] sm:min-h-0 shrink-0 px-3 py-2 rounded-lg border border-rose-500/35 text-rose-300 hover:bg-rose-950/40 cursor-pointer transition-colors duration-200","aria-label":`Eliminar plantilla ${xe.name}`,children:"Eliminar"}):null]},xe.id??xe.name))}):p.jsx("p",{className:"text-[11px] text-slate-500",children:"No hay plantillas para esta operación."})]}),(D.length>0||K.length>0||Se.length>0||je.length>0)&&p.jsxs("div",{className:"space-y-4 rounded-xl border border-white/[0.07] bg-surface-950/35 backdrop-blur-sm p-3",children:[p.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:"Parámetros"}),Mt("Ruta","Sustituyen {placeholders} en el path","border-sky-500/35 bg-sky-500/10 text-sky-200/95",D,d,m),Mt("Query","Se añaden a la cadena de consulta","border-emerald-500/35 bg-emerald-500/10 text-emerald-200/95",K,y,w),Mt("Cabeceras","Parámetros declarados como header","border-amber-500/35 bg-amber-500/10 text-amber-200/95",Se,S,x),Mt("Cookies","Se envían como cabecera Cookie","border-fuchsia-500/35 bg-fuchsia-500/10 text-fuchsia-200/95",je,k,_)]}),tt&&p.jsxs("div",{className:"space-y-2 rounded-xl border border-white/[0.07] bg-surface-950/35 backdrop-blur-sm p-3",children:[p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:"Cuerpo"}),Ne?p.jsx("span",{className:"text-[10px] text-amber-200/90 rounded-md border border-amber-500/30 bg-amber-950/35 px-2 py-1",children:"multipart/form-data — el boundary lo envía el navegador (no añadas Content-Type manual)"}):Ee!=null&&Ee.length?p.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:[p.jsx("button",{type:"button",className:`min-h-[40px] px-3 py-2 transition-colors duration-200 sm:min-h-0 sm:py-1.5 ${$==="fields"?"bg-accent/25 text-accent font-medium":"bg-surface-800 text-slate-400 hover:text-slate-200"}`,onClick:dt,children:"Campos"}),p.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 ${$==="raw"?"bg-accent/25 text-accent font-medium":"bg-surface-800 text-slate-400 hover:text-slate-200"}`,onClick:mt,children:"JSON raw"})]}):p.jsx("span",{className:"text-[10px] text-slate-500",children:"(solo JSON — sin propiedades `object` en el spec)"})]}),$==="fields"&&(Ee!=null&&Ee.length)?p.jsx("div",{className:"grid gap-3 sm:grid-cols-2 pt-1",children:Ee.map(xe=>cn(xe))}):Ne?null:p.jsx("textarea",{className:"glass-input w-full min-h-[10rem] border rounded-xl p-3 font-mono text-xs text-slate-200 leading-relaxed transition-colors duration-150 hover:border-accent/25 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/35 bg-surface-950/80",value:U,onChange:xe=>P(xe.target.value),placeholder:'{"key": "value"}',spellCheck:!1,rows:14})]}),ue&&p.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:ue}),p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.jsx("button",{type:"button",onClick:()=>void It(),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"}),p.jsx("button",{type:"button",onClick:()=>void Xt(),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 cursor-pointer transition-colors duration-200",children:"Copiar cURL"})]}),ke?p.jsx("p",{className:"text-xs text-emerald-400/90",role:"status",children:ke}):null,p.jsxs("div",{className:"space-y-2",children:[p.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:"Respuesta"}),F?p.jsxs(p.Fragment,{children:[p.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:[p.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?p.jsx(bN,{data:F.json,defaultOpenDepth:3}):p.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||"—"})]}):p.jsx("p",{className:"text-xs text-slate-500",children:"—"})]})]})}function MN(e){const r=e.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 TN(e){return p.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:e.className,"aria-hidden":!0,children:[p.jsx("circle",{cx:"11",cy:"11",r:"8"}),p.jsx("path",{d:"m21 21-4.3-4.3"})]})}function IN(e){return p.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:e.className,"aria-hidden":!0,children:[p.jsx("circle",{cx:"18",cy:"5",r:"3"}),p.jsx("circle",{cx:"6",cy:"12",r:"3"}),p.jsx("circle",{cx:"18",cy:"19",r:"3"}),p.jsx("path",{d:"m8.59 13.51 6.83 3.98"}),p.jsx("path",{d:"m15.41 6.51-6.82 3.98"})]})}function AN(e){return p.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:e.className,"aria-hidden":!0,children:[p.jsx("path",{d:"M12 3 2 8l10 5 10-5-10-5Z"}),p.jsx("path",{d:"M2 13 12 18l10-5"}),p.jsx("path",{d:"M2 18 12 23l10-5"})]})}function ON(e){return p.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:e.className,"aria-hidden":!0,children:[p.jsx("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),p.jsx("path",{d:"M3 3v5h5"}),p.jsx("path",{d:"M12 7v5l4 2"})]})}function LN(e){return p.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:e.className,"aria-hidden":!0,children:[p.jsx("path",{d:"M9 11l3 3L22 4"}),p.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(e){return p.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:e.className,"aria-hidden":!0,children:[p.jsx("path",{d:"M12 8V4H8"}),p.jsx("rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"}),p.jsx("path",{d:"M2 14h2"}),p.jsx("path",{d:"M20 14h2"}),p.jsx("path",{d:"M15 13v2"}),p.jsx("path",{d:"M9 13v2"})]})}function RN(e){return p.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:e.className,"aria-hidden":!0,children:[p.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),p.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}function DN(e){return p.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:e.className,"aria-hidden":!0,children:[p.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),p.jsx("polyline",{points:"7 10 12 15 17 10"}),p.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function zN(e){return p.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:e.className,"aria-hidden":!0,children:[p.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),p.jsx("polyline",{points:"17 8 12 3 7 8"}),p.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]})}function FN(e){return p.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:e.className,"aria-hidden":!0,children:[p.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),p.jsx("polyline",{points:"16 17 21 12 16 7"}),p.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]})}function Im(e){return p.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:e.className,"aria-hidden":!0,children:[p.jsx("path",{d:"M15 3h6v6"}),p.jsx("path",{d:"M9 21H3v-6"}),p.jsx("path",{d:"M21 3l-7 7"}),p.jsx("path",{d:"M3 21l7-7"})]})}const BN=["get","post","put","patch","delete","options","head","trace"];function qg(e,r){const o=e.trim().replace(/\s+/g," ");return o.length<=r?o:`${o.slice(0,r-1)}…`}function HN(e,r,o,i,a){const c=[`${e.toUpperCase()} ${r}`];return o&&c.push(`— ${qg(o,140)}`),i!=null&&i.length&&c.push(`[tags: ${i.join(", ")}]`),a&&c.push(`(operationId: ${a})`),c.join(" ")}function VN(e,r){const o=[];let i=0;const a=e.paths;if(!a)return{lines:o,total:0};for(const[c,d]of Object.entries(a)){if(!d||typeof d!="object"||"$ref"in d)continue;const m=d;for(const y of BN){const w=m[y];if(!(!w||typeof w!="object")&&(i+=1,o.length<r)){const S=w.summary||(w.description?qg(w.description,200):void 0);o.push(HN(y,c,S,w.tags,w.operationId))}}}return{lines:o,total:i}}function UN(e){var o,i,a,c,d,m,y;const r=[`Flujo «${e.name}»`];if((o=e.steps)!=null&&o.length){const w=e.steps.map(x=>`${x.method.toUpperCase()} ${x.path}`).join(" → ");r.push(`secuencia (pasos): ${w}`);const S=e.steps.filter(x=>x.extract).map(x=>`${x.extract.varName} ← ${x.extract.jsonPath}`);S.length&&r.push(`extracciones: ${S.join("; ")}`)}if((a=(i=e.graph)==null?void 0:i.nodes)!=null&&a.length){const w=e.graph.nodes.map(S=>`${S.method.toUpperCase()} ${S.path}`).join(" → ");r.push(`grafo (nodos en orden guardado): ${w}`),(c=e.graph.edges)!=null&&c.length&&r.push(`cables: ${e.graph.edges.length} (mapeo respuesta → siguiente request; detalle en la UI Flujos)`)}return!((d=e.steps)!=null&&d.length)&&!((y=(m=e.graph)==null?void 0:m.nodes)!=null&&y.length)&&r.push("(sin pasos ni nodos)"),r.join(". ")}function KN(e){var o;if(!((o=e.cases)!=null&&o.length))return`Suite «${e.name}»: sin casos`;const r=e.cases.map(i=>`${i.method.toUpperCase()} ${i.path} → esperado HTTP ${i.expectStatus}`).join("; ");return`Suite «${e.name}» (${e.cases.length} caso(s)): ${r}`}function qN(e,r){var A,T,U,P;const o=e.info.title??"API",i=e.info.version??"",a=`Documentación OpenAPI «${o}»${i?` v${i}`:""}.`,c=((A=e.servers)==null?void 0:A.map($=>`${$.url}${$.description?` (${$.description})`:""}`).join(`
207
+ `))||"(sin servers en el spec; usa la Base URL de la barra superior en la UI)",d=(T=e.components)!=null&&T.securitySchemes?Object.entries(e.components.securitySchemes).map(([$,R])=>{if(!R||typeof R!="object"||"$ref"in R)return`${$}: ref`;const F=R.type??"?";return`${$} (${F})`}).join("; "):"",{lines:m,total:y}=VN(e,400),w=y>m.length?`
208
+ … y ${y-m.length} operación(es) más en el spec.`:"";let S="";const x=((U=r==null?void 0:r.savedFlows)==null?void 0:U.filter($=>$.name))??[];x.length&&(S=`
209
+
210
+ --- Flujos guardados por el usuario en esta app (${x.length}) ---
211
+ ${x.map(UN).join(`
212
+ `)}`);let k="";const _=((P=r==null?void 0:r.testSuites)==null?void 0:P.filter($=>$.name))??[];_.length&&(k=`
213
+
214
+ --- Suites de tests guardadas (${_.length}) ---
215
+ ${_.map(KN).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».)`),`${a}
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: ${y}.
230
+ ${m.join(`
231
+ `)}${w}
232
+ ${S}
233
+ ${k}${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 WN(e,r,o,i,a){const c=`${e.replace(/\/?$/,"/")}__chat`,d=await fetch(c,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",[Gy]:r},body:JSON.stringify({provider:o,model:i,messages:a})}),m=await d.text();if(!d.ok){let y=m;try{const w=JSON.parse(m);y=w.message??w.error??m}catch{}throw new Error(y||`HTTP ${d.status}`)}return JSON.parse(m)}function YN({doc:e,contextExtras:r,provider:o,model:i,apiKey:a,onOpenLlmSettings:c}){const d="/docs/",[m,y]=L.useState(!1),[w,S]=L.useState([]),[x,k]=L.useState(""),[_,j]=L.useState(!1),[M,A]=L.useState(null),T=L.useRef(null),U=L.useMemo(()=>qN(e,r),[e,r]);L.useEffect(()=>{var R;(R=T.current)==null||R.scrollIntoView({behavior:"smooth"})},[w]);const P=L.useCallback(async()=>{const R=x.trim();if(!R||_)return;if(!a.trim()){A("Configura tu API key: botón «Asistente: API de IA…» al pie del menú, o el icono del asistente."),c==null||c();return}A(null);const F=i.trim()||cu(o),W={role:"user",content:R},ue=[{role:"system",content:U},...w.filter(ne=>ne.role!=="system"),W];k(""),S(ne=>[...ne,W]),j(!0);try{const ne=await WN(d,a.trim(),o,F,ue);S(ke=>[...ke,{role:"assistant",content:ne.content??""}])}catch(ne){A(ne instanceof Error?ne.message:String(ne))}finally{j(!1)}},[a,d,x,_,w,i,c,o,U]),$=L.useCallback(()=>{S([]),A(null)},[]);return p.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:[m?p.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:[p.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:[p.jsx("span",{className:"text-sm font-medium text-slate-200",children:"Asistente"}),p.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[p.jsx("button",{type:"button",onClick:$,className:"text-[11px] text-slate-500 hover:text-slate-300 px-2 py-1 rounded-lg glass-pill",children:"Vaciar"}),p.jsx("button",{type:"button",onClick:()=>y(!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?p.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:[p.jsx("span",{className:"flex-1 min-w-0",children:M}),c?p.jsx("button",{type:"button",className:"shrink-0 underline text-accent",onClick:c,children:"Abrir configuración"}):null]}):null,p.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-3 min-h-0",children:[w.length===0?p.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ú."}):w.map((R,F)=>p.jsxs("div",{className:`text-xs leading-relaxed rounded-xl px-2.5 py-2 backdrop-blur-sm ${R.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:[p.jsx("span",{className:"text-[10px] uppercase tracking-wider text-slate-500 block mb-0.5",children:R.role==="user"?"Tú":"Asistente"}),p.jsx("div",{className:"whitespace-pre-wrap break-words",children:R.content})]},`${F}-${R.role}`)),p.jsx("div",{ref:T})]}),p.jsxs("div",{className:"p-2.5 border-t border-white/[0.08] flex gap-2 bg-surface-950/25",children:[p.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:R=>k(R.target.value),onKeyDown:R=>{R.key==="Enter"&&!R.shiftKey&&(R.preventDefault(),P())},placeholder:"Pregunta sobre el spec…",disabled:_}),p.jsx("button",{type:"button",onClick:()=>void P(),disabled:_||!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:_?"…":"Enviar"})]})]}):null,p.jsx("button",{type:"button",onClick:()=>y(R=>!R),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 ${m?"glass-fab-muted scale-95":"glass-fab hover:scale-[1.03] hover:brightness-110"}`,"aria-expanded":m,"aria-label":m?"Ocultar asistente":"Abrir asistente",title:"Asistente",children:p.jsx(Kg,{className:m?"opacity-80":void 0})})]})}const Wg="adt-llm-provider",Yg="adt-llm-model",Xg="adt-llm-key";function XN(){try{const e=localStorage.getItem(Wg),r=e==="anthropic"||e==="openai"||e==="openrouter"?e:"openrouter",o=localStorage.getItem(Yg)??"",i=localStorage.getItem(Xg)??"";return{provider:r,model:o,apiKey:i}}catch{return{provider:"openrouter",model:"",apiKey:""}}}function QN(e,r,o){try{localStorage.setItem(Wg,e),localStorage.setItem(Yg,r),localStorage.setItem(Xg,o)}catch{}}function JN({open:e,onClose:r,ops:o,onPick:i}){const[a,c]=L.useState(""),d=L.useRef(null),[m,y]=L.useState(0),w=L.useMemo(()=>{const x=a.trim().toLowerCase();return x?o.filter(k=>{const _=(k.operationId??"").toLowerCase(),j=k.path.toLowerCase(),M=k.method.toLowerCase(),A=(k.tags??[]).join(" ").toLowerCase();return j.includes(x)||M.includes(x)||_.includes(x)||A.includes(x)}).slice(0,80):o.slice(0,80)},[o,a]);L.useEffect(()=>{e&&(c(""),y(0),window.setTimeout(()=>{var x;return(x=d.current)==null?void 0:x.focus()},10))},[e]),L.useEffect(()=>{y(0)},[a]);const S=L.useCallback(x=>{i({method:x.method,path:x.path}),r()},[r,i]);return L.useEffect(()=>{if(!e)return;const x=k=>{if(k.key==="Escape"){k.preventDefault(),r();return}k.key==="ArrowDown"&&(k.preventDefault(),y(_=>Math.min(_+1,Math.max(0,w.length-1)))),k.key==="ArrowUp"&&(k.preventDefault(),y(_=>Math.max(0,_-1))),k.key==="Enter"&&w[m]&&(k.preventDefault(),S(w[m]))};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[e,w,m,r,S]),e?p.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:p.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:[p.jsxs("div",{className:"border-b border-white/[0.08] px-3 py-2",children:[p.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:a,onChange:x=>c(x.target.value),autoComplete:"off"}),p.jsxs("p",{className:"text-[10px] text-slate-500 mt-1 px-1",children:["↑↓ navegar · Enter abrir · Esc cerrar ·"," ",p.jsx("kbd",{className:"px-1 rounded bg-surface-800 text-slate-400",children:"⌘K"})," /"," ",p.jsx("kbd",{className:"px-1 rounded bg-surface-800 text-slate-400",children:"Ctrl+K"})]})]}),p.jsx("ul",{className:"max-h-[min(50vh,22rem)] overflow-y-auto py-1",role:"listbox",children:w.length===0?p.jsx("li",{className:"px-4 py-6 text-sm text-slate-500 text-center",children:"Sin coincidencias"}):w.map((x,k)=>p.jsx("li",{children:p.jsxs("button",{type:"button",role:"option","aria-selected":k===m,className:`w-full text-left px-3 py-2.5 flex items-start gap-2 transition-colors ${k===m?"bg-accent/15 text-slate-100":"hover:bg-white/[0.04] text-slate-300"}`,onMouseEnter:()=>y(k),onClick:()=>S(x),children:[p.jsx(Oi,{method:x.method,size:"sm"}),p.jsxs("span",{className:"flex-1 min-w-0",children:[p.jsx("span",{className:"font-mono text-xs break-all",children:x.path}),x.operationId?p.jsx("span",{className:"block text-[10px] text-slate-500 mt-0.5",children:x.operationId}):null,x.deprecated?p.jsx("span",{className:"ml-2 text-[10px] uppercase text-amber-400/90",children:"deprecated"}):null]})]})},`${x.method}:${x.path}`))})]})}):null}function GN(e){return typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string"}function ZN({doc:e}){const r=L.useMemo(()=>{var m;const d=(m=e.components)==null?void 0:m.schemas;return!d||typeof d!="object"?[]:Object.keys(d).sort((y,w)=>y.localeCompare(w))},[e]),[o,i]=L.useState(null);L.useEffect(()=>{if(r.length===0){i(null);return}(!o||!r.includes(o))&&i(r[0])},[r,o]);const a=L.useMemo(()=>{var m,y;if(!o)return"";const d=(y=(m=e.components)==null?void 0:m.schemas)==null?void 0:y[o];if(d===void 0)return"// (no definido)";try{return JSON.stringify(d,null,2)}catch{return String(d)}},[e,o]),c=async()=>{try{await navigator.clipboard.writeText(a)}catch{}};return r.length===0?p.jsx("div",{className:"p-4 max-w-3xl",children:p.jsxs("p",{className:"text-sm text-slate-500",children:["Este spec no define ",p.jsx("code",{className:"text-accent",children:"components.schemas"}),"."]})}):p.jsxs("div",{className:"p-4 flex flex-col lg:flex-row gap-4 min-h-0 max-w-6xl",children:[p.jsxs("div",{className:"lg:w-56 shrink-0 space-y-2",children:[p.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500",children:"Esquemas"}),p.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 w,S;const m=(S=(w=e.components)==null?void 0:w.schemas)==null?void 0:S[d],y=GN(m);return p.jsx("li",{children:p.jsxs("button",{type:"button",onClick:()=>i(d),className:`w-full text-left px-2 py-2 rounded-lg text-xs font-mono transition-colors ${o===d?"glass-pill-active text-slate-100":"text-slate-400 hover:bg-white/[0.04] hover:text-slate-200"}`,children:[d,y?p.jsx("span",{className:"block text-[10px] text-slate-500 truncate",title:m.$ref,children:"→ ref"}):null]})},d)})})]}),p.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-2 min-h-0",children:[p.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[p.jsx("h3",{className:"text-sm font-medium text-slate-200",children:o?p.jsx(p.Fragment,{children:p.jsx("code",{className:"text-accent",children:o})}):p.jsx("span",{className:"text-slate-500",children:"Selecciona un esquema"})}),o?p.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]}),o?p.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:a}):p.jsx("p",{className:"text-xs text-slate-500",children:"Los modelos reutilizables del spec aparecen aquí."})]})]})}const lu="op",e_="playground";function Am(e){if(!e)return!1;const r=e.startsWith("?")?e.slice(1):e;return new URLSearchParams(r).get(e_)==="1"}function t_(e,r){const o=`${e.toLowerCase()} ${r}`;return encodeURIComponent(o)}function n_(e){if(!(e!=null&&e.trim()))return null;try{const r=decodeURIComponent(e),o=r.indexOf(" ");if(o===-1)return null;const i=r.slice(0,o).trim().toLowerCase(),a=r.slice(o+1);return!i||a.length===0?null:{method:i,path:a}}catch{return null}}function Om(e){try{const r=JSON.parse(e);return JSON.stringify(r,null,2)}catch{return null}}async function uu(e){await navigator.clipboard.writeText(e)}function r_({listKey:e,onReplay:r}){const[o,i]=L.useState([]),[a,c]=L.useState(null),[d,m]=L.useState(""),[y,w]=L.useState(""),[S,x]=L.useState(null),[k,_]=L.useState(!1),j=L.useCallback(async()=>{const $=await jx();i($)},[]);L.useEffect(()=>{j()},[j,e]);const M=L.useMemo(()=>{const $=d.trim().toLowerCase(),R=y.trim().toLowerCase();return o.filter(F=>!($&&F.method.toLowerCase()!==$||R&&!F.path.toLowerCase().includes(R)&&!F.url.toLowerCase().includes(R)))},[o,d,y]),A=$=>{$!==void 0&&c(R=>R===$?null:$)},T=async()=>{if(window.confirm("¿Vaciar todo el historial de llamadas? No se puede deshacer.")){_(!0);try{await Ex(),i([]),c(null)}finally{_(!1)}}},U=async $=>{$!==void 0&&(await Cx($),c(R=>R===$?null:R),await j())},P=()=>{x("Copiado."),window.setTimeout(()=>x(null),2e3)};return p.jsxs("div",{className:"flex-1 flex flex-col min-h-0 p-4 md:p-6 max-w-5xl w-full mx-auto space-y-4",children:[p.jsxs("div",{children:[p.jsx("h2",{className:"text-lg font-semibold text-slate-100 tracking-tight",children:"Historial de «Probar»"}),p.jsxs("p",{className:"text-xs text-slate-500 mt-1 leading-relaxed max-w-2xl",children:["Cada ejecución guarda URL, cabeceras, cuerpos y respuesta en este navegador. Puede incluir tokens u datos sensibles. Se conservan como máximo ",Id," entradas (las más antiguas se eliminan)."]})]}),p.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[p.jsxs("label",{className:"text-xs text-slate-400 flex items-center gap-2",children:["Método",p.jsx("input",{type:"text",className:"glass-input border rounded-xl px-3 py-2 min-h-[44px] sm:min-h-0 w-24 font-mono text-xs text-slate-200",value:d,onChange:$=>m($.target.value),placeholder:"get",autoComplete:"off",spellCheck:!1})]}),p.jsxs("label",{className:"text-xs text-slate-400 flex items-center gap-2 flex-1 min-w-[12rem]",children:["Ruta o URL",p.jsx("input",{type:"search",className:"glass-input border rounded-xl px-3 py-2 min-h-[44px] sm:min-h-0 flex-1 font-mono text-xs text-slate-200",value:y,onChange:$=>w($.target.value),placeholder:"/users …",autoComplete:"off",spellCheck:!1})]}),p.jsx("button",{type:"button",onClick:()=>void j(),className:"min-h-[44px] sm:min-h-0 px-4 py-2.5 rounded-xl glass-pill text-slate-200 text-sm cursor-pointer transition-colors duration-200",children:"Actualizar"}),p.jsx("button",{type:"button",disabled:k||o.length===0,onClick:()=>void T(),className:"min-h-[44px] sm:min-h-0 px-4 py-2.5 rounded-xl border border-rose-500/40 text-rose-200 text-sm cursor-pointer transition-colors duration-200 hover:bg-rose-950/35 disabled:opacity-40 disabled:cursor-not-allowed",children:k?"…":"Vaciar historial"})]}),S?p.jsx("p",{className:"text-xs text-emerald-400/90",role:"status",children:S}):null,M.length===0?p.jsx("p",{className:"text-sm text-slate-500 py-8 text-center border border-dashed border-surface-600 rounded-2xl",children:o.length===0?"Aún no hay llamadas. Usa Explorar → Probar → Ejecutar.":"Nada coincide con el filtro."}):p.jsx("ul",{className:"space-y-2 overflow-auto flex-1 min-h-0 pb-8",children:M.map($=>{const R=$.id,F=R!==void 0&&a===R;return p.jsxs("li",{className:"rounded-2xl border border-surface-600/50 bg-surface-900/40 overflow-hidden",children:[p.jsxs("div",{className:"flex flex-wrap items-center gap-2 p-3",children:[p.jsxs("button",{type:"button",onClick:()=>A(R),className:"flex flex-wrap items-center gap-2 flex-1 min-w-0 text-left cursor-pointer rounded-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-accent/60","aria-expanded":F,children:[p.jsx(Oi,{method:$.method}),p.jsx("span",{className:"text-xs font-mono text-slate-300 truncate",children:$.path}),p.jsx("span",{className:"text-[10px] text-slate-500 shrink-0",children:new Date($.at).toLocaleString()}),$.networkError!==void 0?p.jsx("span",{className:"text-[10px] uppercase text-rose-400 shrink-0",children:"error"}):$.status!==void 0?p.jsx("span",{className:`text-xs font-mono shrink-0 ${$.status<400?"text-emerald-400":"text-rose-400"}`,children:$.status}):null]}),p.jsxs("div",{className:"flex flex-wrap gap-2 shrink-0",children:[p.jsx("button",{type:"button",onClick:()=>r($),className:"min-h-[44px] sm:min-h-0 px-3 py-2 rounded-xl glass-pill text-accent text-xs font-medium cursor-pointer transition-colors duration-200",children:"Cargar en Probar"}),R!==void 0?p.jsx("button",{type:"button",onClick:()=>void U(R),className:"min-h-[44px] sm:min-h-0 px-3 py-2 rounded-xl border border-surface-600 text-slate-400 text-xs cursor-pointer hover:text-rose-300 transition-colors duration-200","aria-label":"Eliminar entrada del historial",children:"Borrar"}):null]})]}),F?p.jsxs("div",{className:"border-t border-surface-700/60 p-3 space-y-3 text-xs bg-surface-950/50",children:[p.jsxs("div",{children:[p.jsx("p",{className:"text-[10px] uppercase text-slate-500 mb-1",children:"Base URL (campo superior)"}),p.jsx("p",{className:"font-mono text-slate-300 break-all",children:$.baseUrl||"—"})]}),p.jsxs("div",{children:[p.jsx("p",{className:"text-[10px] uppercase text-slate-500 mb-1",children:"URL final"}),p.jsx("p",{className:"font-mono text-slate-300 break-all",children:$.url}),p.jsx("button",{type:"button",onClick:()=>void uu($.url).then(P),className:"mt-1 text-accent hover:underline cursor-pointer",children:"Copiar URL"})]}),p.jsxs("div",{children:[p.jsx("p",{className:"text-[10px] uppercase text-slate-500 mb-1",children:"Request headers"}),p.jsx("pre",{className:"glass-input border rounded-lg p-2 max-h-40 overflow-auto font-mono text-[11px] text-slate-300 whitespace-pre-wrap",children:JSON.stringify($.requestHeaders,null,2)}),p.jsx("button",{type:"button",onClick:()=>void uu(JSON.stringify($.requestHeaders,null,2)).then(P),className:"mt-1 text-accent hover:underline cursor-pointer",children:"Copiar JSON"})]}),p.jsxs("div",{children:[p.jsx("p",{className:"text-[10px] uppercase text-slate-500 mb-1",children:"Request body"}),$.requestBody?p.jsxs(p.Fragment,{children:[p.jsx("pre",{className:"glass-input border rounded-lg p-2 max-h-48 overflow-auto font-mono text-[11px] text-slate-300 whitespace-pre-wrap",children:Om($.requestBody)??$.requestBody}),p.jsx("button",{type:"button",onClick:()=>void uu($.requestBody??"").then(P),className:"mt-1 text-accent hover:underline cursor-pointer",children:"Copiar body"})]}):p.jsx("p",{className:"text-slate-500",children:"—"})]}),$.networkError!==void 0?p.jsxs("p",{className:"text-rose-300",role:"alert",children:["Error de red: ",$.networkError]}):null,$.responseHeaders!==void 0?p.jsxs("div",{children:[p.jsx("p",{className:"text-[10px] uppercase text-slate-500 mb-1",children:"Response headers"}),p.jsx("pre",{className:"glass-input border rounded-lg p-2 max-h-40 overflow-auto font-mono text-[11px] text-slate-300 whitespace-pre-wrap",children:JSON.stringify($.responseHeaders,null,2)})]}):null,$.responseBodyText!==void 0?p.jsxs("div",{children:[p.jsx("p",{className:"text-[10px] uppercase text-slate-500 mb-1",children:"Response body"}),p.jsx("pre",{className:"glass-input border rounded-lg p-2 max-h-64 overflow-auto font-mono text-[11px] text-slate-300 whitespace-pre-wrap",children:Om($.responseBodyText)??$.responseBodyText}),p.jsx("button",{type:"button",onClick:()=>void uu($.responseBodyText??"").then(P),className:"mt-1 text-accent hover:underline cursor-pointer",children:"Copiar respuesta"})]}):null]}):null]},R??`${$.at}-${$.url}`)})})]})}const Qg=[{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 Lm(e){return Qg.some(r=>r.value===e)}const Pd=[{id:"typescript",label:"TypeScript"},{id:"javascript",label:"JavaScript"},{id:"python",label:"Python"},{id:"php",label:"PHP"}];function $d(e,r){return`${e.toLowerCase()} ${r}`}function o_(e){const r=e.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:e.slice(0,r),path:e.slice(r+1)}}function s_(){if(typeof window>"u")return null;let e=new URLSearchParams(window.location.search).get("spec");if(!(e!=null&&e.trim()))return null;e=e.trim();try{e=decodeURIComponent(e)}catch{}try{const r=new URL(e);return r.protocol!=="http:"&&r.protocol!=="https:"?null:r.href}catch{return null}}async function Rm(e){await navigator.clipboard.writeText(e)}function i_(){var bs;const e=wN(),[r,o]=L.useState(null),[i,a]=L.useState(null),[c,d]=L.useState("server"),[m,y]=L.useState(null),[w,S]=L.useState(null),[x,k]=L.useState("explore"),[_,j]=L.useState(""),[M,A]=L.useState(null),[T,U]=L.useState(null),[P,$]=L.useState("typescript"),[R,F]=L.useState(""),[W,ue]=L.useState(""),[ne,ke]=L.useState("X-Api-Key"),[Y,Q]=L.useState({nodes:[],edges:[]}),[ve,B]=L.useState(0),[ie,G]=L.useState("Mi flujo"),[se,H]=L.useState([]),[q,J]=L.useState(""),[D,K]=L.useState({name:"Suite 1",cases:[]}),[Se,je]=L.useState([]),[Le,Ie]=L.useState(""),[Ee,Ne]=L.useState(""),[Re,_e]=L.useState(null),[tt,Fe]=L.useState(null),[qe,mt]=L.useState(null),[dt,gt]=L.useState("openrouter"),[It,mn]=L.useState(""),[Zt,en]=L.useState(""),[At,Xt]=L.useState(!1),[tn,Xn]=L.useState(!1),[un,Mt]=L.useState(!1),[on,cn]=L.useState(null),[xe,rt]=L.useState(0),[ut,Ot]=L.useState([]),[xt,nn]=L.useState("get"),[ht,Ue]=L.useState(""),[sn,An]=L.useState(""),[Vn,Ve]=L.useState(""),[Un,En]=L.useState(null),Cr=(O,ge)=>{try{const ze=sessionStorage.getItem(O);if(ze==="1")return!0;if(ze==="0")return!1}catch{}return ge},[ar,Pr]=L.useState(()=>Cr("adt-collapse-main",!1)),[mr,go]=L.useState(()=>Cr("adt-collapse-explore",!1)),On="/docs/openapi.json",Qn="/docs/preset.json",Kn=L.useMemo(()=>s_(),[]),dn=L.useCallback(async()=>{const[O,ge]=await Promise.all([Ge.flows.toArray(),Ge.testSuites.toArray()]);H(O.sort((ze,We)=>(ze.name??"").localeCompare(We.name??""))),je(ge.sort((ze,We)=>(ze.name??"").localeCompare(We.name??"")))},[]),vt=L.useCallback(async()=>{const O=await Px();Ot(O.sort((ge,ze)=>ge.path.localeCompare(ze.path)||ge.method.localeCompare(ze.method)))},[]);L.useEffect(()=>{vt()},[vt]),L.useEffect(()=>{var ge,ze;if(!r)return;const O=((ge=e.productName)==null?void 0:ge.trim())||((ze=r.info.title)==null?void 0:ze.trim())||"API";document.title=O},[r,e.productName]);const Rt=L.useCallback(async()=>{if(y(null),Kn)try{const ge=await fetch(Kn,{credentials:"omit",mode:"cors"});if(!ge.ok)throw new Error(`${ge.status} ${ge.statusText}`);const ze=await ge.json();pd(ze);const We=ze;o(We),j(qr(We)),a(null),d("remote");return}catch(ge){a(ge instanceof Error?ge.message:String(ge));return}const O=await Ge.kv.get(Ri);if(O!=null&&O.value)try{const ge=JSON.parse(O.value);pd(ge);const ze=ge;o(ze),j(qr(ze)),a(null),d("local");return}catch{await xh()}try{const ge=await fetch(On,{credentials:"include"});if(ge.status===401){let We="/docs/__auth/login";try{const Pt=await ge.json();Pt.loginPath&&(We=Pt.loginPath)}catch{}window.location.href=We;return}if(!ge.ok)throw new Error(`${ge.status} ${ge.statusText}`);const ze=await ge.json();o(ze),j(qr(ze)),a(null),d("server")}catch(ge){a(ge instanceof Error?ge.message:String(ge))}},[On,Kn]);L.useEffect(()=>{Rt()},[Rt]),L.useEffect(()=>{try{sessionStorage.setItem("adt-collapse-main",ar?"1":"0")}catch{}},[ar]),L.useEffect(()=>{try{sessionStorage.setItem("adt-collapse-explore",mr?"1":"0")}catch{}},[mr]),L.useEffect(()=>{(async()=>{try{const O=await fetch("/docs/__auth/session",{credentials:"include"});if(O.ok){const ge=await O.json();mt({username:ge.username})}else mt(null)}catch{mt(null)}})()},[]),L.useEffect(()=>{if(!r)return;let O=!1;return(async()=>{try{const ge=await fetch(Qn,{credentials:"include"});if(!ge.ok||O)return;const ze=await ge.json(),We=await Ix(ze);!O&&We&&await dn()}catch{}})(),()=>{O=!0}},[r,Qn,dn]),L.useEffect(()=>{dn(),Ge.kv.get("bearer").then(O=>O&&F(O.value)),Ge.kv.get("apiKey").then(O=>O&&ue(O.value))},[dn]),L.useEffect(()=>{const O=XN();gt(O.provider),mn(O.model||cu(O.provider)),en(O.apiKey)},[]),L.useEffect(()=>{Mt(!1)},[r]);const et=L.useMemo(()=>r?Lx(r,ut):null,[r,ut]),lr=L.useMemo(()=>et?gx(et):[],[et]),_t=L.useMemo(()=>et?ho(et):[],[et]),gr=L.useMemo(()=>et?_t.map(O=>({method:O.method,path:O.path,operationId:O.operationId,tags:O.tags,deprecated:Cd(et,O.method,O.path)})):[],[et,_t]);L.useEffect(()=>{if(!et||_t.length===0||un)return;const O=new URLSearchParams(window.location.search);if(Am(window.location.search)){Mt(!0);return}const ge=n_(O.get(lu));ge&&_t.some(We=>We.method.toLowerCase()===ge.method&&We.path===ge.path)&&(cn(null),U({method:ge.method,path:ge.path}),k("explore")),Mt(!0)},[et,_t,un]),L.useEffect(()=>{if(!un||!et)return;const O=new URL(window.location.href);if(Am(O.search)){O.searchParams.delete(lu),window.history.replaceState({},"",O.toString());return}x==="explore"&&T?O.searchParams.set(lu,t_(T.method,T.path)):O.searchParams.delete(lu),window.history.replaceState({},"",O.toString())},[un,et,x,T]),L.useEffect(()=>{if(!T||_t.length===0)return;if(!_t.some(ge=>ge.method.toLowerCase()===T.method.toLowerCase()&&ge.path===T.path)){const ge=_t[0];U(ge?{method:ge.method,path:ge.path}:null)}},[_t,T]),L.useEffect(()=>{const O=ge=>{(ge.metaKey||ge.ctrlKey)&&ge.key.toLowerCase()==="k"&&(ge.preventDefault(),Xn(ze=>!ze))};return window.addEventListener("keydown",O),()=>window.removeEventListener("keydown",O)},[]);const ws=L.useMemo(()=>({savedFlows:se,testSuites:Se,selectedOperation:T}),[se,Se,T]),Cn=L.useMemo(()=>M?_t.filter(O=>(O.tags??["default"]).includes(M)):_t,[_t,M]);L.useEffect(()=>{if(_t.length&&!Ee){const O=_t[0];Ne($d(O.method,O.path))}},[_t,Ee]),L.useEffect(()=>{if(_t.length===0||Y.nodes.length>0||x!=="flows"||Re!=null)return;const O=_t[0];Q({nodes:[{id:crypto.randomUUID(),method:O.method.toLowerCase(),path:O.path,x:80,y:120}],edges:[]}),B(ge=>ge+1)},[_t,Y.nodes.length,x,Re]);const Pn=L.useCallback(()=>{const O={"Content-Type":"application/json"};return R.trim()&&(O.Authorization=`Bearer ${R.trim()}`),W.trim()&&(O[ne]=W.trim()),O},[R,W,ne]),an=L.useCallback(()=>{cn(null)},[]),yr=L.useCallback(O=>{U({method:O.method,path:O.path}),cn(O),k("explore")},[]);L.useEffect(()=>{x==="history"&&rt(O=>O+1)},[x]);const Gr=L.useCallback(O=>{cn(null),U(O)},[]),Ln=L.useMemo(()=>{if(!et||!T)return null;const O={};for(const{id:ge}of Pd)O[ge]=px(et,ge,T.method,T.path);return O},[et,T]),Zr=L.useMemo(()=>et?mx(et,P,M):"",[et,P,M]),zt=L.useMemo(()=>{var Bt,Nt;if(!et||!T)return null;const O=(Bt=et.paths)==null?void 0:Bt[T.path];if(!O||typeof O!="object"||"$ref"in O)return null;const ge=O[T.method.toLowerCase()];if(!ge)return null;const ze=typeof ge.summary=="string"?ge.summary:void 0,We=typeof ge.description=="string"?ge.description:void 0;let Pt=null;try{const Dt=ge.requestBody,Lt=(Nt=Dt==null?void 0:Dt.content)==null?void 0:Nt["application/json"];if((Lt==null?void 0:Lt.example)!==void 0)Pt=JSON.stringify(Lt.example,null,2);else if(Lt!=null&&Lt.examples&&typeof Lt.examples=="object"){const Rn=Object.values(Lt.examples)[0];Rn&&Rn.value!==void 0&&(Pt=JSON.stringify(Rn.value,null,2))}}catch{}return{summary:ze,description:We,exampleStr:Pt}},[et,T]),yo=L.useCallback(O=>{cn(null),U(O),k("explore")},[]),eo=async O=>{var Pt;if(!et)return"";const ge={};let ze="";const We=qr(et,_);for(let Bt=0;Bt<O.length;Bt++){const Nt=O[Bt];let Dt=Nt.path;for(const[bn,ro]of Object.entries(ge))Dt=Dt.replace(`{${bn}}`,ro);const Lt=`${We}${Dt}`,Rn={method:Nt.method.toUpperCase(),headers:Pn()},ko=Nt.method.toLowerCase();ko!=="get"&&ko!=="head"&&(Rn.body="{}");const $n=await fetch(Lt,{...Rn,credentials:Aa(Lt)}),Qs=await $n.json().catch(()=>({}));if(ze+=`Paso ${Bt+1}: ${$n.status}
240
+ ${JSON.stringify(Qs,null,2)}
241
+
242
+ `,(Pt=Nt.extract)!=null&&Pt.jsonPath){const bn=Ou(Qs,Nt.extract.jsonPath);bn!==void 0&&(ge[Nt.extract.varName]=String(bn))}}return ze},Ft=async()=>{if(!et)return;const O=qr(et,_);if(Y.nodes.length===0){J("Añade al menos un nodo al flujo.");return}const ge=await Mm(Y,O,Pn);J(ge)},Jn=async O=>{if(!et)return;const ge=qr(et,_),ze=O.graph&&O.graph.nodes.length>0?await Mm(O.graph,ge,Pn):await eo(O.steps);J(ze),k("flows")},jt=O=>{G(O.name),Q(O.graph&&O.graph.nodes.length>0?O.graph:xN(O.steps.length?O.steps:[{method:"get",path:"/"}])),B(ge=>ge+1),_e(O.id??null),k("flows")},xo=()=>{_e(null),G("Nuevo flujo"),_t[0]?Q({nodes:[{id:crypto.randomUUID(),method:_t[0].method.toLowerCase(),path:_t[0].path,x:80,y:120}],edges:[]}):Q({nodes:[],edges:[]}),B(O=>O+1)},xr=L.useCallback(O=>{Q(O)},[]),to=async()=>{const O=yN(Y);if(Re!=null)await Ge.flows.update(Re,{name:ie,steps:O,graph:Y});else{const ge=await Ge.flows.add({name:ie,steps:O,graph:Y});_e(ge)}await dn()},vr=async O=>{O!==void 0&&(O===Re&&(_e(null),xo()),await Ge.flows.delete(O),await dn())},ur=()=>{if(!Ee)return;const{method:O,path:ge}=o_(Ee),ze={id:crypto.randomUUID(),method:O,path:ge,expectStatus:200,contains:void 0,jsonPath:void 0,expectJsonValue:void 0};K(We=>({...We,cases:[...We.cases,ze]}))},vo=O=>{K(ge=>({...ge,cases:ge.cases.filter(ze=>ze.id!==O)}))},gn=(O,ge)=>{K(ze=>({...ze,cases:ze.cases.map(We=>We.id===O?{...We,...ge}:We)}))},yn=async O=>{if(!et)return"";const ge=qr(et,_);let ze="";for(const We of O){const Pt=`${ge}${We.path}`,Bt=await fetch(Pt,{method:We.method.toUpperCase(),headers:Pn(),credentials:Aa(Pt)}),Nt=await Bt.text(),Dt=Rx(We,Bt.status,Nt),Lt=`${Dt.pass?"PASS":"FAIL"} ${We.method.toUpperCase()} ${We.path}`;ze+=`${Lt}
243
+ ${Dt.lines.map(Rn=>` ${Rn}`).join(`
244
+ `)}
245
+
246
+ `}return ze},yt=async()=>{const O=await yn(D.cases);Ie(O)},wn=async()=>{if(!et||Se.length===0)return;let O="";for(const ge of Se)O+=`━━━ ${ge.name} (${ge.cases.length} casos) ━━━
247
+ `,O+=await yn(ge.cases);Ie(O),k("tests")},qo=async O=>{const ge=await yn(O.cases);Ie(ge),k("tests")},no=O=>{K({name:O.name,cases:O.cases.map(ge=>({...ge,id:ge.id&&ge.id.length>0?ge.id:crypto.randomUUID()}))}),Fe(O.id??null),k("tests")},$r=()=>{Fe(null),K({name:"Nueva suite",cases:[]})},Mr=async()=>{if(tt!=null)await Ge.testSuites.update(tt,{name:D.name,cases:D.cases});else{const O=await Ge.testSuites.add({name:D.name,cases:D.cases});Fe(O)}await dn()},Tr=async O=>{O!==void 0&&(O===tt&&(Fe(null),K({name:"Nueva suite",cases:[]})),await Ge.testSuites.delete(O),await dn())},qn=async()=>{await Ge.kv.put({key:"bearer",value:R}),await Ge.kv.put({key:"apiKey",value:W})},St=async()=>{S(null);const O=await Tx(),ge=new Blob([JSON.stringify(O,null,2)],{type:"application/json"}),ze=document.createElement("a");ze.href=URL.createObjectURL(ge),ze.download="api-doc-tor-estado-app.json",ze.click(),URL.revokeObjectURL(ze.href)},wr=async O=>{var ze;const ge=(ze=O.target.files)==null?void 0:ze[0];if(O.target.value="",!!ge){S(null);try{const We=await ge.text(),Pt=JSON.parse(We);if(Pt.formatVersion!==1)throw new Error("Se esperaba un export de estado de la app (formatVersion: 1).");await Wm(Pt),await dn(),await vt(),await Rt()}catch(We){S(We instanceof Error?We.message:String(We))}}},Ir=L.useCallback(async()=>{if(En(null),!r)return;const O=vu(ht),ge=xt.trim().toLowerCase();if(!/^(get|post|put|patch|delete|options|head|trace)$/.test(ge)){En("Método HTTP no válido.");return}if(!ht.trim()){En("Indica una ruta.");return}if(Ox(r,ge,O)){En("Esa operación ya existe en el OpenAPI remoto.");return}if(ut.some(Pt=>vu(Pt.path)===O&&Pt.method.toLowerCase()===ge)){En("Ya añadiste esa operación.");return}const We=sn.trim()||`${ge.toUpperCase()} ${O}`;await $x({method:ge,path:O,summary:We,...Vn.trim()?{description:Vn.trim()}:{}}),await vt(),Ue(""),An(""),Ve("")},[r,ht,xt,sn,Vn,ut,vt]),Gn=L.useCallback(async O=>{await Mx(O),await vt()},[vt]),br=L.useCallback(()=>{var We;if(!et)return;const O=new Blob([JSON.stringify(et,null,2)],{type:"application/json"}),ge=document.createElement("a"),ze=(((We=et.info)==null?void 0:We.title)??"openapi").replace(/[^\w\-.]+/g,"-").slice(0,80);ge.href=URL.createObjectURL(O),ge.download=`${ze||"openapi"}.json`,ge.click(),URL.revokeObjectURL(ge.href)},[et]),Ar=async O=>{var ze;const ge=(ze=O.target.files)==null?void 0:ze[0];if(O.target.value="",!!ge){y(null);try{const We=await ge.text(),Pt=JSON.parse(We);pd(Pt);const Bt=Pt;await kx(Bt),o(Bt),j(qr(Bt)),a(null),d("local"),cn(null),U(null),A(null)}catch(We){y(We instanceof Error?We.message:String(We))}}},Zn=L.useCallback(async()=>{y(null),await xh(),await Rt()},[Rt]),wo=L.useCallback(()=>{const O=new URL(window.location.href);O.searchParams.delete("spec"),window.location.replace(O.pathname+O.search+O.hash)},[]),Or=async()=>{await fetch("/docs/__auth/logout",{method:"POST",credentials:"include"}),window.location.href="/docs/__auth/login"},Ct=L.useCallback(()=>{Xt(!0)},[]),Xs=L.useCallback(()=>{QN(dt,It.trim(),Zt),Xt(!1)},[Zt,It,dt]);L.useEffect(()=>{if(!At)return;const O=ge=>{ge.key==="Escape"&&Xt(!1)};return window.addEventListener("keydown",O),()=>window.removeEventListener("keydown",O)},[At]);const kt=()=>{T&&(Q(O=>{const ge=O.nodes[O.nodes.length-1],ze=ge?ge.x+280:80,We=(ge==null?void 0:ge.y)??120;return{nodes:[...O.nodes,{id:crypto.randomUUID(),method:T.method.toLowerCase(),path:T.path,x:ze,y:We}],edges:O.edges}}),B(O=>O+1),k("flows"))};if(i)return p.jsx("div",{className:"app-glass-bg min-h-screen flex items-center justify-center p-8",children:p.jsxs("div",{role:"alert",className:"glass-card max-w-lg border-red-500/40 bg-red-950/25 p-6 text-red-100",children:[p.jsx("h1",{className:"font-display text-xl font-bold mb-2",children:"No se pudo cargar OpenAPI"}),p.jsx("p",{className:"text-sm opacity-90 leading-relaxed",children:i}),p.jsxs("p",{className:"text-xs mt-4 text-slate-500",children:["URL intentada: ",On]})]})});if(!et)return p.jsx("div",{className:"app-glass-bg min-h-screen flex items-center justify-center p-6",children:p.jsx("div",{className:"glass-card px-8 py-6 border-white/[0.08]",children:p.jsx("p",{className:"text-slate-300 motion-safe:animate-pulse text-sm font-medium",children:"Cargando especificación…"})})});const bo=M===null?"Todos los endpoints (cliente único con todas las operaciones)":`Tag «${M}» (solo operaciones de este grupo)`,Wo=((bs=e.productName)==null?void 0:bs.trim())||et.info.title;return p.jsxs("div",{className:"app-glass-bg min-h-screen flex flex-col selection:bg-accent/25 selection:text-slate-50",children:[p.jsx("a",{href:"#main-content",className:"skip-link",children:"Saltar al contenido"}),p.jsxs("div",{className:"flex flex-1 flex-col md:flex-row min-h-0",children:[p.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 ${ar?"md:w-14 md:min-w-[3.5rem]":"md:w-64"}`,children:[p.jsx("input",{id:"adt-state-import",type:"file",accept:"application/json,.json",className:"hidden",onChange:wr}),p.jsx("input",{id:"adt-openapi-import",type:"file",accept:"application/json,.json",className:"hidden",onChange:Ar}),p.jsxs("div",{className:ar?"max-md:block md:hidden":"block",children:[p.jsxs("div",{className:"p-4 border-b border-surface-700 flex justify-between items-start gap-2",children:[p.jsxs("div",{className:"min-w-0",children:[e.logoDataUrl?p.jsx("img",{src:e.logoDataUrl,alt:Wo,className:"h-9 max-w-[200px] object-contain object-left mb-2"}):null,p.jsx("h1",{className:"font-display text-lg font-bold text-white tracking-tight",children:Wo}),p.jsx("p",{className:"text-xs text-slate-500 mt-1",children:Wo===et.info.title?`v${et.info.version}`:`${et.info.title} · v${et.info.version}`})]}),p.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:()=>Pr(!0),"aria-label":"Ocultar menú lateral",title:"Ocultar menú",children:"‹"})]}),p.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 (${se.length})`],["tests",`Tests (${Se.length})`],["history","Historial"],["schemas","Esquemas"],["auth","Auth"]].map(([O,ge])=>p.jsx("button",{type:"button",onClick:()=>k(O),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===O?"glass-pill-active text-accent":"text-slate-400 glass-pill hover:text-slate-200"}`,children:ge},O))}),qe?p.jsxs("div",{className:"px-3 py-2 border-t border-surface-700 flex items-center justify-between gap-2 text-xs",children:[p.jsx("span",{className:"text-slate-400 truncate",title:qe.username,children:qe.username}),p.jsx("button",{type:"button",className:"shrink-0 text-accent hover:underline",onClick:()=>void Or(),children:"Salir"})]}):null,p.jsxs("div",{className:"p-3 border-t border-surface-700 space-y-2",children:[p.jsx("button",{type:"button",onClick:()=>Xt(!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…"}),w?p.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:w}):null,p.jsx("button",{type:"button",onClick:()=>void St(),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)"}),p.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)"})]})]}),ar?p.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:[p.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:()=>Pr(!1),"aria-label":"Mostrar menú lateral completo",title:"Expandir panel completo",children:p.jsx(Im,{className:"text-slate-300"})}),p.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:[p.jsx("button",{type:"button",onClick:()=>k("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:p.jsx(TN,{})}),p.jsxs("button",{type:"button",onClick:()=>k("flows"),title:`Flujos (${se.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:[p.jsx(IN,{}),se.length>0?p.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:se.length>99?"99+":se.length}):null]}),p.jsxs("button",{type:"button",onClick:()=>k("tests"),title:`Tests (${Se.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:[p.jsx(LN,{}),Se.length>0?p.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:Se.length>99?"99+":Se.length}):null]}),p.jsx("button",{type:"button",onClick:()=>k("history"),title:"Historial de Probar","aria-current":x==="history"?"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==="history"?"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:p.jsx(ON,{})}),p.jsx("button",{type:"button",onClick:()=>k("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:p.jsx(AN,{})}),p.jsx("button",{type:"button",onClick:()=>Xt(!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:p.jsx(Kg,{})}),p.jsxs("button",{type:"button",onClick:()=>k("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:[p.jsx(RN,{}),qe?p.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]})]}),p.jsxs("div",{className:"flex flex-col gap-0.5 items-center w-full py-1 mt-auto border-t border-surface-700/80",children:[p.jsx("button",{type:"button",onClick:()=>void St(),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:p.jsx(DN,{})}),p.jsx("button",{type:"button",onClick:()=>{var O;return(O=document.getElementById("adt-state-import"))==null?void 0:O.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:p.jsx(zN,{})}),qe?p.jsx("button",{type:"button",onClick:()=>void Or(),title:`Salir (${qe.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:p.jsx(FN,{})}):null]})]}):null]}),p.jsxs("main",{id:"main-content",tabIndex:-1,className:"flex-1 flex flex-col min-h-0 outline-none",children:[p.jsx("header",{className:"glass-sticky-header sticky top-0 z-20 px-4 py-3 flex flex-wrap gap-3 items-center",children:p.jsxs("label",{className:"text-xs text-slate-500 flex flex-col gap-1 sm:flex-row sm:items-center",children:[p.jsx("span",{className:"shrink-0 font-medium text-slate-400",children:"Base URL"}),p.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:_,onChange:O=>j(O.target.value),placeholder:"https://api.ejemplo.com",autoComplete:"url",spellCheck:!1})]})}),x==="explore"&&p.jsxs("div",{className:"flex-1 flex flex-col lg:flex-row min-h-0",children:[p.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 ${mr?"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:[p.jsxs("div",{className:mr?"max-lg:block lg:hidden":"block",children:[p.jsxs("div",{className:"p-2 flex items-start justify-between gap-2 border-b border-surface-700 lg:border-b-0",children:[p.jsx("p",{className:"text-xs uppercase tracking-wider text-slate-500 shrink-0",children:"Tags"}),p.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:()=>go(!0),"aria-label":"Ocultar lista de endpoints",title:"Ocultar endpoints",children:"‹"})]}),p.jsx("div",{className:"p-2 pt-1",children:p.jsxs("div",{className:"flex flex-wrap gap-1",children:[p.jsx("button",{type:"button",onClick:()=>A(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"}),lr.map(O=>p.jsx("button",{type:"button",onClick:()=>A(O),className:`text-xs px-3 py-2 sm:py-1 rounded-xl min-h-[40px] sm:min-h-0 transition-all duration-200 ${M===O?"glass-pill-active text-slate-100":"glass-pill text-slate-300"}`,children:O},O))]})}),p.jsx("ul",{className:"text-sm",children:Cn.map(O=>p.jsx("li",{children:p.jsxs("button",{type:"button",onClick:()=>Gr({method:O.method,path:O.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 ${(T==null?void 0:T.method)===O.method&&T.path===O.path?"glass-pill-active border-l-2 border-accent ml-0.5":"hover:bg-white/[0.04]"}`,children:[p.jsx(Oi,{method:O.method}),p.jsxs("span",{className:"flex-1 min-w-0 flex items-center gap-1.5",children:[p.jsx("span",{className:"truncate text-slate-300",children:O.path}),et&&Cd(et,O.method,O.path)?p.jsx("span",{className:"shrink-0 text-[9px] uppercase text-amber-400/90",title:"Deprecated",children:"dep"}):null]})]})},`${O.method}:${O.path}`))})]}),mr?p.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:[p.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:()=>go(!1),"aria-label":"Mostrar lista de endpoints completa",title:"Expandir lista de endpoints",children:p.jsx(Im,{className:"text-slate-300"})}),p.jsxs("div",{className:"text-center text-[9px] font-mono text-slate-500 leading-none px-0.5",title:`${Cn.length} operación(es) (filtro actual)`,children:[p.jsx("span",{className:"block text-slate-400 font-semibold text-[11px]",children:Cn.length}),p.jsx("span",{className:"text-[8px] uppercase tracking-tighter",children:"ops"})]}),p.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:Cn.map((O,ge)=>{const ze=(T==null?void 0:T.method)===O.method&&T.path===O.path;return p.jsx("button",{type:"button",role:"listitem",title:`${O.method.toUpperCase()} ${O.path}`,onClick:()=>Gr({method:O.method,path:O.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 ${MN(O.method)} ${ze?"ring-2 ring-accent/80 shadow-[inset_0_0_0_1px_rgba(56,189,248,0.2)]":""}`,children:ge+1},`${O.method}:${O.path}`)})})]}):null]}),p.jsxs("div",{className:"flex-1 p-4 overflow-auto space-y-6",children:[p.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:[p.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[p.jsxs("div",{children:[p.jsx("h2",{id:"adt-openapi-tools-heading",className:"text-sm font-semibold text-slate-200",children:"Documento OpenAPI"}),p.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:["Fuente actual:"," ",p.jsx("span",{className:"text-slate-300 font-medium",children:c==="local"?"copia local (IndexedDB)":c==="remote"?"URL remota (?spec=…)":"servidor (openapi.json)"})]})]}),p.jsxs("div",{className:"flex flex-wrap gap-2 justify-end",children:[p.jsx("button",{type:"button",onClick:br,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"}),p.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"?p.jsx("button",{type:"button",onClick:()=>void Zn(),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,c==="remote"?p.jsx("button",{type:"button",onClick:()=>wo(),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 openapi.json del sitio"}):null]})]}),p.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"," ",p.jsx("strong",{className:"text-slate-400",children:"estado de la app"})," (flujos, tests, entornos y este spec si existe) está en el menú lateral."]}),m?p.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:m}):null,c==="remote"?p.jsxs("div",{className:"mt-4 pt-4 border-t border-surface-600/40 space-y-3",children:[p.jsx("h3",{className:"text-xs font-semibold text-slate-300",children:"Playground: creador de endpoints"}),p.jsxs("p",{className:"text-[11px] text-slate-500 leading-relaxed",children:["Añade operaciones que no vienen en el spec remoto. Quedan en IndexedDB y se incluyen en"," ",p.jsx("strong",{className:"text-slate-400",children:"Exportar estado de la app"})," (campo"," ",p.jsx("code",{className:"text-slate-400",children:"playgroundManualEndpoints"}),") y en"," ",p.jsx("strong",{className:"text-slate-400",children:"Exportar OpenAPI"})," (documento fusionado)."]}),p.jsxs("div",{className:"flex flex-wrap gap-2 items-end",children:[p.jsxs("label",{className:"text-[11px] text-slate-400 flex flex-col gap-1",children:["Método",p.jsx("select",{className:"bg-surface-800 border border-surface-600 rounded-lg px-2 py-1.5 text-sm text-slate-200",value:xt,onChange:O=>nn(O.target.value),children:["get","post","put","patch","delete","options","head","trace"].map(O=>p.jsx("option",{value:O,children:O.toUpperCase()},O))})]}),p.jsxs("label",{className:"text-[11px] text-slate-400 flex flex-col gap-1 min-w-[8rem] flex-1",children:["Ruta",p.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded-lg px-2 py-1.5 text-sm font-mono text-slate-200",value:ht,onChange:O=>Ue(O.target.value),placeholder:"/recurso/{id}",autoComplete:"off"})]}),p.jsxs("label",{className:"text-[11px] text-slate-400 flex flex-col gap-1 flex-1 min-w-[10rem]",children:["Resumen",p.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded-lg px-2 py-1.5 text-sm text-slate-200",value:sn,onChange:O=>An(O.target.value),placeholder:"Opcional",autoComplete:"off"})]})]}),p.jsxs("label",{className:"text-[11px] text-slate-400 flex flex-col gap-1",children:["Descripción (opcional)",p.jsx("textarea",{className:"bg-surface-800 border border-surface-600 rounded-lg px-2 py-1.5 text-sm text-slate-200 min-h-[52px]",value:Vn,onChange:O=>Ve(O.target.value),rows:2})]}),Un?p.jsx("p",{className:"text-[11px] text-rose-300/95",role:"alert",children:Un}):null,p.jsx("button",{type:"button",onClick:()=>void Ir(),className:"text-xs px-3 py-2 rounded-xl bg-accent/20 text-accent border border-accent/40 hover:bg-accent/30 min-h-[40px] sm:min-h-0",children:"Añadir endpoint"}),ut.length>0?p.jsx("ul",{className:"space-y-1.5 mt-2",children:ut.map(O=>p.jsxs("li",{className:"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-surface-700 bg-surface-950/40 px-3 py-2 text-[11px]",children:[p.jsxs("span",{className:"font-mono text-slate-200",children:[p.jsx("span",{className:"text-emerald-400/90",children:O.method.toUpperCase()})," ",O.path]}),p.jsx("button",{type:"button",className:"text-rose-400/90 hover:text-rose-300 text-[11px] min-h-[40px] sm:min-h-0 px-2",onClick:()=>void Gn(O.id),children:"Quitar"})]},O.id))}):p.jsx("p",{className:"text-[11px] text-slate-600",children:"Ningún endpoint manual."})]}):null]}),T?p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsxs("h2",{className:"font-display font-semibold text-white text-lg flex flex-wrap items-center gap-2",children:[p.jsx(Oi,{method:T.method,size:"md"}),p.jsx("span",{className:"font-mono text-slate-200 break-all",children:T.path}),et&&Cd(et,T.method,T.path)?p.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]}),zt!=null&&zt.summary?p.jsx("p",{className:"text-sm text-slate-300 mt-2 leading-relaxed",children:zt.summary}):null,zt!=null&&zt.description&&zt.description!==zt.summary?p.jsx("p",{className:"text-xs text-slate-500 mt-2 leading-relaxed whitespace-pre-wrap",children:zt.description}):null,zt!=null&&zt.exampleStr?p.jsxs("details",{className:"mt-3 group",children:[p.jsx("summary",{className:"text-xs text-slate-400 cursor-pointer hover:text-slate-300",children:"Ejemplo de cuerpo (request)"}),p.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:zt.exampleStr})]}):null,p.jsxs("p",{className:"text-xs text-slate-500 mt-2",children:["Filtro de exportación de servicio: ",bo]})]}),et?p.jsx($N,{doc:et,selectedOp:T,baseUrl:_,buildHeaders:Pn,hydrateEntry:on,onHydrateConsumed:an}):null,p.jsxs("section",{className:"space-y-3",children:[p.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Snippets por lenguaje"}),p.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:Ln&&Pd.map(({id:O,label:ge})=>p.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/60 overflow-hidden",children:[p.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-surface-700 bg-surface-800/50",children:[p.jsx("span",{className:"text-xs font-medium text-accent",children:ge}),p.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-surface-600",onClick:()=>void Rm(Ln[O]),children:"Copiar"})]}),p.jsx("pre",{className:"text-[11px] p-3 overflow-auto max-h-56 text-slate-300 font-mono whitespace-pre-wrap",children:Ln[O]})]},O))})]}),p.jsxs("section",{className:"space-y-3 rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[p.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Cliente / servicio generado"}),p.jsx("p",{className:"text-xs text-slate-500",children:bo}),p.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[p.jsxs("label",{className:"text-xs text-slate-400",children:["Lenguaje del archivo",p.jsx("select",{className:"ml-2 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:P,onChange:O=>$(O.target.value),children:Pd.map(({id:O,label:ge})=>p.jsx("option",{value:O,children:ge},O))})]}),p.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg bg-surface-700 hover:bg-surface-600",onClick:()=>void Rm(Zr),children:"Copiar servicio"})]}),p.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:Zr})]}),p.jsx("div",{className:"flex flex-wrap gap-2 pt-2 border-t border-surface-800",children:p.jsx("button",{type:"button",className:"text-xs px-3 py-2 rounded-lg bg-surface-800 hover:bg-surface-700",onClick:kt,children:"Añadir operación actual a un flujo (ve a Flujos)"})})]}):p.jsx("p",{className:"text-slate-500",children:"Selecciona una operación en la lista."})]})]}),x==="history"&&p.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:p.jsx(r_,{listKey:xe,onReplay:yr})}),x==="schemas"&&p.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:p.jsx(ZN,{doc:et})}),x==="flows"&&p.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[p.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4",children:[p.jsx("h3",{className:"text-sm font-semibold text-white mb-3",children:"Flujos guardados"}),se.length===0?p.jsx("p",{className:"text-sm text-slate-500",children:"Aún no hay flujos. Crea uno en el editor y guarda."}):p.jsx("ul",{className:"space-y-2",children:se.map(O=>{var ge,ze;return p.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:[p.jsxs("div",{children:[p.jsx("span",{className:"text-sm text-slate-200 font-medium",children:O.name}),p.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[(((ze=(ge=O.graph)==null?void 0:ge.nodes)==null?void 0:ze.length)??O.steps.length)||0," nodo(s)"]})]}),p.jsxs("div",{className:"flex flex-wrap gap-2",children:[p.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 Jn(O),children:"Play"}),p.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent hover:bg-accent/30",onClick:()=>jt(O),children:"Editar"}),p.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 vr(O.id),children:"Eliminar"})]})]},O.id!=null?`flow-${O.id}`:`flow-${O.name}`)})})]}),p.jsxs("section",{className:"space-y-4 max-w-6xl",children:[p.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[p.jsx("h3",{className:"text-sm font-semibold text-white",children:"Editor de flujo (nodos y cables)"}),p.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:xo,children:"Nuevo flujo"})]}),Re!=null&&p.jsxs("p",{className:"text-xs text-accent",children:["Editando flujo guardado (#",Re,")"]}),p.jsxs("p",{className:"text-sm text-slate-400",children:["Cada nodo es un endpoint del spec. Conecta ",p.jsx("strong",{className:"text-slate-300",children:"res → req"})," y mapea la respuesta al request siguiente. Pulsa el cable o la etiqueta sobre la línea: se abre un"," ",p.jsx("strong",{className:"text-slate-300",children:"modal a pantalla completa"})," fuera del grafo; al abrirlo se"," ",p.jsx("strong",{className:"text-slate-300",children:"llama solo al nodo origen"})," y ves los campos del destino (path, query, header, cookie, body JSON): en cada fila eliges un JSON path de la respuesta o un valor fijo; los obligatorios del OpenAPI llevan *. El modo clásico (una variable y"," ",p.jsx("code",{className:"text-accent",children:"{variable}"})," en la ruta) sigue en el desplegable del modal."]}),p.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm w-full max-w-md",value:ie,onChange:O=>G(O.target.value),placeholder:"Nombre del flujo"}),p.jsx(pN,{doc:et,ops:_t,graph:Y,onGraphChange:xr,baseUrl:_,buildHeaders:Pn},ve),p.jsxs("div",{className:"flex flex-wrap gap-2",children:[p.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 Ft(),children:"Play (grafo)"}),p.jsx("button",{type:"button",className:"px-3 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void to(),children:Re!=null?"Guardar cambios":"Guardar flujo"})]}),p.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"&&p.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[p.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[p.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[p.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suites guardadas"}),Se.length>0&&p.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 wn(),children:"Ejecutar todas las suites"})]}),Se.length===0?p.jsx("p",{className:"text-sm text-slate-500",children:"Ninguna suite guardada."}):p.jsx("ul",{className:"space-y-2",children:Se.map(O=>p.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:[p.jsxs("div",{children:[p.jsx("span",{className:"text-sm text-slate-200 font-medium",children:O.name}),p.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[O.cases.length," caso(s)"]})]}),p.jsxs("div",{className:"flex flex-wrap gap-2",children:[p.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 qo(O),children:"Play"}),p.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent",onClick:()=>no(O),children:"Editar"}),p.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-red-900/40",onClick:()=>void Tr(O.id),children:"Eliminar"})]})]},O.id!=null?`suite-${O.id}`:`suite-${O.name}`))})]}),p.jsxs("section",{className:"space-y-4",children:[p.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[p.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suite en edición"}),p.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:$r,children:"Nueva suite"})]}),tt!=null&&p.jsxs("p",{className:"text-xs text-accent",children:["Editando suite guardada (#",tt,")"]}),p.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm max-w-md",value:D.name,onChange:O=>K(ge=>({...ge,name:O.target.value})),placeholder:"Nombre de la suite"}),p.jsxs("div",{className:"flex flex-wrap gap-2 items-end rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[p.jsxs("label",{className:"text-xs text-slate-400 flex-1 min-w-[200px]",children:["Añadir endpoint del spec",p.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm font-mono",value:Ee,onChange:O=>Ne(O.target.value),children:_t.map(O=>p.jsxs("option",{value:$d(O.method,O.path),children:[O.method.toUpperCase()," ",O.path]},$d(O.method,O.path)))})]}),p.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-800 text-sm hover:bg-surface-700",onClick:ur,children:"Añadir a la suite"})]}),p.jsx("ul",{className:"space-y-4",children:D.cases.map(O=>{const ge=Lm(O.expectStatus)?String(O.expectStatus):"custom";return p.jsxs("li",{className:"rounded-xl border border-surface-700 bg-surface-950/40 p-4 space-y-3 text-sm",children:[p.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[p.jsxs("span",{className:"flex flex-wrap items-center gap-2 min-w-0",children:[p.jsx(Oi,{method:O.method}),p.jsx("span",{className:"font-mono text-xs text-slate-300 break-all",children:O.path})]}),p.jsx("button",{type:"button",className:"text-xs text-red-400 hover:underline shrink-0",onClick:()=>vo(O.id),children:"Quitar"})]}),p.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[p.jsxs("label",{className:"text-xs text-slate-400 block",children:["Código HTTP esperado",p.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[p.jsxs("select",{className:"bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm max-w-[200px]",value:ge,onChange:ze=>{const We=ze.target.value;if(We==="custom"){gn(O.id,{expectStatus:Lm(O.expectStatus)?1e3:O.expectStatus});return}gn(O.id,{expectStatus:Number(We)})},children:[Qg.map(ze=>p.jsx("option",{value:String(ze.value),children:ze.label},ze.value)),p.jsx("option",{value:"custom",children:"Otro…"})]}),ge==="custom"&&p.jsx("input",{type:"number",className:"w-20 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:O.expectStatus,onChange:ze=>gn(O.id,{expectStatus:Number(ze.target.value)||0})})]})]}),p.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["El body contiene (opcional)",p.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:O.contains??"",onChange:ze=>gn(O.id,{contains:ze.target.value||void 0})})]}),p.jsxs("label",{className:"text-xs text-slate-400 block",children:["JSON path (opcional)",p.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:O.jsonPath??"",onChange:ze=>gn(O.id,{jsonPath:ze.target.value||void 0})})]}),p.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["Valor esperado en JSON path (opcional)",p.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:O.expectJsonValue??"",onChange:ze=>gn(O.id,{expectJsonValue:ze.target.value||void 0})})]})]})]},O.id)})}),p.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[p.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 yt(),children:"Correr todos los casos (suite actual)"}),p.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void Mr(),children:tt!=null?"Guardar cambios":"Guardar suite"})]}),p.jsx("pre",{className:"text-xs bg-surface-950 border border-surface-700 rounded-lg p-3 whitespace-pre-wrap min-h-[4rem]",children:Le||"—"})]})]}),x==="auth"&&p.jsxs("div",{className:"p-4 space-y-4 max-w-lg",children:[p.jsxs("p",{className:"text-sm text-slate-400",children:["Esquemas en el spec: ",yx(et).join(", ")||"ninguno"]}),p.jsxs("label",{className:"block text-sm",children:["Bearer token",p.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:R,onChange:O=>F(O.target.value),placeholder:"eyJ..."})]}),p.jsxs("label",{className:"block text-sm",children:["API key header",p.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:ne,onChange:O=>ke(O.target.value)})]}),p.jsxs("label",{className:"block text-sm",children:["API key",p.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:W,onChange:O=>ue(O.target.value),type:"password",autoComplete:"off"})]}),p.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void qn(),children:"Recordar en este navegador"})]})]})]}),p.jsx(JN,{open:tn,onClose:()=>Xn(!1),ops:gr,onPick:yo}),At?p.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:()=>Xt(!1),children:p.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:O=>O.stopPropagation(),children:[p.jsxs("div",{className:"flex items-start justify-between gap-2 px-4 py-3 border-b border-white/[0.08]",children:[p.jsx("h2",{id:"adt-llm-modal-title",className:"text-sm font-semibold text-slate-100 pr-2",children:"Asistente: proveedor de IA"}),p.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:()=>Xt(!1),"aria-label":"Cerrar",children:"×"})]}),p.jsxs("div",{className:"px-4 py-4 space-y-3",children:[p.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."}),p.jsxs("label",{className:"block text-xs text-slate-400",children:["Proveedor",p.jsxs("select",{className:"glass-input mt-1 w-full border rounded-xl px-3 py-2 text-sm text-slate-200",value:dt,onChange:O=>{const ge=O.target.value;gt(ge),mn(ze=>ze.trim()?ze:cu(ge))},children:[p.jsx("option",{value:"anthropic",children:"Anthropic (Claude)"}),p.jsx("option",{value:"openai",children:"OpenAI"}),p.jsx("option",{value:"openrouter",children:"OpenRouter"})]})]}),p.jsxs("label",{className:"block text-xs text-slate-400",children:["Modelo (opcional)",p.jsx("input",{className:"glass-input mt-1 w-full border rounded-xl px-3 py-2 text-sm font-mono text-slate-200",value:It,onChange:O=>mn(O.target.value),placeholder:cu(dt),spellCheck:!1})]}),p.jsxs("label",{className:"block text-xs text-slate-400",children:["API key",p.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:Zt,onChange:O=>en(O.target.value),placeholder:dt==="anthropic"?"sk-ant-…":dt==="openai"?"sk-…":"sk-or-v1-…",autoComplete:"off"})]}),p.jsxs("div",{className:"flex flex-wrap gap-2 pt-1",children:[p.jsx("button",{type:"button",onClick:Xs,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"}),p.jsx("button",{type:"button",onClick:()=>Xt(!1),className:"px-4 py-2.5 rounded-xl glass-pill text-slate-300 text-sm",children:"Cancelar"})]})]})]})}):null,p.jsx(YN,{doc:et,contextExtras:ws,provider:dt,model:It,apiKey:Zt,onOpenLlmSettings:Ct}),p.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 a_={surface950:"#0c0f14",surface900:"#12171f",surface800:"#1a2230",surface700:"#243044",accent:"#38bdf8",accentDim:"#0ea5e9"};function $i(e){const r=e.trim(),o=/^#?([0-9a-f]{6})$/i.exec(r);if(!o)return"12 15 20";const i=parseInt(o[1],16);return`${i>>16&255} ${i>>8&255} ${i&255}`}function l_(e){return{...a_,...e}}function u_(e){var i,a;const r=(i=e.logoBase64)==null?void 0:i.trim();return r?r.startsWith("data:")?r:`data:${((a=e.logoMimeType)==null?void 0:a.trim())||"image/png"};base64,${r}`:null}function c_(e){var o;const r=l_(e==null?void 0:e.colors);return{productName:((o=e==null?void 0:e.productName)==null?void 0:o.trim())||null,logoDataUrl:e?u_(e):null,colors:r,colorsRgb:{surface950:$i(r.surface950),surface900:$i(r.surface900),surface800:$i(r.surface800),surface700:$i(r.surface700),accent:$i(r.accent),accentDim:$i(r.accentDim)}}}const d_={credentials:"include"};function f_(e){const r=document.documentElement;r.style.setProperty("--surface-950",e.surface950),r.style.setProperty("--surface-900",e.surface900),r.style.setProperty("--surface-800",e.surface800),r.style.setProperty("--surface-700",e.surface700),r.style.setProperty("--accent",e.accent),r.style.setProperty("--accent-dim",e.accentDim)}async function p_(){const e=c_(void 0);try{const r=await fetch("/docs/ui-config.json",d_);return r.status===401?{...e,docsAuthRequired:!0}:r.ok?await r.json():e}catch{return e}}(async()=>{const e=await p_();f_(e.colorsRgb),Jy.createRoot(document.getElementById("root")).render(p.jsx(Dm.StrictMode,{children:p.jsx(vN,{value:{productName:e.productName,logoDataUrl:e.logoDataUrl},children:p.jsx(i_,{})})}))})();