@api-doc-tor/express 0.2.1 → 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,269 @@
1
+ var Jy=Object.defineProperty;var Xy=(e,r,o)=>r in e?Jy(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o;var bs=(e,r,o)=>Xy(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 d of a)if(d.type==="childList")for(const c of d.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&i(c)}).observe(document,{childList:!0,subtree:!0});function o(a){const d={};return a.integrity&&(d.integrity=a.integrity),a.referrerPolicy&&(d.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?d.credentials="include":a.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function i(a){if(a.ep)return;a.ep=!0;const d=o(a);fetch(a.href,d)}})();var Qy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Iu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dd={exports:{}},Pa={},fd={exports:{}},kt={};/**
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 uh;function Gy(){if(uh)return kt;uh=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"),d=Symbol.for("react.provider"),c=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),b=Symbol.iterator;function S(L){return L===null||typeof L!="object"?null:(L=b&&L[b]||L["@@iterator"],typeof L=="function"?L:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,P={};function T(L,U,je){this.props=L,this.context=U,this.refs=P,this.updater=je||_}T.prototype.isReactComponent={},T.prototype.setState=function(L,U){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,U,"setState")},T.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function M(){}M.prototype=T.prototype;function V(L,U,je){this.props=L,this.context=U,this.refs=P,this.updater=je||_}var $=V.prototype=new M;$.constructor=V,j($,T.prototype),$.isPureReactComponent=!0;var O=Array.isArray,z=Object.prototype.hasOwnProperty,R={current:null},W={key:!0,ref:!0,__self:!0,__source:!0};function Y(L,U,je){var Ne,Re={},Oe=null,Le=null;if(U!=null)for(Ne in U.ref!==void 0&&(Le=U.ref),U.key!==void 0&&(Oe=""+U.key),U)z.call(U,Ne)&&!W.hasOwnProperty(Ne)&&(Re[Ne]=U[Ne]);var ke=arguments.length-2;if(ke===1)Re.children=je;else if(1<ke){for(var $e=Array(ke),_e=0;_e<ke;_e++)$e[_e]=arguments[_e+2];Re.children=$e}if(L&&L.defaultProps)for(Ne in ke=L.defaultProps,ke)Re[Ne]===void 0&&(Re[Ne]=ke[Ne]);return{$$typeof:e,type:L,key:Oe,ref:Le,props:Re,_owner:R.current}}function le(L,U){return{$$typeof:e,type:L.type,key:U,ref:L.ref,props:L.props,_owner:L._owner}}function we(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function ie(L){var U={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(je){return U[je]})}var de=/\/+/g;function te(L,U){return typeof L=="object"&&L!==null&&L.key!=null?ie(""+L.key):U.toString(36)}function F(L,U,je,Ne,Re){var Oe=typeof L;(Oe==="undefined"||Oe==="boolean")&&(L=null);var Le=!1;if(L===null)Le=!0;else switch(Oe){case"string":case"number":Le=!0;break;case"object":switch(L.$$typeof){case e:case r:Le=!0}}if(Le)return Le=L,Re=Re(Le),L=Ne===""?"."+te(Le,0):Ne,O(Re)?(je="",L!=null&&(je=L.replace(de,"$&/")+"/"),F(Re,U,je,"",function(_e){return _e})):Re!=null&&(we(Re)&&(Re=le(Re,je+(!Re.key||Le&&Le.key===Re.key?"":(""+Re.key).replace(de,"$&/")+"/")+L)),U.push(Re)),1;if(Le=0,Ne=Ne===""?".":Ne+":",O(L))for(var ke=0;ke<L.length;ke++){Oe=L[ke];var $e=Ne+te(Oe,ke);Le+=F(Oe,U,je,$e,Re)}else if($e=S(L),typeof $e=="function")for(L=$e.call(L),ke=0;!(Oe=L.next()).done;)Oe=Oe.value,$e=Ne+te(Oe,ke++),Le+=F(Oe,U,je,$e,Re);else if(Oe==="object")throw U=String(L),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.");return Le}function ce(L,U,je){if(L==null)return L;var Ne=[],Re=0;return F(L,Ne,"","",function(Oe){return U.call(je,Oe,Re++)}),Ne}function J(L){if(L._status===-1){var U=L._result;U=U(),U.then(function(je){(L._status===0||L._status===-1)&&(L._status=1,L._result=je)},function(je){(L._status===0||L._status===-1)&&(L._status=2,L._result=je)}),L._status===-1&&(L._status=0,L._result=U)}if(L._status===1)return L._result.default;throw L._result}var ue={current:null},q={transition:null},K={ReactCurrentDispatcher:ue,ReactCurrentBatchConfig:q,ReactCurrentOwner:R};function Q(){throw Error("act(...) is not supported in production builds of React.")}return kt.Children={map:ce,forEach:function(L,U,je){ce(L,function(){U.apply(this,arguments)},je)},count:function(L){var U=0;return ce(L,function(){U++}),U},toArray:function(L){return ce(L,function(U){return U})||[]},only:function(L){if(!we(L))throw Error("React.Children.only expected to receive a single React element child.");return L}},kt.Component=T,kt.Fragment=o,kt.Profiler=a,kt.PureComponent=V,kt.StrictMode=i,kt.Suspense=g,kt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=K,kt.act=Q,kt.cloneElement=function(L,U,je){if(L==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+L+".");var Ne=j({},L.props),Re=L.key,Oe=L.ref,Le=L._owner;if(U!=null){if(U.ref!==void 0&&(Oe=U.ref,Le=R.current),U.key!==void 0&&(Re=""+U.key),L.type&&L.type.defaultProps)var ke=L.type.defaultProps;for($e in U)z.call(U,$e)&&!W.hasOwnProperty($e)&&(Ne[$e]=U[$e]===void 0&&ke!==void 0?ke[$e]:U[$e])}var $e=arguments.length-2;if($e===1)Ne.children=je;else if(1<$e){ke=Array($e);for(var _e=0;_e<$e;_e++)ke[_e]=arguments[_e+2];Ne.children=ke}return{$$typeof:e,type:L.type,key:Re,ref:Oe,props:Ne,_owner:Le}},kt.createContext=function(L){return L={$$typeof:c,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},L.Provider={$$typeof:d,_context:L},L.Consumer=L},kt.createElement=Y,kt.createFactory=function(L){var U=Y.bind(null,L);return U.type=L,U},kt.createRef=function(){return{current:null}},kt.forwardRef=function(L){return{$$typeof:h,render:L}},kt.isValidElement=we,kt.lazy=function(L){return{$$typeof:k,_payload:{_status:-1,_result:L},_init:J}},kt.memo=function(L,U){return{$$typeof:x,type:L,compare:U===void 0?null:U}},kt.startTransition=function(L){var U=q.transition;q.transition={};try{L()}finally{q.transition=U}},kt.unstable_act=Q,kt.useCallback=function(L,U){return ue.current.useCallback(L,U)},kt.useContext=function(L){return ue.current.useContext(L)},kt.useDebugValue=function(){},kt.useDeferredValue=function(L){return ue.current.useDeferredValue(L)},kt.useEffect=function(L,U){return ue.current.useEffect(L,U)},kt.useId=function(){return ue.current.useId()},kt.useImperativeHandle=function(L,U,je){return ue.current.useImperativeHandle(L,U,je)},kt.useInsertionEffect=function(L,U){return ue.current.useInsertionEffect(L,U)},kt.useLayoutEffect=function(L,U){return ue.current.useLayoutEffect(L,U)},kt.useMemo=function(L,U){return ue.current.useMemo(L,U)},kt.useReducer=function(L,U,je){return ue.current.useReducer(L,U,je)},kt.useRef=function(L){return ue.current.useRef(L)},kt.useState=function(L){return ue.current.useState(L)},kt.useSyncExternalStore=function(L,U,je){return ue.current.useSyncExternalStore(L,U,je)},kt.useTransition=function(){return ue.current.useTransition()},kt.version="18.3.1",kt}var ch;function Ya(){return ch||(ch=1,fd.exports=Gy()),fd.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 dh;function Zy(){if(dh)return Pa;dh=1;var e=Ya(),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,d={key:!0,ref:!0,__self:!0,__source:!0};function c(h,g,x){var k,b={},S=null,_=null;x!==void 0&&(S=""+x),g.key!==void 0&&(S=""+g.key),g.ref!==void 0&&(_=g.ref);for(k in g)i.call(g,k)&&!d.hasOwnProperty(k)&&(b[k]=g[k]);if(h&&h.defaultProps)for(k in g=h.defaultProps,g)b[k]===void 0&&(b[k]=g[k]);return{$$typeof:r,type:h,key:S,ref:_,props:b,_owner:a.current}}return Pa.Fragment=o,Pa.jsx=c,Pa.jsxs=c,Pa}var fh;function ex(){return fh||(fh=1,dd.exports=Zy()),dd.exports}var f=ex(),I=Ya();const zm=Iu(I);var tu={},pd={exports:{}},dr={},hd={exports:{}},md={};/**
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 ph;function tx(){return ph||(ph=1,(function(e){function r(q,K){var Q=q.length;q.push(K);e:for(;0<Q;){var L=Q-1>>>1,U=q[L];if(0<a(U,K))q[L]=K,q[Q]=U,Q=L;else break e}}function o(q){return q.length===0?null:q[0]}function i(q){if(q.length===0)return null;var K=q[0],Q=q.pop();if(Q!==K){q[0]=Q;e:for(var L=0,U=q.length,je=U>>>1;L<je;){var Ne=2*(L+1)-1,Re=q[Ne],Oe=Ne+1,Le=q[Oe];if(0>a(Re,Q))Oe<U&&0>a(Le,Re)?(q[L]=Le,q[Oe]=Q,L=Oe):(q[L]=Re,q[Ne]=Q,L=Ne);else if(Oe<U&&0>a(Le,Q))q[L]=Le,q[Oe]=Q,L=Oe;else break e}}return K}function a(q,K){var Q=q.sortIndex-K.sortIndex;return Q!==0?Q:q.id-K.id}if(typeof performance=="object"&&typeof performance.now=="function"){var d=performance;e.unstable_now=function(){return d.now()}}else{var c=Date,h=c.now();e.unstable_now=function(){return c.now()-h}}var g=[],x=[],k=1,b=null,S=3,_=!1,j=!1,P=!1,T=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,V=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function $(q){for(var K=o(x);K!==null;){if(K.callback===null)i(x);else if(K.startTime<=q)i(x),K.sortIndex=K.expirationTime,r(g,K);else break;K=o(x)}}function O(q){if(P=!1,$(q),!j)if(o(g)!==null)j=!0,J(z);else{var K=o(x);K!==null&&ue(O,K.startTime-q)}}function z(q,K){j=!1,P&&(P=!1,M(Y),Y=-1),_=!0;var Q=S;try{for($(K),b=o(g);b!==null&&(!(b.expirationTime>K)||q&&!ie());){var L=b.callback;if(typeof L=="function"){b.callback=null,S=b.priorityLevel;var U=L(b.expirationTime<=K);K=e.unstable_now(),typeof U=="function"?b.callback=U:b===o(g)&&i(g),$(K)}else i(g);b=o(g)}if(b!==null)var je=!0;else{var Ne=o(x);Ne!==null&&ue(O,Ne.startTime-K),je=!1}return je}finally{b=null,S=Q,_=!1}}var R=!1,W=null,Y=-1,le=5,we=-1;function ie(){return!(e.unstable_now()-we<le)}function de(){if(W!==null){var q=e.unstable_now();we=q;var K=!0;try{K=W(!0,q)}finally{K?te():(R=!1,W=null)}}else R=!1}var te;if(typeof V=="function")te=function(){V(de)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,ce=F.port2;F.port1.onmessage=de,te=function(){ce.postMessage(null)}}else te=function(){T(de,0)};function J(q){W=q,R||(R=!0,te())}function ue(q,K){Y=T(function(){q(e.unstable_now())},K)}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(q){q.callback=null},e.unstable_continueExecution=function(){j||_||(j=!0,J(z))},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):le=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return S},e.unstable_getFirstCallbackNode=function(){return o(g)},e.unstable_next=function(q){switch(S){case 1:case 2:case 3:var K=3;break;default:K=S}var Q=S;S=K;try{return q()}finally{S=Q}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(q,K){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var Q=S;S=q;try{return K()}finally{S=Q}},e.unstable_scheduleCallback=function(q,K,Q){var L=e.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?L+Q:L):Q=L,q){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=Q+U,q={id:k++,callback:K,priorityLevel:q,startTime:Q,expirationTime:U,sortIndex:-1},Q>L?(q.sortIndex=Q,r(x,q),o(g)===null&&q===o(x)&&(P?(M(Y),Y=-1):P=!0,ue(O,Q-L))):(q.sortIndex=U,r(g,q),j||_||(j=!0,J(z))),q},e.unstable_shouldYield=ie,e.unstable_wrapCallback=function(q){var K=S;return function(){var Q=S;S=K;try{return q.apply(this,arguments)}finally{S=Q}}}})(md)),md}var hh;function nx(){return hh||(hh=1,hd.exports=tx()),hd.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 mh;function rx(){if(mh)return dr;mh=1;var e=Ya(),r=nx();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 d(t,n){c(t,n),c(t+"Capture",n)}function c(t,n){for(a[t]=n,t=0;t<n.length;t++)i.add(n[t])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g=Object.prototype.hasOwnProperty,x=/^[: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]*$/,k={},b={};function S(t){return g.call(b,t)?!0:g.call(k,t)?!1:x.test(t)?b[t]=!0:(k[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 P(t,n,s,u,m,v,E){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=u,this.attributeNamespace=m,this.mustUseProperty=s,this.propertyName=t,this.type=n,this.sanitizeURL=v,this.removeEmptyString=E}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){T[t]=new P(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var n=t[0];T[n]=new P(n,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){T[t]=new P(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){T[t]=new P(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){T[t]=new P(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){T[t]=new P(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){T[t]=new P(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){T[t]=new P(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){T[t]=new P(t,5,!1,t.toLowerCase(),null,!1,!1)});var M=/[\-:]([a-z])/g;function V(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(M,V);T[n]=new P(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(M,V);T[n]=new P(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(M,V);T[n]=new P(n,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){T[t]=new P(t,1,!1,t.toLowerCase(),null,!1,!1)}),T.xlinkHref=new P("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){T[t]=new P(t,1,!1,t.toLowerCase(),null,!0,!0)});function $(t,n,s,u){var m=T.hasOwnProperty(n)?T[n]:null;(m!==null?m.type!==0:u||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(j(n,s,m,u)&&(s=null),u||m===null?S(n)&&(s===null?t.removeAttribute(n):t.setAttribute(n,""+s)):m.mustUseProperty?t[m.propertyName]=s===null?m.type===3?!1:"":s:(n=m.attributeName,u=m.attributeNamespace,s===null?t.removeAttribute(n):(m=m.type,s=m===3||m===4&&s===!0?"":""+s,u?t.setAttributeNS(u,n,s):t.setAttribute(n,s))))}var O=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,z=Symbol.for("react.element"),R=Symbol.for("react.portal"),W=Symbol.for("react.fragment"),Y=Symbol.for("react.strict_mode"),le=Symbol.for("react.profiler"),we=Symbol.for("react.provider"),ie=Symbol.for("react.context"),de=Symbol.for("react.forward_ref"),te=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),ce=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),ue=Symbol.for("react.offscreen"),q=Symbol.iterator;function K(t){return t===null||typeof t!="object"?null:(t=q&&t[q]||t["@@iterator"],typeof t=="function"?t:null)}var Q=Object.assign,L;function U(t){if(L===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);L=n&&n[1]||""}return`
34
+ `+L+t}var je=!1;function Ne(t,n){if(!t||je)return"";je=!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(be){var u=be}Reflect.construct(t,[],n)}else{try{n.call()}catch(be){u=be}t.call(n.prototype)}else{try{throw Error()}catch(be){u=be}t()}}catch(be){if(be&&u&&typeof be.stack=="string"){for(var m=be.stack.split(`
35
+ `),v=u.stack.split(`
36
+ `),E=m.length-1,B=v.length-1;1<=E&&0<=B&&m[E]!==v[B];)B--;for(;1<=E&&0<=B;E--,B--)if(m[E]!==v[B]){if(E!==1||B!==1)do if(E--,B--,0>B||m[E]!==v[B]){var X=`
37
+ `+m[E].replace(" at new "," at ");return t.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",t.displayName)),X}while(1<=E&&0<=B);break}}}finally{je=!1,Error.prepareStackTrace=s}return(t=t?t.displayName||t.name:"")?U(t):""}function Re(t){switch(t.tag){case 5:return U(t.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return t=Ne(t.type,!1),t;case 11:return t=Ne(t.type.render,!1),t;case 1:return t=Ne(t.type,!0),t;default:return""}}function Oe(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 R:return"Portal";case le:return"Profiler";case Y:return"StrictMode";case te:return"Suspense";case F:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case ie:return(t.displayName||"Context")+".Consumer";case we:return(t._context.displayName||"Context")+".Provider";case de:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case ce:return n=t.displayName||null,n!==null?n:Oe(t.type)||"Memo";case J:n=t._payload,t=t._init;try{return Oe(t(n))}catch{}}return null}function Le(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 Oe(n);case 8:return n===Y?"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 ke(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function $e(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function _e(t){var n=$e(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 m=s.get,v=s.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return m.call(this)},set:function(E){u=""+E,v.call(this,E)}}),Object.defineProperty(t,n,{enumerable:s.enumerable}),{getValue:function(){return u},setValue:function(E){u=""+E},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function tt(t){t._valueTracker||(t._valueTracker=_e(t))}function ze(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var s=n.getValue(),u="";return t&&(u=$e(t)?t.checked?"true":"false":t.value),t=u,t!==s?(n.setValue(t),!0):!1}function Je(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 at(t,n){var s=n.checked;return Q({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??t._wrapperState.initialChecked})}function mt(t,n){var s=n.defaultValue==null?"":n.defaultValue,u=n.checked!=null?n.checked:n.defaultChecked;s=ke(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 ft(t,n){n=n.checked,n!=null&&$(t,"checked",n,!1)}function Mt(t,n){ft(t,n);var s=ke(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")?nn(t,n.type,s):n.hasOwnProperty("defaultValue")&&nn(t,n.type,ke(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(t.defaultChecked=!!n.defaultChecked)}function Xt(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 nn(t,n,s){(n!=="number"||Je(t.ownerDocument)!==t)&&(s==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+s&&(t.defaultValue=""+s))}var Ht=Array.isArray;function Dt(t,n,s,u){if(t=t.options,n){n={};for(var m=0;m<s.length;m++)n["$"+s[m]]=!0;for(s=0;s<t.length;s++)m=n.hasOwnProperty("$"+t[s].value),t[s].selected!==m&&(t[s].selected=m),m&&u&&(t[s].defaultSelected=!0)}else{for(s=""+ke(s),n=null,m=0;m<t.length;m++){if(t[m].value===s){t[m].selected=!0,u&&(t[m].defaultSelected=!0);return}n!==null||t[m].disabled||(n=t[m])}n!==null&&(n.selected=!0)}}function pn(t,n){if(n.dangerouslySetInnerHTML!=null)throw Error(o(91));return Q({},n,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function ln(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(Ht(s)){if(1<s.length)throw Error(o(93));s=s[0]}n=s}n==null&&(n=""),s=n}t._wrapperState={initialValue:ke(s)}}function An(t,n){var s=ke(n.value),u=ke(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 en(t){var n=t.textContent;n===t._wrapperState.initialValue&&n!==""&&n!==null&&(t.value=n)}function At(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 Rt(t,n){return t==null||t==="http://www.w3.org/1999/xhtml"?At(n):t==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var gn,Fn=(function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,s,u,m){MSApp.execUnsafeLocalFunction(function(){return t(n,s,u,m)})}:t})(function(t,n){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=n;else{for(gn=gn||document.createElement("div"),gn.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=gn.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;n.firstChild;)t.appendChild(n.firstChild)}});function un(t,n){if(n){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=n;return}}t.textContent=n}var ye={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(ye).forEach(function(t){ot.forEach(function(n){n=n+t.charAt(0).toUpperCase()+t.substring(1),ye[n]=ye[t]})});function pt(t,n,s){return n==null||typeof n=="boolean"||n===""?"":s||typeof n!="number"||n===0||ye.hasOwnProperty(t)&&ye[t]?(""+n).trim():n+"px"}function Ft(t,n){t=t.style;for(var s in n)if(n.hasOwnProperty(s)){var u=s.indexOf("--")===0,m=pt(s,n[s],u);s==="float"&&(s="cssFloat"),u?t.setProperty(s,m):t[s]=m}}var vt=Q({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(vt[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 bt(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 Tt=null;function yn(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var qe=null,zn=null,Bn=null;function Lr(t){if(t=ha(t)){if(typeof qe!="function")throw Error(o(280));var n=t.stateNode;n&&(n=gl(n),qe(t.stateNode,t.type,n))}}function wr(t){zn?Bn?Bn.push(t):Bn=[t]:zn=t}function Hr(){if(zn){var t=zn,n=Bn;if(Bn=zn=null,Lr(t),n)for(t=0;t<n.length;t++)Lr(n[t])}}function So(t,n){return t(n)}function br(){}var qn=!1;function jn(t,n,s){if(qn)return t(n,s);qn=!0;try{return So(t,n,s)}finally{qn=!1,(zn!==null||Bn!==null)&&(br(),Hr())}}function Xn(t,n){var s=t.stateNode;if(s===null)return null;var u=gl(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 In=!1;if(h)try{var _t={};Object.defineProperty(_t,"passive",{get:function(){In=!0}}),window.addEventListener("test",_t,_t),window.removeEventListener("test",_t,_t)}catch{In=!1}function zt(t,n,s,u,m,v,E,B,X){var be=Array.prototype.slice.call(arguments,3);try{n.apply(s,be)}catch(Me){this.onError(Me)}}var Sr=!1,Un=null,rn=!1,xn=null,Fr={onError:function(t){Sr=!0,Un=t}};function Qe(t,n,s,u,m,v,E,B,X){Sr=!1,Un=null,zt.apply(Fr,arguments)}function kr(t,n,s,u,m,v,E,B,X){if(Qe.apply(this,arguments),Sr){if(Sr){var be=Un;Sr=!1,Un=null}else throw Error(o(198));rn||(rn=!0,xn=be)}}function yt(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 Nr(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 ko(t){if(yt(t)!==t)throw Error(o(188))}function Cn(t){var n=t.alternate;if(!n){if(n=yt(t),n===null)throw Error(o(188));return n!==t?null:t}for(var s=t,u=n;;){var m=s.return;if(m===null)break;var v=m.alternate;if(v===null){if(u=m.return,u!==null){s=u;continue}break}if(m.child===v.child){for(v=m.child;v;){if(v===s)return ko(m),t;if(v===u)return ko(m),n;v=v.sibling}throw Error(o(188))}if(s.return!==u.return)s=m,u=v;else{for(var E=!1,B=m.child;B;){if(B===s){E=!0,s=m,u=v;break}if(B===u){E=!0,u=m,s=v;break}B=B.sibling}if(!E){for(B=v.child;B;){if(B===s){E=!0,s=v,u=m;break}if(B===u){E=!0,u=v,s=m;break}B=B.sibling}if(!E)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 Qn(t){return t=Cn(t),t!==null?Gn(t):null}function Gn(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var n=Gn(t);if(n!==null)return n;t=t.sibling}return null}var No=r.unstable_scheduleCallback,zr=r.unstable_cancelCallback,It=r.unstable_shouldYield,Vn=r.unstable_requestPaint,ct=r.unstable_now,Yo=r.unstable_getCurrentPriorityLevel,_r=r.unstable_ImmediatePriority,lo=r.unstable_UserBlockingPriority,jr=r.unstable_NormalPriority,pr=r.unstable_LowPriority,uo=r.unstable_IdlePriority,Zn=null,En=null;function wt(t){if(En&&typeof En.onCommitFiberRoot=="function")try{En.onCommitFiberRoot(Zn,t,void 0,(t.current.flags&128)===128)}catch{}}var vn=Math.clz32?Math.clz32:hr,Jo=Math.log,Kn=Math.LN2;function hr(t){return t>>>=0,t===0?32:31-(Jo(t)/Kn|0)|0}var Br=64,qr=4194304;function Wn(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 jt(t,n){var s=t.pendingLanes;if(s===0)return 0;var u=0,m=t.suspendedLanes,v=t.pingedLanes,E=s&268435455;if(E!==0){var B=E&~m;B!==0?u=Wn(B):(v&=E,v!==0&&(u=Wn(v)))}else E=s&~m,E!==0?u=Wn(E):v!==0&&(u=Wn(v));if(u===0)return 0;if(n!==0&&n!==u&&(n&m)===0&&(m=u&-u,v=n&-n,m>=v||m===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-vn(n),m=1<<s,u|=t[s],n&=~m;return u}function Cr(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 Ur(t,n){for(var s=t.suspendedLanes,u=t.pingedLanes,m=t.expirationTimes,v=t.pendingLanes;0<v;){var E=31-vn(v),B=1<<E,X=m[E];X===-1?((B&s)===0||(B&u)!==0)&&(m[E]=Cr(B,n)):X<=n&&(t.expiredLanes|=B),v&=~B}}function er(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Er(){var t=Br;return Br<<=1,(Br&4194240)===0&&(Br=64),t}function Pr(t){for(var n=[],s=0;31>s;s++)n.push(t);return n}function tr(t,n,s){t.pendingLanes|=n,n!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,n=31-vn(n),t[n]=s}function _o(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 m=31-vn(s),v=1<<m;n[m]=0,u[m]=-1,t[m]=-1,s&=~v}}function co(t,n){var s=t.entangledLanes|=n;for(t=t.entanglements;s;){var u=31-vn(s),m=1<<u;m&n|t[u]&n&&(t[u]|=n),s&=~m}}var Et=0;function ei(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var Nt,Xo,_s,ti,wn,Tr=!1,$r=[],on=null,nr=null,D=null,he=new Map,Ae=new Map,We=[],Ot="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 sn(t,n){switch(t){case"focusin":case"focusout":on=null;break;case"dragenter":case"dragleave":nr=null;break;case"mouseover":case"mouseout":D=null;break;case"pointerover":case"pointerout":he.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ae.delete(n.pointerId)}}function Bt(t,n,s,u,m,v){return t===null||t.nativeEvent!==v?(t={blockedOn:n,domEventName:s,eventSystemFlags:u,nativeEvent:v,targetContainers:[m]},n!==null&&(n=ha(n),n!==null&&Xo(n)),t):(t.eventSystemFlags|=u,n=t.targetContainers,m!==null&&n.indexOf(m)===-1&&n.push(m),t)}function rr(t,n,s,u,m){switch(n){case"focusin":return on=Bt(on,t,n,s,u,m),!0;case"dragenter":return nr=Bt(nr,t,n,s,u,m),!0;case"mouseover":return D=Bt(D,t,n,s,u,m),!0;case"pointerover":var v=m.pointerId;return he.set(v,Bt(he.get(v)||null,t,n,s,u,m)),!0;case"gotpointercapture":return v=m.pointerId,Ae.set(v,Bt(Ae.get(v)||null,t,n,s,u,m)),!0}return!1}function Lt(t){var n=As(t.target);if(n!==null){var s=yt(n);if(s!==null){if(n=s.tag,n===13){if(n=Nr(s),n!==null){t.blockedOn=n,wn(t.priority,function(){_s(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 Pn(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var s=Zo(t.domEventName,t.eventSystemFlags,n[0],t.nativeEvent);if(s===null){s=t.nativeEvent;var u=new s.constructor(s.type,s);Tt=u,s.target.dispatchEvent(u),Tt=null}else return n=ha(s),n!==null&&Xo(n),t.blockedOn=s,!1;n.shift()}return!0}function Qo(t,n,s){Pn(t)&&s.delete(n)}function Go(){Tr=!1,on!==null&&Pn(on)&&(on=null),nr!==null&&Pn(nr)&&(nr=null),D!==null&&Pn(D)&&(D=null),he.forEach(Qo),Ae.forEach(Qo)}function or(t,n){t.blockedOn===n&&(t.blockedOn=null,Tr||(Tr=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Go)))}function sr(t){function n(m){return or(m,t)}if(0<$r.length){or($r[0],t);for(var s=1;s<$r.length;s++){var u=$r[s];u.blockedOn===t&&(u.blockedOn=null)}}for(on!==null&&or(on,t),nr!==null&&or(nr,t),D!==null&&or(D,t),he.forEach(n),Ae.forEach(n),s=0;s<We.length;s++)u=We[s],u.blockedOn===t&&(u.blockedOn=null);for(;0<We.length&&(s=We[0],s.blockedOn===null);)Lt(s),s.blockedOn===null&&We.shift()}var Vr=O.ReactCurrentBatchConfig,ni=!0;function js(t,n,s,u){var m=Et,v=Vr.transition;Vr.transition=null;try{Et=1,Gi(t,n,s,u)}finally{Et=m,Vr.transition=v}}function Xu(t,n,s,u){var m=Et,v=Vr.transition;Vr.transition=null;try{Et=4,Gi(t,n,s,u)}finally{Et=m,Vr.transition=v}}function Gi(t,n,s,u){if(ni){var m=Zo(t,n,s,u);if(m===null)tc(t,n,u,jo,s),sn(t,u);else if(rr(m,t,n,s,u))u.stopPropagation();else if(sn(t,u),n&4&&-1<Ot.indexOf(t)){for(;m!==null;){var v=ha(m);if(v!==null&&Nt(v),v=Zo(t,n,s,u),v===null&&tc(t,n,u,jo,s),v===m)break;m=v}m!==null&&u.stopPropagation()}else tc(t,n,u,null,s)}}var jo=null;function Zo(t,n,s,u){if(jo=null,t=yn(u),t=As(t),t!==null)if(n=yt(t),n===null)t=null;else if(s=n.tag,s===13){if(t=Nr(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 jo=t,null}function ri(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(Yo()){case _r:return 1;case lo:return 4;case jr:case pr:return 16;case uo:return 536870912;default:return 16}default:return 16}}var fo=null,Zi=null,oi=null;function si(){if(oi)return oi;var t,n=Zi,s=n.length,u,m="value"in fo?fo.value:fo.textContent,v=m.length;for(t=0;t<s&&n[t]===m[t];t++);var E=s-t;for(u=1;u<=E&&n[s-u]===m[v-u];u++);return oi=m.slice(t,1<u?1-u:void 0)}function es(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 Cs(){return!0}function Es(){return!1}function bn(t){function n(s,u,m,v,E){this._reactName=s,this._targetInst=m,this.type=u,this.nativeEvent=v,this.target=E,this.currentTarget=null;for(var B in t)t.hasOwnProperty(B)&&(s=t[B],this[B]=s?s(v):v[B]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Cs:Es,this.isPropagationStopped=Es,this}return Q(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=Cs)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Cs)},persist:function(){},isPersistent:Cs}),n}var Kr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ii=bn(Kr),Ps=Q({},Kr,{view:0,detail:0}),ts=bn(Ps),Co,Ts,Eo,ns=Q({},Ps,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fi,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"?(Co=t.screenX-Eo.screenX,Ts=t.screenY-Eo.screenY):Ts=Co=0,Eo=t),Co)},movementY:function(t){return"movementY"in t?t.movementY:Ts}}),ai=bn(ns),Sn=Q({},ns,{dataTransfer:0}),$s=bn(Sn),Ms=Q({},Ps,{relatedTarget:0}),li=bn(Ms),ui=Q({},Kr,{animationName:0,elapsedTime:0,pseudoElement:0}),nl=bn(ui),rl=Q({},Kr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),ci=bn(rl),ea=Q({},Kr,{data:0}),po=bn(ea),ta={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},na={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"},di={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ra(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=di[t])?!!n[t]:!1}function fi(){return ra}var Qu=Q({},Ps,{key:function(t){if(t.key){var n=ta[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=es(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?na[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fi,charCode:function(t){return t.type==="keypress"?es(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?es(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),oa=bn(Qu),pi=Q({},ns,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ol=bn(pi),sa=Q({},Ps,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fi}),ia=bn(sa),Gu=Q({},Kr,{propertyName:0,elapsedTime:0,pseudoElement:0}),sl=bn(Gu),Zu=Q({},ns,{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}),il=bn(Zu),al=[9,13,27,32],aa=h&&"CompositionEvent"in window,rs=null;h&&"documentMode"in document&&(rs=document.documentMode);var la=h&&"TextEvent"in window&&!rs,ua=h&&(!aa||rs&&8<rs&&11>=rs),ca=" ",ll=!1;function ul(t,n){switch(t){case"keyup":return al.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cl(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Wr=!1;function Yr(t,n){switch(t){case"compositionend":return cl(n);case"keypress":return n.which!==32?null:(ll=!0,ca);case"textInput":return t=n.data,t===ca&&ll?null:t;default:return null}}function Qt(t,n){if(Wr)return t==="compositionend"||!aa&&ul(t,n)?(t=si(),oi=Zi=fo=null,Wr=!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 ua&&n.locale!=="ko"?null:n.data;default:return null}}var hi={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 Po(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!hi[t.type]:n==="textarea"}function dl(t,n,s,u){wr(u),n=pl(n,"onChange"),0<n.length&&(s=new ii("onChange","change",null,s,u),t.push({event:s,listeners:n}))}var To=null,os=null;function $o(t){_f(t,0)}function ss(t){var n=xi(t);if(ze(n))return t}function is(t,n){if(t==="change")return n}var Jr=!1;if(h){var mi;if(h){var l="oninput"in document;if(!l){var p=document.createElement("div");p.setAttribute("oninput","return;"),l=typeof p.oninput=="function"}mi=l}else mi=!1;Jr=mi&&(!document.documentMode||9<document.documentMode)}function y(){To&&(To.detachEvent("onpropertychange",w),os=To=null)}function w(t){if(t.propertyName==="value"&&ss(os)){var n=[];dl(n,os,t,yn(t)),jn($o,n)}}function N(t,n,s){t==="focusin"?(y(),To=n,os=s,To.attachEvent("onpropertychange",w)):t==="focusout"&&y()}function C(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return ss(os)}function A(t,n){if(t==="click")return ss(n)}function H(t,n){if(t==="input"||t==="change")return ss(n)}function Z(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var pe=typeof Object.is=="function"?Object.is:Z;function ne(t,n){if(pe(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 m=s[u];if(!g.call(n,m)||!pe(t[m],n[m]))return!1}return!0}function G(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function ee(t,n){var s=G(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=G(s)}}function fe(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?fe(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function se(){for(var t=window,n=Je();n instanceof t.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)t=n.contentWindow;else break;n=Je(t.document)}return n}function oe(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 ae(t){var n=se(),s=t.focusedElem,u=t.selectionRange;if(n!==s&&s&&s.ownerDocument&&fe(s.ownerDocument.documentElement,s)){if(u!==null&&oe(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 m=s.textContent.length,v=Math.min(u.start,m);u=u.end===void 0?v:Math.min(u.end,m),!t.extend&&v>u&&(m=u,u=v,v=m),m=ee(s,v);var E=ee(s,u);m&&E&&(t.rangeCount!==1||t.anchorNode!==m.node||t.anchorOffset!==m.offset||t.focusNode!==E.node||t.focusOffset!==E.offset)&&(n=n.createRange(),n.setStart(m.node,m.offset),t.removeAllRanges(),v>u?(t.addRange(n),t.extend(E.node,E.offset)):(n.setEnd(E.node,E.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 ve=h&&"documentMode"in document&&11>=document.documentMode,me=null,Se=null,Ce=null,Pe=!1;function Fe(t,n,s){var u=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Pe||me==null||me!==Je(u)||(u=me,"selectionStart"in u&&oe(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Ce&&ne(Ce,u)||(Ce=u,u=pl(Se,"onSelect"),0<u.length&&(n=new ii("onSelect","select",null,n,s),t.push({event:n,listeners:u}),n.target=me)))}function Ie(t,n){var s={};return s[t.toLowerCase()]=n.toLowerCase(),s["Webkit"+t]="webkit"+n,s["Moz"+t]="moz"+n,s}var Ve={animationend:Ie("Animation","AnimationEnd"),animationiteration:Ie("Animation","AnimationIteration"),animationstart:Ie("Animation","AnimationStart"),transitionend:Ie("Transition","TransitionEnd")},He={},Ye={};h&&(Ye=document.createElement("div").style,"AnimationEvent"in window||(delete Ve.animationend.animation,delete Ve.animationiteration.animation,delete Ve.animationstart.animation),"TransitionEvent"in window||delete Ve.transitionend.transition);function Ee(t){if(He[t])return He[t];if(!Ve[t])return t;var n=Ve[t],s;for(s in n)if(n.hasOwnProperty(s)&&s in Ye)return He[t]=n[s];return t}var lt=Ee("animationend"),ut=Ee("animationiteration"),gt=Ee("animationstart"),St=Ee("transitionend"),On=new Map,ht="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 Ut(t,n){On.set(t,n),d(n,[t])}for(var cn=0;cn<ht.length;cn++){var as=ht[cn],Tn=as.toLowerCase(),Mo=as[0].toUpperCase()+as.slice(1);Ut(Tn,"on"+Mo)}Ut(lt,"onAnimationEnd"),Ut(ut,"onAnimationIteration"),Ut(gt,"onAnimationStart"),Ut("dblclick","onDoubleClick"),Ut("focusin","onFocus"),Ut("focusout","onBlur"),Ut(St,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),d("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),d("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),d("onBeforeInput",["compositionend","keypress","textInput","paste"]),d("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),d("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),d("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ao="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(" "),iy=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ao));function Nf(t,n,s){var u=t.type||"unknown-event";t.currentTarget=s,kr(u,n,void 0,t),t.currentTarget=null}function _f(t,n){n=(n&4)!==0;for(var s=0;s<t.length;s++){var u=t[s],m=u.event;u=u.listeners;e:{var v=void 0;if(n)for(var E=u.length-1;0<=E;E--){var B=u[E],X=B.instance,be=B.currentTarget;if(B=B.listener,X!==v&&m.isPropagationStopped())break e;Nf(m,B,be),v=X}else for(E=0;E<u.length;E++){if(B=u[E],X=B.instance,be=B.currentTarget,B=B.listener,X!==v&&m.isPropagationStopped())break e;Nf(m,B,be),v=X}}}if(rn)throw t=xn,rn=!1,xn=null,t}function Vt(t,n){var s=n[ac];s===void 0&&(s=n[ac]=new Set);var u=t+"__bubble";s.has(u)||(jf(n,t,2,!1),s.add(u))}function ec(t,n,s){var u=0;n&&(u|=4),jf(s,t,u,n)}var fl="_reactListening"+Math.random().toString(36).slice(2);function da(t){if(!t[fl]){t[fl]=!0,i.forEach(function(s){s!=="selectionchange"&&(iy.has(s)||ec(s,!1,t),ec(s,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[fl]||(n[fl]=!0,ec("selectionchange",!1,n))}}function jf(t,n,s,u){switch(ri(n)){case 1:var m=js;break;case 4:m=Xu;break;default:m=Gi}s=m.bind(null,n,s,t),m=void 0,!In||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(m=!0),u?m!==void 0?t.addEventListener(n,s,{capture:!0,passive:m}):t.addEventListener(n,s,!0):m!==void 0?t.addEventListener(n,s,{passive:m}):t.addEventListener(n,s,!1)}function tc(t,n,s,u,m){var v=u;if((n&1)===0&&(n&2)===0&&u!==null)e:for(;;){if(u===null)return;var E=u.tag;if(E===3||E===4){var B=u.stateNode.containerInfo;if(B===m||B.nodeType===8&&B.parentNode===m)break;if(E===4)for(E=u.return;E!==null;){var X=E.tag;if((X===3||X===4)&&(X=E.stateNode.containerInfo,X===m||X.nodeType===8&&X.parentNode===m))return;E=E.return}for(;B!==null;){if(E=As(B),E===null)return;if(X=E.tag,X===5||X===6){u=v=E;continue e}B=B.parentNode}}u=u.return}jn(function(){var be=v,Me=yn(s),De=[];e:{var Te=On.get(t);if(Te!==void 0){var Ke=ii,Ge=t;switch(t){case"keypress":if(es(s)===0)break e;case"keydown":case"keyup":Ke=oa;break;case"focusin":Ge="focus",Ke=li;break;case"focusout":Ge="blur",Ke=li;break;case"beforeblur":case"afterblur":Ke=li;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":Ke=ai;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ke=$s;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ke=ia;break;case lt:case ut:case gt:Ke=nl;break;case St:Ke=sl;break;case"scroll":Ke=ts;break;case"wheel":Ke=il;break;case"copy":case"cut":case"paste":Ke=ci;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ke=ol}var et=(n&4)!==0,an=!et&&t==="scroll",ge=et?Te!==null?Te+"Capture":null:Te;et=[];for(var re=be,xe;re!==null;){xe=re;var Be=xe.stateNode;if(xe.tag===5&&Be!==null&&(xe=Be,ge!==null&&(Be=Xn(re,ge),Be!=null&&et.push(fa(re,Be,xe)))),an)break;re=re.return}0<et.length&&(Te=new Ke(Te,Ge,null,s,Me),De.push({event:Te,listeners:et}))}}if((n&7)===0){e:{if(Te=t==="mouseover"||t==="pointerover",Ke=t==="mouseout"||t==="pointerout",Te&&s!==Tt&&(Ge=s.relatedTarget||s.fromElement)&&(As(Ge)||Ge[Io]))break e;if((Ke||Te)&&(Te=Me.window===Me?Me:(Te=Me.ownerDocument)?Te.defaultView||Te.parentWindow:window,Ke?(Ge=s.relatedTarget||s.toElement,Ke=be,Ge=Ge?As(Ge):null,Ge!==null&&(an=yt(Ge),Ge!==an||Ge.tag!==5&&Ge.tag!==6)&&(Ge=null)):(Ke=null,Ge=be),Ke!==Ge)){if(et=ai,Be="onMouseLeave",ge="onMouseEnter",re="mouse",(t==="pointerout"||t==="pointerover")&&(et=ol,Be="onPointerLeave",ge="onPointerEnter",re="pointer"),an=Ke==null?Te:xi(Ke),xe=Ge==null?Te:xi(Ge),Te=new et(Be,re+"leave",Ke,s,Me),Te.target=an,Te.relatedTarget=xe,Be=null,As(Me)===be&&(et=new et(ge,re+"enter",Ge,s,Me),et.target=xe,et.relatedTarget=an,Be=et),an=Be,Ke&&Ge)t:{for(et=Ke,ge=Ge,re=0,xe=et;xe;xe=gi(xe))re++;for(xe=0,Be=ge;Be;Be=gi(Be))xe++;for(;0<re-xe;)et=gi(et),re--;for(;0<xe-re;)ge=gi(ge),xe--;for(;re--;){if(et===ge||ge!==null&&et===ge.alternate)break t;et=gi(et),ge=gi(ge)}et=null}else et=null;Ke!==null&&Cf(De,Te,Ke,et,!1),Ge!==null&&an!==null&&Cf(De,an,Ge,et,!0)}}e:{if(Te=be?xi(be):window,Ke=Te.nodeName&&Te.nodeName.toLowerCase(),Ke==="select"||Ke==="input"&&Te.type==="file")var nt=is;else if(Po(Te))if(Jr)nt=H;else{nt=C;var st=N}else(Ke=Te.nodeName)&&Ke.toLowerCase()==="input"&&(Te.type==="checkbox"||Te.type==="radio")&&(nt=A);if(nt&&(nt=nt(t,be))){dl(De,nt,s,Me);break e}st&&st(t,Te,be),t==="focusout"&&(st=Te._wrapperState)&&st.controlled&&Te.type==="number"&&nn(Te,"number",Te.value)}switch(st=be?xi(be):window,t){case"focusin":(Po(st)||st.contentEditable==="true")&&(me=st,Se=be,Ce=null);break;case"focusout":Ce=Se=me=null;break;case"mousedown":Pe=!0;break;case"contextmenu":case"mouseup":case"dragend":Pe=!1,Fe(De,s,Me);break;case"selectionchange":if(ve)break;case"keydown":case"keyup":Fe(De,s,Me)}var it;if(aa)e:{switch(t){case"compositionstart":var dt="onCompositionStart";break e;case"compositionend":dt="onCompositionEnd";break e;case"compositionupdate":dt="onCompositionUpdate";break e}dt=void 0}else Wr?ul(t,s)&&(dt="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(dt="onCompositionStart");dt&&(ua&&s.locale!=="ko"&&(Wr||dt!=="onCompositionStart"?dt==="onCompositionEnd"&&Wr&&(it=si()):(fo=Me,Zi="value"in fo?fo.value:fo.textContent,Wr=!0)),st=pl(be,dt),0<st.length&&(dt=new po(dt,t,null,s,Me),De.push({event:dt,listeners:st}),it?dt.data=it:(it=cl(s),it!==null&&(dt.data=it)))),(it=la?Yr(t,s):Qt(t,s))&&(be=pl(be,"onBeforeInput"),0<be.length&&(Me=new po("onBeforeInput","beforeinput",null,s,Me),De.push({event:Me,listeners:be}),Me.data=it))}_f(De,n)})}function fa(t,n,s){return{instance:t,listener:n,currentTarget:s}}function pl(t,n){for(var s=n+"Capture",u=[];t!==null;){var m=t,v=m.stateNode;m.tag===5&&v!==null&&(m=v,v=Xn(t,s),v!=null&&u.unshift(fa(t,v,m)),v=Xn(t,n),v!=null&&u.push(fa(t,v,m))),t=t.return}return u}function gi(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Cf(t,n,s,u,m){for(var v=n._reactName,E=[];s!==null&&s!==u;){var B=s,X=B.alternate,be=B.stateNode;if(X!==null&&X===u)break;B.tag===5&&be!==null&&(B=be,m?(X=Xn(s,v),X!=null&&E.unshift(fa(s,X,B))):m||(X=Xn(s,v),X!=null&&E.push(fa(s,X,B)))),s=s.return}E.length!==0&&t.push({event:n,listeners:E})}var ay=/\r\n?/g,ly=/\u0000|\uFFFD/g;function Ef(t){return(typeof t=="string"?t:""+t).replace(ay,`
38
+ `).replace(ly,"")}function hl(t,n,s){if(n=Ef(n),Ef(t)!==n&&s)throw Error(o(425))}function ml(){}var nc=null,rc=null;function oc(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 sc=typeof setTimeout=="function"?setTimeout:void 0,uy=typeof clearTimeout=="function"?clearTimeout:void 0,Pf=typeof Promise=="function"?Promise:void 0,cy=typeof queueMicrotask=="function"?queueMicrotask:typeof Pf<"u"?function(t){return Pf.resolve(null).then(t).catch(dy)}:sc;function dy(t){setTimeout(function(){throw t})}function ic(t,n){var s=n,u=0;do{var m=s.nextSibling;if(t.removeChild(s),m&&m.nodeType===8)if(s=m.data,s==="/$"){if(u===0){t.removeChild(m),sr(n);return}u--}else s!=="$"&&s!=="$?"&&s!=="$!"||u++;s=m}while(s);sr(n)}function ls(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 Tf(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 yi=Math.random().toString(36).slice(2),ho="__reactFiber$"+yi,pa="__reactProps$"+yi,Io="__reactContainer$"+yi,ac="__reactEvents$"+yi,fy="__reactListeners$"+yi,py="__reactHandles$"+yi;function As(t){var n=t[ho];if(n)return n;for(var s=t.parentNode;s;){if(n=s[Io]||s[ho]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(t=Tf(t);t!==null;){if(s=t[ho])return s;t=Tf(t)}return n}t=s,s=t.parentNode}return null}function ha(t){return t=t[ho]||t[Io],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function xi(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(o(33))}function gl(t){return t[pa]||null}var lc=[],vi=-1;function us(t){return{current:t}}function Kt(t){0>vi||(t.current=lc[vi],lc[vi]=null,vi--)}function qt(t,n){vi++,lc[vi]=t.current,t.current=n}var cs={},Dn=us(cs),ir=us(!1),Is=cs;function wi(t,n){var s=t.type.contextTypes;if(!s)return cs;var u=t.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===n)return u.__reactInternalMemoizedMaskedChildContext;var m={},v;for(v in s)m[v]=n[v];return u&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=n,t.__reactInternalMemoizedMaskedChildContext=m),m}function ar(t){return t=t.childContextTypes,t!=null}function yl(){Kt(ir),Kt(Dn)}function $f(t,n,s){if(Dn.current!==cs)throw Error(o(168));qt(Dn,n),qt(ir,s)}function Mf(t,n,s){var u=t.stateNode;if(n=n.childContextTypes,typeof u.getChildContext!="function")return s;u=u.getChildContext();for(var m in u)if(!(m in n))throw Error(o(108,Le(t)||"Unknown",m));return Q({},s,u)}function xl(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||cs,Is=Dn.current,qt(Dn,t),qt(ir,ir.current),!0}function Af(t,n,s){var u=t.stateNode;if(!u)throw Error(o(169));s?(t=Mf(t,n,Is),u.__reactInternalMemoizedMergedChildContext=t,Kt(ir),Kt(Dn),qt(Dn,t)):Kt(ir),qt(ir,s)}var Oo=null,vl=!1,uc=!1;function If(t){Oo===null?Oo=[t]:Oo.push(t)}function hy(t){vl=!0,If(t)}function ds(){if(!uc&&Oo!==null){uc=!0;var t=0,n=Et;try{var s=Oo;for(Et=1;t<s.length;t++){var u=s[t];do u=u(!0);while(u!==null)}Oo=null,vl=!1}catch(m){throw Oo!==null&&(Oo=Oo.slice(t+1)),No(_r,ds),m}finally{Et=n,uc=!1}}return null}var bi=[],Si=0,wl=null,bl=0,Mr=[],Ar=0,Os=null,Do=1,Ro="";function Ds(t,n){bi[Si++]=bl,bi[Si++]=wl,wl=t,bl=n}function Of(t,n,s){Mr[Ar++]=Do,Mr[Ar++]=Ro,Mr[Ar++]=Os,Os=t;var u=Do;t=Ro;var m=32-vn(u)-1;u&=~(1<<m),s+=1;var v=32-vn(n)+m;if(30<v){var E=m-m%5;v=(u&(1<<E)-1).toString(32),u>>=E,m-=E,Do=1<<32-vn(n)+m|s<<m|u,Ro=v+t}else Do=1<<v|s<<m|u,Ro=t}function cc(t){t.return!==null&&(Ds(t,1),Of(t,1,0))}function dc(t){for(;t===wl;)wl=bi[--Si],bi[Si]=null,bl=bi[--Si],bi[Si]=null;for(;t===Os;)Os=Mr[--Ar],Mr[Ar]=null,Ro=Mr[--Ar],Mr[Ar]=null,Do=Mr[--Ar],Mr[Ar]=null}var mr=null,gr=null,Yt=!1,Xr=null;function Df(t,n){var s=Rr(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 Rf(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,mr=t,gr=ls(n.firstChild),!0):!1;case 6:return n=t.pendingProps===""||n.nodeType!==3?null:n,n!==null?(t.stateNode=n,mr=t,gr=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(s=Os!==null?{id:Do,overflow:Ro}:null,t.memoizedState={dehydrated:n,treeContext:s,retryLane:1073741824},s=Rr(18,null,null,0),s.stateNode=n,s.return=t,t.child=s,mr=t,gr=null,!0):!1;default:return!1}}function fc(t){return(t.mode&1)!==0&&(t.flags&128)===0}function pc(t){if(Yt){var n=gr;if(n){var s=n;if(!Rf(t,n)){if(fc(t))throw Error(o(418));n=ls(s.nextSibling);var u=mr;n&&Rf(t,n)?Df(u,s):(t.flags=t.flags&-4097|2,Yt=!1,mr=t)}}else{if(fc(t))throw Error(o(418));t.flags=t.flags&-4097|2,Yt=!1,mr=t}}}function Lf(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;mr=t}function Sl(t){if(t!==mr)return!1;if(!Yt)return Lf(t),Yt=!0,!1;var n;if((n=t.tag!==3)&&!(n=t.tag!==5)&&(n=t.type,n=n!=="head"&&n!=="body"&&!oc(t.type,t.memoizedProps)),n&&(n=gr)){if(fc(t))throw Hf(),Error(o(418));for(;n;)Df(t,n),n=ls(n.nextSibling)}if(Lf(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){gr=ls(t.nextSibling);break e}n--}else s!=="$"&&s!=="$!"&&s!=="$?"||n++}t=t.nextSibling}gr=null}}else gr=mr?ls(t.stateNode.nextSibling):null;return!0}function Hf(){for(var t=gr;t;)t=ls(t.nextSibling)}function ki(){gr=mr=null,Yt=!1}function hc(t){Xr===null?Xr=[t]:Xr.push(t)}var my=O.ReactCurrentBatchConfig;function ma(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 m=u,v=""+t;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===v?n.ref:(n=function(E){var B=m.refs;E===null?delete B[v]:B[v]=E},n._stringRef=v,n)}if(typeof t!="string")throw Error(o(284));if(!s._owner)throw Error(o(290,t))}return t}function kl(t,n){throw t=Object.prototype.toString.call(n),Error(o(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t))}function Ff(t){var n=t._init;return n(t._payload)}function zf(t){function n(ge,re){if(t){var xe=ge.deletions;xe===null?(ge.deletions=[re],ge.flags|=16):xe.push(re)}}function s(ge,re){if(!t)return null;for(;re!==null;)n(ge,re),re=re.sibling;return null}function u(ge,re){for(ge=new Map;re!==null;)re.key!==null?ge.set(re.key,re):ge.set(re.index,re),re=re.sibling;return ge}function m(ge,re){return ge=vs(ge,re),ge.index=0,ge.sibling=null,ge}function v(ge,re,xe){return ge.index=xe,t?(xe=ge.alternate,xe!==null?(xe=xe.index,xe<re?(ge.flags|=2,re):xe):(ge.flags|=2,re)):(ge.flags|=1048576,re)}function E(ge){return t&&ge.alternate===null&&(ge.flags|=2),ge}function B(ge,re,xe,Be){return re===null||re.tag!==6?(re=sd(xe,ge.mode,Be),re.return=ge,re):(re=m(re,xe),re.return=ge,re)}function X(ge,re,xe,Be){var nt=xe.type;return nt===W?Me(ge,re,xe.props.children,Be,xe.key):re!==null&&(re.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===J&&Ff(nt)===re.type)?(Be=m(re,xe.props),Be.ref=ma(ge,re,xe),Be.return=ge,Be):(Be=Wl(xe.type,xe.key,xe.props,null,ge.mode,Be),Be.ref=ma(ge,re,xe),Be.return=ge,Be)}function be(ge,re,xe,Be){return re===null||re.tag!==4||re.stateNode.containerInfo!==xe.containerInfo||re.stateNode.implementation!==xe.implementation?(re=id(xe,ge.mode,Be),re.return=ge,re):(re=m(re,xe.children||[]),re.return=ge,re)}function Me(ge,re,xe,Be,nt){return re===null||re.tag!==7?(re=Us(xe,ge.mode,Be,nt),re.return=ge,re):(re=m(re,xe),re.return=ge,re)}function De(ge,re,xe){if(typeof re=="string"&&re!==""||typeof re=="number")return re=sd(""+re,ge.mode,xe),re.return=ge,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case z:return xe=Wl(re.type,re.key,re.props,null,ge.mode,xe),xe.ref=ma(ge,null,re),xe.return=ge,xe;case R:return re=id(re,ge.mode,xe),re.return=ge,re;case J:var Be=re._init;return De(ge,Be(re._payload),xe)}if(Ht(re)||K(re))return re=Us(re,ge.mode,xe,null),re.return=ge,re;kl(ge,re)}return null}function Te(ge,re,xe,Be){var nt=re!==null?re.key:null;if(typeof xe=="string"&&xe!==""||typeof xe=="number")return nt!==null?null:B(ge,re,""+xe,Be);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case z:return xe.key===nt?X(ge,re,xe,Be):null;case R:return xe.key===nt?be(ge,re,xe,Be):null;case J:return nt=xe._init,Te(ge,re,nt(xe._payload),Be)}if(Ht(xe)||K(xe))return nt!==null?null:Me(ge,re,xe,Be,null);kl(ge,xe)}return null}function Ke(ge,re,xe,Be,nt){if(typeof Be=="string"&&Be!==""||typeof Be=="number")return ge=ge.get(xe)||null,B(re,ge,""+Be,nt);if(typeof Be=="object"&&Be!==null){switch(Be.$$typeof){case z:return ge=ge.get(Be.key===null?xe:Be.key)||null,X(re,ge,Be,nt);case R:return ge=ge.get(Be.key===null?xe:Be.key)||null,be(re,ge,Be,nt);case J:var st=Be._init;return Ke(ge,re,xe,st(Be._payload),nt)}if(Ht(Be)||K(Be))return ge=ge.get(xe)||null,Me(re,ge,Be,nt,null);kl(re,Be)}return null}function Ge(ge,re,xe,Be){for(var nt=null,st=null,it=re,dt=re=0,_n=null;it!==null&&dt<xe.length;dt++){it.index>dt?(_n=it,it=null):_n=it.sibling;var $t=Te(ge,it,xe[dt],Be);if($t===null){it===null&&(it=_n);break}t&&it&&$t.alternate===null&&n(ge,it),re=v($t,re,dt),st===null?nt=$t:st.sibling=$t,st=$t,it=_n}if(dt===xe.length)return s(ge,it),Yt&&Ds(ge,dt),nt;if(it===null){for(;dt<xe.length;dt++)it=De(ge,xe[dt],Be),it!==null&&(re=v(it,re,dt),st===null?nt=it:st.sibling=it,st=it);return Yt&&Ds(ge,dt),nt}for(it=u(ge,it);dt<xe.length;dt++)_n=Ke(it,ge,dt,xe[dt],Be),_n!==null&&(t&&_n.alternate!==null&&it.delete(_n.key===null?dt:_n.key),re=v(_n,re,dt),st===null?nt=_n:st.sibling=_n,st=_n);return t&&it.forEach(function(ws){return n(ge,ws)}),Yt&&Ds(ge,dt),nt}function et(ge,re,xe,Be){var nt=K(xe);if(typeof nt!="function")throw Error(o(150));if(xe=nt.call(xe),xe==null)throw Error(o(151));for(var st=nt=null,it=re,dt=re=0,_n=null,$t=xe.next();it!==null&&!$t.done;dt++,$t=xe.next()){it.index>dt?(_n=it,it=null):_n=it.sibling;var ws=Te(ge,it,$t.value,Be);if(ws===null){it===null&&(it=_n);break}t&&it&&ws.alternate===null&&n(ge,it),re=v(ws,re,dt),st===null?nt=ws:st.sibling=ws,st=ws,it=_n}if($t.done)return s(ge,it),Yt&&Ds(ge,dt),nt;if(it===null){for(;!$t.done;dt++,$t=xe.next())$t=De(ge,$t.value,Be),$t!==null&&(re=v($t,re,dt),st===null?nt=$t:st.sibling=$t,st=$t);return Yt&&Ds(ge,dt),nt}for(it=u(ge,it);!$t.done;dt++,$t=xe.next())$t=Ke(it,ge,dt,$t.value,Be),$t!==null&&(t&&$t.alternate!==null&&it.delete($t.key===null?dt:$t.key),re=v($t,re,dt),st===null?nt=$t:st.sibling=$t,st=$t);return t&&it.forEach(function(Yy){return n(ge,Yy)}),Yt&&Ds(ge,dt),nt}function an(ge,re,xe,Be){if(typeof xe=="object"&&xe!==null&&xe.type===W&&xe.key===null&&(xe=xe.props.children),typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case z:e:{for(var nt=xe.key,st=re;st!==null;){if(st.key===nt){if(nt=xe.type,nt===W){if(st.tag===7){s(ge,st.sibling),re=m(st,xe.props.children),re.return=ge,ge=re;break e}}else if(st.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===J&&Ff(nt)===st.type){s(ge,st.sibling),re=m(st,xe.props),re.ref=ma(ge,st,xe),re.return=ge,ge=re;break e}s(ge,st);break}else n(ge,st);st=st.sibling}xe.type===W?(re=Us(xe.props.children,ge.mode,Be,xe.key),re.return=ge,ge=re):(Be=Wl(xe.type,xe.key,xe.props,null,ge.mode,Be),Be.ref=ma(ge,re,xe),Be.return=ge,ge=Be)}return E(ge);case R:e:{for(st=xe.key;re!==null;){if(re.key===st)if(re.tag===4&&re.stateNode.containerInfo===xe.containerInfo&&re.stateNode.implementation===xe.implementation){s(ge,re.sibling),re=m(re,xe.children||[]),re.return=ge,ge=re;break e}else{s(ge,re);break}else n(ge,re);re=re.sibling}re=id(xe,ge.mode,Be),re.return=ge,ge=re}return E(ge);case J:return st=xe._init,an(ge,re,st(xe._payload),Be)}if(Ht(xe))return Ge(ge,re,xe,Be);if(K(xe))return et(ge,re,xe,Be);kl(ge,xe)}return typeof xe=="string"&&xe!==""||typeof xe=="number"?(xe=""+xe,re!==null&&re.tag===6?(s(ge,re.sibling),re=m(re,xe),re.return=ge,ge=re):(s(ge,re),re=sd(xe,ge.mode,Be),re.return=ge,ge=re),E(ge)):s(ge,re)}return an}var Ni=zf(!0),Bf=zf(!1),Nl=us(null),_l=null,_i=null,mc=null;function gc(){mc=_i=_l=null}function yc(t){var n=Nl.current;Kt(Nl),t._currentValue=n}function xc(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 ji(t,n){_l=t,mc=_i=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&n)!==0&&(lr=!0),t.firstContext=null)}function Ir(t){var n=t._currentValue;if(mc!==t)if(t={context:t,memoizedValue:n,next:null},_i===null){if(_l===null)throw Error(o(308));_i=t,_l.dependencies={lanes:0,firstContext:t}}else _i=_i.next=t;return n}var Rs=null;function vc(t){Rs===null?Rs=[t]:Rs.push(t)}function qf(t,n,s,u){var m=n.interleaved;return m===null?(s.next=s,vc(n)):(s.next=m.next,m.next=s),n.interleaved=s,Lo(t,u)}function Lo(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 fs=!1;function wc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Uf(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 Ho(t,n){return{eventTime:t,lane:n,tag:0,payload:null,callback:null,next:null}}function ps(t,n,s){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,(Pt&2)!==0){var m=u.pending;return m===null?n.next=n:(n.next=m.next,m.next=n),u.pending=n,Lo(t,s)}return m=u.interleaved,m===null?(n.next=n,vc(u)):(n.next=m.next,m.next=n),u.interleaved=n,Lo(t,s)}function jl(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,co(t,s)}}function Vf(t,n){var s=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,s===u)){var m=null,v=null;if(s=s.firstBaseUpdate,s!==null){do{var E={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};v===null?m=v=E:v=v.next=E,s=s.next}while(s!==null);v===null?m=v=n:v=v.next=n}else m=v=n;s={baseState:u.baseState,firstBaseUpdate:m,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 Cl(t,n,s,u){var m=t.updateQueue;fs=!1;var v=m.firstBaseUpdate,E=m.lastBaseUpdate,B=m.shared.pending;if(B!==null){m.shared.pending=null;var X=B,be=X.next;X.next=null,E===null?v=be:E.next=be,E=X;var Me=t.alternate;Me!==null&&(Me=Me.updateQueue,B=Me.lastBaseUpdate,B!==E&&(B===null?Me.firstBaseUpdate=be:B.next=be,Me.lastBaseUpdate=X))}if(v!==null){var De=m.baseState;E=0,Me=be=X=null,B=v;do{var Te=B.lane,Ke=B.eventTime;if((u&Te)===Te){Me!==null&&(Me=Me.next={eventTime:Ke,lane:0,tag:B.tag,payload:B.payload,callback:B.callback,next:null});e:{var Ge=t,et=B;switch(Te=n,Ke=s,et.tag){case 1:if(Ge=et.payload,typeof Ge=="function"){De=Ge.call(Ke,De,Te);break e}De=Ge;break e;case 3:Ge.flags=Ge.flags&-65537|128;case 0:if(Ge=et.payload,Te=typeof Ge=="function"?Ge.call(Ke,De,Te):Ge,Te==null)break e;De=Q({},De,Te);break e;case 2:fs=!0}}B.callback!==null&&B.lane!==0&&(t.flags|=64,Te=m.effects,Te===null?m.effects=[B]:Te.push(B))}else Ke={eventTime:Ke,lane:Te,tag:B.tag,payload:B.payload,callback:B.callback,next:null},Me===null?(be=Me=Ke,X=De):Me=Me.next=Ke,E|=Te;if(B=B.next,B===null){if(B=m.shared.pending,B===null)break;Te=B,B=Te.next,Te.next=null,m.lastBaseUpdate=Te,m.shared.pending=null}}while(!0);if(Me===null&&(X=De),m.baseState=X,m.firstBaseUpdate=be,m.lastBaseUpdate=Me,n=m.shared.interleaved,n!==null){m=n;do E|=m.lane,m=m.next;while(m!==n)}else v===null&&(m.shared.lanes=0);Fs|=E,t.lanes=E,t.memoizedState=De}}function Kf(t,n,s){if(t=n.effects,n.effects=null,t!==null)for(n=0;n<t.length;n++){var u=t[n],m=u.callback;if(m!==null){if(u.callback=null,u=s,typeof m!="function")throw Error(o(191,m));m.call(u)}}}var ga={},mo=us(ga),ya=us(ga),xa=us(ga);function Ls(t){if(t===ga)throw Error(o(174));return t}function bc(t,n){switch(qt(xa,n),qt(ya,t),qt(mo,ga),t=n.nodeType,t){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:Rt(null,"");break;default:t=t===8?n.parentNode:n,n=t.namespaceURI||null,t=t.tagName,n=Rt(n,t)}Kt(mo),qt(mo,n)}function Ci(){Kt(mo),Kt(ya),Kt(xa)}function Wf(t){Ls(xa.current);var n=Ls(mo.current),s=Rt(n,t.type);n!==s&&(qt(ya,t),qt(mo,s))}function Sc(t){ya.current===t&&(Kt(mo),Kt(ya))}var Gt=us(0);function El(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 kc=[];function Nc(){for(var t=0;t<kc.length;t++)kc[t]._workInProgressVersionPrimary=null;kc.length=0}var Pl=O.ReactCurrentDispatcher,_c=O.ReactCurrentBatchConfig,Hs=0,Zt=null,hn=null,kn=null,Tl=!1,va=!1,wa=0,gy=0;function Rn(){throw Error(o(321))}function jc(t,n){if(n===null)return!1;for(var s=0;s<n.length&&s<t.length;s++)if(!pe(t[s],n[s]))return!1;return!0}function Cc(t,n,s,u,m,v){if(Hs=v,Zt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,Pl.current=t===null||t.memoizedState===null?wy:by,t=s(u,m),va){v=0;do{if(va=!1,wa=0,25<=v)throw Error(o(301));v+=1,kn=hn=null,n.updateQueue=null,Pl.current=Sy,t=s(u,m)}while(va)}if(Pl.current=Al,n=hn!==null&&hn.next!==null,Hs=0,kn=hn=Zt=null,Tl=!1,n)throw Error(o(300));return t}function Ec(){var t=wa!==0;return wa=0,t}function go(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return kn===null?Zt.memoizedState=kn=t:kn=kn.next=t,kn}function Or(){if(hn===null){var t=Zt.alternate;t=t!==null?t.memoizedState:null}else t=hn.next;var n=kn===null?Zt.memoizedState:kn.next;if(n!==null)kn=n,hn=t;else{if(t===null)throw Error(o(310));hn=t,t={memoizedState:hn.memoizedState,baseState:hn.baseState,baseQueue:hn.baseQueue,queue:hn.queue,next:null},kn===null?Zt.memoizedState=kn=t:kn=kn.next=t}return kn}function ba(t,n){return typeof n=="function"?n(t):n}function Pc(t){var n=Or(),s=n.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=t;var u=hn,m=u.baseQueue,v=s.pending;if(v!==null){if(m!==null){var E=m.next;m.next=v.next,v.next=E}u.baseQueue=m=v,s.pending=null}if(m!==null){v=m.next,u=u.baseState;var B=E=null,X=null,be=v;do{var Me=be.lane;if((Hs&Me)===Me)X!==null&&(X=X.next={lane:0,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null}),u=be.hasEagerState?be.eagerState:t(u,be.action);else{var De={lane:Me,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null};X===null?(B=X=De,E=u):X=X.next=De,Zt.lanes|=Me,Fs|=Me}be=be.next}while(be!==null&&be!==v);X===null?E=u:X.next=B,pe(u,n.memoizedState)||(lr=!0),n.memoizedState=u,n.baseState=E,n.baseQueue=X,s.lastRenderedState=u}if(t=s.interleaved,t!==null){m=t;do v=m.lane,Zt.lanes|=v,Fs|=v,m=m.next;while(m!==t)}else m===null&&(s.lanes=0);return[n.memoizedState,s.dispatch]}function Tc(t){var n=Or(),s=n.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=t;var u=s.dispatch,m=s.pending,v=n.memoizedState;if(m!==null){s.pending=null;var E=m=m.next;do v=t(v,E.action),E=E.next;while(E!==m);pe(v,n.memoizedState)||(lr=!0),n.memoizedState=v,n.baseQueue===null&&(n.baseState=v),s.lastRenderedState=v}return[v,u]}function Yf(){}function Jf(t,n){var s=Zt,u=Or(),m=n(),v=!pe(u.memoizedState,m);if(v&&(u.memoizedState=m,lr=!0),u=u.queue,$c(Gf.bind(null,s,u,t),[t]),u.getSnapshot!==n||v||kn!==null&&kn.memoizedState.tag&1){if(s.flags|=2048,Sa(9,Qf.bind(null,s,u,m,n),void 0,null),Nn===null)throw Error(o(349));(Hs&30)!==0||Xf(s,n,m)}return m}function Xf(t,n,s){t.flags|=16384,t={getSnapshot:n,value:s},n=Zt.updateQueue,n===null?(n={lastEffect:null,stores:null},Zt.updateQueue=n,n.stores=[t]):(s=n.stores,s===null?n.stores=[t]:s.push(t))}function Qf(t,n,s,u){n.value=s,n.getSnapshot=u,Zf(n)&&ep(t)}function Gf(t,n,s){return s(function(){Zf(n)&&ep(t)})}function Zf(t){var n=t.getSnapshot;t=t.value;try{var s=n();return!pe(t,s)}catch{return!0}}function ep(t){var n=Lo(t,1);n!==null&&eo(n,t,1,-1)}function tp(t){var n=go();return typeof t=="function"&&(t=t()),n.memoizedState=n.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ba,lastRenderedState:t},n.queue=t,t=t.dispatch=vy.bind(null,Zt,t),[n.memoizedState,t]}function Sa(t,n,s,u){return t={tag:t,create:n,destroy:s,deps:u,next:null},n=Zt.updateQueue,n===null?(n={lastEffect:null,stores:null},Zt.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 np(){return Or().memoizedState}function $l(t,n,s,u){var m=go();Zt.flags|=t,m.memoizedState=Sa(1|n,s,void 0,u===void 0?null:u)}function Ml(t,n,s,u){var m=Or();u=u===void 0?null:u;var v=void 0;if(hn!==null){var E=hn.memoizedState;if(v=E.destroy,u!==null&&jc(u,E.deps)){m.memoizedState=Sa(n,s,v,u);return}}Zt.flags|=t,m.memoizedState=Sa(1|n,s,v,u)}function rp(t,n){return $l(8390656,8,t,n)}function $c(t,n){return Ml(2048,8,t,n)}function op(t,n){return Ml(4,2,t,n)}function sp(t,n){return Ml(4,4,t,n)}function ip(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 ap(t,n,s){return s=s!=null?s.concat([t]):null,Ml(4,4,ip.bind(null,n,t),s)}function Mc(){}function lp(t,n){var s=Or();n=n===void 0?null:n;var u=s.memoizedState;return u!==null&&n!==null&&jc(n,u[1])?u[0]:(s.memoizedState=[t,n],t)}function up(t,n){var s=Or();n=n===void 0?null:n;var u=s.memoizedState;return u!==null&&n!==null&&jc(n,u[1])?u[0]:(t=t(),s.memoizedState=[t,n],t)}function cp(t,n,s){return(Hs&21)===0?(t.baseState&&(t.baseState=!1,lr=!0),t.memoizedState=s):(pe(s,n)||(s=Er(),Zt.lanes|=s,Fs|=s,t.baseState=!0),n)}function yy(t,n){var s=Et;Et=s!==0&&4>s?s:4,t(!0);var u=_c.transition;_c.transition={};try{t(!1),n()}finally{Et=s,_c.transition=u}}function dp(){return Or().memoizedState}function xy(t,n,s){var u=ys(t);if(s={lane:u,action:s,hasEagerState:!1,eagerState:null,next:null},fp(t))pp(n,s);else if(s=qf(t,n,s,u),s!==null){var m=Jn();eo(s,t,u,m),hp(s,n,u)}}function vy(t,n,s){var u=ys(t),m={lane:u,action:s,hasEagerState:!1,eagerState:null,next:null};if(fp(t))pp(n,m);else{var v=t.alternate;if(t.lanes===0&&(v===null||v.lanes===0)&&(v=n.lastRenderedReducer,v!==null))try{var E=n.lastRenderedState,B=v(E,s);if(m.hasEagerState=!0,m.eagerState=B,pe(B,E)){var X=n.interleaved;X===null?(m.next=m,vc(n)):(m.next=X.next,X.next=m),n.interleaved=m;return}}catch{}finally{}s=qf(t,n,m,u),s!==null&&(m=Jn(),eo(s,t,u,m),hp(s,n,u))}}function fp(t){var n=t.alternate;return t===Zt||n!==null&&n===Zt}function pp(t,n){va=Tl=!0;var s=t.pending;s===null?n.next=n:(n.next=s.next,s.next=n),t.pending=n}function hp(t,n,s){if((s&4194240)!==0){var u=n.lanes;u&=t.pendingLanes,s|=u,n.lanes=s,co(t,s)}}var Al={readContext:Ir,useCallback:Rn,useContext:Rn,useEffect:Rn,useImperativeHandle:Rn,useInsertionEffect:Rn,useLayoutEffect:Rn,useMemo:Rn,useReducer:Rn,useRef:Rn,useState:Rn,useDebugValue:Rn,useDeferredValue:Rn,useTransition:Rn,useMutableSource:Rn,useSyncExternalStore:Rn,useId:Rn,unstable_isNewReconciler:!1},wy={readContext:Ir,useCallback:function(t,n){return go().memoizedState=[t,n===void 0?null:n],t},useContext:Ir,useEffect:rp,useImperativeHandle:function(t,n,s){return s=s!=null?s.concat([t]):null,$l(4194308,4,ip.bind(null,n,t),s)},useLayoutEffect:function(t,n){return $l(4194308,4,t,n)},useInsertionEffect:function(t,n){return $l(4,2,t,n)},useMemo:function(t,n){var s=go();return n=n===void 0?null:n,t=t(),s.memoizedState=[t,n],t},useReducer:function(t,n,s){var u=go();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=xy.bind(null,Zt,t),[u.memoizedState,t]},useRef:function(t){var n=go();return t={current:t},n.memoizedState=t},useState:tp,useDebugValue:Mc,useDeferredValue:function(t){return go().memoizedState=t},useTransition:function(){var t=tp(!1),n=t[0];return t=yy.bind(null,t[1]),go().memoizedState=t,[n,t]},useMutableSource:function(){},useSyncExternalStore:function(t,n,s){var u=Zt,m=go();if(Yt){if(s===void 0)throw Error(o(407));s=s()}else{if(s=n(),Nn===null)throw Error(o(349));(Hs&30)!==0||Xf(u,n,s)}m.memoizedState=s;var v={value:s,getSnapshot:n};return m.queue=v,rp(Gf.bind(null,u,v,t),[t]),u.flags|=2048,Sa(9,Qf.bind(null,u,v,s,n),void 0,null),s},useId:function(){var t=go(),n=Nn.identifierPrefix;if(Yt){var s=Ro,u=Do;s=(u&~(1<<32-vn(u)-1)).toString(32)+s,n=":"+n+"R"+s,s=wa++,0<s&&(n+="H"+s.toString(32)),n+=":"}else s=gy++,n=":"+n+"r"+s.toString(32)+":";return t.memoizedState=n},unstable_isNewReconciler:!1},by={readContext:Ir,useCallback:lp,useContext:Ir,useEffect:$c,useImperativeHandle:ap,useInsertionEffect:op,useLayoutEffect:sp,useMemo:up,useReducer:Pc,useRef:np,useState:function(){return Pc(ba)},useDebugValue:Mc,useDeferredValue:function(t){var n=Or();return cp(n,hn.memoizedState,t)},useTransition:function(){var t=Pc(ba)[0],n=Or().memoizedState;return[t,n]},useMutableSource:Yf,useSyncExternalStore:Jf,useId:dp,unstable_isNewReconciler:!1},Sy={readContext:Ir,useCallback:lp,useContext:Ir,useEffect:$c,useImperativeHandle:ap,useInsertionEffect:op,useLayoutEffect:sp,useMemo:up,useReducer:Tc,useRef:np,useState:function(){return Tc(ba)},useDebugValue:Mc,useDeferredValue:function(t){var n=Or();return hn===null?n.memoizedState=t:cp(n,hn.memoizedState,t)},useTransition:function(){var t=Tc(ba)[0],n=Or().memoizedState;return[t,n]},useMutableSource:Yf,useSyncExternalStore:Jf,useId:dp,unstable_isNewReconciler:!1};function Qr(t,n){if(t&&t.defaultProps){n=Q({},n),t=t.defaultProps;for(var s in t)n[s]===void 0&&(n[s]=t[s]);return n}return n}function Ac(t,n,s,u){n=t.memoizedState,s=s(u,n),s=s==null?n:Q({},n,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var Il={isMounted:function(t){return(t=t._reactInternals)?yt(t)===t:!1},enqueueSetState:function(t,n,s){t=t._reactInternals;var u=Jn(),m=ys(t),v=Ho(u,m);v.payload=n,s!=null&&(v.callback=s),n=ps(t,v,m),n!==null&&(eo(n,t,m,u),jl(n,t,m))},enqueueReplaceState:function(t,n,s){t=t._reactInternals;var u=Jn(),m=ys(t),v=Ho(u,m);v.tag=1,v.payload=n,s!=null&&(v.callback=s),n=ps(t,v,m),n!==null&&(eo(n,t,m,u),jl(n,t,m))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var s=Jn(),u=ys(t),m=Ho(s,u);m.tag=2,n!=null&&(m.callback=n),n=ps(t,m,u),n!==null&&(eo(n,t,u,s),jl(n,t,u))}};function mp(t,n,s,u,m,v,E){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(u,v,E):n.prototype&&n.prototype.isPureReactComponent?!ne(s,u)||!ne(m,v):!0}function gp(t,n,s){var u=!1,m=cs,v=n.contextType;return typeof v=="object"&&v!==null?v=Ir(v):(m=ar(n)?Is:Dn.current,u=n.contextTypes,v=(u=u!=null)?wi(t,m):cs),n=new n(s,v),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=Il,t.stateNode=n,n._reactInternals=t,u&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=m,t.__reactInternalMemoizedMaskedChildContext=v),n}function yp(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&&Il.enqueueReplaceState(n,n.state,null)}function Ic(t,n,s,u){var m=t.stateNode;m.props=s,m.state=t.memoizedState,m.refs={},wc(t);var v=n.contextType;typeof v=="object"&&v!==null?m.context=Ir(v):(v=ar(n)?Is:Dn.current,m.context=wi(t,v)),m.state=t.memoizedState,v=n.getDerivedStateFromProps,typeof v=="function"&&(Ac(t,n,v,s),m.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(n=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),n!==m.state&&Il.enqueueReplaceState(m,m.state,null),Cl(t,s,m,u),m.state=t.memoizedState),typeof m.componentDidMount=="function"&&(t.flags|=4194308)}function Ei(t,n){try{var s="",u=n;do s+=Re(u),u=u.return;while(u);var m=s}catch(v){m=`
39
+ Error generating stack: `+v.message+`
40
+ `+v.stack}return{value:t,source:n,stack:m,digest:null}}function Oc(t,n,s){return{value:t,source:null,stack:s??null,digest:n??null}}function Dc(t,n){try{console.error(n.value)}catch(s){setTimeout(function(){throw s})}}var ky=typeof WeakMap=="function"?WeakMap:Map;function xp(t,n,s){s=Ho(-1,s),s.tag=3,s.payload={element:null};var u=n.value;return s.callback=function(){zl||(zl=!0,Qc=u),Dc(t,n)},s}function vp(t,n,s){s=Ho(-1,s),s.tag=3;var u=t.type.getDerivedStateFromError;if(typeof u=="function"){var m=n.value;s.payload=function(){return u(m)},s.callback=function(){Dc(t,n)}}var v=t.stateNode;return v!==null&&typeof v.componentDidCatch=="function"&&(s.callback=function(){Dc(t,n),typeof u!="function"&&(ms===null?ms=new Set([this]):ms.add(this));var E=n.stack;this.componentDidCatch(n.value,{componentStack:E!==null?E:""})}),s}function wp(t,n,s){var u=t.pingCache;if(u===null){u=t.pingCache=new ky;var m=new Set;u.set(n,m)}else m=u.get(n),m===void 0&&(m=new Set,u.set(n,m));m.has(s)||(m.add(s),t=Ry.bind(null,t,n,s),n.then(t,t))}function bp(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 Sp(t,n,s,u,m){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=Ho(-1,1),n.tag=2,ps(s,n,1))),s.lanes|=1),t):(t.flags|=65536,t.lanes=m,t)}var Ny=O.ReactCurrentOwner,lr=!1;function Yn(t,n,s,u){n.child=t===null?Bf(n,null,s,u):Ni(n,t.child,s,u)}function kp(t,n,s,u,m){s=s.render;var v=n.ref;return ji(n,m),u=Cc(t,n,s,u,v,m),s=Ec(),t!==null&&!lr?(n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~m,Fo(t,n,m)):(Yt&&s&&cc(n),n.flags|=1,Yn(t,n,u,m),n.child)}function Np(t,n,s,u,m){if(t===null){var v=s.type;return typeof v=="function"&&!od(v)&&v.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(n.tag=15,n.type=v,_p(t,n,v,u,m)):(t=Wl(s.type,null,u,n,n.mode,m),t.ref=n.ref,t.return=n,n.child=t)}if(v=t.child,(t.lanes&m)===0){var E=v.memoizedProps;if(s=s.compare,s=s!==null?s:ne,s(E,u)&&t.ref===n.ref)return Fo(t,n,m)}return n.flags|=1,t=vs(v,u),t.ref=n.ref,t.return=n,n.child=t}function _p(t,n,s,u,m){if(t!==null){var v=t.memoizedProps;if(ne(v,u)&&t.ref===n.ref)if(lr=!1,n.pendingProps=u=v,(t.lanes&m)!==0)(t.flags&131072)!==0&&(lr=!0);else return n.lanes=t.lanes,Fo(t,n,m)}return Rc(t,n,s,u,m)}function jp(t,n,s){var u=n.pendingProps,m=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},qt(Ti,yr),yr|=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,qt(Ti,yr),yr|=t,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},u=v!==null?v.baseLanes:s,qt(Ti,yr),yr|=u}else v!==null?(u=v.baseLanes|s,n.memoizedState=null):u=s,qt(Ti,yr),yr|=u;return Yn(t,n,m,s),n.child}function Cp(t,n){var s=n.ref;(t===null&&s!==null||t!==null&&t.ref!==s)&&(n.flags|=512,n.flags|=2097152)}function Rc(t,n,s,u,m){var v=ar(s)?Is:Dn.current;return v=wi(n,v),ji(n,m),s=Cc(t,n,s,u,v,m),u=Ec(),t!==null&&!lr?(n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~m,Fo(t,n,m)):(Yt&&u&&cc(n),n.flags|=1,Yn(t,n,s,m),n.child)}function Ep(t,n,s,u,m){if(ar(s)){var v=!0;xl(n)}else v=!1;if(ji(n,m),n.stateNode===null)Dl(t,n),gp(n,s,u),Ic(n,s,u,m),u=!0;else if(t===null){var E=n.stateNode,B=n.memoizedProps;E.props=B;var X=E.context,be=s.contextType;typeof be=="object"&&be!==null?be=Ir(be):(be=ar(s)?Is:Dn.current,be=wi(n,be));var Me=s.getDerivedStateFromProps,De=typeof Me=="function"||typeof E.getSnapshotBeforeUpdate=="function";De||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(B!==u||X!==be)&&yp(n,E,u,be),fs=!1;var Te=n.memoizedState;E.state=Te,Cl(n,u,E,m),X=n.memoizedState,B!==u||Te!==X||ir.current||fs?(typeof Me=="function"&&(Ac(n,s,Me,u),X=n.memoizedState),(B=fs||mp(n,s,B,u,Te,X,be))?(De||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(n.flags|=4194308)):(typeof E.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=u,n.memoizedState=X),E.props=u,E.state=X,E.context=be,u=B):(typeof E.componentDidMount=="function"&&(n.flags|=4194308),u=!1)}else{E=n.stateNode,Uf(t,n),B=n.memoizedProps,be=n.type===n.elementType?B:Qr(n.type,B),E.props=be,De=n.pendingProps,Te=E.context,X=s.contextType,typeof X=="object"&&X!==null?X=Ir(X):(X=ar(s)?Is:Dn.current,X=wi(n,X));var Ke=s.getDerivedStateFromProps;(Me=typeof Ke=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(B!==De||Te!==X)&&yp(n,E,u,X),fs=!1,Te=n.memoizedState,E.state=Te,Cl(n,u,E,m);var Ge=n.memoizedState;B!==De||Te!==Ge||ir.current||fs?(typeof Ke=="function"&&(Ac(n,s,Ke,u),Ge=n.memoizedState),(be=fs||mp(n,s,be,u,Te,Ge,X)||!1)?(Me||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(u,Ge,X),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(u,Ge,X)),typeof E.componentDidUpdate=="function"&&(n.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof E.componentDidUpdate!="function"||B===t.memoizedProps&&Te===t.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||B===t.memoizedProps&&Te===t.memoizedState||(n.flags|=1024),n.memoizedProps=u,n.memoizedState=Ge),E.props=u,E.state=Ge,E.context=X,u=be):(typeof E.componentDidUpdate!="function"||B===t.memoizedProps&&Te===t.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||B===t.memoizedProps&&Te===t.memoizedState||(n.flags|=1024),u=!1)}return Lc(t,n,s,u,v,m)}function Lc(t,n,s,u,m,v){Cp(t,n);var E=(n.flags&128)!==0;if(!u&&!E)return m&&Af(n,s,!1),Fo(t,n,v);u=n.stateNode,Ny.current=n;var B=E&&typeof s.getDerivedStateFromError!="function"?null:u.render();return n.flags|=1,t!==null&&E?(n.child=Ni(n,t.child,null,v),n.child=Ni(n,null,B,v)):Yn(t,n,B,v),n.memoizedState=u.state,m&&Af(n,s,!0),n.child}function Pp(t){var n=t.stateNode;n.pendingContext?$f(t,n.pendingContext,n.pendingContext!==n.context):n.context&&$f(t,n.context,!1),bc(t,n.containerInfo)}function Tp(t,n,s,u,m){return ki(),hc(m),n.flags|=256,Yn(t,n,s,u),n.child}var Hc={dehydrated:null,treeContext:null,retryLane:0};function Fc(t){return{baseLanes:t,cachePool:null,transitions:null}}function $p(t,n,s){var u=n.pendingProps,m=Gt.current,v=!1,E=(n.flags&128)!==0,B;if((B=E)||(B=t!==null&&t.memoizedState===null?!1:(m&2)!==0),B?(v=!0,n.flags&=-129):(t===null||t.memoizedState!==null)&&(m|=1),qt(Gt,m&1),t===null)return pc(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):(E=u.children,t=u.fallback,v?(u=n.mode,v=n.child,E={mode:"hidden",children:E},(u&1)===0&&v!==null?(v.childLanes=0,v.pendingProps=E):v=Yl(E,u,0,null),t=Us(t,u,s,null),v.return=n,t.return=n,v.sibling=t,n.child=v,n.child.memoizedState=Fc(s),n.memoizedState=Hc,t):zc(n,E));if(m=t.memoizedState,m!==null&&(B=m.dehydrated,B!==null))return _y(t,n,E,u,B,m,s);if(v){v=u.fallback,E=n.mode,m=t.child,B=m.sibling;var X={mode:"hidden",children:u.children};return(E&1)===0&&n.child!==m?(u=n.child,u.childLanes=0,u.pendingProps=X,n.deletions=null):(u=vs(m,X),u.subtreeFlags=m.subtreeFlags&14680064),B!==null?v=vs(B,v):(v=Us(v,E,s,null),v.flags|=2),v.return=n,u.return=n,u.sibling=v,n.child=u,u=v,v=n.child,E=t.child.memoizedState,E=E===null?Fc(s):{baseLanes:E.baseLanes|s,cachePool:null,transitions:E.transitions},v.memoizedState=E,v.childLanes=t.childLanes&~s,n.memoizedState=Hc,u}return v=t.child,t=v.sibling,u=vs(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 zc(t,n){return n=Yl({mode:"visible",children:n},t.mode,0,null),n.return=t,t.child=n}function Ol(t,n,s,u){return u!==null&&hc(u),Ni(n,t.child,null,s),t=zc(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function _y(t,n,s,u,m,v,E){if(s)return n.flags&256?(n.flags&=-257,u=Oc(Error(o(422))),Ol(t,n,E,u)):n.memoizedState!==null?(n.child=t.child,n.flags|=128,null):(v=u.fallback,m=n.mode,u=Yl({mode:"visible",children:u.children},m,0,null),v=Us(v,m,E,null),v.flags|=2,u.return=n,v.return=n,u.sibling=v,n.child=u,(n.mode&1)!==0&&Ni(n,t.child,null,E),n.child.memoizedState=Fc(E),n.memoizedState=Hc,v);if((n.mode&1)===0)return Ol(t,n,E,null);if(m.data==="$!"){if(u=m.nextSibling&&m.nextSibling.dataset,u)var B=u.dgst;return u=B,v=Error(o(419)),u=Oc(v,u,void 0),Ol(t,n,E,u)}if(B=(E&t.childLanes)!==0,lr||B){if(u=Nn,u!==null){switch(E&-E){case 4:m=2;break;case 16:m=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:m=32;break;case 536870912:m=268435456;break;default:m=0}m=(m&(u.suspendedLanes|E))!==0?0:m,m!==0&&m!==v.retryLane&&(v.retryLane=m,Lo(t,m),eo(u,t,m,-1))}return rd(),u=Oc(Error(o(421))),Ol(t,n,E,u)}return m.data==="$?"?(n.flags|=128,n.child=t.child,n=Ly.bind(null,t),m._reactRetry=n,null):(t=v.treeContext,gr=ls(m.nextSibling),mr=n,Yt=!0,Xr=null,t!==null&&(Mr[Ar++]=Do,Mr[Ar++]=Ro,Mr[Ar++]=Os,Do=t.id,Ro=t.overflow,Os=n),n=zc(n,u.children),n.flags|=4096,n)}function Mp(t,n,s){t.lanes|=n;var u=t.alternate;u!==null&&(u.lanes|=n),xc(t.return,n,s)}function Bc(t,n,s,u,m){var v=t.memoizedState;v===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:u,tail:s,tailMode:m}:(v.isBackwards=n,v.rendering=null,v.renderingStartTime=0,v.last=u,v.tail=s,v.tailMode=m)}function Ap(t,n,s){var u=n.pendingProps,m=u.revealOrder,v=u.tail;if(Yn(t,n,u.children,s),u=Gt.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&&Mp(t,s,n);else if(t.tag===19)Mp(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(qt(Gt,u),(n.mode&1)===0)n.memoizedState=null;else switch(m){case"forwards":for(s=n.child,m=null;s!==null;)t=s.alternate,t!==null&&El(t)===null&&(m=s),s=s.sibling;s=m,s===null?(m=n.child,n.child=null):(m=s.sibling,s.sibling=null),Bc(n,!1,m,s,v);break;case"backwards":for(s=null,m=n.child,n.child=null;m!==null;){if(t=m.alternate,t!==null&&El(t)===null){n.child=m;break}t=m.sibling,m.sibling=s,s=m,m=t}Bc(n,!0,s,null,v);break;case"together":Bc(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function Dl(t,n){(n.mode&1)===0&&t!==null&&(t.alternate=null,n.alternate=null,n.flags|=2)}function Fo(t,n,s){if(t!==null&&(n.dependencies=t.dependencies),Fs|=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=vs(t,t.pendingProps),n.child=s,s.return=n;t.sibling!==null;)t=t.sibling,s=s.sibling=vs(t,t.pendingProps),s.return=n;s.sibling=null}return n.child}function jy(t,n,s){switch(n.tag){case 3:Pp(n),ki();break;case 5:Wf(n);break;case 1:ar(n.type)&&xl(n);break;case 4:bc(n,n.stateNode.containerInfo);break;case 10:var u=n.type._context,m=n.memoizedProps.value;qt(Nl,u._currentValue),u._currentValue=m;break;case 13:if(u=n.memoizedState,u!==null)return u.dehydrated!==null?(qt(Gt,Gt.current&1),n.flags|=128,null):(s&n.child.childLanes)!==0?$p(t,n,s):(qt(Gt,Gt.current&1),t=Fo(t,n,s),t!==null?t.sibling:null);qt(Gt,Gt.current&1);break;case 19:if(u=(s&n.childLanes)!==0,(t.flags&128)!==0){if(u)return Ap(t,n,s);n.flags|=128}if(m=n.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),qt(Gt,Gt.current),u)break;return null;case 22:case 23:return n.lanes=0,jp(t,n,s)}return Fo(t,n,s)}var Ip,qc,Op,Dp;Ip=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}},qc=function(){},Op=function(t,n,s,u){var m=t.memoizedProps;if(m!==u){t=n.stateNode,Ls(mo.current);var v=null;switch(s){case"input":m=at(t,m),u=at(t,u),v=[];break;case"select":m=Q({},m,{value:void 0}),u=Q({},u,{value:void 0}),v=[];break;case"textarea":m=pn(t,m),u=pn(t,u),v=[];break;default:typeof m.onClick!="function"&&typeof u.onClick=="function"&&(t.onclick=ml)}Ue(s,u);var E;s=null;for(be in m)if(!u.hasOwnProperty(be)&&m.hasOwnProperty(be)&&m[be]!=null)if(be==="style"){var B=m[be];for(E in B)B.hasOwnProperty(E)&&(s||(s={}),s[E]="")}else be!=="dangerouslySetInnerHTML"&&be!=="children"&&be!=="suppressContentEditableWarning"&&be!=="suppressHydrationWarning"&&be!=="autoFocus"&&(a.hasOwnProperty(be)?v||(v=[]):(v=v||[]).push(be,null));for(be in u){var X=u[be];if(B=m!=null?m[be]:void 0,u.hasOwnProperty(be)&&X!==B&&(X!=null||B!=null))if(be==="style")if(B){for(E in B)!B.hasOwnProperty(E)||X&&X.hasOwnProperty(E)||(s||(s={}),s[E]="");for(E in X)X.hasOwnProperty(E)&&B[E]!==X[E]&&(s||(s={}),s[E]=X[E])}else s||(v||(v=[]),v.push(be,s)),s=X;else be==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,B=B?B.__html:void 0,X!=null&&B!==X&&(v=v||[]).push(be,X)):be==="children"?typeof X!="string"&&typeof X!="number"||(v=v||[]).push(be,""+X):be!=="suppressContentEditableWarning"&&be!=="suppressHydrationWarning"&&(a.hasOwnProperty(be)?(X!=null&&be==="onScroll"&&Vt("scroll",t),v||B===X||(v=[])):(v=v||[]).push(be,X))}s&&(v=v||[]).push("style",s);var be=v;(n.updateQueue=be)&&(n.flags|=4)}},Dp=function(t,n,s,u){s!==u&&(n.flags|=4)};function ka(t,n){if(!Yt)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 Ln(t){var n=t.alternate!==null&&t.alternate.child===t.child,s=0,u=0;if(n)for(var m=t.child;m!==null;)s|=m.lanes|m.childLanes,u|=m.subtreeFlags&14680064,u|=m.flags&14680064,m.return=t,m=m.sibling;else for(m=t.child;m!==null;)s|=m.lanes|m.childLanes,u|=m.subtreeFlags,u|=m.flags,m.return=t,m=m.sibling;return t.subtreeFlags|=u,t.childLanes=s,n}function Cy(t,n,s){var u=n.pendingProps;switch(dc(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ln(n),null;case 1:return ar(n.type)&&yl(),Ln(n),null;case 3:return u=n.stateNode,Ci(),Kt(ir),Kt(Dn),Nc(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(t===null||t.child===null)&&(Sl(n)?n.flags|=4:t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Xr!==null&&(ed(Xr),Xr=null))),qc(t,n),Ln(n),null;case 5:Sc(n);var m=Ls(xa.current);if(s=n.type,t!==null&&n.stateNode!=null)Op(t,n,s,u,m),t.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!u){if(n.stateNode===null)throw Error(o(166));return Ln(n),null}if(t=Ls(mo.current),Sl(n)){u=n.stateNode,s=n.type;var v=n.memoizedProps;switch(u[ho]=n,u[pa]=v,t=(n.mode&1)!==0,s){case"dialog":Vt("cancel",u),Vt("close",u);break;case"iframe":case"object":case"embed":Vt("load",u);break;case"video":case"audio":for(m=0;m<Ao.length;m++)Vt(Ao[m],u);break;case"source":Vt("error",u);break;case"img":case"image":case"link":Vt("error",u),Vt("load",u);break;case"details":Vt("toggle",u);break;case"input":mt(u,v),Vt("invalid",u);break;case"select":u._wrapperState={wasMultiple:!!v.multiple},Vt("invalid",u);break;case"textarea":ln(u,v),Vt("invalid",u)}Ue(s,v),m=null;for(var E in v)if(v.hasOwnProperty(E)){var B=v[E];E==="children"?typeof B=="string"?u.textContent!==B&&(v.suppressHydrationWarning!==!0&&hl(u.textContent,B,t),m=["children",B]):typeof B=="number"&&u.textContent!==""+B&&(v.suppressHydrationWarning!==!0&&hl(u.textContent,B,t),m=["children",""+B]):a.hasOwnProperty(E)&&B!=null&&E==="onScroll"&&Vt("scroll",u)}switch(s){case"input":tt(u),Xt(u,v,!0);break;case"textarea":tt(u),en(u);break;case"select":case"option":break;default:typeof v.onClick=="function"&&(u.onclick=ml)}u=m,n.updateQueue=u,u!==null&&(n.flags|=4)}else{E=m.nodeType===9?m:m.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=At(s)),t==="http://www.w3.org/1999/xhtml"?s==="script"?(t=E.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof u.is=="string"?t=E.createElement(s,{is:u.is}):(t=E.createElement(s),s==="select"&&(E=t,u.multiple?E.multiple=!0:u.size&&(E.size=u.size))):t=E.createElementNS(t,s),t[ho]=n,t[pa]=u,Ip(t,n,!1,!1),n.stateNode=t;e:{switch(E=bt(s,u),s){case"dialog":Vt("cancel",t),Vt("close",t),m=u;break;case"iframe":case"object":case"embed":Vt("load",t),m=u;break;case"video":case"audio":for(m=0;m<Ao.length;m++)Vt(Ao[m],t);m=u;break;case"source":Vt("error",t),m=u;break;case"img":case"image":case"link":Vt("error",t),Vt("load",t),m=u;break;case"details":Vt("toggle",t),m=u;break;case"input":mt(t,u),m=at(t,u),Vt("invalid",t);break;case"option":m=u;break;case"select":t._wrapperState={wasMultiple:!!u.multiple},m=Q({},u,{value:void 0}),Vt("invalid",t);break;case"textarea":ln(t,u),m=pn(t,u),Vt("invalid",t);break;default:m=u}Ue(s,m),B=m;for(v in B)if(B.hasOwnProperty(v)){var X=B[v];v==="style"?Ft(t,X):v==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,X!=null&&Fn(t,X)):v==="children"?typeof X=="string"?(s!=="textarea"||X!=="")&&un(t,X):typeof X=="number"&&un(t,""+X):v!=="suppressContentEditableWarning"&&v!=="suppressHydrationWarning"&&v!=="autoFocus"&&(a.hasOwnProperty(v)?X!=null&&v==="onScroll"&&Vt("scroll",t):X!=null&&$(t,v,X,E))}switch(s){case"input":tt(t),Xt(t,u,!1);break;case"textarea":tt(t),en(t);break;case"option":u.value!=null&&t.setAttribute("value",""+ke(u.value));break;case"select":t.multiple=!!u.multiple,v=u.value,v!=null?Dt(t,!!u.multiple,v,!1):u.defaultValue!=null&&Dt(t,!!u.multiple,u.defaultValue,!0);break;default:typeof m.onClick=="function"&&(t.onclick=ml)}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 Ln(n),null;case 6:if(t&&n.stateNode!=null)Dp(t,n,t.memoizedProps,u);else{if(typeof u!="string"&&n.stateNode===null)throw Error(o(166));if(s=Ls(xa.current),Ls(mo.current),Sl(n)){if(u=n.stateNode,s=n.memoizedProps,u[ho]=n,(v=u.nodeValue!==s)&&(t=mr,t!==null))switch(t.tag){case 3:hl(u.nodeValue,s,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&hl(u.nodeValue,s,(t.mode&1)!==0)}v&&(n.flags|=4)}else u=(s.nodeType===9?s:s.ownerDocument).createTextNode(u),u[ho]=n,n.stateNode=u}return Ln(n),null;case 13:if(Kt(Gt),u=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Yt&&gr!==null&&(n.mode&1)!==0&&(n.flags&128)===0)Hf(),ki(),n.flags|=98560,v=!1;else if(v=Sl(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[ho]=n}else ki(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ln(n),v=!1}else Xr!==null&&(ed(Xr),Xr=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||(Gt.current&1)!==0?mn===0&&(mn=3):rd())),n.updateQueue!==null&&(n.flags|=4),Ln(n),null);case 4:return Ci(),qc(t,n),t===null&&da(n.stateNode.containerInfo),Ln(n),null;case 10:return yc(n.type._context),Ln(n),null;case 17:return ar(n.type)&&yl(),Ln(n),null;case 19:if(Kt(Gt),v=n.memoizedState,v===null)return Ln(n),null;if(u=(n.flags&128)!==0,E=v.rendering,E===null)if(u)ka(v,!1);else{if(mn!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(E=El(t),E!==null){for(n.flags|=128,ka(v,!1),u=E.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,E=v.alternate,E===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=E.childLanes,v.lanes=E.lanes,v.child=E.child,v.subtreeFlags=0,v.deletions=null,v.memoizedProps=E.memoizedProps,v.memoizedState=E.memoizedState,v.updateQueue=E.updateQueue,v.type=E.type,t=E.dependencies,v.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),s=s.sibling;return qt(Gt,Gt.current&1|2),n.child}t=t.sibling}v.tail!==null&&ct()>$i&&(n.flags|=128,u=!0,ka(v,!1),n.lanes=4194304)}else{if(!u)if(t=El(E),t!==null){if(n.flags|=128,u=!0,s=t.updateQueue,s!==null&&(n.updateQueue=s,n.flags|=4),ka(v,!0),v.tail===null&&v.tailMode==="hidden"&&!E.alternate&&!Yt)return Ln(n),null}else 2*ct()-v.renderingStartTime>$i&&s!==1073741824&&(n.flags|=128,u=!0,ka(v,!1),n.lanes=4194304);v.isBackwards?(E.sibling=n.child,n.child=E):(s=v.last,s!==null?s.sibling=E:n.child=E,v.last=E)}return v.tail!==null?(n=v.tail,v.rendering=n,v.tail=n.sibling,v.renderingStartTime=ct(),n.sibling=null,s=Gt.current,qt(Gt,u?s&1|2:s&1),n):(Ln(n),null);case 22:case 23:return nd(),u=n.memoizedState!==null,t!==null&&t.memoizedState!==null!==u&&(n.flags|=8192),u&&(n.mode&1)!==0?(yr&1073741824)!==0&&(Ln(n),n.subtreeFlags&6&&(n.flags|=8192)):Ln(n),null;case 24:return null;case 25:return null}throw Error(o(156,n.tag))}function Ey(t,n){switch(dc(n),n.tag){case 1:return ar(n.type)&&yl(),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return Ci(),Kt(ir),Kt(Dn),Nc(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 5:return Sc(n),null;case 13:if(Kt(Gt),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(o(340));ki()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return Kt(Gt),null;case 4:return Ci(),null;case 10:return yc(n.type._context),null;case 22:case 23:return nd(),null;case 24:return null;default:return null}}var Rl=!1,Hn=!1,Py=typeof WeakSet=="function"?WeakSet:Set,Xe=null;function Pi(t,n){var s=t.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(u){tn(t,n,u)}else s.current=null}function Uc(t,n,s){try{s()}catch(u){tn(t,n,u)}}var Rp=!1;function Ty(t,n){if(nc=ni,t=se(),oe(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 m=u.anchorOffset,v=u.focusNode;u=u.focusOffset;try{s.nodeType,v.nodeType}catch{s=null;break e}var E=0,B=-1,X=-1,be=0,Me=0,De=t,Te=null;t:for(;;){for(var Ke;De!==s||m!==0&&De.nodeType!==3||(B=E+m),De!==v||u!==0&&De.nodeType!==3||(X=E+u),De.nodeType===3&&(E+=De.nodeValue.length),(Ke=De.firstChild)!==null;)Te=De,De=Ke;for(;;){if(De===t)break t;if(Te===s&&++be===m&&(B=E),Te===v&&++Me===u&&(X=E),(Ke=De.nextSibling)!==null)break;De=Te,Te=De.parentNode}De=Ke}s=B===-1||X===-1?null:{start:B,end:X}}else s=null}s=s||{start:0,end:0}}else s=null;for(rc={focusedElem:t,selectionRange:s},ni=!1,Xe=n;Xe!==null;)if(n=Xe,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Xe=t;else for(;Xe!==null;){n=Xe;try{var Ge=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(Ge!==null){var et=Ge.memoizedProps,an=Ge.memoizedState,ge=n.stateNode,re=ge.getSnapshotBeforeUpdate(n.elementType===n.type?et:Qr(n.type,et),an);ge.__reactInternalSnapshotBeforeUpdate=re}break;case 3:var xe=n.stateNode.containerInfo;xe.nodeType===1?xe.textContent="":xe.nodeType===9&&xe.documentElement&&xe.removeChild(xe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(Be){tn(n,n.return,Be)}if(t=n.sibling,t!==null){t.return=n.return,Xe=t;break}Xe=n.return}return Ge=Rp,Rp=!1,Ge}function Na(t,n,s){var u=n.updateQueue;if(u=u!==null?u.lastEffect:null,u!==null){var m=u=u.next;do{if((m.tag&t)===t){var v=m.destroy;m.destroy=void 0,v!==void 0&&Uc(n,s,v)}m=m.next}while(m!==u)}}function Ll(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 Vc(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 Lp(t){var n=t.alternate;n!==null&&(t.alternate=null,Lp(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&(delete n[ho],delete n[pa],delete n[ac],delete n[fy],delete n[py])),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 Hp(t){return t.tag===5||t.tag===3||t.tag===4}function Fp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Hp(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 Kc(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=ml));else if(u!==4&&(t=t.child,t!==null))for(Kc(t,n,s),t=t.sibling;t!==null;)Kc(t,n,s),t=t.sibling}function Wc(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(Wc(t,n,s),t=t.sibling;t!==null;)Wc(t,n,s),t=t.sibling}var $n=null,Gr=!1;function hs(t,n,s){for(s=s.child;s!==null;)zp(t,n,s),s=s.sibling}function zp(t,n,s){if(En&&typeof En.onCommitFiberUnmount=="function")try{En.onCommitFiberUnmount(Zn,s)}catch{}switch(s.tag){case 5:Hn||Pi(s,n);case 6:var u=$n,m=Gr;$n=null,hs(t,n,s),$n=u,Gr=m,$n!==null&&(Gr?(t=$n,s=s.stateNode,t.nodeType===8?t.parentNode.removeChild(s):t.removeChild(s)):$n.removeChild(s.stateNode));break;case 18:$n!==null&&(Gr?(t=$n,s=s.stateNode,t.nodeType===8?ic(t.parentNode,s):t.nodeType===1&&ic(t,s),sr(t)):ic($n,s.stateNode));break;case 4:u=$n,m=Gr,$n=s.stateNode.containerInfo,Gr=!0,hs(t,n,s),$n=u,Gr=m;break;case 0:case 11:case 14:case 15:if(!Hn&&(u=s.updateQueue,u!==null&&(u=u.lastEffect,u!==null))){m=u=u.next;do{var v=m,E=v.destroy;v=v.tag,E!==void 0&&((v&2)!==0||(v&4)!==0)&&Uc(s,n,E),m=m.next}while(m!==u)}hs(t,n,s);break;case 1:if(!Hn&&(Pi(s,n),u=s.stateNode,typeof u.componentWillUnmount=="function"))try{u.props=s.memoizedProps,u.state=s.memoizedState,u.componentWillUnmount()}catch(B){tn(s,n,B)}hs(t,n,s);break;case 21:hs(t,n,s);break;case 22:s.mode&1?(Hn=(u=Hn)||s.memoizedState!==null,hs(t,n,s),Hn=u):hs(t,n,s);break;default:hs(t,n,s)}}function Bp(t){var n=t.updateQueue;if(n!==null){t.updateQueue=null;var s=t.stateNode;s===null&&(s=t.stateNode=new Py),n.forEach(function(u){var m=Hy.bind(null,t,u);s.has(u)||(s.add(u),u.then(m,m))})}}function Zr(t,n){var s=n.deletions;if(s!==null)for(var u=0;u<s.length;u++){var m=s[u];try{var v=t,E=n,B=E;e:for(;B!==null;){switch(B.tag){case 5:$n=B.stateNode,Gr=!1;break e;case 3:$n=B.stateNode.containerInfo,Gr=!0;break e;case 4:$n=B.stateNode.containerInfo,Gr=!0;break e}B=B.return}if($n===null)throw Error(o(160));zp(v,E,m),$n=null,Gr=!1;var X=m.alternate;X!==null&&(X.return=null),m.return=null}catch(be){tn(m,n,be)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)qp(n,t),n=n.sibling}function qp(t,n){var s=t.alternate,u=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Zr(n,t),yo(t),u&4){try{Na(3,t,t.return),Ll(3,t)}catch(et){tn(t,t.return,et)}try{Na(5,t,t.return)}catch(et){tn(t,t.return,et)}}break;case 1:Zr(n,t),yo(t),u&512&&s!==null&&Pi(s,s.return);break;case 5:if(Zr(n,t),yo(t),u&512&&s!==null&&Pi(s,s.return),t.flags&32){var m=t.stateNode;try{un(m,"")}catch(et){tn(t,t.return,et)}}if(u&4&&(m=t.stateNode,m!=null)){var v=t.memoizedProps,E=s!==null?s.memoizedProps:v,B=t.type,X=t.updateQueue;if(t.updateQueue=null,X!==null)try{B==="input"&&v.type==="radio"&&v.name!=null&&ft(m,v),bt(B,E);var be=bt(B,v);for(E=0;E<X.length;E+=2){var Me=X[E],De=X[E+1];Me==="style"?Ft(m,De):Me==="dangerouslySetInnerHTML"?Fn(m,De):Me==="children"?un(m,De):$(m,Me,De,be)}switch(B){case"input":Mt(m,v);break;case"textarea":An(m,v);break;case"select":var Te=m._wrapperState.wasMultiple;m._wrapperState.wasMultiple=!!v.multiple;var Ke=v.value;Ke!=null?Dt(m,!!v.multiple,Ke,!1):Te!==!!v.multiple&&(v.defaultValue!=null?Dt(m,!!v.multiple,v.defaultValue,!0):Dt(m,!!v.multiple,v.multiple?[]:"",!1))}m[pa]=v}catch(et){tn(t,t.return,et)}}break;case 6:if(Zr(n,t),yo(t),u&4){if(t.stateNode===null)throw Error(o(162));m=t.stateNode,v=t.memoizedProps;try{m.nodeValue=v}catch(et){tn(t,t.return,et)}}break;case 3:if(Zr(n,t),yo(t),u&4&&s!==null&&s.memoizedState.isDehydrated)try{sr(n.containerInfo)}catch(et){tn(t,t.return,et)}break;case 4:Zr(n,t),yo(t);break;case 13:Zr(n,t),yo(t),m=t.child,m.flags&8192&&(v=m.memoizedState!==null,m.stateNode.isHidden=v,!v||m.alternate!==null&&m.alternate.memoizedState!==null||(Xc=ct())),u&4&&Bp(t);break;case 22:if(Me=s!==null&&s.memoizedState!==null,t.mode&1?(Hn=(be=Hn)||Me,Zr(n,t),Hn=be):Zr(n,t),yo(t),u&8192){if(be=t.memoizedState!==null,(t.stateNode.isHidden=be)&&!Me&&(t.mode&1)!==0)for(Xe=t,Me=t.child;Me!==null;){for(De=Xe=Me;Xe!==null;){switch(Te=Xe,Ke=Te.child,Te.tag){case 0:case 11:case 14:case 15:Na(4,Te,Te.return);break;case 1:Pi(Te,Te.return);var Ge=Te.stateNode;if(typeof Ge.componentWillUnmount=="function"){u=Te,s=Te.return;try{n=u,Ge.props=n.memoizedProps,Ge.state=n.memoizedState,Ge.componentWillUnmount()}catch(et){tn(u,s,et)}}break;case 5:Pi(Te,Te.return);break;case 22:if(Te.memoizedState!==null){Kp(De);continue}}Ke!==null?(Ke.return=Te,Xe=Ke):Kp(De)}Me=Me.sibling}e:for(Me=null,De=t;;){if(De.tag===5){if(Me===null){Me=De;try{m=De.stateNode,be?(v=m.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none"):(B=De.stateNode,X=De.memoizedProps.style,E=X!=null&&X.hasOwnProperty("display")?X.display:null,B.style.display=pt("display",E))}catch(et){tn(t,t.return,et)}}}else if(De.tag===6){if(Me===null)try{De.stateNode.nodeValue=be?"":De.memoizedProps}catch(et){tn(t,t.return,et)}}else if((De.tag!==22&&De.tag!==23||De.memoizedState===null||De===t)&&De.child!==null){De.child.return=De,De=De.child;continue}if(De===t)break e;for(;De.sibling===null;){if(De.return===null||De.return===t)break e;Me===De&&(Me=null),De=De.return}Me===De&&(Me=null),De.sibling.return=De.return,De=De.sibling}}break;case 19:Zr(n,t),yo(t),u&4&&Bp(t);break;case 21:break;default:Zr(n,t),yo(t)}}function yo(t){var n=t.flags;if(n&2){try{e:{for(var s=t.return;s!==null;){if(Hp(s)){var u=s;break e}s=s.return}throw Error(o(160))}switch(u.tag){case 5:var m=u.stateNode;u.flags&32&&(un(m,""),u.flags&=-33);var v=Fp(t);Wc(t,v,m);break;case 3:case 4:var E=u.stateNode.containerInfo,B=Fp(t);Kc(t,B,E);break;default:throw Error(o(161))}}catch(X){tn(t,t.return,X)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function $y(t,n,s){Xe=t,Up(t)}function Up(t,n,s){for(var u=(t.mode&1)!==0;Xe!==null;){var m=Xe,v=m.child;if(m.tag===22&&u){var E=m.memoizedState!==null||Rl;if(!E){var B=m.alternate,X=B!==null&&B.memoizedState!==null||Hn;B=Rl;var be=Hn;if(Rl=E,(Hn=X)&&!be)for(Xe=m;Xe!==null;)E=Xe,X=E.child,E.tag===22&&E.memoizedState!==null?Wp(m):X!==null?(X.return=E,Xe=X):Wp(m);for(;v!==null;)Xe=v,Up(v),v=v.sibling;Xe=m,Rl=B,Hn=be}Vp(t)}else(m.subtreeFlags&8772)!==0&&v!==null?(v.return=m,Xe=v):Vp(t)}}function Vp(t){for(;Xe!==null;){var n=Xe;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||Ll(5,n);break;case 1:var u=n.stateNode;if(n.flags&4&&!Hn)if(s===null)u.componentDidMount();else{var m=n.elementType===n.type?s.memoizedProps:Qr(n.type,s.memoizedProps);u.componentDidUpdate(m,s.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}var v=n.updateQueue;v!==null&&Kf(n,v,u);break;case 3:var E=n.updateQueue;if(E!==null){if(s=null,n.child!==null)switch(n.child.tag){case 5:s=n.child.stateNode;break;case 1:s=n.child.stateNode}Kf(n,E,s)}break;case 5:var B=n.stateNode;if(s===null&&n.flags&4){s=B;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 be=n.alternate;if(be!==null){var Me=be.memoizedState;if(Me!==null){var De=Me.dehydrated;De!==null&&sr(De)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}Hn||n.flags&512&&Vc(n)}catch(Te){tn(n,n.return,Te)}}if(n===t){Xe=null;break}if(s=n.sibling,s!==null){s.return=n.return,Xe=s;break}Xe=n.return}}function Kp(t){for(;Xe!==null;){var n=Xe;if(n===t){Xe=null;break}var s=n.sibling;if(s!==null){s.return=n.return,Xe=s;break}Xe=n.return}}function Wp(t){for(;Xe!==null;){var n=Xe;try{switch(n.tag){case 0:case 11:case 15:var s=n.return;try{Ll(4,n)}catch(X){tn(n,s,X)}break;case 1:var u=n.stateNode;if(typeof u.componentDidMount=="function"){var m=n.return;try{u.componentDidMount()}catch(X){tn(n,m,X)}}var v=n.return;try{Vc(n)}catch(X){tn(n,v,X)}break;case 5:var E=n.return;try{Vc(n)}catch(X){tn(n,E,X)}}}catch(X){tn(n,n.return,X)}if(n===t){Xe=null;break}var B=n.sibling;if(B!==null){B.return=n.return,Xe=B;break}Xe=n.return}}var My=Math.ceil,Hl=O.ReactCurrentDispatcher,Yc=O.ReactCurrentOwner,Dr=O.ReactCurrentBatchConfig,Pt=0,Nn=null,dn=null,Mn=0,yr=0,Ti=us(0),mn=0,_a=null,Fs=0,Fl=0,Jc=0,ja=null,ur=null,Xc=0,$i=1/0,zo=null,zl=!1,Qc=null,ms=null,Bl=!1,gs=null,ql=0,Ca=0,Gc=null,Ul=-1,Vl=0;function Jn(){return(Pt&6)!==0?ct():Ul!==-1?Ul:Ul=ct()}function ys(t){return(t.mode&1)===0?1:(Pt&2)!==0&&Mn!==0?Mn&-Mn:my.transition!==null?(Vl===0&&(Vl=Er()),Vl):(t=Et,t!==0||(t=window.event,t=t===void 0?16:ri(t.type)),t)}function eo(t,n,s,u){if(50<Ca)throw Ca=0,Gc=null,Error(o(185));tr(t,s,u),((Pt&2)===0||t!==Nn)&&(t===Nn&&((Pt&2)===0&&(Fl|=s),mn===4&&xs(t,Mn)),cr(t,u),s===1&&Pt===0&&(n.mode&1)===0&&($i=ct()+500,vl&&ds()))}function cr(t,n){var s=t.callbackNode;Ur(t,n);var u=jt(t,t===Nn?Mn:0);if(u===0)s!==null&&zr(s),t.callbackNode=null,t.callbackPriority=0;else if(n=u&-u,t.callbackPriority!==n){if(s!=null&&zr(s),n===1)t.tag===0?hy(Jp.bind(null,t)):If(Jp.bind(null,t)),cy(function(){(Pt&6)===0&&ds()}),s=null;else{switch(ei(u)){case 1:s=_r;break;case 4:s=lo;break;case 16:s=jr;break;case 536870912:s=uo;break;default:s=jr}s=rh(s,Yp.bind(null,t))}t.callbackPriority=n,t.callbackNode=s}}function Yp(t,n){if(Ul=-1,Vl=0,(Pt&6)!==0)throw Error(o(327));var s=t.callbackNode;if(Mi()&&t.callbackNode!==s)return null;var u=jt(t,t===Nn?Mn:0);if(u===0)return null;if((u&30)!==0||(u&t.expiredLanes)!==0||n)n=Kl(t,u);else{n=u;var m=Pt;Pt|=2;var v=Qp();(Nn!==t||Mn!==n)&&(zo=null,$i=ct()+500,Bs(t,n));do try{Oy();break}catch(B){Xp(t,B)}while(!0);gc(),Hl.current=v,Pt=m,dn!==null?n=0:(Nn=null,Mn=0,n=mn)}if(n!==0){if(n===2&&(m=er(t),m!==0&&(u=m,n=Zc(t,m))),n===1)throw s=_a,Bs(t,0),xs(t,u),cr(t,ct()),s;if(n===6)xs(t,u);else{if(m=t.current.alternate,(u&30)===0&&!Ay(m)&&(n=Kl(t,u),n===2&&(v=er(t),v!==0&&(u=v,n=Zc(t,v))),n===1))throw s=_a,Bs(t,0),xs(t,u),cr(t,ct()),s;switch(t.finishedWork=m,t.finishedLanes=u,n){case 0:case 1:throw Error(o(345));case 2:qs(t,ur,zo);break;case 3:if(xs(t,u),(u&130023424)===u&&(n=Xc+500-ct(),10<n)){if(jt(t,0)!==0)break;if(m=t.suspendedLanes,(m&u)!==u){Jn(),t.pingedLanes|=t.suspendedLanes&m;break}t.timeoutHandle=sc(qs.bind(null,t,ur,zo),n);break}qs(t,ur,zo);break;case 4:if(xs(t,u),(u&4194240)===u)break;for(n=t.eventTimes,m=-1;0<u;){var E=31-vn(u);v=1<<E,E=n[E],E>m&&(m=E),u&=~v}if(u=m,u=ct()-u,u=(120>u?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*My(u/1960))-u,10<u){t.timeoutHandle=sc(qs.bind(null,t,ur,zo),u);break}qs(t,ur,zo);break;case 5:qs(t,ur,zo);break;default:throw Error(o(329))}}}return cr(t,ct()),t.callbackNode===s?Yp.bind(null,t):null}function Zc(t,n){var s=ja;return t.current.memoizedState.isDehydrated&&(Bs(t,n).flags|=256),t=Kl(t,n),t!==2&&(n=ur,ur=s,n!==null&&ed(n)),t}function ed(t){ur===null?ur=t:ur.push.apply(ur,t)}function Ay(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 m=s[u],v=m.getSnapshot;m=m.value;try{if(!pe(v(),m))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 xs(t,n){for(n&=~Jc,n&=~Fl,t.suspendedLanes|=n,t.pingedLanes&=~n,t=t.expirationTimes;0<n;){var s=31-vn(n),u=1<<s;t[s]=-1,n&=~u}}function Jp(t){if((Pt&6)!==0)throw Error(o(327));Mi();var n=jt(t,0);if((n&1)===0)return cr(t,ct()),null;var s=Kl(t,n);if(t.tag!==0&&s===2){var u=er(t);u!==0&&(n=u,s=Zc(t,u))}if(s===1)throw s=_a,Bs(t,0),xs(t,n),cr(t,ct()),s;if(s===6)throw Error(o(345));return t.finishedWork=t.current.alternate,t.finishedLanes=n,qs(t,ur,zo),cr(t,ct()),null}function td(t,n){var s=Pt;Pt|=1;try{return t(n)}finally{Pt=s,Pt===0&&($i=ct()+500,vl&&ds())}}function zs(t){gs!==null&&gs.tag===0&&(Pt&6)===0&&Mi();var n=Pt;Pt|=1;var s=Dr.transition,u=Et;try{if(Dr.transition=null,Et=1,t)return t()}finally{Et=u,Dr.transition=s,Pt=n,(Pt&6)===0&&ds()}}function nd(){yr=Ti.current,Kt(Ti)}function Bs(t,n){t.finishedWork=null,t.finishedLanes=0;var s=t.timeoutHandle;if(s!==-1&&(t.timeoutHandle=-1,uy(s)),dn!==null)for(s=dn.return;s!==null;){var u=s;switch(dc(u),u.tag){case 1:u=u.type.childContextTypes,u!=null&&yl();break;case 3:Ci(),Kt(ir),Kt(Dn),Nc();break;case 5:Sc(u);break;case 4:Ci();break;case 13:Kt(Gt);break;case 19:Kt(Gt);break;case 10:yc(u.type._context);break;case 22:case 23:nd()}s=s.return}if(Nn=t,dn=t=vs(t.current,null),Mn=yr=n,mn=0,_a=null,Jc=Fl=Fs=0,ur=ja=null,Rs!==null){for(n=0;n<Rs.length;n++)if(s=Rs[n],u=s.interleaved,u!==null){s.interleaved=null;var m=u.next,v=s.pending;if(v!==null){var E=v.next;v.next=m,u.next=E}s.pending=u}Rs=null}return t}function Xp(t,n){do{var s=dn;try{if(gc(),Pl.current=Al,Tl){for(var u=Zt.memoizedState;u!==null;){var m=u.queue;m!==null&&(m.pending=null),u=u.next}Tl=!1}if(Hs=0,kn=hn=Zt=null,va=!1,wa=0,Yc.current=null,s===null||s.return===null){mn=1,_a=n,dn=null;break}e:{var v=t,E=s.return,B=s,X=n;if(n=Mn,B.flags|=32768,X!==null&&typeof X=="object"&&typeof X.then=="function"){var be=X,Me=B,De=Me.tag;if((Me.mode&1)===0&&(De===0||De===11||De===15)){var Te=Me.alternate;Te?(Me.updateQueue=Te.updateQueue,Me.memoizedState=Te.memoizedState,Me.lanes=Te.lanes):(Me.updateQueue=null,Me.memoizedState=null)}var Ke=bp(E);if(Ke!==null){Ke.flags&=-257,Sp(Ke,E,B,v,n),Ke.mode&1&&wp(v,be,n),n=Ke,X=be;var Ge=n.updateQueue;if(Ge===null){var et=new Set;et.add(X),n.updateQueue=et}else Ge.add(X);break e}else{if((n&1)===0){wp(v,be,n),rd();break e}X=Error(o(426))}}else if(Yt&&B.mode&1){var an=bp(E);if(an!==null){(an.flags&65536)===0&&(an.flags|=256),Sp(an,E,B,v,n),hc(Ei(X,B));break e}}v=X=Ei(X,B),mn!==4&&(mn=2),ja===null?ja=[v]:ja.push(v),v=E;do{switch(v.tag){case 3:v.flags|=65536,n&=-n,v.lanes|=n;var ge=xp(v,X,n);Vf(v,ge);break e;case 1:B=X;var re=v.type,xe=v.stateNode;if((v.flags&128)===0&&(typeof re.getDerivedStateFromError=="function"||xe!==null&&typeof xe.componentDidCatch=="function"&&(ms===null||!ms.has(xe)))){v.flags|=65536,n&=-n,v.lanes|=n;var Be=vp(v,B,n);Vf(v,Be);break e}}v=v.return}while(v!==null)}Zp(s)}catch(nt){n=nt,dn===s&&s!==null&&(dn=s=s.return);continue}break}while(!0)}function Qp(){var t=Hl.current;return Hl.current=Al,t===null?Al:t}function rd(){(mn===0||mn===3||mn===2)&&(mn=4),Nn===null||(Fs&268435455)===0&&(Fl&268435455)===0||xs(Nn,Mn)}function Kl(t,n){var s=Pt;Pt|=2;var u=Qp();(Nn!==t||Mn!==n)&&(zo=null,Bs(t,n));do try{Iy();break}catch(m){Xp(t,m)}while(!0);if(gc(),Pt=s,Hl.current=u,dn!==null)throw Error(o(261));return Nn=null,Mn=0,mn}function Iy(){for(;dn!==null;)Gp(dn)}function Oy(){for(;dn!==null&&!It();)Gp(dn)}function Gp(t){var n=nh(t.alternate,t,yr);t.memoizedProps=t.pendingProps,n===null?Zp(t):dn=n,Yc.current=null}function Zp(t){var n=t;do{var s=n.alternate;if(t=n.return,(n.flags&32768)===0){if(s=Cy(s,n,yr),s!==null){dn=s;return}}else{if(s=Ey(s,n),s!==null){s.flags&=32767,dn=s;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{mn=6,dn=null;return}}if(n=n.sibling,n!==null){dn=n;return}dn=n=t}while(n!==null);mn===0&&(mn=5)}function qs(t,n,s){var u=Et,m=Dr.transition;try{Dr.transition=null,Et=1,Dy(t,n,s,u)}finally{Dr.transition=m,Et=u}return null}function Dy(t,n,s,u){do Mi();while(gs!==null);if((Pt&6)!==0)throw Error(o(327));s=t.finishedWork;var m=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(_o(t,v),t===Nn&&(dn=Nn=null,Mn=0),(s.subtreeFlags&2064)===0&&(s.flags&2064)===0||Bl||(Bl=!0,rh(jr,function(){return Mi(),null})),v=(s.flags&15990)!==0,(s.subtreeFlags&15990)!==0||v){v=Dr.transition,Dr.transition=null;var E=Et;Et=1;var B=Pt;Pt|=4,Yc.current=null,Ty(t,s),qp(s,t),ae(rc),ni=!!nc,rc=nc=null,t.current=s,$y(s),Vn(),Pt=B,Et=E,Dr.transition=v}else t.current=s;if(Bl&&(Bl=!1,gs=t,ql=m),v=t.pendingLanes,v===0&&(ms=null),wt(s.stateNode),cr(t,ct()),n!==null)for(u=t.onRecoverableError,s=0;s<n.length;s++)m=n[s],u(m.value,{componentStack:m.stack,digest:m.digest});if(zl)throw zl=!1,t=Qc,Qc=null,t;return(ql&1)!==0&&t.tag!==0&&Mi(),v=t.pendingLanes,(v&1)!==0?t===Gc?Ca++:(Ca=0,Gc=t):Ca=0,ds(),null}function Mi(){if(gs!==null){var t=ei(ql),n=Dr.transition,s=Et;try{if(Dr.transition=null,Et=16>t?16:t,gs===null)var u=!1;else{if(t=gs,gs=null,ql=0,(Pt&6)!==0)throw Error(o(331));var m=Pt;for(Pt|=4,Xe=t.current;Xe!==null;){var v=Xe,E=v.child;if((Xe.flags&16)!==0){var B=v.deletions;if(B!==null){for(var X=0;X<B.length;X++){var be=B[X];for(Xe=be;Xe!==null;){var Me=Xe;switch(Me.tag){case 0:case 11:case 15:Na(8,Me,v)}var De=Me.child;if(De!==null)De.return=Me,Xe=De;else for(;Xe!==null;){Me=Xe;var Te=Me.sibling,Ke=Me.return;if(Lp(Me),Me===be){Xe=null;break}if(Te!==null){Te.return=Ke,Xe=Te;break}Xe=Ke}}}var Ge=v.alternate;if(Ge!==null){var et=Ge.child;if(et!==null){Ge.child=null;do{var an=et.sibling;et.sibling=null,et=an}while(et!==null)}}Xe=v}}if((v.subtreeFlags&2064)!==0&&E!==null)E.return=v,Xe=E;else e:for(;Xe!==null;){if(v=Xe,(v.flags&2048)!==0)switch(v.tag){case 0:case 11:case 15:Na(9,v,v.return)}var ge=v.sibling;if(ge!==null){ge.return=v.return,Xe=ge;break e}Xe=v.return}}var re=t.current;for(Xe=re;Xe!==null;){E=Xe;var xe=E.child;if((E.subtreeFlags&2064)!==0&&xe!==null)xe.return=E,Xe=xe;else e:for(E=re;Xe!==null;){if(B=Xe,(B.flags&2048)!==0)try{switch(B.tag){case 0:case 11:case 15:Ll(9,B)}}catch(nt){tn(B,B.return,nt)}if(B===E){Xe=null;break e}var Be=B.sibling;if(Be!==null){Be.return=B.return,Xe=Be;break e}Xe=B.return}}if(Pt=m,ds(),En&&typeof En.onPostCommitFiberRoot=="function")try{En.onPostCommitFiberRoot(Zn,t)}catch{}u=!0}return u}finally{Et=s,Dr.transition=n}}return!1}function eh(t,n,s){n=Ei(s,n),n=xp(t,n,1),t=ps(t,n,1),n=Jn(),t!==null&&(tr(t,1,n),cr(t,n))}function tn(t,n,s){if(t.tag===3)eh(t,t,s);else for(;n!==null;){if(n.tag===3){eh(n,t,s);break}else if(n.tag===1){var u=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(ms===null||!ms.has(u))){t=Ei(s,t),t=vp(n,t,1),n=ps(n,t,1),t=Jn(),n!==null&&(tr(n,1,t),cr(n,t));break}}n=n.return}}function Ry(t,n,s){var u=t.pingCache;u!==null&&u.delete(n),n=Jn(),t.pingedLanes|=t.suspendedLanes&s,Nn===t&&(Mn&s)===s&&(mn===4||mn===3&&(Mn&130023424)===Mn&&500>ct()-Xc?Bs(t,0):Jc|=s),cr(t,n)}function th(t,n){n===0&&((t.mode&1)===0?n=1:(n=qr,qr<<=1,(qr&130023424)===0&&(qr=4194304)));var s=Jn();t=Lo(t,n),t!==null&&(tr(t,n,s),cr(t,s))}function Ly(t){var n=t.memoizedState,s=0;n!==null&&(s=n.retryLane),th(t,s)}function Hy(t,n){var s=0;switch(t.tag){case 13:var u=t.stateNode,m=t.memoizedState;m!==null&&(s=m.retryLane);break;case 19:u=t.stateNode;break;default:throw Error(o(314))}u!==null&&u.delete(n),th(t,s)}var nh;nh=function(t,n,s){if(t!==null)if(t.memoizedProps!==n.pendingProps||ir.current)lr=!0;else{if((t.lanes&s)===0&&(n.flags&128)===0)return lr=!1,jy(t,n,s);lr=(t.flags&131072)!==0}else lr=!1,Yt&&(n.flags&1048576)!==0&&Of(n,bl,n.index);switch(n.lanes=0,n.tag){case 2:var u=n.type;Dl(t,n),t=n.pendingProps;var m=wi(n,Dn.current);ji(n,s),m=Cc(null,n,u,t,m,s);var v=Ec();return n.flags|=1,typeof m=="object"&&m!==null&&typeof m.render=="function"&&m.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,ar(u)?(v=!0,xl(n)):v=!1,n.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,wc(n),m.updater=Il,n.stateNode=m,m._reactInternals=n,Ic(n,u,t,s),n=Lc(null,n,u,!0,v,s)):(n.tag=0,Yt&&v&&cc(n),Yn(null,n,m,s),n=n.child),n;case 16:u=n.elementType;e:{switch(Dl(t,n),t=n.pendingProps,m=u._init,u=m(u._payload),n.type=u,m=n.tag=zy(u),t=Qr(u,t),m){case 0:n=Rc(null,n,u,t,s);break e;case 1:n=Ep(null,n,u,t,s);break e;case 11:n=kp(null,n,u,t,s);break e;case 14:n=Np(null,n,u,Qr(u.type,t),s);break e}throw Error(o(306,u,""))}return n;case 0:return u=n.type,m=n.pendingProps,m=n.elementType===u?m:Qr(u,m),Rc(t,n,u,m,s);case 1:return u=n.type,m=n.pendingProps,m=n.elementType===u?m:Qr(u,m),Ep(t,n,u,m,s);case 3:e:{if(Pp(n),t===null)throw Error(o(387));u=n.pendingProps,v=n.memoizedState,m=v.element,Uf(t,n),Cl(n,u,null,s);var E=n.memoizedState;if(u=E.element,v.isDehydrated)if(v={element:u,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},n.updateQueue.baseState=v,n.memoizedState=v,n.flags&256){m=Ei(Error(o(423)),n),n=Tp(t,n,u,s,m);break e}else if(u!==m){m=Ei(Error(o(424)),n),n=Tp(t,n,u,s,m);break e}else for(gr=ls(n.stateNode.containerInfo.firstChild),mr=n,Yt=!0,Xr=null,s=Bf(n,null,u,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(ki(),u===m){n=Fo(t,n,s);break e}Yn(t,n,u,s)}n=n.child}return n;case 5:return Wf(n),t===null&&pc(n),u=n.type,m=n.pendingProps,v=t!==null?t.memoizedProps:null,E=m.children,oc(u,m)?E=null:v!==null&&oc(u,v)&&(n.flags|=32),Cp(t,n),Yn(t,n,E,s),n.child;case 6:return t===null&&pc(n),null;case 13:return $p(t,n,s);case 4:return bc(n,n.stateNode.containerInfo),u=n.pendingProps,t===null?n.child=Ni(n,null,u,s):Yn(t,n,u,s),n.child;case 11:return u=n.type,m=n.pendingProps,m=n.elementType===u?m:Qr(u,m),kp(t,n,u,m,s);case 7:return Yn(t,n,n.pendingProps,s),n.child;case 8:return Yn(t,n,n.pendingProps.children,s),n.child;case 12:return Yn(t,n,n.pendingProps.children,s),n.child;case 10:e:{if(u=n.type._context,m=n.pendingProps,v=n.memoizedProps,E=m.value,qt(Nl,u._currentValue),u._currentValue=E,v!==null)if(pe(v.value,E)){if(v.children===m.children&&!ir.current){n=Fo(t,n,s);break e}}else for(v=n.child,v!==null&&(v.return=n);v!==null;){var B=v.dependencies;if(B!==null){E=v.child;for(var X=B.firstContext;X!==null;){if(X.context===u){if(v.tag===1){X=Ho(-1,s&-s),X.tag=2;var be=v.updateQueue;if(be!==null){be=be.shared;var Me=be.pending;Me===null?X.next=X:(X.next=Me.next,Me.next=X),be.pending=X}}v.lanes|=s,X=v.alternate,X!==null&&(X.lanes|=s),xc(v.return,s,n),B.lanes|=s;break}X=X.next}}else if(v.tag===10)E=v.type===n.type?null:v.child;else if(v.tag===18){if(E=v.return,E===null)throw Error(o(341));E.lanes|=s,B=E.alternate,B!==null&&(B.lanes|=s),xc(E,s,n),E=v.sibling}else E=v.child;if(E!==null)E.return=v;else for(E=v;E!==null;){if(E===n){E=null;break}if(v=E.sibling,v!==null){v.return=E.return,E=v;break}E=E.return}v=E}Yn(t,n,m.children,s),n=n.child}return n;case 9:return m=n.type,u=n.pendingProps.children,ji(n,s),m=Ir(m),u=u(m),n.flags|=1,Yn(t,n,u,s),n.child;case 14:return u=n.type,m=Qr(u,n.pendingProps),m=Qr(u.type,m),Np(t,n,u,m,s);case 15:return _p(t,n,n.type,n.pendingProps,s);case 17:return u=n.type,m=n.pendingProps,m=n.elementType===u?m:Qr(u,m),Dl(t,n),n.tag=1,ar(u)?(t=!0,xl(n)):t=!1,ji(n,s),gp(n,u,m),Ic(n,u,m,s),Lc(null,n,u,!0,t,s);case 19:return Ap(t,n,s);case 22:return jp(t,n,s)}throw Error(o(156,n.tag))};function rh(t,n){return No(t,n)}function Fy(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 Rr(t,n,s,u){return new Fy(t,n,s,u)}function od(t){return t=t.prototype,!(!t||!t.isReactComponent)}function zy(t){if(typeof t=="function")return od(t)?1:0;if(t!=null){if(t=t.$$typeof,t===de)return 11;if(t===ce)return 14}return 2}function vs(t,n){var s=t.alternate;return s===null?(s=Rr(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 Wl(t,n,s,u,m,v){var E=2;if(u=t,typeof t=="function")od(t)&&(E=1);else if(typeof t=="string")E=5;else e:switch(t){case W:return Us(s.children,m,v,n);case Y:E=8,m|=8;break;case le:return t=Rr(12,s,n,m|2),t.elementType=le,t.lanes=v,t;case te:return t=Rr(13,s,n,m),t.elementType=te,t.lanes=v,t;case F:return t=Rr(19,s,n,m),t.elementType=F,t.lanes=v,t;case ue:return Yl(s,m,v,n);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case we:E=10;break e;case ie:E=9;break e;case de:E=11;break e;case ce:E=14;break e;case J:E=16,u=null;break e}throw Error(o(130,t==null?t:typeof t,""))}return n=Rr(E,s,n,m),n.elementType=t,n.type=u,n.lanes=v,n}function Us(t,n,s,u){return t=Rr(7,t,u,n),t.lanes=s,t}function Yl(t,n,s,u){return t=Rr(22,t,u,n),t.elementType=ue,t.lanes=s,t.stateNode={isHidden:!1},t}function sd(t,n,s){return t=Rr(6,t,null,n),t.lanes=s,t}function id(t,n,s){return n=Rr(4,t.children!==null?t.children:[],t.key,n),n.lanes=s,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}function By(t,n,s,u,m){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=Pr(0),this.expirationTimes=Pr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pr(0),this.identifierPrefix=u,this.onRecoverableError=m,this.mutableSourceEagerHydrationData=null}function ad(t,n,s,u,m,v,E,B,X){return t=new By(t,n,s,B,X),n===1?(n=1,v===!0&&(n|=8)):n=0,v=Rr(3,null,null,n),t.current=v,v.stateNode=t,v.memoizedState={element:u,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},wc(v),t}function qy(t,n,s){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:u==null?null:""+u,children:t,containerInfo:n,implementation:s}}function oh(t){if(!t)return cs;t=t._reactInternals;e:{if(yt(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(ar(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(ar(s))return Mf(t,s,n)}return n}function sh(t,n,s,u,m,v,E,B,X){return t=ad(s,u,!0,t,m,v,E,B,X),t.context=oh(null),s=t.current,u=Jn(),m=ys(s),v=Ho(u,m),v.callback=n??null,ps(s,v,m),t.current.lanes=m,tr(t,m,u),cr(t,u),t}function Jl(t,n,s,u){var m=n.current,v=Jn(),E=ys(m);return s=oh(s),n.context===null?n.context=s:n.pendingContext=s,n=Ho(v,E),n.payload={element:t},u=u===void 0?null:u,u!==null&&(n.callback=u),t=ps(m,n,E),t!==null&&(eo(t,m,E,v),jl(t,m,E)),E}function Xl(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 ih(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<n?s:n}}function ld(t,n){ih(t,n),(t=t.alternate)&&ih(t,n)}function Uy(){return null}var ah=typeof reportError=="function"?reportError:function(t){console.error(t)};function ud(t){this._internalRoot=t}Ql.prototype.render=ud.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(o(409));Jl(t,n,null,null)},Ql.prototype.unmount=ud.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;zs(function(){Jl(null,t,null,null)}),n[Io]=null}};function Ql(t){this._internalRoot=t}Ql.prototype.unstable_scheduleHydration=function(t){if(t){var n=ti();t={blockedOn:null,target:t,priority:n};for(var s=0;s<We.length&&n!==0&&n<We[s].priority;s++);We.splice(s,0,t),s===0&&Lt(t)}};function cd(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Gl(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function lh(){}function Vy(t,n,s,u,m){if(m){if(typeof u=="function"){var v=u;u=function(){var be=Xl(E);v.call(be)}}var E=sh(n,u,t,0,null,!1,!1,"",lh);return t._reactRootContainer=E,t[Io]=E.current,da(t.nodeType===8?t.parentNode:t),zs(),E}for(;m=t.lastChild;)t.removeChild(m);if(typeof u=="function"){var B=u;u=function(){var be=Xl(X);B.call(be)}}var X=ad(t,0,!1,null,null,!1,!1,"",lh);return t._reactRootContainer=X,t[Io]=X.current,da(t.nodeType===8?t.parentNode:t),zs(function(){Jl(n,X,s,u)}),X}function Zl(t,n,s,u,m){var v=s._reactRootContainer;if(v){var E=v;if(typeof m=="function"){var B=m;m=function(){var X=Xl(E);B.call(X)}}Jl(n,E,t,m)}else E=Vy(s,n,t,m,u);return Xl(E)}Nt=function(t){switch(t.tag){case 3:var n=t.stateNode;if(n.current.memoizedState.isDehydrated){var s=Wn(n.pendingLanes);s!==0&&(co(n,s|1),cr(n,ct()),(Pt&6)===0&&($i=ct()+500,ds()))}break;case 13:zs(function(){var u=Lo(t,1);if(u!==null){var m=Jn();eo(u,t,1,m)}}),ld(t,1)}},Xo=function(t){if(t.tag===13){var n=Lo(t,134217728);if(n!==null){var s=Jn();eo(n,t,134217728,s)}ld(t,134217728)}},_s=function(t){if(t.tag===13){var n=ys(t),s=Lo(t,n);if(s!==null){var u=Jn();eo(s,t,n,u)}ld(t,n)}},ti=function(){return Et},wn=function(t,n){var s=Et;try{return Et=t,n()}finally{Et=s}},qe=function(t,n,s){switch(n){case"input":if(Mt(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 m=gl(u);if(!m)throw Error(o(90));ze(u),Mt(u,m)}}}break;case"textarea":An(t,s);break;case"select":n=s.value,n!=null&&Dt(t,!!s.multiple,n,!1)}},So=td,br=zs;var Ky={usingClientEntryPoint:!1,Events:[ha,xi,gl,wr,Hr,td]},Ea={findFiberByHostInstance:As,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Wy={bundleType:Ea.bundleType,version:Ea.version,rendererPackageName:Ea.rendererPackageName,rendererConfig:Ea.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:O.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Qn(t),t===null?null:t.stateNode},findFiberByHostInstance:Ea.findFiberByHostInstance||Uy,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 eu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!eu.isDisabled&&eu.supportsFiber)try{Zn=eu.inject(Wy),En=eu}catch{}}return dr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ky,dr.createPortal=function(t,n){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!cd(n))throw Error(o(200));return qy(t,n,null,s)},dr.createRoot=function(t,n){if(!cd(t))throw Error(o(299));var s=!1,u="",m=ah;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onRecoverableError!==void 0&&(m=n.onRecoverableError)),n=ad(t,1,!1,null,null,s,!1,u,m),t[Io]=n.current,da(t.nodeType===8?t.parentNode:t),new ud(n)},dr.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=Qn(n),t=t===null?null:t.stateNode,t},dr.flushSync=function(t){return zs(t)},dr.hydrate=function(t,n,s){if(!Gl(n))throw Error(o(200));return Zl(null,t,n,!0,s)},dr.hydrateRoot=function(t,n,s){if(!cd(t))throw Error(o(405));var u=s!=null&&s.hydratedSources||null,m=!1,v="",E=ah;if(s!=null&&(s.unstable_strictMode===!0&&(m=!0),s.identifierPrefix!==void 0&&(v=s.identifierPrefix),s.onRecoverableError!==void 0&&(E=s.onRecoverableError)),n=sh(n,null,t,1,s??null,m,!1,v,E),t[Io]=n.current,da(t),u)for(t=0;t<u.length;t++)s=u[t],m=s._getVersion,m=m(s._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[s,m]:n.mutableSourceEagerHydrationData.push(s,m);return new Ql(n)},dr.render=function(t,n,s){if(!Gl(n))throw Error(o(200));return Zl(null,t,n,!1,s)},dr.unmountComponentAtNode=function(t){if(!Gl(t))throw Error(o(40));return t._reactRootContainer?(zs(function(){Zl(null,null,t,!1,function(){t._reactRootContainer=null,t[Io]=null})}),!0):!1},dr.unstable_batchedUpdates=td,dr.unstable_renderSubtreeIntoContainer=function(t,n,s,u){if(!Gl(s))throw Error(o(200));if(t==null||t._reactInternals===void 0)throw Error(o(38));return Zl(t,n,s,!1,u)},dr.version="18.3.1-next-f1338f8080-20240426",dr}var gh;function Bm(){if(gh)return pd.exports;gh=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(),pd.exports=rx(),pd.exports}var yh;function ox(){if(yh)return tu;yh=1;var e=Bm();return tu.createRoot=e.createRoot,tu.hydrateRoot=e.hydrateRoot,tu}var sx=ox();const ix=Iu(sx);function gd(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 ax="x-api-doc-tor-llm-key";function pu(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 lx=["get","post","put","patch","delete","options","head","trace"];function xh(e){return e.replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_|_$/g,"").replace(/_+/g,"_")}function Ou(e,r,o,i){if(o)return xh(o).replace(/^[0-9]/,"_$&")||`op_${i}`;const a=xh(r.replace(/[{}]/g,""));return`${e}_${a}`||`op_${i}`}function Du(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 Ru(e){return(e.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(o=>o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()).join("")||"Api")+"Service"}function io(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 d of lx){const c=a[d];c&&typeof c=="object"&&r.push({method:d,path:o,operationId:c.operationId,tags:c.tags})}}return r}function ux(e,r,o,i="baseUrl"){var d,c;const a=r.toUpperCase();return`const ${i} = "${((c=(d=e.servers)==null?void 0:d[0])==null?void 0:c.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 qm(e,r){const o=e.map((i,a)=>` /**
49
+ * @param {{ headers?: Record<string, string> }} [options]
50
+ * @returns {Promise<unknown>}
51
+ */
52
+ async ${Ou(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 cx(e){return qm(io(e),Du(e))}function dx(e,r){const o=Ru(r),i=io(e).filter(a=>{var d;return(d=a.tags)==null?void 0:d.includes(r)});return qm(i,o)}function fx(e,r,o){var d,c;const i=((c=(d=e.servers)==null?void 0:d[0])==null?void 0:c.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 Um(e,r){const o=e.map((i,a)=>` public function ${Ou(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 px(e){return Um(io(e),Du(e))}function hx(e,r){const o=Ru(r),i=io(e).filter(a=>{var d;return(d=a.tags)==null?void 0:d.includes(r)});return Um(i,o)}function mx(e,r,o){var c,h;const i=((h=(c=e.servers)==null?void 0:c[0])==null?void 0:h.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 Vm(e,r){const o=e.map((i,a)=>{const d=Ou(i.method,i.path,i.operationId,a),c=i.method.toLowerCase(),h=c==="get"||c==="head"?"":", json={}";return` def ${d}(self, headers: dict | None = None) -> dict:
135
+ h = {**self.default_headers, **(headers or {})}
136
+ r = self._client.${c}(f"{self.base_url}${i.path}", headers=h${h})
137
+ return r.json()`});return`from __future__ import annotations
138
+ import httpx
139
+
140
+ class ${r}:
141
+ def __init__(self, base_url: str, default_headers: dict | None = None) -> None:
142
+ self.base_url = base_url.rstrip("/")
143
+ self.default_headers = default_headers or {}
144
+ self._client = httpx.Client()
145
+
146
+ def close(self) -> None:
147
+ self._client.close()
148
+
149
+ ${o.join(`
150
+
151
+ `)}
152
+ `}function gx(e){return Vm(io(e),Du(e))}function yx(e,r){const o=Ru(r),i=io(e).filter(a=>{var d;return(d=a.tags)==null?void 0:d.includes(r)});return Vm(i,o)}function xx(e){const r=e.split("/");return(r[r.length-1]??"Unknown").replace(/[^a-zA-Z0-9_]/g,"_")}function Id(e){if(!e)return"unknown";if("$ref"in e&&e.$ref)return xx(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?`${Id(r.items)}[]`:r.type==="object"&&r.properties?`{
153
+ ${Object.entries(r.properties).map(([i,a])=>` ${JSON.stringify(i)}?: ${Id(a)};`).join(`
154
+ `)}
155
+ }`:"Record<string, unknown>"}function vx(e,r,o,i="baseUrl"){var x,k,b,S,_,j;const a=(k=(x=e.paths)==null?void 0:x[o])==null?void 0:k[r],d=a==null?void 0:a.requestBody;let c;if((S=(b=d==null?void 0:d.content)==null?void 0:b["application/json"])!=null&&S.schema){const P=d.content["application/json"].schema;P&&!("$ref"in P)&&(c=P)}const h=c?Id(c):"Record<string, unknown>",g=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: "${g}",
158
+ headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
159
+ ${g==="GET"||g==="HEAD"?"":`body: JSON.stringify({} as ${h}),`}
160
+ });
161
+ const data = await res.json() as unknown;
162
+ `}function Km(e,r){const o=e.map((i,a)=>` async ${Ou(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 wx(e){const r=io(e),o=Du(e);return Km(r,o)}function bx(e,r){const o=Ru(r),i=io(e).filter(a=>{var d;return(d=a.tags)==null?void 0:d.includes(r)});return Km(i,o)}function Sx(e,r,o,i){switch(r){case"typescript":return vx(e,o,i);case"javascript":return ux(e,o,i);case"python":return mx(e,o,i);case"php":return fx(e,o,i);default:{const a=r;throw new Error(`Unsupported language: ${a}`)}}}function kx(e,r,o){switch(r){case"typescript":return bx(e,o);case"javascript":return dx(e,o);case"python":return yx(e,o);case"php":return hx(e,o);default:{const i=r;throw new Error(`Unsupported language: ${i}`)}}}function Nx(e,r,o){if(o===null)switch(r){case"typescript":return wx(e);case"javascript":return cx(e);case"python":return gx(e);case"php":return px(e);default:{const i=r;throw new Error(`Unsupported language: ${i}`)}}return kx(e,r,o)}function Wm(e){const r=new Set;for(const o of io(e))for(const i of o.tags??[])r.add(i);return r.size===0&&r.add("default"),[...r].sort()}function to(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 _x(e){var o;const r=(o=e.components)==null?void 0:o.securitySchemes;return r?Object.keys(r):[]}function Lu(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 Ra(e){if(typeof window>"u")return"omit";try{return new URL(e).origin===window.location.origin?"include":"omit"}catch{return"omit"}}var hu={exports:{}},jx=hu.exports,vh;function Cx(){return vh||(vh=1,(function(e,r){((o,i)=>{e.exports=i()})(jx,function(){var o=function(l,p){return(o=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(y,w){y.__proto__=w}:function(y,w){for(var N in w)Object.prototype.hasOwnProperty.call(w,N)&&(y[N]=w[N])}))(l,p)},i=function(){return(i=Object.assign||function(l){for(var p,y=1,w=arguments.length;y<w;y++)for(var N in p=arguments[y])Object.prototype.hasOwnProperty.call(p,N)&&(l[N]=p[N]);return l}).apply(this,arguments)};function a(l,p,y){for(var w,N=0,C=p.length;N<C;N++)!w&&N in p||((w=w||Array.prototype.slice.call(p,0,N))[N]=p[N]);return l.concat(w||Array.prototype.slice.call(p))}var d=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Qy,c=Object.keys,h=Array.isArray;function g(l,p){return typeof p=="object"&&c(p).forEach(function(y){l[y]=p[y]}),l}typeof Promise>"u"||d.Promise||(d.Promise=Promise);var x=Object.getPrototypeOf,k={}.hasOwnProperty;function b(l,p){return k.call(l,p)}function S(l,p){typeof p=="function"&&(p=p(x(l))),(typeof Reflect>"u"?c:Reflect.ownKeys)(p).forEach(function(y){j(l,y,p[y])})}var _=Object.defineProperty;function j(l,p,y,w){_(l,p,g(y&&b(y,"get")&&typeof y.get=="function"?{get:y.get,set:y.set,configurable:!0}:{value:y,configurable:!0,writable:!0},w))}function P(l){return{from:function(p){return l.prototype=Object.create(p.prototype),j(l.prototype,"constructor",l),{extend:S.bind(null,l.prototype)}}}}var T=Object.getOwnPropertyDescriptor,M=[].slice;function V(l,p,y){return M.call(l,p,y)}function $(l,p){return p(l)}function O(l){if(!l)throw new Error("Assertion Failed")}function z(l){d.setImmediate?setImmediate(l):setTimeout(l,0)}function R(l,p){if(typeof p=="string"&&b(l,p))return l[p];if(!p)return l;if(typeof p!="string"){for(var y=[],w=0,N=p.length;w<N;++w){var C=R(l,p[w]);y.push(C)}return y}var A,H=p.indexOf(".");return H===-1||(A=l[p.substr(0,H)])==null?void 0:R(A,p.substr(H+1))}function W(l,p,y){if(l&&p!==void 0&&!("isFrozen"in Object&&Object.isFrozen(l)))if(typeof p!="string"&&"length"in p){O(typeof y!="string"&&"length"in y);for(var w=0,N=p.length;w<N;++w)W(l,p[w],y[w])}else{var C,A,H=p.indexOf(".");H!==-1?(C=p.substr(0,H),(H=p.substr(H+1))===""?y===void 0?h(l)&&!isNaN(parseInt(C))?l.splice(C,1):delete l[C]:l[C]=y:W(A=(A=l[C])&&b(l,C)?A:l[C]={},H,y)):y===void 0?h(l)&&!isNaN(parseInt(p))?l.splice(p,1):delete l[p]:l[p]=y}}function Y(l){var p,y={};for(p in l)b(l,p)&&(y[p]=l[p]);return y}var le=[].concat;function we(l){return le.apply([],l)}var U="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(we([8,16,32,64].map(function(l){return["Int","Uint","Float"].map(function(p){return p+l+"Array"})}))).filter(function(l){return d[l]}),ie=new Set(U.map(function(l){return d[l]})),de=null;function te(l){return de=new WeakMap,l=(function p(y){if(!y||typeof y!="object")return y;var w=de.get(y);if(w)return w;if(h(y)){w=[],de.set(y,w);for(var N=0,C=y.length;N<C;++N)w.push(p(y[N]))}else if(ie.has(y.constructor))w=y;else{var A,H=x(y);for(A in w=H===Object.prototype?{}:Object.create(H),de.set(y,w),y)b(y,A)&&(w[A]=p(y[A]))}return w})(l),de=null,l}var F={}.toString;function ce(l){return F.call(l).slice(8,-1)}var J=typeof Symbol<"u"?Symbol.iterator:"@@iterator",ue=typeof J=="symbol"?function(l){var p;return l!=null&&(p=l[J])&&p.apply(l)}:function(){return null};function q(l,p){p=l.indexOf(p),0<=p&&l.splice(p,1)}var K={};function Q(l){var p,y,w,N;if(arguments.length===1){if(h(l))return l.slice();if(this===K&&typeof l=="string")return[l];if(N=ue(l))for(y=[];!(w=N.next()).done;)y.push(w.value);else{if(l==null)return[l];if(typeof(p=l.length)!="number")return[l];for(y=new Array(p);p--;)y[p]=l[p]}}else for(p=arguments.length,y=new Array(p);p--;)y[p]=arguments[p];return y}var L=typeof Symbol<"u"?function(l){return l[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},U=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],At=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(U),je={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 Ne(l,p){this.name=l,this.message=p}function Re(l,p){return l+". Errors: "+Object.keys(p).map(function(y){return p[y].toString()}).filter(function(y,w,N){return N.indexOf(y)===w}).join(`
179
+ `)}function Oe(l,p,y,w){this.failures=p,this.failedKeys=w,this.successCount=y,this.message=Re(l,p)}function Le(l,p){this.name="BulkError",this.failures=Object.keys(p).map(function(y){return p[y]}),this.failuresByPos=p,this.message=Re(l,this.failures)}P(Ne).from(Error).extend({toString:function(){return this.name+": "+this.message}}),P(Oe).from(Ne),P(Le).from(Ne);var ke=At.reduce(function(l,p){return l[p]=p+"Error",l},{}),$e=Ne,_e=At.reduce(function(l,p){var y=p+"Error";function w(N,C){this.name=y,N?typeof N=="string"?(this.message="".concat(N).concat(C?`
180
+ `+C:""),this.inner=C||null):typeof N=="object"&&(this.message="".concat(N.name," ").concat(N.message),this.inner=N):(this.message=je[p]||y,this.inner=null)}return P(w).from($e),l[p]=w,l},{}),tt=(_e.Syntax=SyntaxError,_e.Type=TypeError,_e.Range=RangeError,U.reduce(function(l,p){return l[p+"Error"]=_e[p],l},{}));U=At.reduce(function(l,p){return["Syntax","Type","Range"].indexOf(p)===-1&&(l[p+"Error"]=_e[p]),l},{});function ze(){}function Je(l){return l}function at(l,p){return l==null||l===Je?p:function(y){return p(l(y))}}function mt(l,p){return function(){l.apply(this,arguments),p.apply(this,arguments)}}function ft(l,p){return l===ze?p:function(){var y=l.apply(this,arguments),w=(y!==void 0&&(arguments[0]=y),this.onsuccess),N=this.onerror,C=(this.onsuccess=null,this.onerror=null,p.apply(this,arguments));return w&&(this.onsuccess=this.onsuccess?mt(w,this.onsuccess):w),N&&(this.onerror=this.onerror?mt(N,this.onerror):N),C!==void 0?C:y}}function Mt(l,p){return l===ze?p:function(){l.apply(this,arguments);var y=this.onsuccess,w=this.onerror;this.onsuccess=this.onerror=null,p.apply(this,arguments),y&&(this.onsuccess=this.onsuccess?mt(y,this.onsuccess):y),w&&(this.onerror=this.onerror?mt(w,this.onerror):w)}}function Xt(l,p){return l===ze?p:function(N){var w=l.apply(this,arguments),N=(g(N,w),this.onsuccess),C=this.onerror,A=(this.onsuccess=null,this.onerror=null,p.apply(this,arguments));return N&&(this.onsuccess=this.onsuccess?mt(N,this.onsuccess):N),C&&(this.onerror=this.onerror?mt(C,this.onerror):C),w===void 0?A===void 0?void 0:A:g(w,A)}}function nn(l,p){return l===ze?p:function(){return p.apply(this,arguments)!==!1&&l.apply(this,arguments)}}function Ht(l,p){return l===ze?p:function(){var y=l.apply(this,arguments);if(y&&typeof y.then=="function"){for(var w=this,N=arguments.length,C=new Array(N);N--;)C[N]=arguments[N];return y.then(function(){return p.apply(w,C)})}return p.apply(this,arguments)}}U.ModifyError=Oe,U.DexieError=Ne,U.BulkError=Le;var Dt=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function pn(l){Dt=l}var ln={},An=100,en=typeof Promise>"u"?[]:(At=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[en=crypto.subtle.digest("SHA-512",new Uint8Array([0])),x(en),At]:[At,x(At),At]),At=en[0],Po=en[1],Po=Po&&Po.then,Rt=At&&At.constructor,gn=!!en[2],Fn=function(l,p){bt.push([l,p]),ye&&(queueMicrotask(br),ye=!1)},un=!0,ye=!0,ot=[],pt=[],Ft=Je,vt={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:ze,pgp:!1,env:{},finalize:ze},Ue=vt,bt=[],Tt=0,yn=[];function qe(l){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var p=this._PSD=Ue;if(typeof l!="function"){if(l!==ln)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&Lr(this,this._value)}else this._state=null,this._value=null,++p.ref,(function y(w,N){try{N(function(C){if(w._state===null){if(C===w)throw new TypeError("A promise cannot be resolved with itself.");var A=w._lib&&qn();C&&typeof C.then=="function"?y(w,function(H,Z){C instanceof qe?C._then(H,Z):C.then(H,Z)}):(w._state=!0,w._value=C,wr(w)),A&&jn()}},Lr.bind(null,w))}catch(C){Lr(w,C)}})(this,l)}var zn={get:function(){var l=Ue,p=xn;function y(w,N){var C=this,A=!l.global&&(l!==Ue||p!==xn),H=A&&!yt(),Z=new qe(function(pe,ne){Hr(C,new Bn(No(w,l,A,H),No(N,l,A,H),pe,ne,l))});return this._consoleTask&&(Z._consoleTask=this._consoleTask),Z}return y.prototype=ln,y},set:function(l){j(this,"then",l&&l.prototype===ln?zn:{get:function(){return l},set:zn.set})}};function Bn(l,p,y,w,N){this.onFulfilled=typeof l=="function"?l:null,this.onRejected=typeof p=="function"?p:null,this.resolve=y,this.reject=w,this.psd=N}function Lr(l,p){var y,w;pt.push(p),l._state===null&&(y=l._lib&&qn(),p=Ft(p),l._state=!1,l._value=p,w=l,ot.some(function(N){return N._value===w._value})||ot.push(w),wr(l),y)&&jn()}function wr(l){var p=l._listeners;l._listeners=[];for(var y=0,w=p.length;y<w;++y)Hr(l,p[y]);var N=l._PSD;--N.ref||N.finalize(),Tt===0&&(++Tt,Fn(function(){--Tt==0&&Xn()},[]))}function Hr(l,p){if(l._state===null)l._listeners.push(p);else{var y=l._state?p.onFulfilled:p.onRejected;if(y===null)return(l._state?p.resolve:p.reject)(l._value);++p.psd.ref,++Tt,Fn(So,[y,l,p])}}function So(l,p,y){try{var w,N=p._value;!p._state&&pt.length&&(pt=[]),w=Dt&&p._consoleTask?p._consoleTask.run(function(){return l(N)}):l(N),p._state||pt.indexOf(N)!==-1||(C=>{for(var A=ot.length;A;)if(ot[--A]._value===C._value)return ot.splice(A,1)})(p),y.resolve(w)}catch(C){y.reject(C)}finally{--Tt==0&&Xn(),--y.psd.ref||y.psd.finalize()}}function br(){Gn(vt,function(){qn()&&jn()})}function qn(){var l=un;return ye=un=!1,l}function jn(){var l,p,y;do for(;0<bt.length;)for(l=bt,bt=[],y=l.length,p=0;p<y;++p){var w=l[p];w[0].apply(null,w[1])}while(0<bt.length);ye=un=!0}function Xn(){for(var l=ot,p=(ot=[],l.forEach(function(w){w._PSD.onunhandled.call(null,w._value,w)}),yn.slice(0)),y=p.length;y;)p[--y]()}function In(l){return new qe(ln,!1,l)}function _t(l,p){var y=Ue;return function(){var w=qn(),N=Ue;try{return Cn(y,!0),l.apply(this,arguments)}catch(C){p&&p(C)}finally{Cn(N,!1),w&&jn()}}}S(qe.prototype,{then:zn,_then:function(l,p){Hr(this,new Bn(null,null,l,p,Ue))},catch:function(l){var p,y;return arguments.length===1?this.then(null,l):(p=l,y=arguments[1],typeof p=="function"?this.then(null,function(w){return(w instanceof p?y:In)(w)}):this.then(null,function(w){return(w&&w.name===p?y:In)(w)}))},finally:function(l){return this.then(function(p){return qe.resolve(l()).then(function(){return p})},function(p){return qe.resolve(l()).then(function(){return In(p)})})},timeout:function(l,p){var y=this;return l<1/0?new qe(function(w,N){var C=setTimeout(function(){return N(new _e.Timeout(p))},l);y.then(w,N).finally(clearTimeout.bind(null,C))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&j(qe.prototype,Symbol.toStringTag,"Dexie.Promise"),vt.env=Qn(),S(qe,{all:function(){var l=Q.apply(null,arguments).map(Nr);return new qe(function(p,y){l.length===0&&p([]);var w=l.length;l.forEach(function(N,C){return qe.resolve(N).then(function(A){l[C]=A,--w||p(l)},y)})})},resolve:function(l){return l instanceof qe?l:l&&typeof l.then=="function"?new qe(function(p,y){l.then(p,y)}):new qe(ln,!0,l)},reject:In,race:function(){var l=Q.apply(null,arguments).map(Nr);return new qe(function(p,y){l.map(function(w){return qe.resolve(w).then(p,y)})})},PSD:{get:function(){return Ue},set:function(l){return Ue=l}},totalEchoes:{get:function(){return xn}},newPSD:Qe,usePSD:Gn,scheduler:{get:function(){return Fn},set:function(l){Fn=l}},rejectionMapper:{get:function(){return Ft},set:function(l){Ft=l}},follow:function(l,p){return new qe(function(y,w){return Qe(function(N,C){var A=Ue;A.unhandleds=[],A.onunhandled=C,A.finalize=mt(function(){var H,Z=this;H=function(){Z.unhandleds.length===0?N():C(Z.unhandleds[0])},yn.push(function pe(){H(),yn.splice(yn.indexOf(pe),1)}),++Tt,Fn(function(){--Tt==0&&Xn()},[])},A.finalize),l()},p,y,w)})}}),Rt&&(Rt.allSettled&&j(qe,"allSettled",function(){var l=Q.apply(null,arguments).map(Nr);return new qe(function(p){l.length===0&&p([]);var y=l.length,w=new Array(y);l.forEach(function(N,C){return qe.resolve(N).then(function(A){return w[C]={status:"fulfilled",value:A}},function(A){return w[C]={status:"rejected",reason:A}}).then(function(){return--y||p(w)})})})}),Rt.any&&typeof AggregateError<"u"&&j(qe,"any",function(){var l=Q.apply(null,arguments).map(Nr);return new qe(function(p,y){l.length===0&&y(new AggregateError([]));var w=l.length,N=new Array(w);l.forEach(function(C,A){return qe.resolve(C).then(function(H){return p(H)},function(H){N[A]=H,--w||y(new AggregateError(N))})})})}),Rt.withResolvers)&&(qe.withResolvers=Rt.withResolvers);var zt={awaits:0,echoes:0,id:0},Sr=0,Un=[],rn=0,xn=0,Fr=0;function Qe(l,A,y,w){var N=Ue,C=Object.create(N),A=(C.parent=N,C.ref=0,C.global=!1,C.id=++Fr,vt.env,C.env=gn?{Promise:qe,PromiseProp:{value:qe,configurable:!0,writable:!0},all:qe.all,race:qe.race,allSettled:qe.allSettled,any:qe.any,resolve:qe.resolve,reject:qe.reject}:{},A&&g(C,A),++N.ref,C.finalize=function(){--this.parent.ref||this.parent.finalize()},Gn(C,l,y,w));return C.ref===0&&C.finalize(),A}function kr(){return zt.id||(zt.id=++Sr),++zt.awaits,zt.echoes+=An,zt.id}function yt(){return!!zt.awaits&&(--zt.awaits==0&&(zt.id=0),zt.echoes=zt.awaits*An,!0)}function Nr(l){return zt.echoes&&l&&l.constructor===Rt?(kr(),l.then(function(p){return yt(),p},function(p){return yt(),It(p)})):l}function ko(){var l=Un[Un.length-1];Un.pop(),Cn(l,!1)}function Cn(l,p){var y,w,N=Ue;(p?!zt.echoes||rn++&&l===Ue:!rn||--rn&&l===Ue)||queueMicrotask(p?(function(C){++xn,zt.echoes&&--zt.echoes!=0||(zt.echoes=zt.awaits=zt.id=0),Un.push(Ue),Cn(C,!0)}).bind(null,l):ko),l!==Ue&&(Ue=l,N===vt&&(vt.env=Qn()),gn)&&(y=vt.env.Promise,w=l.env,N.global||l.global)&&(Object.defineProperty(d,"Promise",w.PromiseProp),y.all=w.all,y.race=w.race,y.resolve=w.resolve,y.reject=w.reject,w.allSettled&&(y.allSettled=w.allSettled),w.any)&&(y.any=w.any)}function Qn(){var l=d.Promise;return gn?{Promise:l,PromiseProp:Object.getOwnPropertyDescriptor(d,"Promise"),all:l.all,race:l.race,allSettled:l.allSettled,any:l.any,resolve:l.resolve,reject:l.reject}:{}}function Gn(l,p,y,w,N){var C=Ue;try{return Cn(l,!0),p(y,w,N)}finally{Cn(C,!1)}}function No(l,p,y,w){return typeof l!="function"?l:function(){var N=Ue;y&&kr(),Cn(p,!0);try{return l.apply(this,arguments)}finally{Cn(N,!1),w&&queueMicrotask(yt)}}}function zr(l){Promise===Rt&&zt.echoes===0?rn===0?l():enqueueNativeMicroTask(l):setTimeout(l,0)}(""+Po).indexOf("[native code]")===-1&&(kr=yt=ze);var It=qe.reject,Vn="￿",ct="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Yo="String expected.",_r="__dbnames",lo="readonly",jr="readwrite";function pr(l,p){return l?p?function(){return l.apply(this,arguments)&&p.apply(this,arguments)}:l:p}var uo={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Zn(l){return typeof l!="string"||/\./.test(l)?function(p){return p}:function(p){return p[l]===void 0&&l in p&&delete(p=te(p))[l],p}}function En(){throw _e.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function wt(l,p){try{var y=vn(l),w=vn(p);if(y!==w)return y==="Array"?1:w==="Array"?-1:y==="binary"?1:w==="binary"?-1:y==="string"?1:w==="string"?-1:y==="Date"?1:w!=="Date"?NaN:-1;switch(y){case"number":case"Date":case"string":return p<l?1:l<p?-1:0;case"binary":for(var N=Jo(l),C=Jo(p),A=N.length,H=C.length,Z=A<H?A:H,pe=0;pe<Z;++pe)if(N[pe]!==C[pe])return N[pe]<C[pe]?-1:1;return A===H?0:A<H?-1:1;case"Array":for(var ne=l,G=p,ee=ne.length,fe=G.length,se=ee<fe?ee:fe,oe=0;oe<se;++oe){var ae=wt(ne[oe],G[oe]);if(ae!==0)return ae}return ee===fe?0:ee<fe?-1:1}}catch{}return NaN}function vn(l){var p=typeof l;return p=="object"&&(ArrayBuffer.isView(l)||(p=ce(l))==="ArrayBuffer")?"binary":p}function Jo(l){return l instanceof Uint8Array?l:ArrayBuffer.isView(l)?new Uint8Array(l.buffer,l.byteOffset,l.byteLength):new Uint8Array(l)}function Kn(l,p,y){var w=l.schema.yProps;return w?(p&&0<y.numFailures&&(p=p.filter(function(N,C){return!y.failures[C]})),Promise.all(w.map(function(N){return N=N.updatesTable,p?l.db.table(N).where("k").anyOf(p).delete():l.db.table(N).clear()})).then(function(){return y})):y}Br.prototype.execute=function(l){var p=this["@@propmod"];if(p.add!==void 0){var y=p.add;if(h(y))return a(a([],h(l)?l:[],!0),y).sort();if(typeof y=="number")return(Number(l)||0)+y;if(typeof y=="bigint")try{return BigInt(l)+y}catch{return BigInt(0)+y}throw new TypeError("Invalid term ".concat(y))}if(p.remove!==void 0){var w=p.remove;if(h(w))return h(l)?l.filter(function(N){return!w.includes(N)}).sort():[];if(typeof w=="number")return Number(l)-w;if(typeof w=="bigint")try{return BigInt(l)-w}catch{return BigInt(0)-w}throw new TypeError("Invalid subtrahend ".concat(w))}return y=(y=p.replacePrefix)==null?void 0:y[0],y&&typeof l=="string"&&l.startsWith(y)?p.replacePrefix[1]+l.substring(y.length):l};var hr=Br;function Br(l){this["@@propmod"]=l}function qr(l,p){for(var y=c(p),w=y.length,N=!1,C=0;C<w;++C){var A=y[C],H=p[A],Z=R(l,A);H instanceof hr?(W(l,A,H.execute(Z)),N=!0):Z!==H&&(W(l,A,H),N=!0)}return N}jt.prototype._trans=function(l,p,y){var w=this._tx||Ue.trans,N=this.name,C=Dt&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(l==="readonly"?"read":"write"," ").concat(this.name));function A(pe,ne,G){if(G.schema[N])return p(G.idbtrans,G);throw new _e.NotFound("Table "+N+" not part of transaction")}var H=qn();try{var Z=w&&w.db._novip===this.db._novip?w===Ue.trans?w._promise(l,A,y):Qe(function(){return w._promise(l,A,y)},{trans:w,transless:Ue.transless||Ue}):(function pe(ne,G,ee,fe){if(ne.idbdb&&(ne._state.openComplete||Ue.letThrough||ne._vip)){var se=ne._createTransaction(G,ee,ne._dbSchema);try{se.create(),ne._state.PR1398_maxLoop=3}catch(oe){return oe.name===ke.InvalidState&&ne.isOpen()&&0<--ne._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),ne.close({disableAutoOpen:!1}),ne.open().then(function(){return pe(ne,G,ee,fe)})):It(oe)}return se._promise(G,function(oe,ae){return Qe(function(){return Ue.trans=se,fe(oe,ae,se)})}).then(function(oe){if(G==="readwrite")try{se.idbtrans.commit()}catch{}return G==="readonly"?oe:se._completion.then(function(){return oe})})}if(ne._state.openComplete)return It(new _e.DatabaseClosed(ne._state.dbOpenError));if(!ne._state.isBeingOpened){if(!ne._state.autoOpen)return It(new _e.DatabaseClosed);ne.open().catch(ze)}return ne._state.dbReadyPromise.then(function(){return pe(ne,G,ee,fe)})})(this.db,l,[this.name],A);return C&&(Z._consoleTask=C,Z=Z.catch(function(pe){return console.trace(pe),It(pe)})),Z}finally{H&&jn()}},jt.prototype.get=function(l,p){var y=this;return l&&l.constructor===Object?this.where(l).first(p):l==null?It(new _e.Type("Invalid argument to Table.get()")):this._trans("readonly",function(w){return y.core.get({trans:w,key:l}).then(function(N){return y.hook.reading.fire(N)})}).then(p)},jt.prototype.where=function(l){if(typeof l=="string")return new this.db.WhereClause(this,l);if(h(l))return new this.db.WhereClause(this,"[".concat(l.join("+"),"]"));var p=c(l);if(p.length===1)return this.where(p[0]).equals(l[p[0]]);var y=this.schema.indexes.concat(this.schema.primKey).filter(function(H){if(H.compound&&p.every(function(pe){return 0<=H.keyPath.indexOf(pe)})){for(var Z=0;Z<p.length;++Z)if(p.indexOf(H.keyPath[Z])===-1)return!1;return!0}return!1}).sort(function(H,Z){return H.keyPath.length-Z.keyPath.length})[0];if(y&&this.db._maxKey!==Vn)return A=y.keyPath.slice(0,p.length),this.where(A).equals(A.map(function(H){return l[H]}));!y&&Dt&&console.warn("The query ".concat(JSON.stringify(l)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(p.join("+"),"]"));var w=this.schema.idxByName;function N(H,Z){return wt(H,Z)===0}var A=p.reduce(function(ne,Z){var pe=ne[0],ne=ne[1],G=w[Z],ee=l[Z];return[pe||G,pe||!G?pr(ne,G&&G.multi?function(fe){return fe=R(fe,Z),h(fe)&&fe.some(function(se){return N(ee,se)})}:function(fe){return N(ee,R(fe,Z))}):ne]},[null,null]),C=A[0],A=A[1];return C?this.where(C.name).equals(l[C.keyPath]).filter(A):y?this.filter(A):this.where(p).equals("")},jt.prototype.filter=function(l){return this.toCollection().and(l)},jt.prototype.count=function(l){return this.toCollection().count(l)},jt.prototype.offset=function(l){return this.toCollection().offset(l)},jt.prototype.limit=function(l){return this.toCollection().limit(l)},jt.prototype.each=function(l){return this.toCollection().each(l)},jt.prototype.toArray=function(l){return this.toCollection().toArray(l)},jt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},jt.prototype.orderBy=function(l){return new this.db.Collection(new this.db.WhereClause(this,h(l)?"[".concat(l.join("+"),"]"):l))},jt.prototype.reverse=function(){return this.toCollection().reverse()},jt.prototype.mapToClass=function(l){for(var p=this.db,y=this.name,w=((this.schema.mappedClass=l).prototype instanceof En&&(l=(A=>{var H=ne,Z=A;if(typeof Z!="function"&&Z!==null)throw new TypeError("Class extends value "+String(Z)+" is not a constructor or null");function pe(){this.constructor=H}function ne(){return A!==null&&A.apply(this,arguments)||this}return o(H,Z),H.prototype=Z===null?Object.create(Z):(pe.prototype=Z.prototype,new pe),Object.defineProperty(ne.prototype,"db",{get:function(){return p},enumerable:!1,configurable:!0}),ne.prototype.table=function(){return y},ne})(l)),new Set),N=l.prototype;N;N=x(N))Object.getOwnPropertyNames(N).forEach(function(A){return w.add(A)});function C(A){if(!A)return A;var H,Z=Object.create(l.prototype);for(H in A)if(!w.has(H))try{Z[H]=A[H]}catch{}return Z}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=C,this.hook("reading",C),l},jt.prototype.defineClass=function(){return this.mapToClass(function(l){g(this,l)})},jt.prototype.add=function(l,p){var y=this,w=this.schema.primKey,N=w.auto,C=w.keyPath,A=l;return C&&N&&(A=Zn(C)(l)),this._trans("readwrite",function(H){return y.core.mutate({trans:H,type:"add",keys:p!=null?[p]:null,values:[A]})}).then(function(H){return H.numFailures?qe.reject(H.failures[0]):H.lastResult}).then(function(H){if(C)try{W(l,C,H)}catch{}return H})},jt.prototype.upsert=function(l,p){var y=this,w=this.schema.primKey.keyPath;return this._trans("readwrite",function(N){return y.core.get({trans:N,key:l}).then(function(C){var A=C??{};return qr(A,p),w&&W(A,w,l),y.core.mutate({trans:N,type:"put",values:[A],keys:[l],upsert:!0,updates:{keys:[l],changeSpecs:[p]}}).then(function(H){return H.numFailures?qe.reject(H.failures[0]):!!C})})})},jt.prototype.update=function(l,p){return typeof l!="object"||h(l)?this.where(":id").equals(l).modify(p):(l=R(l,this.schema.primKey.keyPath))===void 0?It(new _e.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(l).modify(p)},jt.prototype.put=function(l,p){var y=this,w=this.schema.primKey,N=w.auto,C=w.keyPath,A=l;return C&&N&&(A=Zn(C)(l)),this._trans("readwrite",function(H){return y.core.mutate({trans:H,type:"put",values:[A],keys:p!=null?[p]:null})}).then(function(H){return H.numFailures?qe.reject(H.failures[0]):H.lastResult}).then(function(H){if(C)try{W(l,C,H)}catch{}return H})},jt.prototype.delete=function(l){var p=this;return this._trans("readwrite",function(y){return p.core.mutate({trans:y,type:"delete",keys:[l]}).then(function(w){return Kn(p,[l],w)}).then(function(w){return w.numFailures?qe.reject(w.failures[0]):void 0})})},jt.prototype.clear=function(){var l=this;return this._trans("readwrite",function(p){return l.core.mutate({trans:p,type:"deleteRange",range:uo}).then(function(y){return Kn(l,null,y)})}).then(function(p){return p.numFailures?qe.reject(p.failures[0]):void 0})},jt.prototype.bulkGet=function(l){var p=this;return this._trans("readonly",function(y){return p.core.getMany({keys:l,trans:y}).then(function(w){return w.map(function(N){return p.hook.reading.fire(N)})})})},jt.prototype.bulkAdd=function(l,p,y){var w=this,N=Array.isArray(p)?p:void 0,C=(y=y||(N?void 0:p))?y.allKeys:void 0;return this._trans("readwrite",function(A){var H=w.schema.primKey,pe=H.auto,H=H.keyPath;if(H&&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 Z=l.length,pe=H&&pe?l.map(Zn(H)):l;return w.core.mutate({trans:A,type:"add",keys:N,values:pe,wantResults:C}).then(function(ne){var G=ne.numFailures,ee=ne.failures;if(G===0)return C?ne.results:ne.lastResult;throw new Le("".concat(w.name,".bulkAdd(): ").concat(G," of ").concat(Z," operations failed"),ee)})})},jt.prototype.bulkPut=function(l,p,y){var w=this,N=Array.isArray(p)?p:void 0,C=(y=y||(N?void 0:p))?y.allKeys:void 0;return this._trans("readwrite",function(A){var H=w.schema.primKey,pe=H.auto,H=H.keyPath;if(H&&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 Z=l.length,pe=H&&pe?l.map(Zn(H)):l;return w.core.mutate({trans:A,type:"put",keys:N,values:pe,wantResults:C}).then(function(ne){var G=ne.numFailures,ee=ne.failures;if(G===0)return C?ne.results:ne.lastResult;throw new Le("".concat(w.name,".bulkPut(): ").concat(G," of ").concat(Z," operations failed"),ee)})})},jt.prototype.bulkUpdate=function(l){var p=this,y=this.core,w=l.map(function(A){return A.key}),N=l.map(function(A){return A.changes}),C=[];return this._trans("readwrite",function(A){return y.getMany({trans:A,keys:w,cache:"clone"}).then(function(H){var Z=[],pe=[],ne=(l.forEach(function(G,ee){var fe=G.key,se=G.changes,oe=H[ee];if(oe){for(var ae=0,ve=Object.keys(se);ae<ve.length;ae++){var me=ve[ae],Se=se[me];if(me===p.schema.primKey.keyPath){if(wt(Se,fe)!==0)throw new _e.Constraint("Cannot update primary key in bulkUpdate()")}else W(oe,me,Se)}C.push(ee),Z.push(fe),pe.push(oe)}}),Z.length);return y.mutate({trans:A,type:"put",keys:Z,values:pe,updates:{keys:w,changeSpecs:N}}).then(function(G){var ee=G.numFailures,fe=G.failures;if(ee===0)return ne;for(var se=0,oe=Object.keys(fe);se<oe.length;se++){var ae,ve=oe[se],me=C[Number(ve)];me!=null&&(ae=fe[ve],delete fe[ve],fe[me]=ae)}throw new Le("".concat(p.name,".bulkUpdate(): ").concat(ee," of ").concat(ne," operations failed"),fe)})})})},jt.prototype.bulkDelete=function(l){var p=this,y=l.length;return this._trans("readwrite",function(w){return p.core.mutate({trans:w,type:"delete",keys:l}).then(function(N){return Kn(p,l,N)})}).then(function(w){var N=w.numFailures,C=w.failures;if(N===0)return w.lastResult;throw new Le("".concat(p.name,".bulkDelete(): ").concat(N," of ").concat(y," operations failed"),C)})};var Wn=jt;function jt(){}function Cr(l){function p(A,H){if(H){for(var Z=arguments.length,pe=new Array(Z-1);--Z;)pe[Z-1]=arguments[Z];return y[A].subscribe.apply(null,pe),l}if(typeof A=="string")return y[A]}var y={};p.addEventType=C;for(var w=1,N=arguments.length;w<N;++w)C(arguments[w]);return p;function C(A,H,Z){var pe,ne;if(typeof A!="object")return H=H||nn,ne={subscribers:[],fire:Z=Z||ze,subscribe:function(G){ne.subscribers.indexOf(G)===-1&&(ne.subscribers.push(G),ne.fire=H(ne.fire,G))},unsubscribe:function(G){ne.subscribers=ne.subscribers.filter(function(ee){return ee!==G}),ne.fire=ne.subscribers.reduce(H,Z)}},y[A]=p[A]=ne;c(pe=A).forEach(function(G){var ee=pe[G];if(h(ee))C(G,pe[G][0],pe[G][1]);else{if(ee!=="asap")throw new _e.InvalidArgument("Invalid event config");var fe=C(G,Je,function(){for(var se=arguments.length,oe=new Array(se);se--;)oe[se]=arguments[se];fe.subscribers.forEach(function(ae){z(function(){ae.apply(null,oe)})})})}})}}function Ur(l,p){return P(p).from({prototype:l}),p}function er(l,p){return!(l.filter||l.algorithm||l.or)&&(p?l.justLimit:!l.replayFilter)}function Er(l,p){l.filter=pr(l.filter,p)}function Pr(l,p,y){var w=l.replayFilter;l.replayFilter=w?function(){return pr(w(),p())}:p,l.justLimit=y&&!w}function tr(l,p){if(l.isPrimKey)return p.primaryKey;var y=p.getIndexByKeyPath(l.index);if(y)return y;throw new _e.Schema("KeyPath "+l.index+" on object store "+p.name+" is not indexed")}function _o(l,p,y){var w=tr(l,p.schema);return p.openCursor({trans:y,values:!l.keysOnly,reverse:l.dir==="prev",unique:!!l.unique,query:{index:w,range:l.range}})}function co(l,p,y,w){var N,C,A=l.replayFilter?pr(l.filter,l.replayFilter()):l.filter;return l.or?(N={},C=function(H,Z,pe){var ne,G;A&&!A(Z,pe,function(ee){return Z.stop(ee)},function(ee){return Z.fail(ee)})||((G=""+(ne=Z.primaryKey))=="[object ArrayBuffer]"&&(G=""+new Uint8Array(ne)),b(N,G))||(N[G]=!0,p(H,Z,pe))},Promise.all([l.or._iterate(C,y),Et(_o(l,w,y),l.algorithm,C,!l.keysOnly&&l.valueMapper)])):Et(_o(l,w,y),pr(l.algorithm,A),p,!l.keysOnly&&l.valueMapper)}function Et(l,p,y,w){var N=_t(w?function(C,A,H){return y(w(C),A,H)}:y);return l.then(function(C){if(C)return C.start(function(){var A=function(){return C.continue()};p&&!p(C,function(H){return A=H},function(H){C.stop(H),A=ze},function(H){C.fail(H),A=ze})||N(C.value,C,function(H){return A=H}),A()})})}Nt.prototype._read=function(l,p){var y=this._ctx;return y.error?y.table._trans(null,It.bind(null,y.error)):y.table._trans("readonly",l).then(p)},Nt.prototype._write=function(l){var p=this._ctx;return p.error?p.table._trans(null,It.bind(null,p.error)):p.table._trans("readwrite",l,"locked")},Nt.prototype._addAlgorithm=function(l){var p=this._ctx;p.algorithm=pr(p.algorithm,l)},Nt.prototype._iterate=function(l,p){return co(this._ctx,l,p,this._ctx.table.core)},Nt.prototype.clone=function(l){var p=Object.create(this.constructor.prototype),y=Object.create(this._ctx);return l&&g(y,l),p._ctx=y,p},Nt.prototype.raw=function(){return this._ctx.valueMapper=null,this},Nt.prototype.each=function(l){var p=this._ctx;return this._read(function(y){return co(p,l,y,p.table.core)})},Nt.prototype.count=function(l){var p=this;return this._read(function(y){var w,N=p._ctx,C=N.table.core;return er(N,!0)?C.count({trans:y,query:{index:tr(N,C.schema),range:N.range}}).then(function(A){return Math.min(A,N.limit)}):(w=0,co(N,function(){return++w,!1},y,C).then(function(){return w}))}).then(l)},Nt.prototype.sortBy=function(l,p){var y=l.split(".").reverse(),w=y[0],N=y.length-1;function C(Z,pe){return pe?C(Z[y[pe]],pe-1):Z[w]}var A=this._ctx.dir==="next"?1:-1;function H(Z,pe){return wt(C(Z,N),C(pe,N))*A}return this.toArray(function(Z){return Z.sort(H)}).then(p)},Nt.prototype.toArray=function(l){var p=this;return this._read(function(y){var w,N,C,A=p._ctx;return er(A,!0)&&0<A.limit?(w=A.valueMapper,N=tr(A,A.table.core.schema),A.table.core.query({trans:y,limit:A.limit,values:!0,direction:A.dir==="prev"?"prev":void 0,query:{index:N,range:A.range}}).then(function(H){return H=H.result,w?H.map(w):H})):(C=[],co(A,function(H){return C.push(H)},y,A.table.core).then(function(){return C}))},l)},Nt.prototype.offset=function(l){var p=this._ctx;return l<=0||(p.offset+=l,er(p)?Pr(p,function(){var y=l;return function(w,N){return y===0||(y===1?--y:N(function(){w.advance(y),y=0}),!1)}}):Pr(p,function(){var y=l;return function(){return--y<0}})),this},Nt.prototype.limit=function(l){return this._ctx.limit=Math.min(this._ctx.limit,l),Pr(this._ctx,function(){var p=l;return function(y,w,N){return--p<=0&&w(N),0<=p}},!0),this},Nt.prototype.until=function(l,p){return Er(this._ctx,function(y,w,N){return!l(y.value)||(w(N),p)}),this},Nt.prototype.first=function(l){return this.limit(1).toArray(function(p){return p[0]}).then(l)},Nt.prototype.last=function(l){return this.reverse().first(l)},Nt.prototype.filter=function(l){var p;return Er(this._ctx,function(y){return l(y.value)}),(p=this._ctx).isMatch=pr(p.isMatch,l),this},Nt.prototype.and=function(l){return this.filter(l)},Nt.prototype.or=function(l){return new this.db.WhereClause(this._ctx.table,l,this)},Nt.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Nt.prototype.desc=function(){return this.reverse()},Nt.prototype.eachKey=function(l){var p=this._ctx;return p.keysOnly=!p.isMatch,this.each(function(y,w){l(w.key,w)})},Nt.prototype.eachUniqueKey=function(l){return this._ctx.unique="unique",this.eachKey(l)},Nt.prototype.eachPrimaryKey=function(l){var p=this._ctx;return p.keysOnly=!p.isMatch,this.each(function(y,w){l(w.primaryKey,w)})},Nt.prototype.keys=function(l){var p=this._ctx,y=(p.keysOnly=!p.isMatch,[]);return this.each(function(w,N){y.push(N.key)}).then(function(){return y}).then(l)},Nt.prototype.primaryKeys=function(l){var p=this._ctx;if(er(p,!0)&&0<p.limit)return this._read(function(w){var N=tr(p,p.table.core.schema);return p.table.core.query({trans:w,values:!1,limit:p.limit,direction:p.dir==="prev"?"prev":void 0,query:{index:N,range:p.range}})}).then(function(w){return w.result}).then(l);p.keysOnly=!p.isMatch;var y=[];return this.each(function(w,N){y.push(N.primaryKey)}).then(function(){return y}).then(l)},Nt.prototype.uniqueKeys=function(l){return this._ctx.unique="unique",this.keys(l)},Nt.prototype.firstKey=function(l){return this.limit(1).keys(function(p){return p[0]}).then(l)},Nt.prototype.lastKey=function(l){return this.reverse().firstKey(l)},Nt.prototype.distinct=function(){var l,p=this._ctx,p=p.index&&p.table.schema.idxByName[p.index];return p&&p.multi&&(l={},Er(this._ctx,function(w){var w=w.primaryKey.toString(),N=b(l,w);return l[w]=!0,!N})),this},Nt.prototype.modify=function(l){var p=this,y=this._ctx;return this._write(function(w){function N(oe,ae){var ve=ae.failures;ee+=oe-ae.numFailures;for(var me=0,Se=c(ve);me<Se.length;me++){var Ce=Se[me];G.push(ve[Ce])}}var C=typeof l=="function"?l:function(oe){return qr(oe,l)},A=y.table.core,ne=A.schema.primaryKey,H=ne.outbound,Z=ne.extractKey,pe=200,ne=p.db._options.modifyChunkSize,G=(ne&&(pe=typeof ne=="object"?ne[A.name]||ne["*"]||200:ne),[]),ee=0,fe=[],se=l===Xo;return p.clone().primaryKeys().then(function(oe){function ae(me){var Se=Math.min(pe,oe.length-me),Ce=oe.slice(me,me+Se);return(se?Promise.resolve([]):A.getMany({trans:w,keys:Ce,cache:"immutable"})).then(function(Pe){var Fe=[],Ie=[],Ve=H?[]:null,He=se?Ce:[];if(!se)for(var Ye=0;Ye<Se;++Ye){var Ee=Pe[Ye],lt={value:te(Ee),primKey:oe[me+Ye]};C.call(lt,lt.value,lt)!==!1&&(lt.value==null?He.push(oe[me+Ye]):H||wt(Z(Ee),Z(lt.value))===0?(Ie.push(lt.value),H&&Ve.push(oe[me+Ye])):(He.push(oe[me+Ye]),Fe.push(lt.value)))}return Promise.resolve(0<Fe.length&&A.mutate({trans:w,type:"add",values:Fe}).then(function(ut){for(var gt in ut.failures)He.splice(parseInt(gt),1);N(Fe.length,ut)})).then(function(){return(0<Ie.length||ve&&typeof l=="object")&&A.mutate({trans:w,type:"put",keys:Ve,values:Ie,criteria:ve,changeSpec:typeof l!="function"&&l,isAdditionalChunk:0<me}).then(function(ut){return N(Ie.length,ut)})}).then(function(){return(0<He.length||ve&&se)&&A.mutate({trans:w,type:"delete",keys:He,criteria:ve,isAdditionalChunk:0<me}).then(function(ut){return Kn(y.table,He,ut)}).then(function(ut){return N(He.length,ut)})}).then(function(){return oe.length>me+Se&&ae(me+pe)})})}var ve=er(y)&&y.limit===1/0&&(typeof l!="function"||se)&&{index:y.index,range:y.range};return ae(0).then(function(){if(0<G.length)throw new Oe("Error modifying one or more objects",G,ee,fe);return oe.length})})})},Nt.prototype.delete=function(){var l=this._ctx,p=l.range;return!er(l)||l.table.schema.yProps||!l.isPrimKey&&p.type!==3?this.modify(Xo):this._write(function(y){var w=l.table.core.schema.primaryKey,N=p;return l.table.core.count({trans:y,query:{index:w,range:N}}).then(function(C){return l.table.core.mutate({trans:y,type:"deleteRange",range:N}).then(function(Z){var H=Z.failures,Z=Z.numFailures;if(Z)throw new Oe("Could not delete some values",Object.keys(H).map(function(pe){return H[pe]}),C-Z);return C-Z})})})};var ei=Nt;function Nt(){}var Xo=function(l,p){return p.value=null};function _s(l,p){return l<p?-1:l===p?0:1}function ti(l,p){return p<l?-1:l===p?0:1}function wn(l,p,y){return l=l instanceof D?new l.Collection(l):l,l._ctx.error=new(y||TypeError)(p),l}function Tr(l){return new l.Collection(l,function(){return nr("")}).limit(0)}function $r(fe,p,y,w){var N,C,A,H,Z,pe,ne,G=y.length;if(!y.every(function(oe){return typeof oe=="string"}))return wn(fe,Yo);function ee(oe){N=oe==="next"?function(ve){return ve.toUpperCase()}:function(ve){return ve.toLowerCase()},C=oe==="next"?function(ve){return ve.toLowerCase()}:function(ve){return ve.toUpperCase()},A=oe==="next"?_s:ti;var ae=y.map(function(ve){return{lower:C(ve),upper:N(ve)}}).sort(function(ve,me){return A(ve.lower,me.lower)});H=ae.map(function(ve){return ve.upper}),Z=ae.map(function(ve){return ve.lower}),ne=(pe=oe)==="next"?"":w}ee("next");var fe=new fe.Collection(fe,function(){return on(H[0],Z[G-1]+w)}),se=(fe._ondirectionchange=function(oe){ee(oe)},0);return fe._addAlgorithm(function(oe,ae,ve){var me=oe.key;if(typeof me=="string"){var Se=C(me);if(p(Se,Z,se))return!0;for(var Ce=null,Pe=se;Pe<G;++Pe){var Fe=((Ie,Ve,He,Ye,Ee,lt)=>{for(var ut=Math.min(Ie.length,Ye.length),gt=-1,St=0;St<ut;++St){var On=Ve[St];if(On!==Ye[St])return Ee(Ie[St],He[St])<0?Ie.substr(0,St)+He[St]+He.substr(St+1):Ee(Ie[St],Ye[St])<0?Ie.substr(0,St)+Ye[St]+He.substr(St+1):0<=gt?Ie.substr(0,gt)+Ve[gt]+He.substr(gt+1):null;Ee(Ie[St],On)<0&&(gt=St)}return ut<Ye.length&&lt==="next"?Ie+He.substr(Ie.length):ut<Ie.length&&lt==="prev"?Ie.substr(0,He.length):gt<0?null:Ie.substr(0,gt)+Ye[gt]+He.substr(gt+1)})(me,Se,H[Pe],Z[Pe],A,pe);Fe===null&&Ce===null?se=Pe+1:(Ce===null||0<A(Ce,Fe))&&(Ce=Fe)}ae(Ce!==null?function(){oe.continue(Ce+ne)}:ve)}return!1}),fe}function on(l,p,y,w){return{type:2,lower:l,upper:p,lowerOpen:y,upperOpen:w}}function nr(l){return{type:1,lower:l,upper:l}}Object.defineProperty(he.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),he.prototype.between=function(l,p,y,w){y=y!==!1,w=w===!0;try{return 0<this._cmp(l,p)||this._cmp(l,p)===0&&(y||w)&&(!y||!w)?Tr(this):new this.Collection(this,function(){return on(l,p,!y,!w)})}catch{return wn(this,ct)}},he.prototype.equals=function(l){return l==null?wn(this,ct):new this.Collection(this,function(){return nr(l)})},he.prototype.above=function(l){return l==null?wn(this,ct):new this.Collection(this,function(){return on(l,void 0,!0)})},he.prototype.aboveOrEqual=function(l){return l==null?wn(this,ct):new this.Collection(this,function(){return on(l,void 0,!1)})},he.prototype.below=function(l){return l==null?wn(this,ct):new this.Collection(this,function(){return on(void 0,l,!1,!0)})},he.prototype.belowOrEqual=function(l){return l==null?wn(this,ct):new this.Collection(this,function(){return on(void 0,l)})},he.prototype.startsWith=function(l){return typeof l!="string"?wn(this,Yo):this.between(l,l+Vn,!0,!0)},he.prototype.startsWithIgnoreCase=function(l){return l===""?this.startsWith(l):$r(this,function(p,y){return p.indexOf(y[0])===0},[l],Vn)},he.prototype.equalsIgnoreCase=function(l){return $r(this,function(p,y){return p===y[0]},[l],"")},he.prototype.anyOfIgnoreCase=function(){var l=Q.apply(K,arguments);return l.length===0?Tr(this):$r(this,function(p,y){return y.indexOf(p)!==-1},l,"")},he.prototype.startsWithAnyOfIgnoreCase=function(){var l=Q.apply(K,arguments);return l.length===0?Tr(this):$r(this,function(p,y){return y.some(function(w){return p.indexOf(w)===0})},l,Vn)},he.prototype.anyOf=function(){var l,p,y=this,w=Q.apply(K,arguments),N=this._cmp;try{w.sort(N)}catch{return wn(this,ct)}return w.length===0?Tr(this):((l=new this.Collection(this,function(){return on(w[0],w[w.length-1])}))._ondirectionchange=function(C){N=C==="next"?y._ascending:y._descending,w.sort(N)},p=0,l._addAlgorithm(function(C,A,H){for(var Z=C.key;0<N(Z,w[p]);)if(++p===w.length)return A(H),!1;return N(Z,w[p])===0||(A(function(){C.continue(w[p])}),!1)}),l)},he.prototype.notEqual=function(l){return this.inAnyRange([[-1/0,l],[l,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},he.prototype.noneOf=function(){var l=Q.apply(K,arguments);if(l.length===0)return new this.Collection(this);try{l.sort(this._ascending)}catch{return wn(this,ct)}var p=l.reduce(function(y,w){return y?y.concat([[y[y.length-1][1],w]]):[[-1/0,w]]},null);return p.push([l[l.length-1],this.db._maxKey]),this.inAnyRange(p,{includeLowers:!1,includeUppers:!1})},he.prototype.inAnyRange=function(l,ve){var y=this,w=this._cmp,N=this._ascending,C=this._descending,A=this._min,H=this._max;if(l.length===0)return Tr(this);if(!l.every(function(me){return me[0]!==void 0&&me[1]!==void 0&&N(me[0],me[1])<=0}))return wn(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 Z=!ve||ve.includeLowers!==!1,pe=ve&&ve.includeUppers===!0,ne,G=N;function ee(me,Se){return G(me[0],Se[0])}try{(ne=l.reduce(function(me,Se){for(var Ce=0,Pe=me.length;Ce<Pe;++Ce){var Fe=me[Ce];if(w(Se[0],Fe[1])<0&&0<w(Se[1],Fe[0])){Fe[0]=A(Fe[0],Se[0]),Fe[1]=H(Fe[1],Se[1]);break}}return Ce===Pe&&me.push(Se),me},[])).sort(ee)}catch{return wn(this,ct)}var fe=0,se=pe?function(me){return 0<N(me,ne[fe][1])}:function(me){return 0<=N(me,ne[fe][1])},oe=Z?function(me){return 0<C(me,ne[fe][0])}:function(me){return 0<=C(me,ne[fe][0])},ae=se,ve=new this.Collection(this,function(){return on(ne[0][0],ne[ne.length-1][1],!Z,!pe)});return ve._ondirectionchange=function(me){G=me==="next"?(ae=se,N):(ae=oe,C),ne.sort(ee)},ve._addAlgorithm(function(me,Se,Ce){for(var Pe,Fe=me.key;ae(Fe);)if(++fe===ne.length)return Se(Ce),!1;return!se(Pe=Fe)&&!oe(Pe)||(y._cmp(Fe,ne[fe][1])===0||y._cmp(Fe,ne[fe][0])===0||Se(function(){G===N?me.continue(ne[fe][0]):me.continue(ne[fe][1])}),!1)}),ve},he.prototype.startsWithAnyOf=function(){var l=Q.apply(K,arguments);return l.every(function(p){return typeof p=="string"})?l.length===0?Tr(this):this.inAnyRange(l.map(function(p){return[p,p+Vn]})):wn(this,"startsWithAnyOf() only works with strings")};var D=he;function he(){}function Ae(l){return _t(function(p){return We(p),l(p.target.error),!1})}function We(l){l.stopPropagation&&l.stopPropagation(),l.preventDefault&&l.preventDefault()}var Ot="storagemutated",sn="x-storagemutated-1",Bt=Cr(null,Ot),rr=(Lt.prototype._lock=function(){return O(!Ue.global),++this._reculock,this._reculock!==1||Ue.global||(Ue.lockOwnerFor=this),this},Lt.prototype._unlock=function(){if(O(!Ue.global),--this._reculock==0)for(Ue.global||(Ue.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var l=this._blockedFuncs.shift();try{Gn(l[1],l[0])}catch{}}return this},Lt.prototype._locked=function(){return this._reculock&&Ue.lockOwnerFor!==this},Lt.prototype.create=function(l){var p=this;if(this.mode){var y=this.db.idbdb,w=this.db._state.dbOpenError;if(O(!this.idbtrans),!l&&!y)switch(w&&w.name){case"DatabaseClosedError":throw new _e.DatabaseClosed(w);case"MissingAPIError":throw new _e.MissingAPI(w.message,w);default:throw new _e.OpenFailed(w)}if(!this.active)throw new _e.TransactionInactive;O(this._completion._state===null),(l=this.idbtrans=l||(this.db.core||y).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=_t(function(N){We(N),p._reject(l.error)}),l.onabort=_t(function(N){We(N),p.active&&p._reject(new _e.Abort(l.error)),p.active=!1,p.on("abort").fire(N)}),l.oncomplete=_t(function(){p.active=!1,p._resolve(),"mutatedParts"in l&&Bt.storagemutated.fire(l.mutatedParts)})}return this},Lt.prototype._promise=function(l,p,y){var w,N=this;return l==="readwrite"&&this.mode!=="readwrite"?It(new _e.ReadOnly("Transaction is readonly")):this.active?this._locked()?new qe(function(C,A){N._blockedFuncs.push([function(){N._promise(l,p,y).then(C,A)},Ue])}):y?Qe(function(){var C=new qe(function(A,H){N._lock();var Z=p(A,H,N);Z&&Z.then&&Z.then(A,H)});return C.finally(function(){return N._unlock()}),C._lib=!0,C}):((w=new qe(function(C,A){var H=p(C,A,N);H&&H.then&&H.then(C,A)}))._lib=!0,w):It(new _e.TransactionInactive)},Lt.prototype._root=function(){return this.parent?this.parent._root():this},Lt.prototype.waitFor=function(l){var p,y=this._root(),w=qe.resolve(l),N=(y._waitingFor?y._waitingFor=y._waitingFor.then(function(){return w}):(y._waitingFor=w,y._waitingQueue=[],p=y.idbtrans.objectStore(y.storeNames[0]),(function C(){for(++y._spinCount;y._waitingQueue.length;)y._waitingQueue.shift()();y._waitingFor&&(p.get(-1/0).onsuccess=C)})()),y._waitingFor);return new qe(function(C,A){w.then(function(H){return y._waitingQueue.push(_t(C.bind(null,H)))},function(H){return y._waitingQueue.push(_t(A.bind(null,H)))}).finally(function(){y._waitingFor===N&&(y._waitingFor=null)})})},Lt.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new _e.Abort))},Lt.prototype.table=function(l){var p=this._memoizedTables||(this._memoizedTables={});if(b(p,l))return p[l];var y=this.schema[l];if(y)return(y=new this.db.Table(l,y,this)).core=this.db.core.table(l),p[l]=y;throw new _e.NotFound("Table "+l+" not part of transaction")},Lt);function Lt(){}function Pn(l,p,y,w,N,C,A,H){return{name:l,keyPath:p,unique:y,multi:w,auto:N,compound:C,src:(y&&!A?"&":"")+(w?"*":"")+(N?"++":"")+Qo(p),type:H}}function Qo(l){return typeof l=="string"?l:l?"["+[].join.call(l,"+")+"]":""}function Go(l,p,y){return{name:l,primKey:p,indexes:y,mappedClass:null,idxByName:(w=function(N){return[N.name,N]},y.reduce(function(N,C,A){return C=w(C,A),C&&(N[C[0]]=C[1]),N},{}))};var w}var or=function(l){try{return l.only([[]]),or=function(){return[[]]},[[]]}catch{return or=function(){return Vn},Vn}};function sr(l){return l==null?function(){}:typeof l=="string"?(p=l).split(".").length===1?function(y){return y[p]}:function(y){return R(y,p)}:function(y){return R(y,l)};var p}function Vr(l){return[].slice.call(l)}var ni=0;function js(l){return l==null?":id":typeof l=="string"?l:"[".concat(l.join("+"),"]")}function Xu(l,p,A){function w(ae){if(ae.type===3)return null;if(ae.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var fe=ae.lower,se=ae.upper,oe=ae.lowerOpen,ae=ae.upperOpen;return fe===void 0?se===void 0?null:p.upperBound(se,!!ae):se===void 0?p.lowerBound(fe,!!oe):p.bound(fe,se,!!oe,!!ae)}function N(ee){var fe,se,oe=ee.name;return{name:oe,schema:ee,mutate:function(ae){var ve=ae.trans,me=ae.type,Se=ae.keys,Ce=ae.values,Pe=ae.range;return new Promise(function(Fe,Ie){Fe=_t(Fe);var Ve=ve.objectStore(oe),He=Ve.keyPath==null,Ye=me==="put"||me==="add";if(!Ye&&me!=="delete"&&me!=="deleteRange")throw new Error("Invalid operation type: "+me);var Ee,lt=(Se||Ce||{length:1}).length;if(Se&&Ce&&Se.length!==Ce.length)throw new Error("Given keys array must have same length as given values array.");if(lt===0)return Fe({numFailures:0,failures:{},results:[],lastResult:void 0});function ut(Tn){++On,We(Tn)}var gt=[],St=[],On=0;if(me==="deleteRange"){if(Pe.type===4)return Fe({numFailures:On,failures:St,results:[],lastResult:void 0});Pe.type===3?gt.push(Ee=Ve.clear()):gt.push(Ee=Ve.delete(w(Pe)))}else{var He=Ye?He?[Ce,Se]:[Ce,null]:[Se,null],ht=He[0],Ut=He[1];if(Ye)for(var cn=0;cn<lt;++cn)gt.push(Ee=Ut&&Ut[cn]!==void 0?Ve[me](ht[cn],Ut[cn]):Ve[me](ht[cn])),Ee.onerror=ut;else for(cn=0;cn<lt;++cn)gt.push(Ee=Ve[me](ht[cn])),Ee.onerror=ut}function as(Tn){Tn=Tn.target.result,gt.forEach(function(Mo,Ao){return Mo.error!=null&&(St[Ao]=Mo.error)}),Fe({numFailures:On,failures:St,results:me==="delete"?Se:gt.map(function(Mo){return Mo.result}),lastResult:Tn})}Ee.onerror=function(Tn){ut(Tn),as(Tn)},Ee.onsuccess=as})},getMany:function(ae){var ve=ae.trans,me=ae.keys;return new Promise(function(Se,Ce){Se=_t(Se);for(var Pe,Fe=ve.objectStore(oe),Ie=me.length,Ve=new Array(Ie),He=0,Ye=0,Ee=function(gt){gt=gt.target,Ve[gt._pos]=gt.result,++Ye===He&&Se(Ve)},lt=Ae(Ce),ut=0;ut<Ie;++ut)me[ut]!=null&&((Pe=Fe.get(me[ut]))._pos=ut,Pe.onsuccess=Ee,Pe.onerror=lt,++He);He===0&&Se(Ve)})},get:function(ae){var ve=ae.trans,me=ae.key;return new Promise(function(Se,Ce){Se=_t(Se);var Pe=ve.objectStore(oe).get(me);Pe.onsuccess=function(Fe){return Se(Fe.target.result)},Pe.onerror=Ae(Ce)})},query:(fe=Z,se=pe,function(ae){return new Promise(function(ve,me){ve=_t(ve);var Se,Ce,Pe,Fe,lt=ae.trans,Ie=ae.values,Ve=ae.limit,Ee=ae.query,He=(He=ae.direction)!=null?He:"next",Ye=Ve===1/0?void 0:Ve,ut=Ee.index,Ee=Ee.range,lt=lt.objectStore(oe),lt=ut.isPrimaryKey?lt:lt.index(ut.name),ut=w(Ee);if(Ve===0)return ve({result:[]});se?(Ee={query:ut,count:Ye,direction:He},(Se=Ie?lt.getAll(Ee):lt.getAllKeys(Ee)).onsuccess=function(gt){return ve({result:gt.target.result})},Se.onerror=Ae(me)):fe&&He==="next"?((Se=Ie?lt.getAll(ut,Ye):lt.getAllKeys(ut,Ye)).onsuccess=function(gt){return ve({result:gt.target.result})},Se.onerror=Ae(me)):(Ce=0,Pe=!Ie&&"openKeyCursor"in lt?lt.openKeyCursor(ut,He):lt.openCursor(ut,He),Fe=[],Pe.onsuccess=function(){var gt=Pe.result;return!gt||(Fe.push(Ie?gt.value:gt.primaryKey),++Ce===Ve)?ve({result:Fe}):void gt.continue()},Pe.onerror=Ae(me))})}),openCursor:function(ae){var ve=ae.trans,me=ae.values,Se=ae.query,Ce=ae.reverse,Pe=ae.unique;return new Promise(function(Fe,Ie){Fe=_t(Fe);var Ye=Se.index,Ve=Se.range,He=ve.objectStore(oe),He=Ye.isPrimaryKey?He:He.index(Ye.name),Ye=Ce?Pe?"prevunique":"prev":Pe?"nextunique":"next",Ee=!me&&"openKeyCursor"in He?He.openKeyCursor(w(Ve),Ye):He.openCursor(w(Ve),Ye);Ee.onerror=Ae(Ie),Ee.onsuccess=_t(function(lt){var ut,gt,St,On,ht=Ee.result;ht?(ht.___id=++ni,ht.done=!1,ut=ht.continue.bind(ht),gt=(gt=ht.continuePrimaryKey)&&gt.bind(ht),St=ht.advance.bind(ht),On=function(){throw new Error("Cursor not stopped")},ht.trans=ve,ht.stop=ht.continue=ht.continuePrimaryKey=ht.advance=function(){throw new Error("Cursor not started")},ht.fail=_t(Ie),ht.next=function(){var Ut=this,cn=1;return this.start(function(){return cn--?Ut.continue():Ut.stop()}).then(function(){return Ut})},ht.start=function(Ut){function cn(){if(Ee.result)try{Ut()}catch(Tn){ht.fail(Tn)}else ht.done=!0,ht.start=function(){throw new Error("Cursor behind last entry")},ht.stop()}var as=new Promise(function(Tn,Mo){Tn=_t(Tn),Ee.onerror=Ae(Mo),ht.fail=Mo,ht.stop=function(Ao){ht.stop=ht.continue=ht.continuePrimaryKey=ht.advance=On,Tn(Ao)}});return Ee.onsuccess=_t(function(Tn){Ee.onsuccess=cn,cn()}),ht.continue=ut,ht.continuePrimaryKey=gt,ht.advance=St,cn(),as},Fe(ht)):Fe(null)},Ie)})},count:function(ae){var ve=ae.query,me=ae.trans,Se=ve.index,Ce=ve.range;return new Promise(function(Pe,Fe){var Ie=me.objectStore(oe),Ie=Se.isPrimaryKey?Ie:Ie.index(Se.name),Ve=w(Ce),Ve=Ve?Ie.count(Ve):Ie.count();Ve.onsuccess=_t(function(He){return Pe(He.target.result)}),Ve.onerror=Ae(Fe)})}}}C=A,H=Vr((A=l).objectStoreNames),ne=0<H.length?C.objectStore(H[0]):{};var C,A={schema:{name:A.name,tables:H.map(function(ee){return C.objectStore(ee)}).map(function(ee){var fe=ee.keyPath,se=ee.autoIncrement,ae=h(fe),oe={},ae={name:ee.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:fe==null,compound:ae,keyPath:fe,autoIncrement:se,unique:!0,extractKey:sr(fe)},indexes:Vr(ee.indexNames).map(function(ve){return ee.index(ve)}).map(function(Ce){var Pe=Ce.name,me=Ce.unique,Se=Ce.multiEntry,Ce=Ce.keyPath,Pe={name:Pe,compound:h(Ce),keyPath:Ce,unique:me,multiEntry:Se,extractKey:sr(Ce)};return oe[js(Ce)]=Pe}),getIndexByKeyPath:function(ve){return oe[js(ve)]}};return oe[":id"]=ae.primaryKey,fe!=null&&(oe[js(fe)]=ae.primaryKey),ae})},hasGetAll:0<H.length&&"getAll"in ne&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604),hasIdb3Features:"getAllRecords"in ne},H=A.schema,Z=A.hasGetAll,pe=A.hasIdb3Features,ne=H.tables.map(N),G={};return ne.forEach(function(ee){return G[ee.name]=ee}),{stack:"dbcore",transaction:l.transaction.bind(l),table:function(ee){if(G[ee])return G[ee];throw new Error("Table '".concat(ee,"' not found"))},MIN_KEY:-1/0,MAX_KEY:or(p),schema:H}}function Gi(l,p,y,w){return y=y.IDBKeyRange,p=Xu(p,y,w),{dbcore:l.dbcore.reduce(function(N,C){return C=C.create,i(i({},N),C(N))},p)}}function jo(l,p){var y=p.db,y=Gi(l._middlewares,y,l._deps,p);l.core=y.dbcore,l.tables.forEach(function(w){var N=w.name;l.core.schema.tables.some(function(C){return C.name===N})&&(w.core=l.core.table(N),l[N]instanceof l.Table)&&(l[N].core=w.core)})}function Zo(l,p,y,w){y.forEach(function(N){var C=w[N];p.forEach(function(A){var H=(function Z(pe,ne){return T(pe,ne)||(pe=x(pe))&&Z(pe,ne)})(A,N);(!H||"value"in H&&H.value===void 0)&&(A===l.Transaction.prototype||A instanceof l.Transaction?j(A,N,{get:function(){return this.table(N)},set:function(Z){_(this,N,{value:Z,writable:!0,configurable:!0,enumerable:!0})}}):A[N]=new l.Table(N,C))})})}function ri(l,p){p.forEach(function(y){for(var w in y)y[w]instanceof l.Table&&delete y[w]})}function fo(l,p){return l._cfg.version-p._cfg.version}function Zi(l,p,y,w){var N=l._dbSchema,C=(y.objectStoreNames.contains("$meta")&&!N.$meta&&(N.$meta=Go("$meta",ii("")[0],[]),l._storeNames.push("$meta")),l._createTransaction("readwrite",l._storeNames,N)),A=(C.create(y),C._completion.catch(w),C._reject.bind(C)),H=Ue.transless||Ue;Qe(function(){if(Ue.trans=C,Ue.transless=H,p!==0)return jo(l,y),pe=p,((Z=C).storeNames.includes("$meta")?Z.table("$meta").get("version").then(function(ne){return ne??pe}):qe.resolve(pe)).then(function(ae){var G=l,ee=ae,fe=C,se=y,oe=[],ae=G._versions,ve=G._dbSchema=bn(0,G.idbdb,se);return(ae=ae.filter(function(me){return me._cfg.version>=ee})).length===0?qe.resolve():(ae.forEach(function(me){oe.push(function(){var Se,Ce,Pe,Fe=ve,Ie=me._cfg.dbschema,Ve=(Kr(G,Fe,se),Kr(G,Ie,se),ve=G._dbSchema=Ie,si(Fe,Ie)),He=(Ve.add.forEach(function(Ye){es(se,Ye[0],Ye[1].primKey,Ye[1].indexes)}),Ve.change.forEach(function(Ye){if(Ye.recreate)throw new _e.Upgrade("Not yet support for changing primary key");var Ee=se.objectStore(Ye.name);Ye.add.forEach(function(lt){return Es(Ee,lt)}),Ye.change.forEach(function(lt){Ee.deleteIndex(lt.name),Es(Ee,lt)}),Ye.del.forEach(function(lt){return Ee.deleteIndex(lt)})}),me._cfg.contentUpgrade);if(He&&me._cfg.version>ee)return jo(G,se),fe._memoizedTables={},Se=Y(Ie),Ve.del.forEach(function(Ye){Se[Ye]=Fe[Ye]}),ri(G,[G.Transaction.prototype]),Zo(G,[G.Transaction.prototype],c(Se),Se),fe.schema=Se,(Ce=L(He))&&kr(),Ie=qe.follow(function(){var Ye;(Pe=He(fe))&&Ce&&(Ye=yt.bind(null,null),Pe.then(Ye,Ye))}),Pe&&typeof Pe.then=="function"?qe.resolve(Pe):Ie.then(function(){return Pe})}),oe.push(function(Se){var Ce,Pe,Fe=me._cfg.dbschema;Ce=Fe,Pe=Se,[].slice.call(Pe.db.objectStoreNames).forEach(function(Ie){return Ce[Ie]==null&&Pe.db.deleteObjectStore(Ie)}),ri(G,[G.Transaction.prototype]),Zo(G,[G.Transaction.prototype],G._storeNames,G._dbSchema),fe.schema=G._dbSchema}),oe.push(function(Se){G.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(G.idbdb.version/10)===me._cfg.version?(G.idbdb.deleteObjectStore("$meta"),delete G._dbSchema.$meta,G._storeNames=G._storeNames.filter(function(Ce){return Ce!=="$meta"})):Se.objectStore("$meta").put(me._cfg.version,"version"))})}),(function me(){return oe.length?qe.resolve(oe.shift()(fe.idbtrans)).then(me):qe.resolve()})().then(function(){Cs(ve,se)}))}).catch(A);var Z,pe;c(N).forEach(function(ne){es(y,ne,N[ne].primKey,N[ne].indexes)}),jo(l,y),qe.follow(function(){return l.on.populate.fire(C)}).catch(A)})}function oi(l,p){Cs(l._dbSchema,p),p.db.version%10!=0||p.objectStoreNames.contains("$meta")||p.db.createObjectStore("$meta").add(Math.ceil(p.db.version/10-1),"version");var y=bn(0,l.idbdb,p);Kr(l,l._dbSchema,p);for(var w=0,N=si(y,l._dbSchema).change;w<N.length;w++){var C=(A=>{if(A.change.length||A.recreate)return console.warn("Unable to patch indexes of table ".concat(A.name," because it has changes on the type of index or primary key.")),{value:void 0};var H=p.objectStore(A.name);A.add.forEach(function(Z){Dt&&console.debug("Dexie upgrade patch: Creating missing index ".concat(A.name,".").concat(Z.src)),Es(H,Z)})})(N[w]);if(typeof C=="object")return C.value}}function si(l,p){var y,w={del:[],add:[],change:[]};for(y in l)p[y]||w.del.push(y);for(y in p){var N=l[y],C=p[y];if(N){var A={name:y,def:C,recreate:!1,del:[],add:[],change:[]};if(""+(N.primKey.keyPath||"")!=""+(C.primKey.keyPath||"")||N.primKey.auto!==C.primKey.auto)A.recreate=!0,w.change.push(A);else{var H=N.idxByName,Z=C.idxByName,pe=void 0;for(pe in H)Z[pe]||A.del.push(pe);for(pe in Z){var ne=H[pe],G=Z[pe];ne?ne.src!==G.src&&A.change.push(G):A.add.push(G)}(0<A.del.length||0<A.add.length||0<A.change.length)&&w.change.push(A)}}else w.add.push([y,C])}return w}function es(l,p,y,w){var N=l.db.createObjectStore(p,y.keyPath?{keyPath:y.keyPath,autoIncrement:y.auto}:{autoIncrement:y.auto});w.forEach(function(C){return Es(N,C)})}function Cs(l,p){c(l).forEach(function(y){p.db.objectStoreNames.contains(y)||(Dt&&console.debug("Dexie: Creating missing table",y),es(p,y,l[y].primKey,l[y].indexes))})}function Es(l,p){l.createIndex(p.name,p.keyPath,{unique:p.unique,multiEntry:p.multi})}function bn(l,p,y){var w={};return V(p.objectStoreNames,0).forEach(function(N){for(var C=y.objectStore(N),A=Pn(Qo(pe=C.keyPath),pe||"",!0,!1,!!C.autoIncrement,pe&&typeof pe!="string",!0),H=[],Z=0;Z<C.indexNames.length;++Z){var ne=C.index(C.indexNames[Z]),pe=ne.keyPath,ne=Pn(ne.name,pe,!!ne.unique,!!ne.multiEntry,!1,pe&&typeof pe!="string",!1);H.push(ne)}w[N]=Go(N,A,H)}),w}function Kr(l,p,y){for(var w=y.db.objectStoreNames,N=0;N<w.length;++N){var C=w[N],A=y.objectStore(C);l._hasGetAll="getAll"in A;for(var H=0;H<A.indexNames.length;++H){var Z,pe=A.indexNames[H],ne=A.index(pe).keyPath,ne=typeof ne=="string"?ne:"["+V(ne).join("+")+"]";p[C]&&(Z=p[C].idxByName[ne])&&(Z.name=pe,delete p[C].idxByName[ne],p[C].idxByName[pe]=Z)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&d.WorkerGlobalScope&&d instanceof d.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(l._hasGetAll=!1)}function ii(l){return l.split(",").map(function(p,y){var N=p.split(":"),w=(w=N[1])==null?void 0:w.trim(),N=(p=N[0].trim()).replace(/([&*]|\+\+)/g,""),C=/^\[/.test(N)?N.match(/^\[(.*)\]$/)[1].split("+"):N;return Pn(N,C||null,/\&/.test(p),/\*/.test(p),/\+\+/.test(p),h(C),y===0,w)})}ts.prototype._createTableSchema=Go,ts.prototype._parseIndexSyntax=ii,ts.prototype._parseStoresSpec=function(l,p){var y=this;c(l).forEach(function(w){if(l[w]!==null){var N=y._parseIndexSyntax(l[w]),C=N.shift();if(!C)throw new _e.Schema("Invalid schema for table "+w+": "+l[w]);if(C.unique=!0,C.multi)throw new _e.Schema("Primary key cannot be multiEntry*");N.forEach(function(A){if(A.auto)throw new _e.Schema("Only primary key can be marked as autoIncrement (++)");if(!A.keyPath)throw new _e.Schema("Index must have a name and cannot be an empty string")}),C=y._createTableSchema(w,C,N),p[w]=C}})},ts.prototype.stores=function(y){var p=this.db,y=(this._cfg.storesSource=this._cfg.storesSource?g(this._cfg.storesSource,y):y,p._versions),w={},N={};return y.forEach(function(C){g(w,C._cfg.storesSource),N=C._cfg.dbschema={},C._parseStoresSpec(w,N)}),p._dbSchema=N,ri(p,[p._allTables,p,p.Transaction.prototype]),Zo(p,[p._allTables,p,p.Transaction.prototype,this._cfg.tables],c(N),N),p._storeNames=c(N),this},ts.prototype.upgrade=function(l){return this._cfg.contentUpgrade=Ht(this._cfg.contentUpgrade||ze,l),this};var Ps=ts;function ts(){}var Co=(()=>{var l,p,y;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(l=new Set,p=new FinalizationRegistry(function(w){l.delete(w)}),{toArray:function(){return Array.from(l).map(function(w){return w.deref()}).filter(function(w){return w!==void 0})},add:function(w){var N=new WeakRef(w._novip);l.add(N),p.register(w._novip,N,N),l.size>w._options.maxConnections&&(N=l.values().next().value,l.delete(N),p.unregister(N))},remove:function(w){if(w)for(var N=l.values(),C=N.next();!C.done;){var A=C.value;if(A.deref()===w._novip)return l.delete(A),void p.unregister(A);C=N.next()}}}):(y=[],{toArray:function(){return y},add:function(w){y.push(w._novip)},remove:function(w){w&&(w=y.indexOf(w._novip))!==-1&&y.splice(w,1)}})})();function Ts(l,p){var y=l._dbNamesDB;return y||(y=l._dbNamesDB=new Yr(_r,{addons:[],indexedDB:l,IDBKeyRange:p})).version(1).stores({dbnames:"name"}),y.table("dbnames")}function Eo(l){return l&&typeof l.databases=="function"}function ns(l){return Qe(function(){return Ue.letThrough=!0,l()})}function ai(l){return!("from"in l)}var Sn=function(l,p){var y;if(!this)return y=new Sn,l&&"d"in l&&g(y,l),y;g(this,arguments.length?{d:1,from:l,to:1<arguments.length?p:l}:{d:0})};function $s(l,p,y){var w=wt(p,y);if(!isNaN(w)){if(0<w)throw RangeError();if(ai(l))return g(l,{from:p,to:y,d:1});var w=l.l,N=l.r;if(wt(y,l.from)<0)return w?$s(w,p,y):l.l={from:p,to:y,d:1,l:null,r:null},nl(l);if(0<wt(p,l.to))return N?$s(N,p,y):l.r={from:p,to:y,d:1,l:null,r:null},nl(l);wt(p,l.from)<0&&(l.from=p,l.l=null,l.d=N?N.d+1:1),0<wt(y,l.to)&&(l.to=y,l.r=null,l.d=l.l?l.l.d+1:1),p=!l.r,w&&!l.l&&Ms(l,w),N&&p&&Ms(l,N)}}function Ms(l,p){ai(p)||(function y(w,N){var C=N.from,A=N.l,H=N.r;$s(w,C,N.to),A&&y(w,A),H&&y(w,H)})(l,p)}function li(l,p){var y=ui(p),w=y.next();if(!w.done)for(var N=w.value,C=ui(l),A=C.next(N.from),H=A.value;!w.done&&!A.done;){if(wt(H.from,N.to)<=0&&0<=wt(H.to,N.from))return!0;wt(N.from,H.from)<0?N=(w=y.next(H.from)).value:H=(A=C.next(N.from)).value}return!1}function ui(l){var p=ai(l)?null:{s:0,n:l};return{next:function(y){for(var w=0<arguments.length;p;)switch(p.s){case 0:if(p.s=1,w)for(;p.n.l&&wt(y,p.n.from)<0;)p={up:p,n:p.n.l,s:1};else for(;p.n.l;)p={up:p,n:p.n.l,s:1};case 1:if(p.s=2,!w||wt(y,p.n.to)<=0)return{value:p.n,done:!1};case 2:if(p.n.r){p.s=3,p={up:p,n:p.n.r,s:0};continue}case 3:p=p.up}return{done:!0}}}}function nl(l){var p,y,w,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&&(p=N=="r"?"l":"r",y=i({},l),w=l[N],l.from=w.from,l.to=w.to,l[N]=w[N],y[N]=w[p],(l[p]=y).d=rl(y)),l.d=rl(l)}function rl(y){var p=y.r,y=y.l;return(p?y?Math.max(p.d,y.d):p.d:y?y.d:0)+1}function ci(l,p){return c(p).forEach(function(y){l[y]?Ms(l[y],p[y]):l[y]=(function w(N){var C,A,H={};for(C in N)b(N,C)&&(A=N[C],H[C]=!A||typeof A!="object"||ie.has(A.constructor)?A:w(A));return H})(p[y])}),l}function ea(l,p){return l.all||p.all||Object.keys(l).some(function(y){return p[y]&&li(p[y],l[y])})}S(Sn.prototype,((At={add:function(l){return Ms(this,l),this},addKey:function(l){return $s(this,l,l),this},addKeys:function(l){var p=this;return l.forEach(function(y){return $s(p,y,y)}),this},hasKey:function(l){var p=ui(this).next(l).value;return p&&wt(p.from,l)<=0&&0<=wt(p.to,l)}})[J]=function(){return ui(this)},At));var po={},ta={},na=!1;function di(l){ci(ta,l),na||(na=!0,setTimeout(function(){na=!1,ra(ta,!(ta={}))},0))}function ra(l,p){p===void 0&&(p=!1);var y=new Set;if(l.all)for(var w=0,N=Object.values(po);w<N.length;w++)fi(H=N[w],l,y,p);else for(var C in l){var A,H,C=/^idb\:\/\/(.*)\/(.*)\//.exec(C);C&&(A=C[1],C=C[2],H=po["idb://".concat(A,"/").concat(C)])&&fi(H,l,y,p)}y.forEach(function(Z){return Z()})}function fi(l,p,y,w){for(var N=[],C=0,A=Object.entries(l.queries.query);C<A.length;C++){for(var H=A[C],Z=H[0],pe=[],ne=0,G=H[1];ne<G.length;ne++){var ee=G[ne];ea(p,ee.obsSet)?ee.subscribers.forEach(function(ae){return y.add(ae)}):w&&pe.push(ee)}w&&N.push([Z,pe])}if(w)for(var fe=0,se=N;fe<se.length;fe++){var oe=se[fe],Z=oe[0],pe=oe[1];l.queries.query[Z]=pe}}function Qu(l){var p=l._state,y=l._deps.indexedDB;if(p.isBeingOpened||l.idbdb)return p.dbReadyPromise.then(function(){return p.dbOpenError?It(p.dbOpenError):l});p.isBeingOpened=!0,p.dbOpenError=null,p.openComplete=!1;var w=p.openCanceller,N=Math.round(10*l.verno),C=!1;function A(){if(p.openCanceller!==w)throw new _e.DatabaseClosed("db.open() was cancelled")}function H(){return new qe(function(ee,fe){if(A(),!y)throw new _e.MissingAPI;var se=l.name,oe=p.autoSchema||!N?y.open(se):y.open(se,N);if(!oe)throw new _e.MissingAPI;oe.onerror=Ae(fe),oe.onblocked=_t(l._fireOnBlocked),oe.onupgradeneeded=_t(function(ae){var ve;ne=oe.transaction,p.autoSchema&&!l._options.allowEmptyDB?(oe.onerror=We,ne.abort(),oe.result.close(),(ve=y.deleteDatabase(se)).onsuccess=ve.onerror=_t(function(){fe(new _e.NoSuchDatabase("Database ".concat(se," doesnt exist")))})):(ne.onerror=Ae(fe),ve=ae.oldVersion>Math.pow(2,62)?0:ae.oldVersion,G=ve<1,l.idbdb=oe.result,C&&oi(l,ne),Zi(l,ve/10,ne,fe))},fe),oe.onsuccess=_t(function(){ne=null;var ae,ve,me,Se,Ce,Pe,Fe=l.idbdb=oe.result,Ie=V(Fe.objectStoreNames);if(0<Ie.length)try{var Ve=Fe.transaction((Ce=Ie).length===1?Ce[0]:Ce,"readonly");if(p.autoSchema)Pe=Fe,Se=Ve,(me=l).verno=Pe.version/10,Se=me._dbSchema=bn(0,Pe,Se),me._storeNames=V(Pe.objectStoreNames,0),Zo(me,[me._allTables],c(Se),Se);else if(Kr(l,l._dbSchema,Ve),ve=Ve,((ve=si(bn(0,(ae=l).idbdb,ve),ae._dbSchema)).add.length||ve.change.some(function(He){return He.add.length||He.change.length}))&&!C)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."),Fe.close(),N=Fe.version+1,C=!0,ee(H());jo(l,Ve)}catch{}Co.add(l),Fe.onversionchange=_t(function(He){p.vcFired=!0,l.on("versionchange").fire(He)}),Fe.onclose=_t(function(){l.close({disableAutoOpen:!1})}),G&&(Ie=l._deps,Ce=se,Eo(Pe=Ie.indexedDB)||Ce===_r||Ts(Pe,Ie.IDBKeyRange).put({name:Ce}).catch(ze)),ee()},fe)}).catch(function(ee){switch(ee==null?void 0:ee.name){case"UnknownError":if(0<p.PR1398_maxLoop)return p.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),H();break;case"VersionError":if(0<N)return N=0,H()}return qe.reject(ee)})}var Z,pe=p.dbReadyResolve,ne=null,G=!1;return qe.race([w,(typeof navigator>"u"?qe.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(ee){function fe(){return indexedDB.databases().finally(ee)}Z=setInterval(fe,100),fe()}).finally(function(){return clearInterval(Z)}):Promise.resolve()).then(H)]).then(function(){return A(),p.onReadyBeingFired=[],qe.resolve(ns(function(){return l.on.ready.fire(l.vip)})).then(function ee(){var fe;if(0<p.onReadyBeingFired.length)return fe=p.onReadyBeingFired.reduce(Ht,ze),p.onReadyBeingFired=[],qe.resolve(ns(function(){return fe(l.vip)})).then(ee)})}).finally(function(){p.openCanceller===w&&(p.onReadyBeingFired=null,p.isBeingOpened=!1)}).catch(function(ee){p.dbOpenError=ee;try{ne&&ne.abort()}catch{}return w===p.openCanceller&&l._close(),It(ee)}).finally(function(){p.openComplete=!0,pe()}).then(function(){var ee;return G&&(ee={},l.tables.forEach(function(fe){fe.schema.indexes.forEach(function(se){se.name&&(ee["idb://".concat(l.name,"/").concat(fe.name,"/").concat(se.name)]=new Sn(-1/0,[[[]]]))}),ee["idb://".concat(l.name,"/").concat(fe.name,"/")]=ee["idb://".concat(l.name,"/").concat(fe.name,"/:dels")]=new Sn(-1/0,[[[]]])}),Bt(Ot).fire(ee),ra(ee,!0)),l})}function oa(l){function p(C){return l.next(C)}var y=N(p),w=N(function(C){return l.throw(C)});function N(C){return function(H){var H=C(H),Z=H.value;return H.done?Z:Z&&typeof Z.then=="function"?Z.then(y,w):h(Z)?Promise.all(Z).then(y,w):y(Z)}}return N(p)()}function pi(l,p,y){for(var w=h(l)?l.slice():[l],N=0;N<y;++N)w.push(p);return w}var ol={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(l){return i(i({},l),{table:function(w){var y=l.table(w),w=y.schema,N={},C=[];function A(ee,fe,se){var me=js(ee),oe=N[me]=N[me]||[],ae=ee==null?0:typeof ee=="string"?1:ee.length,ve=0<fe,me=i(i({},se),{name:ve?"".concat(me,"(virtual-from:").concat(se.name,")"):se.name,lowLevelIndex:se,isVirtual:ve,keyTail:fe,keyLength:ae,extractKey:sr(ee),unique:!ve&&se.unique});return oe.push(me),me.isPrimaryKey||C.push(me),1<ae&&A(ae===2?ee[0]:ee.slice(0,ae-1),fe+1,se),oe.sort(function(Se,Ce){return Se.keyTail-Ce.keyTail}),me}var H=A(w.primaryKey.keyPath,0,w.primaryKey);N[":id"]=[H];for(var Z=0,pe=w.indexes;Z<pe.length;Z++){var ne=pe[Z];A(ne.keyPath,0,ne)}function G(ee){var fe,se=ee.query.index;return se.isVirtual?i(i({},ee),{query:{index:se.lowLevelIndex,range:(fe=ee.query.range,se=se.keyTail,{type:fe.type===1?2:fe.type,lower:pi(fe.lower,fe.lowerOpen?l.MAX_KEY:l.MIN_KEY,se),lowerOpen:!0,upper:pi(fe.upper,fe.upperOpen?l.MIN_KEY:l.MAX_KEY,se),upperOpen:!0})}}):ee}return i(i({},y),{schema:i(i({},w),{primaryKey:H,indexes:C,getIndexByKeyPath:function(ee){return(ee=N[js(ee)])&&ee[0]}}),count:function(ee){return y.count(G(ee))},query:function(ee){return y.query(G(ee))},openCursor:function(ee){var fe=ee.query.index,se=fe.keyTail,oe=fe.keyLength;return fe.isVirtual?y.openCursor(G(ee)).then(function(ve){return ve&&ae(ve)}):y.openCursor(ee);function ae(ve){return Object.create(ve,{continue:{value:function(me){me!=null?ve.continue(pi(me,ee.reverse?l.MAX_KEY:l.MIN_KEY,se)):ee.unique?ve.continue(ve.key.slice(0,oe).concat(ee.reverse?l.MIN_KEY:l.MAX_KEY,se)):ve.continue()}},continuePrimaryKey:{value:function(me,Se){ve.continuePrimaryKey(pi(me,l.MAX_KEY,se),Se)}},primaryKey:{get:function(){return ve.primaryKey}},key:{get:function(){var me=ve.key;return oe===1?me[0]:me.slice(0,oe)}},value:{get:function(){return ve.value}}})}}})}})}};function sa(l,p,y,w){return y=y||{},w=w||"",c(l).forEach(function(N){var C,A,H;b(p,N)?(C=l[N],A=p[N],typeof C=="object"&&typeof A=="object"&&C&&A?(H=ce(C))!==ce(A)?y[w+N]=p[N]:H==="Object"?sa(C,A,y,w+N+"."):C!==A&&(y[w+N]=p[N]):C!==A&&(y[w+N]=p[N])):y[w+N]=void 0}),c(p).forEach(function(N){b(l,N)||(y[w+N]=p[N])}),y}function ia(l,p){return p.type==="delete"?p.keys:p.keys||p.values.map(l.extractKey)}var Gu={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(l){return i(i({},l),{table:function(p){var y=l.table(p),w=y.schema.primaryKey;return i(i({},y),{mutate:function(N){var C=Ue.trans,A=C.table(p).hook,H=A.deleting,Z=A.creating,pe=A.updating;switch(N.type){case"add":if(Z.fire===ze)break;return C._promise("readwrite",function(){return ne(N)},!0);case"put":if(Z.fire===ze&&pe.fire===ze)break;return C._promise("readwrite",function(){return ne(N)},!0);case"delete":if(H.fire===ze)break;return C._promise("readwrite",function(){return ne(N)},!0);case"deleteRange":if(H.fire===ze)break;return C._promise("readwrite",function(){return(function G(ee,fe,se){return y.query({trans:ee,values:!1,query:{index:w,range:fe},limit:se}).then(function(oe){var ae=oe.result;return ne({type:"delete",keys:ae,trans:ee}).then(function(ve){return 0<ve.numFailures?Promise.reject(ve.failures[0]):ae.length<se?{failures:[],numFailures:0,lastResult:void 0}:G(ee,i(i({},fe),{lower:ae[ae.length-1],lowerOpen:!0}),se)})})})(N.trans,N.range,1e4)},!0)}return y.mutate(N);function ne(G){var ee,fe,se,oe=Ue.trans,ae=G.keys||ia(w,G);if(ae)return(G=G.type==="add"||G.type==="put"?i(i({},G),{keys:ae}):i({},G)).type!=="delete"&&(G.values=a([],G.values)),G.keys&&(G.keys=a([],G.keys)),ee=y,se=ae,((fe=G).type==="add"?Promise.resolve([]):ee.getMany({trans:fe.trans,keys:se,cache:"immutable"})).then(function(ve){var me=ae.map(function(Se,Ce){var Pe,Fe,Ie,Ve=ve[Ce],He={onerror:null,onsuccess:null};return G.type==="delete"?H.fire.call(He,Se,Ve,oe):G.type==="add"||Ve===void 0?(Pe=Z.fire.call(He,Se,G.values[Ce],oe),Se==null&&Pe!=null&&(G.keys[Ce]=Se=Pe,w.outbound||W(G.values[Ce],w.keyPath,Se))):(Pe=sa(Ve,G.values[Ce]),(Fe=pe.fire.call(He,Pe,Se,Ve,oe))&&(Ie=G.values[Ce],Object.keys(Fe).forEach(function(Ye){b(Ie,Ye)?Ie[Ye]=Fe[Ye]:W(Ie,Ye,Fe[Ye])}))),He});return y.mutate(G).then(function(Se){for(var Ce=Se.failures,Pe=Se.results,Fe=Se.numFailures,Se=Se.lastResult,Ie=0;Ie<ae.length;++Ie){var Ve=(Pe||ae)[Ie],He=me[Ie];Ve==null?He.onerror&&He.onerror(Ce[Ie]):He.onsuccess&&He.onsuccess(G.type==="put"&&ve[Ie]?G.values[Ie]:Ve)}return{failures:Ce,results:Pe,numFailures:Fe,lastResult:Se}}).catch(function(Se){return me.forEach(function(Ce){return Ce.onerror&&Ce.onerror(Se)}),Promise.reject(Se)})});throw new Error("Keys missing")}}})}})}};function sl(l,p,y){try{if(!p||p.keys.length<l.length)return null;for(var w=[],N=0,C=0;N<p.keys.length&&C<l.length;++N)wt(p.keys[N],l[C])===0&&(w.push(y?te(p.values[N]):p.values[N]),++C);return w.length===l.length?w:null}catch{return null}}var Zu={stack:"dbcore",level:-1,create:function(l){return{table:function(p){var y=l.table(p);return i(i({},y),{getMany:function(w){var N;return w.cache?(N=sl(w.keys,w.trans._cache,w.cache==="clone"))?qe.resolve(N):y.getMany(w).then(function(C){return w.trans._cache={keys:w.keys,values:w.cache==="clone"?te(C):C},C}):y.getMany(w)},mutate:function(w){return w.type!=="add"&&(w.trans._cache=null),y.mutate(w)}})}}}};function il(l,p){return l.trans.mode==="readonly"&&!!l.subscr&&!l.trans.explicit&&l.trans.db._options.cache!=="disabled"&&!p.schema.primaryKey.outbound}function al(l,p){switch(l){case"query":return p.values&&!p.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var aa={stack:"dbcore",level:0,name:"Observability",create:function(l){var p=l.schema.name,y=new Sn(l.MIN_KEY,l.MAX_KEY);return i(i({},l),{transaction:function(w,N,C){if(Ue.subscr&&N!=="readonly")throw new _e.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Ue.querier));return l.transaction(w,N,C)},table:function(w){function N(ae){var oe,ae=ae.query;return[oe=ae.index,new Sn((oe=(ae=ae.range).lower)!=null?oe:l.MIN_KEY,(oe=ae.upper)!=null?oe:l.MAX_KEY)]}var C=l.table(w),A=C.schema,H=A.primaryKey,Z=A.indexes,pe=H.extractKey,ne=H.outbound,G=H.autoIncrement&&Z.filter(function(se){return se.compound&&se.keyPath.includes(H.keyPath)}),ee=i(i({},C),{mutate:function(se){function oe(Ee){return Ee="idb://".concat(p,"/").concat(w,"/").concat(Ee),Ce[Ee]||(Ce[Ee]=new Sn)}var ae,ve,me,Se=se.trans,Ce=se.mutatedParts||(se.mutatedParts={}),Pe=oe(""),Fe=oe(":dels"),Ie=se.type,He=se.type==="deleteRange"?[se.range]:se.type==="delete"?[se.keys]:se.values.length<50?[ia(H,se).filter(function(Ee){return Ee}),se.values]:[],Ve=He[0],He=He[1],Ye=se.trans._cache;return h(Ve)?(Pe.addKeys(Ve),(Ie=Ie==="delete"||Ve.length===He.length?sl(Ve,Ye):null)||Fe.addKeys(Ve),(Ie||He)&&(ae=oe,ve=Ie,me=He,A.indexes.forEach(function(Ee){var lt=ae(Ee.name||"");function ut(St){return St!=null?Ee.extractKey(St):null}function gt(St){Ee.multiEntry&&h(St)?St.forEach(function(On){return lt.addKey(On)}):lt.addKey(St)}(ve||me).forEach(function(St,Ut){var ht=ve&&ut(ve[Ut]),Ut=me&&ut(me[Ut]);wt(ht,Ut)!==0&&(ht!=null&&gt(ht),Ut!=null)&&gt(Ut)})}))):Ve?(He={from:(Ye=Ve.lower)!=null?Ye:l.MIN_KEY,to:(Ie=Ve.upper)!=null?Ie:l.MAX_KEY},Fe.add(He),Pe.add(He)):(Pe.add(y),Fe.add(y),A.indexes.forEach(function(Ee){return oe(Ee.name).add(y)})),C.mutate(se).then(function(Ee){return!Ve||se.type!=="add"&&se.type!=="put"||(Pe.addKeys(Ee.results),G&&G.forEach(function(lt){for(var ut=se.values.map(function(ht){return lt.extractKey(ht)}),gt=lt.keyPath.findIndex(function(ht){return ht===H.keyPath}),St=0,On=Ee.results.length;St<On;++St)ut[St][gt]=Ee.results[St];oe(lt.name).addKeys(ut)})),Se.mutatedParts=ci(Se.mutatedParts||{},Ce),Ee})}}),fe={get:function(se){return[H,new Sn(se.key)]},getMany:function(se){return[H,new Sn().addKeys(se.keys)]},count:N,query:N,openCursor:N};return c(fe).forEach(function(se){ee[se]=function(oe){var ae=Ue.subscr,ve=!!ae,me=il(Ue,C)&&al(se,oe)?oe.obsSet={}:ae;if(ve){var Se,ae=function(He){return He="idb://".concat(p,"/").concat(w,"/").concat(He),me[He]||(me[He]=new Sn)},Ce=ae(""),Pe=ae(":dels"),ve=fe[se](oe),Fe=ve[0],ve=ve[1];if((se==="query"&&Fe.isPrimaryKey&&!oe.values?Pe:ae(Fe.name||"")).add(ve),!Fe.isPrimaryKey){if(se!=="count")return Se=se==="query"&&ne&&oe.values&&C.query(i(i({},oe),{values:!1})),C[se].apply(this,arguments).then(function(He){if(se==="query"){if(ne&&oe.values)return Se.then(function(ut){return ut=ut.result,Ce.addKeys(ut),He});var Ye=oe.values?He.result.map(pe):He.result;(oe.values?Ce:Pe).addKeys(Ye)}else{var Ee,lt;if(se==="openCursor")return lt=oe.values,(Ee=He)&&Object.create(Ee,{key:{get:function(){return Pe.addKey(Ee.primaryKey),Ee.key}},primaryKey:{get:function(){var ut=Ee.primaryKey;return Pe.addKey(ut),ut}},value:{get:function(){return lt&&Ce.addKey(Ee.primaryKey),Ee.value}}})}return He});Pe.add(y)}}return C[se].apply(this,arguments)}}),ee}})}};function rs(l,p,y){var w;return y.numFailures===0?p:p.type==="deleteRange"||(w=p.keys?p.keys.length:"values"in p&&p.values?p.values.length:1,y.numFailures===w)?null:(w=i({},p),h(w.keys)&&(w.keys=w.keys.filter(function(N,C){return!(C in y.failures)})),"values"in w&&h(w.values)&&(w.values=w.values.filter(function(N,C){return!(C in y.failures)})),w)}function la(l,p){return y=l,((w=p).lower===void 0||(w.lowerOpen?0<wt(y,w.lower):0<=wt(y,w.lower)))&&(y=l,(w=p).upper===void 0||(w.upperOpen?wt(y,w.upper)<0:wt(y,w.upper)<=0));var y,w}function ua(l,p,y,w,N,C){var A,H,Z,pe,ne,G,ee;return!y||y.length===0||(A=p.query.index,H=A.multiEntry,Z=p.query.range,pe=w.schema.primaryKey.extractKey,ne=A.extractKey,G=(A.lowLevelIndex||A).extractKey,(w=y.reduce(function(fe,se){var oe=fe,ae=[];if(se.type==="add"||se.type==="put")for(var ve=new Sn,me=se.values.length-1;0<=me;--me){var Se,Ce=se.values[me],Pe=pe(Ce);!ve.hasKey(Pe)&&(Se=ne(Ce),H&&h(Se)?Se.some(function(Ye){return la(Ye,Z)}):la(Se,Z))&&(ve.addKey(Pe),ae.push(Ce))}switch(se.type){case"add":var Fe=new Sn().addKeys(p.values?fe.map(function(Ee){return pe(Ee)}):fe),oe=fe.concat(p.values?ae.filter(function(Ee){return Ee=pe(Ee),!Fe.hasKey(Ee)&&(Fe.addKey(Ee),!0)}):ae.map(function(Ee){return pe(Ee)}).filter(function(Ee){return!Fe.hasKey(Ee)&&(Fe.addKey(Ee),!0)}));break;case"put":var Ie=new Sn().addKeys(se.values.map(function(Ee){return pe(Ee)}));oe=fe.filter(function(Ee){return!Ie.hasKey(p.values?pe(Ee):Ee)}).concat(p.values?ae:ae.map(function(Ee){return pe(Ee)}));break;case"delete":var Ve=new Sn().addKeys(se.keys);oe=fe.filter(function(Ee){return!Ve.hasKey(p.values?pe(Ee):Ee)});break;case"deleteRange":var He=se.range;oe=fe.filter(function(Ee){return!la(pe(Ee),He)})}return oe},l))===l)?l:(ee=function(fe,se){return wt(G(fe),G(se))||wt(pe(fe),pe(se))},w.sort(p.direction==="prev"||p.direction==="prevunique"?function(fe,se){return ee(se,fe)}:ee),p.limit&&p.limit<1/0&&(w.length>p.limit?w.length=p.limit:l.length===p.limit&&w.length<p.limit&&(N.dirty=!0)),C?Object.freeze(w):w)}function ca(l,p){return wt(l.lower,p.lower)===0&&wt(l.upper,p.upper)===0&&!!l.lowerOpen==!!p.lowerOpen&&!!l.upperOpen==!!p.upperOpen}function ll(l,p){return((y,w,N,C)=>{if(y===void 0)return w!==void 0?-1:0;if(w===void 0)return 1;if((y=wt(y,w))===0){if(N&&C)return 0;if(N)return 1;if(C)return-1}return y})(l.lower,p.lower,l.lowerOpen,p.lowerOpen)<=0&&0<=((y,w,N,C)=>{if(y===void 0)return w!==void 0?1:0;if(w===void 0)return-1;if((y=wt(y,w))===0){if(N&&C)return 0;if(N)return-1;if(C)return 1}return y})(l.upper,p.upper,l.upperOpen,p.upperOpen)}function ul(l,p,y,w){l.subscribers.add(y),w.addEventListener("abort",function(){var N,C;l.subscribers.delete(y),l.subscribers.size===0&&(N=l,C=p,setTimeout(function(){N.subscribers.size===0&&q(C,N)},3e3))})}var cl={stack:"dbcore",level:0,name:"Cache",create:function(l){var p=l.schema.name;return i(i({},l),{transaction:function(y,w,N){var C,A,H=l.transaction(y,w,N);return w==="readwrite"&&(N=(C=new AbortController).signal,H.addEventListener("abort",(A=function(Z){return function(){if(C.abort(),w==="readwrite"){for(var pe=new Set,ne=0,G=y;ne<G.length;ne++){var ee=G[ne],fe=po["idb://".concat(p,"/").concat(ee)];if(fe){var se=l.table(ee),oe=fe.optimisticOps.filter(function(Ee){return Ee.trans===H});if(H._explicit&&Z&&H.mutatedParts)for(var ae=0,ve=Object.values(fe.queries.query);ae<ve.length;ae++)for(var me=0,Se=(Fe=ve[ae]).slice();me<Se.length;me++)ea((Ie=Se[me]).obsSet,H.mutatedParts)&&(q(Fe,Ie),Ie.subscribers.forEach(function(Ee){return pe.add(Ee)}));else if(0<oe.length){fe.optimisticOps=fe.optimisticOps.filter(function(Ee){return Ee.trans!==H});for(var Ce=0,Pe=Object.values(fe.queries.query);Ce<Pe.length;Ce++)for(var Fe,Ie,Ve,He=0,Ye=(Fe=Pe[Ce]).slice();He<Ye.length;He++)(Ie=Ye[He]).res!=null&&H.mutatedParts&&(Z&&!Ie.dirty?(Ve=Object.isFrozen(Ie.res),Ve=ua(Ie.res,Ie.req,oe,se,Ie,Ve),Ie.dirty?(q(Fe,Ie),Ie.subscribers.forEach(function(Ee){return pe.add(Ee)})):Ve!==Ie.res&&(Ie.res=Ve,Ie.promise=qe.resolve({result:Ve}))):(Ie.dirty&&q(Fe,Ie),Ie.subscribers.forEach(function(Ee){return pe.add(Ee)})))}}}pe.forEach(function(Ee){return Ee()})}}})(!1),{signal:N}),H.addEventListener("error",A(!1),{signal:N}),H.addEventListener("complete",A(!0),{signal:N})),H},table:function(y){var w=l.table(y),N=w.schema.primaryKey;return i(i({},w),{mutate:function(C){var A,H=Ue.trans;return!N.outbound&&H.db._options.cache!=="disabled"&&!H.explicit&&H.idbtrans.mode==="readwrite"&&(A=po["idb://".concat(p,"/").concat(y)])?(H=w.mutate(C),C.type!=="add"&&C.type!=="put"||!(50<=C.values.length||ia(N,C).some(function(Z){return Z==null}))?(A.optimisticOps.push(C),C.mutatedParts&&di(C.mutatedParts),H.then(function(Z){0<Z.numFailures&&(q(A.optimisticOps,C),(Z=rs(0,C,Z))&&A.optimisticOps.push(Z),C.mutatedParts)&&di(C.mutatedParts)}),H.catch(function(){q(A.optimisticOps,C),C.mutatedParts&&di(C.mutatedParts)})):H.then(function(Z){var pe=rs(0,i(i({},C),{values:C.values.map(function(ne,G){var ee;return Z.failures[G]?ne:(W(ee=(ee=N.keyPath)!=null&&ee.includes(".")?te(ne):i({},ne),N.keyPath,Z.results[G]),ee)})}),Z);A.optimisticOps.push(pe),queueMicrotask(function(){return C.mutatedParts&&di(C.mutatedParts)})}),H):w.mutate(C)},query:function(C){var A,H,Z,pe,ne,G,ee;return il(Ue,w)&&al("query",C)?(A=((Z=Ue.trans)==null?void 0:Z.db._options.cache)==="immutable",H=(Z=Ue).requery,Z=Z.signal,G=((fe,se,oe,ae)=>{var ve=po["idb://".concat(fe,"/").concat(se)];if(!ve)return[];if(!(fe=ve.queries[oe]))return[null,!1,ve,null];var me=fe[(ae.query?ae.query.index.name:null)||""];if(!me)return[null,!1,ve,null];switch(oe){case"query":var Se=(Ce=ae.direction)!=null?Ce:"next",Ce=me.find(function(Pe){var Fe;return Pe.req.limit===ae.limit&&Pe.req.values===ae.values&&((Fe=Pe.req.direction)!=null?Fe:"next")===Se&&ca(Pe.req.query.range,ae.query.range)});return Ce?[Ce,!0,ve,me]:[me.find(function(Pe){var Fe;return("limit"in Pe.req?Pe.req.limit:1/0)>=ae.limit&&((Fe=Pe.req.direction)!=null?Fe:"next")===Se&&(!ae.values||Pe.req.values)&&ll(Pe.req.query.range,ae.query.range)}),!1,ve,me];case"count":return Ce=me.find(function(Pe){return ca(Pe.req.query.range,ae.query.range)}),[Ce,!!Ce,ve,me]}})(p,y,"query",C),ee=G[0],pe=G[2],ne=G[3],ee&&G[1]?ee.obsSet=C.obsSet:(G=w.query(C).then(function(fe){var se=fe.result;if(ee&&(ee.res=se),A){for(var oe=0,ae=se.length;oe<ae;++oe)Object.freeze(se[oe]);Object.freeze(se)}else fe.result=te(se);return fe}).catch(function(fe){return ne&&ee&&q(ne,ee),Promise.reject(fe)}),ee={obsSet:C.obsSet,promise:G,subscribers:new Set,type:"query",req:C,dirty:!1},ne?ne.push(ee):(ne=[ee],(pe=pe||(po["idb://".concat(p,"/").concat(y)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[C.query.index.name||""]=ne)),ul(ee,ne,H,Z),ee.promise.then(function(fe){return{result:ua(fe.result,C,pe==null?void 0:pe.optimisticOps,w,ee,A)}})):w.query(C)}})}})}};function Wr(l,p){return new Proxy(l,{get:function(y,w,N){return w==="db"?p:Reflect.get(y,w,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 p=this._versions,y=p.filter(function(w){return w._cfg.version===l})[0];return y||(y=new this.Version(l),p.push(y),p.sort(fo),y.stores({}),this._state.autoSchema=!1),y},Qt.prototype._whenReady=function(l){var p=this;return this.idbdb&&(this._state.openComplete||Ue.letThrough||this._vip)?l():new qe(function(y,w){if(p._state.openComplete)return w(new _e.DatabaseClosed(p._state.dbOpenError));if(!p._state.isBeingOpened){if(!p._state.autoOpen)return void w(new _e.DatabaseClosed);p.open().catch(ze)}p._state.dbReadyPromise.then(y,w)}).then(l)},Qt.prototype.use=function(N){var p=N.stack,y=N.create,w=N.level,N=N.name,C=(N&&this.unuse({stack:p,name:N}),this._middlewares[p]||(this._middlewares[p]=[]));return C.push({stack:p,create:y,level:w??10,name:N}),C.sort(function(A,H){return A.level-H.level}),this},Qt.prototype.unuse=function(l){var p=l.stack,y=l.name,w=l.create;return p&&this._middlewares[p]&&(this._middlewares[p]=this._middlewares[p].filter(function(N){return w?N.create!==w:!!y&&N.name!==y})),this},Qt.prototype.open=function(){var l=this;return Gn(vt,function(){return Qu(l)})},Qt.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var l=this._state;if(Co.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}l.isBeingOpened||(l.dbReadyPromise=new qe(function(p){l.dbReadyResolve=p}),l.openCanceller=new qe(function(p,y){l.cancelOpen=y}))},Qt.prototype.close=function(p){var p=(p===void 0?{disableAutoOpen:!0}:p).disableAutoOpen,y=this._state;p?(y.isBeingOpened&&y.cancelOpen(new _e.DatabaseClosed),this._close(),y.autoOpen=!1,y.dbOpenError=new _e.DatabaseClosed):(this._close(),y.autoOpen=this._options.autoOpen||y.isBeingOpened,y.openComplete=!1,y.dbOpenError=null)},Qt.prototype.delete=function(l){var p=this,y=(l===void 0&&(l={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),w=this._state;return new qe(function(N,C){function A(){p.close(l);var H=p._deps.indexedDB.deleteDatabase(p.name);H.onsuccess=_t(function(){var Z,pe,ne;Z=p._deps,pe=p.name,Eo(ne=Z.indexedDB)||pe===_r||Ts(ne,Z.IDBKeyRange).delete(pe).catch(ze),N()}),H.onerror=Ae(C),H.onblocked=p._fireOnBlocked}if(y)throw new _e.InvalidArgument("Invalid closeOptions argument to db.delete()");w.isBeingOpened?w.dbReadyPromise.then(A):A()})},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 c(this._allTables).map(function(p){return l._allTables[p]})},enumerable:!1,configurable:!0}),Qt.prototype.transaction=function(){var l=(function(p,y,w){var N=arguments.length;if(N<2)throw new _e.InvalidArgument("Too few arguments");for(var C=new Array(N-1);--N;)C[N-1]=arguments[N];return w=C.pop(),[p,we(C),w]}).apply(this,arguments);return this._transaction.apply(this,l)},Qt.prototype._transaction=function(l,p,y){var w,N,C=this,A=Ue.trans,H=(A&&A.db===this&&l.indexOf("!")===-1||(A=null),l.indexOf("?")!==-1);l=l.replace("!","").replace("?","");try{if(N=p.map(function(pe){if(pe=pe instanceof C.Table?pe.name:pe,typeof pe!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return pe}),l=="r"||l===lo)w=lo;else{if(l!="rw"&&l!=jr)throw new _e.InvalidArgument("Invalid transaction mode: "+l);w=jr}if(A){if(A.mode===lo&&w===jr){if(!H)throw new _e.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");A=null}A&&N.forEach(function(pe){if(A&&A.storeNames.indexOf(pe)===-1){if(!H)throw new _e.SubTransaction("Table "+pe+" not included in parent transaction.");A=null}}),H&&A&&!A.active&&(A=null)}}catch(pe){return A?A._promise(null,function(ne,G){G(pe)}):It(pe)}var Z=(function pe(ne,G,ee,fe,se){return qe.resolve().then(function(){var me=Ue.transless||Ue,oe=ne._createTransaction(G,ee,ne._dbSchema,fe),me=(oe.explicit=!0,{trans:oe,transless:me});if(fe)oe.idbtrans=fe.idbtrans;else try{oe.create(),oe.idbtrans._explicit=!0,ne._state.PR1398_maxLoop=3}catch(Se){return Se.name===ke.InvalidState&&ne.isOpen()&&0<--ne._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),ne.close({disableAutoOpen:!1}),ne.open().then(function(){return pe(ne,G,ee,null,se)})):It(Se)}var ae,ve=L(se),me=(ve&&kr(),qe.follow(function(){var Se;(ae=se.call(oe,oe))&&(ve?(Se=yt.bind(null,null),ae.then(Se,Se)):typeof ae.next=="function"&&typeof ae.throw=="function"&&(ae=oa(ae)))},me));return(ae&&typeof ae.then=="function"?qe.resolve(ae).then(function(Se){return oe.active?Se:It(new _e.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):me.then(function(){return ae})).then(function(Se){return fe&&oe._resolve(),oe._completion.then(function(){return Se})}).catch(function(Se){return oe._reject(Se),It(Se)})})}).bind(null,this,w,N,A,y);return A?A._promise(w,Z,"lock"):Ue.trans?Gn(Ue.transless,function(){return C._whenReady(Z)}):this._whenReady(Z)},Qt.prototype.table=function(l){if(b(this._allTables,l))return this._allTables[l];throw new _e.InvalidTable("Table ".concat(l," does not exist"))};var Yr=Qt;function Qt(l,p){var y,w,N,C,A,H=this,Z=(this._middlewares={},this.verno=0,Qt.dependencies),Z=(this._options=p=i({addons:Qt.addons,autoOpen:!0,indexedDB:Z.indexedDB,IDBKeyRange:Z.IDBKeyRange,cache:"cloned",maxConnections:1e3},p),this._deps={indexedDB:p.indexedDB,IDBKeyRange:p.IDBKeyRange},p.addons),pe=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:ze,dbReadyPromise:null,cancelOpen:ze,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:p.autoOpen}),ne=(pe.dbReadyPromise=new qe(function(G){pe.dbReadyResolve=G}),pe.openCanceller=new qe(function(G,ee){pe.cancelOpen=ee}),this._state=pe,this.name=l,this.on=Cr(this,"populate","blocked","versionchange","close",{ready:[Ht,ze]}),this.once=function(G,ee){var fe=function(){for(var se=[],oe=0;oe<arguments.length;oe++)se[oe]=arguments[oe];H.on(G).unsubscribe(fe),ee.apply(H,se)};return H.on(G,fe)},this.on.ready.subscribe=$(this.on.ready.subscribe,function(G){return function(ee,fe){Qt.vip(function(){var se,oe=H._state;oe.openComplete?(oe.dbOpenError||qe.resolve().then(ee),fe&&G(ee)):oe.onReadyBeingFired?(oe.onReadyBeingFired.push(ee),fe&&G(ee)):(G(ee),se=H,fe||G(function ae(){se.on.ready.unsubscribe(ee),se.on.ready.unsubscribe(ae)}))})}}),this.Collection=(y=this,Ur(ei.prototype,function(ae,oe){this.db=y;var fe=uo,se=null;if(oe)try{fe=oe()}catch(me){se=me}var oe=ae._ctx,ae=oe.table,ve=ae.hook.reading.fire;this._ctx={table:ae,index:oe.index,isPrimKey:!oe.index||ae.schema.primKey.keyPath&&oe.index===ae.schema.primKey.name,range:fe,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:se,or:oe.or,valueMapper:ve!==Je?ve:null}})),this.Table=(w=this,Ur(Wn.prototype,function(G,ee,fe){this.db=w,this._tx=fe,this.name=G,this.schema=ee,this.hook=w._allTables[G]?w._allTables[G].hook:Cr(null,{creating:[ft,ze],reading:[at,Je],updating:[Xt,ze],deleting:[Mt,ze]})})),this.Transaction=(N=this,Ur(rr.prototype,function(G,ee,fe,se,oe){var ae=this;G!=="readonly"&&ee.forEach(function(ve){ve=(ve=fe[ve])==null?void 0:ve.yProps,ve&&(ee=ee.concat(ve.map(function(me){return me.updatesTable})))}),this.db=N,this.mode=G,this.storeNames=ee,this.schema=fe,this.chromeTransactionDurability=se,this.idbtrans=null,this.on=Cr(this,"complete","error","abort"),this.parent=oe||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new qe(function(ve,me){ae._resolve=ve,ae._reject=me}),this._completion.then(function(){ae.active=!1,ae.on.complete.fire()},function(ve){var me=ae.active;return ae.active=!1,ae.on.error.fire(ve),ae.parent?ae.parent._reject(ve):me&&ae.idbtrans&&ae.idbtrans.abort(),It(ve)})})),this.Version=(C=this,Ur(Ps.prototype,function(G){this.db=C,this._cfg={version:G,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(A=this,Ur(D.prototype,function(G,ee,fe){if(this.db=A,this._ctx={table:G,index:ee===":id"?null:ee,or:fe},this._cmp=this._ascending=wt,this._descending=function(se,oe){return wt(oe,se)},this._max=function(se,oe){return 0<wt(se,oe)?se:oe},this._min=function(se,oe){return wt(se,oe)<0?se:oe},this._IDBKeyRange=A._deps.IDBKeyRange,!this._IDBKeyRange)throw new _e.MissingAPI})),this.on("versionchange",function(G){0<G.newVersion?console.warn("Another connection wants to upgrade database '".concat(H.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(H.name,"'. Closing db now to resume the delete request.")),H.close({disableAutoOpen:!1})}),this.on("blocked",function(G){!G.newVersion||G.newVersion<G.oldVersion?console.warn("Dexie.delete('".concat(H.name,"') was blocked")):console.warn("Upgrade '".concat(H.name,"' blocked by other connection holding version ").concat(G.oldVersion/10))}),this._maxKey=or(p.IDBKeyRange),this._createTransaction=function(G,ee,fe,se){return new H.Transaction(G,ee,fe,H._options.chromeTransactionDurability,se)},this._fireOnBlocked=function(G){H.on("blocked").fire(G),Co.toArray().filter(function(ee){return ee.name===H.name&&ee!==H&&!ee._state.vcFired}).map(function(ee){return ee.on("versionchange").fire(G)})},this.use(Zu),this.use(cl),this.use(aa),this.use(ol),this.use(Gu),new Proxy(this,{get:function(G,ee,fe){var se;return ee==="_vip"||(ee==="table"?function(oe){return Wr(H.table(oe),ne)}:(se=Reflect.get(G,ee,fe))instanceof Wn?Wr(se,ne):ee==="tables"?se.map(function(oe){return Wr(oe,ne)}):ee==="_createTransaction"?function(){return Wr(se.apply(this,arguments),ne)}:se)}}));this.vip=ne,Z.forEach(function(G){return G(H)})}var hi,Po=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",dl=(To.prototype.subscribe=function(l,p,y){return this._subscribe(l&&typeof l!="function"?l:{next:l,error:p,complete:y})},To.prototype[Po]=function(){return this},To);function To(l){this._subscribe=l}try{hi={indexedDB:d.indexedDB||d.mozIndexedDB||d.webkitIndexedDB||d.msIndexedDB,IDBKeyRange:d.IDBKeyRange||d.webkitIDBKeyRange}}catch{hi={indexedDB:null,IDBKeyRange:null}}function os(l){var p,y=!1,w=new dl(function(N){var C=L(l),A,H=!1,Z={},pe={},ne={get closed(){return H},unsubscribe:function(){H||(H=!0,A&&A.abort(),G&&Bt.storagemutated.unsubscribe(se))}},G=(N.start&&N.start(ne),!1),ee=function(){return zr(oe)};function fe(){return ea(pe,Z)}var se=function(ae){ci(Z,ae),fe()&&ee()},oe=function(){var ae,ve,me;!H&&hi.indexedDB&&(Z={},ae={},A&&A.abort(),A=new AbortController,me=(Se=>{var Ce=qn();try{C&&kr();var Pe=Qe(l,Se);return Pe=C?Pe.finally(yt):Pe}finally{Ce&&jn()}})(ve={subscr:ae,signal:A.signal,requery:ee,querier:l,trans:null}),G||(Bt(Ot,se),G=!0),Promise.resolve(me).then(function(Se){y=!0,p=Se,H||ve.signal.aborted||(fe()||(pe=ae,fe())?ee():(Z={},zr(function(){return!H&&N.next&&N.next(Se)})))},function(Se){y=!1,["DatabaseClosedError","AbortError"].includes(Se==null?void 0:Se.name)||H||zr(function(){H||N.error&&N.error(Se)})}))};return setTimeout(ee,0),ne});return w.hasValue=function(){return y},w.getValue=function(){return p},w}var $o=Yr;function ss(l){var p=Jr;try{Jr=!0,Bt.storagemutated.fire(l),ra(l,!0)}finally{Jr=p}}S($o,i(i({},U),{delete:function(l){return new $o(l,{addons:[]}).delete()},exists:function(l){return new $o(l,{addons:[]}).open().then(function(p){return p.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(l){try{return p=$o.dependencies,y=p.indexedDB,p=p.IDBKeyRange,(Eo(y)?Promise.resolve(y.databases()).then(function(w){return w.map(function(N){return N.name}).filter(function(N){return N!==_r})}):Ts(y,p).toCollection().primaryKeys()).then(l)}catch{return It(new _e.MissingAPI)}var p,y},defineClass:function(){return function(l){g(this,l)}},ignoreTransaction:function(l){return Ue.trans?Gn(Ue.transless||vt,l):l()},vip:ns,async:function(l){return function(){try{var p=oa(l.apply(this,arguments));return p&&typeof p.then=="function"?p:qe.resolve(p)}catch(y){return It(y)}}},spawn:function(l,p,y){try{var w=oa(l.apply(y,p||[]));return w&&typeof w.then=="function"?w:qe.resolve(w)}catch(N){return It(N)}},currentTransaction:{get:function(){return Ue.trans||null}},waitFor:function(l,p){return l=qe.resolve(typeof l=="function"?$o.ignoreTransaction(l):l).timeout(p||6e4),Ue.trans?Ue.trans.waitFor(l):l},Promise:qe,debug:{get:function(){return Dt},set:function(l){pn(l)}},derive:P,extend:g,props:S,override:$,Events:Cr,on:Bt,liveQuery:os,extendObservabilitySet:ci,getByKeyPath:R,setByKeyPath:W,delByKeyPath:function(l,p){typeof p=="string"?W(l,p,void 0):"length"in p&&[].map.call(p,function(y){W(l,y,void 0)})},shallowClone:Y,deepClone:te,getObjectDiff:sa,cmp:wt,asap:z,minKey:-1/0,addons:[],connections:{get:Co.toArray},errnames:ke,dependencies:hi,cache:po,semVer:"4.4.2",version:"4.4.2".split(".").map(function(l){return parseInt(l)}).reduce(function(l,p,y){return l+p/Math.pow(10,2*y)})})),$o.maxKey=or($o.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Bt(Ot,function(l){Jr||(l=new CustomEvent(sn,{detail:l}),Jr=!0,dispatchEvent(l),Jr=!1)}),addEventListener(sn,function(l){l=l.detail,Jr||ss(l)}));var is,Jr=!1,mi=function(){};return typeof BroadcastChannel<"u"&&((mi=function(){(is=new BroadcastChannel(sn)).onmessage=function(l){return l.data&&ss(l.data)}})(),typeof is.unref=="function"&&is.unref(),Bt(Ot,function(l){Jr||is.postMessage(l)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(l){if(!Yr.disableBfCache&&l.persisted){Dt&&console.debug("Dexie: handling persisted pagehide"),is!=null&&is.close();for(var p=0,y=Co.toArray();p<y.length;p++)y[p].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(l){!Yr.disableBfCache&&l.persisted&&(Dt&&console.debug("Dexie: handling persisted pageshow"),mi(),ss({all:new Sn(-1/0,[[]])}))})),qe.rejectionMapper=function(l,p){return!l||l instanceof Ne||l instanceof TypeError||l instanceof SyntaxError||!l.name||!tt[l.name]?l:(p=new tt[l.name](p||l.message,l),"stack"in l&&j(p,"stack",{get:function(){return this.inner.stack}}),p)},pn(Dt),i(Yr,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:Yr,Entity:En,PropModification:hr,RangeSet:Sn,add:function(l){return new hr({add:l})},cmp:wt,default:Yr,liveQuery:os,mergeRanges:Ms,rangesOverlap:li,remove:function(l){return new hr({remove:l})},replacePrefix:function(l,p){return new hr({replacePrefix:[l,p]})}}),{default:Yr}),Yr})})(hu)),hu.exports}var Ex=Cx();const Od=Iu(Ex),wh=Symbol.for("Dexie"),bu=globalThis[wh]||(globalThis[wh]=Od);if(Od.semVer!==bu.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Od.semVer} and ${bu.semVer}`);const{liveQuery:K_,mergeRanges:W_,rangesOverlap:Y_,RangeSet:J_,cmp:X_,Entity:Q_,PropModification:G_,replacePrefix:Z_,add:ej,remove:tj,DexieYProvider:nj}=bu,Dd=500;class Px extends bu{constructor(){super("api-doc-tor");bs(this,"flows");bs(this,"testSuites");bs(this,"environments");bs(this,"requestPresets");bs(this,"tryHistory");bs(this,"playgroundManualEndpoints");bs(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 Ze=new Px,zi="openapiOverride";async function Tx(e){await Ze.kv.put({key:zi,value:JSON.stringify(e)})}async function bh(){await Ze.kv.delete(zi)}function Ym(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 Jm(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 $x(e,r){const o=e.toLowerCase();return Ze.requestPresets.where("path").equals(r).filter(i=>i.method.toLowerCase()===o).toArray()}async function Mx(e){return Ze.requestPresets.add(e)}async function Ax(e){await Ze.requestPresets.delete(e)}async function Xm(){const e=await Ze.tryHistory.count();if(e<=Dd)return;const r=e-Dd,o=await Ze.tryHistory.orderBy("at").limit(r).primaryKeys();await Ze.tryHistory.bulkDelete(o)}async function Sh(e){await Ze.tryHistory.add(e),await Xm()}async function Ix(){return Ze.tryHistory.orderBy("at").reverse().toArray()}async function Ox(){await Ze.tryHistory.clear()}async function Dx(e){await Ze.tryHistory.delete(e)}async function Rx(){return Ze.playgroundManualEndpoints.toArray()}async function Lx(e){const r=e.id??crypto.randomUUID();return await Ze.playgroundManualEndpoints.put({...e,id:r}),r}async function Hx(e){await Ze.playgroundManualEndpoints.delete(e)}async function Fx(){const[e,r,o,i,a,d,c]=await Promise.all([Ze.flows.toArray(),Ze.testSuites.toArray(),Ze.environments.toArray(),Ze.requestPresets.toArray(),Ze.tryHistory.toArray(),Ze.playgroundManualEndpoints.toArray(),Ze.kv.get(zi)]),h=await Ze.kv.get("authTokens");let g;try{g=h!=null&&h.value?JSON.parse(h.value):void 0}catch{g=void 0}let x;if(c!=null&&c.value)try{x=JSON.parse(c.value)}catch{x=void 0}return{formatVersion:1,exportedAt:new Date().toISOString(),flows:e,testSuites:r,environments:o,authTokens:g,requestPresets:i.map(Ym),tryHistory:a.map(Jm),...x!==void 0?{importedOpenApi:x}:{},...d.length>0?{playgroundManualEndpoints:d}:{}}}async function Qm(e){await Ze.transaction("rw",[Ze.flows,Ze.testSuites,Ze.environments,Ze.requestPresets,Ze.tryHistory,Ze.playgroundManualEndpoints,Ze.kv],async()=>{var r;await Ze.flows.clear(),await Ze.testSuites.clear(),await Ze.environments.clear(),await Ze.requestPresets.clear(),await Ze.tryHistory.clear(),await Ze.playgroundManualEndpoints.clear();for(const o of e.flows)await Ze.flows.add({name:o.name,steps:o.steps,graph:o.graph});for(const o of e.testSuites)await Ze.testSuites.add({name:o.name,cases:o.cases});for(const o of e.environments)await Ze.environments.add({name:o.name,baseUrl:o.baseUrl,vars:o.vars??{}});for(const o of e.requestPresets??[])await Ze.requestPresets.add(Ym(o));for(const o of e.tryHistory??[])await Ze.tryHistory.add(Jm(o));if(await Xm(),e.authTokens&&await Ze.kv.put({key:"authTokens",value:JSON.stringify(e.authTokens)}),Object.prototype.hasOwnProperty.call(e,"importedOpenApi")&&(e.importedOpenApi===null?await Ze.kv.delete(zi):e.importedOpenApi!==void 0&&await Ze.kv.put({key:zi,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 Ze.playgroundManualEndpoints.put(o)})}async function zx(e){if(e.formatVersion!==1)return!1;const[r,o,i,a,d]=await Promise.all([Ze.flows.count(),Ze.testSuites.count(),Ze.requestPresets.count(),Ze.tryHistory.count(),Ze.playgroundManualEndpoints.count()]);return r>0||o>0||i>0||a>0||d>0?!1:(await Qm(e),!0)}const Bx="Manual";function Su(e){const r=e.trim();return r?r.startsWith("/")?r:`/${r}`:"/"}function qx(e,r,o){var c;const i=Su(o),a=r.toLowerCase(),d=(c=e.paths)==null?void 0:c[i];return!d||typeof d!="object"||"$ref"in d?!1:typeof d[a]=="object"}function Ux(e,r){var i,a;if(r.length===0)return e;const o={...e.paths??{}};for(const d of r){const c=Su(d.path),h=d.method.toLowerCase(),g=o[c];let x;g&&typeof g=="object"&&!("$ref"in g)?x={...g}:x={};const k=(((i=d.summary)==null?void 0:i.trim())||`${h.toUpperCase()} ${c}`).slice(0,512);x[h]={summary:k,...(a=d.description)!=null&&a.trim()?{description:d.description.trim()}:{},tags:[Bx],responses:{200:{description:"OK (endpoint añadido en playground)"}},"x-api-doc-tor-manual":!0},o[c]=x}return{...e,paths:o}}function Vx(e,r,o){var c,h;const i=[],a=r===e.expectStatus;if(i.push(`HTTP ${r} ${a?"✓":`✗ (esperado ${e.expectStatus})`}`),!a)return{pass:!1,lines:i};if((c=e.contains)!=null&&c.trim()){const g=o.includes(e.contains);if(i.push(`Contiene texto "${e.contains}": ${g?"✓":"✗"}`),!g)return{pass:!1,lines:i}}const d=(h=e.jsonPath)==null?void 0:h.trim();if(d){let g;try{g=JSON.parse(o)}catch{return i.push("Body no es JSON válido: ✗"),{pass:!1,lines:i}}const x=Lu(g,d),k=e.expectJsonValue;if(k!==void 0&&k!==""){const b=x==null?String(x):typeof x=="object"?JSON.stringify(x):String(x),S=k.trim(),_=b===S||String(x)===S;if(i.push(`JSON path ${d} → ${b} vs "${S}": ${_?"✓":"✗"}`),!_)return{pass:!1,lines:i}}else{const b=x!=null;if(i.push(`JSON path ${d} existe: ${b?"✓":"✗"}`),!b)return{pass:!1,lines:i}}}return{pass:!0,lines:i}}function fn(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=fn(e[o]))!==""&&(r+=(r&&" ")+i);else for(let o in e)e[o]&&(r+=(r&&" ")+o);return r}var Kx={value:()=>{}};function Hu(){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 mu(o)}function mu(e){this._=e}function Wx(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}})}mu.prototype=Hu.prototype={constructor:mu,on:function(e,r){var o=this._,i=Wx(e+"",o),a,d=-1,c=i.length;if(arguments.length<2){for(;++d<c;)if((a=(e=i[d]).type)&&(a=Yx(o[a],e.name)))return a;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++d<c;)if(a=(e=i[d]).type)o[a]=kh(o[a],e.name,r);else if(r==null)for(a in o)o[a]=kh(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 mu(e)},call:function(e,r){if((a=arguments.length-2)>0)for(var o=new Array(a),i=0,a,d;i<a;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(d=this._[e],i=0,a=d.length;i<a;++i)d[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,d=i.length;a<d;++a)i[a].value.apply(r,o)}};function Yx(e,r){for(var o=0,i=e.length,a;o<i;++o)if((a=e[o]).name===r)return a.value}function kh(e,r,o){for(var i=0,a=e.length;i<a;++i)if(e[i].name===r){e[i]=Kx,e=e.slice(0,i).concat(e.slice(i+1));break}return o!=null&&e.push({name:r,value:o}),e}var Rd="http://www.w3.org/1999/xhtml";const Nh={svg:"http://www.w3.org/2000/svg",xhtml:Rd,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Fu(e){var r=e+="",o=r.indexOf(":");return o>=0&&(r=e.slice(0,o))!=="xmlns"&&(e=e.slice(o+1)),Nh.hasOwnProperty(r)?{space:Nh[r],local:e}:e}function Jx(e){return function(){var r=this.ownerDocument,o=this.namespaceURI;return o===Rd&&r.documentElement.namespaceURI===Rd?r.createElement(e):r.createElementNS(o,e)}}function Xx(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Gm(e){var r=Fu(e);return(r.local?Xx:Jx)(r)}function Qx(){}function Zd(e){return e==null?Qx:function(){return this.querySelector(e)}}function Gx(e){typeof e!="function"&&(e=Zd(e));for(var r=this._groups,o=r.length,i=new Array(o),a=0;a<o;++a)for(var d=r[a],c=d.length,h=i[a]=new Array(c),g,x,k=0;k<c;++k)(g=d[k])&&(x=e.call(g,g.__data__,k,d))&&("__data__"in g&&(x.__data__=g.__data__),h[k]=x);return new vr(i,this._parents)}function Zx(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function ev(){return[]}function Zm(e){return e==null?ev:function(){return this.querySelectorAll(e)}}function tv(e){return function(){return Zx(e.apply(this,arguments))}}function nv(e){typeof e=="function"?e=tv(e):e=Zm(e);for(var r=this._groups,o=r.length,i=[],a=[],d=0;d<o;++d)for(var c=r[d],h=c.length,g,x=0;x<h;++x)(g=c[x])&&(i.push(e.call(g,g.__data__,x,c)),a.push(g));return new vr(i,a)}function e0(e){return function(){return this.matches(e)}}function t0(e){return function(r){return r.matches(e)}}var rv=Array.prototype.find;function ov(e){return function(){return rv.call(this.children,e)}}function sv(){return this.firstElementChild}function iv(e){return this.select(e==null?sv:ov(typeof e=="function"?e:t0(e)))}var av=Array.prototype.filter;function lv(){return Array.from(this.children)}function uv(e){return function(){return av.call(this.children,e)}}function cv(e){return this.selectAll(e==null?lv:uv(typeof e=="function"?e:t0(e)))}function dv(e){typeof e!="function"&&(e=e0(e));for(var r=this._groups,o=r.length,i=new Array(o),a=0;a<o;++a)for(var d=r[a],c=d.length,h=i[a]=[],g,x=0;x<c;++x)(g=d[x])&&e.call(g,g.__data__,x,d)&&h.push(g);return new vr(i,this._parents)}function n0(e){return new Array(e.length)}function fv(){return new vr(this._enter||this._groups.map(n0),this._parents)}function ku(e,r){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=r}ku.prototype={constructor:ku,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 pv(e){return function(){return e}}function hv(e,r,o,i,a,d){for(var c=0,h,g=r.length,x=d.length;c<x;++c)(h=r[c])?(h.__data__=d[c],i[c]=h):o[c]=new ku(e,d[c]);for(;c<g;++c)(h=r[c])&&(a[c]=h)}function mv(e,r,o,i,a,d,c){var h,g,x=new Map,k=r.length,b=d.length,S=new Array(k),_;for(h=0;h<k;++h)(g=r[h])&&(S[h]=_=c.call(g,g.__data__,h,r)+"",x.has(_)?a[h]=g:x.set(_,g));for(h=0;h<b;++h)_=c.call(e,d[h],h,d)+"",(g=x.get(_))?(i[h]=g,g.__data__=d[h],x.delete(_)):o[h]=new ku(e,d[h]);for(h=0;h<k;++h)(g=r[h])&&x.get(S[h])===g&&(a[h]=g)}function gv(e){return e.__data__}function yv(e,r){if(!arguments.length)return Array.from(this,gv);var o=r?mv:hv,i=this._parents,a=this._groups;typeof e!="function"&&(e=pv(e));for(var d=a.length,c=new Array(d),h=new Array(d),g=new Array(d),x=0;x<d;++x){var k=i[x],b=a[x],S=b.length,_=xv(e.call(k,k&&k.__data__,x,i)),j=_.length,P=h[x]=new Array(j),T=c[x]=new Array(j),M=g[x]=new Array(S);o(k,b,P,T,M,_,r);for(var V=0,$=0,O,z;V<j;++V)if(O=P[V]){for(V>=$&&($=V+1);!(z=T[$])&&++$<j;);O._next=z||null}}return c=new vr(c,i),c._enter=h,c._exit=g,c}function xv(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function vv(){return new vr(this._exit||this._groups.map(n0),this._parents)}function wv(e,r,o){var i=this.enter(),a=this,d=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?d.remove():o(d),i&&a?i.merge(a).order():a}function bv(e){for(var r=e.selection?e.selection():e,o=this._groups,i=r._groups,a=o.length,d=i.length,c=Math.min(a,d),h=new Array(a),g=0;g<c;++g)for(var x=o[g],k=i[g],b=x.length,S=h[g]=new Array(b),_,j=0;j<b;++j)(_=x[j]||k[j])&&(S[j]=_);for(;g<a;++g)h[g]=o[g];return new vr(h,this._parents)}function Sv(){for(var e=this._groups,r=-1,o=e.length;++r<o;)for(var i=e[r],a=i.length-1,d=i[a],c;--a>=0;)(c=i[a])&&(d&&c.compareDocumentPosition(d)^4&&d.parentNode.insertBefore(c,d),d=c);return this}function kv(e){e||(e=Nv);function r(b,S){return b&&S?e(b.__data__,S.__data__):!b-!S}for(var o=this._groups,i=o.length,a=new Array(i),d=0;d<i;++d){for(var c=o[d],h=c.length,g=a[d]=new Array(h),x,k=0;k<h;++k)(x=c[k])&&(g[k]=x);g.sort(r)}return new vr(a,this._parents).order()}function Nv(e,r){return e<r?-1:e>r?1:e>=r?0:NaN}function _v(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function jv(){return Array.from(this)}function Cv(){for(var e=this._groups,r=0,o=e.length;r<o;++r)for(var i=e[r],a=0,d=i.length;a<d;++a){var c=i[a];if(c)return c}return null}function Ev(){let e=0;for(const r of this)++e;return e}function Pv(){return!this.node()}function Tv(e){for(var r=this._groups,o=0,i=r.length;o<i;++o)for(var a=r[o],d=0,c=a.length,h;d<c;++d)(h=a[d])&&e.call(h,h.__data__,d,a);return this}function $v(e){return function(){this.removeAttribute(e)}}function Mv(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Av(e,r){return function(){this.setAttribute(e,r)}}function Iv(e,r){return function(){this.setAttributeNS(e.space,e.local,r)}}function Ov(e,r){return function(){var o=r.apply(this,arguments);o==null?this.removeAttribute(e):this.setAttribute(e,o)}}function Dv(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 Rv(e,r){var o=Fu(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?Mv:$v:typeof r=="function"?o.local?Dv:Ov:o.local?Iv:Av)(o,r))}function r0(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Lv(e){return function(){this.style.removeProperty(e)}}function Hv(e,r,o){return function(){this.style.setProperty(e,r,o)}}function Fv(e,r,o){return function(){var i=r.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,o)}}function zv(e,r,o){return arguments.length>1?this.each((r==null?Lv:typeof r=="function"?Fv:Hv)(e,r,o??"")):Bi(this.node(),e)}function Bi(e,r){return e.style.getPropertyValue(r)||r0(e).getComputedStyle(e,null).getPropertyValue(r)}function Bv(e){return function(){delete this[e]}}function qv(e,r){return function(){this[e]=r}}function Uv(e,r){return function(){var o=r.apply(this,arguments);o==null?delete this[e]:this[e]=o}}function Vv(e,r){return arguments.length>1?this.each((r==null?Bv:typeof r=="function"?Uv:qv)(e,r)):this.node()[e]}function o0(e){return e.trim().split(/^|\s+/)}function ef(e){return e.classList||new s0(e)}function s0(e){this._node=e,this._names=o0(e.getAttribute("class")||"")}s0.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 i0(e,r){for(var o=ef(e),i=-1,a=r.length;++i<a;)o.add(r[i])}function a0(e,r){for(var o=ef(e),i=-1,a=r.length;++i<a;)o.remove(r[i])}function Kv(e){return function(){i0(this,e)}}function Wv(e){return function(){a0(this,e)}}function Yv(e,r){return function(){(r.apply(this,arguments)?i0:a0)(this,e)}}function Jv(e,r){var o=o0(e+"");if(arguments.length<2){for(var i=ef(this.node()),a=-1,d=o.length;++a<d;)if(!i.contains(o[a]))return!1;return!0}return this.each((typeof r=="function"?Yv:r?Kv:Wv)(o,r))}function Xv(){this.textContent=""}function Qv(e){return function(){this.textContent=e}}function Gv(e){return function(){var r=e.apply(this,arguments);this.textContent=r??""}}function Zv(e){return arguments.length?this.each(e==null?Xv:(typeof e=="function"?Gv:Qv)(e)):this.node().textContent}function ew(){this.innerHTML=""}function tw(e){return function(){this.innerHTML=e}}function nw(e){return function(){var r=e.apply(this,arguments);this.innerHTML=r??""}}function rw(e){return arguments.length?this.each(e==null?ew:(typeof e=="function"?nw:tw)(e)):this.node().innerHTML}function ow(){this.nextSibling&&this.parentNode.appendChild(this)}function sw(){return this.each(ow)}function iw(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function aw(){return this.each(iw)}function lw(e){var r=typeof e=="function"?e:Gm(e);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function uw(){return null}function cw(e,r){var o=typeof e=="function"?e:Gm(e),i=r==null?uw:typeof r=="function"?r:Zd(r);return this.select(function(){return this.insertBefore(o.apply(this,arguments),i.apply(this,arguments)||null)})}function dw(){var e=this.parentNode;e&&e.removeChild(this)}function fw(){return this.each(dw)}function pw(){var e=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(e,this.nextSibling):e}function hw(){var e=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(e,this.nextSibling):e}function mw(e){return this.select(e?hw:pw)}function gw(e){return arguments.length?this.property("__data__",e):this.node().__data__}function yw(e){return function(r){e.call(this,r,this.__data__)}}function xw(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 vw(e){return function(){var r=this.__on;if(r){for(var o=0,i=-1,a=r.length,d;o<a;++o)d=r[o],(!e.type||d.type===e.type)&&d.name===e.name?this.removeEventListener(d.type,d.listener,d.options):r[++i]=d;++i?r.length=i:delete this.__on}}}function ww(e,r,o){return function(){var i=this.__on,a,d=yw(r);if(i){for(var c=0,h=i.length;c<h;++c)if((a=i[c]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=d,a.options=o),a.value=r;return}}this.addEventListener(e.type,d,o),a={type:e.type,name:e.name,value:r,listener:d,options:o},i?i.push(a):this.__on=[a]}}function bw(e,r,o){var i=xw(e+""),a,d=i.length,c;if(arguments.length<2){var h=this.node().__on;if(h){for(var g=0,x=h.length,k;g<x;++g)for(a=0,k=h[g];a<d;++a)if((c=i[a]).type===k.type&&c.name===k.name)return k.value}return}for(h=r?ww:vw,a=0;a<d;++a)this.each(h(i[a],r,o));return this}function l0(e,r,o){var i=r0(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 Sw(e,r){return function(){return l0(this,e,r)}}function kw(e,r){return function(){return l0(this,e,r.apply(this,arguments))}}function Nw(e,r){return this.each((typeof r=="function"?kw:Sw)(e,r))}function*_w(){for(var e=this._groups,r=0,o=e.length;r<o;++r)for(var i=e[r],a=0,d=i.length,c;a<d;++a)(c=i[a])&&(yield c)}var u0=[null];function vr(e,r){this._groups=e,this._parents=r}function Ja(){return new vr([[document.documentElement]],u0)}function jw(){return this}vr.prototype=Ja.prototype={constructor:vr,select:Gx,selectAll:nv,selectChild:iv,selectChildren:cv,filter:dv,data:yv,enter:fv,exit:vv,join:wv,merge:bv,selection:jw,order:Sv,sort:kv,call:_v,nodes:jv,node:Cv,size:Ev,empty:Pv,each:Tv,attr:Rv,style:zv,property:Vv,classed:Jv,text:Zv,html:rw,raise:sw,lower:aw,append:lw,insert:cw,remove:fw,clone:mw,datum:gw,on:bw,dispatch:Nw,[Symbol.iterator]:_w};function xr(e){return typeof e=="string"?new vr([[document.querySelector(e)]],[document.documentElement]):new vr([[e]],u0)}function Cw(e){let r;for(;r=e.sourceEvent;)e=r;return e}function no(e,r){if(e=Cw(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 Ew={passive:!1},La={capture:!0,passive:!1};function yd(e){e.stopImmediatePropagation()}function Li(e){e.preventDefault(),e.stopImmediatePropagation()}function c0(e){var r=e.document.documentElement,o=xr(e).on("dragstart.drag",Li,La);"onselectstart"in r?o.on("selectstart.drag",Li,La):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function d0(e,r){var o=e.document.documentElement,i=xr(e).on("dragstart.drag",null);r&&(i.on("click.drag",Li,La),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 nu=e=>()=>e;function Ld(e,{sourceEvent:r,subject:o,target:i,identifier:a,active:d,x:c,y:h,dx:g,dy:x,dispatch:k}){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:d,enumerable:!0,configurable:!0},x:{value:c,enumerable:!0,configurable:!0},y:{value:h,enumerable:!0,configurable:!0},dx:{value:g,enumerable:!0,configurable:!0},dy:{value:x,enumerable:!0,configurable:!0},_:{value:k}})}Ld.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Pw(e){return!e.ctrlKey&&!e.button}function Tw(){return this.parentNode}function $w(e,r){return r??{x:e.x,y:e.y}}function Mw(){return navigator.maxTouchPoints||"ontouchstart"in this}function f0(){var e=Pw,r=Tw,o=$w,i=Mw,a={},d=Hu("start","drag","end"),c=0,h,g,x,k,b=0;function S(O){O.on("mousedown.drag",_).filter(i).on("touchstart.drag",T).on("touchmove.drag",M,Ew).on("touchend.drag touchcancel.drag",V).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _(O,z){if(!(k||!e.call(this,O,z))){var R=$(this,r.call(this,O,z),O,z,"mouse");R&&(xr(O.view).on("mousemove.drag",j,La).on("mouseup.drag",P,La),c0(O.view),yd(O),x=!1,h=O.clientX,g=O.clientY,R("start",O))}}function j(O){if(Li(O),!x){var z=O.clientX-h,R=O.clientY-g;x=z*z+R*R>b}a.mouse("drag",O)}function P(O){xr(O.view).on("mousemove.drag mouseup.drag",null),d0(O.view,x),Li(O),a.mouse("end",O)}function T(O,z){if(e.call(this,O,z)){var R=O.changedTouches,W=r.call(this,O,z),Y=R.length,le,we;for(le=0;le<Y;++le)(we=$(this,W,O,z,R[le].identifier,R[le]))&&(yd(O),we("start",O,R[le]))}}function M(O){var z=O.changedTouches,R=z.length,W,Y;for(W=0;W<R;++W)(Y=a[z[W].identifier])&&(Li(O),Y("drag",O,z[W]))}function V(O){var z=O.changedTouches,R=z.length,W,Y;for(k&&clearTimeout(k),k=setTimeout(function(){k=null},500),W=0;W<R;++W)(Y=a[z[W].identifier])&&(yd(O),Y("end",O,z[W]))}function $(O,z,R,W,Y,le){var we=d.copy(),ie=no(le||R,z),de,te,F;if((F=o.call(O,new Ld("beforestart",{sourceEvent:R,target:S,identifier:Y,active:c,x:ie[0],y:ie[1],dx:0,dy:0,dispatch:we}),W))!=null)return de=F.x-ie[0]||0,te=F.y-ie[1]||0,function ce(J,ue,q){var K=ie,Q;switch(J){case"start":a[Y]=ce,Q=c++;break;case"end":delete a[Y],--c;case"drag":ie=no(q||ue,z),Q=c;break}we.call(J,O,new Ld(J,{sourceEvent:ue,subject:F,target:S,identifier:Y,active:Q,x:ie[0]+de,y:ie[1]+te,dx:ie[0]-K[0],dy:ie[1]-K[1],dispatch:we}),W)}}return S.filter=function(O){return arguments.length?(e=typeof O=="function"?O:nu(!!O),S):e},S.container=function(O){return arguments.length?(r=typeof O=="function"?O:nu(O),S):r},S.subject=function(O){return arguments.length?(o=typeof O=="function"?O:nu(O),S):o},S.touchable=function(O){return arguments.length?(i=typeof O=="function"?O:nu(!!O),S):i},S.on=function(){var O=d.on.apply(d,arguments);return O===d?S:O},S.clickDistance=function(O){return arguments.length?(b=(O=+O)*O,S):Math.sqrt(b)},S}function tf(e,r,o){e.prototype=r.prototype=o,o.constructor=e}function p0(e,r){var o=Object.create(e.prototype);for(var i in r)o[i]=r[i];return o}function Xa(){}var Ha=.7,Nu=1/Ha,Hi="\\s*([+-]?\\d+)\\s*",Fa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",vo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Aw=/^#([0-9a-f]{3,8})$/,Iw=new RegExp(`^rgb\\(${Hi},${Hi},${Hi}\\)$`),Ow=new RegExp(`^rgb\\(${vo},${vo},${vo}\\)$`),Dw=new RegExp(`^rgba\\(${Hi},${Hi},${Hi},${Fa}\\)$`),Rw=new RegExp(`^rgba\\(${vo},${vo},${vo},${Fa}\\)$`),Lw=new RegExp(`^hsl\\(${Fa},${vo},${vo}\\)$`),Hw=new RegExp(`^hsla\\(${Fa},${vo},${vo},${Fa}\\)$`),_h={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};tf(Xa,Xs,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:jh,formatHex:jh,formatHex8:Fw,formatHsl:zw,formatRgb:Ch,toString:Ch});function jh(){return this.rgb().formatHex()}function Fw(){return this.rgb().formatHex8()}function zw(){return h0(this).formatHsl()}function Ch(){return this.rgb().formatRgb()}function Xs(e){var r,o;return e=(e+"").trim().toLowerCase(),(r=Aw.exec(e))?(o=r[1].length,r=parseInt(r[1],16),o===6?Eh(r):o===3?new fr(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):o===8?ru(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):o===4?ru(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=Iw.exec(e))?new fr(r[1],r[2],r[3],1):(r=Ow.exec(e))?new fr(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=Dw.exec(e))?ru(r[1],r[2],r[3],r[4]):(r=Rw.exec(e))?ru(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=Lw.exec(e))?$h(r[1],r[2]/100,r[3]/100,1):(r=Hw.exec(e))?$h(r[1],r[2]/100,r[3]/100,r[4]):_h.hasOwnProperty(e)?Eh(_h[e]):e==="transparent"?new fr(NaN,NaN,NaN,0):null}function Eh(e){return new fr(e>>16&255,e>>8&255,e&255,1)}function ru(e,r,o,i){return i<=0&&(e=r=o=NaN),new fr(e,r,o,i)}function Bw(e){return e instanceof Xa||(e=Xs(e)),e?(e=e.rgb(),new fr(e.r,e.g,e.b,e.opacity)):new fr}function Hd(e,r,o,i){return arguments.length===1?Bw(e):new fr(e,r,o,i??1)}function fr(e,r,o,i){this.r=+e,this.g=+r,this.b=+o,this.opacity=+i}tf(fr,Hd,p0(Xa,{brighter(e){return e=e==null?Nu:Math.pow(Nu,e),new fr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ha:Math.pow(Ha,e),new fr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new fr(Ws(this.r),Ws(this.g),Ws(this.b),_u(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:Ph,formatHex:Ph,formatHex8:qw,formatRgb:Th,toString:Th}));function Ph(){return`#${Ks(this.r)}${Ks(this.g)}${Ks(this.b)}`}function qw(){return`#${Ks(this.r)}${Ks(this.g)}${Ks(this.b)}${Ks((isNaN(this.opacity)?1:this.opacity)*255)}`}function Th(){const e=_u(this.opacity);return`${e===1?"rgb(":"rgba("}${Ws(this.r)}, ${Ws(this.g)}, ${Ws(this.b)}${e===1?")":`, ${e})`}`}function _u(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ws(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ks(e){return e=Ws(e),(e<16?"0":"")+e.toString(16)}function $h(e,r,o,i){return i<=0?e=r=o=NaN:o<=0||o>=1?e=r=NaN:r<=0&&(e=NaN),new ro(e,r,o,i)}function h0(e){if(e instanceof ro)return new ro(e.h,e.s,e.l,e.opacity);if(e instanceof Xa||(e=Xs(e)),!e)return new ro;if(e instanceof ro)return e;e=e.rgb();var r=e.r/255,o=e.g/255,i=e.b/255,a=Math.min(r,o,i),d=Math.max(r,o,i),c=NaN,h=d-a,g=(d+a)/2;return h?(r===d?c=(o-i)/h+(o<i)*6:o===d?c=(i-r)/h+2:c=(r-o)/h+4,h/=g<.5?d+a:2-d-a,c*=60):h=g>0&&g<1?0:c,new ro(c,h,g,e.opacity)}function Uw(e,r,o,i){return arguments.length===1?h0(e):new ro(e,r,o,i??1)}function ro(e,r,o,i){this.h=+e,this.s=+r,this.l=+o,this.opacity=+i}tf(ro,Uw,p0(Xa,{brighter(e){return e=e==null?Nu:Math.pow(Nu,e),new ro(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ha:Math.pow(Ha,e),new ro(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 fr(xd(e>=240?e-240:e+120,a,i),xd(e,a,i),xd(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new ro(Mh(this.h),ou(this.s),ou(this.l),_u(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=_u(this.opacity);return`${e===1?"hsl(":"hsla("}${Mh(this.h)}, ${ou(this.s)*100}%, ${ou(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Mh(e){return e=(e||0)%360,e<0?e+360:e}function ou(e){return Math.max(0,Math.min(1,e||0))}function xd(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 nf=e=>()=>e;function Vw(e,r){return function(o){return e+o*r}}function Kw(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 Ww(e){return(e=+e)==1?m0:function(r,o){return o-r?Kw(r,o,e):nf(isNaN(r)?o:r)}}function m0(e,r){var o=r-e;return o?Vw(e,o):nf(isNaN(e)?r:e)}const ju=(function e(r){var o=Ww(r);function i(a,d){var c=o((a=Hd(a)).r,(d=Hd(d)).r),h=o(a.g,d.g),g=o(a.b,d.b),x=m0(a.opacity,d.opacity);return function(k){return a.r=c(k),a.g=h(k),a.b=g(k),a.opacity=x(k),a+""}}return i.gamma=e,i})(1);function Yw(e,r){r||(r=[]);var o=e?Math.min(r.length,e.length):0,i=r.slice(),a;return function(d){for(a=0;a<o;++a)i[a]=e[a]*(1-d)+r[a]*d;return i}}function Jw(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Xw(e,r){var o=r?r.length:0,i=e?Math.min(o,e.length):0,a=new Array(i),d=new Array(o),c;for(c=0;c<i;++c)a[c]=Ia(e[c],r[c]);for(;c<o;++c)d[c]=r[c];return function(h){for(c=0;c<i;++c)d[c]=a[c](h);return d}}function Qw(e,r){var o=new Date;return e=+e,r=+r,function(i){return o.setTime(e*(1-i)+r*i),o}}function xo(e,r){return e=+e,r=+r,function(o){return e*(1-o)+r*o}}function Gw(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]=Ia(e[a],r[a]):i[a]=r[a];return function(d){for(a in o)i[a]=o[a](d);return i}}var Fd=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,vd=new RegExp(Fd.source,"g");function Zw(e){return function(){return e}}function e1(e){return function(r){return e(r)+""}}function g0(e,r){var o=Fd.lastIndex=vd.lastIndex=0,i,a,d,c=-1,h=[],g=[];for(e=e+"",r=r+"";(i=Fd.exec(e))&&(a=vd.exec(r));)(d=a.index)>o&&(d=r.slice(o,d),h[c]?h[c]+=d:h[++c]=d),(i=i[0])===(a=a[0])?h[c]?h[c]+=a:h[++c]=a:(h[++c]=null,g.push({i:c,x:xo(i,a)})),o=vd.lastIndex;return o<r.length&&(d=r.slice(o),h[c]?h[c]+=d:h[++c]=d),h.length<2?g[0]?e1(g[0].x):Zw(r):(r=g.length,function(x){for(var k=0,b;k<r;++k)h[(b=g[k]).i]=b.x(x);return h.join("")})}function Ia(e,r){var o=typeof r,i;return r==null||o==="boolean"?nf(r):(o==="number"?xo:o==="string"?(i=Xs(r))?(r=i,ju):g0:r instanceof Xs?ju:r instanceof Date?Qw:Jw(r)?Yw:Array.isArray(r)?Xw:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Gw:xo)(e,r)}var Ah=180/Math.PI,zd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function y0(e,r,o,i,a,d){var c,h,g;return(c=Math.sqrt(e*e+r*r))&&(e/=c,r/=c),(g=e*o+r*i)&&(o-=e*g,i-=r*g),(h=Math.sqrt(o*o+i*i))&&(o/=h,i/=h,g/=h),e*i<r*o&&(e=-e,r=-r,g=-g,c=-c),{translateX:a,translateY:d,rotate:Math.atan2(r,e)*Ah,skewX:Math.atan(g)*Ah,scaleX:c,scaleY:h}}var su;function t1(e){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return r.isIdentity?zd:y0(r.a,r.b,r.c,r.d,r.e,r.f)}function n1(e){return e==null||(su||(su=document.createElementNS("http://www.w3.org/2000/svg","g")),su.setAttribute("transform",e),!(e=su.transform.baseVal.consolidate()))?zd:(e=e.matrix,y0(e.a,e.b,e.c,e.d,e.e,e.f))}function x0(e,r,o,i){function a(x){return x.length?x.pop()+" ":""}function d(x,k,b,S,_,j){if(x!==b||k!==S){var P=_.push("translate(",null,r,null,o);j.push({i:P-4,x:xo(x,b)},{i:P-2,x:xo(k,S)})}else(b||S)&&_.push("translate("+b+r+S+o)}function c(x,k,b,S){x!==k?(x-k>180?k+=360:k-x>180&&(x+=360),S.push({i:b.push(a(b)+"rotate(",null,i)-2,x:xo(x,k)})):k&&b.push(a(b)+"rotate("+k+i)}function h(x,k,b,S){x!==k?S.push({i:b.push(a(b)+"skewX(",null,i)-2,x:xo(x,k)}):k&&b.push(a(b)+"skewX("+k+i)}function g(x,k,b,S,_,j){if(x!==b||k!==S){var P=_.push(a(_)+"scale(",null,",",null,")");j.push({i:P-4,x:xo(x,b)},{i:P-2,x:xo(k,S)})}else(b!==1||S!==1)&&_.push(a(_)+"scale("+b+","+S+")")}return function(x,k){var b=[],S=[];return x=e(x),k=e(k),d(x.translateX,x.translateY,k.translateX,k.translateY,b,S),c(x.rotate,k.rotate,b,S),h(x.skewX,k.skewX,b,S),g(x.scaleX,x.scaleY,k.scaleX,k.scaleY,b,S),x=k=null,function(_){for(var j=-1,P=S.length,T;++j<P;)b[(T=S[j]).i]=T.x(_);return b.join("")}}}var r1=x0(t1,"px, ","px)","deg)"),o1=x0(n1,", ",")",")"),s1=1e-12;function Ih(e){return((e=Math.exp(e))+1/e)/2}function i1(e){return((e=Math.exp(e))-1/e)/2}function a1(e){return((e=Math.exp(2*e))-1)/(e+1)}const gu=(function e(r,o,i){function a(d,c){var h=d[0],g=d[1],x=d[2],k=c[0],b=c[1],S=c[2],_=k-h,j=b-g,P=_*_+j*j,T,M;if(P<s1)M=Math.log(S/x)/r,T=function(W){return[h+W*_,g+W*j,x*Math.exp(r*W*M)]};else{var V=Math.sqrt(P),$=(S*S-x*x+i*P)/(2*x*o*V),O=(S*S-x*x-i*P)/(2*S*o*V),z=Math.log(Math.sqrt($*$+1)-$),R=Math.log(Math.sqrt(O*O+1)-O);M=(R-z)/r,T=function(W){var Y=W*M,le=Ih(z),we=x/(o*V)*(le*a1(r*Y+z)-i1(z));return[h+we*_,g+we*j,x*le/Ih(r*Y+z)]}}return T.duration=M*1e3*r/Math.SQRT2,T}return a.rho=function(d){var c=Math.max(.001,+d),h=c*c,g=h*h;return e(c,h,g)},a})(Math.SQRT2,2,4);var qi=0,Ma=0,Ta=0,v0=1e3,Cu,Aa,Eu=0,Qs=0,zu=0,za=typeof performance=="object"&&performance.now?performance:Date,w0=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function rf(){return Qs||(w0(l1),Qs=za.now()+zu)}function l1(){Qs=0}function Pu(){this._call=this._time=this._next=null}Pu.prototype=b0.prototype={constructor:Pu,restart:function(e,r,o){if(typeof e!="function")throw new TypeError("callback is not a function");o=(o==null?rf():+o)+(r==null?0:+r),!this._next&&Aa!==this&&(Aa?Aa._next=this:Cu=this,Aa=this),this._call=e,this._time=o,Bd()},stop:function(){this._call&&(this._call=null,this._time=1/0,Bd())}};function b0(e,r,o){var i=new Pu;return i.restart(e,r,o),i}function u1(){rf(),++qi;for(var e=Cu,r;e;)(r=Qs-e._time)>=0&&e._call.call(void 0,r),e=e._next;--qi}function Oh(){Qs=(Eu=za.now())+zu,qi=Ma=0;try{u1()}finally{qi=0,d1(),Qs=0}}function c1(){var e=za.now(),r=e-Eu;r>v0&&(zu-=r,Eu=e)}function d1(){for(var e,r=Cu,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:Cu=o);Aa=e,Bd(i)}function Bd(e){if(!qi){Ma&&(Ma=clearTimeout(Ma));var r=e-Qs;r>24?(e<1/0&&(Ma=setTimeout(Oh,e-za.now()-zu)),Ta&&(Ta=clearInterval(Ta))):(Ta||(Eu=za.now(),Ta=setInterval(c1,v0)),qi=1,w0(Oh))}}function Dh(e,r,o){var i=new Pu;return r=r==null?0:+r,i.restart(a=>{i.stop(),e(a+r)},r,o),i}var f1=Hu("start","end","cancel","interrupt"),p1=[],S0=0,Rh=1,qd=2,yu=3,Lh=4,Ud=5,xu=6;function Bu(e,r,o,i,a,d){var c=e.__transition;if(!c)e.__transition={};else if(o in c)return;h1(e,o,{name:r,index:i,group:a,on:f1,tween:p1,time:d.time,delay:d.delay,duration:d.duration,ease:d.ease,timer:null,state:S0})}function of(e,r){var o=ao(e,r);if(o.state>S0)throw new Error("too late; already scheduled");return o}function bo(e,r){var o=ao(e,r);if(o.state>yu)throw new Error("too late; already running");return o}function ao(e,r){var o=e.__transition;if(!o||!(o=o[r]))throw new Error("transition not found");return o}function h1(e,r,o){var i=e.__transition,a;i[r]=o,o.timer=b0(d,0,o.time);function d(x){o.state=Rh,o.timer.restart(c,o.delay,o.time),o.delay<=x&&c(x-o.delay)}function c(x){var k,b,S,_;if(o.state!==Rh)return g();for(k in i)if(_=i[k],_.name===o.name){if(_.state===yu)return Dh(c);_.state===Lh?(_.state=xu,_.timer.stop(),_.on.call("interrupt",e,e.__data__,_.index,_.group),delete i[k]):+k<r&&(_.state=xu,_.timer.stop(),_.on.call("cancel",e,e.__data__,_.index,_.group),delete i[k])}if(Dh(function(){o.state===yu&&(o.state=Lh,o.timer.restart(h,o.delay,o.time),h(x))}),o.state=qd,o.on.call("start",e,e.__data__,o.index,o.group),o.state===qd){for(o.state=yu,a=new Array(S=o.tween.length),k=0,b=-1;k<S;++k)(_=o.tween[k].value.call(e,e.__data__,o.index,o.group))&&(a[++b]=_);a.length=b+1}}function h(x){for(var k=x<o.duration?o.ease.call(null,x/o.duration):(o.timer.restart(g),o.state=Ud,1),b=-1,S=a.length;++b<S;)a[b].call(e,k);o.state===Ud&&(o.on.call("end",e,e.__data__,o.index,o.group),g())}function g(){o.state=xu,o.timer.stop(),delete i[r];for(var x in i)return;delete e.__transition}}function vu(e,r){var o=e.__transition,i,a,d=!0,c;if(o){r=r==null?null:r+"";for(c in o){if((i=o[c]).name!==r){d=!1;continue}a=i.state>qd&&i.state<Ud,i.state=xu,i.timer.stop(),i.on.call(a?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete o[c]}d&&delete e.__transition}}function m1(e){return this.each(function(){vu(this,e)})}function g1(e,r){var o,i;return function(){var a=bo(this,e),d=a.tween;if(d!==o){i=o=d;for(var c=0,h=i.length;c<h;++c)if(i[c].name===r){i=i.slice(),i.splice(c,1);break}}a.tween=i}}function y1(e,r,o){var i,a;if(typeof o!="function")throw new Error;return function(){var d=bo(this,e),c=d.tween;if(c!==i){a=(i=c).slice();for(var h={name:r,value:o},g=0,x=a.length;g<x;++g)if(a[g].name===r){a[g]=h;break}g===x&&a.push(h)}d.tween=a}}function x1(e,r){var o=this._id;if(e+="",arguments.length<2){for(var i=ao(this.node(),o).tween,a=0,d=i.length,c;a<d;++a)if((c=i[a]).name===e)return c.value;return null}return this.each((r==null?g1:y1)(o,e,r))}function sf(e,r,o){var i=e._id;return e.each(function(){var a=bo(this,i);(a.value||(a.value={}))[r]=o.apply(this,arguments)}),function(a){return ao(a,i).value[r]}}function k0(e,r){var o;return(typeof r=="number"?xo:r instanceof Xs?ju:(o=Xs(r))?(r=o,ju):g0)(e,r)}function v1(e){return function(){this.removeAttribute(e)}}function w1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function b1(e,r,o){var i,a=o+"",d;return function(){var c=this.getAttribute(e);return c===a?null:c===i?d:d=r(i=c,o)}}function S1(e,r,o){var i,a=o+"",d;return function(){var c=this.getAttributeNS(e.space,e.local);return c===a?null:c===i?d:d=r(i=c,o)}}function k1(e,r,o){var i,a,d;return function(){var c,h=o(this),g;return h==null?void this.removeAttribute(e):(c=this.getAttribute(e),g=h+"",c===g?null:c===i&&g===a?d:(a=g,d=r(i=c,h)))}}function N1(e,r,o){var i,a,d;return function(){var c,h=o(this),g;return h==null?void this.removeAttributeNS(e.space,e.local):(c=this.getAttributeNS(e.space,e.local),g=h+"",c===g?null:c===i&&g===a?d:(a=g,d=r(i=c,h)))}}function _1(e,r){var o=Fu(e),i=o==="transform"?o1:k0;return this.attrTween(e,typeof r=="function"?(o.local?N1:k1)(o,i,sf(this,"attr."+e,r)):r==null?(o.local?w1:v1)(o):(o.local?S1:b1)(o,i,r))}function j1(e,r){return function(o){this.setAttribute(e,r.call(this,o))}}function C1(e,r){return function(o){this.setAttributeNS(e.space,e.local,r.call(this,o))}}function E1(e,r){var o,i;function a(){var d=r.apply(this,arguments);return d!==i&&(o=(i=d)&&C1(e,d)),o}return a._value=r,a}function P1(e,r){var o,i;function a(){var d=r.apply(this,arguments);return d!==i&&(o=(i=d)&&j1(e,d)),o}return a._value=r,a}function T1(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=Fu(e);return this.tween(o,(i.local?E1:P1)(i,r))}function $1(e,r){return function(){of(this,e).delay=+r.apply(this,arguments)}}function M1(e,r){return r=+r,function(){of(this,e).delay=r}}function A1(e){var r=this._id;return arguments.length?this.each((typeof e=="function"?$1:M1)(r,e)):ao(this.node(),r).delay}function I1(e,r){return function(){bo(this,e).duration=+r.apply(this,arguments)}}function O1(e,r){return r=+r,function(){bo(this,e).duration=r}}function D1(e){var r=this._id;return arguments.length?this.each((typeof e=="function"?I1:O1)(r,e)):ao(this.node(),r).duration}function R1(e,r){if(typeof r!="function")throw new Error;return function(){bo(this,e).ease=r}}function L1(e){var r=this._id;return arguments.length?this.each(R1(r,e)):ao(this.node(),r).ease}function H1(e,r){return function(){var o=r.apply(this,arguments);if(typeof o!="function")throw new Error;bo(this,e).ease=o}}function F1(e){if(typeof e!="function")throw new Error;return this.each(H1(this._id,e))}function z1(e){typeof e!="function"&&(e=e0(e));for(var r=this._groups,o=r.length,i=new Array(o),a=0;a<o;++a)for(var d=r[a],c=d.length,h=i[a]=[],g,x=0;x<c;++x)(g=d[x])&&e.call(g,g.__data__,x,d)&&h.push(g);return new Vo(i,this._parents,this._name,this._id)}function B1(e){if(e._id!==this._id)throw new Error;for(var r=this._groups,o=e._groups,i=r.length,a=o.length,d=Math.min(i,a),c=new Array(i),h=0;h<d;++h)for(var g=r[h],x=o[h],k=g.length,b=c[h]=new Array(k),S,_=0;_<k;++_)(S=g[_]||x[_])&&(b[_]=S);for(;h<i;++h)c[h]=r[h];return new Vo(c,this._parents,this._name,this._id)}function q1(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 U1(e,r,o){var i,a,d=q1(r)?of:bo;return function(){var c=d(this,e),h=c.on;h!==i&&(a=(i=h).copy()).on(r,o),c.on=a}}function V1(e,r){var o=this._id;return arguments.length<2?ao(this.node(),o).on.on(e):this.each(U1(o,e,r))}function K1(e){return function(){var r=this.parentNode;for(var o in this.__transition)if(+o!==e)return;r&&r.removeChild(this)}}function W1(){return this.on("end.remove",K1(this._id))}function Y1(e){var r=this._name,o=this._id;typeof e!="function"&&(e=Zd(e));for(var i=this._groups,a=i.length,d=new Array(a),c=0;c<a;++c)for(var h=i[c],g=h.length,x=d[c]=new Array(g),k,b,S=0;S<g;++S)(k=h[S])&&(b=e.call(k,k.__data__,S,h))&&("__data__"in k&&(b.__data__=k.__data__),x[S]=b,Bu(x[S],r,o,S,x,ao(k,o)));return new Vo(d,this._parents,r,o)}function J1(e){var r=this._name,o=this._id;typeof e!="function"&&(e=Zm(e));for(var i=this._groups,a=i.length,d=[],c=[],h=0;h<a;++h)for(var g=i[h],x=g.length,k,b=0;b<x;++b)if(k=g[b]){for(var S=e.call(k,k.__data__,b,g),_,j=ao(k,o),P=0,T=S.length;P<T;++P)(_=S[P])&&Bu(_,r,o,P,S,j);d.push(S),c.push(k)}return new Vo(d,c,r,o)}var X1=Ja.prototype.constructor;function Q1(){return new X1(this._groups,this._parents)}function G1(e,r){var o,i,a;return function(){var d=Bi(this,e),c=(this.style.removeProperty(e),Bi(this,e));return d===c?null:d===o&&c===i?a:a=r(o=d,i=c)}}function N0(e){return function(){this.style.removeProperty(e)}}function Z1(e,r,o){var i,a=o+"",d;return function(){var c=Bi(this,e);return c===a?null:c===i?d:d=r(i=c,o)}}function eb(e,r,o){var i,a,d;return function(){var c=Bi(this,e),h=o(this),g=h+"";return h==null&&(g=h=(this.style.removeProperty(e),Bi(this,e))),c===g?null:c===i&&g===a?d:(a=g,d=r(i=c,h))}}function tb(e,r){var o,i,a,d="style."+r,c="end."+d,h;return function(){var g=bo(this,e),x=g.on,k=g.value[d]==null?h||(h=N0(r)):void 0;(x!==o||a!==k)&&(i=(o=x).copy()).on(c,a=k),g.on=i}}function nb(e,r,o){var i=(e+="")=="transform"?r1:k0;return r==null?this.styleTween(e,G1(e,i)).on("end.style."+e,N0(e)):typeof r=="function"?this.styleTween(e,eb(e,i,sf(this,"style."+e,r))).each(tb(this._id,e)):this.styleTween(e,Z1(e,i,r),o).on("end.style."+e,null)}function rb(e,r,o){return function(i){this.style.setProperty(e,r.call(this,i),o)}}function ob(e,r,o){var i,a;function d(){var c=r.apply(this,arguments);return c!==a&&(i=(a=c)&&rb(e,c,o)),i}return d._value=r,d}function sb(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,ob(e,r,o??""))}function ib(e){return function(){this.textContent=e}}function ab(e){return function(){var r=e(this);this.textContent=r??""}}function lb(e){return this.tween("text",typeof e=="function"?ab(sf(this,"text",e)):ib(e==null?"":e+""))}function ub(e){return function(r){this.textContent=e.call(this,r)}}function cb(e){var r,o;function i(){var a=e.apply(this,arguments);return a!==o&&(r=(o=a)&&ub(a)),r}return i._value=e,i}function db(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,cb(e))}function fb(){for(var e=this._name,r=this._id,o=_0(),i=this._groups,a=i.length,d=0;d<a;++d)for(var c=i[d],h=c.length,g,x=0;x<h;++x)if(g=c[x]){var k=ao(g,r);Bu(g,e,o,x,c,{time:k.time+k.delay+k.duration,delay:0,duration:k.duration,ease:k.ease})}return new Vo(i,this._parents,e,o)}function pb(){var e,r,o=this,i=o._id,a=o.size();return new Promise(function(d,c){var h={value:c},g={value:function(){--a===0&&d()}};o.each(function(){var x=bo(this,i),k=x.on;k!==e&&(r=(e=k).copy(),r._.cancel.push(h),r._.interrupt.push(h),r._.end.push(g)),x.on=r}),a===0&&d()})}var hb=0;function Vo(e,r,o,i){this._groups=e,this._parents=r,this._name=o,this._id=i}function _0(){return++hb}var Bo=Ja.prototype;Vo.prototype={constructor:Vo,select:Y1,selectAll:J1,selectChild:Bo.selectChild,selectChildren:Bo.selectChildren,filter:z1,merge:B1,selection:Q1,transition:fb,call:Bo.call,nodes:Bo.nodes,node:Bo.node,size:Bo.size,empty:Bo.empty,each:Bo.each,on:V1,attr:_1,attrTween:T1,style:nb,styleTween:sb,text:lb,textTween:db,remove:W1,tween:x1,delay:A1,duration:D1,ease:L1,easeVarying:F1,end:pb,[Symbol.iterator]:Bo[Symbol.iterator]};function mb(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var gb={time:null,delay:0,duration:250,ease:mb};function yb(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 xb(e){var r,o;e instanceof Vo?(r=e._id,e=e._name):(r=_0(),(o=gb).time=rf(),e=e==null?null:e+"");for(var i=this._groups,a=i.length,d=0;d<a;++d)for(var c=i[d],h=c.length,g,x=0;x<h;++x)(g=c[x])&&Bu(g,e,r,x,c,o||yb(g,r));return new Vo(i,this._parents,e,r)}Ja.prototype.interrupt=m1;Ja.prototype.transition=xb;const iu=e=>()=>e;function vb(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 qo(e,r,o){this.k=e,this.x=r,this.y=o}qo.prototype={constructor:qo,scale:function(e){return e===1?this:new qo(this.k*e,this.x,this.y)},translate:function(e,r){return e===0&r===0?this:new qo(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 qu=new qo(1,0,0);j0.prototype=qo.prototype;function j0(e){for(;!e.__zoom;)if(!(e=e.parentNode))return qu;return e.__zoom}function wd(e){e.stopImmediatePropagation()}function $a(e){e.preventDefault(),e.stopImmediatePropagation()}function wb(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function bb(){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 Hh(){return this.__zoom||qu}function Sb(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function kb(){return navigator.maxTouchPoints||"ontouchstart"in this}function Nb(e,r,o){var i=e.invertX(r[0][0])-o[0][0],a=e.invertX(r[1][0])-o[1][0],d=e.invertY(r[0][1])-o[0][1],c=e.invertY(r[1][1])-o[1][1];return e.translate(a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a),c>d?(d+c)/2:Math.min(0,d)||Math.max(0,c))}function C0(){var e=wb,r=bb,o=Nb,i=Sb,a=kb,d=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],h=250,g=gu,x=Hu("start","zoom","end"),k,b,S,_=500,j=150,P=0,T=10;function M(F){F.property("__zoom",Hh).on("wheel.zoom",Y,{passive:!1}).on("mousedown.zoom",le).on("dblclick.zoom",we).filter(a).on("touchstart.zoom",ie).on("touchmove.zoom",de).on("touchend.zoom touchcancel.zoom",te).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}M.transform=function(F,ce,J,ue){var q=F.selection?F.selection():F;q.property("__zoom",Hh),F!==q?z(F,ce,J,ue):q.interrupt().each(function(){R(this,arguments).event(ue).start().zoom(null,typeof ce=="function"?ce.apply(this,arguments):ce).end()})},M.scaleBy=function(F,ce,J,ue){M.scaleTo(F,function(){var q=this.__zoom.k,K=typeof ce=="function"?ce.apply(this,arguments):ce;return q*K},J,ue)},M.scaleTo=function(F,ce,J,ue){M.transform(F,function(){var q=r.apply(this,arguments),K=this.__zoom,Q=J==null?O(q):typeof J=="function"?J.apply(this,arguments):J,L=K.invert(Q),U=typeof ce=="function"?ce.apply(this,arguments):ce;return o($(V(K,U),Q,L),q,c)},J,ue)},M.translateBy=function(F,ce,J,ue){M.transform(F,function(){return o(this.__zoom.translate(typeof ce=="function"?ce.apply(this,arguments):ce,typeof J=="function"?J.apply(this,arguments):J),r.apply(this,arguments),c)},null,ue)},M.translateTo=function(F,ce,J,ue,q){M.transform(F,function(){var K=r.apply(this,arguments),Q=this.__zoom,L=ue==null?O(K):typeof ue=="function"?ue.apply(this,arguments):ue;return o(qu.translate(L[0],L[1]).scale(Q.k).translate(typeof ce=="function"?-ce.apply(this,arguments):-ce,typeof J=="function"?-J.apply(this,arguments):-J),K,c)},ue,q)};function V(F,ce){return ce=Math.max(d[0],Math.min(d[1],ce)),ce===F.k?F:new qo(ce,F.x,F.y)}function $(F,ce,J){var ue=ce[0]-J[0]*F.k,q=ce[1]-J[1]*F.k;return ue===F.x&&q===F.y?F:new qo(F.k,ue,q)}function O(F){return[(+F[0][0]+ +F[1][0])/2,(+F[0][1]+ +F[1][1])/2]}function z(F,ce,J,ue){F.on("start.zoom",function(){R(this,arguments).event(ue).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event(ue).end()}).tween("zoom",function(){var q=this,K=arguments,Q=R(q,K).event(ue),L=r.apply(q,K),U=J==null?O(L):typeof J=="function"?J.apply(q,K):J,je=Math.max(L[1][0]-L[0][0],L[1][1]-L[0][1]),Ne=q.__zoom,Re=typeof ce=="function"?ce.apply(q,K):ce,Oe=g(Ne.invert(U).concat(je/Ne.k),Re.invert(U).concat(je/Re.k));return function(Le){if(Le===1)Le=Re;else{var ke=Oe(Le),$e=je/ke[2];Le=new qo($e,U[0]-ke[0]*$e,U[1]-ke[1]*$e)}Q.zoom(null,Le)}})}function R(F,ce,J){return!J&&F.__zooming||new W(F,ce)}function W(F,ce){this.that=F,this.args=ce,this.active=0,this.sourceEvent=null,this.extent=r.apply(F,ce),this.taps=0}W.prototype={event:function(F){return F&&(this.sourceEvent=F),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(F,ce){return this.mouse&&F!=="mouse"&&(this.mouse[1]=ce.invert(this.mouse[0])),this.touch0&&F!=="touch"&&(this.touch0[1]=ce.invert(this.touch0[0])),this.touch1&&F!=="touch"&&(this.touch1[1]=ce.invert(this.touch1[0])),this.that.__zoom=ce,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(F){var ce=xr(this.that).datum();x.call(F,this.that,new vb(F,{sourceEvent:this.sourceEvent,target:M,transform:this.that.__zoom,dispatch:x}),ce)}};function Y(F,...ce){if(!e.apply(this,arguments))return;var J=R(this,ce).event(F),ue=this.__zoom,q=Math.max(d[0],Math.min(d[1],ue.k*Math.pow(2,i.apply(this,arguments)))),K=no(F);if(J.wheel)(J.mouse[0][0]!==K[0]||J.mouse[0][1]!==K[1])&&(J.mouse[1]=ue.invert(J.mouse[0]=K)),clearTimeout(J.wheel);else{if(ue.k===q)return;J.mouse=[K,ue.invert(K)],vu(this),J.start()}$a(F),J.wheel=setTimeout(Q,j),J.zoom("mouse",o($(V(ue,q),J.mouse[0],J.mouse[1]),J.extent,c));function Q(){J.wheel=null,J.end()}}function le(F,...ce){if(S||!e.apply(this,arguments))return;var J=F.currentTarget,ue=R(this,ce,!0).event(F),q=xr(F.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",je,!0),K=no(F,J),Q=F.clientX,L=F.clientY;c0(F.view),wd(F),ue.mouse=[K,this.__zoom.invert(K)],vu(this),ue.start();function U(Ne){if($a(Ne),!ue.moved){var Re=Ne.clientX-Q,Oe=Ne.clientY-L;ue.moved=Re*Re+Oe*Oe>P}ue.event(Ne).zoom("mouse",o($(ue.that.__zoom,ue.mouse[0]=no(Ne,J),ue.mouse[1]),ue.extent,c))}function je(Ne){q.on("mousemove.zoom mouseup.zoom",null),d0(Ne.view,ue.moved),$a(Ne),ue.event(Ne).end()}}function we(F,...ce){if(e.apply(this,arguments)){var J=this.__zoom,ue=no(F.changedTouches?F.changedTouches[0]:F,this),q=J.invert(ue),K=J.k*(F.shiftKey?.5:2),Q=o($(V(J,K),ue,q),r.apply(this,ce),c);$a(F),h>0?xr(this).transition().duration(h).call(z,Q,ue,F):xr(this).call(M.transform,Q,ue,F)}}function ie(F,...ce){if(e.apply(this,arguments)){var J=F.touches,ue=J.length,q=R(this,ce,F.changedTouches.length===ue).event(F),K,Q,L,U;for(wd(F),Q=0;Q<ue;++Q)L=J[Q],U=no(L,this),U=[U,this.__zoom.invert(U),L.identifier],q.touch0?!q.touch1&&q.touch0[2]!==U[2]&&(q.touch1=U,q.taps=0):(q.touch0=U,K=!0,q.taps=1+!!k);k&&(k=clearTimeout(k)),K&&(q.taps<2&&(b=U[0],k=setTimeout(function(){k=null},_)),vu(this),q.start())}}function de(F,...ce){if(this.__zooming){var J=R(this,ce).event(F),ue=F.changedTouches,q=ue.length,K,Q,L,U;for($a(F),K=0;K<q;++K)Q=ue[K],L=no(Q,this),J.touch0&&J.touch0[2]===Q.identifier?J.touch0[0]=L:J.touch1&&J.touch1[2]===Q.identifier&&(J.touch1[0]=L);if(Q=J.that.__zoom,J.touch1){var je=J.touch0[0],Ne=J.touch0[1],Re=J.touch1[0],Oe=J.touch1[1],Le=(Le=Re[0]-je[0])*Le+(Le=Re[1]-je[1])*Le,ke=(ke=Oe[0]-Ne[0])*ke+(ke=Oe[1]-Ne[1])*ke;Q=V(Q,Math.sqrt(Le/ke)),L=[(je[0]+Re[0])/2,(je[1]+Re[1])/2],U=[(Ne[0]+Oe[0])/2,(Ne[1]+Oe[1])/2]}else if(J.touch0)L=J.touch0[0],U=J.touch0[1];else return;J.zoom("touch",o($(Q,L,U),J.extent,c))}}function te(F,...ce){if(this.__zooming){var J=R(this,ce).event(F),ue=F.changedTouches,q=ue.length,K,Q;for(wd(F),S&&clearTimeout(S),S=setTimeout(function(){S=null},_),K=0;K<q;++K)Q=ue[K],J.touch0&&J.touch0[2]===Q.identifier?delete J.touch0:J.touch1&&J.touch1[2]===Q.identifier&&delete J.touch1;if(J.touch1&&!J.touch0&&(J.touch0=J.touch1,delete J.touch1),J.touch0)J.touch0[1]=this.__zoom.invert(J.touch0[0]);else if(J.end(),J.taps===2&&(Q=no(Q,this),Math.hypot(b[0]-Q[0],b[1]-Q[1])<T)){var L=xr(this).on("dblclick.zoom");L&&L.apply(this,arguments)}}}return M.wheelDelta=function(F){return arguments.length?(i=typeof F=="function"?F:iu(+F),M):i},M.filter=function(F){return arguments.length?(e=typeof F=="function"?F:iu(!!F),M):e},M.touchable=function(F){return arguments.length?(a=typeof F=="function"?F:iu(!!F),M):a},M.extent=function(F){return arguments.length?(r=typeof F=="function"?F:iu([[+F[0][0],+F[0][1]],[+F[1][0],+F[1][1]]]),M):r},M.scaleExtent=function(F){return arguments.length?(d[0]=+F[0],d[1]=+F[1],M):[d[0],d[1]]},M.translateExtent=function(F){return arguments.length?(c[0][0]=+F[0][0],c[1][0]=+F[1][0],c[0][1]=+F[0][1],c[1][1]=+F[1][1],M):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},M.constrain=function(F){return arguments.length?(o=F,M):o},M.duration=function(F){return arguments.length?(h=+F,M):h},M.interpolate=function(F){return arguments.length?(g=F,M):g},M.on=function(){var F=x.on.apply(x,arguments);return F===x?M:F},M.clickDistance=function(F){return arguments.length?(P=(F=+F)*F,M):Math.sqrt(P)},M.tapDistance=function(F){return arguments.length?(T=+F,M):T},M}const wo={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."},Ba=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],E0=["Enter"," ","Escape"],P0={"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 Ui;(function(e){e.Strict="strict",e.Loose="loose"})(Ui||(Ui={}));var Ys;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ys||(Ys={}));var qa;(function(e){e.Partial="partial",e.Full="full"})(qa||(qa={}));const T0={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ns;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ns||(Ns={}));var Tu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Tu||(Tu={}));var rt;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(rt||(rt={}));const Fh={[rt.Left]:rt.Right,[rt.Right]:rt.Left,[rt.Top]:rt.Bottom,[rt.Bottom]:rt.Top};function $0(e){return e===null?null:e?"valid":"invalid"}const M0=e=>"id"in e&&"source"in e&&"target"in e,_b=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),af=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Qa=(e,r=[0,0])=>{const{width:o,height:i}=Ko(e),a=e.origin??r,d=o*a[0],c=i*a[1];return{x:e.position.x-d,y:e.position.y-c}},jb=(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 d=typeof a=="string";let c=!r.nodeLookup&&!d?a:void 0;r.nodeLookup&&(c=d?r.nodeLookup.get(a):af(a)?a:r.nodeLookup.get(a.id));const h=c?$u(c,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Uu(i,h)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Vu(o)},Ga=(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=Uu(o,$u(a)),i=!0)}),i?Vu(o):{x:0,y:0,width:0,height:0}},lf=(e,r,[o,i,a]=[0,0,1],d=!1,c=!1)=>{const h={...el(r,[o,i,a]),width:r.width/a,height:r.height/a},g=[];for(const x of e.values()){const{measured:k,selectable:b=!0,hidden:S=!1}=x;if(c&&!b||S)continue;const _=k.width??x.width??x.initialWidth??null,j=k.height??x.height??x.initialHeight??null,P=Ua(h,Ki(x)),T=(_??0)*(j??0),M=d&&P>0;(!x.internals.handleBounds||M||P>=T||x.dragging)&&g.push(x)}return g},Cb=(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 Eb(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 Pb({nodes:e,width:r,height:o,panZoom:i,minZoom:a,maxZoom:d},c){if(e.size===0)return Promise.resolve(!0);const h=Eb(e,c),g=Ga(h),x=uf(g,r,o,(c==null?void 0:c.minZoom)??a,(c==null?void 0:c.maxZoom)??d,(c==null?void 0:c.padding)??.1);return await i.setViewport(x,{duration:c==null?void 0:c.duration,ease:c==null?void 0:c.ease,interpolate:c==null?void 0:c.interpolate}),Promise.resolve(!0)}function A0({nodeId:e,nextPosition:r,nodeLookup:o,nodeOrigin:i=[0,0],nodeExtent:a,onError:d}){const c=o.get(e),h=c.parentId?o.get(c.parentId):void 0,{x:g,y:x}=h?h.internals.positionAbsolute:{x:0,y:0},k=c.origin??i;let b=c.extent||a;if(c.extent==="parent"&&!c.expandParent)if(!h)d==null||d("005",wo.error005());else{const _=h.measured.width,j=h.measured.height;_&&j&&(b=[[g,x],[g+_,x+j]])}else h&&Wi(c.extent)&&(b=[[c.extent[0][0]+g,c.extent[0][1]+x],[c.extent[1][0]+g,c.extent[1][1]+x]]);const S=Wi(b)?Gs(r,b,c.measured):r;return(c.measured.width===void 0||c.measured.height===void 0)&&(d==null||d("015",wo.error015())),{position:{x:S.x-g+(c.measured.width??0)*k[0],y:S.y-x+(c.measured.height??0)*k[1]},positionAbsolute:S}}async function Tb({nodesToRemove:e=[],edgesToRemove:r=[],nodes:o,edges:i,onBeforeDelete:a}){const d=new Set(e.map(S=>S.id)),c=[];for(const S of o){if(S.deletable===!1)continue;const _=d.has(S.id),j=!_&&S.parentId&&c.find(P=>P.id===S.parentId);(_||j)&&c.push(S)}const h=new Set(r.map(S=>S.id)),g=i.filter(S=>S.deletable!==!1),k=Cb(c,g);for(const S of g)h.has(S.id)&&!k.find(j=>j.id===S.id)&&k.push(S);if(!a)return{edges:k,nodes:c};const b=await a({nodes:c,edges:k});return typeof b=="boolean"?b?{edges:k,nodes:c}:{edges:[],nodes:[]}:b}const Vi=(e,r=0,o=1)=>Math.min(Math.max(e,r),o),Gs=(e={x:0,y:0},r,o)=>({x:Vi(e.x,r[0][0],r[1][0]-((o==null?void 0:o.width)??0)),y:Vi(e.y,r[0][1],r[1][1]-((o==null?void 0:o.height)??0))});function I0(e,r,o){const{width:i,height:a}=Ko(o),{x:d,y:c}=o.internals.positionAbsolute;return Gs(e,[[d,c],[d+i,c+a]],r)}const zh=(e,r,o)=>e<r?Vi(Math.abs(e-r),1,r)/r:e>o?-Vi(Math.abs(e-o),1,r)/r:0,O0=(e,r,o=15,i=40)=>{const a=zh(e.x,i,r.width-i)*o,d=zh(e.y,i,r.height-i)*o;return[a,d]},Uu=(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)}),Vd=({x:e,y:r,width:o,height:i})=>({x:e,y:r,x2:e+o,y2:r+i}),Vu=({x:e,y:r,x2:o,y2:i})=>({x:e,y:r,width:o-e,height:i-r}),Ki=(e,r=[0,0])=>{var a,d;const{x:o,y:i}=af(e)?e.internals.positionAbsolute:Qa(e,r);return{x:o,y:i,width:((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0,height:((d=e.measured)==null?void 0:d.height)??e.height??e.initialHeight??0}},$u=(e,r=[0,0])=>{var a,d;const{x:o,y:i}=af(e)?e.internals.positionAbsolute:Qa(e,r);return{x:o,y:i,x2:o+(((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0),y2:i+(((d=e.measured)==null?void 0:d.height)??e.height??e.initialHeight??0)}},D0=(e,r)=>Vu(Uu(Vd(e),Vd(r))),Ua=(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)},Bh=e=>oo(e.width)&&oo(e.height)&&oo(e.x)&&oo(e.y),oo=e=>!isNaN(e)&&isFinite(e),$b=(e,r)=>{},Za=(e,r=[1,1])=>({x:r[0]*Math.round(e.x/r[0]),y:r[1]*Math.round(e.y/r[1])}),el=({x:e,y:r},[o,i,a],d=!1,c=[1,1])=>{const h={x:(e-o)/a,y:(r-i)/a};return d?Za(h,c):h},Mu=({x:e,y:r},[o,i,a])=>({x:e*a+o,y:r*a+i});function Ai(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 Mb(e,r,o){if(typeof e=="string"||typeof e=="number"){const i=Ai(e,o),a=Ai(e,r);return{top:i,right:a,bottom:i,left:a,x:a*2,y:i*2}}if(typeof e=="object"){const i=Ai(e.top??e.y??0,o),a=Ai(e.bottom??e.y??0,o),d=Ai(e.left??e.x??0,r),c=Ai(e.right??e.x??0,r);return{top:i,right:c,bottom:a,left:d,x:d+c,y:i+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Ab(e,r,o,i,a,d){const{x:c,y:h}=Mu(e,[r,o,i]),{x:g,y:x}=Mu({x:e.x+e.width,y:e.y+e.height},[r,o,i]),k=a-g,b=d-x;return{left:Math.floor(c),top:Math.floor(h),right:Math.floor(k),bottom:Math.floor(b)}}const uf=(e,r,o,i,a,d)=>{const c=Mb(d,r,o),h=(r-c.x)/e.width,g=(o-c.y)/e.height,x=Math.min(h,g),k=Vi(x,i,a),b=e.x+e.width/2,S=e.y+e.height/2,_=r/2-b*k,j=o/2-S*k,P=Ab(e,_,j,k,r,o),T={left:Math.min(P.left-c.left,0),top:Math.min(P.top-c.top,0),right:Math.min(P.right-c.right,0),bottom:Math.min(P.bottom-c.bottom,0)};return{x:_-T.left+T.right,y:j-T.top+T.bottom,zoom:k}},Va=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Wi(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 R0(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 L0(e,r={width:0,height:0},o,i,a){const d={...e},c=i.get(o);if(c){const h=c.origin||a;d.x+=c.internals.positionAbsolute.x-(r.width??0)*h[0],d.y+=c.internals.positionAbsolute.y-(r.height??0)*h[1]}return d}function qh(e,r){if(e.size!==r.size)return!1;for(const o of e)if(!r.has(o))return!1;return!0}function Ib(){let e,r;return{promise:new Promise((i,a)=>{e=i,r=a}),resolve:e,reject:r}}function Ob(e){return{...P0,...e||{}}}function Oa(e,{snapGrid:r=[0,0],snapToGrid:o=!1,transform:i,containerBounds:a}){const{x:d,y:c}=so(e),h=el({x:d-((a==null?void 0:a.left)??0),y:c-((a==null?void 0:a.top)??0)},i),{x:g,y:x}=o?Za(h,r):h;return{xSnapped:g,ySnapped:x,...h}}const cf=e=>({width:e.offsetWidth,height:e.offsetHeight}),H0=e=>{var r;return((r=e==null?void 0:e.getRootNode)==null?void 0:r.call(e))||(window==null?void 0:window.document)},Db=["INPUT","SELECT","TEXTAREA"];function F0(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:Db.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const z0=e=>"clientX"in e,so=(e,r)=>{var d,c;const o=z0(e),i=o?e.clientX:(d=e.touches)==null?void 0:d[0].clientX,a=o?e.clientY:(c=e.touches)==null?void 0:c[0].clientY;return{x:i-((r==null?void 0:r.left)??0),y:a-((r==null?void 0:r.top)??0)}},Uh=(e,r,o,i,a)=>{const d=r.querySelectorAll(`.${e}`);return!d||!d.length?null:Array.from(d).map(c=>{const h=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),type:e,nodeId:a,position:c.getAttribute("data-handlepos"),x:(h.left-o.left)/i,y:(h.top-o.top)/i,...cf(c)}})};function B0({sourceX:e,sourceY:r,targetX:o,targetY:i,sourceControlX:a,sourceControlY:d,targetControlX:c,targetControlY:h}){const g=e*.125+a*.375+c*.375+o*.125,x=r*.125+d*.375+h*.375+i*.125,k=Math.abs(g-e),b=Math.abs(x-r);return[g,x,k,b]}function au(e,r){return e>=0?.5*e:r*25*Math.sqrt(-e)}function Vh({pos:e,x1:r,y1:o,x2:i,y2:a,c:d}){switch(e){case rt.Left:return[r-au(r-i,d),o];case rt.Right:return[r+au(i-r,d),o];case rt.Top:return[r,o-au(o-a,d)];case rt.Bottom:return[r,o+au(a-o,d)]}}function df({sourceX:e,sourceY:r,sourcePosition:o=rt.Bottom,targetX:i,targetY:a,targetPosition:d=rt.Top,curvature:c=.25}){const[h,g]=Vh({pos:o,x1:e,y1:r,x2:i,y2:a,c}),[x,k]=Vh({pos:d,x1:i,y1:a,x2:e,y2:r,c}),[b,S,_,j]=B0({sourceX:e,sourceY:r,targetX:i,targetY:a,sourceControlX:h,sourceControlY:g,targetControlX:x,targetControlY:k});return[`M${e},${r} C${h},${g} ${x},${k} ${i},${a}`,b,S,_,j]}function q0({sourceX:e,sourceY:r,targetX:o,targetY:i}){const a=Math.abs(o-e)/2,d=o<e?o+a:o-a,c=Math.abs(i-r)/2,h=i<r?i+c:i-c;return[d,h,a,c]}function Rb({sourceNode:e,targetNode:r,selected:o=!1,zIndex:i=0,elevateOnSelect:a=!1,zIndexMode:d="basic"}){if(d==="manual")return i;const c=a&&o?i+1e3:i,h=Math.max(e.parentId||a&&e.selected?e.internals.z:0,r.parentId||a&&r.selected?r.internals.z:0);return c+h}function Lb({sourceNode:e,targetNode:r,width:o,height:i,transform:a}){const d=Uu($u(e),$u(r));d.x===d.x2&&(d.x2+=1),d.y===d.y2&&(d.y2+=1);const c={x:-a[0]/a[2],y:-a[1]/a[2],width:o/a[2],height:i/a[2]};return Ua(c,Vu(d))>0}const Hb=({source:e,sourceHandle:r,target:o,targetHandle:i})=>`xy-edge__${e}${r||""}-${o}${i||""}`,Fb=(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)),U0=(e,r,o={})=>{if(!e.source||!e.target)return r;const i=o.getEdgeId||Hb;let a;return M0(e)?a={...e}:a={...e,id:i(e)},Fb(a,r)?r:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,r.concat(a))};function V0({sourceX:e,sourceY:r,targetX:o,targetY:i}){const[a,d,c,h]=q0({sourceX:e,sourceY:r,targetX:o,targetY:i});return[`M ${e},${r}L ${o},${i}`,a,d,c,h]}const Kh={[rt.Left]:{x:-1,y:0},[rt.Right]:{x:1,y:0},[rt.Top]:{x:0,y:-1},[rt.Bottom]:{x:0,y:1}},zb=({source:e,sourcePosition:r=rt.Bottom,target:o})=>r===rt.Left||r===rt.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},Wh=(e,r)=>Math.sqrt(Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2));function Bb({source:e,sourcePosition:r=rt.Bottom,target:o,targetPosition:i=rt.Top,center:a,offset:d,stepPosition:c}){const h=Kh[r],g=Kh[i],x={x:e.x+h.x*d,y:e.y+h.y*d},k={x:o.x+g.x*d,y:o.y+g.y*d},b=zb({source:x,sourcePosition:r,target:k}),S=b.x!==0?"x":"y",_=b[S];let j=[],P,T;const M={x:0,y:0},V={x:0,y:0},[,,$,O]=q0({sourceX:e.x,sourceY:e.y,targetX:o.x,targetY:o.y});if(h[S]*g[S]===-1){S==="x"?(P=a.x??x.x+(k.x-x.x)*c,T=a.y??(x.y+k.y)/2):(P=a.x??(x.x+k.x)/2,T=a.y??x.y+(k.y-x.y)*c);const Y=[{x:P,y:x.y},{x:P,y:k.y}],le=[{x:x.x,y:T},{x:k.x,y:T}];h[S]===_?j=S==="x"?Y:le:j=S==="x"?le:Y}else{const Y=[{x:x.x,y:k.y}],le=[{x:k.x,y:x.y}];if(S==="x"?j=h.x===_?le:Y:j=h.y===_?Y:le,r===i){const F=Math.abs(e[S]-o[S]);if(F<=d){const ce=Math.min(d-1,d-F);h[S]===_?M[S]=(x[S]>e[S]?-1:1)*ce:V[S]=(k[S]>o[S]?-1:1)*ce}}if(r!==i){const F=S==="x"?"y":"x",ce=h[S]===g[F],J=x[F]>k[F],ue=x[F]<k[F];(h[S]===1&&(!ce&&J||ce&&ue)||h[S]!==1&&(!ce&&ue||ce&&J))&&(j=S==="x"?Y:le)}const we={x:x.x+M.x,y:x.y+M.y},ie={x:k.x+V.x,y:k.y+V.y},de=Math.max(Math.abs(we.x-j[0].x),Math.abs(ie.x-j[0].x)),te=Math.max(Math.abs(we.y-j[0].y),Math.abs(ie.y-j[0].y));de>=te?(P=(we.x+ie.x)/2,T=j[0].y):(P=j[0].x,T=(we.y+ie.y)/2)}const z={x:x.x+M.x,y:x.y+M.y},R={x:k.x+V.x,y:k.y+V.y};return[[e,...z.x!==j[0].x||z.y!==j[0].y?[z]:[],...j,...R.x!==j[j.length-1].x||R.y!==j[j.length-1].y?[R]:[],o],P,T,$,O]}function qb(e,r,o,i){const a=Math.min(Wh(e,r)/2,Wh(r,o)/2,i),{x:d,y:c}=r;if(e.x===d&&d===o.x||e.y===c&&c===o.y)return`L${d} ${c}`;if(e.y===c){const x=e.x<o.x?-1:1,k=e.y<o.y?1:-1;return`L ${d+a*x},${c}Q ${d},${c} ${d},${c+a*k}`}const h=e.x<o.x?1:-1,g=e.y<o.y?-1:1;return`L ${d},${c+a*g}Q ${d},${c} ${d+a*h},${c}`}function Kd({sourceX:e,sourceY:r,sourcePosition:o=rt.Bottom,targetX:i,targetY:a,targetPosition:d=rt.Top,borderRadius:c=5,centerX:h,centerY:g,offset:x=20,stepPosition:k=.5}){const[b,S,_,j,P]=Bb({source:{x:e,y:r},sourcePosition:o,target:{x:i,y:a},targetPosition:d,center:{x:h,y:g},offset:x,stepPosition:k});let T=`M${b[0].x} ${b[0].y}`;for(let M=1;M<b.length-1;M++)T+=qb(b[M-1],b[M],b[M+1],c);return T+=`L${b[b.length-1].x} ${b[b.length-1].y}`,[T,S,_,j,P]}function Yh(e){var r;return e&&!!(e.internals.handleBounds||(r=e.handles)!=null&&r.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Ub(e){var b;const{sourceNode:r,targetNode:o}=e;if(!Yh(r)||!Yh(o))return null;const i=r.internals.handleBounds||Jh(r.handles),a=o.internals.handleBounds||Jh(o.handles),d=Xh((i==null?void 0:i.source)??[],e.sourceHandle),c=Xh(e.connectionMode===Ui.Strict?(a==null?void 0:a.target)??[]:((a==null?void 0:a.target)??[]).concat((a==null?void 0:a.source)??[]),e.targetHandle);if(!d||!c)return(b=e.onError)==null||b.call(e,"008",wo.error008(d?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const h=(d==null?void 0:d.position)||rt.Bottom,g=(c==null?void 0:c.position)||rt.Top,x=Zs(r,d,h),k=Zs(o,c,g);return{sourceX:x.x,sourceY:x.y,targetX:k.x,targetY:k.y,sourcePosition:h,targetPosition:g}}function Jh(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 Zs(e,r,o=rt.Left,i=!1){const a=((r==null?void 0:r.x)??0)+e.internals.positionAbsolute.x,d=((r==null?void 0:r.y)??0)+e.internals.positionAbsolute.y,{width:c,height:h}=r??Ko(e);if(i)return{x:a+c/2,y:d+h/2};switch((r==null?void 0:r.position)??o){case rt.Top:return{x:a+c/2,y:d};case rt.Right:return{x:a+c,y:d+h/2};case rt.Bottom:return{x:a+c/2,y:d+h};case rt.Left:return{x:a,y:d+h/2}}}function Xh(e,r){return e&&(r?e.find(o=>o.id===r):e[0])||null}function Wd(e,r){return e?typeof e=="string"?e:`${r?`${r}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function Vb(e,{id:r,defaultColor:o,defaultMarkerStart:i,defaultMarkerEnd:a}){const d=new Set;return e.reduce((c,h)=>([h.markerStart||i,h.markerEnd||a].forEach(g=>{if(g&&typeof g=="object"){const x=Wd(g,r);d.has(x)||(c.push({id:x,color:g.color||o,...g}),d.add(x))}}),c),[]).sort((c,h)=>c.id.localeCompare(h.id))}const K0=1e3,Kb=10,ff={nodeOrigin:[0,0],nodeExtent:Ba,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Wb={...ff,checkEquality:!0};function pf(e,r){const o={...e};for(const i in r)r[i]!==void 0&&(o[i]=r[i]);return o}function Yb(e,r,o){const i=pf(ff,o);for(const a of e.values())if(a.parentId)mf(a,e,r,i);else{const d=Qa(a,i.nodeOrigin),c=Wi(a.extent)?a.extent:i.nodeExtent,h=Gs(d,c,Ko(a));a.internals.positionAbsolute=h}}function Jb(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 d={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(d):a.type==="target"&&i.push(d)}return{source:o,target:i}}function hf(e){return e==="manual"}function Yd(e,r,o,i={}){var k,b;const a=pf(Wb,i),d={i:0},c=new Map(r),h=a!=null&&a.elevateNodesOnSelect&&!hf(a.zIndexMode)?K0:0;let g=e.length>0,x=!1;r.clear(),o.clear();for(const S of e){let _=c.get(S.id);if(a.checkEquality&&S===(_==null?void 0:_.internals.userNode))r.set(S.id,_);else{const j=Qa(S,a.nodeOrigin),P=Wi(S.extent)?S.extent:a.nodeExtent,T=Gs(j,P,Ko(S));_={...a.defaults,...S,measured:{width:(k=S.measured)==null?void 0:k.width,height:(b=S.measured)==null?void 0:b.height},internals:{positionAbsolute:T,handleBounds:Jb(S,_),z:W0(S,h,a.zIndexMode),userNode:S}},r.set(S.id,_)}(_.measured===void 0||_.measured.width===void 0||_.measured.height===void 0)&&!_.hidden&&(g=!1),S.parentId&&mf(_,r,o,i,d),x||(x=S.selected??!1)}return{nodesInitialized:g,hasSelectedNodes:x}}function Xb(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 mf(e,r,o,i,a){const{elevateNodesOnSelect:d,nodeOrigin:c,nodeExtent:h,zIndexMode:g}=pf(ff,i),x=e.parentId,k=r.get(x);if(!k){console.warn(`Parent node ${x} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Xb(e,o),a&&!k.parentId&&k.internals.rootParentIndex===void 0&&g==="auto"&&(k.internals.rootParentIndex=++a.i,k.internals.z=k.internals.z+a.i*Kb),a&&k.internals.rootParentIndex!==void 0&&(a.i=k.internals.rootParentIndex);const b=d&&!hf(g)?K0:0,{x:S,y:_,z:j}=Qb(e,k,c,h,b,g),{positionAbsolute:P}=e.internals,T=S!==P.x||_!==P.y;(T||j!==e.internals.z)&&r.set(e.id,{...e,internals:{...e.internals,positionAbsolute:T?{x:S,y:_}:P,z:j}})}function W0(e,r,o){const i=oo(e.zIndex)?e.zIndex:0;return hf(o)?i:i+(e.selected?r:0)}function Qb(e,r,o,i,a,d){const{x:c,y:h}=r.internals.positionAbsolute,g=Ko(e),x=Qa(e,o),k=Wi(e.extent)?Gs(x,e.extent,g):x;let b=Gs({x:c+k.x,y:h+k.y},i,g);e.extent==="parent"&&(b=I0(b,g,r));const S=W0(e,a,d),_=r.internals.z??0;return{x:b.x,y:b.y,z:_>=S?_+1:S}}function gf(e,r,o,i=[0,0]){var c;const a=[],d=new Map;for(const h of e){const g=r.get(h.parentId);if(!g)continue;const x=((c=d.get(h.parentId))==null?void 0:c.expandedRect)??Ki(g),k=D0(x,h.rect);d.set(h.parentId,{expandedRect:k,parent:g})}return d.size>0&&d.forEach(({expandedRect:h,parent:g},x)=>{var $;const k=g.internals.positionAbsolute,b=Ko(g),S=g.origin??i,_=h.x<k.x?Math.round(Math.abs(k.x-h.x)):0,j=h.y<k.y?Math.round(Math.abs(k.y-h.y)):0,P=Math.max(b.width,Math.round(h.width)),T=Math.max(b.height,Math.round(h.height)),M=(P-b.width)*S[0],V=(T-b.height)*S[1];(_>0||j>0||M||V)&&(a.push({id:x,type:"position",position:{x:g.position.x-_+M,y:g.position.y-j+V}}),($=o.get(x))==null||$.forEach(O=>{e.some(z=>z.id===O.id)||a.push({id:O.id,type:"position",position:{x:O.position.x+_,y:O.position.y+j}})})),(b.width<h.width||b.height<h.height||_||j)&&a.push({id:x,type:"dimensions",setAttributes:!0,dimensions:{width:P+(_?S[0]*_-M:0),height:T+(j?S[1]*j-V:0)}})}),a}function Gb(e,r,o,i,a,d,c){const h=i==null?void 0:i.querySelector(".xyflow__viewport");let g=!1;if(!h)return{changes:[],updatedInternals:g};const x=[],k=window.getComputedStyle(h),{m22:b}=new window.DOMMatrixReadOnly(k.transform),S=[];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}}),g=!0;continue}const P=cf(_.nodeElement),T=j.measured.width!==P.width||j.measured.height!==P.height;if(!!(P.width&&P.height&&(T||!j.internals.handleBounds||_.force))){const V=_.nodeElement.getBoundingClientRect(),$=Wi(j.extent)?j.extent:d;let{positionAbsolute:O}=j.internals;j.parentId&&j.extent==="parent"?O=I0(O,P,r.get(j.parentId)):$&&(O=Gs(O,$,P));const z={...j,measured:P,internals:{...j.internals,positionAbsolute:O,handleBounds:{source:Uh("source",_.nodeElement,V,b,j.id),target:Uh("target",_.nodeElement,V,b,j.id)}}};r.set(j.id,z),j.parentId&&mf(z,r,o,{nodeOrigin:a,zIndexMode:c}),g=!0,T&&(x.push({id:j.id,type:"dimensions",dimensions:P}),j.expandParent&&j.parentId&&S.push({id:j.id,parentId:j.parentId,rect:Ki(z,a)}))}}if(S.length>0){const _=gf(S,r,o,a);x.push(..._)}return{changes:x,updatedInternals:g}}async function Zb({delta:e,panZoom:r,transform:o,translateExtent:i,width:a,height:d}){if(!r||!e.x&&!e.y)return Promise.resolve(!1);const c=await r.setViewportConstrained({x:o[0]+e.x,y:o[1]+e.y,zoom:o[2]},[[0,0],[a,d]],i),h=!!c&&(c.x!==o[0]||c.y!==o[1]||c.k!==o[2]);return Promise.resolve(h)}function Qh(e,r,o,i,a,d){let c=a;const h=i.get(c)||new Map;i.set(c,h.set(o,r)),c=`${a}-${e}`;const g=i.get(c)||new Map;if(i.set(c,g.set(o,r)),d){c=`${a}-${e}-${d}`;const x=i.get(c)||new Map;i.set(c,x.set(o,r))}}function Y0(e,r,o){e.clear(),r.clear();for(const i of o){const{source:a,target:d,sourceHandle:c=null,targetHandle:h=null}=i,g={edgeId:i.id,source:a,target:d,sourceHandle:c,targetHandle:h},x=`${a}-${c}--${d}-${h}`,k=`${d}-${h}--${a}-${c}`;Qh("source",g,k,e,a,c),Qh("target",g,x,e,d,h),r.set(i.id,i)}}function J0(e,r){if(!e.parentId)return!1;const o=r.get(e.parentId);return o?o.selected?!0:J0(o,r):!1}function Gh(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 eS(e,r,o,i){const a=new Map;for(const[d,c]of e)if((c.selected||c.id===i)&&(!c.parentId||!J0(c,e))&&(c.draggable||r&&typeof c.draggable>"u")){const h=e.get(d);h&&a.set(d,{id:d,position:h.position||{x:0,y:0},distance:{x:o.x-h.internals.positionAbsolute.x,y:o.y-h.internals.positionAbsolute.y},extent:h.extent,parentId:h.parentId,origin:h.origin,expandParent:h.expandParent,internals:{positionAbsolute:h.internals.positionAbsolute||{x:0,y:0}},measured:{width:h.measured.width??0,height:h.measured.height??0}})}return a}function bd({nodeId:e,dragItems:r,nodeLookup:o,dragging:i=!0}){var c,h,g;const a=[];for(const[x,k]of r){const b=(c=o.get(x))==null?void 0:c.internals.userNode;b&&a.push({...b,position:k.position,dragging:i})}if(!e)return[a[0],a];const d=(h=o.get(e))==null?void 0:h.internals.userNode;return[d?{...d,position:((g=r.get(e))==null?void 0:g.position)||d.position,dragging:i}:a[0],a]}function tS({dragItems:e,snapGrid:r,x:o,y:i}){const a=e.values().next().value;if(!a)return null;const d={x:o-a.distance.x,y:i-a.distance.y},c=Za(d,r);return{x:c.x-d.x,y:c.y-d.y}}function nS({onNodeMouseDown:e,getStoreItems:r,onDragStart:o,onDrag:i,onDragStop:a}){let d={x:null,y:null},c=0,h=new Map,g=!1,x={x:0,y:0},k=null,b=!1,S=null,_=!1,j=!1,P=null;function T({noDragClassName:V,handleSelector:$,domNode:O,isSelectable:z,nodeId:R,nodeClickDistance:W=0}){S=xr(O);function Y({x:de,y:te}){const{nodeLookup:F,nodeExtent:ce,snapGrid:J,snapToGrid:ue,nodeOrigin:q,onNodeDrag:K,onSelectionDrag:Q,onError:L,updateNodePositions:U}=r();d={x:de,y:te};let je=!1;const Ne=h.size>1,Re=Ne&&ce?Vd(Ga(h)):null,Oe=Ne&&ue?tS({dragItems:h,snapGrid:J,x:de,y:te}):null;for(const[Le,ke]of h){if(!F.has(Le))continue;let $e={x:de-ke.distance.x,y:te-ke.distance.y};ue&&($e=Oe?{x:Math.round($e.x+Oe.x),y:Math.round($e.y+Oe.y)}:Za($e,J));let _e=null;if(Ne&&ce&&!ke.extent&&Re){const{positionAbsolute:Je}=ke.internals,at=Je.x-Re.x+ce[0][0],mt=Je.x+ke.measured.width-Re.x2+ce[1][0],ft=Je.y-Re.y+ce[0][1],Mt=Je.y+ke.measured.height-Re.y2+ce[1][1];_e=[[at,ft],[mt,Mt]]}const{position:tt,positionAbsolute:ze}=A0({nodeId:Le,nextPosition:$e,nodeLookup:F,nodeExtent:_e||ce,nodeOrigin:q,onError:L});je=je||ke.position.x!==tt.x||ke.position.y!==tt.y,ke.position=tt,ke.internals.positionAbsolute=ze}if(j=j||je,!!je&&(U(h,!0),P&&(i||K||!R&&Q))){const[Le,ke]=bd({nodeId:R,dragItems:h,nodeLookup:F});i==null||i(P,h,Le,ke),K==null||K(P,Le,ke),R||Q==null||Q(P,ke)}}async function le(){if(!k)return;const{transform:de,panBy:te,autoPanSpeed:F,autoPanOnNodeDrag:ce}=r();if(!ce){g=!1,cancelAnimationFrame(c);return}const[J,ue]=O0(x,k,F);(J!==0||ue!==0)&&(d.x=(d.x??0)-J/de[2],d.y=(d.y??0)-ue/de[2],await te({x:J,y:ue})&&Y(d)),c=requestAnimationFrame(le)}function we(de){var Ne;const{nodeLookup:te,multiSelectionActive:F,nodesDraggable:ce,transform:J,snapGrid:ue,snapToGrid:q,selectNodesOnDrag:K,onNodeDragStart:Q,onSelectionDragStart:L,unselectNodesAndEdges:U}=r();b=!0,(!K||!z)&&!F&&R&&((Ne=te.get(R))!=null&&Ne.selected||U()),z&&K&&R&&(e==null||e(R));const je=Oa(de.sourceEvent,{transform:J,snapGrid:ue,snapToGrid:q,containerBounds:k});if(d=je,h=eS(te,ce,je,R),h.size>0&&(o||Q||!R&&L)){const[Re,Oe]=bd({nodeId:R,dragItems:h,nodeLookup:te});o==null||o(de.sourceEvent,h,Re,Oe),Q==null||Q(de.sourceEvent,Re,Oe),R||L==null||L(de.sourceEvent,Oe)}}const ie=f0().clickDistance(W).on("start",de=>{const{domNode:te,nodeDragThreshold:F,transform:ce,snapGrid:J,snapToGrid:ue}=r();k=(te==null?void 0:te.getBoundingClientRect())||null,_=!1,j=!1,P=de.sourceEvent,F===0&&we(de),d=Oa(de.sourceEvent,{transform:ce,snapGrid:J,snapToGrid:ue,containerBounds:k}),x=so(de.sourceEvent,k)}).on("drag",de=>{const{autoPanOnNodeDrag:te,transform:F,snapGrid:ce,snapToGrid:J,nodeDragThreshold:ue,nodeLookup:q}=r(),K=Oa(de.sourceEvent,{transform:F,snapGrid:ce,snapToGrid:J,containerBounds:k});if(P=de.sourceEvent,(de.sourceEvent.type==="touchmove"&&de.sourceEvent.touches.length>1||R&&!q.has(R))&&(_=!0),!_){if(!g&&te&&b&&(g=!0,le()),!b){const Q=so(de.sourceEvent,k),L=Q.x-x.x,U=Q.y-x.y;Math.sqrt(L*L+U*U)>ue&&we(de)}(d.x!==K.xSnapped||d.y!==K.ySnapped)&&h&&b&&(x=so(de.sourceEvent,k),Y(K))}}).on("end",de=>{if(!(!b||_)&&(g=!1,b=!1,cancelAnimationFrame(c),h.size>0)){const{nodeLookup:te,updateNodePositions:F,onNodeDragStop:ce,onSelectionDragStop:J}=r();if(j&&(F(h,!1),j=!1),a||ce||!R&&J){const[ue,q]=bd({nodeId:R,dragItems:h,nodeLookup:te,dragging:!1});a==null||a(de.sourceEvent,h,ue,q),ce==null||ce(de.sourceEvent,ue,q),R||J==null||J(de.sourceEvent,q)}}}).filter(de=>{const te=de.target;return!de.button&&(!V||!Gh(te,`.${V}`,O))&&(!$||Gh(te,$,O))});S.call(ie)}function M(){S==null||S.on(".drag",null)}return{update:T,destroy:M}}function rS(e,r,o){const i=[],a={x:e.x-o,y:e.y-o,width:o*2,height:o*2};for(const d of r.values())Ua(a,Ki(d))>0&&i.push(d);return i}const oS=250;function sS(e,r,o,i){var h,g;let a=[],d=1/0;const c=rS(e,o,r+oS);for(const x of c){const k=[...((h=x.internals.handleBounds)==null?void 0:h.source)??[],...((g=x.internals.handleBounds)==null?void 0:g.target)??[]];for(const b of k){if(i.nodeId===b.nodeId&&i.type===b.type&&i.id===b.id)continue;const{x:S,y:_}=Zs(x,b,b.position,!0),j=Math.sqrt(Math.pow(S-e.x,2)+Math.pow(_-e.y,2));j>r||(j<d?(a=[{...b,x:S,y:_}],d=j):j===d&&a.push({...b,x:S,y:_}))}}if(!a.length)return null;if(a.length>1){const x=i.type==="source"?"target":"source";return a.find(k=>k.type===x)??a[0]}return a[0]}function X0(e,r,o,i,a,d=!1){var x,k,b;const c=i.get(e);if(!c)return null;const h=a==="strict"?(x=c.internals.handleBounds)==null?void 0:x[r]:[...((k=c.internals.handleBounds)==null?void 0:k.source)??[],...((b=c.internals.handleBounds)==null?void 0:b.target)??[]],g=(o?h==null?void 0:h.find(S=>S.id===o):h==null?void 0:h[0])??null;return g&&d?{...g,...Zs(c,g,g.position,!0)}:g}function Q0(e,r){return e||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function iS(e,r){let o=null;return r?o=!0:e&&!r&&(o=!1),o}const G0=()=>!0;function aS(e,{connectionMode:r,connectionRadius:o,handleId:i,nodeId:a,edgeUpdaterType:d,isTarget:c,domNode:h,nodeLookup:g,lib:x,autoPanOnConnect:k,flowId:b,panBy:S,cancelConnection:_,onConnectStart:j,onConnect:P,onConnectEnd:T,isValidConnection:M=G0,onReconnectEnd:V,updateConnection:$,getTransform:O,getFromHandle:z,autoPanSpeed:R,dragThreshold:W=1,handleDomNode:Y}){const le=H0(e.target);let we=0,ie;const{x:de,y:te}=so(e),F=Q0(d,Y),ce=h==null?void 0:h.getBoundingClientRect();let J=!1;if(!ce||!F)return;const ue=X0(a,F,i,g,r);if(!ue)return;let q=so(e,ce),K=!1,Q=null,L=!1,U=null;function je(){if(!k||!ce)return;const[tt,ze]=O0(q,ce,R);S({x:tt,y:ze}),we=requestAnimationFrame(je)}const Ne={...ue,nodeId:a,type:F,position:ue.position},Re=g.get(a);let Le={inProgress:!0,isValid:null,from:Zs(Re,Ne,rt.Left,!0),fromHandle:Ne,fromPosition:Ne.position,fromNode:Re,to:q,toHandle:null,toPosition:Fh[Ne.position],toNode:null,pointer:q};function ke(){J=!0,$(Le),j==null||j(e,{nodeId:a,handleId:i,handleType:F})}W===0&&ke();function $e(tt){if(!J){const{x:Mt,y:Xt}=so(tt),nn=Mt-de,Ht=Xt-te;if(!(nn*nn+Ht*Ht>W*W))return;ke()}if(!z()||!Ne){_e(tt);return}const ze=O();q=so(tt,ce),ie=sS(el(q,ze,!1,[1,1]),o,g,Ne),K||(je(),K=!0);const Je=Z0(tt,{handle:ie,connectionMode:r,fromNodeId:a,fromHandleId:i,fromType:c?"target":"source",isValidConnection:M,doc:le,lib:x,flowId:b,nodeLookup:g});U=Je.handleDomNode,Q=Je.connection,L=iS(!!ie,Je.isValid);const at=g.get(a),mt=at?Zs(at,Ne,rt.Left,!0):Le.from,ft={...Le,from:mt,isValid:L,to:Je.toHandle&&L?Mu({x:Je.toHandle.x,y:Je.toHandle.y},ze):q,toHandle:Je.toHandle,toPosition:L&&Je.toHandle?Je.toHandle.position:Fh[Ne.position],toNode:Je.toHandle?g.get(Je.toHandle.nodeId):null,pointer:q};$(ft),Le=ft}function _e(tt){if(!("touches"in tt&&tt.touches.length>0)){if(J){(ie||U)&&Q&&L&&(P==null||P(Q));const{inProgress:ze,...Je}=Le,at={...Je,toPosition:Le.toHandle?Le.toPosition:null};T==null||T(tt,at),d&&(V==null||V(tt,at))}_(),cancelAnimationFrame(we),K=!1,L=!1,Q=null,U=null,le.removeEventListener("mousemove",$e),le.removeEventListener("mouseup",_e),le.removeEventListener("touchmove",$e),le.removeEventListener("touchend",_e)}}le.addEventListener("mousemove",$e),le.addEventListener("mouseup",_e),le.addEventListener("touchmove",$e),le.addEventListener("touchend",_e)}function Z0(e,{handle:r,connectionMode:o,fromNodeId:i,fromHandleId:a,fromType:d,doc:c,lib:h,flowId:g,isValidConnection:x=G0,nodeLookup:k}){const b=d==="target",S=r?c.querySelector(`.${h}-flow__handle[data-id="${g}-${r==null?void 0:r.nodeId}-${r==null?void 0:r.id}-${r==null?void 0:r.type}"]`):null,{x:_,y:j}=so(e),P=c.elementFromPoint(_,j),T=P!=null&&P.classList.contains(`${h}-flow__handle`)?P:S,M={handleDomNode:T,isValid:!1,connection:null,toHandle:null};if(T){const V=Q0(void 0,T),$=T.getAttribute("data-nodeid"),O=T.getAttribute("data-handleid"),z=T.classList.contains("connectable"),R=T.classList.contains("connectableend");if(!$||!V)return M;const W={source:b?$:i,sourceHandle:b?O:a,target:b?i:$,targetHandle:b?a:O};M.connection=W;const le=z&&R&&(o===Ui.Strict?b&&V==="source"||!b&&V==="target":$!==i||O!==a);M.isValid=le&&x(W),M.toHandle=X0($,V,O,k,o,!0)}return M}const Jd={onPointerDown:aS,isValid:Z0};function lS({domNode:e,panZoom:r,getTransform:o,getViewScale:i}){const a=xr(e);function d({translateExtent:h,width:g,height:x,zoomStep:k=1,pannable:b=!0,zoomable:S=!0,inversePan:_=!1}){const j=$=>{if($.sourceEvent.type!=="wheel"||!r)return;const O=o(),z=$.sourceEvent.ctrlKey&&Va()?10:1,R=-$.sourceEvent.deltaY*($.sourceEvent.deltaMode===1?.05:$.sourceEvent.deltaMode?1:.002)*k,W=O[2]*Math.pow(2,R*z);r.scaleTo(W)};let P=[0,0];const T=$=>{($.sourceEvent.type==="mousedown"||$.sourceEvent.type==="touchstart")&&(P=[$.sourceEvent.clientX??$.sourceEvent.touches[0].clientX,$.sourceEvent.clientY??$.sourceEvent.touches[0].clientY])},M=$=>{const O=o();if($.sourceEvent.type!=="mousemove"&&$.sourceEvent.type!=="touchmove"||!r)return;const z=[$.sourceEvent.clientX??$.sourceEvent.touches[0].clientX,$.sourceEvent.clientY??$.sourceEvent.touches[0].clientY],R=[z[0]-P[0],z[1]-P[1]];P=z;const W=i()*Math.max(O[2],Math.log(O[2]))*(_?-1:1),Y={x:O[0]-R[0]*W,y:O[1]-R[1]*W},le=[[0,0],[g,x]];r.setViewportConstrained({x:Y.x,y:Y.y,zoom:O[2]},le,h)},V=C0().on("start",T).on("zoom",b?M:null).on("zoom.wheel",S?j:null);a.call(V,{})}function c(){a.on("zoom",null)}return{update:d,destroy:c,pointer:no}}const Ku=e=>({x:e.x,y:e.y,zoom:e.k}),Sd=({x:e,y:r,zoom:o})=>qu.translate(e,r).scale(o),Di=(e,r)=>e.target.closest(`.${r}`),eg=(e,r)=>r===2&&Array.isArray(e)&&e.includes(2),uS=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,kd=(e,r=0,o=uS,i=()=>{})=>{const a=typeof r=="number"&&r>0;return a||i(),a?e.transition().duration(r).ease(o).on("end",i):e},tg=e=>{const r=e.ctrlKey&&Va()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*r};function cS({zoomPanValues:e,noWheelClassName:r,d3Selection:o,d3Zoom:i,panOnScrollMode:a,panOnScrollSpeed:d,zoomOnPinch:c,onPanZoomStart:h,onPanZoom:g,onPanZoomEnd:x}){return k=>{if(Di(k,r))return k.ctrlKey&&k.preventDefault(),!1;k.preventDefault(),k.stopImmediatePropagation();const b=o.property("__zoom").k||1;if(k.ctrlKey&&c){const T=no(k),M=tg(k),V=b*Math.pow(2,M);i.scaleTo(o,V,T,k);return}const S=k.deltaMode===1?20:1;let _=a===Ys.Vertical?0:k.deltaX*S,j=a===Ys.Horizontal?0:k.deltaY*S;!Va()&&k.shiftKey&&a!==Ys.Vertical&&(_=k.deltaY*S,j=0),i.translateBy(o,-(_/b)*d,-(j/b)*d,{internal:!0});const P=Ku(o.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(g==null||g(k,P),e.panScrollTimeout=setTimeout(()=>{x==null||x(k,P),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,h==null||h(k,P))}}function dS({noWheelClassName:e,preventScrolling:r,d3ZoomHandler:o}){return function(i,a){const d=i.type==="wheel",c=!r&&d&&!i.ctrlKey,h=Di(i,e);if(i.ctrlKey&&d&&h&&i.preventDefault(),c||h)return null;i.preventDefault(),o.call(this,i,a)}}function fS({zoomPanValues:e,onDraggingChange:r,onPanZoomStart:o}){return i=>{var d,c,h;if((d=i.sourceEvent)!=null&&d.internal)return;const a=Ku(i.transform);e.mouseButton=((c=i.sourceEvent)==null?void 0:c.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,((h=i.sourceEvent)==null?void 0:h.type)==="mousedown"&&r(!0),o&&(o==null||o(i.sourceEvent,a))}}function pS({zoomPanValues:e,panOnDrag:r,onPaneContextMenu:o,onTransformChange:i,onPanZoom:a}){return d=>{var c,h;e.usedRightMouseButton=!!(o&&eg(r,e.mouseButton??0)),(c=d.sourceEvent)!=null&&c.sync||i([d.transform.x,d.transform.y,d.transform.k]),a&&!((h=d.sourceEvent)!=null&&h.internal)&&(a==null||a(d.sourceEvent,Ku(d.transform)))}}function hS({zoomPanValues:e,panOnDrag:r,panOnScroll:o,onDraggingChange:i,onPanZoomEnd:a,onPaneContextMenu:d}){return c=>{var h;if(!((h=c.sourceEvent)!=null&&h.internal)&&(e.isZoomingOrPanning=!1,d&&eg(r,e.mouseButton??0)&&!e.usedRightMouseButton&&c.sourceEvent&&d(c.sourceEvent),e.usedRightMouseButton=!1,i(!1),a)){const g=Ku(c.transform);e.prevViewport=g,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(c.sourceEvent,g)},o?150:0)}}}function mS({zoomActivationKeyPressed:e,zoomOnScroll:r,zoomOnPinch:o,panOnDrag:i,panOnScroll:a,zoomOnDoubleClick:d,userSelectionActive:c,noWheelClassName:h,noPanClassName:g,lib:x,connectionInProgress:k}){return b=>{var T;const S=e||r,_=o&&b.ctrlKey,j=b.type==="wheel";if(b.button===1&&b.type==="mousedown"&&(Di(b,`${x}-flow__node`)||Di(b,`${x}-flow__edge`)))return!0;if(!i&&!S&&!a&&!d&&!o||c||k&&!j||Di(b,h)&&j||Di(b,g)&&(!j||a&&j&&!e)||!o&&b.ctrlKey&&j)return!1;if(!o&&b.type==="touchstart"&&((T=b.touches)==null?void 0:T.length)>1)return b.preventDefault(),!1;if(!S&&!a&&!_&&j||!i&&(b.type==="mousedown"||b.type==="touchstart")||Array.isArray(i)&&!i.includes(b.button)&&b.type==="mousedown")return!1;const P=Array.isArray(i)&&i.includes(b.button)||!b.button||b.button<=1;return(!b.ctrlKey||j)&&P}}function gS({domNode:e,minZoom:r,maxZoom:o,translateExtent:i,viewport:a,onPanZoom:d,onPanZoomStart:c,onPanZoomEnd:h,onDraggingChange:g}){const x={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},k=e.getBoundingClientRect(),b=C0().scaleExtent([r,o]).translateExtent(i),S=xr(e).call(b);V({x:a.x,y:a.y,zoom:Vi(a.zoom,r,o)},[[0,0],[k.width,k.height]],i);const _=S.on("wheel.zoom"),j=S.on("dblclick.zoom");b.wheelDelta(tg);function P(ie,de){return S?new Promise(te=>{b==null||b.interpolate((de==null?void 0:de.interpolate)==="linear"?Ia:gu).transform(kd(S,de==null?void 0:de.duration,de==null?void 0:de.ease,()=>te(!0)),ie)}):Promise.resolve(!1)}function T({noWheelClassName:ie,noPanClassName:de,onPaneContextMenu:te,userSelectionActive:F,panOnScroll:ce,panOnDrag:J,panOnScrollMode:ue,panOnScrollSpeed:q,preventScrolling:K,zoomOnPinch:Q,zoomOnScroll:L,zoomOnDoubleClick:U,zoomActivationKeyPressed:je,lib:Ne,onTransformChange:Re,connectionInProgress:Oe,paneClickDistance:Le,selectionOnDrag:ke}){F&&!x.isZoomingOrPanning&&M();const $e=ce&&!je&&!F;b.clickDistance(ke?1/0:!oo(Le)||Le<0?0:Le);const _e=$e?cS({zoomPanValues:x,noWheelClassName:ie,d3Selection:S,d3Zoom:b,panOnScrollMode:ue,panOnScrollSpeed:q,zoomOnPinch:Q,onPanZoomStart:c,onPanZoom:d,onPanZoomEnd:h}):dS({noWheelClassName:ie,preventScrolling:K,d3ZoomHandler:_});if(S.on("wheel.zoom",_e,{passive:!1}),!F){const ze=fS({zoomPanValues:x,onDraggingChange:g,onPanZoomStart:c});b.on("start",ze);const Je=pS({zoomPanValues:x,panOnDrag:J,onPaneContextMenu:!!te,onPanZoom:d,onTransformChange:Re});b.on("zoom",Je);const at=hS({zoomPanValues:x,panOnDrag:J,panOnScroll:ce,onPaneContextMenu:te,onPanZoomEnd:h,onDraggingChange:g});b.on("end",at)}const tt=mS({zoomActivationKeyPressed:je,panOnDrag:J,zoomOnScroll:L,panOnScroll:ce,zoomOnDoubleClick:U,zoomOnPinch:Q,userSelectionActive:F,noPanClassName:de,noWheelClassName:ie,lib:Ne,connectionInProgress:Oe});b.filter(tt),U?S.on("dblclick.zoom",j):S.on("dblclick.zoom",null)}function M(){b.on("zoom",null)}async function V(ie,de,te){const F=Sd(ie),ce=b==null?void 0:b.constrain()(F,de,te);return ce&&await P(ce),new Promise(J=>J(ce))}async function $(ie,de){const te=Sd(ie);return await P(te,de),new Promise(F=>F(te))}function O(ie){if(S){const de=Sd(ie),te=S.property("__zoom");(te.k!==ie.zoom||te.x!==ie.x||te.y!==ie.y)&&(b==null||b.transform(S,de,null,{sync:!0}))}}function z(){const ie=S?j0(S.node()):{x:0,y:0,k:1};return{x:ie.x,y:ie.y,zoom:ie.k}}function R(ie,de){return S?new Promise(te=>{b==null||b.interpolate((de==null?void 0:de.interpolate)==="linear"?Ia:gu).scaleTo(kd(S,de==null?void 0:de.duration,de==null?void 0:de.ease,()=>te(!0)),ie)}):Promise.resolve(!1)}function W(ie,de){return S?new Promise(te=>{b==null||b.interpolate((de==null?void 0:de.interpolate)==="linear"?Ia:gu).scaleBy(kd(S,de==null?void 0:de.duration,de==null?void 0:de.ease,()=>te(!0)),ie)}):Promise.resolve(!1)}function Y(ie){b==null||b.scaleExtent(ie)}function le(ie){b==null||b.translateExtent(ie)}function we(ie){const de=!oo(ie)||ie<0?0:ie;b==null||b.clickDistance(de)}return{update:T,destroy:M,setViewport:$,setViewportConstrained:V,getViewport:z,scaleTo:R,scaleBy:W,setScaleExtent:Y,setTranslateExtent:le,syncViewport:O,setClickDistance:we}}var Yi;(function(e){e.Line="line",e.Handle="handle"})(Yi||(Yi={}));function yS({width:e,prevWidth:r,height:o,prevHeight:i,affectsX:a,affectsY:d}){const c=e-r,h=o-i,g=[c>0?1:c<0?-1:0,h>0?1:h<0?-1:0];return c&&a&&(g[0]=g[0]*-1),h&&d&&(g[1]=g[1]*-1),g}function Zh(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 Ss(e,r){return Math.max(0,r-e)}function ks(e,r){return Math.max(0,e-r)}function lu(e,r,o){return Math.max(0,r-e,e-o)}function em(e,r){return e?!r:r}function xS(e,r,o,i,a,d,c,h){let{affectsX:g,affectsY:x}=r;const{isHorizontal:k,isVertical:b}=r,S=k&&b,{xSnapped:_,ySnapped:j}=o,{minWidth:P,maxWidth:T,minHeight:M,maxHeight:V}=i,{x:$,y:O,width:z,height:R,aspectRatio:W}=e;let Y=Math.floor(k?_-e.pointerX:0),le=Math.floor(b?j-e.pointerY:0);const we=z+(g?-Y:Y),ie=R+(x?-le:le),de=-d[0]*z,te=-d[1]*R;let F=lu(we,P,T),ce=lu(ie,M,V);if(c){let q=0,K=0;g&&Y<0?q=Ss($+Y+de,c[0][0]):!g&&Y>0&&(q=ks($+we+de,c[1][0])),x&&le<0?K=Ss(O+le+te,c[0][1]):!x&&le>0&&(K=ks(O+ie+te,c[1][1])),F=Math.max(F,q),ce=Math.max(ce,K)}if(h){let q=0,K=0;g&&Y>0?q=ks($+Y,h[0][0]):!g&&Y<0&&(q=Ss($+we,h[1][0])),x&&le>0?K=ks(O+le,h[0][1]):!x&&le<0&&(K=Ss(O+ie,h[1][1])),F=Math.max(F,q),ce=Math.max(ce,K)}if(a){if(k){const q=lu(we/W,M,V)*W;if(F=Math.max(F,q),c){let K=0;!g&&!x||g&&!x&&S?K=ks(O+te+we/W,c[1][1])*W:K=Ss(O+te+(g?Y:-Y)/W,c[0][1])*W,F=Math.max(F,K)}if(h){let K=0;!g&&!x||g&&!x&&S?K=Ss(O+we/W,h[1][1])*W:K=ks(O+(g?Y:-Y)/W,h[0][1])*W,F=Math.max(F,K)}}if(b){const q=lu(ie*W,P,T)/W;if(ce=Math.max(ce,q),c){let K=0;!g&&!x||x&&!g&&S?K=ks($+ie*W+de,c[1][0])/W:K=Ss($+(x?le:-le)*W+de,c[0][0])/W,ce=Math.max(ce,K)}if(h){let K=0;!g&&!x||x&&!g&&S?K=Ss($+ie*W,h[1][0])/W:K=ks($+(x?le:-le)*W,h[0][0])/W,ce=Math.max(ce,K)}}}le=le+(le<0?ce:-ce),Y=Y+(Y<0?F:-F),a&&(S?we>ie*W?le=(em(g,x)?-Y:Y)/W:Y=(em(g,x)?-le:le)*W:k?(le=Y/W,x=g):(Y=le*W,g=x));const J=g?$+Y:$,ue=x?O+le:O;return{width:z+(g?-Y:Y),height:R+(x?-le:le),x:d[0]*Y*(g?-1:1)+J,y:d[1]*le*(x?-1:1)+ue}}const ng={width:0,height:0,x:0,y:0},vS={...ng,pointerX:0,pointerY:0,aspectRatio:1};function wS(e){return[[0,0],[e.measured.width,e.measured.height]]}function bS(e,r,o){const i=r.position.x+e.position.x,a=r.position.y+e.position.y,d=e.measured.width??0,c=e.measured.height??0,h=o[0]*d,g=o[1]*c;return[[i-h,a-g],[i+d-h,a+c-g]]}function SS({domNode:e,nodeId:r,getStoreItems:o,onChange:i,onEnd:a}){const d=xr(e);let c={controlDirection:Zh("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function h({controlPosition:x,boundaries:k,keepAspectRatio:b,resizeDirection:S,onResizeStart:_,onResize:j,onResizeEnd:P,shouldResize:T}){let M={...ng},V={...vS};c={boundaries:k,resizeDirection:S,keepAspectRatio:b,controlDirection:Zh(x)};let $,O=null,z=[],R,W,Y,le=!1;const we=f0().on("start",ie=>{const{nodeLookup:de,transform:te,snapGrid:F,snapToGrid:ce,nodeOrigin:J,paneDomNode:ue}=o();if($=de.get(r),!$)return;O=(ue==null?void 0:ue.getBoundingClientRect())??null;const{xSnapped:q,ySnapped:K}=Oa(ie.sourceEvent,{transform:te,snapGrid:F,snapToGrid:ce,containerBounds:O});M={width:$.measured.width??0,height:$.measured.height??0,x:$.position.x??0,y:$.position.y??0},V={...M,pointerX:q,pointerY:K,aspectRatio:M.width/M.height},R=void 0,$.parentId&&($.extent==="parent"||$.expandParent)&&(R=de.get($.parentId),W=R&&$.extent==="parent"?wS(R):void 0),z=[],Y=void 0;for(const[Q,L]of de)if(L.parentId===r&&(z.push({id:Q,position:{...L.position},extent:L.extent}),L.extent==="parent"||L.expandParent)){const U=bS(L,$,L.origin??J);Y?Y=[[Math.min(U[0][0],Y[0][0]),Math.min(U[0][1],Y[0][1])],[Math.max(U[1][0],Y[1][0]),Math.max(U[1][1],Y[1][1])]]:Y=U}_==null||_(ie,{...M})}).on("drag",ie=>{const{transform:de,snapGrid:te,snapToGrid:F,nodeOrigin:ce}=o(),J=Oa(ie.sourceEvent,{transform:de,snapGrid:te,snapToGrid:F,containerBounds:O}),ue=[];if(!$)return;const{x:q,y:K,width:Q,height:L}=M,U={},je=$.origin??ce,{width:Ne,height:Re,x:Oe,y:Le}=xS(V,c.controlDirection,J,c.boundaries,c.keepAspectRatio,je,W,Y),ke=Ne!==Q,$e=Re!==L,_e=Oe!==q&&ke,tt=Le!==K&&$e;if(!_e&&!tt&&!ke&&!$e)return;if((_e||tt||je[0]===1||je[1]===1)&&(U.x=_e?Oe:M.x,U.y=tt?Le:M.y,M.x=U.x,M.y=U.y,z.length>0)){const mt=Oe-q,ft=Le-K;for(const Mt of z)Mt.position={x:Mt.position.x-mt+je[0]*(Ne-Q),y:Mt.position.y-ft+je[1]*(Re-L)},ue.push(Mt)}if((ke||$e)&&(U.width=ke&&(!c.resizeDirection||c.resizeDirection==="horizontal")?Ne:M.width,U.height=$e&&(!c.resizeDirection||c.resizeDirection==="vertical")?Re:M.height,M.width=U.width,M.height=U.height),R&&$.expandParent){const mt=je[0]*(U.width??0);U.x&&U.x<mt&&(M.x=mt,V.x=V.x-(U.x-mt));const ft=je[1]*(U.height??0);U.y&&U.y<ft&&(M.y=ft,V.y=V.y-(U.y-ft))}const ze=yS({width:M.width,prevWidth:Q,height:M.height,prevHeight:L,affectsX:c.controlDirection.affectsX,affectsY:c.controlDirection.affectsY}),Je={...M,direction:ze};(T==null?void 0:T(ie,Je))!==!1&&(le=!0,j==null||j(ie,Je),i(U,ue))}).on("end",ie=>{le&&(P==null||P(ie,{...M}),a==null||a({...M}),le=!1)});d.call(we)}function g(){d.on(".drag",null)}return{update:h,destroy:g}}var Nd={exports:{}},_d={},jd={exports:{}},Cd={};/**
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 tm;function kS(){if(tm)return Cd;tm=1;var e=Ya();function r(b,S){return b===S&&(b!==0||1/b===1/S)||b!==b&&S!==S}var o=typeof Object.is=="function"?Object.is:r,i=e.useState,a=e.useEffect,d=e.useLayoutEffect,c=e.useDebugValue;function h(b,S){var _=S(),j=i({inst:{value:_,getSnapshot:S}}),P=j[0].inst,T=j[1];return d(function(){P.value=_,P.getSnapshot=S,g(P)&&T({inst:P})},[b,_,S]),a(function(){return g(P)&&T({inst:P}),b(function(){g(P)&&T({inst:P})})},[b]),c(_),_}function g(b){var S=b.getSnapshot;b=b.value;try{var _=S();return!o(b,_)}catch{return!0}}function x(b,S){return S()}var k=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?x:h;return Cd.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:k,Cd}var nm;function NS(){return nm||(nm=1,jd.exports=kS()),jd.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 rm;function _S(){if(rm)return _d;rm=1;var e=Ya(),r=NS();function o(x,k){return x===k&&(x!==0||1/x===1/k)||x!==x&&k!==k}var i=typeof Object.is=="function"?Object.is:o,a=r.useSyncExternalStore,d=e.useRef,c=e.useEffect,h=e.useMemo,g=e.useDebugValue;return _d.useSyncExternalStoreWithSelector=function(x,k,b,S,_){var j=d(null);if(j.current===null){var P={hasValue:!1,value:null};j.current=P}else P=j.current;j=h(function(){function M(R){if(!V){if(V=!0,$=R,R=S(R),_!==void 0&&P.hasValue){var W=P.value;if(_(W,R))return O=W}return O=R}if(W=O,i($,R))return W;var Y=S(R);return _!==void 0&&_(W,Y)?($=R,W):($=R,O=Y)}var V=!1,$,O,z=b===void 0?null:b;return[function(){return M(k())},z===null?void 0:function(){return M(z())}]},[k,b,S,_]);var T=a(x,j[0],j[1]);return c(function(){P.hasValue=!0,P.value=T},[T]),g(T),T},_d}var om;function jS(){return om||(om=1,Nd.exports=_S()),Nd.exports}var CS=jS();const ES=Iu(CS),PS={},sm=e=>{let r;const o=new Set,i=(k,b)=>{const S=typeof k=="function"?k(r):k;if(!Object.is(S,r)){const _=r;r=b??(typeof S!="object"||S===null)?S:Object.assign({},r,S),o.forEach(j=>j(r,_))}},a=()=>r,g={setState:i,getState:a,getInitialState:()=>x,subscribe:k=>(o.add(k),()=>o.delete(k)),destroy:()=>{(PS?"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()}},x=r=e(i,a,g);return g},TS=e=>e?sm(e):sm,{useDebugValue:$S}=zm,{useSyncExternalStoreWithSelector:MS}=ES,AS=e=>e;function rg(e,r=AS,o){const i=MS(e.subscribe,e.getState,e.getServerState||e.getInitialState,r,o);return $S(i),i}const im=(e,r)=>{const o=TS(e),i=(a,d=r)=>rg(o,a,d);return Object.assign(i,o),i},IS=(e,r)=>e?im(e,r):im;function Jt(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 og=Bm();const Wu=I.createContext(null),OS=Wu.Provider,sg=wo.error001();function Ct(e,r){const o=I.useContext(Wu);if(o===null)throw new Error(sg);return rg(o,e,r)}function Wt(){const e=I.useContext(Wu);if(e===null)throw new Error(sg);return I.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const am={display:"none"},DS={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ig="react-flow__node-desc",ag="react-flow__edge-desc",RS="react-flow__aria-live",LS=e=>e.ariaLiveMessage,HS=e=>e.ariaLabelConfig;function FS({rfId:e}){const r=Ct(LS);return f.jsx("div",{id:`${RS}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:DS,children:r})}function zS({rfId:e,disableKeyboardA11y:r}){const o=Ct(HS);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${ig}-${e}`,style:am,children:r?o["node.a11yDescription.default"]:o["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${ag}-${e}`,style:am,children:o["edge.a11yDescription.default"]}),!r&&f.jsx(FS,{rfId:e})]})}const tl=I.forwardRef(({position:e="top-left",children:r,className:o,style:i,...a},d)=>{const c=`${e}`.split("-");return f.jsx("div",{className:fn(["react-flow__panel",o,...c]),style:i,ref:d,...a,children:r})});tl.displayName="Panel";function BS({proOptions:e,position:r="bottom-right"}){return e!=null&&e.hideAttribution?null:f.jsx(tl,{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:f.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const qS=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}},uu=e=>e.id;function US(e,r){return Jt(e.selectedNodes.map(uu),r.selectedNodes.map(uu))&&Jt(e.selectedEdges.map(uu),r.selectedEdges.map(uu))}function VS({onSelectionChange:e}){const r=Wt(),{selectedNodes:o,selectedEdges:i}=Ct(qS,US);return I.useEffect(()=>{const a={nodes:o,edges:i};e==null||e(a),r.getState().onSelectionChangeHandlers.forEach(d=>d(a))},[o,i,e]),null}const KS=e=>!!e.onSelectionChangeHandlers;function WS({onSelectionChange:e}){const r=Ct(KS);return e||r?f.jsx(VS,{onSelectionChange:e}):null}const Xd=typeof window<"u"?I.useLayoutEffect:I.useEffect,lg=[0,0],YS={x:0,y:0,zoom:1},JS=["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"],lm=[...JS,"rfId"],XS=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}),um={translateExtent:Ba,nodeOrigin:lg,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function QS(e){const{setNodes:r,setEdges:o,setMinZoom:i,setMaxZoom:a,setTranslateExtent:d,setNodeExtent:c,reset:h,setDefaultNodesAndEdges:g}=Ct(XS,Jt),x=Wt();Xd(()=>(g(e.defaultNodes,e.defaultEdges),()=>{k.current=um,h()}),[]);const k=I.useRef(um);return Xd(()=>{for(const b of lm){const S=e[b],_=k.current[b];S!==_&&(typeof e[b]>"u"||(b==="nodes"?r(S):b==="edges"?o(S):b==="minZoom"?i(S):b==="maxZoom"?a(S):b==="translateExtent"?d(S):b==="nodeExtent"?c(S):b==="ariaLabelConfig"?x.setState({ariaLabelConfig:Ob(S)}):b==="fitView"?x.setState({fitViewQueued:S}):b==="fitViewOptions"?x.setState({fitViewOptions:S}):x.setState({[b]:S})))}k.current=e},lm.map(b=>e[b])),null}function cm(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function GS(e){var i;const[r,o]=I.useState(e==="system"?null:e);return I.useEffect(()=>{if(e!=="system"){o(e);return}const a=cm(),d=()=>o(a!=null&&a.matches?"dark":"light");return d(),a==null||a.addEventListener("change",d),()=>{a==null||a.removeEventListener("change",d)}},[e]),r!==null?r:(i=cm())!=null&&i.matches?"dark":"light"}const dm=typeof document<"u"?document:null;function Ka(e=null,r={target:dm,actInsideInputWithModifier:!0}){const[o,i]=I.useState(!1),a=I.useRef(!1),d=I.useRef(new Set([])),[c,h]=I.useMemo(()=>{if(e!==null){const x=(Array.isArray(e)?e:[e]).filter(b=>typeof b=="string").map(b=>b.replace("+",`
197
+ `).replace(`
198
+
199
+ `,`
200
+ +`).split(`
201
+ `)),k=x.reduce((b,S)=>b.concat(...S),[]);return[x,k]}return[[],[]]},[e]);return I.useEffect(()=>{const g=(r==null?void 0:r.target)??dm,x=(r==null?void 0:r.actInsideInputWithModifier)??!0;if(e!==null){const k=_=>{var T,M;if(a.current=_.ctrlKey||_.metaKey||_.shiftKey||_.altKey,(!a.current||a.current&&!x)&&F0(_))return!1;const P=pm(_.code,h);if(d.current.add(_[P]),fm(c,d.current,!1)){const V=((M=(T=_.composedPath)==null?void 0:T.call(_))==null?void 0:M[0])||_.target,$=(V==null?void 0:V.nodeName)==="BUTTON"||(V==null?void 0:V.nodeName)==="A";r.preventDefault!==!1&&(a.current||!$)&&_.preventDefault(),i(!0)}},b=_=>{const j=pm(_.code,h);fm(c,d.current,!0)?(i(!1),d.current.clear()):d.current.delete(_[j]),_.key==="Meta"&&d.current.clear(),a.current=!1},S=()=>{d.current.clear(),i(!1)};return g==null||g.addEventListener("keydown",k),g==null||g.addEventListener("keyup",b),window.addEventListener("blur",S),window.addEventListener("contextmenu",S),()=>{g==null||g.removeEventListener("keydown",k),g==null||g.removeEventListener("keyup",b),window.removeEventListener("blur",S),window.removeEventListener("contextmenu",S)}}},[e,i]),o}function fm(e,r,o){return e.filter(i=>o||i.length===r.size).some(i=>i.every(a=>r.has(a)))}function pm(e,r){return r.includes(e)?"code":"key"}const ZS=()=>{const e=Wt();return I.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,d],panZoom:c}=e.getState();return c?(await c.setViewport({x:r.x??i,y:r.y??a,zoom:r.zoom??d},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:d,maxZoom:c,panZoom:h}=e.getState(),g=uf(r,i,a,d,c,(o==null?void 0:o.padding)??.1);return h?(await h.setViewport(g,{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:d,domNode:c}=e.getState();if(!c)return r;const{x:h,y:g}=c.getBoundingClientRect(),x={x:r.x-h,y:r.y-g},k=o.snapGrid??a,b=o.snapToGrid??d;return el(x,i,b,k)},flowToScreenPosition:r=>{const{transform:o,domNode:i}=e.getState();if(!i)return r;const{x:a,y:d}=i.getBoundingClientRect(),c=Mu(r,o);return{x:c.x+a,y:c.y+d}}}),[])};function ug(e,r){const o=[],i=new Map,a=[];for(const d of e)if(d.type==="add"){a.push(d);continue}else if(d.type==="remove"||d.type==="replace")i.set(d.id,[d]);else{const c=i.get(d.id);c?c.push(d):i.set(d.id,[d])}for(const d of r){const c=i.get(d.id);if(!c){o.push(d);continue}if(c[0].type==="remove")continue;if(c[0].type==="replace"){o.push({...c[0].item});continue}const h={...d};for(const g of c)ek(g,h);o.push(h)}return a.length&&a.forEach(d=>{d.index!==void 0?o.splice(d.index,0,{...d.item}):o.push({...d.item})}),o}function ek(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 cg(e,r){return ug(e,r)}function dg(e,r){return ug(e,r)}function Vs(e,r){return{id:e,type:"select",selected:r}}function Ri(e,r=new Set,o=!1){const i=[];for(const[a,d]of e){const c=r.has(a);!(d.selected===void 0&&!c)&&d.selected!==c&&(o&&(d.selected=c),i.push(Vs(d.id,c)))}return i}function hm({items:e=[],lookup:r}){var a;const o=[],i=new Map(e.map(d=>[d.id,d]));for(const[d,c]of e.entries()){const h=r.get(c.id),g=((a=h==null?void 0:h.internals)==null?void 0:a.userNode)??h;g!==void 0&&g!==c&&o.push({id:c.id,item:c,type:"replace"}),g===void 0&&o.push({item:c,type:"add",index:d})}for(const[d]of r)i.get(d)===void 0&&o.push({id:d,type:"remove"});return o}function mm(e){return{id:e.id,type:"remove"}}const gm=e=>_b(e),tk=e=>M0(e);function fg(e){return I.forwardRef(e)}function ym(e){const[r,o]=I.useState(BigInt(0)),[i]=I.useState(()=>nk(()=>o(a=>a+BigInt(1))));return Xd(()=>{const a=i.get();a.length&&(e(a),i.reset())},[r]),i}function nk(e){let r=[];return{get:()=>r,reset:()=>{r=[]},push:o=>{r.push(o),e()}}}const pg=I.createContext(null);function rk({children:e}){const r=Wt(),o=I.useCallback(h=>{const{nodes:g=[],setNodes:x,hasDefaultNodes:k,onNodesChange:b,nodeLookup:S,fitViewQueued:_,onNodesChangeMiddlewareMap:j}=r.getState();let P=g;for(const M of h)P=typeof M=="function"?M(P):M;let T=hm({items:P,lookup:S});for(const M of j.values())T=M(T);k&&x(P),T.length>0?b==null||b(T):_&&window.requestAnimationFrame(()=>{const{fitViewQueued:M,nodes:V,setNodes:$}=r.getState();M&&$(V)})},[]),i=ym(o),a=I.useCallback(h=>{const{edges:g=[],setEdges:x,hasDefaultEdges:k,onEdgesChange:b,edgeLookup:S}=r.getState();let _=g;for(const j of h)_=typeof j=="function"?j(_):j;k?x(_):b&&b(hm({items:_,lookup:S}))},[]),d=ym(a),c=I.useMemo(()=>({nodeQueue:i,edgeQueue:d}),[]);return f.jsx(pg.Provider,{value:c,children:e})}function ok(){const e=I.useContext(pg);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const sk=e=>!!e.panZoom;function yf(){const e=ZS(),r=Wt(),o=ok(),i=Ct(sk),a=I.useMemo(()=>{const d=b=>r.getState().nodeLookup.get(b),c=b=>{o.nodeQueue.push(b)},h=b=>{o.edgeQueue.push(b)},g=b=>{var M,V;const{nodeLookup:S,nodeOrigin:_}=r.getState(),j=gm(b)?b:S.get(b.id),P=j.parentId?L0(j.position,j.measured,j.parentId,S,_):j.position,T={...j,position:P,width:((M=j.measured)==null?void 0:M.width)??j.width,height:((V=j.measured)==null?void 0:V.height)??j.height};return Ki(T)},x=(b,S,_={replace:!1})=>{c(j=>j.map(P=>{if(P.id===b){const T=typeof S=="function"?S(P):S;return _.replace&&gm(T)?T:{...P,...T}}return P}))},k=(b,S,_={replace:!1})=>{h(j=>j.map(P=>{if(P.id===b){const T=typeof S=="function"?S(P):S;return _.replace&&tk(T)?T:{...P,...T}}return P}))};return{getNodes:()=>r.getState().nodes.map(b=>({...b})),getNode:b=>{var S;return(S=d(b))==null?void 0:S.internals.userNode},getInternalNode:d,getEdges:()=>{const{edges:b=[]}=r.getState();return b.map(S=>({...S}))},getEdge:b=>r.getState().edgeLookup.get(b),setNodes:c,setEdges:h,addNodes:b=>{const S=Array.isArray(b)?b:[b];o.nodeQueue.push(_=>[..._,...S])},addEdges:b=>{const S=Array.isArray(b)?b:[b];o.edgeQueue.push(_=>[..._,...S])},toObject:()=>{const{nodes:b=[],edges:S=[],transform:_}=r.getState(),[j,P,T]=_;return{nodes:b.map(M=>({...M})),edges:S.map(M=>({...M})),viewport:{x:j,y:P,zoom:T}}},deleteElements:async({nodes:b=[],edges:S=[]})=>{const{nodes:_,edges:j,onNodesDelete:P,onEdgesDelete:T,triggerNodeChanges:M,triggerEdgeChanges:V,onDelete:$,onBeforeDelete:O}=r.getState(),{nodes:z,edges:R}=await Tb({nodesToRemove:b,edgesToRemove:S,nodes:_,edges:j,onBeforeDelete:O}),W=R.length>0,Y=z.length>0;if(W){const le=R.map(mm);T==null||T(R),V(le)}if(Y){const le=z.map(mm);P==null||P(z),M(le)}return(Y||W)&&($==null||$({nodes:z,edges:R})),{deletedNodes:z,deletedEdges:R}},getIntersectingNodes:(b,S=!0,_)=>{const j=Bh(b),P=j?b:g(b),T=_!==void 0;return P?(_||r.getState().nodes).filter(M=>{const V=r.getState().nodeLookup.get(M.id);if(V&&!j&&(M.id===b.id||!V.internals.positionAbsolute))return!1;const $=Ki(T?M:V),O=Ua($,P);return S&&O>0||O>=$.width*$.height||O>=P.width*P.height}):[]},isNodeIntersecting:(b,S,_=!0)=>{const P=Bh(b)?b:g(b);if(!P)return!1;const T=Ua(P,S);return _&&T>0||T>=S.width*S.height||T>=P.width*P.height},updateNode:x,updateNodeData:(b,S,_={replace:!1})=>{x(b,j=>{const P=typeof S=="function"?S(j):S;return _.replace?{...j,data:P}:{...j,data:{...j.data,...P}}},_)},updateEdge:k,updateEdgeData:(b,S,_={replace:!1})=>{k(b,j=>{const P=typeof S=="function"?S(j):S;return _.replace?{...j,data:P}:{...j,data:{...j.data,...P}}},_)},getNodesBounds:b=>{const{nodeLookup:S,nodeOrigin:_}=r.getState();return jb(b,{nodeLookup:S,nodeOrigin:_})},getHandleConnections:({type:b,id:S,nodeId:_})=>{var j;return Array.from(((j=r.getState().connectionLookup.get(`${_}-${b}${S?`-${S}`:""}`))==null?void 0:j.values())??[])},getNodeConnections:({type:b,handleId:S,nodeId:_})=>{var j;return Array.from(((j=r.getState().connectionLookup.get(`${_}${b?S?`-${b}-${S}`:`-${b}`:""}`))==null?void 0:j.values())??[])},fitView:async b=>{const S=r.getState().fitViewResolver??Ib();return r.setState({fitViewQueued:!0,fitViewOptions:b,fitViewResolver:S}),o.nodeQueue.push(_=>[..._]),S.promise}}},[]);return I.useMemo(()=>({...a,...e,viewportInitialized:i}),[i])}const xm=e=>e.selected,ik=typeof window<"u"?window:void 0;function ak({deleteKeyCode:e,multiSelectionKeyCode:r}){const o=Wt(),{deleteElements:i}=yf(),a=Ka(e,{actInsideInputWithModifier:!1}),d=Ka(r,{target:ik});I.useEffect(()=>{if(a){const{edges:c,nodes:h}=o.getState();i({nodes:h.filter(xm),edges:c.filter(xm)}),o.setState({nodesSelectionActive:!1})}},[a]),I.useEffect(()=>{o.setState({multiSelectionActive:d})},[d])}function lk(e){const r=Wt();I.useEffect(()=>{const o=()=>{var a,d,c,h;if(!e.current||!(((d=(a=e.current).checkVisibility)==null?void 0:d.call(a))??!0))return!1;const i=cf(e.current);(i.height===0||i.width===0)&&((h=(c=r.getState()).onError)==null||h.call(c,"004",wo.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 Yu={position:"absolute",width:"100%",height:"100%",top:0,left:0},uk=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function ck({onPaneContextMenu:e,zoomOnScroll:r=!0,zoomOnPinch:o=!0,panOnScroll:i=!1,panOnScrollSpeed:a=.5,panOnScrollMode:d=Ys.Free,zoomOnDoubleClick:c=!0,panOnDrag:h=!0,defaultViewport:g,translateExtent:x,minZoom:k,maxZoom:b,zoomActivationKeyCode:S,preventScrolling:_=!0,children:j,noWheelClassName:P,noPanClassName:T,onViewportChange:M,isControlledViewport:V,paneClickDistance:$,selectionOnDrag:O}){const z=Wt(),R=I.useRef(null),{userSelectionActive:W,lib:Y,connectionInProgress:le}=Ct(uk,Jt),we=Ka(S),ie=I.useRef();lk(R);const de=I.useCallback(te=>{M==null||M({x:te[0],y:te[1],zoom:te[2]}),V||z.setState({transform:te})},[M,V]);return I.useEffect(()=>{if(R.current){ie.current=gS({domNode:R.current,minZoom:k,maxZoom:b,translateExtent:x,viewport:g,onDraggingChange:J=>z.setState(ue=>ue.paneDragging===J?ue:{paneDragging:J}),onPanZoomStart:(J,ue)=>{const{onViewportChangeStart:q,onMoveStart:K}=z.getState();K==null||K(J,ue),q==null||q(ue)},onPanZoom:(J,ue)=>{const{onViewportChange:q,onMove:K}=z.getState();K==null||K(J,ue),q==null||q(ue)},onPanZoomEnd:(J,ue)=>{const{onViewportChangeEnd:q,onMoveEnd:K}=z.getState();K==null||K(J,ue),q==null||q(ue)}});const{x:te,y:F,zoom:ce}=ie.current.getViewport();return z.setState({panZoom:ie.current,transform:[te,F,ce],domNode:R.current.closest(".react-flow")}),()=>{var J;(J=ie.current)==null||J.destroy()}}},[]),I.useEffect(()=>{var te;(te=ie.current)==null||te.update({onPaneContextMenu:e,zoomOnScroll:r,zoomOnPinch:o,panOnScroll:i,panOnScrollSpeed:a,panOnScrollMode:d,zoomOnDoubleClick:c,panOnDrag:h,zoomActivationKeyPressed:we,preventScrolling:_,noPanClassName:T,userSelectionActive:W,noWheelClassName:P,lib:Y,onTransformChange:de,connectionInProgress:le,selectionOnDrag:O,paneClickDistance:$})},[e,r,o,i,a,d,c,h,we,_,T,W,P,Y,de,le,O,$]),f.jsx("div",{className:"react-flow__renderer",ref:R,style:Yu,children:j})}const dk=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function fk(){const{userSelectionActive:e,userSelectionRect:r}=Ct(dk,Jt);return e&&r?f.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 Ed=(e,r)=>o=>{o.target===r.current&&(e==null||e(o))},pk=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function hk({isSelecting:e,selectionKeyPressed:r,selectionMode:o=qa.Full,panOnDrag:i,paneClickDistance:a,selectionOnDrag:d,onSelectionStart:c,onSelectionEnd:h,onPaneClick:g,onPaneContextMenu:x,onPaneScroll:k,onPaneMouseEnter:b,onPaneMouseMove:S,onPaneMouseLeave:_,children:j}){const P=Wt(),{userSelectionActive:T,elementsSelectable:M,dragging:V,connectionInProgress:$}=Ct(pk,Jt),O=M&&(e||T),z=I.useRef(null),R=I.useRef(),W=I.useRef(new Set),Y=I.useRef(new Set),le=I.useRef(!1),we=q=>{if(le.current||$){le.current=!1;return}g==null||g(q),P.getState().resetSelectedElements(),P.setState({nodesSelectionActive:!1})},ie=q=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){q.preventDefault();return}x==null||x(q)},de=k?q=>k(q):void 0,te=q=>{le.current&&(q.stopPropagation(),le.current=!1)},F=q=>{var Re,Oe;const{domNode:K}=P.getState();if(R.current=K==null?void 0:K.getBoundingClientRect(),!R.current)return;const Q=q.target===z.current;if(!Q&&!!q.target.closest(".nokey")||!e||!(d&&Q||r)||q.button!==0||!q.isPrimary)return;(Oe=(Re=q.target)==null?void 0:Re.setPointerCapture)==null||Oe.call(Re,q.pointerId),le.current=!1;const{x:je,y:Ne}=so(q.nativeEvent,R.current);P.setState({userSelectionRect:{width:0,height:0,startX:je,startY:Ne,x:je,y:Ne}}),Q||(q.stopPropagation(),q.preventDefault())},ce=q=>{const{userSelectionRect:K,transform:Q,nodeLookup:L,edgeLookup:U,connectionLookup:je,triggerNodeChanges:Ne,triggerEdgeChanges:Re,defaultEdgeOptions:Oe,resetSelectedElements:Le}=P.getState();if(!R.current||!K)return;const{x:ke,y:$e}=so(q.nativeEvent,R.current),{startX:_e,startY:tt}=K;if(!le.current){const ft=r?0:a;if(Math.hypot(ke-_e,$e-tt)<=ft)return;Le(),c==null||c(q)}le.current=!0;const ze={startX:_e,startY:tt,x:ke<_e?ke:_e,y:$e<tt?$e:tt,width:Math.abs(ke-_e),height:Math.abs($e-tt)},Je=W.current,at=Y.current;W.current=new Set(lf(L,ze,Q,o===qa.Partial,!0).map(ft=>ft.id)),Y.current=new Set;const mt=(Oe==null?void 0:Oe.selectable)??!0;for(const ft of W.current){const Mt=je.get(ft);if(Mt)for(const{edgeId:Xt}of Mt.values()){const nn=U.get(Xt);nn&&(nn.selectable??mt)&&Y.current.add(Xt)}}if(!qh(Je,W.current)){const ft=Ri(L,W.current,!0);Ne(ft)}if(!qh(at,Y.current)){const ft=Ri(U,Y.current);Re(ft)}P.setState({userSelectionRect:ze,userSelectionActive:!0,nodesSelectionActive:!1})},J=q=>{var K,Q;q.button===0&&((Q=(K=q.target)==null?void 0:K.releasePointerCapture)==null||Q.call(K,q.pointerId),!T&&q.target===z.current&&P.getState().userSelectionRect&&(we==null||we(q)),P.setState({userSelectionActive:!1,userSelectionRect:null}),le.current&&(h==null||h(q),P.setState({nodesSelectionActive:W.current.size>0})))},ue=i===!0||Array.isArray(i)&&i.includes(0);return f.jsxs("div",{className:fn(["react-flow__pane",{draggable:ue,dragging:V,selection:e}]),onClick:O?void 0:Ed(we,z),onContextMenu:Ed(ie,z),onWheel:Ed(de,z),onPointerEnter:O?void 0:b,onPointerMove:O?ce:S,onPointerUp:O?J:void 0,onPointerDownCapture:O?F:void 0,onClickCapture:O?te:void 0,onPointerLeave:_,ref:z,style:Yu,children:[j,f.jsx(fk,{})]})}function Qd({id:e,store:r,unselect:o=!1,nodeRef:i}){const{addSelectedNodes:a,unselectNodesAndEdges:d,multiSelectionActive:c,nodeLookup:h,onError:g}=r.getState(),x=h.get(e);if(!x){g==null||g("012",wo.error012(e));return}r.setState({nodesSelectionActive:!1}),x.selected?(o||x.selected&&c)&&(d({nodes:[x],edges:[]}),requestAnimationFrame(()=>{var k;return(k=i==null?void 0:i.current)==null?void 0:k.blur()})):a([e])}function hg({nodeRef:e,disabled:r=!1,noDragClassName:o,handleSelector:i,nodeId:a,isSelectable:d,nodeClickDistance:c}){const h=Wt(),[g,x]=I.useState(!1),k=I.useRef();return I.useEffect(()=>{k.current=nS({getStoreItems:()=>h.getState(),onNodeMouseDown:b=>{Qd({id:b,store:h,nodeRef:e})},onDragStart:()=>{x(!0)},onDragStop:()=>{x(!1)}})},[]),I.useEffect(()=>{if(!(r||!e.current||!k.current))return k.current.update({noDragClassName:o,handleSelector:i,domNode:e.current,isSelectable:d,nodeId:a,nodeClickDistance:c}),()=>{var b;(b=k.current)==null||b.destroy()}},[o,i,r,d,e,a,c]),g}const mk=e=>r=>r.selected&&(r.draggable||e&&typeof r.draggable>"u");function mg(){const e=Wt();return I.useCallback(o=>{const{nodeExtent:i,snapToGrid:a,snapGrid:d,nodesDraggable:c,onError:h,updateNodePositions:g,nodeLookup:x,nodeOrigin:k}=e.getState(),b=new Map,S=mk(c),_=a?d[0]:5,j=a?d[1]:5,P=o.direction.x*_*o.factor,T=o.direction.y*j*o.factor;for(const[,M]of x){if(!S(M))continue;let V={x:M.internals.positionAbsolute.x+P,y:M.internals.positionAbsolute.y+T};a&&(V=Za(V,d));const{position:$,positionAbsolute:O}=A0({nodeId:M.id,nextPosition:V,nodeLookup:x,nodeExtent:i,nodeOrigin:k,onError:h});M.position=$,M.internals.positionAbsolute=O,b.set(M.id,M)}g(b)},[])}const xf=I.createContext(null),gk=xf.Provider;xf.Consumer;const gg=()=>I.useContext(xf),yk=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),xk=(e,r,o)=>i=>{const{connectionClickStartHandle:a,connectionMode:d,connection:c}=i,{fromHandle:h,toHandle:g,isValid:x}=c,k=(g==null?void 0:g.nodeId)===e&&(g==null?void 0:g.id)===r&&(g==null?void 0:g.type)===o;return{connectingFrom:(h==null?void 0:h.nodeId)===e&&(h==null?void 0:h.id)===r&&(h==null?void 0:h.type)===o,connectingTo:k,clickConnecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===r&&(a==null?void 0:a.type)===o,isPossibleEndHandle:d===Ui.Strict?(h==null?void 0:h.type)!==o:e!==(h==null?void 0:h.nodeId)||r!==(h==null?void 0:h.id),connectionInProcess:!!h,clickConnectionInProcess:!!a,valid:k&&x}};function vk({type:e="source",position:r=rt.Top,isValidConnection:o,isConnectable:i=!0,isConnectableStart:a=!0,isConnectableEnd:d=!0,id:c,onConnect:h,children:g,className:x,onMouseDown:k,onTouchStart:b,...S},_){var ce,J;const j=c||null,P=e==="target",T=Wt(),M=gg(),{connectOnClick:V,noPanClassName:$,rfId:O}=Ct(yk,Jt),{connectingFrom:z,connectingTo:R,clickConnecting:W,isPossibleEndHandle:Y,connectionInProcess:le,clickConnectionInProcess:we,valid:ie}=Ct(xk(M,j,e),Jt);M||(J=(ce=T.getState()).onError)==null||J.call(ce,"010",wo.error010());const de=ue=>{const{defaultEdgeOptions:q,onConnect:K,hasDefaultEdges:Q}=T.getState(),L={...q,...ue};if(Q){const{edges:U,setEdges:je}=T.getState();je(U0(L,U))}K==null||K(L),h==null||h(L)},te=ue=>{if(!M)return;const q=z0(ue.nativeEvent);if(a&&(q&&ue.button===0||!q)){const K=T.getState();Jd.onPointerDown(ue.nativeEvent,{handleDomNode:ue.currentTarget,autoPanOnConnect:K.autoPanOnConnect,connectionMode:K.connectionMode,connectionRadius:K.connectionRadius,domNode:K.domNode,nodeLookup:K.nodeLookup,lib:K.lib,isTarget:P,handleId:j,nodeId:M,flowId:K.rfId,panBy:K.panBy,cancelConnection:K.cancelConnection,onConnectStart:K.onConnectStart,onConnectEnd:(...Q)=>{var L,U;return(U=(L=T.getState()).onConnectEnd)==null?void 0:U.call(L,...Q)},updateConnection:K.updateConnection,onConnect:de,isValidConnection:o||((...Q)=>{var L,U;return((U=(L=T.getState()).isValidConnection)==null?void 0:U.call(L,...Q))??!0}),getTransform:()=>T.getState().transform,getFromHandle:()=>T.getState().connection.fromHandle,autoPanSpeed:K.autoPanSpeed,dragThreshold:K.connectionDragThreshold})}q?k==null||k(ue):b==null||b(ue)},F=ue=>{const{onClickConnectStart:q,onClickConnectEnd:K,connectionClickStartHandle:Q,connectionMode:L,isValidConnection:U,lib:je,rfId:Ne,nodeLookup:Re,connection:Oe}=T.getState();if(!M||!Q&&!a)return;if(!Q){q==null||q(ue.nativeEvent,{nodeId:M,handleId:j,handleType:e}),T.setState({connectionClickStartHandle:{nodeId:M,type:e,id:j}});return}const Le=H0(ue.target),ke=o||U,{connection:$e,isValid:_e}=Jd.isValid(ue.nativeEvent,{handle:{nodeId:M,id:j,type:e},connectionMode:L,fromNodeId:Q.nodeId,fromHandleId:Q.id||null,fromType:Q.type,isValidConnection:ke,flowId:Ne,doc:Le,lib:je,nodeLookup:Re});_e&&$e&&de($e);const tt=structuredClone(Oe);delete tt.inProgress,tt.toPosition=tt.toHandle?tt.toHandle.position:null,K==null||K(ue,tt),T.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":j,"data-nodeid":M,"data-handlepos":r,"data-id":`${O}-${M}-${j}-${e}`,className:fn(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",$,x,{source:!P,target:P,connectable:i,connectablestart:a,connectableend:d,clickconnecting:W,connectingfrom:z,connectingto:R,valid:ie,connectionindicator:i&&(!le||Y)&&(le||we?d:a)}]),onMouseDown:te,onTouchStart:te,onClick:V?F:void 0,ref:_,...S,children:g})}const Ji=I.memo(fg(vk));function wk({data:e,isConnectable:r,sourcePosition:o=rt.Bottom}){return f.jsxs(f.Fragment,{children:[e==null?void 0:e.label,f.jsx(Ji,{type:"source",position:o,isConnectable:r})]})}function bk({data:e,isConnectable:r,targetPosition:o=rt.Top,sourcePosition:i=rt.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(Ji,{type:"target",position:o,isConnectable:r}),e==null?void 0:e.label,f.jsx(Ji,{type:"source",position:i,isConnectable:r})]})}function Sk(){return null}function kk({data:e,isConnectable:r,targetPosition:o=rt.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(Ji,{type:"target",position:o,isConnectable:r}),e==null?void 0:e.label]})}const Au={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},vm={input:wk,default:bk,output:kk,group:Sk};function Nk(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 _k=e=>{const{width:r,height:o,x:i,y:a}=Ga(e.nodeLookup,{filter:d=>!!d.selected});return{width:oo(r)?r:null,height:oo(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 jk({onSelectionContextMenu:e,noPanClassName:r,disableKeyboardA11y:o}){const i=Wt(),{width:a,height:d,transformString:c,userSelectionActive:h}=Ct(_k,Jt),g=mg(),x=I.useRef(null);I.useEffect(()=>{var _;o||(_=x.current)==null||_.focus({preventScroll:!0})},[o]);const k=!h&&a!==null&&d!==null;if(hg({nodeRef:x,disabled:!k}),!k)return null;const b=e?_=>{const j=i.getState().nodes.filter(P=>P.selected);e(_,j)}:void 0,S=_=>{Object.prototype.hasOwnProperty.call(Au,_.key)&&(_.preventDefault(),g({direction:Au[_.key],factor:_.shiftKey?4:1}))};return f.jsx("div",{className:fn(["react-flow__nodesselection","react-flow__container",r]),style:{transform:c},children:f.jsx("div",{ref:x,className:"react-flow__nodesselection-rect",onContextMenu:b,tabIndex:o?void 0:-1,onKeyDown:o?void 0:S,style:{width:a,height:d}})})}const wm=typeof window<"u"?window:void 0,Ck=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function yg({children:e,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:i,onPaneMouseLeave:a,onPaneContextMenu:d,onPaneScroll:c,paneClickDistance:h,deleteKeyCode:g,selectionKeyCode:x,selectionOnDrag:k,selectionMode:b,onSelectionStart:S,onSelectionEnd:_,multiSelectionKeyCode:j,panActivationKeyCode:P,zoomActivationKeyCode:T,elementsSelectable:M,zoomOnScroll:V,zoomOnPinch:$,panOnScroll:O,panOnScrollSpeed:z,panOnScrollMode:R,zoomOnDoubleClick:W,panOnDrag:Y,defaultViewport:le,translateExtent:we,minZoom:ie,maxZoom:de,preventScrolling:te,onSelectionContextMenu:F,noWheelClassName:ce,noPanClassName:J,disableKeyboardA11y:ue,onViewportChange:q,isControlledViewport:K}){const{nodesSelectionActive:Q,userSelectionActive:L}=Ct(Ck,Jt),U=Ka(x,{target:wm}),je=Ka(P,{target:wm}),Ne=je||Y,Re=je||O,Oe=k&&Ne!==!0,Le=U||L||Oe;return ak({deleteKeyCode:g,multiSelectionKeyCode:j}),f.jsx(ck,{onPaneContextMenu:d,elementsSelectable:M,zoomOnScroll:V,zoomOnPinch:$,panOnScroll:Re,panOnScrollSpeed:z,panOnScrollMode:R,zoomOnDoubleClick:W,panOnDrag:!U&&Ne,defaultViewport:le,translateExtent:we,minZoom:ie,maxZoom:de,zoomActivationKeyCode:T,preventScrolling:te,noWheelClassName:ce,noPanClassName:J,onViewportChange:q,isControlledViewport:K,paneClickDistance:h,selectionOnDrag:Oe,children:f.jsxs(hk,{onSelectionStart:S,onSelectionEnd:_,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:i,onPaneMouseLeave:a,onPaneContextMenu:d,onPaneScroll:c,panOnDrag:Ne,isSelecting:!!Le,selectionMode:b,selectionKeyPressed:U,paneClickDistance:h,selectionOnDrag:Oe,children:[e,Q&&f.jsx(jk,{onSelectionContextMenu:F,noPanClassName:J,disableKeyboardA11y:ue})]})})}yg.displayName="FlowRenderer";const Ek=I.memo(yg),Pk=e=>r=>e?lf(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 Tk(e){return Ct(I.useCallback(Pk(e),[e]),Jt)}const $k=e=>e.updateNodeInternals;function Mk(){const e=Ct($k),[r]=I.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(o=>{const i=new Map;o.forEach(a=>{const d=a.target.getAttribute("data-id");i.set(d,{id:d,nodeElement:a.target,force:!0})}),e(i)}));return I.useEffect(()=>()=>{r==null||r.disconnect()},[r]),r}function Ak({node:e,nodeType:r,hasDimensions:o,resizeObserver:i}){const a=Wt(),d=I.useRef(null),c=I.useRef(null),h=I.useRef(e.sourcePosition),g=I.useRef(e.targetPosition),x=I.useRef(r),k=o&&!!e.internals.handleBounds;return I.useEffect(()=>{d.current&&!e.hidden&&(!k||c.current!==d.current)&&(c.current&&(i==null||i.unobserve(c.current)),i==null||i.observe(d.current),c.current=d.current)},[k,e.hidden]),I.useEffect(()=>()=>{c.current&&(i==null||i.unobserve(c.current),c.current=null)},[]),I.useEffect(()=>{if(d.current){const b=x.current!==r,S=h.current!==e.sourcePosition,_=g.current!==e.targetPosition;(b||S||_)&&(x.current=r,h.current=e.sourcePosition,g.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:d.current,force:!0}]])))}},[e.id,r,e.sourcePosition,e.targetPosition]),d}function Ik({id:e,onClick:r,onMouseEnter:o,onMouseMove:i,onMouseLeave:a,onContextMenu:d,onDoubleClick:c,nodesDraggable:h,elementsSelectable:g,nodesConnectable:x,nodesFocusable:k,resizeObserver:b,noDragClassName:S,noPanClassName:_,disableKeyboardA11y:j,rfId:P,nodeTypes:T,nodeClickDistance:M,onError:V}){const{node:$,internals:O,isParent:z}=Ct(ke=>{const $e=ke.nodeLookup.get(e),_e=ke.parentLookup.has(e);return{node:$e,internals:$e.internals,isParent:_e}},Jt);let R=$.type||"default",W=(T==null?void 0:T[R])||vm[R];W===void 0&&(V==null||V("003",wo.error003(R)),R="default",W=(T==null?void 0:T.default)||vm.default);const Y=!!($.draggable||h&&typeof $.draggable>"u"),le=!!($.selectable||g&&typeof $.selectable>"u"),we=!!($.connectable||x&&typeof $.connectable>"u"),ie=!!($.focusable||k&&typeof $.focusable>"u"),de=Wt(),te=R0($),F=Ak({node:$,nodeType:R,hasDimensions:te,resizeObserver:b}),ce=hg({nodeRef:F,disabled:$.hidden||!Y,noDragClassName:S,handleSelector:$.dragHandle,nodeId:e,isSelectable:le,nodeClickDistance:M}),J=mg();if($.hidden)return null;const ue=Ko($),q=Nk($),K=le||Y||r||o||i||a,Q=o?ke=>o(ke,{...O.userNode}):void 0,L=i?ke=>i(ke,{...O.userNode}):void 0,U=a?ke=>a(ke,{...O.userNode}):void 0,je=d?ke=>d(ke,{...O.userNode}):void 0,Ne=c?ke=>c(ke,{...O.userNode}):void 0,Re=ke=>{const{selectNodesOnDrag:$e,nodeDragThreshold:_e}=de.getState();le&&(!$e||!Y||_e>0)&&Qd({id:e,store:de,nodeRef:F}),r&&r(ke,{...O.userNode})},Oe=ke=>{if(!(F0(ke.nativeEvent)||j)){if(E0.includes(ke.key)&&le){const $e=ke.key==="Escape";Qd({id:e,store:de,unselect:$e,nodeRef:F})}else if(Y&&$.selected&&Object.prototype.hasOwnProperty.call(Au,ke.key)){ke.preventDefault();const{ariaLabelConfig:$e}=de.getState();de.setState({ariaLiveMessage:$e["node.a11yDescription.ariaLiveMessage"]({direction:ke.key.replace("Arrow","").toLowerCase(),x:~~O.positionAbsolute.x,y:~~O.positionAbsolute.y})}),J({direction:Au[ke.key],factor:ke.shiftKey?4:1})}}},Le=()=>{var at;if(j||!((at=F.current)!=null&&at.matches(":focus-visible")))return;const{transform:ke,width:$e,height:_e,autoPanOnNodeFocus:tt,setCenter:ze}=de.getState();if(!tt)return;lf(new Map([[e,$]]),{x:0,y:0,width:$e,height:_e},ke,!0).length>0||ze($.position.x+ue.width/2,$.position.y+ue.height/2,{zoom:ke[2]})};return f.jsx("div",{className:fn(["react-flow__node",`react-flow__node-${R}`,{[_]:Y},$.className,{selected:$.selected,selectable:le,parent:z,draggable:Y,dragging:ce}]),ref:F,style:{zIndex:O.z,transform:`translate(${O.positionAbsolute.x}px,${O.positionAbsolute.y}px)`,pointerEvents:K?"all":"none",visibility:te?"visible":"hidden",...$.style,...q},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:Q,onMouseMove:L,onMouseLeave:U,onContextMenu:je,onClick:Re,onDoubleClick:Ne,onKeyDown:ie?Oe:void 0,tabIndex:ie?0:void 0,onFocus:ie?Le:void 0,role:$.ariaRole??(ie?"group":void 0),"aria-roledescription":"node","aria-describedby":j?void 0:`${ig}-${P}`,"aria-label":$.ariaLabel,...$.domAttributes,children:f.jsx(gk,{value:e,children:f.jsx(W,{id:e,data:$.data,type:R,positionAbsoluteX:O.positionAbsolute.x,positionAbsoluteY:O.positionAbsolute.y,selected:$.selected??!1,selectable:le,draggable:Y,deletable:$.deletable??!0,isConnectable:we,sourcePosition:$.sourcePosition,targetPosition:$.targetPosition,dragging:ce,dragHandle:$.dragHandle,zIndex:O.z,parentId:$.parentId,...ue})})})}var Ok=I.memo(Ik);const Dk=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function xg(e){const{nodesDraggable:r,nodesConnectable:o,nodesFocusable:i,elementsSelectable:a,onError:d}=Ct(Dk,Jt),c=Tk(e.onlyRenderVisibleElements),h=Mk();return f.jsx("div",{className:"react-flow__nodes",style:Yu,children:c.map(g=>f.jsx(Ok,{id:g,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:h,nodesDraggable:r,nodesConnectable:o,nodesFocusable:i,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:d},g))})}xg.displayName="NodeRenderer";const Rk=I.memo(xg);function Lk(e){return Ct(I.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 d=o.nodeLookup.get(a.source),c=o.nodeLookup.get(a.target);d&&c&&Lb({sourceNode:d,targetNode:c,width:o.width,height:o.height,transform:o.transform})&&i.push(a.id)}return i},[e]),Jt)}const Hk=({color:e="none",strokeWidth:r=1})=>{const o={strokeWidth:r,...e&&{stroke:e}};return f.jsx("polyline",{className:"arrow",style:o,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Fk=({color:e="none",strokeWidth:r=1})=>{const o={strokeWidth:r,...e&&{stroke:e,fill:e}};return f.jsx("polyline",{className:"arrowclosed",style:o,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},bm={[Tu.Arrow]:Hk,[Tu.ArrowClosed]:Fk};function zk(e){const r=Wt();return I.useMemo(()=>{var a,d;return Object.prototype.hasOwnProperty.call(bm,e)?bm[e]:((d=(a=r.getState()).onError)==null||d.call(a,"009",wo.error009(e)),null)},[e])}const Bk=({id:e,type:r,color:o,width:i=12.5,height:a=12.5,markerUnits:d="strokeWidth",strokeWidth:c,orient:h="auto-start-reverse"})=>{const g=zk(r);return g?f.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:d,orient:h,refX:"0",refY:"0",children:f.jsx(g,{color:o,strokeWidth:c})}):null},vg=({defaultColor:e,rfId:r})=>{const o=Ct(d=>d.edges),i=Ct(d=>d.defaultEdgeOptions),a=I.useMemo(()=>Vb(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?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:a.map(d=>f.jsx(Bk,{id:d.id,type:d.type,color:d.color,width:d.width,height:d.height,markerUnits:d.markerUnits,strokeWidth:d.strokeWidth,orient:d.orient},d.id))})}):null};vg.displayName="MarkerDefinitions";var qk=I.memo(vg);function wg({x:e,y:r,label:o,labelStyle:i,labelShowBg:a=!0,labelBgStyle:d,labelBgPadding:c=[2,4],labelBgBorderRadius:h=2,children:g,className:x,...k}){const[b,S]=I.useState({x:1,y:0,width:0,height:0}),_=fn(["react-flow__edge-textwrapper",x]),j=I.useRef(null);return I.useEffect(()=>{if(j.current){const P=j.current.getBBox();S({x:P.x,y:P.y,width:P.width,height:P.height})}},[o]),o?f.jsxs("g",{transform:`translate(${e-b.width/2} ${r-b.height/2})`,className:_,visibility:b.width?"visible":"hidden",...k,children:[a&&f.jsx("rect",{width:b.width+2*c[0],x:-c[0],y:-c[1],height:b.height+2*c[1],className:"react-flow__edge-textbg",style:d,rx:h,ry:h}),f.jsx("text",{className:"react-flow__edge-text",y:b.height/2,dy:"0.3em",ref:j,style:i,children:o}),g]}):null}wg.displayName="EdgeText";const Uk=I.memo(wg);function Xi({path:e,labelX:r,labelY:o,label:i,labelStyle:a,labelShowBg:d,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:g,interactionWidth:x=20,...k}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{...k,d:e,fill:"none",className:fn(["react-flow__edge-path",k.className])}),x?f.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:x,className:"react-flow__edge-interaction"}):null,i&&oo(r)&&oo(o)?f.jsx(Uk,{x:r,y:o,label:i,labelStyle:a,labelShowBg:d,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:g}):null]})}function Sm({pos:e,x1:r,y1:o,x2:i,y2:a}){return e===rt.Left||e===rt.Right?[.5*(r+i),o]:[r,.5*(o+a)]}function bg({sourceX:e,sourceY:r,sourcePosition:o=rt.Bottom,targetX:i,targetY:a,targetPosition:d=rt.Top}){const[c,h]=Sm({pos:o,x1:e,y1:r,x2:i,y2:a}),[g,x]=Sm({pos:d,x1:i,y1:a,x2:e,y2:r}),[k,b,S,_]=B0({sourceX:e,sourceY:r,targetX:i,targetY:a,sourceControlX:c,sourceControlY:h,targetControlX:g,targetControlY:x});return[`M${e},${r} C${c},${h} ${g},${x} ${i},${a}`,k,b,S,_]}function Sg(e){return I.memo(({id:r,sourceX:o,sourceY:i,targetX:a,targetY:d,sourcePosition:c,targetPosition:h,label:g,labelStyle:x,labelShowBg:k,labelBgStyle:b,labelBgPadding:S,labelBgBorderRadius:_,style:j,markerEnd:P,markerStart:T,interactionWidth:M})=>{const[V,$,O]=bg({sourceX:o,sourceY:i,sourcePosition:c,targetX:a,targetY:d,targetPosition:h}),z=e.isInternal?void 0:r;return f.jsx(Xi,{id:z,path:V,labelX:$,labelY:O,label:g,labelStyle:x,labelShowBg:k,labelBgStyle:b,labelBgPadding:S,labelBgBorderRadius:_,style:j,markerEnd:P,markerStart:T,interactionWidth:M})})}const Vk=Sg({isInternal:!1}),kg=Sg({isInternal:!0});Vk.displayName="SimpleBezierEdge";kg.displayName="SimpleBezierEdgeInternal";function Ng(e){return I.memo(({id:r,sourceX:o,sourceY:i,targetX:a,targetY:d,label:c,labelStyle:h,labelShowBg:g,labelBgStyle:x,labelBgPadding:k,labelBgBorderRadius:b,style:S,sourcePosition:_=rt.Bottom,targetPosition:j=rt.Top,markerEnd:P,markerStart:T,pathOptions:M,interactionWidth:V})=>{const[$,O,z]=Kd({sourceX:o,sourceY:i,sourcePosition:_,targetX:a,targetY:d,targetPosition:j,borderRadius:M==null?void 0:M.borderRadius,offset:M==null?void 0:M.offset,stepPosition:M==null?void 0:M.stepPosition}),R=e.isInternal?void 0:r;return f.jsx(Xi,{id:R,path:$,labelX:O,labelY:z,label:c,labelStyle:h,labelShowBg:g,labelBgStyle:x,labelBgPadding:k,labelBgBorderRadius:b,style:S,markerEnd:P,markerStart:T,interactionWidth:V})})}const _g=Ng({isInternal:!1}),jg=Ng({isInternal:!0});_g.displayName="SmoothStepEdge";jg.displayName="SmoothStepEdgeInternal";function Cg(e){return I.memo(({id:r,...o})=>{var a;const i=e.isInternal?void 0:r;return f.jsx(_g,{...o,id:i,pathOptions:I.useMemo(()=>{var d;return{borderRadius:0,offset:(d=o.pathOptions)==null?void 0:d.offset}},[(a=o.pathOptions)==null?void 0:a.offset])})})}const Kk=Cg({isInternal:!1}),Eg=Cg({isInternal:!0});Kk.displayName="StepEdge";Eg.displayName="StepEdgeInternal";function Pg(e){return I.memo(({id:r,sourceX:o,sourceY:i,targetX:a,targetY:d,label:c,labelStyle:h,labelShowBg:g,labelBgStyle:x,labelBgPadding:k,labelBgBorderRadius:b,style:S,markerEnd:_,markerStart:j,interactionWidth:P})=>{const[T,M,V]=V0({sourceX:o,sourceY:i,targetX:a,targetY:d}),$=e.isInternal?void 0:r;return f.jsx(Xi,{id:$,path:T,labelX:M,labelY:V,label:c,labelStyle:h,labelShowBg:g,labelBgStyle:x,labelBgPadding:k,labelBgBorderRadius:b,style:S,markerEnd:_,markerStart:j,interactionWidth:P})})}const Wk=Pg({isInternal:!1}),Tg=Pg({isInternal:!0});Wk.displayName="StraightEdge";Tg.displayName="StraightEdgeInternal";function $g(e){return I.memo(({id:r,sourceX:o,sourceY:i,targetX:a,targetY:d,sourcePosition:c=rt.Bottom,targetPosition:h=rt.Top,label:g,labelStyle:x,labelShowBg:k,labelBgStyle:b,labelBgPadding:S,labelBgBorderRadius:_,style:j,markerEnd:P,markerStart:T,pathOptions:M,interactionWidth:V})=>{const[$,O,z]=df({sourceX:o,sourceY:i,sourcePosition:c,targetX:a,targetY:d,targetPosition:h,curvature:M==null?void 0:M.curvature}),R=e.isInternal?void 0:r;return f.jsx(Xi,{id:R,path:$,labelX:O,labelY:z,label:g,labelStyle:x,labelShowBg:k,labelBgStyle:b,labelBgPadding:S,labelBgBorderRadius:_,style:j,markerEnd:P,markerStart:T,interactionWidth:V})})}const Yk=$g({isInternal:!1}),Mg=$g({isInternal:!0});Yk.displayName="BezierEdge";Mg.displayName="BezierEdgeInternal";const km={default:Mg,straight:Tg,step:Eg,smoothstep:jg,simplebezier:kg},Nm={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Jk=(e,r,o)=>o===rt.Left?e-r:o===rt.Right?e+r:e,Xk=(e,r,o)=>o===rt.Top?e-r:o===rt.Bottom?e+r:e,_m="react-flow__edgeupdater";function jm({position:e,centerX:r,centerY:o,radius:i=10,onMouseDown:a,onMouseEnter:d,onMouseOut:c,type:h}){return f.jsx("circle",{onMouseDown:a,onMouseEnter:d,onMouseOut:c,className:fn([_m,`${_m}-${h}`]),cx:Jk(r,i,e),cy:Xk(o,i,e),r:i,stroke:"transparent",fill:"transparent"})}function Qk({isReconnectable:e,reconnectRadius:r,edge:o,sourceX:i,sourceY:a,targetX:d,targetY:c,sourcePosition:h,targetPosition:g,onReconnect:x,onReconnectStart:k,onReconnectEnd:b,setReconnecting:S,setUpdateHover:_}){const j=Wt(),P=(O,z)=>{if(O.button!==0)return;const{autoPanOnConnect:R,domNode:W,connectionMode:Y,connectionRadius:le,lib:we,onConnectStart:ie,cancelConnection:de,nodeLookup:te,rfId:F,panBy:ce,updateConnection:J}=j.getState(),ue=z.type==="target",q=(L,U)=>{S(!1),b==null||b(L,o,z.type,U)},K=L=>x==null?void 0:x(o,L),Q=(L,U)=>{S(!0),k==null||k(O,o,z.type),ie==null||ie(L,U)};Jd.onPointerDown(O.nativeEvent,{autoPanOnConnect:R,connectionMode:Y,connectionRadius:le,domNode:W,handleId:z.id,nodeId:z.nodeId,nodeLookup:te,isTarget:ue,edgeUpdaterType:z.type,lib:we,flowId:F,cancelConnection:de,panBy:ce,isValidConnection:(...L)=>{var U,je;return((je=(U=j.getState()).isValidConnection)==null?void 0:je.call(U,...L))??!0},onConnect:K,onConnectStart:Q,onConnectEnd:(...L)=>{var U,je;return(je=(U=j.getState()).onConnectEnd)==null?void 0:je.call(U,...L)},onReconnectEnd:q,updateConnection:J,getTransform:()=>j.getState().transform,getFromHandle:()=>j.getState().connection.fromHandle,dragThreshold:j.getState().connectionDragThreshold,handleDomNode:O.currentTarget})},T=O=>P(O,{nodeId:o.target,id:o.targetHandle??null,type:"target"}),M=O=>P(O,{nodeId:o.source,id:o.sourceHandle??null,type:"source"}),V=()=>_(!0),$=()=>_(!1);return f.jsxs(f.Fragment,{children:[(e===!0||e==="source")&&f.jsx(jm,{position:h,centerX:i,centerY:a,radius:r,onMouseDown:T,onMouseEnter:V,onMouseOut:$,type:"source"}),(e===!0||e==="target")&&f.jsx(jm,{position:g,centerX:d,centerY:c,radius:r,onMouseDown:M,onMouseEnter:V,onMouseOut:$,type:"target"})]})}function Gk({id:e,edgesFocusable:r,edgesReconnectable:o,elementsSelectable:i,onClick:a,onDoubleClick:d,onContextMenu:c,onMouseEnter:h,onMouseMove:g,onMouseLeave:x,reconnectRadius:k,onReconnect:b,onReconnectStart:S,onReconnectEnd:_,rfId:j,edgeTypes:P,noPanClassName:T,onError:M,disableKeyboardA11y:V}){let $=Ct(ze=>ze.edgeLookup.get(e));const O=Ct(ze=>ze.defaultEdgeOptions);$=O?{...O,...$}:$;let z=$.type||"default",R=(P==null?void 0:P[z])||km[z];R===void 0&&(M==null||M("011",wo.error011(z)),z="default",R=(P==null?void 0:P.default)||km.default);const W=!!($.focusable||r&&typeof $.focusable>"u"),Y=typeof b<"u"&&($.reconnectable||o&&typeof $.reconnectable>"u"),le=!!($.selectable||i&&typeof $.selectable>"u"),we=I.useRef(null),[ie,de]=I.useState(!1),[te,F]=I.useState(!1),ce=Wt(),{zIndex:J,sourceX:ue,sourceY:q,targetX:K,targetY:Q,sourcePosition:L,targetPosition:U}=Ct(I.useCallback(ze=>{const Je=ze.nodeLookup.get($.source),at=ze.nodeLookup.get($.target);if(!Je||!at)return{zIndex:$.zIndex,...Nm};const mt=Ub({id:e,sourceNode:Je,targetNode:at,sourceHandle:$.sourceHandle||null,targetHandle:$.targetHandle||null,connectionMode:ze.connectionMode,onError:M});return{zIndex:Rb({selected:$.selected,zIndex:$.zIndex,sourceNode:Je,targetNode:at,elevateOnSelect:ze.elevateEdgesOnSelect,zIndexMode:ze.zIndexMode}),...mt||Nm}},[$.source,$.target,$.sourceHandle,$.targetHandle,$.selected,$.zIndex]),Jt),je=I.useMemo(()=>$.markerStart?`url('#${Wd($.markerStart,j)}')`:void 0,[$.markerStart,j]),Ne=I.useMemo(()=>$.markerEnd?`url('#${Wd($.markerEnd,j)}')`:void 0,[$.markerEnd,j]);if($.hidden||ue===null||q===null||K===null||Q===null)return null;const Re=ze=>{var ft;const{addSelectedEdges:Je,unselectNodesAndEdges:at,multiSelectionActive:mt}=ce.getState();le&&(ce.setState({nodesSelectionActive:!1}),$.selected&&mt?(at({nodes:[],edges:[$]}),(ft=we.current)==null||ft.blur()):Je([e])),a&&a(ze,$)},Oe=d?ze=>{d(ze,{...$})}:void 0,Le=c?ze=>{c(ze,{...$})}:void 0,ke=h?ze=>{h(ze,{...$})}:void 0,$e=g?ze=>{g(ze,{...$})}:void 0,_e=x?ze=>{x(ze,{...$})}:void 0,tt=ze=>{var Je;if(!V&&E0.includes(ze.key)&&le){const{unselectNodesAndEdges:at,addSelectedEdges:mt}=ce.getState();ze.key==="Escape"?((Je=we.current)==null||Je.blur(),at({edges:[$]})):mt([e])}};return f.jsx("svg",{style:{zIndex:J},children:f.jsxs("g",{className:fn(["react-flow__edge",`react-flow__edge-${z}`,$.className,T,{selected:$.selected,animated:$.animated,inactive:!le&&!a,updating:ie,selectable:le}]),onClick:Re,onDoubleClick:Oe,onContextMenu:Le,onMouseEnter:ke,onMouseMove:$e,onMouseLeave:_e,onKeyDown:W?tt:void 0,tabIndex:W?0:void 0,role:$.ariaRole??(W?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":$.ariaLabel===null?void 0:$.ariaLabel||`Edge from ${$.source} to ${$.target}`,"aria-describedby":W?`${ag}-${j}`:void 0,ref:we,...$.domAttributes,children:[!te&&f.jsx(R,{id:e,source:$.source,target:$.target,type:$.type,selected:$.selected,animated:$.animated,selectable:le,deletable:$.deletable??!0,label:$.label,labelStyle:$.labelStyle,labelShowBg:$.labelShowBg,labelBgStyle:$.labelBgStyle,labelBgPadding:$.labelBgPadding,labelBgBorderRadius:$.labelBgBorderRadius,sourceX:ue,sourceY:q,targetX:K,targetY:Q,sourcePosition:L,targetPosition:U,data:$.data,style:$.style,sourceHandleId:$.sourceHandle,targetHandleId:$.targetHandle,markerStart:je,markerEnd:Ne,pathOptions:"pathOptions"in $?$.pathOptions:void 0,interactionWidth:$.interactionWidth}),Y&&f.jsx(Qk,{edge:$,isReconnectable:Y,reconnectRadius:k,onReconnect:b,onReconnectStart:S,onReconnectEnd:_,sourceX:ue,sourceY:q,targetX:K,targetY:Q,sourcePosition:L,targetPosition:U,setUpdateHover:de,setReconnecting:F})]})})}var Zk=I.memo(Gk);const eN=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Ag({defaultMarkerColor:e,onlyRenderVisibleElements:r,rfId:o,edgeTypes:i,noPanClassName:a,onReconnect:d,onEdgeContextMenu:c,onEdgeMouseEnter:h,onEdgeMouseMove:g,onEdgeMouseLeave:x,onEdgeClick:k,reconnectRadius:b,onEdgeDoubleClick:S,onReconnectStart:_,onReconnectEnd:j,disableKeyboardA11y:P}){const{edgesFocusable:T,edgesReconnectable:M,elementsSelectable:V,onError:$}=Ct(eN,Jt),O=Lk(r);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(qk,{defaultColor:e,rfId:o}),O.map(z=>f.jsx(Zk,{id:z,edgesFocusable:T,edgesReconnectable:M,elementsSelectable:V,noPanClassName:a,onReconnect:d,onContextMenu:c,onMouseEnter:h,onMouseMove:g,onMouseLeave:x,onClick:k,reconnectRadius:b,onDoubleClick:S,onReconnectStart:_,onReconnectEnd:j,rfId:o,onError:$,edgeTypes:i,disableKeyboardA11y:P},z))]})}Ag.displayName="EdgeRenderer";const tN=I.memo(Ag),nN=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function rN({children:e}){const r=Ct(nN);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:e})}function oN(e){const r=yf(),o=I.useRef(!1);I.useEffect(()=>{!o.current&&r.viewportInitialized&&e&&(setTimeout(()=>e(r),1),o.current=!0)},[e,r.viewportInitialized])}const sN=e=>{var r;return(r=e.panZoom)==null?void 0:r.syncViewport};function iN(e){const r=Ct(sN),o=Wt();return I.useEffect(()=>{e&&(r==null||r(e),o.setState({transform:[e.x,e.y,e.zoom]}))},[e,r]),null}function aN(e){return e.connection.inProgress?{...e.connection,to:el(e.connection.to,e.transform)}:{...e.connection}}function lN(e){return aN}function uN(e){const r=lN();return Ct(r,Jt)}const cN=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function dN({containerStyle:e,style:r,type:o,component:i}){const{nodesConnectable:a,width:d,height:c,isValid:h,inProgress:g}=Ct(cN,Jt);return!(d&&a&&g)?null:f.jsx("svg",{style:e,width:d,height:c,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:fn(["react-flow__connection",$0(h)]),children:f.jsx(Ig,{style:r,type:o,CustomComponent:i,isValid:h})})})}const Ig=({style:e,type:r=Ns.Bezier,CustomComponent:o,isValid:i})=>{const{inProgress:a,from:d,fromNode:c,fromHandle:h,fromPosition:g,to:x,toNode:k,toHandle:b,toPosition:S,pointer:_}=uN();if(!a)return;if(o)return f.jsx(o,{connectionLineType:r,connectionLineStyle:e,fromNode:c,fromHandle:h,fromX:d.x,fromY:d.y,toX:x.x,toY:x.y,fromPosition:g,toPosition:S,connectionStatus:$0(i),toNode:k,toHandle:b,pointer:_});let j="";const P={sourceX:d.x,sourceY:d.y,sourcePosition:g,targetX:x.x,targetY:x.y,targetPosition:S};switch(r){case Ns.Bezier:[j]=df(P);break;case Ns.SimpleBezier:[j]=bg(P);break;case Ns.Step:[j]=Kd({...P,borderRadius:0});break;case Ns.SmoothStep:[j]=Kd(P);break;default:[j]=V0(P)}return f.jsx("path",{d:j,fill:"none",className:"react-flow__connection-path",style:e})};Ig.displayName="ConnectionLine";const fN={};function Cm(e=fN){I.useRef(e),Wt(),I.useEffect(()=>{},[e])}function pN(){Wt(),I.useRef(!1),I.useEffect(()=>{},[])}function Og({nodeTypes:e,edgeTypes:r,onInit:o,onNodeClick:i,onEdgeClick:a,onNodeDoubleClick:d,onEdgeDoubleClick:c,onNodeMouseEnter:h,onNodeMouseMove:g,onNodeMouseLeave:x,onNodeContextMenu:k,onSelectionContextMenu:b,onSelectionStart:S,onSelectionEnd:_,connectionLineType:j,connectionLineStyle:P,connectionLineComponent:T,connectionLineContainerStyle:M,selectionKeyCode:V,selectionOnDrag:$,selectionMode:O,multiSelectionKeyCode:z,panActivationKeyCode:R,zoomActivationKeyCode:W,deleteKeyCode:Y,onlyRenderVisibleElements:le,elementsSelectable:we,defaultViewport:ie,translateExtent:de,minZoom:te,maxZoom:F,preventScrolling:ce,defaultMarkerColor:J,zoomOnScroll:ue,zoomOnPinch:q,panOnScroll:K,panOnScrollSpeed:Q,panOnScrollMode:L,zoomOnDoubleClick:U,panOnDrag:je,onPaneClick:Ne,onPaneMouseEnter:Re,onPaneMouseMove:Oe,onPaneMouseLeave:Le,onPaneScroll:ke,onPaneContextMenu:$e,paneClickDistance:_e,nodeClickDistance:tt,onEdgeContextMenu:ze,onEdgeMouseEnter:Je,onEdgeMouseMove:at,onEdgeMouseLeave:mt,reconnectRadius:ft,onReconnect:Mt,onReconnectStart:Xt,onReconnectEnd:nn,noDragClassName:Ht,noWheelClassName:Dt,noPanClassName:pn,disableKeyboardA11y:ln,nodeExtent:An,rfId:en,viewport:At,onViewportChange:Rt}){return Cm(e),Cm(r),pN(),oN(o),iN(At),f.jsx(Ek,{onPaneClick:Ne,onPaneMouseEnter:Re,onPaneMouseMove:Oe,onPaneMouseLeave:Le,onPaneContextMenu:$e,onPaneScroll:ke,paneClickDistance:_e,deleteKeyCode:Y,selectionKeyCode:V,selectionOnDrag:$,selectionMode:O,onSelectionStart:S,onSelectionEnd:_,multiSelectionKeyCode:z,panActivationKeyCode:R,zoomActivationKeyCode:W,elementsSelectable:we,zoomOnScroll:ue,zoomOnPinch:q,zoomOnDoubleClick:U,panOnScroll:K,panOnScrollSpeed:Q,panOnScrollMode:L,panOnDrag:je,defaultViewport:ie,translateExtent:de,minZoom:te,maxZoom:F,onSelectionContextMenu:b,preventScrolling:ce,noDragClassName:Ht,noWheelClassName:Dt,noPanClassName:pn,disableKeyboardA11y:ln,onViewportChange:Rt,isControlledViewport:!!At,children:f.jsxs(rN,{children:[f.jsx(tN,{edgeTypes:r,onEdgeClick:a,onEdgeDoubleClick:c,onReconnect:Mt,onReconnectStart:Xt,onReconnectEnd:nn,onlyRenderVisibleElements:le,onEdgeContextMenu:ze,onEdgeMouseEnter:Je,onEdgeMouseMove:at,onEdgeMouseLeave:mt,reconnectRadius:ft,defaultMarkerColor:J,noPanClassName:pn,disableKeyboardA11y:ln,rfId:en}),f.jsx(dN,{style:P,type:j,component:T,containerStyle:M}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(Rk,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:d,onNodeMouseEnter:h,onNodeMouseMove:g,onNodeMouseLeave:x,onNodeContextMenu:k,nodeClickDistance:tt,onlyRenderVisibleElements:le,noPanClassName:pn,noDragClassName:Ht,disableKeyboardA11y:ln,nodeExtent:An,rfId:en}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}Og.displayName="GraphView";const hN=I.memo(Og),Em=({nodes:e,edges:r,defaultNodes:o,defaultEdges:i,width:a,height:d,fitView:c,fitViewOptions:h,minZoom:g=.5,maxZoom:x=2,nodeOrigin:k,nodeExtent:b,zIndexMode:S="basic"}={})=>{const _=new Map,j=new Map,P=new Map,T=new Map,M=i??r??[],V=o??e??[],$=k??[0,0],O=b??Ba;Y0(P,T,M);const{nodesInitialized:z}=Yd(V,_,j,{nodeOrigin:$,nodeExtent:O,zIndexMode:S});let R=[0,0,1];if(c&&a&&d){const W=Ga(_,{filter:ie=>!!((ie.width||ie.initialWidth)&&(ie.height||ie.initialHeight))}),{x:Y,y:le,zoom:we}=uf(W,a,d,g,x,(h==null?void 0:h.padding)??.1);R=[Y,le,we]}return{rfId:"1",width:a??0,height:d??0,transform:R,nodes:V,nodesInitialized:z,nodeLookup:_,parentLookup:j,edges:M,edgeLookup:T,connectionLookup:P,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:o!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:g,maxZoom:x,translateExtent:Ba,nodeExtent:O,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ui.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:$,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:c??!1,fitViewOptions:h,fitViewResolver:null,connection:{...T0},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:$b,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:P0,zIndexMode:S,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},mN=({nodes:e,edges:r,defaultNodes:o,defaultEdges:i,width:a,height:d,fitView:c,fitViewOptions:h,minZoom:g,maxZoom:x,nodeOrigin:k,nodeExtent:b,zIndexMode:S})=>IS((_,j)=>{async function P(){const{nodeLookup:T,panZoom:M,fitViewOptions:V,fitViewResolver:$,width:O,height:z,minZoom:R,maxZoom:W}=j();M&&(await Pb({nodes:T,width:O,height:z,panZoom:M,minZoom:R,maxZoom:W},V),$==null||$.resolve(!0),_({fitViewResolver:null}))}return{...Em({nodes:e,edges:r,width:a,height:d,fitView:c,fitViewOptions:h,minZoom:g,maxZoom:x,nodeOrigin:k,nodeExtent:b,defaultNodes:o,defaultEdges:i,zIndexMode:S}),setNodes:T=>{const{nodeLookup:M,parentLookup:V,nodeOrigin:$,elevateNodesOnSelect:O,fitViewQueued:z,zIndexMode:R,nodesSelectionActive:W}=j(),{nodesInitialized:Y,hasSelectedNodes:le}=Yd(T,M,V,{nodeOrigin:$,nodeExtent:b,elevateNodesOnSelect:O,checkEquality:!0,zIndexMode:R}),we=W&&le;z&&Y?(P(),_({nodes:T,nodesInitialized:Y,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:we})):_({nodes:T,nodesInitialized:Y,nodesSelectionActive:we})},setEdges:T=>{const{connectionLookup:M,edgeLookup:V}=j();Y0(M,V,T),_({edges:T})},setDefaultNodesAndEdges:(T,M)=>{if(T){const{setNodes:V}=j();V(T),_({hasDefaultNodes:!0})}if(M){const{setEdges:V}=j();V(M),_({hasDefaultEdges:!0})}},updateNodeInternals:T=>{const{triggerNodeChanges:M,nodeLookup:V,parentLookup:$,domNode:O,nodeOrigin:z,nodeExtent:R,debug:W,fitViewQueued:Y,zIndexMode:le}=j(),{changes:we,updatedInternals:ie}=Gb(T,V,$,O,z,R,le);ie&&(Yb(V,$,{nodeOrigin:z,nodeExtent:R,zIndexMode:le}),Y?(P(),_({fitViewQueued:!1,fitViewOptions:void 0})):_({}),(we==null?void 0:we.length)>0&&(W&&console.log("React Flow: trigger node changes",we),M==null||M(we)))},updateNodePositions:(T,M=!1)=>{const V=[];let $=[];const{nodeLookup:O,triggerNodeChanges:z,connection:R,updateConnection:W,onNodesChangeMiddlewareMap:Y}=j();for(const[le,we]of T){const ie=O.get(le),de=!!(ie!=null&&ie.expandParent&&(ie!=null&&ie.parentId)&&(we!=null&&we.position)),te={id:le,type:"position",position:de?{x:Math.max(0,we.position.x),y:Math.max(0,we.position.y)}:we.position,dragging:M};if(ie&&R.inProgress&&R.fromNode.id===ie.id){const F=Zs(ie,R.fromHandle,rt.Left,!0);W({...R,from:F})}de&&ie.parentId&&V.push({id:le,parentId:ie.parentId,rect:{...we.internals.positionAbsolute,width:we.measured.width??0,height:we.measured.height??0}}),$.push(te)}if(V.length>0){const{parentLookup:le,nodeOrigin:we}=j(),ie=gf(V,O,le,we);$.push(...ie)}for(const le of Y.values())$=le($);z($)},triggerNodeChanges:T=>{const{onNodesChange:M,setNodes:V,nodes:$,hasDefaultNodes:O,debug:z}=j();if(T!=null&&T.length){if(O){const R=cg(T,$);V(R)}z&&console.log("React Flow: trigger node changes",T),M==null||M(T)}},triggerEdgeChanges:T=>{const{onEdgesChange:M,setEdges:V,edges:$,hasDefaultEdges:O,debug:z}=j();if(T!=null&&T.length){if(O){const R=dg(T,$);V(R)}z&&console.log("React Flow: trigger edge changes",T),M==null||M(T)}},addSelectedNodes:T=>{const{multiSelectionActive:M,edgeLookup:V,nodeLookup:$,triggerNodeChanges:O,triggerEdgeChanges:z}=j();if(M){const R=T.map(W=>Vs(W,!0));O(R);return}O(Ri($,new Set([...T]),!0)),z(Ri(V))},addSelectedEdges:T=>{const{multiSelectionActive:M,edgeLookup:V,nodeLookup:$,triggerNodeChanges:O,triggerEdgeChanges:z}=j();if(M){const R=T.map(W=>Vs(W,!0));z(R);return}z(Ri(V,new Set([...T]))),O(Ri($,new Set,!0))},unselectNodesAndEdges:({nodes:T,edges:M}={})=>{const{edges:V,nodes:$,nodeLookup:O,triggerNodeChanges:z,triggerEdgeChanges:R}=j(),W=T||$,Y=M||V,le=[];for(const ie of W){if(!ie.selected)continue;const de=O.get(ie.id);de&&(de.selected=!1),le.push(Vs(ie.id,!1))}const we=[];for(const ie of Y)ie.selected&&we.push(Vs(ie.id,!1));z(le),R(we)},setMinZoom:T=>{const{panZoom:M,maxZoom:V}=j();M==null||M.setScaleExtent([T,V]),_({minZoom:T})},setMaxZoom:T=>{const{panZoom:M,minZoom:V}=j();M==null||M.setScaleExtent([V,T]),_({maxZoom:T})},setTranslateExtent:T=>{var M;(M=j().panZoom)==null||M.setTranslateExtent(T),_({translateExtent:T})},resetSelectedElements:()=>{const{edges:T,nodes:M,triggerNodeChanges:V,triggerEdgeChanges:$,elementsSelectable:O}=j();if(!O)return;const z=M.reduce((W,Y)=>Y.selected?[...W,Vs(Y.id,!1)]:W,[]),R=T.reduce((W,Y)=>Y.selected?[...W,Vs(Y.id,!1)]:W,[]);V(z),$(R)},setNodeExtent:T=>{const{nodes:M,nodeLookup:V,parentLookup:$,nodeOrigin:O,elevateNodesOnSelect:z,nodeExtent:R,zIndexMode:W}=j();T[0][0]===R[0][0]&&T[0][1]===R[0][1]&&T[1][0]===R[1][0]&&T[1][1]===R[1][1]||(Yd(M,V,$,{nodeOrigin:O,nodeExtent:T,elevateNodesOnSelect:z,checkEquality:!1,zIndexMode:W}),_({nodeExtent:T}))},panBy:T=>{const{transform:M,width:V,height:$,panZoom:O,translateExtent:z}=j();return Zb({delta:T,panZoom:O,transform:M,translateExtent:z,width:V,height:$})},setCenter:async(T,M,V)=>{const{width:$,height:O,maxZoom:z,panZoom:R}=j();if(!R)return Promise.resolve(!1);const W=typeof(V==null?void 0:V.zoom)<"u"?V.zoom:z;return await R.setViewport({x:$/2-T*W,y:O/2-M*W,zoom:W},{duration:V==null?void 0:V.duration,ease:V==null?void 0:V.ease,interpolate:V==null?void 0:V.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{_({connection:{...T0}})},updateConnection:T=>{_({connection:T})},reset:()=>_({...Em()})}},Object.is);function gN({initialNodes:e,initialEdges:r,defaultNodes:o,defaultEdges:i,initialWidth:a,initialHeight:d,initialMinZoom:c,initialMaxZoom:h,initialFitViewOptions:g,fitView:x,nodeOrigin:k,nodeExtent:b,zIndexMode:S,children:_}){const[j]=I.useState(()=>mN({nodes:e,edges:r,defaultNodes:o,defaultEdges:i,width:a,height:d,fitView:x,minZoom:c,maxZoom:h,fitViewOptions:g,nodeOrigin:k,nodeExtent:b,zIndexMode:S}));return f.jsx(OS,{value:j,children:f.jsx(rk,{children:_})})}function yN({children:e,nodes:r,edges:o,defaultNodes:i,defaultEdges:a,width:d,height:c,fitView:h,fitViewOptions:g,minZoom:x,maxZoom:k,nodeOrigin:b,nodeExtent:S,zIndexMode:_}){return I.useContext(Wu)?f.jsx(f.Fragment,{children:e}):f.jsx(gN,{initialNodes:r,initialEdges:o,defaultNodes:i,defaultEdges:a,initialWidth:d,initialHeight:c,fitView:h,initialFitViewOptions:g,initialMinZoom:x,initialMaxZoom:k,nodeOrigin:b,nodeExtent:S,zIndexMode:_,children:e})}const xN={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function vN({nodes:e,edges:r,defaultNodes:o,defaultEdges:i,className:a,nodeTypes:d,edgeTypes:c,onNodeClick:h,onEdgeClick:g,onInit:x,onMove:k,onMoveStart:b,onMoveEnd:S,onConnect:_,onConnectStart:j,onConnectEnd:P,onClickConnectStart:T,onClickConnectEnd:M,onNodeMouseEnter:V,onNodeMouseMove:$,onNodeMouseLeave:O,onNodeContextMenu:z,onNodeDoubleClick:R,onNodeDragStart:W,onNodeDrag:Y,onNodeDragStop:le,onNodesDelete:we,onEdgesDelete:ie,onDelete:de,onSelectionChange:te,onSelectionDragStart:F,onSelectionDrag:ce,onSelectionDragStop:J,onSelectionContextMenu:ue,onSelectionStart:q,onSelectionEnd:K,onBeforeDelete:Q,connectionMode:L,connectionLineType:U=Ns.Bezier,connectionLineStyle:je,connectionLineComponent:Ne,connectionLineContainerStyle:Re,deleteKeyCode:Oe="Backspace",selectionKeyCode:Le="Shift",selectionOnDrag:ke=!1,selectionMode:$e=qa.Full,panActivationKeyCode:_e="Space",multiSelectionKeyCode:tt=Va()?"Meta":"Control",zoomActivationKeyCode:ze=Va()?"Meta":"Control",snapToGrid:Je,snapGrid:at,onlyRenderVisibleElements:mt=!1,selectNodesOnDrag:ft,nodesDraggable:Mt,autoPanOnNodeFocus:Xt,nodesConnectable:nn,nodesFocusable:Ht,nodeOrigin:Dt=lg,edgesFocusable:pn,edgesReconnectable:ln,elementsSelectable:An=!0,defaultViewport:en=YS,minZoom:At=.5,maxZoom:Rt=2,translateExtent:gn=Ba,preventScrolling:Fn=!0,nodeExtent:un,defaultMarkerColor:ye="#b1b1b7",zoomOnScroll:ot=!0,zoomOnPinch:pt=!0,panOnScroll:Ft=!1,panOnScrollSpeed:vt=.5,panOnScrollMode:Ue=Ys.Free,zoomOnDoubleClick:bt=!0,panOnDrag:Tt=!0,onPaneClick:yn,onPaneMouseEnter:qe,onPaneMouseMove:zn,onPaneMouseLeave:Bn,onPaneScroll:Lr,onPaneContextMenu:wr,paneClickDistance:Hr=1,nodeClickDistance:So=0,children:br,onReconnect:qn,onReconnectStart:jn,onReconnectEnd:Xn,onEdgeContextMenu:In,onEdgeDoubleClick:_t,onEdgeMouseEnter:zt,onEdgeMouseMove:Sr,onEdgeMouseLeave:Un,reconnectRadius:rn=10,onNodesChange:xn,onEdgesChange:Fr,noDragClassName:Qe="nodrag",noWheelClassName:kr="nowheel",noPanClassName:yt="nopan",fitView:Nr,fitViewOptions:ko,connectOnClick:Cn,attributionPosition:Qn,proOptions:Gn,defaultEdgeOptions:No,elevateNodesOnSelect:zr=!0,elevateEdgesOnSelect:It=!1,disableKeyboardA11y:Vn=!1,autoPanOnConnect:ct,autoPanOnNodeDrag:Yo,autoPanSpeed:_r,connectionRadius:lo,isValidConnection:jr,onError:pr,style:uo,id:Zn,nodeDragThreshold:En,connectionDragThreshold:wt,viewport:vn,onViewportChange:Jo,width:Kn,height:hr,colorMode:Br="light",debug:qr,onScroll:Wn,ariaLabelConfig:jt,zIndexMode:Cr="basic",...Ur},er){const Er=Zn||"1",Pr=GS(Br),tr=I.useCallback(_o=>{_o.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Wn==null||Wn(_o)},[Wn]);return f.jsx("div",{"data-testid":"rf__wrapper",...Ur,onScroll:tr,style:{...uo,...xN},ref:er,className:fn(["react-flow",a,Pr]),id:Zn,role:"application",children:f.jsxs(yN,{nodes:e,edges:r,width:Kn,height:hr,fitView:Nr,fitViewOptions:ko,minZoom:At,maxZoom:Rt,nodeOrigin:Dt,nodeExtent:un,zIndexMode:Cr,children:[f.jsx(QS,{nodes:e,edges:r,defaultNodes:o,defaultEdges:i,onConnect:_,onConnectStart:j,onConnectEnd:P,onClickConnectStart:T,onClickConnectEnd:M,nodesDraggable:Mt,autoPanOnNodeFocus:Xt,nodesConnectable:nn,nodesFocusable:Ht,edgesFocusable:pn,edgesReconnectable:ln,elementsSelectable:An,elevateNodesOnSelect:zr,elevateEdgesOnSelect:It,minZoom:At,maxZoom:Rt,nodeExtent:un,onNodesChange:xn,onEdgesChange:Fr,snapToGrid:Je,snapGrid:at,connectionMode:L,translateExtent:gn,connectOnClick:Cn,defaultEdgeOptions:No,fitView:Nr,fitViewOptions:ko,onNodesDelete:we,onEdgesDelete:ie,onDelete:de,onNodeDragStart:W,onNodeDrag:Y,onNodeDragStop:le,onSelectionDrag:ce,onSelectionDragStart:F,onSelectionDragStop:J,onMove:k,onMoveStart:b,onMoveEnd:S,noPanClassName:yt,nodeOrigin:Dt,rfId:Er,autoPanOnConnect:ct,autoPanOnNodeDrag:Yo,autoPanSpeed:_r,onError:pr,connectionRadius:lo,isValidConnection:jr,selectNodesOnDrag:ft,nodeDragThreshold:En,connectionDragThreshold:wt,onBeforeDelete:Q,debug:qr,ariaLabelConfig:jt,zIndexMode:Cr}),f.jsx(hN,{onInit:x,onNodeClick:h,onEdgeClick:g,onNodeMouseEnter:V,onNodeMouseMove:$,onNodeMouseLeave:O,onNodeContextMenu:z,onNodeDoubleClick:R,nodeTypes:d,edgeTypes:c,connectionLineType:U,connectionLineStyle:je,connectionLineComponent:Ne,connectionLineContainerStyle:Re,selectionKeyCode:Le,selectionOnDrag:ke,selectionMode:$e,deleteKeyCode:Oe,multiSelectionKeyCode:tt,panActivationKeyCode:_e,zoomActivationKeyCode:ze,onlyRenderVisibleElements:mt,defaultViewport:en,translateExtent:gn,minZoom:At,maxZoom:Rt,preventScrolling:Fn,zoomOnScroll:ot,zoomOnPinch:pt,zoomOnDoubleClick:bt,panOnScroll:Ft,panOnScrollSpeed:vt,panOnScrollMode:Ue,panOnDrag:Tt,onPaneClick:yn,onPaneMouseEnter:qe,onPaneMouseMove:zn,onPaneMouseLeave:Bn,onPaneScroll:Lr,onPaneContextMenu:wr,paneClickDistance:Hr,nodeClickDistance:So,onSelectionContextMenu:ue,onSelectionStart:q,onSelectionEnd:K,onReconnect:qn,onReconnectStart:jn,onReconnectEnd:Xn,onEdgeContextMenu:In,onEdgeDoubleClick:_t,onEdgeMouseEnter:zt,onEdgeMouseMove:Sr,onEdgeMouseLeave:Un,reconnectRadius:rn,defaultMarkerColor:ye,noDragClassName:Qe,noWheelClassName:kr,noPanClassName:yt,rfId:Er,disableKeyboardA11y:Vn,nodeExtent:un,viewport:vn,onViewportChange:Jo}),f.jsx(WS,{onSelectionChange:te}),br,f.jsx(BS,{proOptions:Gn,position:Qn}),f.jsx(zS,{rfId:Er,disableKeyboardA11y:Vn})]})})}var wN=fg(vN);const bN=e=>{var r;return(r=e.domNode)==null?void 0:r.querySelector(".react-flow__edgelabel-renderer")};function SN({children:e}){const r=Ct(bN);return r?og.createPortal(e,r):null}function kN(){const e=Wt();return I.useCallback(r=>{const{domNode:o,updateNodeInternals:i}=e.getState(),a=Array.isArray(r)?r:[r],d=new Map;a.forEach(c=>{const h=o==null?void 0:o.querySelector(`.react-flow__node[data-id="${c}"]`);h&&d.set(c,{id:c,nodeElement:h,force:!0})}),requestAnimationFrame(()=>i(d,{triggerFitView:!1}))},[])}function NN(e){const[r,o]=I.useState(e),i=I.useCallback(a=>o(d=>cg(a,d)),[]);return[r,o,i]}function _N(e){const[r,o]=I.useState(e),i=I.useCallback(a=>o(d=>dg(a,d)),[]);return[r,o,i]}function jN({dimensions:e,lineWidth:r,variant:o,className:i}){return f.jsx("path",{strokeWidth:r,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:fn(["react-flow__background-pattern",o,i])})}function CN({radius:e,className:r}){return f.jsx("circle",{cx:e,cy:e,r:e,className:fn(["react-flow__background-pattern","dots",r])})}var Uo;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Uo||(Uo={}));const EN={[Uo.Dots]:1,[Uo.Lines]:1,[Uo.Cross]:6},PN=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Dg({id:e,variant:r=Uo.Dots,gap:o=20,size:i,lineWidth:a=1,offset:d=0,color:c,bgColor:h,style:g,className:x,patternClassName:k}){const b=I.useRef(null),{transform:S,patternId:_}=Ct(PN,Jt),j=i||EN[r],P=r===Uo.Dots,T=r===Uo.Cross,M=Array.isArray(o)?o:[o,o],V=[M[0]*S[2]||1,M[1]*S[2]||1],$=j*S[2],O=Array.isArray(d)?d:[d,d],z=T?[$,$]:V,R=[O[0]*S[2]||1+z[0]/2,O[1]*S[2]||1+z[1]/2],W=`${_}${e||""}`;return f.jsxs("svg",{className:fn(["react-flow__background",x]),style:{...g,...Yu,"--xy-background-color-props":h,"--xy-background-pattern-color-props":c},ref:b,"data-testid":"rf__background",children:[f.jsx("pattern",{id:W,x:S[0]%V[0],y:S[1]%V[1],width:V[0],height:V[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${R[0]},-${R[1]})`,children:P?f.jsx(CN,{radius:$/2,className:k}):f.jsx(jN,{dimensions:z,lineWidth:a,variant:r,className:k})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${W})`})]})}Dg.displayName="Background";const TN=I.memo(Dg);function $N(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:f.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function MN(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:f.jsx("path",{d:"M0 0h32v4.2H0z"})})}function AN(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:f.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function IN(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function ON(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function cu({children:e,className:r,...o}){return f.jsx("button",{type:"button",className:fn(["react-flow__controls-button",r]),...o,children:e})}const DN=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Rg({style:e,showZoom:r=!0,showFitView:o=!0,showInteractive:i=!0,fitViewOptions:a,onZoomIn:d,onZoomOut:c,onFitView:h,onInteractiveChange:g,className:x,children:k,position:b="bottom-left",orientation:S="vertical","aria-label":_}){const j=Wt(),{isInteractive:P,minZoomReached:T,maxZoomReached:M,ariaLabelConfig:V}=Ct(DN,Jt),{zoomIn:$,zoomOut:O,fitView:z}=yf(),R=()=>{$(),d==null||d()},W=()=>{O(),c==null||c()},Y=()=>{z(a),h==null||h()},le=()=>{j.setState({nodesDraggable:!P,nodesConnectable:!P,elementsSelectable:!P}),g==null||g(!P)},we=S==="horizontal"?"horizontal":"vertical";return f.jsxs(tl,{className:fn(["react-flow__controls",we,x]),position:b,style:e,"data-testid":"rf__controls","aria-label":_??V["controls.ariaLabel"],children:[r&&f.jsxs(f.Fragment,{children:[f.jsx(cu,{onClick:R,className:"react-flow__controls-zoomin",title:V["controls.zoomIn.ariaLabel"],"aria-label":V["controls.zoomIn.ariaLabel"],disabled:M,children:f.jsx($N,{})}),f.jsx(cu,{onClick:W,className:"react-flow__controls-zoomout",title:V["controls.zoomOut.ariaLabel"],"aria-label":V["controls.zoomOut.ariaLabel"],disabled:T,children:f.jsx(MN,{})})]}),o&&f.jsx(cu,{className:"react-flow__controls-fitview",onClick:Y,title:V["controls.fitView.ariaLabel"],"aria-label":V["controls.fitView.ariaLabel"],children:f.jsx(AN,{})}),i&&f.jsx(cu,{className:"react-flow__controls-interactive",onClick:le,title:V["controls.interactive.ariaLabel"],"aria-label":V["controls.interactive.ariaLabel"],children:P?f.jsx(ON,{}):f.jsx(IN,{})}),k]})}Rg.displayName="Controls";const RN=I.memo(Rg);function LN({id:e,x:r,y:o,width:i,height:a,style:d,color:c,strokeColor:h,strokeWidth:g,className:x,borderRadius:k,shapeRendering:b,selected:S,onClick:_}){const{background:j,backgroundColor:P}=d||{},T=c||j||P;return f.jsx("rect",{className:fn(["react-flow__minimap-node",{selected:S},x]),x:r,y:o,rx:k,ry:k,width:i,height:a,style:{fill:T,stroke:h,strokeWidth:g},shapeRendering:b,onClick:_?M=>_(M,e):void 0})}const HN=I.memo(LN),FN=e=>e.nodes.map(r=>r.id),Pd=e=>e instanceof Function?e:()=>e;function zN({nodeStrokeColor:e,nodeColor:r,nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:d=HN,onClick:c}){const h=Ct(FN,Jt),g=Pd(r),x=Pd(e),k=Pd(o),b=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:h.map(S=>f.jsx(qN,{id:S,nodeColorFunc:g,nodeStrokeColorFunc:x,nodeClassNameFunc:k,nodeBorderRadius:i,nodeStrokeWidth:a,NodeComponent:d,onClick:c,shapeRendering:b},S))})}function BN({id:e,nodeColorFunc:r,nodeStrokeColorFunc:o,nodeClassNameFunc:i,nodeBorderRadius:a,nodeStrokeWidth:d,shapeRendering:c,NodeComponent:h,onClick:g}){const{node:x,x:k,y:b,width:S,height:_}=Ct(j=>{const P=j.nodeLookup.get(e);if(!P)return{node:void 0,x:0,y:0,width:0,height:0};const T=P.internals.userNode,{x:M,y:V}=P.internals.positionAbsolute,{width:$,height:O}=Ko(T);return{node:T,x:M,y:V,width:$,height:O}},Jt);return!x||x.hidden||!R0(x)?null:f.jsx(h,{x:k,y:b,width:S,height:_,style:x.style,selected:!!x.selected,className:i(x),color:r(x),borderRadius:a,strokeColor:o(x),strokeWidth:d,shapeRendering:c,onClick:g,id:x.id})}const qN=I.memo(BN);var UN=I.memo(zN);const VN=200,KN=150,WN=e=>!e.hidden,YN=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?D0(Ga(e.nodeLookup,{filter:WN}),r):r,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},JN="react-flow__minimap-desc";function Lg({style:e,className:r,nodeStrokeColor:o,nodeColor:i,nodeClassName:a="",nodeBorderRadius:d=5,nodeStrokeWidth:c,nodeComponent:h,bgColor:g,maskColor:x,maskStrokeColor:k,maskStrokeWidth:b,position:S="bottom-right",onClick:_,onNodeClick:j,pannable:P=!1,zoomable:T=!1,ariaLabel:M,inversePan:V,zoomStep:$=1,offsetScale:O=5}){const z=Wt(),R=I.useRef(null),{boundingRect:W,viewBB:Y,rfId:le,panZoom:we,translateExtent:ie,flowWidth:de,flowHeight:te,ariaLabelConfig:F}=Ct(YN,Jt),ce=(e==null?void 0:e.width)??VN,J=(e==null?void 0:e.height)??KN,ue=W.width/ce,q=W.height/J,K=Math.max(ue,q),Q=K*ce,L=K*J,U=O*K,je=W.x-(Q-W.width)/2-U,Ne=W.y-(L-W.height)/2-U,Re=Q+U*2,Oe=L+U*2,Le=`${JN}-${le}`,ke=I.useRef(0),$e=I.useRef();ke.current=K,I.useEffect(()=>{if(R.current&&we)return $e.current=lS({domNode:R.current,panZoom:we,getTransform:()=>z.getState().transform,getViewScale:()=>ke.current}),()=>{var Je;(Je=$e.current)==null||Je.destroy()}},[we]),I.useEffect(()=>{var Je;(Je=$e.current)==null||Je.update({translateExtent:ie,width:de,height:te,inversePan:V,pannable:P,zoomStep:$,zoomable:T})},[P,T,V,$,ie,de,te]);const _e=_?Je=>{var ft;const[at,mt]=((ft=$e.current)==null?void 0:ft.pointer(Je))||[0,0];_(Je,{x:at,y:mt})}:void 0,tt=j?I.useCallback((Je,at)=>{const mt=z.getState().nodeLookup.get(at).internals.userNode;j(Je,mt)},[]):void 0,ze=M??F["minimap.ariaLabel"];return f.jsx(tl,{position:S,style:{...e,"--xy-minimap-background-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-background-color-props":typeof x=="string"?x:void 0,"--xy-minimap-mask-stroke-color-props":typeof k=="string"?k:void 0,"--xy-minimap-mask-stroke-width-props":typeof b=="number"?b*K: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 c=="number"?c:void 0},className:fn(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:ce,height:J,viewBox:`${je} ${Ne} ${Re} ${Oe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Le,ref:R,onClick:_e,children:[ze&&f.jsx("title",{id:Le,children:ze}),f.jsx(UN,{onClick:tt,nodeColor:i,nodeStrokeColor:o,nodeBorderRadius:d,nodeClassName:a,nodeStrokeWidth:c,nodeComponent:h}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${je-U},${Ne-U}h${Re+U*2}v${Oe+U*2}h${-Re-U*2}z
202
+ M${Y.x},${Y.y}h${Y.width}v${Y.height}h${-Y.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Lg.displayName="MiniMap";const XN=I.memo(Lg),QN=e=>r=>e?`${Math.max(1/r.transform[2],1)}`:void 0,GN={[Yi.Line]:"right",[Yi.Handle]:"bottom-right"};function ZN({nodeId:e,position:r,variant:o=Yi.Handle,className:i,style:a=void 0,children:d,color:c,minWidth:h=10,minHeight:g=10,maxWidth:x=Number.MAX_VALUE,maxHeight:k=Number.MAX_VALUE,keepAspectRatio:b=!1,resizeDirection:S,autoScale:_=!0,shouldResize:j,onResizeStart:P,onResize:T,onResizeEnd:M}){const V=gg(),$=typeof e=="string"?e:V,O=Wt(),z=I.useRef(null),R=o===Yi.Handle,W=Ct(I.useCallback(QN(R&&_),[R,_]),Jt),Y=I.useRef(null),le=r??GN[o];I.useEffect(()=>{if(!(!z.current||!$))return Y.current||(Y.current=SS({domNode:z.current,nodeId:$,getStoreItems:()=>{const{nodeLookup:ie,transform:de,snapGrid:te,snapToGrid:F,nodeOrigin:ce,domNode:J}=O.getState();return{nodeLookup:ie,transform:de,snapGrid:te,snapToGrid:F,nodeOrigin:ce,paneDomNode:J}},onChange:(ie,de)=>{const{triggerNodeChanges:te,nodeLookup:F,parentLookup:ce,nodeOrigin:J}=O.getState(),ue=[],q={x:ie.x,y:ie.y},K=F.get($);if(K&&K.expandParent&&K.parentId){const Q=K.origin??J,L=ie.width??K.measured.width??0,U=ie.height??K.measured.height??0,je={id:K.id,parentId:K.parentId,rect:{width:L,height:U,...L0({x:ie.x??K.position.x,y:ie.y??K.position.y},{width:L,height:U},K.parentId,F,Q)}},Ne=gf([je],F,ce,J);ue.push(...Ne),q.x=ie.x?Math.max(Q[0]*L,ie.x):void 0,q.y=ie.y?Math.max(Q[1]*U,ie.y):void 0}if(q.x!==void 0&&q.y!==void 0){const Q={id:$,type:"position",position:{...q}};ue.push(Q)}if(ie.width!==void 0&&ie.height!==void 0){const L={id:$,type:"dimensions",resizing:!0,setAttributes:S?S==="horizontal"?"width":"height":!0,dimensions:{width:ie.width,height:ie.height}};ue.push(L)}for(const Q of de){const L={...Q,type:"position"};ue.push(L)}te(ue)},onEnd:({width:ie,height:de})=>{const te={id:$,type:"dimensions",resizing:!1,dimensions:{width:ie,height:de}};O.getState().triggerNodeChanges([te])}})),Y.current.update({controlPosition:le,boundaries:{minWidth:h,minHeight:g,maxWidth:x,maxHeight:k},keepAspectRatio:b,resizeDirection:S,onResizeStart:P,onResize:T,onResizeEnd:M,shouldResize:j}),()=>{var ie;(ie=Y.current)==null||ie.destroy()}},[le,h,g,x,k,b,P,T,M,j]);const we=le.split("-");return f.jsx("div",{className:fn(["react-flow__resize-control","nodrag",...we,o,i]),ref:z,style:{...a,scale:W,...c&&{[R?"backgroundColor":"borderColor"]:c}},children:d})}I.memo(ZN);const Hg={skipToContent:"Skip to content",langEs:"ES",langEn:"EN",language:"Language",errLoadOpenApi:"Could not load OpenAPI",errUrlTried:"Attempted URL:",loadingSpec:"Loading specification…",filterHintAll:"All endpoints (single client with every operation)",filterHintTag:"Tag «{tag}» (only operations in this group)",hideMainSidebar:"Hide sidebar",hideMainSidebarTitle:"Hide menu",mainNav:"Main navigation",navExplore:"Explore",navFlows:"Flows ({count})",navTests:"Tests ({count})",navHistory:"History",navSchemas:"Schemas",navAuth:"Auth",sectionsNav:"Sections",logout:"Log out",assistantLlmMenu:"Assistant: AI API…",exportAppState:"Export app state",importAppState:"Import app state",showMainSidebar:"Show full sidebar",showMainSidebarTitle:"Expand full panel",tryHistoryTitle:"Try history",expandPanelFull:"Expand endpoint list",assistantConfigureLlm:"Assistant: configure AI API",exportAppStateTitle:"Export app state (flows, tests, local spec…)",importAppStateTitle:"Import app state",logoutUserTitle:"Log out ({user})",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com",tagsHeading:"Tags",hideEndpointList:"Hide endpoint list",hideEndpointsTitle:"Hide endpoints",tagsAll:"All",deprecatedBadge:"dep",showEndpointList:"Show full endpoint list",showEndpointListTitle:"Expand endpoint list",opsCountTitle:"{count} operation(s) (current filter)",opsShortLabel:"ops",endpointsNumbered:"Numbered endpoints",openApiDocHeading:"OpenAPI document",sourceLabel:"Current source:",sourceLocal:"local copy (IndexedDB)",sourceRemote:"remote URL (?spec=…)",sourceServer:"server (openapi.json)",exportOpenApi:"Export OpenAPI",importOpenApi:"Import OpenAPI…",useServerSpec:"Use server spec",useSiteOpenapi:"Use site openapi.json",openApiImportHelp:"Import stores the JSON in your browser and replaces the server spec until you discard it. Export / import app state (flows, tests, environments and this spec if present) is in the sidebar menu.",playgroundEndpointsHeading:"Playground: endpoint builder",playgroundEndpointsHelp:"Add operations not present in the remote spec. They stay in IndexedDB and are included in Export app state (playgroundManualEndpoints) and Export OpenAPI (merged document).",method:"Method",path:"Path",summary:"Summary",summaryPlaceholder:"Optional",descriptionOptional:"Description (optional)",addEndpoint:"Add endpoint",remove:"Remove",noManualEndpoints:"No manual endpoints.",opHeading:"Service export filter:",exampleRequestBody:"Example request body",serviceExportFilter:"Service export filter:",snippetsByLang:"Snippets by language",save:"Save",cancel:"Cancel",copy:"Copy",generatedClientHeading:"Generated client / service",fileLanguage:"File language",copyService:"Copy service",addOpToFlowHint:"Add current operation to a flow (go to Flows)",selectOperationHint:"Select an operation from the list.",historyTabPanel:"History",schemasTabPanel:"Schemas",savedFlowsHeading:"Saved flows",noFlowsYet:"No flows yet. Create one in the editor and save.",nodesCount:"{count} node(s)",play:"Play",flowPlaySavedTooltip:"Run without loading the editor",edit:"Edit",delete:"Delete",flowEditorHeading:"Flow editor (nodes and edges)",newFlow:"New flow",editingFlow:"Editing saved flow (#{id})",flowEditorIntro:"Each node is a spec endpoint. Connect res → req and map the response to the next request. Click the edge or the label on the line: a full-screen modal opens outside the graph; when it opens, only the source node is called and you see destination fields (path, query, header, cookie, JSON body): in each row pick a JSON path from the response or a fixed value; OpenAPI-required fields are marked *. Classic mode (one variable and «variable» in the path) remains in the modal dropdown.",flowNamePlaceholder:"Flow name",playGraph:"Play (graph)",saveFlowChanges:"Save changes",saveFlow:"Save flow",flowRunPlaceholder:"Execution output appears here.",savedSuitesHeading:"Saved suites",runAllSuites:"Run all suites",noSuitesSaved:"No saved suites.",casesCount:"{count} case(s)",suiteEditorHeading:"Suite being edited",newSuite:"New suite",editingSuite:"Editing saved suite (#{id})",suiteNamePlaceholder:"Suite name",addEndpointFromSpec:"Add endpoint from spec",addToSuite:"Add to suite",expectedHttp:"Expected HTTP status",httpOther:"Other…",bodyContainsOptional:"Body contains (optional)",bodyContainsPh:'e.g. "ok"',jsonPathOptional:"JSON path (optional)",jsonPathPh:"$.data.id",expectedJsonPathValue:"Expected value at JSON path (optional)",expectedJsonPathPlaceholder:"Empty = only check existence",runAllCasesInSuite:"Run all cases (current suite)",saveSuiteChanges:"Save changes",saveSuite:"Save suite",authSchemesInSpec:"Schemes in spec:",none:"none",bearerToken:"Bearer token",bearerPlaceholder:"eyJ...",apiKeyHeader:"API key header",apiKey:"API key",rememberInBrowser:"Remember in this browser",footerCredit:"made with ♥ by andres arcila",llmModalTitle:"Assistant: AI provider",llmModalClose:"Close",llmKeyBrowserOnly:"Your key is stored only in this browser. The server forwards it to the provider; it is not stored on the server.",llmProvider:"Provider",llmModelOptional:"Model (optional)",llmApiKey:"API key",bundleImportInvalid:"Expected an app state export (formatVersion: 1).",playgroundInvalidMethod:"Invalid HTTP method.",playgroundPathRequired:"Enter a path.",playgroundOpExistsRemote:"That operation already exists in the remote OpenAPI.",playgroundOpDuplicate:"You already added that operation.",flowNeedNode:"Add at least one node to the flow.",newFlowName:"New flow",newSuiteName:"New suite",suiteDefaultName:"Suite 1",defaultFlowName:"My flow",flowStepLine:`Step {n}: {status}
203
+ {json}
204
+
205
+ `,testSuiteHeader:`━━━ {name} ({count} cases) ━━━
206
+ `,deprecatedLabel:"deprecated",exploreTryHeading:"Try",requestUrl:"Request URL",copyUrl:"Copy URL",pathUnresolvedHint:"The path still contains {…}: fill path parameters before running.",templates:"Presets",newTemplateName:"New preset name",newTemplatePlaceholder:"e.g. Staging · demo user",saveTemplate:"Save preset",load:"Load",deleteTemplate:"Delete",noTemplates:"No presets for this operation.",params:"Parameters",paramPathBadge:"Path",paramPathSub:"Replace {placeholders} in the path",paramQueryBadge:"Query",paramQuerySub:"Appended to the query string",paramHeaderBadge:"Headers",paramHeaderSub:"Parameters declared as header",paramCookieBadge:"Cookies",paramCookieSub:"Sent as Cookie header",body:"Body",multipartHint:"multipart/form-data — the browser sets the boundary (do not set Content-Type manually)",bodyFieldsMode:"Fields",bodyRawJson:"Raw JSON",bodyJsonObjectHint:"(JSON only — no object properties in spec)",execute:"Send",copyCurl:"Copy cURL",response:"Response",required:"required",optional:"optional",chooseOption:"— choose —",typeInSpecTitle:"Type in spec",paramDefault:"def.:",paramExample:"e.g.:",bodyValuePlaceholder:"value or JSON for nested objects",fileMultipart:"file · multipart",presetNameRequired:"Enter a name for the preset.",presetSaved:"Preset saved.",urlCopied:"URL copied.",urlCopyFailed:"Could not copy URL.",curlCopied:"cURL copied to clipboard.",clipboardDenied:"Could not copy (clipboard permission).",commandPaletteLabel:"Search operation",commandPalettePlaceholder:"Search by path, method, operationId or tag…",commandPaletteHints:"↑↓ navigate · Enter open · Esc close ·",noMatches:"No matches",tryHistoryPageTitle:"“Try” history",tryHistoryIntro:"Each run stores URL, headers, bodies and response in this browser. May include tokens or sensitive data. At most {max} entries are kept (oldest removed).",filterMethod:"Method",filterPathOrUrl:"Path or URL",refresh:"Refresh",clearHistory:"Clear history",clearHistoryConfirm:"Clear all call history? This cannot be undone.",copied:"Copied.",emptyHistory:"No calls yet. Use Explore → Try → Send.",noFilterMatch:"Nothing matches the filter.",loadInTry:"Load in Try",deleteHistoryEntry:"Delete history entry",baseUrlField:"Base URL (top field)",finalUrl:"Final URL",requestHeaders:"Request headers",copyJson:"Copy JSON",copyBody:"Copy body",requestBody:"Request body",networkError:"Network error:",responseHeaders:"Response headers",responseBody:"Response body",copyResponse:"Copy response",schemaNoComponents:"This spec does not define components.schemas.",schemasHeading:"Schemas",refSuffix:"→ ref",selectSchema:"Select a schema",schemaEmptyHint:"Reusable models from the spec appear here.",floatingAssistantTitle:"API assistant",floatingAssistantClear:"Clear",floatingAssistantClose:"Close assistant panel",floatingAssistantOpenSettings:"Open settings",floatingAssistantConfigureKey:"Configure your API key: “Assistant: AI API…” at the bottom of the menu, or the assistant icon.",floatingAssistantEmpty:"Ask about endpoints, flows or tests. Configure the provider with “Assistant: AI API…” in the menu.",roleUser:"You",roleAssistant:"Assistant",floatingAskPlaceholder:"Ask about the spec…",send:"Send",hideAssistant:"Hide assistant",showAssistant:"Open assistant",assistantFabTitle:"Assistant",flowAddNode:"+ Node (endpoint)",flowGraphHelp:"Connect output (res) to input (req) of another node. Click the edge or the label on the line to open a full-screen mapping modal. Click outside the box or press Escape to close.",flowEdgeModalTitle:"Edge: response → request",flowModalClose:"Close",flowModalCloseAria:"Close modal",flowEdgeNoRows:"This edge has no multi-field rows (spec without params/body or legacy flow). Use classic mode.",flowEdgeOrigin:"Source (called when opening the edge modal):",flowEdgeRefreshSample:"Refresh source sample",flowEdgeFetching:"Fetching…",flowEdgeDestination:"Target:",flowEdgeRowsHelp:"Each row is a destination request field. * = required in OpenAPI. Pick a value from the response (JSON path) or fixed.",slotPath:"Path",slotQuery:"Query",slotHeader:"Header",slotCookie:"Cookie",slotBody:"Body JSON",flowSampleOk:"Sample HTTP response {status}",flowSamplePartial:"HTTP {status} (not OK), parseable JSON",graphNotJson:"HTTP {status}: response is not JSON",paletteSearchOperations:"Search operation",navTechDoc:"Documentation",techDocHeroTitle:"Technical documentation",techDocHeroSubtitle:"Text view generated from the loaded OpenAPI. Use the language selector in the header for section labels.",techDocDownloadPdf:"Download PDF",techDocPdfHint:"Opens the browser print dialog: choose «Save as PDF» as the destination to export.",techDocOverview:"Overview",techDocServers:"Servers",techDocSecurity:"Security (global)",techDocContact:"Contact",techDocLicense:"License",techDocTerms:"Terms of service",techDocEndpoints:"Endpoints by tag",techDocTagSection:"Tag",techDocDeprecated:"Deprecated",techDocParameters:"Parameters",techDocRequestBody:"Request body",techDocResponses:"Responses",techDocNoDesc:"No description in the spec.",techDocColName:"Name",techDocColIn:"In",techDocColReq:"Req.",techDocColType:"Type / schema",techDocColDescr:"Description",techDocColCode:"Code",techDocFooterNote:"Auto-generated from OpenAPI ·"},Fg={skipToContent:"Saltar al contenido",langEs:"ES",langEn:"EN",language:"Idioma",errLoadOpenApi:"No se pudo cargar OpenAPI",errUrlTried:"URL intentada:",loadingSpec:"Cargando especificación…",filterHintAll:"Todos los endpoints (cliente único con todas las operaciones)",filterHintTag:"Tag «{tag}» (solo operaciones de este grupo)",hideMainSidebar:"Ocultar menú lateral",hideMainSidebarTitle:"Ocultar menú",mainNav:"Navegación principal",navExplore:"Explorar",navFlows:"Flujos ({count})",navTests:"Tests ({count})",navHistory:"Historial",navSchemas:"Esquemas",navAuth:"Auth",sectionsNav:"Secciones",logout:"Salir",assistantLlmMenu:"Asistente: API de IA…",exportAppState:"Exportar estado (app)",importAppState:"Importar estado (app)",showMainSidebar:"Mostrar menú lateral completo",showMainSidebarTitle:"Expandir panel completo",tryHistoryTitle:"Historial de Probar",expandPanelFull:"Expandir lista de endpoints",assistantConfigureLlm:"Asistente: configurar API de IA",exportAppStateTitle:"Exportar estado de la app (flujos, tests, spec local…)",importAppStateTitle:"Importar estado de la app",logoutUserTitle:"Salir ({user})",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.ejemplo.com",tagsHeading:"Tags",hideEndpointList:"Ocultar lista de endpoints",hideEndpointsTitle:"Ocultar endpoints",tagsAll:"Todos",deprecatedBadge:"dep",showEndpointList:"Mostrar lista de endpoints completa",showEndpointListTitle:"Expandir lista de endpoints",opsCountTitle:"{count} operación(es) (filtro actual)",opsShortLabel:"ops",endpointsNumbered:"Endpoints numerados",openApiDocHeading:"Documento OpenAPI",sourceLabel:"Fuente actual:",sourceLocal:"copia local (IndexedDB)",sourceRemote:"URL remota (?spec=…)",sourceServer:"servidor (openapi.json)",exportOpenApi:"Exportar OpenAPI",importOpenApi:"Importar OpenAPI…",useServerSpec:"Usar spec del servidor",useSiteOpenapi:"Usar openapi.json del sitio",openApiImportHelp:"Importar guarda el JSON en tu navegador y sustituye al spec del servidor hasta que lo descartes. Exportar / importar el estado de la app (flujos, tests, entornos y este spec si existe) está en el menú lateral.",playgroundEndpointsHeading:"Playground: creador de endpoints",playgroundEndpointsHelp:"Añade operaciones que no vienen en el spec remoto. Quedan en IndexedDB y se incluyen en Exportar estado de la app (campo playgroundManualEndpoints) y en Exportar OpenAPI (documento fusionado).",method:"Método",path:"Ruta",summary:"Resumen",summaryPlaceholder:"Opcional",descriptionOptional:"Descripción (opcional)",addEndpoint:"Añadir endpoint",remove:"Quitar",noManualEndpoints:"Ningún endpoint manual.",opHeading:"Filtro de exportación de servicio:",exampleRequestBody:"Ejemplo de cuerpo (request)",serviceExportFilter:"Filtro de exportación de servicio:",snippetsByLang:"Snippets por lenguaje",save:"Guardar",cancel:"Cancelar",copy:"Copiar",generatedClientHeading:"Cliente / servicio generado",fileLanguage:"Lenguaje del archivo",copyService:"Copiar servicio",addOpToFlowHint:"Añadir operación actual a un flujo (ve a Flujos)",selectOperationHint:"Selecciona una operación en la lista.",historyTabPanel:"Historial",schemasTabPanel:"Esquemas",savedFlowsHeading:"Flujos guardados",noFlowsYet:"Aún no hay flujos. Crea uno en el editor y guarda.",nodesCount:"{count} nodo(s)",play:"Play",flowPlaySavedTooltip:"Ejecutar sin cargar el editor",edit:"Editar",delete:"Eliminar",flowEditorHeading:"Editor de flujo (nodos y cables)",newFlow:"Nuevo flujo",editingFlow:"Editando flujo guardado (#{id})",flowEditorIntro:"Cada nodo es un endpoint del spec. Conecta res → req y mapea la respuesta al request siguiente. Pulsa el cable o la etiqueta sobre la línea: se abre un modal a pantalla completa fuera del grafo; al abrirlo se 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 «variable» en la ruta) sigue en el desplegable del modal.",flowNamePlaceholder:"Nombre del flujo",playGraph:"Play (grafo)",saveFlowChanges:"Guardar cambios",saveFlow:"Guardar flujo",flowRunPlaceholder:"Resultado de la ejecución aquí.",savedSuitesHeading:"Suites guardadas",runAllSuites:"Ejecutar todas las suites",noSuitesSaved:"Ninguna suite guardada.",casesCount:"{count} caso(s)",suiteEditorHeading:"Suite en edición",newSuite:"Nueva suite",editingSuite:"Editando suite guardada (#{id})",suiteNamePlaceholder:"Nombre de la suite",addEndpointFromSpec:"Añadir endpoint del spec",addToSuite:"Añadir a la suite",expectedHttp:"Código HTTP esperado",httpOther:"Otro…",bodyContainsOptional:"El body contiene (opcional)",bodyContainsPh:'ej. "ok"',jsonPathOptional:"JSON path (opcional)",jsonPathPh:"$.data.id",expectedJsonPathValue:"Valor esperado en JSON path (opcional)",expectedJsonPathPlaceholder:"Vacío = solo comprobar que existe",runAllCasesInSuite:"Correr todos los casos (suite actual)",saveSuiteChanges:"Guardar cambios",saveSuite:"Guardar suite",authSchemesInSpec:"Esquemas en el spec:",none:"ninguno",bearerToken:"Bearer token",bearerPlaceholder:"eyJ...",apiKeyHeader:"API key header",apiKey:"API key",rememberInBrowser:"Recordar en este navegador",footerCredit:"made with ♥ by andres arcila",llmModalTitle:"Asistente: proveedor de IA",llmModalClose:"Cerrar",llmKeyBrowserOnly:"Tu clave se guarda solo en este navegador. El servidor la reenvía al proveedor; no se almacena en el servidor.",llmProvider:"Proveedor",llmModelOptional:"Modelo (opcional)",llmApiKey:"API key",bundleImportInvalid:"Se esperaba un export de estado de la app (formatVersion: 1).",playgroundInvalidMethod:"Método HTTP no válido.",playgroundPathRequired:"Indica una ruta.",playgroundOpExistsRemote:"Esa operación ya existe en el OpenAPI remoto.",playgroundOpDuplicate:"Ya añadiste esa operación.",flowNeedNode:"Añade al menos un nodo al flujo.",newFlowName:"Nuevo flujo",newSuiteName:"Nueva suite",suiteDefaultName:"Suite 1",defaultFlowName:"Mi flujo",flowStepLine:`Paso {n}: {status}
207
+ {json}
208
+
209
+ `,testSuiteHeader:`━━━ {name} ({count} casos) ━━━
210
+ `,deprecatedLabel:"deprecated",exploreTryHeading:"Probar",requestUrl:"URL de la petición",copyUrl:"Copiar URL",pathUnresolvedHint:"La ruta aún contiene {…}: completa los parámetros de ruta antes de ejecutar.",templates:"Plantillas",newTemplateName:"Nombre nueva plantilla",newTemplatePlaceholder:"p. ej. Staging · usuario demo",saveTemplate:"Guardar plantilla",load:"Cargar",deleteTemplate:"Eliminar",noTemplates:"No hay plantillas para esta operación.",params:"Parámetros",paramPathBadge:"Ruta",paramPathSub:"Sustituyen {placeholders} en el path",paramQueryBadge:"Query",paramQuerySub:"Se añaden a la cadena de consulta",paramHeaderBadge:"Cabeceras",paramHeaderSub:"Parámetros declarados como header",paramCookieBadge:"Cookies",paramCookieSub:"Se envían como cabecera Cookie",body:"Cuerpo",multipartHint:"multipart/form-data — el boundary lo envía el navegador (no añadas Content-Type manual)",bodyFieldsMode:"Campos",bodyRawJson:"JSON raw",bodyJsonObjectHint:"(solo JSON — sin propiedades object en el spec)",execute:"Ejecutar",copyCurl:"Copiar cURL",response:"Respuesta",required:"obligatorio",optional:"opcional",chooseOption:"— elegir —",typeInSpecTitle:"Tipo en el spec",paramDefault:"def.:",paramExample:"ej.:",bodyValuePlaceholder:"valor o JSON para objetos anidados",fileMultipart:"archivo · multipart",presetNameRequired:"Escribe un nombre para la plantilla.",presetSaved:"Plantilla guardada.",urlCopied:"URL copiada.",urlCopyFailed:"No se pudo copiar la URL.",curlCopied:"cURL copiado al portapapeles.",clipboardDenied:"No se pudo copiar (permiso del portapapeles).",commandPaletteLabel:"Buscar operación",commandPalettePlaceholder:"Buscar por ruta, método, operationId o tag…",commandPaletteHints:"↑↓ navegar · Enter abrir · Esc cerrar ·",noMatches:"Sin coincidencias",tryHistoryPageTitle:"Historial de «Probar»",tryHistoryIntro:"Cada ejecución guarda URL, cabeceras, cuerpos y respuesta en este navegador. Puede incluir tokens u datos sensibles. Se conservan como máximo {max} entradas (las más antiguas se eliminan).",filterMethod:"Método",filterPathOrUrl:"Ruta o URL",refresh:"Actualizar",clearHistory:"Vaciar historial",clearHistoryConfirm:"¿Vaciar todo el historial de llamadas? No se puede deshacer.",copied:"Copiado.",emptyHistory:"Aún no hay llamadas. Usa Explorar → Probar → Ejecutar.",noFilterMatch:"Nada coincide con el filtro.",loadInTry:"Cargar en Probar",deleteHistoryEntry:"Eliminar entrada del historial",baseUrlField:"Base URL (campo superior)",finalUrl:"URL final",requestHeaders:"Request headers",copyJson:"Copiar JSON",copyBody:"Copiar body",requestBody:"Request body",networkError:"Error de red:",responseHeaders:"Response headers",responseBody:"Response body",copyResponse:"Copiar respuesta",schemaNoComponents:"Este spec no define components.schemas.",schemasHeading:"Esquemas",refSuffix:"→ ref",selectSchema:"Selecciona un esquema",schemaEmptyHint:"Los modelos reutilizables del spec aparecen aquí.",floatingAssistantTitle:"Asistente de la API",floatingAssistantClear:"Vaciar",floatingAssistantClose:"Cerrar panel del asistente",floatingAssistantOpenSettings:"Abrir configuración",floatingAssistantConfigureKey:"Configura tu API key: botón «Asistente: API de IA…» al pie del menú, o el icono del asistente.",floatingAssistantEmpty:"Pregunta por endpoints, flujos o tests. Configura el proveedor con «Asistente: API de IA…» en el menú.",roleUser:"Tú",roleAssistant:"Asistente",floatingAskPlaceholder:"Pregunta sobre el spec…",send:"Enviar",hideAssistant:"Ocultar asistente",showAssistant:"Abrir asistente",assistantFabTitle:"Asistente",flowAddNode:"+ Nodo (endpoint)",flowGraphHelp:"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.",flowEdgeModalTitle:"Cable: respuesta → request",flowModalClose:"Cerrar",flowModalCloseAria:"Cerrar modal",flowEdgeNoRows:"Este cable no tiene filas multi-campo (spec sin params/body o flujo antiguo). Usa el modo clásico.",flowEdgeOrigin:"Origen (se llama al abrir el modal del cable):",flowEdgeRefreshSample:"Actualizar muestra del origen",flowEdgeFetching:"Obteniendo…",flowEdgeDestination:"Destino:",flowEdgeRowsHelp:"Cada fila es un campo del request destino. * = obligatorio en el OpenAPI. Elige valor desde la respuesta (JSON path) o fijo.",slotPath:"Path",slotQuery:"Query",slotHeader:"Header",slotCookie:"Cookie",slotBody:"Body JSON",flowSampleOk:"Respuesta de muestra HTTP {status}",flowSamplePartial:"HTTP {status} (no OK), JSON analizable",graphNotJson:"HTTP {status}: la respuesta no es JSON",paletteSearchOperations:"Buscar operación",navTechDoc:"Documentación",techDocHeroTitle:"Documentación técnica",techDocHeroSubtitle:"Vista en texto generada a partir del OpenAPI cargado. Usa el idioma seleccionado en la barra superior para los rótulos de sección.",techDocDownloadPdf:"Descargar PDF",techDocPdfHint:"Se abre el cuadro de impresión del navegador: elige «Guardar como PDF» como destino para exportar.",techDocOverview:"Resumen",techDocServers:"Servidores",techDocSecurity:"Seguridad (global)",techDocContact:"Contacto",techDocLicense:"Licencia",techDocTerms:"Términos del servicio",techDocEndpoints:"Endpoints por etiqueta",techDocTagSection:"Etiqueta",techDocDeprecated:"Obsoleto",techDocParameters:"Parámetros",techDocRequestBody:"Cuerpo de la petición",techDocResponses:"Respuestas",techDocNoDesc:"Sin descripción en el spec.",techDocColName:"Nombre",techDocColIn:"En",techDocColReq:"Req.",techDocColType:"Tipo / esquema",techDocColDescr:"Descripción",techDocColCode:"Código",techDocFooterNote:"Generado automáticamente desde OpenAPI ·"},zg="api-doc-tor.locale";function e2(e){try{const r=new URLSearchParams(e).get("lang");if(r==="en"||r==="es")return r}catch{}return null}function Bg(){var o;if(typeof window>"u")return"es";const e=e2(window.location.search);if(e)return e;try{const i=localStorage.getItem(zg);if(i==="en"||i==="es")return i}catch{}return(((o=navigator.language)==null?void 0:o.toLowerCase())??"").startsWith("en")?"en":"es"}function t2(e){try{localStorage.setItem(zg,e)}catch{}}function n2(e){if(!(typeof window>"u"))try{const r=new URL(window.location.href);r.searchParams.set("lang",e),window.history.replaceState({},"",r.pathname+r.search+r.hash)}catch{}}function r2(e){return e==="en"?Hg:Fg}function o2(e,r){if(!r)return e;let o=e;for(const[i,a]of Object.entries(r))o=o.split(`{${i}}`).join(String(a));return o}const qg=I.createContext(null);function s2({children:e}){const[r,o]=I.useState(()=>Bg()),i=I.useCallback(h=>{o(h),t2(h),n2(h),typeof document<"u"&&(document.documentElement.lang=h==="en"?"en":"es")},[]);I.useEffect(()=>{document.documentElement.lang=r==="en"?"en":"es"},[r]);const a=I.useMemo(()=>r2(r),[r]),d=I.useCallback((h,g)=>o2(a[h],g),[a]),c=I.useMemo(()=>({locale:r,setLocale:i,t:d}),[r,i,d]);return f.jsx(qg.Provider,{value:c,children:e})}function Wo(){const e=I.useContext(qg);if(!e)throw new Error("useI18n must be used within I18nProvider");return e}const i2={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 Js({method:e,className:r="",size:o="sm"}){const i=e.toLowerCase().trim(),a=i2[i]??"bg-accent/15 text-accent border-accent/40",d=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 f.jsx("span",{className:`inline-flex items-center rounded-md font-semibold uppercase tracking-wide border shrink-0 transition-colors duration-200 ${a} ${d} ${r}`,children:e.toUpperCase()})}function Gd(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}`,d=o.get(a);return d?{...d}:{targetSlot:i.slot,targetKey:i.key,mode:"from_response",sourceJsonPath:"$",literal:""}})}function a2(e){return e!=null&&e.length?e.length===1?e[0].targetKey||"→":`${e.length} campos`:"v"}function l2(e,r){return e==="en"?`HTTP ${r}: response is not JSON`:`HTTP ${r}: la respuesta no es JSON`}async function Pm(e,r,o,i,a,d="es"){const c=to(e,r),h=a.replace(/\{[^{}]+\}/g,"1"),g=`${c}${h}`,x=i.toLowerCase(),k={method:x.toUpperCase(),headers:{...o()},credentials:Ra(g)};x!=="get"&&x!=="head"&&(k.body="{}");try{const b=await fetch(g,k),S=await b.text();let _;try{_=S?JSON.parse(S):null}catch{return{ok:!1,error:l2(d,b.status)}}return{ok:!0,json:_,httpStatus:b.status,httpOk:b.ok}}catch(b){return{ok:!1,error:b instanceof Error?b.message:String(b)}}}function Tm(e,r){const a=new Set;function d(c,h,g){if(a.size>=200||(a.add(h),g>=6||c===null||typeof c!="object"))return;if(Array.isArray(c)){const k=`${h}[0]`;a.add(k),c.length>0&&d(c[0],k,g+1);return}const x=c;for(const k of Object.keys(x))d(x[k],`${h}.${k}`,g+1)}return d(e,"$",0),[...a].sort((c,h)=>c.length-h.length||c.localeCompare(h))}function Ju(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 u2(e,r){return"$ref"in r?Ju(e,r.$ref):r}function Wa(e,r){return"$ref"in r?Ju(e,r.$ref):r}function c2(e,r){const o=r.schema;if(!o){const x=r.example;return{...x!=null?{exampleHint:String(x)}:{}}}const i=Wa(e,o);if(!i){const x=r.example;return{...x!=null?{exampleHint:String(x)}:{}}}const a=Array.isArray(i.enum)?i.enum.map(x=>String(x)):void 0,d=i.default,c=d!=null?String(d):void 0,h=r.example!==void 0?r.example:i.example,g=h!=null?String(h):void 0;return{schemaType:typeof i.type=="string"?i.type:void 0,format:typeof i.format=="string"?i.format:void 0,enumOptions:a,defaultLabel:c,exampleHint:g}}function vf(e,r,o){var x;const i=(x=e.paths)==null?void 0:x[o],a=i==null?void 0:i[r.toLowerCase()];if(!a)return[];const d=(i==null?void 0:i.parameters)??[],c=a.parameters??[],h=new Set,g=[];for(const k of[...d,...c]){const b=u2(e,k);if(!b||!["query","path","header","cookie"].includes(b.in))continue;const S=`${b.in}:${b.name}`;h.has(S)||(h.add(S),g.push({name:b.name,in:b.in,required:!!b.required,description:typeof b.description=="string"?b.description:void 0,...c2(e,b)}))}return g}function Da(e,r,o){var g,x,k,b;const i=(x=(g=e.paths)==null?void 0:g[o])==null?void 0:x[r.toLowerCase()];if(!(i!=null&&i.requestBody))return null;const a=i.requestBody,d="$ref"in a?Ju(e,a.$ref):a;if(!((b=(k=d==null?void 0:d.content)==null?void 0:k["application/json"])!=null&&b.schema))return null;const c=d.content["application/json"].schema,h=Wa(e,c);if(!h)return null;if(h.type==="object"&&h.properties&&Object.keys(h.properties).length>0){const S=new Set(h.required??[]);return Object.keys(h.properties).map(_=>{const j=h.properties[_],P=j&&"$ref"in j?Wa(e,j):j;return Ug(_,S.has(_),P,!1)})}return null}function Ug(e,r,o,i){const a=o&&Array.isArray(o.enum)?o.enum.map(x=>String(x)):void 0,d=o==null?void 0:o.default,c=d!=null?String(d):void 0,h=o==null?void 0:o.example,g=h!=null?String(h):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:c,exampleHint:g}}function wu(e,r,o){var g,x,k,b;const i=(x=(g=e.paths)==null?void 0:g[o])==null?void 0:x[r.toLowerCase()];if(!(i!=null&&i.requestBody))return null;const a=i.requestBody,d="$ref"in a?Ju(e,a.$ref):a;if(!((b=(k=d==null?void 0:d.content)==null?void 0:k["multipart/form-data"])!=null&&b.schema))return null;const c=d.content["multipart/form-data"].schema,h=Wa(e,c);if(!h)return null;if(h.type==="object"&&h.properties&&Object.keys(h.properties).length>0){const S=new Set(h.required??[]);return Object.keys(h.properties).map(_=>{const j=h.properties[_],P=j&&"$ref"in j?Wa(e,j):j,T=(P==null?void 0:P.type)==="string"&&(P==null?void 0:P.format)==="binary";return Ug(_,S.has(_),P,T)})}return null}function d2(e,r,o){const i=new FormData;for(const a of e)if(a.isFile){const d=o[a.key];d&&i.append(a.key,d,d.name)}else{const d=r[a.key]??"";if(d.trim()==="")continue;i.append(a.key,d)}return i}function f2(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Vg(e,r){let o=e;for(const[i,a]of Object.entries(r))o=o.replace(new RegExp(`\\{${f2(i)}\\}`,"g"),encodeURIComponent(a));return o}function Kg(e,r){const o=new URLSearchParams;for(const a of r){if(a.in!=="query")continue;const d=e[a.name];d!==void 0&&d!==""&&o.set(a.name,d)}const i=o.toString();return i?`?${i}`:""}function Wg(e,r){var i;if(!(e!=null&&e.length))return{};const o={};for(const a of e){const d=((i=r[a.key])==null?void 0:i.trim())??"";if(d==="")continue;const c=a.type;if(c==="integer"||c==="number"){const h=Number(d);o[a.key]=Number.isFinite(h)?h:d}else if(c==="boolean")o[a.key]=d==="true"||d==="1";else try{o[a.key]=JSON.parse(d)}catch{o[a.key]=d}}return o}function $m(e,r){const o=Wg(e,r);return JSON.stringify(o,null,2)}function p2(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 d=o[a.key];i[a.key]=typeof d=="string"?d:JSON.stringify(d)}else i[a.key]="";return i}catch{return Object.fromEntries(e.map(o=>[o.key,""]))}}function Yg(e){return/\{[^/}]+\}/.test(e)}function h2(e){const r=[],o=/\{([^}]+)\}/g;let i;for(;(i=o.exec(e))!==null;)r.push(i[1]);return r}const Mm={path:0,query:1,header:2,cookie:3,body:4};function Jg(e,r,o){const i=new Map,a=vf(e,r,o);for(const c of a){const h=c.in==="path"?"path":c.in==="query"?"query":c.in==="header"?"header":"cookie",g=`${h}:${c.name}`;i.set(g,{slot:h,key:c.name,required:c.required,description:c.description})}for(const c of h2(o)){const h=`path:${c}`;i.has(h)||i.set(h,{slot:"path",key:c,required:!0})}const d=Da(e,r,o);if(d)for(const c of d)i.set(`body:${c.key}`,{slot:"body",key:c.key,required:c.required,description:c.description});return[...i.values()].sort((c,h)=>Mm[c.slot]-Mm[h.slot]||c.key.localeCompare(h.key))}function m2(e,r){return e.find(o=>o.slot===r.targetSlot&&o.key===r.targetKey)}function g2(e){return e.mode==="literal"?!!e.literal&&e.literal.trim()!=="":!!e.sourceJsonPath&&e.sourceJsonPath.trim()!==""}function y2({doc:e,edgeId:r,mapping:o,sourceData:i,targetData:a,baseUrl:d,buildHeaders:c,onPatchMapping:h,onReplaceBindings:g}){const{t:x,locale:k}=Wo(),b=Y=>({path:x("slotPath"),query:x("slotQuery"),header:x("slotHeader"),cookie:x("slotCookie"),body:x("slotBody")})[Y],[S,_]=I.useState(!1),[j,P]=I.useState([]),[T,M]=I.useState(null),V=I.useRef(c);V.current=c;const $=I.useMemo(()=>a?Jg(e,a.method,a.path):[],[e,a]),O=I.useMemo(()=>Gd(o.bindings,$),[o.bindings,$]),z=a?`${a.method} ${a.path}`:"";I.useEffect(()=>{if(!a||$.length===0)return;const Y=Gd(o.bindings,$);JSON.stringify(Y)!==JSON.stringify(o.bindings??[])&&g(Y)},[r,z]),I.useEffect(()=>{if(!i){P([]),M(null),_(!1);return}let Y=!1;return _(!0),P([]),M(null),Pm(e,d,()=>V.current(),i.method,i.path,k).then(le=>{if(!Y){if(_(!1),!le.ok){M(le.error);return}P(Tm(le.json)),M(le.httpOk?x("flowSampleOk",{status:le.httpStatus}):x("flowSamplePartial",{status:le.httpStatus}))}}),()=>{Y=!0}},[e,d,i==null?void 0:i.method,i==null?void 0:i.path,r,k,x]);const R=(Y,le,we)=>{const ie=O.map(de=>de.targetSlot===Y&&de.targetKey===le?{...de,...we}:de);g(ie)},W=()=>{i&&(_(!0),P([]),M(null),Pm(e,d,()=>V.current(),i.method,i.path,k).then(Y=>{if(_(!1),!Y.ok){M(Y.error);return}P(Tm(Y.json)),M(Y.httpOk?x("flowSampleOk",{status:Y.httpStatus}):x("flowSamplePartial",{status:Y.httpStatus}))}))};return O.length===0?f.jsxs("div",{className:"space-y-3 text-xs",children:[f.jsx("p",{className:"text-slate-500",children:x("flowEdgeNoRows")}),f.jsx(Am,{mapping:o,onPatchMapping:h})]}):f.jsxs("div",{className:"space-y-4 text-xs",children:[i?f.jsxs("div",{className:"rounded-lg border border-surface-700/90 bg-surface-950/50 p-3 space-y-2",children:[f.jsxs("p",{className:"text-[11px] text-slate-400",children:[f.jsx("span",{className:"text-slate-600",children:x("flowEdgeOrigin")})," ",f.jsxs("span",{className:"font-mono text-slate-200",children:[i.method.toUpperCase()," ",i.path]})]}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx("button",{type:"button",disabled:S,onClick:()=>W(),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:x(S?"flowEdgeFetching":"flowEdgeRefreshSample")}),T?f.jsx("span",{className:"text-[11px] text-slate-400",children:T}):null]})]}):null,a?f.jsxs("p",{className:"text-[11px] text-slate-500",children:[f.jsx("span",{className:"text-slate-600",children:x("flowEdgeDestination")})," ",f.jsxs("span",{className:"font-mono text-slate-300",children:[a.method.toUpperCase()," ",a.path]})]}):null,f.jsx("p",{className:"text-[11px] text-slate-500",children:x("flowEdgeRowsHelp")}),f.jsx("ul",{className:"space-y-3",children:O.map(Y=>{const le=m2($,Y),we=(le==null?void 0:le.required)??!1,ie=!we||g2(Y);return f.jsxs("li",{className:`rounded-lg border p-3 space-y-2 ${ie?"border-surface-700 bg-surface-900/40":"border-rose-700/60 bg-rose-950/20"}`,children:[f.jsxs("div",{className:"flex flex-wrap items-baseline gap-2",children:[f.jsx("span",{className:"rounded bg-surface-800 px-1.5 py-0.5 text-[10px] font-semibold text-accent",children:b(Y.targetSlot)}),f.jsx("span",{className:"font-mono text-[12px] text-slate-200",children:Y.targetKey}),we?f.jsx("span",{className:"text-rose-400",children:"*"}):null,le!=null&&le.description?f.jsx("span",{className:"text-[10px] text-slate-500 truncate max-w-full",children:le.description}):null]}),f.jsxs("label",{className:"block text-slate-500",children:["Origen del valor",f.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:Y.mode,onChange:de=>R(Y.targetSlot,Y.targetKey,{mode:de.target.value}),children:[f.jsx("option",{value:"from_response",children:"Desde JSON de la respuesta"}),f.jsx("option",{value:"literal",children:"Valor fijo"})]})]}),Y.mode==="from_response"?f.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[j.length>0?f.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Campos detectados en la respuesta",f.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:j.includes(Y.sourceJsonPath)?Y.sourceJsonPath:"",onChange:de=>{const te=de.target.value;te&&R(Y.targetSlot,Y.targetKey,{sourceJsonPath:te})},children:[f.jsx("option",{value:"",children:"— Escribir JSON path manual —"}),j.map(de=>f.jsx("option",{value:de,children:de},de))]})]}):null,f.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["JSON path",f.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-2 font-mono text-[11px]",value:Y.sourceJsonPath,onChange:de=>R(Y.targetSlot,Y.targetKey,{sourceJsonPath:de.target.value}),placeholder:"$.id"})]})]}):f.jsxs("label",{className:"block text-slate-500",children:["Valor fijo",f.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-2 font-mono text-[11px]",value:Y.literal??"",onChange:de=>R(Y.targetSlot,Y.targetKey,{literal:de.target.value}),placeholder:'texto o {"a":1}'})]})]},`${Y.targetSlot}:${Y.targetKey}`)})}),f.jsxs("details",{className:"rounded-lg border border-surface-700/80 bg-surface-950/30 p-2",children:[f.jsx("summary",{className:"cursor-pointer text-[11px] text-slate-400 select-none",children:"Modo clásico (una variable + JSON path)"}),f.jsx("div",{className:"mt-2 pt-2 border-t border-surface-700/60",children:f.jsx(Am,{mapping:o,onPatchMapping:h})})]})]})}function Am({mapping:e,onPatchMapping:r}){return f.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[f.jsxs("label",{className:"text-slate-500",children:["JSON path",f.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})})]}),f.jsxs("label",{className:"text-slate-500",children:["Variable",f.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})})]}),f.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Uso en destino",f.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:[f.jsx("option",{value:"vars_only",children:"{variable} en la ruta"}),f.jsx("option",{value:"path_param",children:"Path param"}),f.jsx("option",{value:"header",children:"Header"}),f.jsx("option",{value:"query",children:"Query"})]})]}),(e.useInTarget==="path_param"||e.useInTarget==="header"||e.useInTarget==="query")&&f.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Clave",f.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 Xg=I.createContext(null);function x2(){return I.useContext(Xg)}const Fi=()=>({sourceJsonPath:"$",variableName:"v",useInTarget:"vars_only",targetKey:""});function v2(e){var Y;const{id:r,sourceX:o,sourceY:i,targetX:a,targetY:d,sourcePosition:c,targetPosition:h,data:g,selected:x,style:k,markerStart:b,markerEnd:S,interactionWidth:_}=e,j=g,P=x2(),[T,M,V]=df({sourceX:o,sourceY:i,sourcePosition:c,targetX:a,targetY:d,targetPosition:h}),$=(j==null?void 0:j.mapping)??Fi(),O=(Y=$.bindings)!=null&&Y.length?a2($.bindings):$.variableName||"→",z=(P==null?void 0:P.selectedEdgeId)===r,R=x||z,W={stroke:R?"rgb(56 189 248 / 0.95)":"rgb(148 163 184 / 0.9)",strokeWidth:R?2.5:2};return P?f.jsxs(f.Fragment,{children:[f.jsx(Xi,{id:r,path:T,markerStart:b,markerEnd:S,interactionWidth:_,style:{...W,...k}}),f.jsx(SN,{children:f.jsx("div",{style:{position:"absolute",transform:`translate(-50%, -100%) translate(${M}px,${V}px)`,pointerEvents:"all",marginTop:-6},className:"nodrag nopan",children:f.jsx("button",{type:"button",onClick:le=>{le.stopPropagation(),P.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:O})})})]}):f.jsx(Xi,{id:r,path:T,markerStart:b,markerEnd:S,interactionWidth:_,style:{...W,...k}})}function wf(e,r,o){var d,c;const i=r.toLowerCase(),a=(c=(d=e.paths)==null?void 0:d[o])==null?void 0:c[i];return(a==null?void 0:a.summary)??(a==null?void 0:a.operationId)??`${r.toUpperCase()} ${o}`}function bf(e,r,o){var h,g,x,k;const i=r.toLowerCase(),a=(g=(h=e.paths)==null?void 0:h[o])==null?void 0:g[i];if(!(a!=null&&a.requestBody))return"— sin body";const c=(k=(x=a.requestBody.content)==null?void 0:x["application/json"])==null?void 0:k.schema;return c&&"$ref"in c?`body: ${c.$ref}`:"body: JSON"}function Sf(e,r,o){var h,g,x,k,b,S;const i=r.toLowerCase(),a=(g=(h=e.paths)==null?void 0:h[o])==null?void 0:g[i],d=((x=a==null?void 0:a.responses)==null?void 0:x["200"])??((k=a==null?void 0:a.responses)==null?void 0:k["201"]);if(!d)return"—";const c=typeof d=="object"&&d&&"content"in d?(S=(b=d.content)==null?void 0:b["application/json"])==null?void 0:S.schema:void 0;return c&&"$ref"in c?String(c.$ref):"JSON"}function Td(e,r){return`${e.toLowerCase()} ${r}`}function w2(e){const r=e.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:e.slice(0,r),path:e.slice(r+1)}}const Qg=I.createContext(null);function b2(e){const{id:r,selected:o}=e,i=e.data,a=I.useContext(Qg),d=kN();return I.useEffect(()=>{d(r)},[i.path,i.method,r,d]),f.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:[f.jsx(Ji,{type:"target",position:rt.Left,id:"in",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-teal-500"}),f.jsxs("div",{className:"flex items-center gap-2 mb-1 min-w-0",children:[f.jsx(Js,{method:i.method}),f.jsx("span",{className:"text-[10px] text-slate-500 truncate",title:i.summary,children:i.summary})]}),a?f.jsxs("label",{className:"block text-[10px] text-slate-500 mb-1",children:["Endpoint",f.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:Td(i.method,i.path),onChange:c=>{const{method:h,path:g}=w2(c.target.value);a.updateNodeData(r,{method:h,path:g,summary:wf(a.doc,h,g),reqHint:bf(a.doc,h,g),resHint:Sf(a.doc,h,g)})},children:a.ops.map(c=>f.jsxs("option",{value:Td(c.method,c.path),children:[c.method.toUpperCase()," ",c.path]},Td(c.method,c.path)))})]}):f.jsx("p",{className:"font-mono text-[11px] text-slate-300 truncate",children:i.path}),f.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-1 text-[9px] text-slate-500 leading-tight",children:[f.jsxs("div",{children:[f.jsx("span",{className:"text-slate-600",children:"req"})," ",i.reqHint]}),f.jsxs("div",{children:[f.jsx("span",{className:"text-slate-600",children:"res"})," ",i.resHint]})]}),f.jsx(Ji,{type:"source",position:rt.Right,id:"out",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-amber-500"})]})}const S2={apiOp:b2},k2={binding:v2};function N2(e,r){const o=Fi();if(!r)return o;const{method:i,path:a}=r.data,d=Jg(e,i,a);return d.length===0?o:{...o,bindings:Gd(void 0,d)}}function _2(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:wf(e,a.method,a.path),reqHint:bf(e,a.method,a.path),resHint:Sf(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 j2(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)??Fi()}})}}function C2({doc:e,ops:r,graph:o,onGraphChange:i,baseUrl:a,buildHeaders:d}){var de;const{t:c}=Wo(),h=I.useMemo(()=>_2(e,o),[e,o]),[g,x,k]=NN(h.nodes),[b,S,_]=_N(h.edges),[j,P]=I.useState(null);I.useEffect(()=>{i(j2(g,b))},[g,b,i]);const T=I.useCallback((te,F)=>{x(ce=>ce.map(J=>J.id===te?{...J,data:{...J.data,...F}}:J))},[x]),M=I.useMemo(()=>({doc:e,ops:r,updateNodeData:T}),[e,r,T]),V=I.useCallback(te=>{te.sourceHandle!=="out"||te.targetHandle!=="in"||S(F=>{const ce=g.find(ue=>ue.id===te.target),J=N2(e,ce);return U0({...te,type:"binding",id:`e-${te.source}-${te.target}-${crypto.randomUUID().slice(0,8)}`,sourceHandle:"out",targetHandle:"in",data:{mapping:J}},F)})},[S,g,e]),$=I.useCallback((te,F)=>{S(ce=>ce.map(J=>{var q;if(J.id!==te)return J;const ue={...((q=J.data)==null?void 0:q.mapping)??Fi(),...F};return{...J,data:{mapping:ue}}}))},[S]),O=I.useCallback((te,F)=>{S(ce=>ce.map(J=>{var K;if(J.id!==te)return J;const q={...((K=J.data)==null?void 0:K.mapping)??Fi(),bindings:F};return{...J,data:{mapping:q}}}))},[S]),z=I.useMemo(()=>({selectedEdgeId:j,setSelectedEdgeId:P}),[j,P]),R=b.find(te=>te.id===j),W=R?g.find(te=>te.id===R.source):void 0,Y=R?g.find(te=>te.id===R.target):void 0,le=W==null?void 0:W.data,we=Y==null?void 0:Y.data;I.useEffect(()=>{j&&!b.some(te=>te.id===j)&&P(null)},[b,j]),I.useEffect(()=>{if(!j)return;const te=F=>{F.key==="Escape"&&P(null)};return window.addEventListener("keydown",te),()=>window.removeEventListener("keydown",te)},[j]),I.useEffect(()=>{if(!j)return;const te=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=te}},[j]);const ie=()=>{const te=g.reduce((K,Q)=>Q.position.x>K?Q.position.x:K,0),F=r[0];if(!F)return;const ce=crypto.randomUUID(),J=te>0?te+40:80,q={id:ce,type:"apiOp",position:{x:J,y:120},data:{method:F.method.toLowerCase(),path:F.path,summary:wf(e,F.method,F.path),reqHint:bf(e,F.method,F.path),resHint:Sf(e,F.method,F.path)}};x(K=>[...K,q])};return f.jsx(Qg.Provider,{value:M,children:f.jsx(Xg.Provider,{value:z,children:f.jsxs("div",{className:"space-y-3",children:[f.jsx("div",{className:"h-[min(520px,70vh)] w-full rounded-xl border border-surface-700 bg-surface-950",children:f.jsxs(wN,{nodes:g,edges:b,onNodesChange:k,onEdgesChange:_,onConnect:V,nodeTypes:S2,edgeTypes:k2,onEdgeClick:(te,F)=>P(F.id),onPaneClick:()=>P(null),fitView:!0,minZoom:.4,maxZoom:1.5,proOptions:{hideAttribution:!0},isValidConnection:te=>te.sourceHandle==="out"&&te.targetHandle==="in",children:[f.jsx(TN,{variant:Uo.Dots,gap:16,size:1,color:"rgb(51 65 85 / 0.5)"}),f.jsx(RN,{className:"!bg-surface-900 !border-surface-600 !shadow-lg"}),f.jsx(XN,{className:"!bg-surface-900/95 !border-surface-600",nodeColor:()=>"rgb(45 212 191 / 0.5)"}),f.jsx(tl,{position:"top-left",children:f.jsx("button",{type:"button",onClick:ie,className:"text-xs px-3 py-2 rounded-lg bg-accent/90 text-surface-950 font-medium shadow",children:c("flowAddNode")})})]})}),f.jsx("p",{className:"text-xs text-slate-500 px-0.5",children:c("flowGraphHelp")}),typeof document<"u"&&j&&R&&og.createPortal(f.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:()=>P(null),children:f.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:te=>te.stopPropagation(),children:[f.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-surface-700 px-4 py-3",children:[f.jsx("h2",{id:"flow-edge-modal-title",className:"text-sm font-semibold text-slate-100",children:c("flowEdgeModalTitle")}),f.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:()=>P(null),"aria-label":c("flowModalCloseAria"),children:c("flowModalClose")})]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto overflow-x-hidden p-4",children:f.jsx(y2,{doc:e,edgeId:R.id,mapping:((de=R.data)==null?void 0:de.mapping)??Fi(),sourceData:le,targetData:we,baseUrl:a,buildHeaders:d,onPatchMapping:te=>$(R.id,te),onReplaceBindings:te=>O(R.id,te)})})]})}),document.body)]})})})}function Gg(e,r){const o=new Map(e.map(g=>[g.id,g])),i=new Set(e.map(g=>g.id)),a=new Map,d=new Map;for(const g of i)a.set(g,0),d.set(g,[]);for(const g of r)!i.has(g.source)||!i.has(g.target)||(a.set(g.target,(a.get(g.target)??0)+1),d.get(g.source).push(g.target));const c=[];for(const[g,x]of a)x===0&&c.push(g);c.sort((g,x)=>o.get(g).x-o.get(x).x||o.get(g).y-o.get(x).y);const h=[];for(;c.length;){const g=c.shift();h.push(g);for(const x of d.get(g)??[]){const k=(a.get(x)??0)-1;a.set(x,k),k===0&&(c.push(x),c.sort((b,S)=>o.get(b).x-o.get(S).x||o.get(b).y-o.get(S).y))}}if(h.length<e.length){const g=e.filter(x=>!h.includes(x.id)).sort((x,k)=>x.x-k.x||x.y-k.y);return[...h.map(x=>o.get(x)),...g]}return h.map(g=>o.get(g))}function E2(e,r){if(r.mode==="literal")return r.literal===void 0||r.literal.trim()===""?void 0:r.literal;const o=(r.sourceJsonPath??"$").trim()||"$",i=Lu(e,o);if(i!=null)return typeof i=="object"?JSON.stringify(i):String(i)}function P2(e,r,o,i,a,d){switch(i){case"path":e.value=e.value.split(`{${a}}`).join(encodeURIComponent(d));break;case"query":{const c=e.value.includes("?")?"&":"?";e.value=`${e.value}${c}${encodeURIComponent(a)}=${encodeURIComponent(d)}`;break}case"header":{r[a]=a.toLowerCase()==="authorization"&&!d.startsWith("Bearer ")?`Bearer ${d}`:d;break}case"cookie":{const c=`${a}=${d}`;r.Cookie=r.Cookie?`${r.Cookie}; ${c}`:c;break}case"body":{let c=d;try{c=JSON.parse(d)}catch{c=d}o[a]=c;break}}}function T2(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 Im(e,r,o){var x;const{nodes:i,edges:a}=e;if(i.length===0)return"Sin nodos en el flujo.";const d=Gg(i,a),c={},h={};let g="";for(let k=0;k<d.length;k++){const b=d[k],S={value:b.path},_={...o()},j={},P=a.filter(W=>W.target===b.id);for(const W of P){const Y=W.mapping,le=h[W.source];if(Y.bindings&&Y.bindings.length>0)for(const we of Y.bindings){const ie=E2(le,we);ie!==void 0&&P2(S,_,j,we.targetSlot,we.targetKey,ie)}else{const we=c[Y.variableName];T2(S,_,Y,we)}}for(const[W,Y]of Object.entries(c))S.value=S.value.split(`{${W}}`).join(Y);const T=`${r.replace(/\/$/,"")}${S.value}`,M={method:b.method.toUpperCase(),headers:_},V=b.method.toLowerCase();V!=="get"&&V!=="head"&&(M.body=Object.keys(j).length>0?JSON.stringify(j):"{}");const $=await fetch(T,{...M,credentials:Ra(T)});let O={};const z=await $.text();try{O=z?JSON.parse(z):{}}catch{O={_raw:z}}h[b.id]=O,g+=`▸ ${b.method.toUpperCase()} ${b.path} → ${$.status}
211
+ ${JSON.stringify(O,null,2)}
212
+
213
+ `;const R=a.filter(W=>W.source===b.id);for(const W of R){const Y=W.mapping;if(Y.bindings&&Y.bindings.length>0)continue;const le=((x=Y.sourceJsonPath)==null?void 0:x.trim())||"$",we=Lu(O,le);we!=null&&(c[Y.variableName]=typeof we=="object"?JSON.stringify(we):String(we))}}return g+=`
214
+ Variables finales: ${JSON.stringify(c,null,2)}`,g}function $2(e){const r=Gg(e.nodes,e.edges);return r.map((o,i)=>{const a=r[i+1];if(!a)return{method:o.method,path:o.path};const d=e.edges.find(h=>h.source===o.id&&h.target===a.id);if(!d)return{method:o.method,path:o.path};const c=d.mapping;if(c.bindings&&c.bindings.length>0){const h=c.bindings.find(g=>g.mode==="from_response")??c.bindings[0];return{method:o.method,path:o.path,extract:{varName:h.targetKey||"v",jsonPath:h.sourceJsonPath||"$"}}}return{method:o.method,path:o.path,extract:{varName:c.variableName,jsonPath:c.sourceJsonPath||"$"}}})}function M2(e){var i;const r=e.map((a,d)=>({id:`n-${d}`,method:a.method,path:a.path,x:40+d*300,y:120})),o=[];for(let a=0;a<e.length-1;a++){const d=(i=e[a])==null?void 0:i.extract;d!=null&&d.jsonPath&&o.push({id:`e-${a}`,source:`n-${a}`,target:`n-${a+1}`,mapping:{sourceJsonPath:d.jsonPath,variableName:d.varName,useInTarget:"vars_only",targetKey:""}})}return{nodes:r,edges:o}}const Zg=I.createContext({productName:null,logoDataUrl:null});function A2({value:e,children:r}){return f.jsx(Zg.Provider,{value:e,children:r})}function I2(){return I.useContext(Zg)}const ey=[{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"}],O2=ey;function D2(e){return e==="en"?O2:ey}function R2({data:e,defaultOpenDepth:r=3}){return f.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:f.jsx(kf,{value:e,depth:0,defaultOpenDepth:r})})}function kf({value:e,depth:r,defaultOpenDepth:o,name:i}){return e===null||typeof e!="object"?f.jsx(L2,{name:i,value:e}):Array.isArray(e)?f.jsx(H2,{name:i,value:e,depth:r,defaultOpenDepth:o}):f.jsx(F2,{name:i,value:e,depth:r,defaultOpenDepth:o})}function L2({name:e,value:r}){return f.jsxs("div",{className:"pl-1 break-all",children:[e!=null&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(e)}),f.jsx("span",{className:"text-slate-500",children:": "})]}),f.jsx("span",{className:"text-emerald-200/95",children:JSON.stringify(r)})]})}function H2({name:e,value:r,depth:o,defaultOpenDepth:i}){const a=o<i,[d,c]=I.useState(a);return r.length===0?f.jsxs("div",{className:"pl-1",children:[e!=null&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(e)}),f.jsx("span",{className:"text-slate-500",children:": "})]}),f.jsx("span",{className:"text-slate-500",children:"[]"})]}):f.jsxs("div",{className:"pl-1",children:[e!=null&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(e)}),f.jsx("span",{className:"text-slate-500",children:": "})]}),f.jsx("button",{type:"button","aria-expanded":d,onClick:()=>c(!d),className:"inline align-middle text-slate-400 hover:text-slate-200 mr-1 select-none w-4",children:d?"▼":"▶"}),f.jsx("span",{className:"text-slate-500",children:"["}),f.jsx("span",{className:"text-slate-600 text-[10px] ml-1",children:r.length}),d&&f.jsx("ul",{className:"list-none my-0.5 ml-4 border-l border-surface-600 pl-2 space-y-0.5",children:r.map((h,g)=>f.jsxs("li",{children:[f.jsx("span",{className:"text-violet-400/90 mr-1",children:g}),f.jsx(kf,{value:h,depth:o+1,defaultOpenDepth:i})]},g))}),!d&&f.jsx("span",{className:"text-slate-600",children:" … "}),f.jsx("span",{className:"text-slate-500",children:"]"})]})}function F2({name:e,value:r,depth:o,defaultOpenDepth:i}){const a=Object.keys(r),d=o<i,[c,h]=I.useState(d);return a.length===0?f.jsxs("div",{className:"pl-1",children:[e!=null&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(e)}),f.jsx("span",{className:"text-slate-500",children:": "})]}),f.jsx("span",{className:"text-slate-500",children:"{}"})]}):f.jsxs("div",{className:"pl-1",children:[e!=null&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(e)}),f.jsx("span",{className:"text-slate-500",children:": "})]}),f.jsx("button",{type:"button","aria-expanded":c,onClick:()=>h(!c),className:"inline align-middle text-slate-400 hover:text-slate-200 mr-1 select-none w-4",children:c?"▼":"▶"}),f.jsx("span",{className:"text-slate-500",children:"{"}),f.jsx("span",{className:"text-slate-600 text-[10px] ml-1",children:a.length}),c&&f.jsx("ul",{className:"list-none my-0.5 ml-4 border-l border-surface-600 pl-2 space-y-0.5",children:a.map(g=>f.jsx("li",{children:f.jsx(kf,{name:g,value:r[g],depth:o+1,defaultOpenDepth:i})},g))}),!c&&f.jsx("span",{className:"text-slate-600",children:" … "}),f.jsx("span",{className:"text-slate-500",children:"}"})]})}const z2={pathParamRequired:e=>`Parámetro de ruta obligatorio: ${e}`,queryRequired:e=>`Query obligatorio: ${e}`,headerRequired:e=>`Header obligatorio: ${e}`,cookieRequired:e=>`Cookie obligatorio: ${e}`,pathPlaceholdersUnresolved:()=>"Quedan placeholders `{…}` en la ruta sin valor.",fileRequired:e=>`Archivo obligatorio: ${e}`,bodyFieldRequired:e=>`Campo de body obligatorio: ${e}`},B2={pathParamRequired:e=>`Required path parameter: ${e}`,queryRequired:e=>`Required query: ${e}`,headerRequired:e=>`Required header: ${e}`,cookieRequired:e=>`Required cookie: ${e}`,pathPlaceholdersUnresolved:()=>"Path still has `{…}` placeholders without a value.",fileRequired:e=>`Required file: ${e}`,bodyFieldRequired:e=>`Required body field: ${e}`};function q2(e){return e==="en"?B2:z2}function U2(e,r,o,i,a){var h,g;const d={...e};for(const x of r){const k=(h=o[x.name])==null?void 0:h.trim();k&&(d[x.name]=k)}const c=[];for(const x of i){const k=(g=a[x.name])==null?void 0:g.trim();k&&c.push(`${x.name}=${k}`)}return c.length&&(d.Cookie=d.Cookie?`${d.Cookie}; ${c.join("; ")}`:c.join("; ")),d}function Om(e,r,o,i,a,d="es"){var W,Y,le,we,ie,de;const c=q2(d),h=vf(e,r.method,r.path),g=h.filter(te=>te.in==="path"),x=h.filter(te=>te.in==="query"),k=h.filter(te=>te.in==="header"),b=h.filter(te=>te.in==="cookie"),S=Da(e,r.method,r.path),_=wu(e,r.method,r.path),j=_!=null&&_.length&&_.length>0?_:S,P=r.method.toLowerCase(),T=P!=="get"&&P!=="head";for(const te of g)if(te.required&&!((W=a.pathVals[te.name])!=null&&W.trim()))return{ok:!1,error:c.pathParamRequired(te.name)};for(const te of x)if(te.required&&!((Y=a.queryVals[te.name])!=null&&Y.trim()))return{ok:!1,error:c.queryRequired(te.name)};for(const te of k)if(te.required&&!((le=a.headerVals[te.name])!=null&&le.trim()))return{ok:!1,error:c.headerRequired(te.name)};for(const te of b)if(te.required&&!((we=a.cookieVals[te.name])!=null&&we.trim()))return{ok:!1,error:c.cookieRequired(te.name)};let M=Vg(r.path,a.pathVals);if(Yg(M))return{ok:!1,error:c.pathPlaceholdersUnresolved()};const V=Kg(a.queryVals,h),O=`${to(e,o)}${M}${V}`,z=U2(i(),k,a.headerVals,b,a.cookieVals);let R;if(T)if(!!(_!=null&&_.length&&_.length>0)&&a.bodyMode==="fields"&&(j!=null&&j.length)){for(const F of j)if(F.isFile){if(F.required&&!a.multipartFiles[F.key])return{ok:!1,error:c.fileRequired(F.key)}}else if(F.required&&!((ie=a.bodyVals[F.key])!=null&&ie.trim()))return{ok:!1,error:c.bodyFieldRequired(F.key)};R=d2(j,a.bodyVals,a.multipartFiles)}else if(a.bodyMode==="fields"&&(j!=null&&j.length)){for(const ce of j)if(ce.required&&!((de=a.bodyVals[ce.key])!=null&&de.trim()))return{ok:!1,error:c.bodyFieldRequired(ce.key)};const F=Wg(j,a.bodyVals);R=JSON.stringify(F)}else R=a.tryBodyRaw.trim()||"{}";return R instanceof FormData&&(delete z["Content-Type"],delete z["content-type"]),{ok:!0,url:O,headers:z,body:R,method:r.method.toUpperCase()}}function Ii(e){return`'${e.replace(/'/g,"'\\''")}'`}function V2(e){const r={};return e.forEach((o,i)=>{r[i]=o}),r}function K2(e){const r=["curl","-sS","-X",Ii(e.method)],o=Object.entries(e.headers);o.sort(([i],[a])=>i.localeCompare(a));for(const[i,a]of o)r.push("-H",Ii(`${i}: ${a}`));if(e.body instanceof FormData)for(const[i,a]of e.body.entries())a instanceof File?r.push("-F",Ii(`${i}=@./${a.name}`)):r.push("-F",Ii(`${i}=${a}`));else e.body!==void 0&&e.body!==""&&r.push("--data",Ii(e.body));return r.push(Ii(e.url)),r.join(" ")}function W2(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 $d(e,r,o){var c;const i=r.toLowerCase(),a=(c=e.paths)==null?void 0:c[o];if(!a||typeof a!="object"||"$ref"in a)return!1;const d=a[i];return(d==null?void 0:d.deprecated)===!0}function Y2(e,r,o,i,a,d,c){return{pathVals:{...e},queryVals:{...r},headerVals:{...o},cookieVals:{...i},bodyMode:a,tryBodyRaw:d,bodyVals:{...c}}}function J2({doc:e,selectedOp:r,baseUrl:o,buildHeaders:i,hydrateEntry:a,onHydrateConsumed:d}){const{t:c,locale:h}=Wo(),[g,x]=I.useState({}),[k,b]=I.useState({}),[S,_]=I.useState({}),[j,P]=I.useState({}),[T,M]=I.useState({}),[V,$]=I.useState({}),[O,z]=I.useState("{}"),[R,W]=I.useState("raw"),[Y,le]=I.useState(null),[we,ie]=I.useState(null),[de,te]=I.useState(null),[F,ce]=I.useState([]),[J,ue]=I.useState(""),[q,K]=I.useState(null),[Q,L]=I.useState(null),U=I.useMemo(()=>vf(e,r.method,r.path),[e,r.method,r.path]),je=I.useMemo(()=>U.filter(ye=>ye.in==="path"),[U]),Ne=I.useMemo(()=>U.filter(ye=>ye.in==="query"),[U]),Re=I.useMemo(()=>U.filter(ye=>ye.in==="header"),[U]),Oe=I.useMemo(()=>U.filter(ye=>ye.in==="cookie"),[U]),Le=I.useMemo(()=>Da(e,r.method,r.path),[e,r.method,r.path]),ke=I.useMemo(()=>wu(e,r.method,r.path),[e,r.method,r.path]),$e=ke!=null&&ke.length?ke:Le,_e=!!(ke!=null&&ke.length),tt=I.useMemo(()=>{const ye=to(e,o),ot=Vg(r.path,g),pt=Kg(k,U),Ft=Yg(ot);return{href:`${ye}${ot}${pt}`,unresolved:Ft}},[e,o,r.path,g,k,U]),ze=r.method.toLowerCase(),Je=ze!=="get"&&ze!=="head",at=I.useCallback(async()=>{const ye=await $x(r.method,r.path);ce(ye.sort((ot,pt)=>ot.name.localeCompare(pt.name)))},[r.method,r.path]);I.useEffect(()=>{at()},[at]),I.useEffect(()=>{x({}),b({}),_({}),P({}),ie(null),le(null),K(null);const ye=wu(e,r.method,r.path),ot=Da(e,r.method,r.path),pt=ye!=null&&ye.length?ye:ot;$({}),pt!=null&&pt.length?(M(Object.fromEntries(pt.map(Ft=>[Ft.key,""]))),W("fields"),z($m(pt,{}))):(M({}),W("raw"),z("{}"))},[e,r.method,r.path]),I.useEffect(()=>{if(!a)return;if(!(a.method.toLowerCase()===r.method.toLowerCase()&&a.path===r.path)){d==null||d();return}const ot=a.tryForm;if(ot){x({...ot.pathVals}),b({...ot.queryVals}),_({...ot.headerVals}),P({...ot.cookieVals}),W(ot.bodyMode),z(ot.tryBodyRaw);const pt=wu(e,r.method,r.path),Ft=Da(e,r.method,r.path),vt=pt!=null&&pt.length?pt:Ft;if($({}),vt!=null&&vt.length&&ot.bodyMode==="fields"){const Ue={};for(const bt of vt)Ue[bt.key]=ot.bodyVals[bt.key]??"";M(Ue)}else M({...ot.bodyVals});ie(null),le(null)}d==null||d()},[a,r.method,r.path,e,d]);const mt=I.useCallback((ye,ot)=>{M(pt=>({...pt,[ye]:ot}))},[]),ft=I.useCallback(()=>{$e!=null&&$e.length&&z($m($e,T)),W("raw")},[$e,T]),Mt=I.useCallback(()=>{$e!=null&&$e.length&&M(p2($e,O)),W("fields")},[$e,O]),Xt=I.useMemo(()=>({pathVals:g,queryVals:k,headerVals:S,cookieVals:j,bodyVals:T,tryBodyRaw:O,bodyMode:R,multipartFiles:V}),[g,k,S,j,T,O,R,V]),nn=async()=>{ie(null);const ye=Om(e,r,o,i,Xt,h);if(!ye.ok){ie(ye.error);return}const ot=Ra(ye.url),pt={method:ye.method,headers:ye.headers,credentials:ot};ye.body!==void 0&&(pt.body=ye.body);const Ft=Y2(g,k,S,j,R,O,T),vt=ye.body instanceof FormData?W2(ye.body):ye.body??null,Ue={at:new Date().toISOString(),method:r.method,path:r.path,baseUrl:o,url:ye.url,requestHeaders:{...ye.headers},requestBody:vt,credentials:ot,tryForm:Ft};try{const bt=await fetch(ye.url,pt),Tt=await bt.text();let yn=null;try{yn=Tt?JSON.parse(Tt):null}catch{yn=null}le({status:bt.status,statusText:bt.statusText,bodyText:Tt,json:yn});try{await Sh({...Ue,status:bt.status,statusText:bt.statusText,responseHeaders:V2(bt.headers),responseBodyText:Tt})}catch{}}catch(bt){le(null);const Tt=bt instanceof Error?bt.message:String(bt);ie(Tt);try{await Sh({...Ue,networkError:Tt})}catch{}}},Ht=async()=>{K(null);const ye=J.trim();if(!ye){K(c("presetNameRequired"));return}await Mx({name:ye,method:r.method,path:r.path,pathVals:{...g},queryVals:{...k},headerVals:{...S},cookieVals:{...j},bodyMode:R,tryBodyRaw:O,bodyVals:{...T}}),ue(""),K(c("presetSaved")),await at(),window.setTimeout(()=>K(null),2500)},Dt=ye=>{if(x({...ye.pathVals}),b({...ye.queryVals}),_({...ye.headerVals}),P({...ye.cookieVals}),$({}),W(_e?"fields":ye.bodyMode),z(ye.tryBodyRaw),$e!=null&&$e.length&&(_e||ye.bodyMode==="fields")){const ot={};for(const pt of $e)ot[pt.key]=ye.bodyVals[pt.key]??"";M(ot)}else M({...ye.bodyVals});K(null)},pn=async ye=>{await Ax(ye),await at()},ln=async()=>{L(null);try{await navigator.clipboard.writeText(tt.href),L(c("urlCopied")),window.setTimeout(()=>L(null),2e3)}catch{L(c("urlCopyFailed"))}},An=async()=>{te(null);const ye=Om(e,r,o,i,Xt,h);if(!ye.ok){te(ye.error);return}const ot=K2(ye);try{await navigator.clipboard.writeText(ot),te(c("curlCopied")),window.setTimeout(()=>te(null),2500)}catch{te(c("clipboardDenied"))}},en="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",At=ye=>{const ot=[ye.defaultLabel?`${c("paramDefault")} ${ye.defaultLabel}`:"",ye.exampleHint?`${c("paramExample")} ${ye.exampleHint}`:""].filter(Boolean);return ot.length?ot.join(" · "):ye.in==="path"?`{${ye.name}}`:""},Rt=(ye,ot,pt)=>{const Ft=ot[ye.name]??"",vt=[ye.schemaType,ye.format].filter(Boolean).join(" · "),Ue=ye.enumOptions&&ye.enumOptions.length>0;return f.jsxs("div",{className:"space-y-1.5",children:[f.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[f.jsx("span",{className:"text-slate-200 text-xs font-medium tracking-tight",children:ye.name}),ye.required?f.jsx("span",{className:"text-[10px] uppercase tracking-wide text-rose-400/85",children:c("required")}):f.jsx("span",{className:"text-[10px] text-slate-600",children:c("optional")}),vt?f.jsx("span",{className:"text-[10px] font-mono text-slate-500",title:c("typeInSpecTitle"),children:vt}):null]}),ye.description?f.jsx("p",{className:"text-[10px] text-slate-500 leading-relaxed line-clamp-4",title:ye.description,children:ye.description}):null,Ue?f.jsxs("select",{className:`${en} cursor-pointer appearance-auto`,value:Ft,onChange:bt=>pt(Tt=>({...Tt,[ye.name]:bt.target.value})),"aria-label":ye.name,children:[ye.required?null:f.jsx("option",{value:"",children:c("chooseOption")}),ye.enumOptions.map(bt=>f.jsx("option",{value:bt,children:bt},bt))]}):f.jsx("input",{type:"text",className:en,value:Ft,onChange:bt=>pt(Tt=>({...Tt,[ye.name]:bt.target.value})),placeholder:At(ye),autoComplete:"off",name:`param-${ye.in}-${ye.name}`,id:`param-${ye.in}-${ye.name}`})]},`${ye.in}:${ye.name}`)},gn=(ye,ot,pt,Ft,vt,Ue)=>Ft.length===0?null:f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[f.jsx("span",{className:`inline-flex items-center rounded-md border px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${pt}`,children:ye}),f.jsx("span",{className:"text-[10px] text-slate-500",children:ot})]}),f.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:Ft.map(bt=>Rt(bt,vt,Ue))})]}),Fn=ye=>{const ot=[ye.defaultLabel?`${c("paramDefault")} ${ye.defaultLabel}`:"",ye.exampleHint?`${c("paramExample")} ${ye.exampleHint}`:""].filter(Boolean);return ot.length?ot.join(" · "):c("bodyValuePlaceholder")},un=ye=>{if(ye.isFile){const vt=V[ye.key];return f.jsxs("div",{className:"space-y-1.5",children:[f.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[f.jsx("span",{className:"text-slate-200 text-xs font-medium tracking-tight",children:ye.key}),ye.required?f.jsx("span",{className:"text-[10px] uppercase tracking-wide text-rose-400/85",children:c("required")}):f.jsx("span",{className:"text-[10px] text-slate-600",children:c("optional")}),f.jsx("span",{className:"text-[10px] font-mono text-slate-500",children:c("fileMultipart")})]}),ye.description?f.jsx("p",{className:"text-[10px] text-slate-500 leading-relaxed",children:ye.description}):null,f.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:Ue=>{var Tt;const bt=((Tt=Ue.target.files)==null?void 0:Tt[0])??null;$(yn=>({...yn,[ye.key]:bt}))},"aria-label":ye.description||ye.key}),vt?f.jsxs("p",{className:"text-[10px] text-slate-400 font-mono truncate",title:vt.name,children:[vt.name," · ",(vt.size/1024).toFixed(1)," KiB"]}):null]},ye.key)}const ot=[ye.type,ye.format].filter(Boolean).join(" · "),pt=ye.enumOptions&&ye.enumOptions.length>0,Ft=ye.type==="boolean";return f.jsxs("div",{className:"space-y-1.5",children:[f.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[f.jsx("span",{className:"text-slate-200 text-xs font-medium tracking-tight",children:ye.key}),ye.required?f.jsx("span",{className:"text-[10px] uppercase tracking-wide text-rose-400/85",children:c("required")}):f.jsx("span",{className:"text-[10px] text-slate-600",children:c("optional")}),ot?f.jsx("span",{className:"text-[10px] font-mono text-slate-500",children:ot}):null]}),ye.description?f.jsx("p",{className:"text-[10px] text-slate-500 leading-relaxed line-clamp-4",title:ye.description,children:ye.description}):null,pt?f.jsxs("select",{className:`${en} cursor-pointer appearance-auto`,value:T[ye.key]??"",onChange:vt=>mt(ye.key,vt.target.value),"aria-label":ye.key,children:[ye.required?null:f.jsx("option",{value:"",children:c("chooseOption")}),ye.enumOptions.map(vt=>f.jsx("option",{value:vt,children:vt},vt))]}):Ft?f.jsxs("select",{className:`${en} cursor-pointer appearance-auto`,value:T[ye.key]??"",onChange:vt=>mt(ye.key,vt.target.value),"aria-label":ye.key,children:[ye.required?null:f.jsx("option",{value:"",children:"—"}),f.jsx("option",{value:"true",children:"true"}),f.jsx("option",{value:"false",children:"false"})]}):f.jsx("input",{type:"text",className:en,value:T[ye.key]??"",onChange:vt=>mt(ye.key,vt.target.value),placeholder:Fn(ye),autoComplete:"off",name:`body-${ye.key}`,id:`body-${ye.key}`})]},ye.key)};return f.jsxs("section",{className:"space-y-4 glass-card p-4",children:[f.jsx("h3",{className:"text-sm font-semibold tracking-tight text-slate-200",children:c("exploreTryHeading")}),f.jsxs("div",{className:"rounded-xl border border-white/[0.07] bg-surface-900/40 backdrop-blur-sm p-3 space-y-2",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:c("requestUrl")}),f.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()})]}),f.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start",children:[f.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:tt.href,children:tt.href}),f.jsx("button",{type:"button",onClick:()=>void ln(),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:c("copyUrl")})]}),tt.unresolved?f.jsx("p",{className:"text-[10px] text-amber-300/95",role:"status",children:c("pathUnresolvedHint")}):null,Q?f.jsx("p",{className:"text-[10px] text-emerald-400/90",role:"status",children:Q}):null]}),f.jsxs("div",{className:"space-y-2 rounded-xl border border-white/[0.07] bg-surface-950/35 backdrop-blur-sm p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:c("templates")}),f.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-end",children:[f.jsxs("label",{className:"block text-xs flex-1 min-w-[12rem]",children:[f.jsx("span",{className:"text-slate-400",children:c("newTemplateName")}),f.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:J,onChange:ye=>ue(ye.target.value),placeholder:c("newTemplatePlaceholder"),autoComplete:"off"})]}),f.jsx("button",{type:"button",onClick:()=>void Ht(),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:c("saveTemplate")})]}),q?f.jsx("p",{className:"text-xs text-emerald-400/90",role:"status",children:q}):null,F.length>0?f.jsx("ul",{className:"space-y-1.5 text-xs",children:F.map(ye=>f.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:[f.jsx("span",{className:"text-slate-300 font-medium truncate flex-1 min-w-0",children:ye.name}),f.jsx("button",{type:"button",onClick:()=>Dt(ye),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:c("load")}),ye.id!==void 0?f.jsx("button",{type:"button",onClick:()=>void pn(ye.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 ${ye.name}`,children:c("deleteTemplate")}):null]},ye.id??ye.name))}):f.jsx("p",{className:"text-[11px] text-slate-500",children:c("noTemplates")})]}),(je.length>0||Ne.length>0||Re.length>0||Oe.length>0)&&f.jsxs("div",{className:"space-y-4 rounded-xl border border-white/[0.07] bg-surface-950/35 backdrop-blur-sm p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:c("params")}),gn(c("paramPathBadge"),c("paramPathSub"),"border-sky-500/35 bg-sky-500/10 text-sky-200/95",je,g,x),gn(c("paramQueryBadge"),c("paramQuerySub"),"border-emerald-500/35 bg-emerald-500/10 text-emerald-200/95",Ne,k,b),gn(c("paramHeaderBadge"),c("paramHeaderSub"),"border-amber-500/35 bg-amber-500/10 text-amber-200/95",Re,S,_),gn(c("paramCookieBadge"),c("paramCookieSub"),"border-fuchsia-500/35 bg-fuchsia-500/10 text-fuchsia-200/95",Oe,j,P)]}),Je&&f.jsxs("div",{className:"space-y-2 rounded-xl border border-white/[0.07] bg-surface-950/35 backdrop-blur-sm p-3",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:c("body")}),_e?f.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:c("multipartHint")}):$e!=null&&$e.length?f.jsxs("div",{className:"flex rounded-lg border border-surface-600 overflow-hidden text-xs shadow-inner shadow-black/20",role:"group","aria-label":c("body"),children:[f.jsx("button",{type:"button",className:`min-h-[40px] px-3 py-2 transition-colors duration-200 sm:min-h-0 sm:py-1.5 ${R==="fields"?"bg-accent/25 text-accent font-medium":"bg-surface-800 text-slate-400 hover:text-slate-200"}`,onClick:Mt,children:c("bodyFieldsMode")}),f.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 ${R==="raw"?"bg-accent/25 text-accent font-medium":"bg-surface-800 text-slate-400 hover:text-slate-200"}`,onClick:ft,children:c("bodyRawJson")})]}):f.jsx("span",{className:"text-[10px] text-slate-500",children:c("bodyJsonObjectHint")})]}),R==="fields"&&($e!=null&&$e.length)?f.jsx("div",{className:"grid gap-3 sm:grid-cols-2 pt-1",children:$e.map(ye=>un(ye))}):_e?null:f.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:O,onChange:ye=>z(ye.target.value),placeholder:'{"key": "value"}',spellCheck:!1,rows:14})]}),we&&f.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:we}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx("button",{type:"button",onClick:()=>void nn(),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:c("execute")}),f.jsx("button",{type:"button",onClick:()=>void An(),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:c("copyCurl")})]}),de?f.jsx("p",{className:"text-xs text-emerald-400/90",role:"status",children:de}):null,f.jsxs("div",{className:"space-y-2",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:c("response")}),Y?f.jsxs(f.Fragment,{children:[f.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:[f.jsx("span",{className:Y.status>=200&&Y.status<300?"text-emerald-400":Y.status>=400?"text-rose-400":"text-amber-300",children:Y.status})," ",Y.statusText]}),Y.json!==null?f.jsx(R2,{data:Y.json,defaultOpenDepth:3}):f.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:Y.bodyText||"—"})]}):f.jsx("p",{className:"text-xs text-slate-500",children:"—"})]})]})}function X2(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 Q2(e){return f.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:[f.jsx("circle",{cx:"11",cy:"11",r:"8"}),f.jsx("path",{d:"m21 21-4.3-4.3"})]})}function G2(e){return f.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:[f.jsx("circle",{cx:"18",cy:"5",r:"3"}),f.jsx("circle",{cx:"6",cy:"12",r:"3"}),f.jsx("circle",{cx:"18",cy:"19",r:"3"}),f.jsx("path",{d:"m8.59 13.51 6.83 3.98"}),f.jsx("path",{d:"m15.41 6.51-6.82 3.98"})]})}function Z2(e){return f.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:[f.jsx("path",{d:"M12 3 2 8l10 5 10-5-10-5Z"}),f.jsx("path",{d:"M2 13 12 18l10-5"}),f.jsx("path",{d:"M2 18 12 23l10-5"})]})}function e_(e){return f.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:[f.jsx("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20"}),f.jsx("path",{d:"M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"}),f.jsx("path",{d:"M8 7h8"}),f.jsx("path",{d:"M8 11h6"})]})}function t_(e){return f.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:[f.jsx("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),f.jsx("path",{d:"M3 3v5h5"}),f.jsx("path",{d:"M12 7v5l4 2"})]})}function n_(e){return f.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:[f.jsx("path",{d:"M9 11l3 3L22 4"}),f.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})}function ty(e){return f.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:[f.jsx("path",{d:"M12 8V4H8"}),f.jsx("rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"}),f.jsx("path",{d:"M2 14h2"}),f.jsx("path",{d:"M20 14h2"}),f.jsx("path",{d:"M15 13v2"}),f.jsx("path",{d:"M9 13v2"})]})}function r_(e){return f.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:[f.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),f.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}function o_(e){return f.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:[f.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),f.jsx("polyline",{points:"7 10 12 15 17 10"}),f.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function s_(e){return f.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:[f.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),f.jsx("polyline",{points:"17 8 12 3 7 8"}),f.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]})}function i_(e){return f.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:[f.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),f.jsx("polyline",{points:"16 17 21 12 16 7"}),f.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]})}function Dm(e){return f.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:[f.jsx("path",{d:"M15 3h6v6"}),f.jsx("path",{d:"M9 21H3v-6"}),f.jsx("path",{d:"M21 3l-7 7"}),f.jsx("path",{d:"M3 21l7-7"})]})}const a_=["get","post","put","patch","delete","options","head","trace"];function ny(e,r){const o=e.trim().replace(/\s+/g," ");return o.length<=r?o:`${o.slice(0,r-1)}…`}function l_(e,r,o,i,a){const d=[`${e.toUpperCase()} ${r}`];return o&&d.push(`— ${ny(o,140)}`),i!=null&&i.length&&d.push(`[tags: ${i.join(", ")}]`),a&&d.push(`(operationId: ${a})`),d.join(" ")}function u_(e,r){const o=[];let i=0;const a=e.paths;if(!a)return{lines:o,total:0};for(const[d,c]of Object.entries(a)){if(!c||typeof c!="object"||"$ref"in c)continue;const h=c;for(const g of a_){const x=h[g];if(!(!x||typeof x!="object")&&(i+=1,o.length<r)){const k=x.summary||(x.description?ny(x.description,200):void 0);o.push(l_(g,d,k,x.tags,x.operationId))}}}return{lines:o,total:i}}function c_(e){var o,i,a,d,c,h,g;const r=[`Flujo «${e.name}»`];if((o=e.steps)!=null&&o.length){const x=e.steps.map(b=>`${b.method.toUpperCase()} ${b.path}`).join(" → ");r.push(`secuencia (pasos): ${x}`);const k=e.steps.filter(b=>b.extract).map(b=>`${b.extract.varName} ← ${b.extract.jsonPath}`);k.length&&r.push(`extracciones: ${k.join("; ")}`)}if((a=(i=e.graph)==null?void 0:i.nodes)!=null&&a.length){const x=e.graph.nodes.map(k=>`${k.method.toUpperCase()} ${k.path}`).join(" → ");r.push(`grafo (nodos en orden guardado): ${x}`),(d=e.graph.edges)!=null&&d.length&&r.push(`cables: ${e.graph.edges.length} (mapeo respuesta → siguiente request; detalle en la UI Flujos)`)}return!((c=e.steps)!=null&&c.length)&&!((g=(h=e.graph)==null?void 0:h.nodes)!=null&&g.length)&&r.push("(sin pasos ni nodos)"),r.join(". ")}function d_(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 f_(e,r){var T,M,V,$;const o=e.info.title??"API",i=e.info.version??"",a=`Documentación OpenAPI «${o}»${i?` v${i}`:""}.`,d=((T=e.servers)==null?void 0:T.map(O=>`${O.url}${O.description?` (${O.description})`:""}`).join(`
215
+ `))||"(sin servers en el spec; usa la Base URL de la barra superior en la UI)",c=(M=e.components)!=null&&M.securitySchemes?Object.entries(e.components.securitySchemes).map(([O,z])=>{if(!z||typeof z!="object"||"$ref"in z)return`${O}: ref`;const R=z.type??"?";return`${O} (${R})`}).join("; "):"",{lines:h,total:g}=u_(e,400),x=g>h.length?`
216
+ … y ${g-h.length} operación(es) más en el spec.`:"";let k="";const b=((V=r==null?void 0:r.savedFlows)==null?void 0:V.filter(O=>O.name))??[];b.length&&(k=`
217
+
218
+ --- Flujos guardados por el usuario en esta app (${b.length}) ---
219
+ ${b.map(c_).join(`
220
+ `)}`);let S="";const _=(($=r==null?void 0:r.testSuites)==null?void 0:$.filter(O=>O.name))??[];_.length&&(S=`
221
+
222
+ --- Suites de tests guardadas (${_.length}) ---
223
+ ${_.map(d_).join(`
224
+ `)}`);let j="";const P=r==null?void 0:r.selectedOperation;return P!=null&&P.path&&(j=`
225
+
226
+ --- Operación enfocada en la UI (Explorar) ---
227
+ ${P.method.toUpperCase()} ${P.path}
228
+ (Prioriza explicar esta ruta si el usuario pregunta en genérico «este endpoint».)`),`${a}
229
+
230
+ --- Servidores (servers) ---
231
+ ${d}
232
+
233
+ --- Seguridad (components.securitySchemes) ---
234
+ ${c||"(ninguno declarado o solo referencias)"}
235
+
236
+ --- Catálogo de endpoints (método, ruta, resumen/tags) ---
237
+ Total de operaciones en el spec: ${g}.
238
+ ${h.join(`
239
+ `)}${x}
240
+ ${k}
241
+ ${S}${j}
242
+
243
+ Instrucciones:
244
+ - Responde en el idioma del usuario. Sé preciso: cita método y ruta cuando hables de un endpoint.
245
+ - Puedes explicar cómo encadenar llamadas (flujos), qué variables extraer entre pasos, y cómo se relacionan con los tests guardados.
246
+ - Para probar requests reales, el usuario debe usar la pestaña Explorar (o Flujos/Tests); tú no ejecutas HTTP.
247
+ - 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 p_(e,r,o,i,a){const d=`${e.replace(/\/?$/,"/")}__chat`,c=await fetch(d,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",[ax]:r},body:JSON.stringify({provider:o,model:i,messages:a})}),h=await c.text();if(!c.ok){let g=h;try{const x=JSON.parse(h);g=x.message??x.error??h}catch{}throw new Error(g||`HTTP ${c.status}`)}return JSON.parse(h)}function h_({doc:e,contextExtras:r,provider:o,model:i,apiKey:a,onOpenLlmSettings:d}){const{t:c}=Wo(),h="/docs/",[g,x]=I.useState(!1),[k,b]=I.useState([]),[S,_]=I.useState(""),[j,P]=I.useState(!1),[T,M]=I.useState(null),V=I.useRef(null),$=I.useMemo(()=>f_(e,r),[e,r]);I.useEffect(()=>{var R;(R=V.current)==null||R.scrollIntoView({behavior:"smooth"})},[k]);const O=I.useCallback(async()=>{const R=S.trim();if(!R||j)return;if(!a.trim()){M(c("floatingAssistantConfigureKey")),d==null||d();return}M(null);const W=i.trim()||pu(o),Y={role:"user",content:R},le=[{role:"system",content:$},...k.filter(we=>we.role!=="system"),Y];_(""),b(we=>[...we,Y]),P(!0);try{const we=await p_(h,a.trim(),o,W,le);b(ie=>[...ie,{role:"assistant",content:we.content??""}])}catch(we){M(we instanceof Error?we.message:String(we))}finally{P(!1)}},[a,h,S,j,k,i,d,o,$,c]),z=I.useCallback(()=>{b([]),M(null)},[]);return f.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:[g?f.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":c("floatingAssistantTitle"),children:[f.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:[f.jsx("span",{className:"text-sm font-medium text-slate-200",children:c("roleAssistant")}),f.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[f.jsx("button",{type:"button",onClick:z,className:"text-[11px] text-slate-500 hover:text-slate-300 px-2 py-1 rounded-lg glass-pill",children:c("floatingAssistantClear")}),f.jsx("button",{type:"button",onClick:()=>x(!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":c("floatingAssistantClose"),children:"×"})]})]}),T?f.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:[f.jsx("span",{className:"flex-1 min-w-0",children:T}),d?f.jsx("button",{type:"button",className:"shrink-0 underline text-accent",onClick:d,children:c("floatingAssistantOpenSettings")}):null]}):null,f.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-3 min-h-0",children:[k.length===0?f.jsx("p",{className:"text-xs text-slate-500 text-center py-6 leading-relaxed px-1",children:c("floatingAssistantEmpty")}):k.map((R,W)=>f.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:[f.jsx("span",{className:"text-[10px] uppercase tracking-wider text-slate-500 block mb-0.5",children:R.role==="user"?c("roleUser"):c("roleAssistant")}),f.jsx("div",{className:"whitespace-pre-wrap break-words",children:R.content})]},`${W}-${R.role}`)),f.jsx("div",{ref:V})]}),f.jsxs("div",{className:"p-2.5 border-t border-white/[0.08] flex gap-2 bg-surface-950/25",children:[f.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:S,onChange:R=>_(R.target.value),onKeyDown:R=>{R.key==="Enter"&&!R.shiftKey&&(R.preventDefault(),O())},placeholder:c("floatingAskPlaceholder"),disabled:j}),f.jsx("button",{type:"button",onClick:()=>void O(),disabled:j||!S.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:j?"…":c("send")})]})]}):null,f.jsx("button",{type:"button",onClick:()=>x(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 ${g?"glass-fab-muted scale-95":"glass-fab hover:scale-[1.03] hover:brightness-110"}`,"aria-expanded":g,"aria-label":c(g?"hideAssistant":"showAssistant"),title:c("assistantFabTitle"),children:f.jsx(ty,{className:g?"opacity-80":void 0})})]})}const ry="adt-llm-provider",oy="adt-llm-model",sy="adt-llm-key";function m_(){try{const e=localStorage.getItem(ry),r=e==="anthropic"||e==="openai"||e==="openrouter"?e:"openrouter",o=localStorage.getItem(oy)??"",i=localStorage.getItem(sy)??"";return{provider:r,model:o,apiKey:i}}catch{return{provider:"openrouter",model:"",apiKey:""}}}function g_(e,r,o){try{localStorage.setItem(ry,e),localStorage.setItem(oy,r),localStorage.setItem(sy,o)}catch{}}function y_({open:e,onClose:r,ops:o,onPick:i}){const{t:a}=Wo(),[d,c]=I.useState(""),h=I.useRef(null),[g,x]=I.useState(0),k=I.useMemo(()=>{const S=d.trim().toLowerCase();return S?o.filter(_=>{const j=(_.operationId??"").toLowerCase(),P=_.path.toLowerCase(),T=_.method.toLowerCase(),M=(_.tags??[]).join(" ").toLowerCase();return P.includes(S)||T.includes(S)||j.includes(S)||M.includes(S)}).slice(0,80):o.slice(0,80)},[o,d]);I.useEffect(()=>{e&&(c(""),x(0),window.setTimeout(()=>{var S;return(S=h.current)==null?void 0:S.focus()},10))},[e]),I.useEffect(()=>{x(0)},[d]);const b=I.useCallback(S=>{i({method:S.method,path:S.path}),r()},[r,i]);return I.useEffect(()=>{if(!e)return;const S=_=>{if(_.key==="Escape"){_.preventDefault(),r();return}_.key==="ArrowDown"&&(_.preventDefault(),x(j=>Math.min(j+1,Math.max(0,k.length-1)))),_.key==="ArrowUp"&&(_.preventDefault(),x(j=>Math.max(0,j-1))),_.key==="Enter"&&k[g]&&(_.preventDefault(),b(k[g]))};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[e,k,g,r,b]),e?f.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:f.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":a("commandPaletteLabel"),className:"glass-modal-panel w-full max-w-xl rounded-2xl overflow-hidden shadow-2xl",onClick:S=>S.stopPropagation(),children:[f.jsxs("div",{className:"border-b border-white/[0.08] px-3 py-2",children:[f.jsx("input",{ref:h,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:a("commandPalettePlaceholder"),value:d,onChange:S=>c(S.target.value),autoComplete:"off"}),f.jsxs("p",{className:"text-[10px] text-slate-500 mt-1 px-1",children:[a("commandPaletteHints")," ",f.jsx("kbd",{className:"px-1 rounded bg-surface-800 text-slate-400",children:"⌘K"})," /"," ",f.jsx("kbd",{className:"px-1 rounded bg-surface-800 text-slate-400",children:"Ctrl+K"})]})]}),f.jsx("ul",{className:"max-h-[min(50vh,22rem)] overflow-y-auto py-1",role:"listbox",children:k.length===0?f.jsx("li",{className:"px-4 py-6 text-sm text-slate-500 text-center",children:a("noMatches")}):k.map((S,_)=>f.jsx("li",{children:f.jsxs("button",{type:"button",role:"option","aria-selected":_===g,className:`w-full text-left px-3 py-2.5 flex items-start gap-2 transition-colors ${_===g?"bg-accent/15 text-slate-100":"hover:bg-white/[0.04] text-slate-300"}`,onMouseEnter:()=>x(_),onClick:()=>b(S),children:[f.jsx(Js,{method:S.method,size:"sm"}),f.jsxs("span",{className:"flex-1 min-w-0",children:[f.jsx("span",{className:"font-mono text-xs break-all",children:S.path}),S.operationId?f.jsx("span",{className:"block text-[10px] text-slate-500 mt-0.5",children:S.operationId}):null,S.deprecated?f.jsx("span",{className:"ml-2 text-[10px] uppercase text-amber-400/90",children:"deprecated"}):null]})]})},`${S.method}:${S.path}`))})]})}):null}function x_(e){return typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string"}function v_({doc:e}){const{t:r}=Wo(),o=I.useMemo(()=>{var g;const h=(g=e.components)==null?void 0:g.schemas;return!h||typeof h!="object"?[]:Object.keys(h).sort((x,k)=>x.localeCompare(k))},[e]),[i,a]=I.useState(null);I.useEffect(()=>{if(o.length===0){a(null);return}(!i||!o.includes(i))&&a(o[0])},[o,i]);const d=I.useMemo(()=>{var g,x;if(!i)return"";const h=(x=(g=e.components)==null?void 0:g.schemas)==null?void 0:x[i];if(h===void 0)return"// (undefined)";try{return JSON.stringify(h,null,2)}catch{return String(h)}},[e,i]),c=async()=>{try{await navigator.clipboard.writeText(d)}catch{}};return o.length===0?f.jsx("div",{className:"p-4 max-w-3xl",children:f.jsx("p",{className:"text-sm text-slate-500",children:r("schemaNoComponents")})}):f.jsxs("div",{className:"p-4 flex flex-col lg:flex-row gap-4 min-h-0 max-w-6xl",children:[f.jsxs("div",{className:"lg:w-56 shrink-0 space-y-2",children:[f.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500",children:r("schemasHeading")}),f.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:o.map(h=>{var k,b;const g=(b=(k=e.components)==null?void 0:k.schemas)==null?void 0:b[h],x=x_(g);return f.jsx("li",{children:f.jsxs("button",{type:"button",onClick:()=>a(h),className:`w-full text-left px-2 py-2 rounded-lg text-xs font-mono transition-colors ${i===h?"glass-pill-active text-slate-100":"text-slate-400 hover:bg-white/[0.04] hover:text-slate-200"}`,children:[h,x?f.jsx("span",{className:"block text-[10px] text-slate-500 truncate",title:g.$ref,children:r("refSuffix")}):null]})},h)})})]}),f.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-2 min-h-0",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[f.jsx("h3",{className:"text-sm font-medium text-slate-200",children:i?f.jsx(f.Fragment,{children:f.jsx("code",{className:"text-accent",children:i})}):f.jsx("span",{className:"text-slate-500",children:r("selectSchema")})}),i?f.jsx("button",{type:"button",onClick:()=>void c(),className:"text-xs px-3 py-1.5 rounded-lg glass-pill text-slate-300",children:r("copyJson")}):null]}),i?f.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:d}):f.jsx("p",{className:"text-xs text-slate-500",children:r("schemaEmptyHint")})]})]})}const du="op",w_="playground";function Rm(e){if(!e)return!1;const r=e.startsWith("?")?e.slice(1):e;return new URLSearchParams(r).get(w_)==="1"}function b_(e,r){const o=`${e.toLowerCase()} ${r}`;return encodeURIComponent(o)}function S_(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 Lm(e){try{const r=JSON.parse(e);return JSON.stringify(r,null,2)}catch{return null}}async function fu(e){await navigator.clipboard.writeText(e)}function k_({listKey:e,onReplay:r}){const{t:o}=Wo(),[i,a]=I.useState([]),[d,c]=I.useState(null),[h,g]=I.useState(""),[x,k]=I.useState(""),[b,S]=I.useState(null),[_,j]=I.useState(!1),P=I.useCallback(async()=>{const z=await Ix();a(z)},[]);I.useEffect(()=>{P()},[P,e]);const T=I.useMemo(()=>{const z=h.trim().toLowerCase(),R=x.trim().toLowerCase();return i.filter(W=>!(z&&W.method.toLowerCase()!==z||R&&!W.path.toLowerCase().includes(R)&&!W.url.toLowerCase().includes(R)))},[i,h,x]),M=z=>{z!==void 0&&c(R=>R===z?null:z)},V=async()=>{if(window.confirm(o("clearHistoryConfirm"))){j(!0);try{await Ox(),a([]),c(null)}finally{j(!1)}}},$=async z=>{z!==void 0&&(await Dx(z),c(R=>R===z?null:R),await P())},O=()=>{S(o("copied")),window.setTimeout(()=>S(null),2e3)};return f.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:[f.jsxs("div",{children:[f.jsx("h2",{className:"text-lg font-semibold text-slate-100 tracking-tight",children:o("tryHistoryPageTitle")}),f.jsx("p",{className:"text-xs text-slate-500 mt-1 leading-relaxed max-w-2xl",children:o("tryHistoryIntro",{max:Dd})})]}),f.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[f.jsxs("label",{className:"text-xs text-slate-400 flex items-center gap-2",children:[o("filterMethod"),f.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:h,onChange:z=>g(z.target.value),placeholder:"get",autoComplete:"off",spellCheck:!1})]}),f.jsxs("label",{className:"text-xs text-slate-400 flex items-center gap-2 flex-1 min-w-[12rem]",children:[o("filterPathOrUrl"),f.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:x,onChange:z=>k(z.target.value),placeholder:"/users …",autoComplete:"off",spellCheck:!1})]}),f.jsx("button",{type:"button",onClick:()=>void P(),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:o("refresh")}),f.jsx("button",{type:"button",disabled:_||i.length===0,onClick:()=>void V(),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:_?"…":o("clearHistory")})]}),b?f.jsx("p",{className:"text-xs text-emerald-400/90",role:"status",children:b}):null,T.length===0?f.jsx("p",{className:"text-sm text-slate-500 py-8 text-center border border-dashed border-surface-600 rounded-2xl",children:i.length===0?o("emptyHistory"):o("noFilterMatch")}):f.jsx("ul",{className:"space-y-2 overflow-auto flex-1 min-h-0 pb-8",children:T.map(z=>{const R=z.id,W=R!==void 0&&d===R;return f.jsxs("li",{className:"rounded-2xl border border-surface-600/50 bg-surface-900/40 overflow-hidden",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2 p-3",children:[f.jsxs("button",{type:"button",onClick:()=>M(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":W,children:[f.jsx(Js,{method:z.method}),f.jsx("span",{className:"text-xs font-mono text-slate-300 truncate",children:z.path}),f.jsx("span",{className:"text-[10px] text-slate-500 shrink-0",children:new Date(z.at).toLocaleString()}),z.networkError!==void 0?f.jsx("span",{className:"text-[10px] uppercase text-rose-400 shrink-0",children:"error"}):z.status!==void 0?f.jsx("span",{className:`text-xs font-mono shrink-0 ${z.status<400?"text-emerald-400":"text-rose-400"}`,children:z.status}):null]}),f.jsxs("div",{className:"flex flex-wrap gap-2 shrink-0",children:[f.jsx("button",{type:"button",onClick:()=>r(z),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:o("loadInTry")}),R!==void 0?f.jsx("button",{type:"button",onClick:()=>void $(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":o("deleteHistoryEntry"),children:o("delete")}):null]})]}),W?f.jsxs("div",{className:"border-t border-surface-700/60 p-3 space-y-3 text-xs bg-surface-950/50",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-[10px] uppercase text-slate-500 mb-1",children:o("baseUrlField")}),f.jsx("p",{className:"font-mono text-slate-300 break-all",children:z.baseUrl||"—"})]}),f.jsxs("div",{children:[f.jsx("p",{className:"text-[10px] uppercase text-slate-500 mb-1",children:o("finalUrl")}),f.jsx("p",{className:"font-mono text-slate-300 break-all",children:z.url}),f.jsx("button",{type:"button",onClick:()=>void fu(z.url).then(O),className:"mt-1 text-accent hover:underline cursor-pointer",children:o("copyUrl")})]}),f.jsxs("div",{children:[f.jsx("p",{className:"text-[10px] uppercase text-slate-500 mb-1",children:o("requestHeaders")}),f.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(z.requestHeaders,null,2)}),f.jsx("button",{type:"button",onClick:()=>void fu(JSON.stringify(z.requestHeaders,null,2)).then(O),className:"mt-1 text-accent hover:underline cursor-pointer",children:o("copyJson")})]}),f.jsxs("div",{children:[f.jsx("p",{className:"text-[10px] uppercase text-slate-500 mb-1",children:o("requestBody")}),z.requestBody?f.jsxs(f.Fragment,{children:[f.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:Lm(z.requestBody)??z.requestBody}),f.jsx("button",{type:"button",onClick:()=>void fu(z.requestBody??"").then(O),className:"mt-1 text-accent hover:underline cursor-pointer",children:o("copyBody")})]}):f.jsx("p",{className:"text-slate-500",children:"—"})]}),z.networkError!==void 0?f.jsxs("p",{className:"text-rose-300",role:"alert",children:[o("networkError")," ",z.networkError]}):null,z.responseHeaders!==void 0?f.jsxs("div",{children:[f.jsx("p",{className:"text-[10px] uppercase text-slate-500 mb-1",children:o("responseHeaders")}),f.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(z.responseHeaders,null,2)})]}):null,z.responseBodyText!==void 0?f.jsxs("div",{children:[f.jsx("p",{className:"text-[10px] uppercase text-slate-500 mb-1",children:o("responseBody")}),f.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:Lm(z.responseBodyText)??z.responseBodyText}),f.jsx("button",{type:"button",onClick:()=>void fu(z.responseBodyText??"").then(O),className:"mt-1 text-accent hover:underline cursor-pointer",children:o("copyResponse")})]}):null]}):null]},R??`${z.at}-${z.url}`)})})]})}function Qi(e){return typeof e=="object"&&e!==null&&"$ref"in e}function N_(e){if(!e||typeof e!="object")return;if("$ref"in e&&typeof e.$ref=="string")return e.$ref.split("/").pop();const r=e;if(r.enum&&Array.isArray(r.enum))return`enum(${r.enum.map(String).join(" | ")})`;if(r.type)return r.format?`${r.type} (${r.format})`:r.type}function __(e){if(!(e!=null&&e.length))return[];const r=[];for(const o of e){if(Qi(o)){r.push({name:o.$ref,in:"ref",required:!1});continue}const i=o.schema;r.push({name:o.name,in:o.in,required:!!o.required,description:typeof o.description=="string"?o.description:void 0,schemaHint:N_(i)})}return r}function j_(e){if(!e||typeof e!="object")return[];const r=[];for(const[o,i]of Object.entries(e)){if(Qi(i)){r.push({code:o,description:i.$ref});continue}const a=typeof i.description=="string"?i.description:i.content?Object.keys(i.content).join(", "):void 0;r.push({code:o,description:a})}return r.sort((o,i)=>o.code.localeCompare(i.code,void 0,{numeric:!0}))}function C_(e){if(Qi(e))return e.$ref;const r=e.content?Object.keys(e.content):[];return r.length?r.join(", "):e.description}function E_(e,r,o){var x;const i=(x=e.paths)==null?void 0:x[o];if(!i||typeof i!="object"||Qi(i))return null;const a=r.toLowerCase(),d=i[a];if(!d||typeof d!="object")return null;const c=__(d.parameters),h=j_(d.responses);let g;return d.requestBody&&(g=C_(d.requestBody)),{method:r,path:o,summary:typeof d.summary=="string"?d.summary:void 0,description:typeof d.description=="string"?d.description:void 0,deprecated:!!d.deprecated,parameters:c,responses:h,requestBodyHint:g}}function P_(e,r){var i;const o=(i=e.components)==null?void 0:i.securitySchemes;return Object.keys(r).map(a=>{const d=o==null?void 0:o[a];if(!d||Qi(d))return a;const c=d.type;return c?`${a} (${c})`:a})}function T_(e){var c,h,g;const r=e.info??{title:"API",version:""},o=((c=e.servers)==null?void 0:c.map(x=>({url:x.url,description:typeof x.description=="string"?x.description:void 0})))??[],i=[];if((h=e.security)!=null&&h.length)for(const x of e.security)P_(e,x).forEach(k=>i.push(k));const a=Wm(e),d=[];for(const x of a){const k=[];for(const b of io(e)){if(!(((g=b.tags)!=null&&g.length?b.tags:["default"]).includes(x)||x==="default"&&(!b.tags||b.tags.length===0)))continue;const j=E_(e,b.method,b.path);j&&k.push(j)}k.length&&d.push({tag:x,operations:k})}return{title:r.title??"API",version:r.version??"",description:typeof r.description=="string"?r.description:void 0,termsOfService:typeof r.termsOfService=="string"?r.termsOfService:void 0,contact:r.contact?{name:r.contact.name,url:r.contact.url,email:r.contact.email}:void 0,license:r.license&&!Qi(r.license)?{name:r.license.name,url:r.license.url}:void 0,servers:o,securityGlobal:i,groups:d}}function xt(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}const $_=`
248
+ * { box-sizing: border-box; }
249
+ body { font-family: Georgia, "Times New Roman", serif; color: #111; line-height: 1.5; max-width: 48rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; font-size: 11pt; }
250
+ h1 { font-size: 1.6rem; font-weight: 700; margin: 0 0 0.35rem; border-bottom: 1px solid #bbb; padding-bottom: 0.35rem; }
251
+ .ver { color: #444; font-size: 0.95rem; margin: 0 0 1rem; }
252
+ h2 { font-size: 1.2rem; margin: 1.5rem 0 0.5rem; page-break-after: avoid; }
253
+ h3 { font-size: 1.05rem; margin: 1.1rem 0 0.35rem; page-break-after: avoid; }
254
+ h4 { font-size: 0.98rem; margin: 0.85rem 0 0.25rem; }
255
+ .desc { white-space: pre-wrap; margin: 0.35rem 0 0.75rem; color: #222; }
256
+ .muted { color: #555; font-size: 0.92rem; }
257
+ .method { font-weight: 700; font-family: ui-monospace, monospace; text-transform: uppercase; }
258
+ .path { font-family: ui-monospace, monospace; }
259
+ table { border-collapse: collapse; width: 100%; font-size: 0.88rem; margin: 0.4rem 0 0.75rem; }
260
+ th, td { border: 1px solid #ccc; padding: 0.3rem 0.45rem; vertical-align: top; }
261
+ th { background: #f3f3f3; text-align: left; }
262
+ .dep { color: #92400e; font-size: 0.85rem; font-weight: 600; }
263
+ footer { margin-top: 2rem; padding-top: 0.75rem; border-top: 1px solid #ddd; font-size: 0.82rem; color: #666; }
264
+ @media print { body { padding: 0; } h2 { page-break-before: auto; } }
265
+ `;function M_(e,r){var i;const o=[];if(o.push(`<!DOCTYPE html><html lang="und"><head><meta charset="utf-8"/><title>${xt(e.title)}</title><style>${$_}</style></head><body>`),o.push(`<h1>${xt(e.title)}</h1>`),o.push(`<p class="ver">${xt(e.version)}</p>`),e.description&&(o.push(`<h2>${xt(r.techDocOverview)}</h2>`),o.push(`<div class="desc">${xt(e.description)}</div>`)),e.termsOfService&&o.push(`<p class="muted"><strong>${xt(r.techDocTerms)}:</strong> ${xt(e.termsOfService)}</p>`),e.contact&&(e.contact.name||e.contact.url||e.contact.email)){const a=[e.contact.name,e.contact.email,e.contact.url].filter(Boolean).join(" · ");o.push(`<p class="muted"><strong>${xt(r.techDocContact)}:</strong> ${xt(a)}</p>`)}if((i=e.license)!=null&&i.name){const a=e.license.url?`${e.license.name} (${e.license.url})`:e.license.name;o.push(`<p class="muted"><strong>${xt(r.techDocLicense)}:</strong> ${xt(a)}</p>`)}if(e.servers.length){o.push(`<h2>${xt(r.techDocServers)}</h2><ul>`);for(const a of e.servers)o.push(`<li><span class="path">${xt(a.url)}</span>${a.description?` — ${xt(a.description)}`:""}</li>`);o.push("</ul>")}e.securityGlobal.length&&o.push(`<h2>${xt(r.techDocSecurity)}</h2><p>${xt(e.securityGlobal.join(", "))}</p>`),o.push(`<h2>${xt(r.techDocEndpoints)}</h2>`);for(const a of e.groups){o.push(`<h3>${xt(r.techDocTagSection)}: ${xt(a.tag)}</h3>`);for(const d of a.operations){if(o.push(`<h4><span class="method">${xt(d.method)}</span> <span class="path">${xt(d.path)}</span>${d.deprecated?` <span class="dep">(${xt(r.techDocDeprecated)})</span>`:""}</h4>`),d.summary&&o.push(`<p><strong>${xt(d.summary)}</strong></p>`),d.description?o.push(`<div class="desc">${xt(d.description)}</div>`):d.summary||o.push(`<p class="muted">${xt(r.techDocNoDesc)}</p>`),d.parameters.length){o.push(`<p><strong>${xt(r.techDocParameters)}</strong></p>`),o.push(`<table><thead><tr><th>${xt(r.techDocColName)}</th><th>${xt(r.techDocColIn)}</th><th>${xt(r.techDocColReq)}</th><th>${xt(r.techDocColType)}</th><th>${xt(r.techDocColDescr)}</th></tr></thead><tbody>`);for(const c of d.parameters)o.push(`<tr><td>${xt(c.name)}</td><td>${xt(c.in)}</td><td>${c.required?"✓":""}</td><td>${xt(c.schemaHint??"—")}</td><td>${xt(c.description??"—")}</td></tr>`);o.push("</tbody></table>")}if(d.requestBodyHint&&o.push(`<p><strong>${xt(r.techDocRequestBody)}:</strong> ${xt(d.requestBodyHint)}</p>`),d.responses.length){o.push(`<p><strong>${xt(r.techDocResponses)}</strong></p>`),o.push(`<table><thead><tr><th>${xt(r.techDocColCode)}</th><th>${xt(r.techDocColDescr)}</th></tr></thead><tbody>`);for(const c of d.responses)o.push(`<tr><td>${xt(c.code)}</td><td>${xt(c.description??"—")}</td></tr>`);o.push("</tbody></table>")}o.push('<hr style="border:none;border-top:1px solid #e5e5e5;margin:1rem 0"/>')}}return o.push(`<footer>${xt(r.techDocFooterNote)} ${new Date().toISOString().slice(0,10)}</footer>`),o.push("</body></html>"),o.join("")}function A_(e){const r=window.open("","_blank");r&&(r.document.open(),r.document.write(e),r.document.close(),r.focus(),window.setTimeout(()=>{r.print(),r.close()},400))}function I_({doc:e}){var d;const{t:r}=Wo(),o=I.useMemo(()=>T_(e),[e]),i=I.useMemo(()=>({techDocOverview:r("techDocOverview"),techDocServers:r("techDocServers"),techDocSecurity:r("techDocSecurity"),techDocContact:r("techDocContact"),techDocLicense:r("techDocLicense"),techDocTerms:r("techDocTerms"),techDocEndpoints:r("techDocEndpoints"),techDocTagSection:r("techDocTagSection"),techDocDeprecated:r("techDocDeprecated"),techDocParameters:r("techDocParameters"),techDocRequestBody:r("techDocRequestBody"),techDocResponses:r("techDocResponses"),techDocNoDesc:r("techDocNoDesc"),techDocColName:r("techDocColName"),techDocColIn:r("techDocColIn"),techDocColReq:r("techDocColReq"),techDocColType:r("techDocColType"),techDocColDescr:r("techDocColDescr"),techDocColCode:r("techDocColCode"),techDocFooterNote:r("techDocFooterNote")}),[r]),a=I.useCallback(()=>{const c=M_(o,i);A_(c)},[o,i]);return f.jsxs("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:[f.jsxs("div",{className:"shrink-0 border-b border-surface-700/80 bg-surface-900/40 px-4 py-4 flex flex-wrap items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0 max-w-3xl",children:[f.jsx("h2",{className:"font-display text-xl font-bold text-white tracking-tight",children:r("techDocHeroTitle")}),f.jsx("p",{className:"text-sm text-slate-400 mt-1 leading-relaxed",children:r("techDocHeroSubtitle")})]}),f.jsxs("div",{className:"flex flex-col items-stretch sm:items-end gap-1",children:[f.jsx("button",{type:"button",onClick:a,className:"touch-target px-4 py-2.5 rounded-xl bg-accent text-surface-950 text-sm font-semibold shadow-lg shadow-accent/20 hover:brightness-110 transition-[filter]",children:r("techDocDownloadPdf")}),f.jsx("p",{className:"text-[11px] text-slate-500 max-w-xs text-left sm:text-right",children:r("techDocPdfHint")})]})]}),f.jsxs("article",{className:"flex-1 overflow-y-auto p-4 md:p-6 max-w-4xl w-full mx-auto space-y-8 text-slate-200",children:[f.jsxs("header",{className:"border-b border-surface-700/60 pb-6",children:[f.jsx("h1",{className:"font-display text-2xl md:text-3xl font-bold text-white",children:o.title}),f.jsx("p",{className:"text-slate-500 mt-1",children:o.version}),o.description?f.jsx("div",{className:"mt-4 text-sm leading-relaxed text-slate-300 whitespace-pre-wrap",children:o.description}):null,o.termsOfService?f.jsxs("p",{className:"text-xs text-slate-500 mt-3",children:[f.jsxs("span",{className:"font-semibold text-slate-400",children:[r("techDocTerms"),":"]})," ",o.termsOfService]}):null,o.contact&&(o.contact.name||o.contact.url||o.contact.email)?f.jsxs("p",{className:"text-xs text-slate-500 mt-2",children:[f.jsxs("span",{className:"font-semibold text-slate-400",children:[r("techDocContact"),":"]})," ",[o.contact.name,o.contact.email,o.contact.url].filter(Boolean).join(" · ")]}):null,(d=o.license)!=null&&d.name?f.jsxs("p",{className:"text-xs text-slate-500 mt-2",children:[f.jsxs("span",{className:"font-semibold text-slate-400",children:[r("techDocLicense"),":"]})," ",o.license.url?f.jsx("a",{href:o.license.url,className:"text-accent hover:underline",target:"_blank",rel:"noreferrer",children:o.license.name}):o.license.name]}):null]}),o.servers.length>0?f.jsxs("section",{children:[f.jsx("h2",{className:"text-lg font-semibold text-white mb-2",children:r("techDocServers")}),f.jsx("ul",{className:"list-disc pl-5 text-sm text-slate-300 space-y-1",children:o.servers.map(c=>f.jsxs("li",{children:[f.jsx("code",{className:"text-accent/90",children:c.url}),c.description?f.jsxs("span",{className:"text-slate-500",children:[" — ",c.description]}):null]},c.url))})]}):null,o.securityGlobal.length>0?f.jsxs("section",{children:[f.jsx("h2",{className:"text-lg font-semibold text-white mb-2",children:r("techDocSecurity")}),f.jsx("p",{className:"text-sm text-slate-300",children:o.securityGlobal.join(", ")})]}):null,f.jsxs("section",{children:[f.jsx("h2",{className:"text-lg font-semibold text-white mb-4",children:r("techDocEndpoints")}),f.jsx("div",{className:"space-y-10",children:o.groups.map(c=>f.jsxs("div",{children:[f.jsxs("h3",{className:"text-sm font-semibold uppercase tracking-wider text-accent/90 mb-3",children:[r("techDocTagSection"),": ",c.tag]}),f.jsx("div",{className:"space-y-8 pl-0 md:pl-2 border-l border-surface-700/50",children:c.operations.map(h=>f.jsxs("div",{className:"pl-3 md:pl-4 space-y-2",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx(Js,{method:h.method,size:"sm"}),f.jsx("code",{className:"text-sm text-slate-200 break-all",children:h.path}),h.deprecated?f.jsxs("span",{className:"text-[10px] uppercase text-amber-400/90",children:["(",r("techDocDeprecated"),")"]}):null]}),h.summary?f.jsx("p",{className:"text-sm font-medium text-slate-100",children:h.summary}):null,h.description?f.jsx("p",{className:"text-sm text-slate-400 whitespace-pre-wrap leading-relaxed",children:h.description}):h.summary?null:f.jsx("p",{className:"text-xs text-slate-600 italic",children:r("techDocNoDesc")}),h.parameters.length>0?f.jsxs("div",{className:"mt-2",children:[f.jsx("p",{className:"text-xs font-semibold text-slate-500 mb-1",children:r("techDocParameters")}),f.jsx("div",{className:"overflow-x-auto rounded-lg border border-surface-700/80",children:f.jsxs("table",{className:"w-full text-xs text-left",children:[f.jsx("thead",{className:"bg-surface-900/80 text-slate-400",children:f.jsxs("tr",{children:[f.jsx("th",{className:"px-2 py-1.5 font-medium",children:r("techDocColName")}),f.jsx("th",{className:"px-2 py-1.5 font-medium",children:r("techDocColIn")}),f.jsx("th",{className:"px-2 py-1.5 font-medium",children:r("techDocColReq")}),f.jsx("th",{className:"px-2 py-1.5 font-medium",children:r("techDocColType")}),f.jsx("th",{className:"px-2 py-1.5 font-medium",children:r("techDocColDescr")})]})}),f.jsx("tbody",{className:"text-slate-300 divide-y divide-surface-700/60",children:h.parameters.map(g=>f.jsxs("tr",{children:[f.jsx("td",{className:"px-2 py-1.5 font-mono",children:g.name}),f.jsx("td",{className:"px-2 py-1.5",children:g.in}),f.jsx("td",{className:"px-2 py-1.5",children:g.required?"✓":""}),f.jsx("td",{className:"px-2 py-1.5 font-mono text-[11px]",children:g.schemaHint??"—"}),f.jsx("td",{className:"px-2 py-1.5 text-slate-400",children:g.description??"—"})]},`${g.in}:${g.name}`))})]})})]}):null,h.requestBodyHint?f.jsxs("p",{className:"text-xs text-slate-400 mt-1",children:[f.jsxs("span",{className:"font-semibold text-slate-500",children:[r("techDocRequestBody"),":"]})," ",h.requestBodyHint]}):null,h.responses.length>0?f.jsxs("div",{className:"mt-2",children:[f.jsx("p",{className:"text-xs font-semibold text-slate-500 mb-1",children:r("techDocResponses")}),f.jsx("div",{className:"overflow-x-auto rounded-lg border border-surface-700/80",children:f.jsxs("table",{className:"w-full text-xs text-left",children:[f.jsx("thead",{className:"bg-surface-900/80 text-slate-400",children:f.jsxs("tr",{children:[f.jsx("th",{className:"px-2 py-1.5 font-medium",children:r("techDocColCode")}),f.jsx("th",{className:"px-2 py-1.5 font-medium",children:r("techDocColDescr")})]})}),f.jsx("tbody",{className:"text-slate-300 divide-y divide-surface-700/60",children:h.responses.map(g=>f.jsxs("tr",{children:[f.jsx("td",{className:"px-2 py-1.5 font-mono",children:g.code}),f.jsx("td",{className:"px-2 py-1.5 text-slate-400",children:g.description??"—"})]},g.code))})]})})]}):null]},`${h.method}:${h.path}`))})]},c.tag))})]}),f.jsxs("footer",{className:"text-[11px] text-slate-600 border-t border-surface-700/50 pt-4",children:[r("techDocFooterNote")," ",new Date().toISOString().slice(0,10)]})]})]})}function Hm(e,r){return r.some(o=>o.value===e)}const Md=[{id:"typescript",label:"TypeScript"},{id:"javascript",label:"JavaScript"},{id:"python",label:"Python"},{id:"php",label:"PHP"}];function Ad(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 D_(){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 Fm(e){await navigator.clipboard.writeText(e)}function R_(){var nr;const e=I2(),{t:r,locale:o,setLocale:i}=Wo(),a=I.useMemo(()=>D2(o),[o]),d=Bg()==="en"?Hg:Fg,[c,h]=I.useState(null),[g,x]=I.useState(null),[k,b]=I.useState("server"),[S,_]=I.useState(null),[j,P]=I.useState(null),[T,M]=I.useState("explore"),[V,$]=I.useState(""),[O,z]=I.useState(null),[R,W]=I.useState(null),[Y,le]=I.useState("typescript"),[we,ie]=I.useState(""),[de,te]=I.useState(""),[F,ce]=I.useState("X-Api-Key"),[J,ue]=I.useState({nodes:[],edges:[]}),[q,K]=I.useState(0),[Q,L]=I.useState(d.defaultFlowName),[U,je]=I.useState([]),[Ne,Re]=I.useState(""),[Oe,Le]=I.useState({name:d.suiteDefaultName,cases:[]}),[ke,$e]=I.useState([]),[_e,tt]=I.useState(""),[ze,Je]=I.useState(""),[at,mt]=I.useState(null),[ft,Mt]=I.useState(null),[Xt,nn]=I.useState(null),[Ht,Dt]=I.useState("openrouter"),[pn,ln]=I.useState(""),[An,en]=I.useState(""),[At,Rt]=I.useState(!1),[gn,Fn]=I.useState(!1),[un,ye]=I.useState(!1),[ot,pt]=I.useState(null),[Ft,vt]=I.useState(0),[Ue,bt]=I.useState([]),[Tt,yn]=I.useState("get"),[qe,zn]=I.useState(""),[Bn,Lr]=I.useState(""),[wr,Hr]=I.useState(""),[So,br]=I.useState(null),qn=(D,he)=>{try{const Ae=sessionStorage.getItem(D);if(Ae==="1")return!0;if(Ae==="0")return!1}catch{}return he},[jn,Xn]=I.useState(()=>qn("adt-collapse-main",!1)),[In,_t]=I.useState(()=>qn("adt-collapse-explore",!1)),zt="/docs/openapi.json",Sr="/docs/preset.json",Un=I.useMemo(()=>D_(),[]),rn=I.useCallback(async()=>{const[D,he]=await Promise.all([Ze.flows.toArray(),Ze.testSuites.toArray()]);je(D.sort((Ae,We)=>(Ae.name??"").localeCompare(We.name??""))),$e(he.sort((Ae,We)=>(Ae.name??"").localeCompare(We.name??"")))},[]),xn=I.useCallback(async()=>{const D=await Rx();bt(D.sort((he,Ae)=>he.path.localeCompare(Ae.path)||he.method.localeCompare(Ae.method)))},[]);I.useEffect(()=>{xn()},[xn]),I.useEffect(()=>{var he,Ae;if(!c)return;const D=((he=e.productName)==null?void 0:he.trim())||((Ae=c.info.title)==null?void 0:Ae.trim())||"API";document.title=D},[c,e.productName]);const Fr=I.useCallback(async()=>{if(_(null),Un)try{const he=await fetch(Un,{credentials:"omit",mode:"cors"});if(!he.ok)throw new Error(`${he.status} ${he.statusText}`);const Ae=await he.json();gd(Ae);const We=Ae;h(We),$(to(We)),x(null),b("remote");return}catch(he){x(he instanceof Error?he.message:String(he));return}const D=await Ze.kv.get(zi);if(D!=null&&D.value)try{const he=JSON.parse(D.value);gd(he);const Ae=he;h(Ae),$(to(Ae)),x(null),b("local");return}catch{await bh()}try{const he=await fetch(zt,{credentials:"include"});if(he.status===401){let We="/docs/__auth/login";try{const Ot=await he.json();Ot.loginPath&&(We=Ot.loginPath)}catch{}window.location.href=We;return}if(!he.ok)throw new Error(`${he.status} ${he.statusText}`);const Ae=await he.json();h(Ae),$(to(Ae)),x(null),b("server")}catch(he){x(he instanceof Error?he.message:String(he))}},[zt,Un]);I.useEffect(()=>{Fr()},[Fr]),I.useEffect(()=>{try{sessionStorage.setItem("adt-collapse-main",jn?"1":"0")}catch{}},[jn]),I.useEffect(()=>{try{sessionStorage.setItem("adt-collapse-explore",In?"1":"0")}catch{}},[In]),I.useEffect(()=>{(async()=>{try{const D=await fetch("/docs/__auth/session",{credentials:"include"});if(D.ok){const he=await D.json();nn({username:he.username})}else nn(null)}catch{nn(null)}})()},[]),I.useEffect(()=>{if(!c)return;let D=!1;return(async()=>{try{const he=await fetch(Sr,{credentials:"include"});if(!he.ok||D)return;const Ae=await he.json(),We=await zx(Ae);!D&&We&&await rn()}catch{}})(),()=>{D=!0}},[c,Sr,rn]),I.useEffect(()=>{rn(),Ze.kv.get("bearer").then(D=>D&&ie(D.value)),Ze.kv.get("apiKey").then(D=>D&&te(D.value))},[rn]),I.useEffect(()=>{const D=m_();Dt(D.provider),ln(D.model||pu(D.provider)),en(D.apiKey)},[]),I.useEffect(()=>{ye(!1)},[c]);const Qe=I.useMemo(()=>c?Ux(c,Ue):null,[c,Ue]),kr=I.useMemo(()=>Qe?Wm(Qe):[],[Qe]),yt=I.useMemo(()=>Qe?io(Qe):[],[Qe]),Nr=I.useMemo(()=>Qe?yt.map(D=>({method:D.method,path:D.path,operationId:D.operationId,tags:D.tags,deprecated:$d(Qe,D.method,D.path)})):[],[Qe,yt]);I.useEffect(()=>{if(!Qe||yt.length===0||un)return;const D=new URLSearchParams(window.location.search);if(Rm(window.location.search)){ye(!0);return}const he=S_(D.get(du));he&&yt.some(We=>We.method.toLowerCase()===he.method&&We.path===he.path)&&(pt(null),W({method:he.method,path:he.path}),M("explore")),ye(!0)},[Qe,yt,un]),I.useEffect(()=>{if(!un||!Qe)return;const D=new URL(window.location.href);if(Rm(D.search)){D.searchParams.delete(du),window.history.replaceState({},"",D.toString());return}T==="explore"&&R?D.searchParams.set(du,b_(R.method,R.path)):D.searchParams.delete(du),window.history.replaceState({},"",D.toString())},[un,Qe,T,R]),I.useEffect(()=>{if(!R||yt.length===0)return;if(!yt.some(he=>he.method.toLowerCase()===R.method.toLowerCase()&&he.path===R.path)){const he=yt[0];W(he?{method:he.method,path:he.path}:null)}},[yt,R]),I.useEffect(()=>{const D=he=>{(he.metaKey||he.ctrlKey)&&he.key.toLowerCase()==="k"&&(he.preventDefault(),Fn(Ae=>!Ae))};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[]);const ko=I.useMemo(()=>({savedFlows:U,testSuites:ke,selectedOperation:R}),[U,ke,R]),Cn=I.useMemo(()=>O?yt.filter(D=>(D.tags??["default"]).includes(O)):yt,[yt,O]);I.useEffect(()=>{if(yt.length&&!ze){const D=yt[0];Je(Ad(D.method,D.path))}},[yt,ze]),I.useEffect(()=>{if(yt.length===0||J.nodes.length>0||T!=="flows"||at!=null)return;const D=yt[0];ue({nodes:[{id:crypto.randomUUID(),method:D.method.toLowerCase(),path:D.path,x:80,y:120}],edges:[]}),K(he=>he+1)},[yt,J.nodes.length,T,at]);const Qn=I.useCallback(()=>{const D={"Content-Type":"application/json"};return we.trim()&&(D.Authorization=`Bearer ${we.trim()}`),de.trim()&&(D[F]=de.trim()),D},[we,de,F]),Gn=I.useCallback(()=>{pt(null)},[]),No=I.useCallback(D=>{W({method:D.method,path:D.path}),pt(D),M("explore")},[]);I.useEffect(()=>{T==="history"&&vt(D=>D+1)},[T]);const zr=I.useCallback(D=>{pt(null),W(D)},[]),It=I.useMemo(()=>{if(!Qe||!R)return null;const D={};for(const{id:he}of Md)D[he]=Sx(Qe,he,R.method,R.path);return D},[Qe,R]),Vn=I.useMemo(()=>Qe?Nx(Qe,Y,O):"",[Qe,Y,O]),ct=I.useMemo(()=>{var sn,Bt;if(!Qe||!R)return null;const D=(sn=Qe.paths)==null?void 0:sn[R.path];if(!D||typeof D!="object"||"$ref"in D)return null;const he=D[R.method.toLowerCase()];if(!he)return null;const Ae=typeof he.summary=="string"?he.summary:void 0,We=typeof he.description=="string"?he.description:void 0;let Ot=null;try{const rr=he.requestBody,Lt=(Bt=rr==null?void 0:rr.content)==null?void 0:Bt["application/json"];if((Lt==null?void 0:Lt.example)!==void 0)Ot=JSON.stringify(Lt.example,null,2);else if(Lt!=null&&Lt.examples&&typeof Lt.examples=="object"){const Pn=Object.values(Lt.examples)[0];Pn&&Pn.value!==void 0&&(Ot=JSON.stringify(Pn.value,null,2))}}catch{}return{summary:Ae,description:We,exampleStr:Ot}},[Qe,R]),Yo=I.useCallback(D=>{pt(null),W(D),M("explore")},[]),_r=async D=>{var Ot;if(!Qe)return"";const he={};let Ae="";const We=to(Qe,V);for(let sn=0;sn<D.length;sn++){const Bt=D[sn];let rr=Bt.path;for(const[sr,Vr]of Object.entries(he))rr=rr.replace(`{${sr}}`,Vr);const Lt=`${We}${rr}`,Pn={method:Bt.method.toUpperCase(),headers:Qn()},Qo=Bt.method.toLowerCase();Qo!=="get"&&Qo!=="head"&&(Pn.body="{}");const Go=await fetch(Lt,{...Pn,credentials:Ra(Lt)}),or=await Go.json().catch(()=>({}));if(Ae+=r("flowStepLine",{n:sn+1,status:String(Go.status),json:JSON.stringify(or,null,2)}),(Ot=Bt.extract)!=null&&Ot.jsonPath){const sr=Lu(or,Bt.extract.jsonPath);sr!==void 0&&(he[Bt.extract.varName]=String(sr))}}return Ae},lo=async()=>{if(!Qe)return;const D=to(Qe,V);if(J.nodes.length===0){Re(r("flowNeedNode"));return}const he=await Im(J,D,Qn);Re(he)},jr=async D=>{if(!Qe)return;const he=to(Qe,V),Ae=D.graph&&D.graph.nodes.length>0?await Im(D.graph,he,Qn):await _r(D.steps);Re(Ae),M("flows")},pr=D=>{L(D.name),ue(D.graph&&D.graph.nodes.length>0?D.graph:M2(D.steps.length?D.steps:[{method:"get",path:"/"}])),K(he=>he+1),mt(D.id??null),M("flows")},uo=()=>{mt(null),L(r("newFlowName")),yt[0]?ue({nodes:[{id:crypto.randomUUID(),method:yt[0].method.toLowerCase(),path:yt[0].path,x:80,y:120}],edges:[]}):ue({nodes:[],edges:[]}),K(D=>D+1)},Zn=I.useCallback(D=>{ue(D)},[]),En=async()=>{const D=$2(J);if(at!=null)await Ze.flows.update(at,{name:Q,steps:D,graph:J});else{const he=await Ze.flows.add({name:Q,steps:D,graph:J});mt(he)}await rn()},wt=async D=>{D!==void 0&&(D===at&&(mt(null),uo()),await Ze.flows.delete(D),await rn())},vn=()=>{if(!ze)return;const{method:D,path:he}=O_(ze),Ae={id:crypto.randomUUID(),method:D,path:he,expectStatus:200,contains:void 0,jsonPath:void 0,expectJsonValue:void 0};Le(We=>({...We,cases:[...We.cases,Ae]}))},Jo=D=>{Le(he=>({...he,cases:he.cases.filter(Ae=>Ae.id!==D)}))},Kn=(D,he)=>{Le(Ae=>({...Ae,cases:Ae.cases.map(We=>We.id===D?{...We,...he}:We)}))},hr=async D=>{if(!Qe)return"";const he=to(Qe,V);let Ae="";for(const We of D){const Ot=`${he}${We.path}`,sn=await fetch(Ot,{method:We.method.toUpperCase(),headers:Qn(),credentials:Ra(Ot)}),Bt=await sn.text(),rr=Vx(We,sn.status,Bt),Lt=`${rr.pass?"PASS":"FAIL"} ${We.method.toUpperCase()} ${We.path}`;Ae+=`${Lt}
266
+ ${rr.lines.map(Pn=>` ${Pn}`).join(`
267
+ `)}
268
+
269
+ `}return Ae},Br=async()=>{const D=await hr(Oe.cases);tt(D)},qr=async()=>{if(!Qe||ke.length===0)return;let D="";for(const he of ke)D+=r("testSuiteHeader",{name:he.name,count:he.cases.length}),D+=await hr(he.cases);tt(D),M("tests")},Wn=async D=>{const he=await hr(D.cases);tt(he),M("tests")},jt=D=>{Le({name:D.name,cases:D.cases.map(he=>({...he,id:he.id&&he.id.length>0?he.id:crypto.randomUUID()}))}),Mt(D.id??null),M("tests")},Cr=()=>{Mt(null),Le({name:r("newSuiteName"),cases:[]})},Ur=async()=>{if(ft!=null)await Ze.testSuites.update(ft,{name:Oe.name,cases:Oe.cases});else{const D=await Ze.testSuites.add({name:Oe.name,cases:Oe.cases});Mt(D)}await rn()},er=async D=>{D!==void 0&&(D===ft&&(Mt(null),Le({name:r("newSuiteName"),cases:[]})),await Ze.testSuites.delete(D),await rn())},Er=async()=>{await Ze.kv.put({key:"bearer",value:we}),await Ze.kv.put({key:"apiKey",value:de})},Pr=async()=>{P(null);const D=await Fx(),he=new Blob([JSON.stringify(D,null,2)],{type:"application/json"}),Ae=document.createElement("a");Ae.href=URL.createObjectURL(he),Ae.download="api-doc-tor-estado-app.json",Ae.click(),URL.revokeObjectURL(Ae.href)},tr=async D=>{var Ae;const he=(Ae=D.target.files)==null?void 0:Ae[0];if(D.target.value="",!!he){P(null);try{const We=await he.text(),Ot=JSON.parse(We);if(Ot.formatVersion!==1)throw new Error(r("bundleImportInvalid"));await Qm(Ot),await rn(),await xn(),await Fr()}catch(We){P(We instanceof Error?We.message:String(We))}}},_o=I.useCallback(async()=>{if(br(null),!c)return;const D=Su(qe),he=Tt.trim().toLowerCase();if(!/^(get|post|put|patch|delete|options|head|trace)$/.test(he)){br(r("playgroundInvalidMethod"));return}if(!qe.trim()){br(r("playgroundPathRequired"));return}if(qx(c,he,D)){br(r("playgroundOpExistsRemote"));return}if(Ue.some(Ot=>Su(Ot.path)===D&&Ot.method.toLowerCase()===he)){br(r("playgroundOpDuplicate"));return}const We=Bn.trim()||`${he.toUpperCase()} ${D}`;await Lx({method:he,path:D,summary:We,...wr.trim()?{description:wr.trim()}:{}}),await xn(),zn(""),Lr(""),Hr("")},[c,qe,Tt,Bn,wr,Ue,xn,r]),co=I.useCallback(async D=>{await Hx(D),await xn()},[xn]),Et=I.useCallback(()=>{var We;if(!Qe)return;const D=new Blob([JSON.stringify(Qe,null,2)],{type:"application/json"}),he=document.createElement("a"),Ae=(((We=Qe.info)==null?void 0:We.title)??"openapi").replace(/[^\w\-.]+/g,"-").slice(0,80);he.href=URL.createObjectURL(D),he.download=`${Ae||"openapi"}.json`,he.click(),URL.revokeObjectURL(he.href)},[Qe]),ei=async D=>{var Ae;const he=(Ae=D.target.files)==null?void 0:Ae[0];if(D.target.value="",!!he){_(null);try{const We=await he.text(),Ot=JSON.parse(We);gd(Ot);const sn=Ot;await Tx(sn),h(sn),$(to(sn)),x(null),b("local"),pt(null),W(null),z(null)}catch(We){_(We instanceof Error?We.message:String(We))}}},Nt=I.useCallback(async()=>{_(null),await bh(),await Fr()},[Fr]),Xo=I.useCallback(()=>{const D=new URL(window.location.href);D.searchParams.delete("spec"),window.location.replace(D.pathname+D.search+D.hash)},[]),_s=async()=>{await fetch("/docs/__auth/logout",{method:"POST",credentials:"include"}),window.location.href="/docs/__auth/login"},ti=I.useCallback(()=>{Rt(!0)},[]),wn=I.useCallback(()=>{g_(Ht,pn.trim(),An),Rt(!1)},[An,pn,Ht]);I.useEffect(()=>{if(!At)return;const D=he=>{he.key==="Escape"&&Rt(!1)};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[At]);const Tr=()=>{R&&(ue(D=>{const he=D.nodes[D.nodes.length-1],Ae=he?he.x+280:80,We=(he==null?void 0:he.y)??120;return{nodes:[...D.nodes,{id:crypto.randomUUID(),method:R.method.toLowerCase(),path:R.path,x:Ae,y:We}],edges:D.edges}}),K(D=>D+1),M("flows"))},$r=I.useMemo(()=>O===null?r("filterHintAll"):r("filterHintTag",{tag:O??""}),[O,r]);if(g)return f.jsx("div",{className:"app-glass-bg min-h-screen flex items-center justify-center p-8",children:f.jsxs("div",{role:"alert",className:"glass-card max-w-lg border-red-500/40 bg-red-950/25 p-6 text-red-100",children:[f.jsx("h1",{className:"font-display text-xl font-bold mb-2",children:r("errLoadOpenApi")}),f.jsx("p",{className:"text-sm opacity-90 leading-relaxed",children:g}),f.jsxs("p",{className:"text-xs mt-4 text-slate-500",children:[r("errUrlTried")," ",zt]})]})});if(!Qe)return f.jsx("div",{className:"app-glass-bg min-h-screen flex items-center justify-center p-6",children:f.jsx("div",{className:"glass-card px-8 py-6 border-white/[0.08]",children:f.jsx("p",{className:"text-slate-300 motion-safe:animate-pulse text-sm font-medium",children:r("loadingSpec")})})});const on=((nr=e.productName)==null?void 0:nr.trim())||Qe.info.title;return f.jsxs("div",{className:"app-glass-bg min-h-screen flex flex-col selection:bg-accent/25 selection:text-slate-50",children:[f.jsx("a",{href:"#main-content",className:"skip-link",children:r("skipToContent")}),f.jsxs("div",{className:"flex flex-1 flex-col md:flex-row min-h-0",children:[f.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 ${jn?"md:w-14 md:min-w-[3.5rem]":"md:w-64"}`,children:[f.jsx("input",{id:"adt-state-import",type:"file",accept:"application/json,.json",className:"hidden",onChange:tr}),f.jsx("input",{id:"adt-openapi-import",type:"file",accept:"application/json,.json",className:"hidden",onChange:ei}),f.jsxs("div",{className:jn?"max-md:block md:hidden":"block",children:[f.jsxs("div",{className:"p-4 border-b border-surface-700 flex justify-between items-start gap-2",children:[f.jsxs("div",{className:"min-w-0",children:[e.logoDataUrl?f.jsx("img",{src:e.logoDataUrl,alt:on,className:"h-9 max-w-[200px] object-contain object-left mb-2"}):null,f.jsx("h1",{className:"font-display text-lg font-bold text-white tracking-tight",children:on}),f.jsx("p",{className:"text-xs text-slate-500 mt-1",children:on===Qe.info.title?`v${Qe.info.version}`:`${Qe.info.title} · v${Qe.info.version}`})]}),f.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:()=>Xn(!0),"aria-label":r("hideMainSidebar"),title:r("hideMainSidebarTitle"),children:"‹"})]}),f.jsx("nav",{className:"p-2 flex flex-row md:flex-col gap-1 overflow-x-auto","aria-label":r("mainNav"),children:[["explore",r("navExplore")],["flows",r("navFlows",{count:U.length})],["tests",r("navTests",{count:ke.length})],["history",r("navHistory")],["schemas",r("navSchemas")],["techdoc",r("navTechDoc")],["auth",r("navAuth")]].map(([D,he])=>f.jsx("button",{type:"button",onClick:()=>M(D),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 ${T===D?"glass-pill-active text-accent":"text-slate-400 glass-pill hover:text-slate-200"}`,children:he},D))}),Xt?f.jsxs("div",{className:"px-3 py-2 border-t border-surface-700 flex items-center justify-between gap-2 text-xs",children:[f.jsx("span",{className:"text-slate-400 truncate",title:Xt.username,children:Xt.username}),f.jsx("button",{type:"button",className:"shrink-0 text-accent hover:underline",onClick:()=>void _s(),children:r("logout")})]}):null,f.jsxs("div",{className:"p-3 border-t border-surface-700 space-y-2",children:[f.jsx("button",{type:"button",onClick:()=>Rt(!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:r("assistantLlmMenu")}),j?f.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:j}):null,f.jsx("button",{type:"button",onClick:()=>void Pr(),className:"w-full text-xs py-2.5 rounded-xl glass-pill text-slate-300 min-h-[44px] md:min-h-0",children:r("exportAppState")}),f.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:r("importAppState")})]})]}),jn?f.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:[f.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:()=>Xn(!1),"aria-label":r("showMainSidebar"),title:r("showMainSidebarTitle"),children:f.jsx(Dm,{className:"text-slate-300"})}),f.jsxs("nav",{className:"flex flex-col gap-0.5 items-center w-full py-1 border-b border-surface-700/80","aria-label":r("sectionsNav"),children:[f.jsx("button",{type:"button",onClick:()=>M("explore"),title:r("navExplore"),"aria-current":T==="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 ${T==="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:f.jsx(Q2,{})}),f.jsxs("button",{type:"button",onClick:()=>M("flows"),title:r("navFlows",{count:U.length}),"aria-current":T==="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 ${T==="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:[f.jsx(G2,{}),U.length>0?f.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:U.length>99?"99+":U.length}):null]}),f.jsxs("button",{type:"button",onClick:()=>M("tests"),title:r("navTests",{count:ke.length}),"aria-current":T==="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 ${T==="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:[f.jsx(n_,{}),ke.length>0?f.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:ke.length>99?"99+":ke.length}):null]}),f.jsx("button",{type:"button",onClick:()=>M("history"),title:r("tryHistoryTitle"),"aria-current":T==="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 ${T==="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:f.jsx(t_,{})}),f.jsx("button",{type:"button",onClick:()=>M("schemas"),title:r("navSchemas"),"aria-current":T==="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 ${T==="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:f.jsx(Z2,{})}),f.jsx("button",{type:"button",onClick:()=>M("techdoc"),title:r("navTechDoc"),"aria-current":T==="techdoc"?"page":void 0,className:`touch-target w-11 h-11 rounded-lg border flex items-center justify-center shrink-0 transition-colors duration-200 ${T==="techdoc"?"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:f.jsx(e_,{})}),f.jsx("button",{type:"button",onClick:()=>Rt(!0),title:r("assistantConfigureLlm"),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:f.jsx(ty,{})}),f.jsxs("button",{type:"button",onClick:()=>M("auth"),title:r("navAuth"),"aria-current":T==="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 ${T==="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:[f.jsx(r_,{}),Xt?f.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]})]}),f.jsxs("div",{className:"flex flex-col gap-0.5 items-center w-full py-1 mt-auto border-t border-surface-700/80",children:[f.jsx("button",{type:"button",onClick:()=>void Pr(),title:r("exportAppStateTitle"),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:f.jsx(o_,{})}),f.jsx("button",{type:"button",onClick:()=>{var D;return(D=document.getElementById("adt-state-import"))==null?void 0:D.click()},title:r("importAppStateTitle"),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:f.jsx(s_,{})}),Xt?f.jsx("button",{type:"button",onClick:()=>void _s(),title:r("logoutUserTitle",{user:Xt.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:f.jsx(i_,{})}):null]})]}):null]}),f.jsxs("main",{id:"main-content",tabIndex:-1,className:"flex-1 flex flex-col min-h-0 outline-none",children:[f.jsxs("header",{className:"glass-sticky-header sticky top-0 z-20 px-4 py-3 flex flex-wrap gap-3 items-center",children:[f.jsxs("label",{className:"text-xs text-slate-500 flex flex-col gap-1 sm:flex-row sm:items-center",children:[f.jsx("span",{className:"shrink-0 font-medium text-slate-400",children:r("baseUrl")}),f.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:V,onChange:D=>$(D.target.value),placeholder:r("baseUrlPlaceholder"),autoComplete:"url",spellCheck:!1})]}),f.jsxs("label",{className:"text-xs text-slate-500 flex flex-col gap-1 sm:flex-row sm:items-center",children:[f.jsx("span",{className:"shrink-0 font-medium text-slate-400",children:r("language")}),f.jsxs("select",{className:"glass-input sm:ml-2 min-h-[44px] sm:min-h-0 border rounded-xl px-3 py-2 text-sm bg-surface-900 text-slate-200",value:o,onChange:D=>i(D.target.value),"aria-label":r("language"),children:[f.jsx("option",{value:"es",children:r("langEs")}),f.jsx("option",{value:"en",children:r("langEn")})]})]})]}),T==="explore"&&f.jsxs("div",{className:"flex-1 flex flex-col lg:flex-row min-h-0",children:[f.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 ${In?"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:[f.jsxs("div",{className:In?"max-lg:block lg:hidden":"block",children:[f.jsxs("div",{className:"p-2 flex items-start justify-between gap-2 border-b border-surface-700 lg:border-b-0",children:[f.jsx("p",{className:"text-xs uppercase tracking-wider text-slate-500 shrink-0",children:r("tagsHeading")}),f.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:()=>_t(!0),"aria-label":r("hideEndpointList"),title:r("hideEndpointsTitle"),children:"‹"})]}),f.jsx("div",{className:"p-2 pt-1",children:f.jsxs("div",{className:"flex flex-wrap gap-1",children:[f.jsx("button",{type:"button",onClick:()=>z(null),className:`text-xs px-3 py-2 sm:py-1 rounded-xl min-h-[40px] sm:min-h-0 transition-all duration-200 ${O===null?"glass-pill-active text-slate-100":"glass-pill text-slate-300"}`,children:r("tagsAll")}),kr.map(D=>f.jsx("button",{type:"button",onClick:()=>z(D),className:`text-xs px-3 py-2 sm:py-1 rounded-xl min-h-[40px] sm:min-h-0 transition-all duration-200 ${O===D?"glass-pill-active text-slate-100":"glass-pill text-slate-300"}`,children:D},D))]})}),f.jsx("ul",{className:"text-sm",children:Cn.map(D=>f.jsx("li",{children:f.jsxs("button",{type:"button",onClick:()=>zr({method:D.method,path:D.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 ${(R==null?void 0:R.method)===D.method&&R.path===D.path?"glass-pill-active border-l-2 border-accent ml-0.5":"hover:bg-white/[0.04]"}`,children:[f.jsx(Js,{method:D.method}),f.jsxs("span",{className:"flex-1 min-w-0 flex items-center gap-1.5",children:[f.jsx("span",{className:"truncate text-slate-300",children:D.path}),Qe&&$d(Qe,D.method,D.path)?f.jsx("span",{className:"shrink-0 text-[9px] uppercase text-amber-400/90",title:"Deprecated",children:r("deprecatedBadge")}):null]})]})},`${D.method}:${D.path}`))})]}),In?f.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:[f.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:()=>_t(!1),"aria-label":r("showEndpointList"),title:r("showEndpointListTitle"),children:f.jsx(Dm,{className:"text-slate-300"})}),f.jsxs("div",{className:"text-center text-[9px] font-mono text-slate-500 leading-none px-0.5",title:r("opsCountTitle",{count:Cn.length}),children:[f.jsx("span",{className:"block text-slate-400 font-semibold text-[11px]",children:Cn.length}),f.jsx("span",{className:"text-[8px] uppercase tracking-tighter",children:r("opsShortLabel")})]}),f.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":r("endpointsNumbered"),children:Cn.map((D,he)=>{const Ae=(R==null?void 0:R.method)===D.method&&R.path===D.path;return f.jsx("button",{type:"button",role:"listitem",title:`${D.method.toUpperCase()} ${D.path}`,onClick:()=>zr({method:D.method,path:D.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 ${X2(D.method)} ${Ae?"ring-2 ring-accent/80 shadow-[inset_0_0_0_1px_rgba(56,189,248,0.2)]":""}`,children:he+1},`${D.method}:${D.path}`)})})]}):null]}),f.jsxs("div",{className:"flex-1 p-4 overflow-auto space-y-6",children:[f.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:[f.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[f.jsxs("div",{children:[f.jsx("h2",{id:"adt-openapi-tools-heading",className:"text-sm font-semibold text-slate-200",children:r("openApiDocHeading")}),f.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:[r("sourceLabel")," ",f.jsx("span",{className:"text-slate-300 font-medium",children:r(k==="local"?"sourceLocal":k==="remote"?"sourceRemote":"sourceServer")})]})]}),f.jsxs("div",{className:"flex flex-wrap gap-2 justify-end",children:[f.jsx("button",{type:"button",onClick:Et,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:r("exportOpenApi")}),f.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:r("importOpenApi")}),k==="local"?f.jsx("button",{type:"button",onClick:()=>void Nt(),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:r("useServerSpec")}):null,k==="remote"?f.jsx("button",{type:"button",onClick:()=>Xo(),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:r("useSiteOpenapi")}):null]})]}),f.jsx("p",{className:"text-[11px] text-slate-500 leading-relaxed",children:r("openApiImportHelp")}),S?f.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:S}):null,k==="remote"?f.jsxs("div",{className:"mt-4 pt-4 border-t border-surface-600/40 space-y-3",children:[f.jsx("h3",{className:"text-xs font-semibold text-slate-300",children:r("playgroundEndpointsHeading")}),f.jsx("p",{className:"text-[11px] text-slate-500 leading-relaxed",children:r("playgroundEndpointsHelp")}),f.jsxs("div",{className:"flex flex-wrap gap-2 items-end",children:[f.jsxs("label",{className:"text-[11px] text-slate-400 flex flex-col gap-1",children:[r("method"),f.jsx("select",{className:"bg-surface-800 border border-surface-600 rounded-lg px-2 py-1.5 text-sm text-slate-200",value:Tt,onChange:D=>yn(D.target.value),children:["get","post","put","patch","delete","options","head","trace"].map(D=>f.jsx("option",{value:D,children:D.toUpperCase()},D))})]}),f.jsxs("label",{className:"text-[11px] text-slate-400 flex flex-col gap-1 min-w-[8rem] flex-1",children:[r("path"),f.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:qe,onChange:D=>zn(D.target.value),placeholder:"/recurso/{id}",autoComplete:"off"})]}),f.jsxs("label",{className:"text-[11px] text-slate-400 flex flex-col gap-1 flex-1 min-w-[10rem]",children:[r("summary"),f.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded-lg px-2 py-1.5 text-sm text-slate-200",value:Bn,onChange:D=>Lr(D.target.value),placeholder:r("summaryPlaceholder"),autoComplete:"off"})]})]}),f.jsxs("label",{className:"text-[11px] text-slate-400 flex flex-col gap-1",children:[r("descriptionOptional"),f.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:wr,onChange:D=>Hr(D.target.value),rows:2})]}),So?f.jsx("p",{className:"text-[11px] text-rose-300/95",role:"alert",children:So}):null,f.jsx("button",{type:"button",onClick:()=>void _o(),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:r("addEndpoint")}),Ue.length>0?f.jsx("ul",{className:"space-y-1.5 mt-2",children:Ue.map(D=>f.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:[f.jsxs("span",{className:"font-mono text-slate-200",children:[f.jsx("span",{className:"text-emerald-400/90",children:D.method.toUpperCase()})," ",D.path]}),f.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 co(D.id),children:r("remove")})]},D.id))}):f.jsx("p",{className:"text-[11px] text-slate-600",children:r("noManualEndpoints")})]}):null]}),R?f.jsxs(f.Fragment,{children:[f.jsxs("div",{children:[f.jsxs("h2",{className:"font-display font-semibold text-white text-lg flex flex-wrap items-center gap-2",children:[f.jsx(Js,{method:R.method,size:"md"}),f.jsx("span",{className:"font-mono text-slate-200 break-all",children:R.path}),Qe&&$d(Qe,R.method,R.path)?f.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:r("deprecatedLabel")}):null]}),ct!=null&&ct.summary?f.jsx("p",{className:"text-sm text-slate-300 mt-2 leading-relaxed",children:ct.summary}):null,ct!=null&&ct.description&&ct.description!==ct.summary?f.jsx("p",{className:"text-xs text-slate-500 mt-2 leading-relaxed whitespace-pre-wrap",children:ct.description}):null,ct!=null&&ct.exampleStr?f.jsxs("details",{className:"mt-3 group",children:[f.jsx("summary",{className:"text-xs text-slate-400 cursor-pointer hover:text-slate-300",children:r("exampleRequestBody")}),f.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:ct.exampleStr})]}):null,f.jsxs("p",{className:"text-xs text-slate-500 mt-2",children:[r("opHeading")," ",$r]})]}),Qe?f.jsx(J2,{doc:Qe,selectedOp:R,baseUrl:V,buildHeaders:Qn,hydrateEntry:ot,onHydrateConsumed:Gn}):null,f.jsxs("section",{className:"space-y-3",children:[f.jsx("h3",{className:"text-sm font-medium text-slate-300",children:r("snippetsByLang")}),f.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:It&&Md.map(({id:D,label:he})=>f.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/60 overflow-hidden",children:[f.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-surface-700 bg-surface-800/50",children:[f.jsx("span",{className:"text-xs font-medium text-accent",children:he}),f.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-surface-600",onClick:()=>void Fm(It[D]),children:r("copy")})]}),f.jsx("pre",{className:"text-[11px] p-3 overflow-auto max-h-56 text-slate-300 font-mono whitespace-pre-wrap",children:It[D]})]},D))})]}),f.jsxs("section",{className:"space-y-3 rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[f.jsx("h3",{className:"text-sm font-medium text-slate-300",children:r("generatedClientHeading")}),f.jsx("p",{className:"text-xs text-slate-500",children:$r}),f.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[f.jsxs("label",{className:"text-xs text-slate-400",children:[r("fileLanguage"),f.jsx("select",{className:"ml-2 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:Y,onChange:D=>le(D.target.value),children:Md.map(({id:D,label:he})=>f.jsx("option",{value:D,children:he},D))})]}),f.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg bg-surface-700 hover:bg-surface-600",onClick:()=>void Fm(Vn),children:r("copyService")})]}),f.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:Vn})]}),f.jsx("div",{className:"flex flex-wrap gap-2 pt-2 border-t border-surface-800",children:f.jsx("button",{type:"button",className:"text-xs px-3 py-2 rounded-lg bg-surface-800 hover:bg-surface-700",onClick:Tr,children:r("addOpToFlowHint")})})]}):f.jsx("p",{className:"text-slate-500",children:r("selectOperationHint")})]})]}),T==="history"&&f.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:f.jsx(k_,{listKey:Ft,onReplay:No})}),T==="schemas"&&f.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:f.jsx(v_,{doc:Qe})}),T==="techdoc"&&f.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:f.jsx(I_,{doc:Qe})}),T==="flows"&&f.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[f.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4",children:[f.jsx("h3",{className:"text-sm font-semibold text-white mb-3",children:r("savedFlowsHeading")}),U.length===0?f.jsx("p",{className:"text-sm text-slate-500",children:r("noFlowsYet")}):f.jsx("ul",{className:"space-y-2",children:U.map(D=>{var he,Ae;return f.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:[f.jsxs("div",{children:[f.jsx("span",{className:"text-sm text-slate-200 font-medium",children:D.name}),f.jsx("span",{className:"text-xs text-slate-500 ml-2",children:r("nodesCount",{count:(((Ae=(he=D.graph)==null?void 0:he.nodes)==null?void 0:Ae.length)??D.steps.length)||0})})]}),f.jsxs("div",{className:"flex flex-wrap gap-2",children:[f.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:r("flowPlaySavedTooltip"),onClick:()=>void jr(D),children:r("play")}),f.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent hover:bg-accent/30",onClick:()=>pr(D),children:r("edit")}),f.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 wt(D.id),children:r("delete")})]})]},D.id!=null?`flow-${D.id}`:`flow-${D.name}`)})})]}),f.jsxs("section",{className:"space-y-4 max-w-6xl",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[f.jsx("h3",{className:"text-sm font-semibold text-white",children:r("flowEditorHeading")}),f.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:uo,children:r("newFlow")})]}),at!=null&&f.jsx("p",{className:"text-xs text-accent",children:r("editingFlow",{id:at})}),f.jsx("p",{className:"text-sm text-slate-400",children:r("flowEditorIntro")}),f.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm w-full max-w-md",value:Q,onChange:D=>L(D.target.value),placeholder:r("flowNamePlaceholder")}),f.jsx(C2,{doc:Qe,ops:yt,graph:J,onGraphChange:Zn,baseUrl:V,buildHeaders:Qn},q),f.jsxs("div",{className:"flex flex-wrap gap-2",children:[f.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 lo(),children:r("playGraph")}),f.jsx("button",{type:"button",className:"px-3 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void En(),children:at!=null?r("saveFlowChanges"):r("saveFlow")})]}),f.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:Ne||r("flowRunPlaceholder")})]})]}),T==="tests"&&f.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[f.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[f.jsx("h3",{className:"text-sm font-semibold text-white",children:r("savedSuitesHeading")}),ke.length>0&&f.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 qr(),children:r("runAllSuites")})]}),ke.length===0?f.jsx("p",{className:"text-sm text-slate-500",children:r("noSuitesSaved")}):f.jsx("ul",{className:"space-y-2",children:ke.map(D=>f.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:[f.jsxs("div",{children:[f.jsx("span",{className:"text-sm text-slate-200 font-medium",children:D.name}),f.jsx("span",{className:"text-xs text-slate-500 ml-2",children:r("casesCount",{count:D.cases.length})})]}),f.jsxs("div",{className:"flex flex-wrap gap-2",children:[f.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 Wn(D),children:r("play")}),f.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent",onClick:()=>jt(D),children:r("edit")}),f.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-red-900/40",onClick:()=>void er(D.id),children:r("delete")})]})]},D.id!=null?`suite-${D.id}`:`suite-${D.name}`))})]}),f.jsxs("section",{className:"space-y-4",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[f.jsx("h3",{className:"text-sm font-semibold text-white",children:r("suiteEditorHeading")}),f.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:Cr,children:r("newSuite")})]}),ft!=null&&f.jsx("p",{className:"text-xs text-accent",children:r("editingSuite",{id:ft})}),f.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm max-w-md",value:Oe.name,onChange:D=>Le(he=>({...he,name:D.target.value})),placeholder:r("suiteNamePlaceholder")}),f.jsxs("div",{className:"flex flex-wrap gap-2 items-end rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[f.jsxs("label",{className:"text-xs text-slate-400 flex-1 min-w-[200px]",children:[r("addEndpointFromSpec"),f.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm font-mono",value:ze,onChange:D=>Je(D.target.value),children:yt.map(D=>f.jsxs("option",{value:Ad(D.method,D.path),children:[D.method.toUpperCase()," ",D.path]},Ad(D.method,D.path)))})]}),f.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-800 text-sm hover:bg-surface-700",onClick:vn,children:r("addToSuite")})]}),f.jsx("ul",{className:"space-y-4",children:Oe.cases.map(D=>{const he=Hm(D.expectStatus,a)?String(D.expectStatus):"custom";return f.jsxs("li",{className:"rounded-xl border border-surface-700 bg-surface-950/40 p-4 space-y-3 text-sm",children:[f.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[f.jsxs("span",{className:"flex flex-wrap items-center gap-2 min-w-0",children:[f.jsx(Js,{method:D.method}),f.jsx("span",{className:"font-mono text-xs text-slate-300 break-all",children:D.path})]}),f.jsx("button",{type:"button",className:"text-xs text-red-400 hover:underline shrink-0",onClick:()=>Jo(D.id),children:r("remove")})]}),f.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[f.jsxs("label",{className:"text-xs text-slate-400 block",children:[r("expectedHttp"),f.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[f.jsxs("select",{className:"bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm max-w-[200px]",value:he,onChange:Ae=>{const We=Ae.target.value;if(We==="custom"){Kn(D.id,{expectStatus:Hm(D.expectStatus,a)?1e3:D.expectStatus});return}Kn(D.id,{expectStatus:Number(We)})},children:[a.map(Ae=>f.jsx("option",{value:String(Ae.value),children:Ae.label},Ae.value)),f.jsx("option",{value:"custom",children:r("httpOther")})]}),he==="custom"&&f.jsx("input",{type:"number",className:"w-20 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:D.expectStatus,onChange:Ae=>Kn(D.id,{expectStatus:Number(Ae.target.value)||0})})]})]}),f.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:[r("bodyContainsOptional"),f.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:r("bodyContainsPh"),value:D.contains??"",onChange:Ae=>Kn(D.id,{contains:Ae.target.value||void 0})})]}),f.jsxs("label",{className:"text-xs text-slate-400 block",children:[r("jsonPathOptional"),f.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:r("jsonPathPh"),value:D.jsonPath??"",onChange:Ae=>Kn(D.id,{jsonPath:Ae.target.value||void 0})})]}),f.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:[r("expectedJsonPathValue"),f.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:r("expectedJsonPathPlaceholder"),value:D.expectJsonValue??"",onChange:Ae=>Kn(D.id,{expectJsonValue:Ae.target.value||void 0})})]})]})]},D.id)})}),f.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[f.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 Br(),children:r("runAllCasesInSuite")}),f.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void Ur(),children:ft!=null?r("saveSuiteChanges"):r("saveSuite")})]}),f.jsx("pre",{className:"text-xs bg-surface-950 border border-surface-700 rounded-lg p-3 whitespace-pre-wrap min-h-[4rem]",children:_e||"—"})]})]}),T==="auth"&&f.jsxs("div",{className:"p-4 space-y-4 max-w-lg",children:[f.jsxs("p",{className:"text-sm text-slate-400",children:[r("authSchemesInSpec")," ",_x(Qe).join(", ")||r("none")]}),f.jsxs("label",{className:"block text-sm",children:[r("bearerToken"),f.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:we,onChange:D=>ie(D.target.value),placeholder:r("bearerPlaceholder")})]}),f.jsxs("label",{className:"block text-sm",children:[r("apiKeyHeader"),f.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:F,onChange:D=>ce(D.target.value)})]}),f.jsxs("label",{className:"block text-sm",children:[r("apiKey"),f.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:de,onChange:D=>te(D.target.value),type:"password",autoComplete:"off"})]}),f.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void Er(),children:r("rememberInBrowser")})]})]})]}),f.jsx(y_,{open:gn,onClose:()=>Fn(!1),ops:Nr,onPick:Yo}),At?f.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:()=>Rt(!1),children:f.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:D=>D.stopPropagation(),children:[f.jsxs("div",{className:"flex items-start justify-between gap-2 px-4 py-3 border-b border-white/[0.08]",children:[f.jsx("h2",{id:"adt-llm-modal-title",className:"text-sm font-semibold text-slate-100 pr-2",children:r("llmModalTitle")}),f.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:()=>Rt(!1),"aria-label":r("llmModalClose"),children:"×"})]}),f.jsxs("div",{className:"px-4 py-4 space-y-3",children:[f.jsx("p",{className:"text-xs text-slate-400 leading-relaxed",children:r("llmKeyBrowserOnly")}),f.jsxs("label",{className:"block text-xs text-slate-400",children:[r("llmProvider"),f.jsxs("select",{className:"glass-input mt-1 w-full border rounded-xl px-3 py-2 text-sm text-slate-200",value:Ht,onChange:D=>{const he=D.target.value;Dt(he),ln(Ae=>Ae.trim()?Ae:pu(he))},children:[f.jsx("option",{value:"anthropic",children:"Anthropic (Claude)"}),f.jsx("option",{value:"openai",children:"OpenAI"}),f.jsx("option",{value:"openrouter",children:"OpenRouter"})]})]}),f.jsxs("label",{className:"block text-xs text-slate-400",children:[r("llmModelOptional"),f.jsx("input",{className:"glass-input mt-1 w-full border rounded-xl px-3 py-2 text-sm font-mono text-slate-200",value:pn,onChange:D=>ln(D.target.value),placeholder:pu(Ht),spellCheck:!1})]}),f.jsxs("label",{className:"block text-xs text-slate-400",children:[r("llmApiKey"),f.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:An,onChange:D=>en(D.target.value),placeholder:Ht==="anthropic"?"sk-ant-…":Ht==="openai"?"sk-…":"sk-or-v1-…",autoComplete:"off"})]}),f.jsxs("div",{className:"flex flex-wrap gap-2 pt-1",children:[f.jsx("button",{type:"button",onClick:wn,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:r("save")}),f.jsx("button",{type:"button",onClick:()=>Rt(!1),className:"px-4 py-2.5 rounded-xl glass-pill text-slate-300 text-sm",children:r("cancel")})]})]})]})}):null,f.jsx(h_,{doc:Qe,contextExtras:ko,provider:Ht,model:pn,apiKey:An,onOpenLlmSettings:ti}),f.jsx("footer",{className:"glass-footer px-3 py-2.5 text-center text-[11px] text-slate-500 shrink-0",children:r("footerCredit")})]})}const L_={surface950:"#0c0f14",surface900:"#12171f",surface800:"#1a2230",surface700:"#243044",accent:"#38bdf8",accentDim:"#0ea5e9"};function Oi(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 H_(e){return{...L_,...e}}function F_(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 z_(e){var o;const r=H_(e==null?void 0:e.colors);return{productName:((o=e==null?void 0:e.productName)==null?void 0:o.trim())||null,logoDataUrl:e?F_(e):null,colors:r,colorsRgb:{surface950:Oi(r.surface950),surface900:Oi(r.surface900),surface800:Oi(r.surface800),surface700:Oi(r.surface700),accent:Oi(r.accent),accentDim:Oi(r.accentDim)}}}const B_={credentials:"include"};function q_(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 U_(){const e=z_(void 0);try{const r=await fetch("/docs/ui-config.json",B_);return r.status===401?{...e,docsAuthRequired:!0}:r.ok?await r.json():e}catch{return e}}(async()=>{const e=await U_();q_(e.colorsRgb),ix.createRoot(document.getElementById("root")).render(f.jsx(zm.StrictMode,{children:f.jsx(A2,{value:{productName:e.productName,logoDataUrl:e.logoDataUrl},children:f.jsx(s2,{children:f.jsx(R_,{})})})}))})();