@api-doc-tor/express 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/chat-proxy.d.ts +12 -0
  2. package/dist/chat-proxy.d.ts.map +1 -0
  3. package/dist/chat-proxy.js +44 -0
  4. package/dist/chat-proxy.js.map +1 -0
  5. package/dist/docs-access-express.d.ts +16 -0
  6. package/dist/docs-access-express.d.ts.map +1 -0
  7. package/dist/docs-access-express.js +187 -0
  8. package/dist/docs-access-express.js.map +1 -0
  9. package/dist/index.d.ts +64 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +134 -0
  12. package/dist/index.js.map +1 -0
  13. package/package.json +36 -0
  14. package/static/assets/index-2Nv3pxOm.css +1 -0
  15. package/static/assets/index-6tehJlKh.js +214 -0
  16. package/static/assets/index-B148KlKZ.js +247 -0
  17. package/static/assets/index-B7AxOqhh.js +247 -0
  18. package/static/assets/index-BAVM9zLs.css +1 -0
  19. package/static/assets/index-BD4qyClR.js +216 -0
  20. package/static/assets/index-BZaQe_xi.css +1 -0
  21. package/static/assets/index-BjWlpH_h.js +216 -0
  22. package/static/assets/index-BmiFV0rx.css +1 -0
  23. package/static/assets/index-BqIvYIJT.js +247 -0
  24. package/static/assets/index-BwOiuEB4.js +216 -0
  25. package/static/assets/index-C372jkHK.js +214 -0
  26. package/static/assets/index-C9S9wEor.js +217 -0
  27. package/static/assets/index-Cd9PPQz6.css +1 -0
  28. package/static/assets/index-Cf2mt1FM.css +1 -0
  29. package/static/assets/index-Cfn42GaL.css +1 -0
  30. package/static/assets/index-Ckm4kbAk.css +1 -0
  31. package/static/assets/index-CzGmm9SR.css +1 -0
  32. package/static/assets/index-D0jOSazL.js +187 -0
  33. package/static/assets/index-D3-lCeHu.js +214 -0
  34. package/static/assets/index-DDRNEd4n.js +247 -0
  35. package/static/assets/index-DOyViYzn.js +247 -0
  36. package/static/assets/index-DZsbTHIg.js +214 -0
  37. package/static/assets/index-DaYbWEw0.js +190 -0
  38. package/static/assets/index-Djqsib7P.css +1 -0
  39. package/static/assets/index-Ds4IYSZ4.css +1 -0
  40. package/static/assets/index-Dzo0Xwn5.css +1 -0
  41. package/static/assets/index-L47Yb4hH.js +187 -0
  42. package/static/assets/index-NKfaEJl0.css +1 -0
  43. package/static/assets/index-U9Pdo8dD.js +214 -0
  44. package/static/assets/index-UVEGH1D3.css +1 -0
  45. package/static/assets/index-mZYiGRwU.css +1 -0
  46. package/static/assets/index-pOjZ5m-I.js +247 -0
  47. package/static/assets/index-rCcLuTWw.js +216 -0
  48. package/static/index.html +21 -0
@@ -0,0 +1,247 @@
1
+ var uy=Object.defineProperty;var cy=(t,r,i)=>r in t?uy(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i;var ga=(t,r,i)=>cy(t,typeof r!="symbol"?r+"":r,i);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();var fy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Gc={exports:{}},ya={},Jc={exports:{}},pt={};/**
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 Kp;function dy(){if(Kp)return pt;Kp=1;var t=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),d=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),x=Symbol.iterator;function S(A){return A===null||typeof A!="object"?null:(A=x&&A[x]||A["@@iterator"],typeof A=="function"?A:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,$={};function T(A,K,be){this.props=A,this.context=K,this.refs=$,this.updater=be||C}T.prototype.isReactComponent={},T.prototype.setState=function(A,K){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,K,"setState")},T.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function I(){}I.prototype=T.prototype;function U(A,K,be){this.props=A,this.context=K,this.refs=$,this.updater=be||C}var P=U.prototype=new I;P.constructor=U,j(P,T.prototype),P.isPureReactComponent=!0;var R=Array.isArray,B=Object.prototype.hasOwnProperty,H={current:null},Q={key:!0,ref:!0,__self:!0,__source:!0};function ce(A,K,be){var Se,Me={},Ie=null,Ae=null;if(K!=null)for(Se in K.ref!==void 0&&(Ae=K.ref),K.key!==void 0&&(Ie=""+K.key),K)B.call(K,Se)&&!Q.hasOwnProperty(Se)&&(Me[Se]=K[Se]);var _e=arguments.length-2;if(_e===1)Me.children=be;else if(1<_e){for(var ze=Array(_e),ke=0;ke<_e;ke++)ze[ke]=arguments[ke+2];Me.children=ze}if(A&&A.defaultProps)for(Se in _e=A.defaultProps,_e)Me[Se]===void 0&&(Me[Se]=_e[Se]);return{$$typeof:t,type:A,key:Ie,ref:Ae,props:Me,_owner:H.current}}function de(A,K){return{$$typeof:t,type:A.type,key:K,ref:A.ref,props:A.props,_owner:A._owner}}function we(A){return typeof A=="object"&&A!==null&&A.$$typeof===t}function q(A){var K={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(be){return K[be]})}var fe=/\/+/g;function xe(A,K){return typeof A=="object"&&A!==null&&A.key!=null?q(""+A.key):K.toString(36)}function L(A,K,be,Se,Me){var Ie=typeof A;(Ie==="undefined"||Ie==="boolean")&&(A=null);var Ae=!1;if(A===null)Ae=!0;else switch(Ie){case"string":case"number":Ae=!0;break;case"object":switch(A.$$typeof){case t:case r:Ae=!0}}if(Ae)return Ae=A,Me=Me(Ae),A=Se===""?"."+xe(Ae,0):Se,R(Me)?(be="",A!=null&&(be=A.replace(fe,"$&/")+"/"),L(Me,K,be,"",function(ke){return ke})):Me!=null&&(we(Me)&&(Me=de(Me,be+(!Me.key||Ae&&Ae.key===Me.key?"":(""+Me.key).replace(fe,"$&/")+"/")+A)),K.push(Me)),1;if(Ae=0,Se=Se===""?".":Se+":",R(A))for(var _e=0;_e<A.length;_e++){Ie=A[_e];var ze=Se+xe(Ie,_e);Ae+=L(Ie,K,be,ze,Me)}else if(ze=S(A),typeof ze=="function")for(A=ze.call(A),_e=0;!(Ie=A.next()).done;)Ie=Ie.value,ze=Se+xe(Ie,_e++),Ae+=L(Ie,K,be,ze,Me);else if(Ie==="object")throw K=String(A),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.");return Ae}function le(A,K,be){if(A==null)return A;var Se=[],Me=0;return L(A,Se,"","",function(Ie){return K.call(be,Ie,Me++)}),Se}function G(A){if(A._status===-1){var K=A._result;K=K(),K.then(function(be){(A._status===0||A._status===-1)&&(A._status=1,A._result=be)},function(be){(A._status===0||A._status===-1)&&(A._status=2,A._result=be)}),A._status===-1&&(A._status=0,A._result=K)}if(A._status===1)return A._result.default;throw A._result}var ie={current:null},z={transition:null},W={ReactCurrentDispatcher:ie,ReactCurrentBatchConfig:z,ReactCurrentOwner:H};function F(){throw Error("act(...) is not supported in production builds of React.")}return pt.Children={map:le,forEach:function(A,K,be){le(A,function(){K.apply(this,arguments)},be)},count:function(A){var K=0;return le(A,function(){K++}),K},toArray:function(A){return le(A,function(K){return K})||[]},only:function(A){if(!we(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},pt.Component=T,pt.Fragment=i,pt.Profiler=l,pt.PureComponent=U,pt.StrictMode=s,pt.Suspense=y,pt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W,pt.act=F,pt.cloneElement=function(A,K,be){if(A==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+A+".");var Se=j({},A.props),Me=A.key,Ie=A.ref,Ae=A._owner;if(K!=null){if(K.ref!==void 0&&(Ie=K.ref,Ae=H.current),K.key!==void 0&&(Me=""+K.key),A.type&&A.type.defaultProps)var _e=A.type.defaultProps;for(ze in K)B.call(K,ze)&&!Q.hasOwnProperty(ze)&&(Se[ze]=K[ze]===void 0&&_e!==void 0?_e[ze]:K[ze])}var ze=arguments.length-2;if(ze===1)Se.children=be;else if(1<ze){_e=Array(ze);for(var ke=0;ke<ze;ke++)_e[ke]=arguments[ke+2];Se.children=_e}return{$$typeof:t,type:A.type,key:Me,ref:Ie,props:Se,_owner:Ae}},pt.createContext=function(A){return A={$$typeof:d,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},A.Provider={$$typeof:c,_context:A},A.Consumer=A},pt.createElement=ce,pt.createFactory=function(A){var K=ce.bind(null,A);return K.type=A,K},pt.createRef=function(){return{current:null}},pt.forwardRef=function(A){return{$$typeof:h,render:A}},pt.isValidElement=we,pt.lazy=function(A){return{$$typeof:k,_payload:{_status:-1,_result:A},_init:G}},pt.memo=function(A,K){return{$$typeof:b,type:A,compare:K===void 0?null:K}},pt.startTransition=function(A){var K=z.transition;z.transition={};try{A()}finally{z.transition=K}},pt.unstable_act=F,pt.useCallback=function(A,K){return ie.current.useCallback(A,K)},pt.useContext=function(A){return ie.current.useContext(A)},pt.useDebugValue=function(){},pt.useDeferredValue=function(A){return ie.current.useDeferredValue(A)},pt.useEffect=function(A,K){return ie.current.useEffect(A,K)},pt.useId=function(){return ie.current.useId()},pt.useImperativeHandle=function(A,K,be){return ie.current.useImperativeHandle(A,K,be)},pt.useInsertionEffect=function(A,K){return ie.current.useInsertionEffect(A,K)},pt.useLayoutEffect=function(A,K){return ie.current.useLayoutEffect(A,K)},pt.useMemo=function(A,K){return ie.current.useMemo(A,K)},pt.useReducer=function(A,K,be){return ie.current.useReducer(A,K,be)},pt.useRef=function(A){return ie.current.useRef(A)},pt.useState=function(A){return ie.current.useState(A)},pt.useSyncExternalStore=function(A,K,be){return ie.current.useSyncExternalStore(A,K,be)},pt.useTransition=function(){return ie.current.useTransition()},pt.version="18.3.1",pt}var qp;function Ia(){return qp||(qp=1,Jc.exports=dy()),Jc.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 Wp;function py(){if(Wp)return ya;Wp=1;var t=Ia(),r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,l=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function d(h,y,b){var k,x={},S=null,C=null;b!==void 0&&(S=""+b),y.key!==void 0&&(S=""+y.key),y.ref!==void 0&&(C=y.ref);for(k in y)s.call(y,k)&&!c.hasOwnProperty(k)&&(x[k]=y[k]);if(h&&h.defaultProps)for(k in y=h.defaultProps,y)x[k]===void 0&&(x[k]=y[k]);return{$$typeof:r,type:h,key:S,ref:C,props:x,_owner:l.current}}return ya.Fragment=i,ya.jsx=d,ya.jsxs=d,ya}var Yp;function hy(){return Yp||(Yp=1,Gc.exports=py()),Gc.exports}var w=hy(),Y=Ia();const gm=wu(Y);var Vl={},Zc={exports:{}},Vn={},ef={exports:{}},tf={};/**
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 Xp;function my(){return Xp||(Xp=1,(function(t){function r(z,W){var F=z.length;z.push(W);e:for(;0<F;){var A=F-1>>>1,K=z[A];if(0<l(K,W))z[A]=W,z[F]=K,F=A;else break e}}function i(z){return z.length===0?null:z[0]}function s(z){if(z.length===0)return null;var W=z[0],F=z.pop();if(F!==W){z[0]=F;e:for(var A=0,K=z.length,be=K>>>1;A<be;){var Se=2*(A+1)-1,Me=z[Se],Ie=Se+1,Ae=z[Ie];if(0>l(Me,F))Ie<K&&0>l(Ae,Me)?(z[A]=Ae,z[Ie]=F,A=Ie):(z[A]=Me,z[Se]=F,A=Se);else if(Ie<K&&0>l(Ae,F))z[A]=Ae,z[Ie]=F,A=Ie;else break e}}return W}function l(z,W){var F=z.sortIndex-W.sortIndex;return F!==0?F:z.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var d=Date,h=d.now();t.unstable_now=function(){return d.now()-h}}var y=[],b=[],k=1,x=null,S=3,C=!1,j=!1,$=!1,T=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,U=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(z){for(var W=i(b);W!==null;){if(W.callback===null)s(b);else if(W.startTime<=z)s(b),W.sortIndex=W.expirationTime,r(y,W);else break;W=i(b)}}function R(z){if($=!1,P(z),!j)if(i(y)!==null)j=!0,G(B);else{var W=i(b);W!==null&&ie(R,W.startTime-z)}}function B(z,W){j=!1,$&&($=!1,I(ce),ce=-1),C=!0;var F=S;try{for(P(W),x=i(y);x!==null&&(!(x.expirationTime>W)||z&&!q());){var A=x.callback;if(typeof A=="function"){x.callback=null,S=x.priorityLevel;var K=A(x.expirationTime<=W);W=t.unstable_now(),typeof K=="function"?x.callback=K:x===i(y)&&s(y),P(W)}else s(y);x=i(y)}if(x!==null)var be=!0;else{var Se=i(b);Se!==null&&ie(R,Se.startTime-W),be=!1}return be}finally{x=null,S=F,C=!1}}var H=!1,Q=null,ce=-1,de=5,we=-1;function q(){return!(t.unstable_now()-we<de)}function fe(){if(Q!==null){var z=t.unstable_now();we=z;var W=!0;try{W=Q(!0,z)}finally{W?xe():(H=!1,Q=null)}}else H=!1}var xe;if(typeof U=="function")xe=function(){U(fe)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,le=L.port2;L.port1.onmessage=fe,xe=function(){le.postMessage(null)}}else xe=function(){T(fe,0)};function G(z){Q=z,H||(H=!0,xe())}function ie(z,W){ce=T(function(){z(t.unstable_now())},W)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(z){z.callback=null},t.unstable_continueExecution=function(){j||C||(j=!0,G(B))},t.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):de=0<z?Math.floor(1e3/z):5},t.unstable_getCurrentPriorityLevel=function(){return S},t.unstable_getFirstCallbackNode=function(){return i(y)},t.unstable_next=function(z){switch(S){case 1:case 2:case 3:var W=3;break;default:W=S}var F=S;S=W;try{return z()}finally{S=F}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(z,W){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var F=S;S=z;try{return W()}finally{S=F}},t.unstable_scheduleCallback=function(z,W,F){var A=t.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?A+F:A):F=A,z){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=F+K,z={id:k++,callback:W,priorityLevel:z,startTime:F,expirationTime:K,sortIndex:-1},F>A?(z.sortIndex=F,r(b,z),i(y)===null&&z===i(b)&&($?(I(ce),ce=-1):$=!0,ie(R,F-A))):(z.sortIndex=K,r(y,z),j||C||(j=!0,G(B))),z},t.unstable_shouldYield=q,t.unstable_wrapCallback=function(z){var W=S;return function(){var F=S;S=W;try{return z.apply(this,arguments)}finally{S=F}}}})(tf)),tf}var Qp;function gy(){return Qp||(Qp=1,ef.exports=my()),ef.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 Gp;function yy(){if(Gp)return Vn;Gp=1;var t=Ia(),r=gy();function i(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=1;o<arguments.length;o++)n+="&args[]="+encodeURIComponent(arguments[o]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,l={};function c(e,n){d(e,n),d(e+"Capture",n)}function d(e,n){for(l[e]=n,e=0;e<n.length;e++)s.add(n[e])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),y=Object.prototype.hasOwnProperty,b=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,k={},x={};function S(e){return y.call(x,e)?!0:y.call(k,e)?!1:b.test(e)?x[e]=!0:(k[e]=!0,!1)}function C(e,n,o,u){if(o!==null&&o.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return u?!1:o!==null?!o.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function j(e,n,o,u){if(n===null||typeof n>"u"||C(e,n,o,u))return!0;if(u)return!1;if(o!==null)switch(o.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function $(e,n,o,u,p,g,E){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=u,this.attributeNamespace=p,this.mustUseProperty=o,this.propertyName=e,this.type=n,this.sanitizeURL=g,this.removeEmptyString=E}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){T[e]=new $(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];T[n]=new $(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){T[e]=new $(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){T[e]=new $(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){T[e]=new $(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){T[e]=new $(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){T[e]=new $(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){T[e]=new $(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){T[e]=new $(e,5,!1,e.toLowerCase(),null,!1,!1)});var I=/[\-:]([a-z])/g;function U(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(I,U);T[n]=new $(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(I,U);T[n]=new $(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(I,U);T[n]=new $(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){T[e]=new $(e,1,!1,e.toLowerCase(),null,!1,!1)}),T.xlinkHref=new $("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){T[e]=new $(e,1,!1,e.toLowerCase(),null,!0,!0)});function P(e,n,o,u){var p=T.hasOwnProperty(n)?T[n]:null;(p!==null?p.type!==0:u||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(j(n,o,p,u)&&(o=null),u||p===null?S(n)&&(o===null?e.removeAttribute(n):e.setAttribute(n,""+o)):p.mustUseProperty?e[p.propertyName]=o===null?p.type===3?!1:"":o:(n=p.attributeName,u=p.attributeNamespace,o===null?e.removeAttribute(n):(p=p.type,o=p===3||p===4&&o===!0?"":""+o,u?e.setAttributeNS(u,n,o):e.setAttribute(n,o))))}var R=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,B=Symbol.for("react.element"),H=Symbol.for("react.portal"),Q=Symbol.for("react.fragment"),ce=Symbol.for("react.strict_mode"),de=Symbol.for("react.profiler"),we=Symbol.for("react.provider"),q=Symbol.for("react.context"),fe=Symbol.for("react.forward_ref"),xe=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),ie=Symbol.for("react.offscreen"),z=Symbol.iterator;function W(e){return e===null||typeof e!="object"?null:(e=z&&e[z]||e["@@iterator"],typeof e=="function"?e:null)}var F=Object.assign,A;function K(e){if(A===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);A=n&&n[1]||""}return`
34
+ `+A+e}var be=!1;function Se(e,n){if(!e||be)return"";be=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(ye){var u=ye}Reflect.construct(e,[],n)}else{try{n.call()}catch(ye){u=ye}e.call(n.prototype)}else{try{throw Error()}catch(ye){u=ye}e()}}catch(ye){if(ye&&u&&typeof ye.stack=="string"){for(var p=ye.stack.split(`
35
+ `),g=u.stack.split(`
36
+ `),E=p.length-1,D=g.length-1;1<=E&&0<=D&&p[E]!==g[D];)D--;for(;1<=E&&0<=D;E--,D--)if(p[E]!==g[D]){if(E!==1||D!==1)do if(E--,D--,0>D||p[E]!==g[D]){var X=`
37
+ `+p[E].replace(" at new "," at ");return e.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",e.displayName)),X}while(1<=E&&0<=D);break}}}finally{be=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?K(e):""}function Me(e){switch(e.tag){case 5:return K(e.type);case 16:return K("Lazy");case 13:return K("Suspense");case 19:return K("SuspenseList");case 0:case 2:case 15:return e=Se(e.type,!1),e;case 11:return e=Se(e.type.render,!1),e;case 1:return e=Se(e.type,!0),e;default:return""}}function Ie(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Q:return"Fragment";case H:return"Portal";case de:return"Profiler";case ce:return"StrictMode";case xe:return"Suspense";case L:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case q:return(e.displayName||"Context")+".Consumer";case we:return(e._context.displayName||"Context")+".Provider";case fe:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case le:return n=e.displayName||null,n!==null?n:Ie(e.type)||"Memo";case G:n=e._payload,e=e._init;try{return Ie(e(n))}catch{}}return null}function Ae(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ie(n);case 8:return n===ce?"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 _e(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ze(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ke(e){var n=ze(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),u=""+e[n];if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var p=o.get,g=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return p.call(this)},set:function(E){u=""+E,g.call(this,E)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return u},setValue:function(E){u=""+E},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function He(e){e._valueTracker||(e._valueTracker=ke(e))}function Oe(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var o=n.getValue(),u="";return e&&(u=ze(e)?e.checked?"true":"false":e.value),e=u,e!==o?(n.setValue(e),!0):!1}function Ke(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function lt(e,n){var o=n.checked;return F({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??e._wrapperState.initialChecked})}function ut(e,n){var o=n.defaultValue==null?"":n.defaultValue,u=n.checked!=null?n.checked:n.defaultChecked;o=_e(n.value!=null?n.value:o),e._wrapperState={initialChecked:u,initialValue:o,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function at(e,n){n=n.checked,n!=null&&P(e,"checked",n,!1)}function Nt(e,n){at(e,n);var o=_e(n.value),u=n.type;if(o!=null)u==="number"?(o===0&&e.value===""||e.value!=o)&&(e.value=""+o):e.value!==""+o&&(e.value=""+o);else if(u==="submit"||u==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?Zt(e,n.type,o):n.hasOwnProperty("defaultValue")&&Zt(e,n.type,_e(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function Xt(e,n,o){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var u=n.type;if(!(u!=="submit"&&u!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,o||n===e.value||(e.value=n),e.defaultValue=n}o=e.name,o!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,o!==""&&(e.name=o)}function Zt(e,n,o){(n!=="number"||Ke(e.ownerDocument)!==e)&&(o==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+o&&(e.defaultValue=""+o))}var Vt=Array.isArray;function Et(e,n,o,u){if(e=e.options,n){n={};for(var p=0;p<o.length;p++)n["$"+o[p]]=!0;for(o=0;o<e.length;o++)p=n.hasOwnProperty("$"+e[o].value),e[o].selected!==p&&(e[o].selected=p),p&&u&&(e[o].defaultSelected=!0)}else{for(o=""+_e(o),n=null,p=0;p<e.length;p++){if(e[p].value===o){e[p].selected=!0,u&&(e[p].defaultSelected=!0);return}n!==null||e[p].disabled||(n=e[p])}n!==null&&(n.selected=!0)}}function Bt(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(i(91));return F({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function fn(e,n){var o=n.value;if(o==null){if(o=n.children,n=n.defaultValue,o!=null){if(n!=null)throw Error(i(92));if(Vt(o)){if(1<o.length)throw Error(i(93));o=o[0]}n=o}n==null&&(n=""),o=n}e._wrapperState={initialValue:_e(o)}}function It(e,n){var o=_e(n.value),u=_e(n.defaultValue);o!=null&&(o=""+o,o!==e.value&&(e.value=o),n.defaultValue==null&&e.defaultValue!==o&&(e.defaultValue=o)),u!=null&&(e.defaultValue=""+u)}function bn(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function St(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Lt(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?St(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var _n,Kn=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,o,u,p){MSApp.execUnsafeLocalFunction(function(){return e(n,o,u,p)})}:e})(function(e,n){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=n;else{for(_n=_n||document.createElement("div"),_n.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=_n.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function Sn(e,n){if(n){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=n;return}}e.textContent=n}var $n={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},qn=["Webkit","ms","Moz","O"];Object.keys($n).forEach(function(e){qn.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),$n[n]=$n[e]})});function yr(e,n,o){return n==null||typeof n=="boolean"||n===""?"":o||typeof n!="number"||n===0||$n.hasOwnProperty(e)&&$n[e]?(""+n).trim():n+"px"}function vr(e,n){e=e.style;for(var o in n)if(n.hasOwnProperty(o)){var u=o.indexOf("--")===0,p=yr(o,n[o],u);o==="float"&&(o="cssFloat"),u?e.setProperty(o,p):e[o]=p}}var kn=F({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ye(e,n){if(n){if(kn[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(i(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(i(61))}if(n.style!=null&&typeof n.style!="object")throw Error(i(62))}}function Wn(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Nn=null;function ir(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Be=null,dn=null,Yn=null;function Fr(e){if(e=ta(e)){if(typeof Be!="function")throw Error(i(280));var n=e.stateNode;n&&(n=ol(n),Be(e.stateNode,e.type,n))}}function ro(e){dn?Yn?Yn.push(e):Yn=[e]:dn=e}function Br(){if(dn){var e=dn,n=Yn;if(Yn=dn=null,Fr(e),n)for(e=0;e<n.length;e++)Fr(n[e])}}function Ao(e,n){return e(n)}function Oo(){}var Tn=!1;function Xn(e,n,o){if(Tn)return e(n,o);Tn=!0;try{return Ao(e,n,o)}finally{Tn=!1,(dn!==null||Yn!==null)&&(Oo(),Br())}}function In(e,n){var o=e.stateNode;if(o===null)return null;var u=ol(o);if(u===null)return null;o=u[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(e=e.type,u=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!u;break e;default:e=!1}if(e)return null;if(o&&typeof o!="function")throw Error(i(231,n,typeof o));return o}var sr=!1;if(h)try{var mt={};Object.defineProperty(mt,"passive",{get:function(){sr=!0}}),window.addEventListener("test",mt,mt),window.removeEventListener("test",mt,mt)}catch{sr=!1}function jt(e,n,o,u,p,g,E,D,X){var ye=Array.prototype.slice.call(arguments,3);try{n.apply(o,ye)}catch(Pe){this.onError(Pe)}}var xr=!1,Qn=null,An=!1,On=null,Ro={onError:function(e){xr=!0,Qn=e}};function V(e,n,o,u,p,g,E,D,X){xr=!1,Qn=null,jt.apply(Ro,arguments)}function Le(e,n,o,u,p,g,E,D,X){if(V.apply(this,arguments),xr){if(xr){var ye=Qn;xr=!1,Qn=null}else throw Error(i(198));An||(An=!0,On=ye)}}function Ve(e){var n=e,o=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(o=n.return),e=n.return;while(e)}return n.tag===3?o:null}function dt(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function En(e){if(Ve(e)!==e)throw Error(i(188))}function Kt(e){var n=e.alternate;if(!n){if(n=Ve(e),n===null)throw Error(i(188));return n!==e?null:e}for(var o=e,u=n;;){var p=o.return;if(p===null)break;var g=p.alternate;if(g===null){if(u=p.return,u!==null){o=u;continue}break}if(p.child===g.child){for(g=p.child;g;){if(g===o)return En(p),e;if(g===u)return En(p),n;g=g.sibling}throw Error(i(188))}if(o.return!==u.return)o=p,u=g;else{for(var E=!1,D=p.child;D;){if(D===o){E=!0,o=p,u=g;break}if(D===u){E=!0,u=p,o=g;break}D=D.sibling}if(!E){for(D=g.child;D;){if(D===o){E=!0,o=g,u=p;break}if(D===u){E=!0,u=g,o=p;break}D=D.sibling}if(!E)throw Error(i(189))}}if(o.alternate!==u)throw Error(i(190))}if(o.tag!==3)throw Error(i(188));return o.stateNode.current===o?e:n}function pn(e){return e=Kt(e),e!==null?Qt(e):null}function Qt(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=Qt(e);if(n!==null)return n;e=e.sibling}return null}var wr=r.unstable_scheduleCallback,Gn=r.unstable_cancelCallback,kt=r.unstable_shouldYield,Cn=r.unstable_requestPaint,ht=r.unstable_now,br=r.unstable_getCurrentPriorityLevel,ar=r.unstable_ImmediatePriority,Lo=r.unstable_UserBlockingPriority,Hr=r.unstable_NormalPriority,_r=r.unstable_LowPriority,di=r.unstable_IdlePriority,lr=null,jn=null;function ct(e){if(jn&&typeof jn.onCommitFiberRoot=="function")try{jn.onCommitFiberRoot(lr,e,void 0,(e.current.flags&128)===128)}catch{}}var hn=Math.clz32?Math.clz32:oo,Hi=Math.log,Do=Math.LN2;function oo(e){return e>>>=0,e===0?32:31-(Hi(e)/Do|0)|0}var io=64,so=4194304;function Jn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function vt(e,n){var o=e.pendingLanes;if(o===0)return 0;var u=0,p=e.suspendedLanes,g=e.pingedLanes,E=o&268435455;if(E!==0){var D=E&~p;D!==0?u=Jn(D):(g&=E,g!==0&&(u=Jn(g)))}else E=o&~p,E!==0?u=Jn(E):g!==0&&(u=Jn(g));if(u===0)return 0;if(n!==0&&n!==u&&(n&p)===0&&(p=u&-u,g=n&-n,p>=g||p===16&&(g&4194240)!==0))return n;if((u&4)!==0&&(u|=o&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=u;0<n;)o=31-hn(n),p=1<<o,u|=e[o],n&=~p;return u}function Vr(e,n){switch(e){case 1:case 2:case 4:return n+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ao(e,n){for(var o=e.suspendedLanes,u=e.pingedLanes,p=e.expirationTimes,g=e.pendingLanes;0<g;){var E=31-hn(g),D=1<<E,X=p[E];X===-1?((D&o)===0||(D&u)!==0)&&(p[E]=Vr(D,n)):X<=n&&(e.expiredLanes|=D),g&=~D}}function ur(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ur(){var e=io;return io<<=1,(io&4194240)===0&&(io=64),e}function lo(e){for(var n=[],o=0;31>o;o++)n.push(e);return n}function cr(e,n,o){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-hn(n),e[n]=o}function pi(e,n){var o=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var u=e.eventTimes;for(e=e.expirationTimes;0<o;){var p=31-hn(o),g=1<<p;n[p]=0,u[p]=-1,e[p]=-1,o&=~g}}function zo(e,n){var o=e.entangledLanes|=n;for(e=e.entanglements;o;){var u=31-hn(o),p=1<<u;p&n|e[u]&n&&(e[u]|=n),o&=~p}}var wt=0;function Ba(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var gt,Vi,Ha,Va,mn,Kr=!1,uo=[],sn=null,Sr=null,kr=null,At=new Map,an=new Map,Rn=[],hi="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 Ui(e,n){switch(e){case"focusin":case"focusout":sn=null;break;case"dragenter":case"dragleave":Sr=null;break;case"mouseover":case"mouseout":kr=null;break;case"pointerover":case"pointerout":At.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":an.delete(n.pointerId)}}function Ln(e,n,o,u,p,g){return e===null||e.nativeEvent!==g?(e={blockedOn:n,domEventName:o,eventSystemFlags:u,nativeEvent:g,targetContainers:[p]},n!==null&&(n=ta(n),n!==null&&Vi(n)),e):(e.eventSystemFlags|=u,n=e.targetContainers,p!==null&&n.indexOf(p)===-1&&n.push(p),e)}function Ou(e,n,o,u,p){switch(n){case"focusin":return sn=Ln(sn,e,n,o,u,p),!0;case"dragenter":return Sr=Ln(Sr,e,n,o,u,p),!0;case"mouseover":return kr=Ln(kr,e,n,o,u,p),!0;case"pointerover":var g=p.pointerId;return At.set(g,Ln(At.get(g)||null,e,n,o,u,p)),!0;case"gotpointercapture":return g=p.pointerId,an.set(g,Ln(an.get(g)||null,e,n,o,u,p)),!0}return!1}function Zn(e){var n=_i(e.target);if(n!==null){var o=Ve(n);if(o!==null){if(n=o.tag,n===13){if(n=dt(o),n!==null){e.blockedOn=n,mn(e.priority,function(){Ha(o)});return}}else if(n===3&&o.stateNode.current.memoizedState.isDehydrated){e.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Fo(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var o=Bo(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(o===null){o=e.nativeEvent;var u=new o.constructor(o.type,o);Nn=u,o.target.dispatchEvent(u),Nn=null}else return n=ta(o),n!==null&&Vi(n),e.blockedOn=o,!1;n.shift()}return!0}function Ls(e,n,o){Fo(e)&&o.delete(n)}function Ds(){Kr=!1,sn!==null&&Fo(sn)&&(sn=null),Sr!==null&&Fo(Sr)&&(Sr=null),kr!==null&&Fo(kr)&&(kr=null),At.forEach(Ls),an.forEach(Ls)}function Nr(e,n){e.blockedOn===n&&(e.blockedOn=null,Kr||(Kr=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Ds)))}function co(e){function n(p){return Nr(p,e)}if(0<uo.length){Nr(uo[0],e);for(var o=1;o<uo.length;o++){var u=uo[o];u.blockedOn===e&&(u.blockedOn=null)}}for(sn!==null&&Nr(sn,e),Sr!==null&&Nr(Sr,e),kr!==null&&Nr(kr,e),At.forEach(n),an.forEach(n),o=0;o<Rn.length;o++)u=Rn[o],u.blockedOn===e&&(u.blockedOn=null);for(;0<Rn.length&&(o=Rn[0],o.blockedOn===null);)Zn(o),o.blockedOn===null&&Rn.shift()}var fo=R.ReactCurrentBatchConfig,Ki=!0;function mi(e,n,o,u){var p=wt,g=fo.transition;fo.transition=null;try{wt=1,zs(e,n,o,u)}finally{wt=p,fo.transition=g}}function Ru(e,n,o,u){var p=wt,g=fo.transition;fo.transition=null;try{wt=4,zs(e,n,o,u)}finally{wt=p,fo.transition=g}}function zs(e,n,o,u){if(Ki){var p=Bo(e,n,o,u);if(p===null)Bu(e,n,u,po,o),Ui(e,u);else if(Ou(p,e,n,o,u))u.stopPropagation();else if(Ui(e,u),n&4&&-1<hi.indexOf(e)){for(;p!==null;){var g=ta(p);if(g!==null&&gt(g),g=Bo(e,n,o,u),g===null&&Bu(e,n,u,po,o),g===p)break;p=g}p!==null&&u.stopPropagation()}else Bu(e,n,u,null,o)}}var po=null;function Bo(e,n,o,u){if(po=null,e=ir(u),e=_i(e),e!==null)if(n=Ve(e),n===null)e=null;else if(o=n.tag,o===13){if(e=dt(n),e!==null)return e;e=null}else if(o===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null);return po=e,null}function qi(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(br()){case ar:return 1;case Lo:return 4;case Hr:case _r:return 16;case di:return 536870912;default:return 16}default:return 16}}var qr=null,Fs=null,Wi=null;function Yi(){if(Wi)return Wi;var e,n=Fs,o=n.length,u,p="value"in qr?qr.value:qr.textContent,g=p.length;for(e=0;e<o&&n[e]===p[e];e++);var E=o-e;for(u=1;u<=E&&n[o-u]===p[g-u];u++);return Wi=p.slice(e,1<u?1-u:void 0)}function Ho(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function gi(){return!0}function yi(){return!1}function en(e){function n(o,u,p,g,E){this._reactName=o,this._targetInst=p,this.type=u,this.nativeEvent=g,this.target=E,this.currentTarget=null;for(var D in e)e.hasOwnProperty(D)&&(o=e[D],this[D]=o?o(g):g[D]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?gi:yi,this.isPropagationStopped=yi,this}return F(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=gi)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=gi)},persist:function(){},isPersistent:gi}),n}var Er={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xi=en(Er),vi=F({},Er,{view:0,detail:0}),Vo=en(vi),ho,xi,mo,Uo=F({},vi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ts,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==mo&&(mo&&e.type==="mousemove"?(ho=e.screenX-mo.screenX,xi=e.screenY-mo.screenY):xi=ho=0,mo=e),ho)},movementY:function(e){return"movementY"in e?e.movementY:xi}}),Qi=en(Uo),tn=F({},Uo,{dataTransfer:0}),wi=en(tn),bi=F({},vi,{relatedTarget:0}),Gi=en(bi),Ji=F({},Er,{animationName:0,elapsedTime:0,pseudoElement:0}),Ua=en(Ji),Ka=F({},Er,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Zi=en(Ka),Bs=F({},Er,{data:0}),Wr=en(Bs),Hs={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vs={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"},es={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Us(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=es[e])?!!n[e]:!1}function ts(){return Us}var Lu=F({},vi,{key:function(e){if(e.key){var n=Hs[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Ho(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Vs[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ts,charCode:function(e){return e.type==="keypress"?Ho(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ho(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ks=en(Lu),ns=F({},Uo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qa=en(ns),qs=F({},vi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ts}),Ws=en(qs),Du=F({},Er,{propertyName:0,elapsedTime:0,pseudoElement:0}),Wa=en(Du),zu=F({},Uo,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Ya=en(zu),Xa=[9,13,27,32],Ys=h&&"CompositionEvent"in window,Ko=null;h&&"documentMode"in document&&(Ko=document.documentMode);var Xs=h&&"TextEvent"in window&&!Ko,Qs=h&&(!Ys||Ko&&8<Ko&&11>=Ko),Gs=" ",Qa=!1;function Ga(e,n){switch(e){case"keyup":return Xa.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ja(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Cr=!1;function jr(e,n){switch(e){case"compositionend":return Ja(n);case"keypress":return n.which!==32?null:(Qa=!0,Gs);case"textInput":return e=n.data,e===Gs&&Qa?null:e;default:return null}}function Dt(e,n){if(Cr)return e==="compositionend"||!Ys&&Ga(e,n)?(e=Yi(),Wi=Fs=qr=null,Cr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Qs&&n.locale!=="ko"?null:n.data;default:return null}}var rs={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 go(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!rs[e.type]:n==="textarea"}function Za(e,n,o,u){ro(u),n=tl(n,"onChange"),0<n.length&&(o=new Xi("onChange","change",null,o,u),e.push({event:o,listeners:n}))}var yo=null,qo=null;function vo(e){ad(e,0)}function Wo(e){var n=as(e);if(Oe(n))return e}function Yo(e,n){if(e==="change")return n}var Pr=!1;if(h){var os;if(h){var a="oninput"in document;if(!a){var f=document.createElement("div");f.setAttribute("oninput","return;"),a=typeof f.oninput=="function"}os=a}else os=!1;Pr=os&&(!document.documentMode||9<document.documentMode)}function m(){yo&&(yo.detachEvent("onpropertychange",v),qo=yo=null)}function v(e){if(e.propertyName==="value"&&Wo(qo)){var n=[];Za(n,qo,e,ir(e)),Xn(vo,n)}}function _(e,n,o){e==="focusin"?(m(),yo=n,qo=o,yo.attachEvent("onpropertychange",v)):e==="focusout"&&m()}function N(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Wo(qo)}function M(e,n){if(e==="click")return Wo(n)}function O(e,n){if(e==="input"||e==="change")return Wo(n)}function Z(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var ue=typeof Object.is=="function"?Object.is:Z;function te(e,n){if(ue(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var o=Object.keys(e),u=Object.keys(n);if(o.length!==u.length)return!1;for(u=0;u<o.length;u++){var p=o[u];if(!y.call(n,p)||!ue(e[p],n[p]))return!1}return!0}function J(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ee(e,n){var o=J(e);e=0;for(var u;o;){if(o.nodeType===3){if(u=e+o.textContent.length,e<=n&&u>=n)return{node:o,offset:n-e};e=u}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=J(o)}}function ae(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?ae(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function oe(){for(var e=window,n=Ke();n instanceof e.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)e=n.contentWindow;else break;n=Ke(e.document)}return n}function re(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function se(e){var n=oe(),o=e.focusedElem,u=e.selectionRange;if(n!==o&&o&&o.ownerDocument&&ae(o.ownerDocument.documentElement,o)){if(u!==null&&re(o)){if(n=u.start,e=u.end,e===void 0&&(e=n),"selectionStart"in o)o.selectionStart=n,o.selectionEnd=Math.min(e,o.value.length);else if(e=(n=o.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var p=o.textContent.length,g=Math.min(u.start,p);u=u.end===void 0?g:Math.min(u.end,p),!e.extend&&g>u&&(p=u,u=g,g=p),p=ee(o,g);var E=ee(o,u);p&&E&&(e.rangeCount!==1||e.anchorNode!==p.node||e.anchorOffset!==p.offset||e.focusNode!==E.node||e.focusOffset!==E.offset)&&(n=n.createRange(),n.setStart(p.node,p.offset),e.removeAllRanges(),g>u?(e.addRange(n),e.extend(E.node,E.offset)):(n.setEnd(E.node,E.offset),e.addRange(n)))}}for(n=[],e=o;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<n.length;o++)e=n[o],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ge=h&&"documentMode"in document&&11>=document.documentMode,pe=null,ve=null,Ne=null,Ce=!1;function De(e,n,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Ce||pe==null||pe!==Ke(u)||(u=pe,"selectionStart"in u&&re(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}),Ne&&te(Ne,u)||(Ne=u,u=tl(ve,"onSelect"),0<u.length&&(n=new Xi("onSelect","select",null,n,o),e.push({event:n,listeners:u}),n.target=pe)))}function $e(e,n){var o={};return o[e.toLowerCase()]=n.toLowerCase(),o["Webkit"+e]="webkit"+n,o["Moz"+e]="moz"+n,o}var Ue={animationend:$e("Animation","AnimationEnd"),animationiteration:$e("Animation","AnimationIteration"),animationstart:$e("Animation","AnimationStart"),transitionend:$e("Transition","TransitionEnd")},Re={},We={};h&&(We=document.createElement("div").style,"AnimationEvent"in window||(delete Ue.animationend.animation,delete Ue.animationiteration.animation,delete Ue.animationstart.animation),"TransitionEvent"in window||delete Ue.transitionend.transition);function Ee(e){if(Re[e])return Re[e];if(!Ue[e])return e;var n=Ue[e],o;for(o in n)if(n.hasOwnProperty(o)&&o in We)return Re[e]=n[o];return e}var nt=Ee("animationend"),rt=Ee("animationiteration"),st=Ee("animationstart"),ft=Ee("transitionend"),gn=new Map,it="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 Pt(e,n){gn.set(e,n),c(n,[e])}for(var qt=0;qt<it.length;qt++){var Xo=it[qt],ln=Xo.toLowerCase(),xo=Xo[0].toUpperCase()+Xo.slice(1);Pt(ln,"on"+xo)}Pt(nt,"onAnimationEnd"),Pt(rt,"onAnimationIteration"),Pt(st,"onAnimationStart"),Pt("dblclick","onDoubleClick"),Pt("focusin","onFocus"),Pt("focusout","onBlur"),Pt(ft,"onTransitionEnd"),d("onMouseEnter",["mouseout","mouseover"]),d("onMouseLeave",["mouseout","mouseover"]),d("onPointerEnter",["pointerout","pointerover"]),d("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wo="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(" "),wg=new Set("cancel close invalid load scroll toggle".split(" ").concat(wo));function sd(e,n,o){var u=e.type||"unknown-event";e.currentTarget=o,Le(u,n,void 0,e),e.currentTarget=null}function ad(e,n){n=(n&4)!==0;for(var o=0;o<e.length;o++){var u=e[o],p=u.event;u=u.listeners;e:{var g=void 0;if(n)for(var E=u.length-1;0<=E;E--){var D=u[E],X=D.instance,ye=D.currentTarget;if(D=D.listener,X!==g&&p.isPropagationStopped())break e;sd(p,D,ye),g=X}else for(E=0;E<u.length;E++){if(D=u[E],X=D.instance,ye=D.currentTarget,D=D.listener,X!==g&&p.isPropagationStopped())break e;sd(p,D,ye),g=X}}}if(An)throw e=On,An=!1,On=null,e}function Mt(e,n){var o=n[Wu];o===void 0&&(o=n[Wu]=new Set);var u=e+"__bubble";o.has(u)||(ld(n,e,2,!1),o.add(u))}function Fu(e,n,o){var u=0;n&&(u|=4),ld(o,e,u,n)}var el="_reactListening"+Math.random().toString(36).slice(2);function Js(e){if(!e[el]){e[el]=!0,s.forEach(function(o){o!=="selectionchange"&&(wg.has(o)||Fu(o,!1,e),Fu(o,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[el]||(n[el]=!0,Fu("selectionchange",!1,n))}}function ld(e,n,o,u){switch(qi(n)){case 1:var p=mi;break;case 4:p=Ru;break;default:p=zs}o=p.bind(null,n,o,e),p=void 0,!sr||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(p=!0),u?p!==void 0?e.addEventListener(n,o,{capture:!0,passive:p}):e.addEventListener(n,o,!0):p!==void 0?e.addEventListener(n,o,{passive:p}):e.addEventListener(n,o,!1)}function Bu(e,n,o,u,p){var g=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 D=u.stateNode.containerInfo;if(D===p||D.nodeType===8&&D.parentNode===p)break;if(E===4)for(E=u.return;E!==null;){var X=E.tag;if((X===3||X===4)&&(X=E.stateNode.containerInfo,X===p||X.nodeType===8&&X.parentNode===p))return;E=E.return}for(;D!==null;){if(E=_i(D),E===null)return;if(X=E.tag,X===5||X===6){u=g=E;continue e}D=D.parentNode}}u=u.return}Xn(function(){var ye=g,Pe=ir(o),Te=[];e:{var je=gn.get(e);if(je!==void 0){var qe=Xi,Qe=e;switch(e){case"keypress":if(Ho(o)===0)break e;case"keydown":case"keyup":qe=Ks;break;case"focusin":Qe="focus",qe=Gi;break;case"focusout":Qe="blur",qe=Gi;break;case"beforeblur":case"afterblur":qe=Gi;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":qe=Qi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":qe=wi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":qe=Ws;break;case nt:case rt:case st:qe=Ua;break;case ft:qe=Wa;break;case"scroll":qe=Vo;break;case"wheel":qe=Ya;break;case"copy":case"cut":case"paste":qe=Zi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":qe=qa}var Ge=(n&4)!==0,Ut=!Ge&&e==="scroll",he=Ge?je!==null?je+"Capture":null:je;Ge=[];for(var ne=ye,me;ne!==null;){me=ne;var Fe=me.stateNode;if(me.tag===5&&Fe!==null&&(me=Fe,he!==null&&(Fe=In(ne,he),Fe!=null&&Ge.push(Zs(ne,Fe,me)))),Ut)break;ne=ne.return}0<Ge.length&&(je=new qe(je,Qe,null,o,Pe),Te.push({event:je,listeners:Ge}))}}if((n&7)===0){e:{if(je=e==="mouseover"||e==="pointerover",qe=e==="mouseout"||e==="pointerout",je&&o!==Nn&&(Qe=o.relatedTarget||o.fromElement)&&(_i(Qe)||Qe[bo]))break e;if((qe||je)&&(je=Pe.window===Pe?Pe:(je=Pe.ownerDocument)?je.defaultView||je.parentWindow:window,qe?(Qe=o.relatedTarget||o.toElement,qe=ye,Qe=Qe?_i(Qe):null,Qe!==null&&(Ut=Ve(Qe),Qe!==Ut||Qe.tag!==5&&Qe.tag!==6)&&(Qe=null)):(qe=null,Qe=ye),qe!==Qe)){if(Ge=Qi,Fe="onMouseLeave",he="onMouseEnter",ne="mouse",(e==="pointerout"||e==="pointerover")&&(Ge=qa,Fe="onPointerLeave",he="onPointerEnter",ne="pointer"),Ut=qe==null?je:as(qe),me=Qe==null?je:as(Qe),je=new Ge(Fe,ne+"leave",qe,o,Pe),je.target=Ut,je.relatedTarget=me,Fe=null,_i(Pe)===ye&&(Ge=new Ge(he,ne+"enter",Qe,o,Pe),Ge.target=me,Ge.relatedTarget=Ut,Fe=Ge),Ut=Fe,qe&&Qe)t:{for(Ge=qe,he=Qe,ne=0,me=Ge;me;me=is(me))ne++;for(me=0,Fe=he;Fe;Fe=is(Fe))me++;for(;0<ne-me;)Ge=is(Ge),ne--;for(;0<me-ne;)he=is(he),me--;for(;ne--;){if(Ge===he||he!==null&&Ge===he.alternate)break t;Ge=is(Ge),he=is(he)}Ge=null}else Ge=null;qe!==null&&ud(Te,je,qe,Ge,!1),Qe!==null&&Ut!==null&&ud(Te,Ut,Qe,Ge,!0)}}e:{if(je=ye?as(ye):window,qe=je.nodeName&&je.nodeName.toLowerCase(),qe==="select"||qe==="input"&&je.type==="file")var Je=Yo;else if(go(je))if(Pr)Je=O;else{Je=N;var et=_}else(qe=je.nodeName)&&qe.toLowerCase()==="input"&&(je.type==="checkbox"||je.type==="radio")&&(Je=M);if(Je&&(Je=Je(e,ye))){Za(Te,Je,o,Pe);break e}et&&et(e,je,ye),e==="focusout"&&(et=je._wrapperState)&&et.controlled&&je.type==="number"&&Zt(je,"number",je.value)}switch(et=ye?as(ye):window,e){case"focusin":(go(et)||et.contentEditable==="true")&&(pe=et,ve=ye,Ne=null);break;case"focusout":Ne=ve=pe=null;break;case"mousedown":Ce=!0;break;case"contextmenu":case"mouseup":case"dragend":Ce=!1,De(Te,o,Pe);break;case"selectionchange":if(ge)break;case"keydown":case"keyup":De(Te,o,Pe)}var tt;if(Ys)e:{switch(e){case"compositionstart":var ot="onCompositionStart";break e;case"compositionend":ot="onCompositionEnd";break e;case"compositionupdate":ot="onCompositionUpdate";break e}ot=void 0}else Cr?Ga(e,o)&&(ot="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(ot="onCompositionStart");ot&&(Qs&&o.locale!=="ko"&&(Cr||ot!=="onCompositionStart"?ot==="onCompositionEnd"&&Cr&&(tt=Yi()):(qr=Pe,Fs="value"in qr?qr.value:qr.textContent,Cr=!0)),et=tl(ye,ot),0<et.length&&(ot=new Wr(ot,e,null,o,Pe),Te.push({event:ot,listeners:et}),tt?ot.data=tt:(tt=Ja(o),tt!==null&&(ot.data=tt)))),(tt=Xs?jr(e,o):Dt(e,o))&&(ye=tl(ye,"onBeforeInput"),0<ye.length&&(Pe=new Wr("onBeforeInput","beforeinput",null,o,Pe),Te.push({event:Pe,listeners:ye}),Pe.data=tt))}ad(Te,n)})}function Zs(e,n,o){return{instance:e,listener:n,currentTarget:o}}function tl(e,n){for(var o=n+"Capture",u=[];e!==null;){var p=e,g=p.stateNode;p.tag===5&&g!==null&&(p=g,g=In(e,o),g!=null&&u.unshift(Zs(e,g,p)),g=In(e,n),g!=null&&u.push(Zs(e,g,p))),e=e.return}return u}function is(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ud(e,n,o,u,p){for(var g=n._reactName,E=[];o!==null&&o!==u;){var D=o,X=D.alternate,ye=D.stateNode;if(X!==null&&X===u)break;D.tag===5&&ye!==null&&(D=ye,p?(X=In(o,g),X!=null&&E.unshift(Zs(o,X,D))):p||(X=In(o,g),X!=null&&E.push(Zs(o,X,D)))),o=o.return}E.length!==0&&e.push({event:n,listeners:E})}var bg=/\r\n?/g,_g=/\u0000|\uFFFD/g;function cd(e){return(typeof e=="string"?e:""+e).replace(bg,`
38
+ `).replace(_g,"")}function nl(e,n,o){if(n=cd(n),cd(e)!==n&&o)throw Error(i(425))}function rl(){}var Hu=null,Vu=null;function Uu(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Ku=typeof setTimeout=="function"?setTimeout:void 0,Sg=typeof clearTimeout=="function"?clearTimeout:void 0,fd=typeof Promise=="function"?Promise:void 0,kg=typeof queueMicrotask=="function"?queueMicrotask:typeof fd<"u"?function(e){return fd.resolve(null).then(e).catch(Ng)}:Ku;function Ng(e){setTimeout(function(){throw e})}function qu(e,n){var o=n,u=0;do{var p=o.nextSibling;if(e.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"){if(u===0){e.removeChild(p),co(n);return}u--}else o!=="$"&&o!=="$?"&&o!=="$!"||u++;o=p}while(o);co(n)}function Qo(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return e}function dd(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="$"||o==="$!"||o==="$?"){if(n===0)return e;n--}else o==="/$"&&n++}e=e.previousSibling}return null}var ss=Math.random().toString(36).slice(2),Yr="__reactFiber$"+ss,ea="__reactProps$"+ss,bo="__reactContainer$"+ss,Wu="__reactEvents$"+ss,Eg="__reactListeners$"+ss,Cg="__reactHandles$"+ss;function _i(e){var n=e[Yr];if(n)return n;for(var o=e.parentNode;o;){if(n=o[bo]||o[Yr]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(e=dd(e);e!==null;){if(o=e[Yr])return o;e=dd(e)}return n}e=o,o=e.parentNode}return null}function ta(e){return e=e[Yr]||e[bo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function as(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function ol(e){return e[ea]||null}var Yu=[],ls=-1;function Go(e){return{current:e}}function $t(e){0>ls||(e.current=Yu[ls],Yu[ls]=null,ls--)}function Ct(e,n){ls++,Yu[ls]=e.current,e.current=n}var Jo={},yn=Go(Jo),Dn=Go(!1),Si=Jo;function us(e,n){var o=e.type.contextTypes;if(!o)return Jo;var u=e.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===n)return u.__reactInternalMemoizedMaskedChildContext;var p={},g;for(g in o)p[g]=n[g];return u&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=p),p}function zn(e){return e=e.childContextTypes,e!=null}function il(){$t(Dn),$t(yn)}function pd(e,n,o){if(yn.current!==Jo)throw Error(i(168));Ct(yn,n),Ct(Dn,o)}function hd(e,n,o){var u=e.stateNode;if(n=n.childContextTypes,typeof u.getChildContext!="function")return o;u=u.getChildContext();for(var p in u)if(!(p in n))throw Error(i(108,Ae(e)||"Unknown",p));return F({},o,u)}function sl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Jo,Si=yn.current,Ct(yn,e),Ct(Dn,Dn.current),!0}function md(e,n,o){var u=e.stateNode;if(!u)throw Error(i(169));o?(e=hd(e,n,Si),u.__reactInternalMemoizedMergedChildContext=e,$t(Dn),$t(yn),Ct(yn,e)):$t(Dn),Ct(Dn,o)}var _o=null,al=!1,Xu=!1;function gd(e){_o===null?_o=[e]:_o.push(e)}function jg(e){al=!0,gd(e)}function Zo(){if(!Xu&&_o!==null){Xu=!0;var e=0,n=wt;try{var o=_o;for(wt=1;e<o.length;e++){var u=o[e];do u=u(!0);while(u!==null)}_o=null,al=!1}catch(p){throw _o!==null&&(_o=_o.slice(e+1)),wr(ar,Zo),p}finally{wt=n,Xu=!1}}return null}var cs=[],fs=0,ll=null,ul=0,fr=[],dr=0,ki=null,So=1,ko="";function Ni(e,n){cs[fs++]=ul,cs[fs++]=ll,ll=e,ul=n}function yd(e,n,o){fr[dr++]=So,fr[dr++]=ko,fr[dr++]=ki,ki=e;var u=So;e=ko;var p=32-hn(u)-1;u&=~(1<<p),o+=1;var g=32-hn(n)+p;if(30<g){var E=p-p%5;g=(u&(1<<E)-1).toString(32),u>>=E,p-=E,So=1<<32-hn(n)+p|o<<p|u,ko=g+e}else So=1<<g|o<<p|u,ko=e}function Qu(e){e.return!==null&&(Ni(e,1),yd(e,1,0))}function Gu(e){for(;e===ll;)ll=cs[--fs],cs[fs]=null,ul=cs[--fs],cs[fs]=null;for(;e===ki;)ki=fr[--dr],fr[dr]=null,ko=fr[--dr],fr[dr]=null,So=fr[--dr],fr[dr]=null}var er=null,tr=null,Ot=!1,Mr=null;function vd(e,n){var o=gr(5,null,null,0);o.elementType="DELETED",o.stateNode=n,o.return=e,n=e.deletions,n===null?(e.deletions=[o],e.flags|=16):n.push(o)}function xd(e,n){switch(e.tag){case 5:var o=e.type;return n=n.nodeType!==1||o.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,er=e,tr=Qo(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,er=e,tr=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(o=ki!==null?{id:So,overflow:ko}:null,e.memoizedState={dehydrated:n,treeContext:o,retryLane:1073741824},o=gr(18,null,null,0),o.stateNode=n,o.return=e,e.child=o,er=e,tr=null,!0):!1;default:return!1}}function Ju(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Zu(e){if(Ot){var n=tr;if(n){var o=n;if(!xd(e,n)){if(Ju(e))throw Error(i(418));n=Qo(o.nextSibling);var u=er;n&&xd(e,n)?vd(u,o):(e.flags=e.flags&-4097|2,Ot=!1,er=e)}}else{if(Ju(e))throw Error(i(418));e.flags=e.flags&-4097|2,Ot=!1,er=e}}}function wd(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;er=e}function cl(e){if(e!==er)return!1;if(!Ot)return wd(e),Ot=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!Uu(e.type,e.memoizedProps)),n&&(n=tr)){if(Ju(e))throw bd(),Error(i(418));for(;n;)vd(e,n),n=Qo(n.nextSibling)}if(wd(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="/$"){if(n===0){tr=Qo(e.nextSibling);break e}n--}else o!=="$"&&o!=="$!"&&o!=="$?"||n++}e=e.nextSibling}tr=null}}else tr=er?Qo(e.stateNode.nextSibling):null;return!0}function bd(){for(var e=tr;e;)e=Qo(e.nextSibling)}function ds(){tr=er=null,Ot=!1}function ec(e){Mr===null?Mr=[e]:Mr.push(e)}var Pg=R.ReactCurrentBatchConfig;function na(e,n,o){if(e=o.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(o._owner){if(o=o._owner,o){if(o.tag!==1)throw Error(i(309));var u=o.stateNode}if(!u)throw Error(i(147,e));var p=u,g=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===g?n.ref:(n=function(E){var D=p.refs;E===null?delete D[g]:D[g]=E},n._stringRef=g,n)}if(typeof e!="string")throw Error(i(284));if(!o._owner)throw Error(i(290,e))}return e}function fl(e,n){throw e=Object.prototype.toString.call(n),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e))}function _d(e){var n=e._init;return n(e._payload)}function Sd(e){function n(he,ne){if(e){var me=he.deletions;me===null?(he.deletions=[ne],he.flags|=16):me.push(ne)}}function o(he,ne){if(!e)return null;for(;ne!==null;)n(he,ne),ne=ne.sibling;return null}function u(he,ne){for(he=new Map;ne!==null;)ne.key!==null?he.set(ne.key,ne):he.set(ne.index,ne),ne=ne.sibling;return he}function p(he,ne){return he=ai(he,ne),he.index=0,he.sibling=null,he}function g(he,ne,me){return he.index=me,e?(me=he.alternate,me!==null?(me=me.index,me<ne?(he.flags|=2,ne):me):(he.flags|=2,ne)):(he.flags|=1048576,ne)}function E(he){return e&&he.alternate===null&&(he.flags|=2),he}function D(he,ne,me,Fe){return ne===null||ne.tag!==6?(ne=Kc(me,he.mode,Fe),ne.return=he,ne):(ne=p(ne,me),ne.return=he,ne)}function X(he,ne,me,Fe){var Je=me.type;return Je===Q?Pe(he,ne,me.props.children,Fe,me.key):ne!==null&&(ne.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===G&&_d(Je)===ne.type)?(Fe=p(ne,me.props),Fe.ref=na(he,ne,me),Fe.return=he,Fe):(Fe=Ol(me.type,me.key,me.props,null,he.mode,Fe),Fe.ref=na(he,ne,me),Fe.return=he,Fe)}function ye(he,ne,me,Fe){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==me.containerInfo||ne.stateNode.implementation!==me.implementation?(ne=qc(me,he.mode,Fe),ne.return=he,ne):(ne=p(ne,me.children||[]),ne.return=he,ne)}function Pe(he,ne,me,Fe,Je){return ne===null||ne.tag!==7?(ne=Ii(me,he.mode,Fe,Je),ne.return=he,ne):(ne=p(ne,me),ne.return=he,ne)}function Te(he,ne,me){if(typeof ne=="string"&&ne!==""||typeof ne=="number")return ne=Kc(""+ne,he.mode,me),ne.return=he,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case B:return me=Ol(ne.type,ne.key,ne.props,null,he.mode,me),me.ref=na(he,null,ne),me.return=he,me;case H:return ne=qc(ne,he.mode,me),ne.return=he,ne;case G:var Fe=ne._init;return Te(he,Fe(ne._payload),me)}if(Vt(ne)||W(ne))return ne=Ii(ne,he.mode,me,null),ne.return=he,ne;fl(he,ne)}return null}function je(he,ne,me,Fe){var Je=ne!==null?ne.key:null;if(typeof me=="string"&&me!==""||typeof me=="number")return Je!==null?null:D(he,ne,""+me,Fe);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case B:return me.key===Je?X(he,ne,me,Fe):null;case H:return me.key===Je?ye(he,ne,me,Fe):null;case G:return Je=me._init,je(he,ne,Je(me._payload),Fe)}if(Vt(me)||W(me))return Je!==null?null:Pe(he,ne,me,Fe,null);fl(he,me)}return null}function qe(he,ne,me,Fe,Je){if(typeof Fe=="string"&&Fe!==""||typeof Fe=="number")return he=he.get(me)||null,D(ne,he,""+Fe,Je);if(typeof Fe=="object"&&Fe!==null){switch(Fe.$$typeof){case B:return he=he.get(Fe.key===null?me:Fe.key)||null,X(ne,he,Fe,Je);case H:return he=he.get(Fe.key===null?me:Fe.key)||null,ye(ne,he,Fe,Je);case G:var et=Fe._init;return qe(he,ne,me,et(Fe._payload),Je)}if(Vt(Fe)||W(Fe))return he=he.get(me)||null,Pe(ne,he,Fe,Je,null);fl(ne,Fe)}return null}function Qe(he,ne,me,Fe){for(var Je=null,et=null,tt=ne,ot=ne=0,on=null;tt!==null&&ot<me.length;ot++){tt.index>ot?(on=tt,tt=null):on=tt.sibling;var bt=je(he,tt,me[ot],Fe);if(bt===null){tt===null&&(tt=on);break}e&&tt&&bt.alternate===null&&n(he,tt),ne=g(bt,ne,ot),et===null?Je=bt:et.sibling=bt,et=bt,tt=on}if(ot===me.length)return o(he,tt),Ot&&Ni(he,ot),Je;if(tt===null){for(;ot<me.length;ot++)tt=Te(he,me[ot],Fe),tt!==null&&(ne=g(tt,ne,ot),et===null?Je=tt:et.sibling=tt,et=tt);return Ot&&Ni(he,ot),Je}for(tt=u(he,tt);ot<me.length;ot++)on=qe(tt,he,ot,me[ot],Fe),on!==null&&(e&&on.alternate!==null&&tt.delete(on.key===null?ot:on.key),ne=g(on,ne,ot),et===null?Je=on:et.sibling=on,et=on);return e&&tt.forEach(function(li){return n(he,li)}),Ot&&Ni(he,ot),Je}function Ge(he,ne,me,Fe){var Je=W(me);if(typeof Je!="function")throw Error(i(150));if(me=Je.call(me),me==null)throw Error(i(151));for(var et=Je=null,tt=ne,ot=ne=0,on=null,bt=me.next();tt!==null&&!bt.done;ot++,bt=me.next()){tt.index>ot?(on=tt,tt=null):on=tt.sibling;var li=je(he,tt,bt.value,Fe);if(li===null){tt===null&&(tt=on);break}e&&tt&&li.alternate===null&&n(he,tt),ne=g(li,ne,ot),et===null?Je=li:et.sibling=li,et=li,tt=on}if(bt.done)return o(he,tt),Ot&&Ni(he,ot),Je;if(tt===null){for(;!bt.done;ot++,bt=me.next())bt=Te(he,bt.value,Fe),bt!==null&&(ne=g(bt,ne,ot),et===null?Je=bt:et.sibling=bt,et=bt);return Ot&&Ni(he,ot),Je}for(tt=u(he,tt);!bt.done;ot++,bt=me.next())bt=qe(tt,he,ot,bt.value,Fe),bt!==null&&(e&&bt.alternate!==null&&tt.delete(bt.key===null?ot:bt.key),ne=g(bt,ne,ot),et===null?Je=bt:et.sibling=bt,et=bt);return e&&tt.forEach(function(ly){return n(he,ly)}),Ot&&Ni(he,ot),Je}function Ut(he,ne,me,Fe){if(typeof me=="object"&&me!==null&&me.type===Q&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case B:e:{for(var Je=me.key,et=ne;et!==null;){if(et.key===Je){if(Je=me.type,Je===Q){if(et.tag===7){o(he,et.sibling),ne=p(et,me.props.children),ne.return=he,he=ne;break e}}else if(et.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===G&&_d(Je)===et.type){o(he,et.sibling),ne=p(et,me.props),ne.ref=na(he,et,me),ne.return=he,he=ne;break e}o(he,et);break}else n(he,et);et=et.sibling}me.type===Q?(ne=Ii(me.props.children,he.mode,Fe,me.key),ne.return=he,he=ne):(Fe=Ol(me.type,me.key,me.props,null,he.mode,Fe),Fe.ref=na(he,ne,me),Fe.return=he,he=Fe)}return E(he);case H:e:{for(et=me.key;ne!==null;){if(ne.key===et)if(ne.tag===4&&ne.stateNode.containerInfo===me.containerInfo&&ne.stateNode.implementation===me.implementation){o(he,ne.sibling),ne=p(ne,me.children||[]),ne.return=he,he=ne;break e}else{o(he,ne);break}else n(he,ne);ne=ne.sibling}ne=qc(me,he.mode,Fe),ne.return=he,he=ne}return E(he);case G:return et=me._init,Ut(he,ne,et(me._payload),Fe)}if(Vt(me))return Qe(he,ne,me,Fe);if(W(me))return Ge(he,ne,me,Fe);fl(he,me)}return typeof me=="string"&&me!==""||typeof me=="number"?(me=""+me,ne!==null&&ne.tag===6?(o(he,ne.sibling),ne=p(ne,me),ne.return=he,he=ne):(o(he,ne),ne=Kc(me,he.mode,Fe),ne.return=he,he=ne),E(he)):o(he,ne)}return Ut}var ps=Sd(!0),kd=Sd(!1),dl=Go(null),pl=null,hs=null,tc=null;function nc(){tc=hs=pl=null}function rc(e){var n=dl.current;$t(dl),e._currentValue=n}function oc(e,n,o){for(;e!==null;){var u=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,u!==null&&(u.childLanes|=n)):u!==null&&(u.childLanes&n)!==n&&(u.childLanes|=n),e===o)break;e=e.return}}function ms(e,n){pl=e,tc=hs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(Fn=!0),e.firstContext=null)}function pr(e){var n=e._currentValue;if(tc!==e)if(e={context:e,memoizedValue:n,next:null},hs===null){if(pl===null)throw Error(i(308));hs=e,pl.dependencies={lanes:0,firstContext:e}}else hs=hs.next=e;return n}var Ei=null;function ic(e){Ei===null?Ei=[e]:Ei.push(e)}function Nd(e,n,o,u){var p=n.interleaved;return p===null?(o.next=o,ic(n)):(o.next=p.next,p.next=o),n.interleaved=o,No(e,u)}function No(e,n){e.lanes|=n;var o=e.alternate;for(o!==null&&(o.lanes|=n),o=e,e=e.return;e!==null;)e.childLanes|=n,o=e.alternate,o!==null&&(o.childLanes|=n),o=e,e=e.return;return o.tag===3?o.stateNode:null}var ei=!1;function sc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ed(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Eo(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function ti(e,n,o){var u=e.updateQueue;if(u===null)return null;if(u=u.shared,(xt&2)!==0){var p=u.pending;return p===null?n.next=n:(n.next=p.next,p.next=n),u.pending=n,No(e,o)}return p=u.interleaved,p===null?(n.next=n,ic(u)):(n.next=p.next,p.next=n),u.interleaved=n,No(e,o)}function hl(e,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194240)!==0)){var u=n.lanes;u&=e.pendingLanes,o|=u,n.lanes=o,zo(e,o)}}function Cd(e,n){var o=e.updateQueue,u=e.alternate;if(u!==null&&(u=u.updateQueue,o===u)){var p=null,g=null;if(o=o.firstBaseUpdate,o!==null){do{var E={eventTime:o.eventTime,lane:o.lane,tag:o.tag,payload:o.payload,callback:o.callback,next:null};g===null?p=g=E:g=g.next=E,o=o.next}while(o!==null);g===null?p=g=n:g=g.next=n}else p=g=n;o={baseState:u.baseState,firstBaseUpdate:p,lastBaseUpdate:g,shared:u.shared,effects:u.effects},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=n:e.next=n,o.lastBaseUpdate=n}function ml(e,n,o,u){var p=e.updateQueue;ei=!1;var g=p.firstBaseUpdate,E=p.lastBaseUpdate,D=p.shared.pending;if(D!==null){p.shared.pending=null;var X=D,ye=X.next;X.next=null,E===null?g=ye:E.next=ye,E=X;var Pe=e.alternate;Pe!==null&&(Pe=Pe.updateQueue,D=Pe.lastBaseUpdate,D!==E&&(D===null?Pe.firstBaseUpdate=ye:D.next=ye,Pe.lastBaseUpdate=X))}if(g!==null){var Te=p.baseState;E=0,Pe=ye=X=null,D=g;do{var je=D.lane,qe=D.eventTime;if((u&je)===je){Pe!==null&&(Pe=Pe.next={eventTime:qe,lane:0,tag:D.tag,payload:D.payload,callback:D.callback,next:null});e:{var Qe=e,Ge=D;switch(je=n,qe=o,Ge.tag){case 1:if(Qe=Ge.payload,typeof Qe=="function"){Te=Qe.call(qe,Te,je);break e}Te=Qe;break e;case 3:Qe.flags=Qe.flags&-65537|128;case 0:if(Qe=Ge.payload,je=typeof Qe=="function"?Qe.call(qe,Te,je):Qe,je==null)break e;Te=F({},Te,je);break e;case 2:ei=!0}}D.callback!==null&&D.lane!==0&&(e.flags|=64,je=p.effects,je===null?p.effects=[D]:je.push(D))}else qe={eventTime:qe,lane:je,tag:D.tag,payload:D.payload,callback:D.callback,next:null},Pe===null?(ye=Pe=qe,X=Te):Pe=Pe.next=qe,E|=je;if(D=D.next,D===null){if(D=p.shared.pending,D===null)break;je=D,D=je.next,je.next=null,p.lastBaseUpdate=je,p.shared.pending=null}}while(!0);if(Pe===null&&(X=Te),p.baseState=X,p.firstBaseUpdate=ye,p.lastBaseUpdate=Pe,n=p.shared.interleaved,n!==null){p=n;do E|=p.lane,p=p.next;while(p!==n)}else g===null&&(p.shared.lanes=0);Pi|=E,e.lanes=E,e.memoizedState=Te}}function jd(e,n,o){if(e=n.effects,n.effects=null,e!==null)for(n=0;n<e.length;n++){var u=e[n],p=u.callback;if(p!==null){if(u.callback=null,u=o,typeof p!="function")throw Error(i(191,p));p.call(u)}}}var ra={},Xr=Go(ra),oa=Go(ra),ia=Go(ra);function Ci(e){if(e===ra)throw Error(i(174));return e}function ac(e,n){switch(Ct(ia,n),Ct(oa,e),Ct(Xr,ra),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:Lt(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=Lt(n,e)}$t(Xr),Ct(Xr,n)}function gs(){$t(Xr),$t(oa),$t(ia)}function Pd(e){Ci(ia.current);var n=Ci(Xr.current),o=Lt(n,e.type);n!==o&&(Ct(oa,e),Ct(Xr,o))}function lc(e){oa.current===e&&($t(Xr),$t(oa))}var zt=Go(0);function gl(e){for(var n=e;n!==null;){if(n.tag===13){var o=n.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||o.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var uc=[];function cc(){for(var e=0;e<uc.length;e++)uc[e]._workInProgressVersionPrimary=null;uc.length=0}var yl=R.ReactCurrentDispatcher,fc=R.ReactCurrentBatchConfig,ji=0,Ft=null,Gt=null,nn=null,vl=!1,sa=!1,aa=0,Mg=0;function vn(){throw Error(i(321))}function dc(e,n){if(n===null)return!1;for(var o=0;o<n.length&&o<e.length;o++)if(!ue(e[o],n[o]))return!1;return!0}function pc(e,n,o,u,p,g){if(ji=g,Ft=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,yl.current=e===null||e.memoizedState===null?Ag:Og,e=o(u,p),sa){g=0;do{if(sa=!1,aa=0,25<=g)throw Error(i(301));g+=1,nn=Gt=null,n.updateQueue=null,yl.current=Rg,e=o(u,p)}while(sa)}if(yl.current=bl,n=Gt!==null&&Gt.next!==null,ji=0,nn=Gt=Ft=null,vl=!1,n)throw Error(i(300));return e}function hc(){var e=aa!==0;return aa=0,e}function Qr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nn===null?Ft.memoizedState=nn=e:nn=nn.next=e,nn}function hr(){if(Gt===null){var e=Ft.alternate;e=e!==null?e.memoizedState:null}else e=Gt.next;var n=nn===null?Ft.memoizedState:nn.next;if(n!==null)nn=n,Gt=e;else{if(e===null)throw Error(i(310));Gt=e,e={memoizedState:Gt.memoizedState,baseState:Gt.baseState,baseQueue:Gt.baseQueue,queue:Gt.queue,next:null},nn===null?Ft.memoizedState=nn=e:nn=nn.next=e}return nn}function la(e,n){return typeof n=="function"?n(e):n}function mc(e){var n=hr(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var u=Gt,p=u.baseQueue,g=o.pending;if(g!==null){if(p!==null){var E=p.next;p.next=g.next,g.next=E}u.baseQueue=p=g,o.pending=null}if(p!==null){g=p.next,u=u.baseState;var D=E=null,X=null,ye=g;do{var Pe=ye.lane;if((ji&Pe)===Pe)X!==null&&(X=X.next={lane:0,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null}),u=ye.hasEagerState?ye.eagerState:e(u,ye.action);else{var Te={lane:Pe,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null};X===null?(D=X=Te,E=u):X=X.next=Te,Ft.lanes|=Pe,Pi|=Pe}ye=ye.next}while(ye!==null&&ye!==g);X===null?E=u:X.next=D,ue(u,n.memoizedState)||(Fn=!0),n.memoizedState=u,n.baseState=E,n.baseQueue=X,o.lastRenderedState=u}if(e=o.interleaved,e!==null){p=e;do g=p.lane,Ft.lanes|=g,Pi|=g,p=p.next;while(p!==e)}else p===null&&(o.lanes=0);return[n.memoizedState,o.dispatch]}function gc(e){var n=hr(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var u=o.dispatch,p=o.pending,g=n.memoizedState;if(p!==null){o.pending=null;var E=p=p.next;do g=e(g,E.action),E=E.next;while(E!==p);ue(g,n.memoizedState)||(Fn=!0),n.memoizedState=g,n.baseQueue===null&&(n.baseState=g),o.lastRenderedState=g}return[g,u]}function Md(){}function $d(e,n){var o=Ft,u=hr(),p=n(),g=!ue(u.memoizedState,p);if(g&&(u.memoizedState=p,Fn=!0),u=u.queue,yc(Ad.bind(null,o,u,e),[e]),u.getSnapshot!==n||g||nn!==null&&nn.memoizedState.tag&1){if(o.flags|=2048,ua(9,Id.bind(null,o,u,p,n),void 0,null),rn===null)throw Error(i(349));(ji&30)!==0||Td(o,n,p)}return p}function Td(e,n,o){e.flags|=16384,e={getSnapshot:n,value:o},n=Ft.updateQueue,n===null?(n={lastEffect:null,stores:null},Ft.updateQueue=n,n.stores=[e]):(o=n.stores,o===null?n.stores=[e]:o.push(e))}function Id(e,n,o,u){n.value=o,n.getSnapshot=u,Od(n)&&Rd(e)}function Ad(e,n,o){return o(function(){Od(n)&&Rd(e)})}function Od(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!ue(e,o)}catch{return!0}}function Rd(e){var n=No(e,1);n!==null&&Ar(n,e,1,-1)}function Ld(e){var n=Qr();return typeof e=="function"&&(e=e()),n.memoizedState=n.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:e},n.queue=e,e=e.dispatch=Ig.bind(null,Ft,e),[n.memoizedState,e]}function ua(e,n,o,u){return e={tag:e,create:n,destroy:o,deps:u,next:null},n=Ft.updateQueue,n===null?(n={lastEffect:null,stores:null},Ft.updateQueue=n,n.lastEffect=e.next=e):(o=n.lastEffect,o===null?n.lastEffect=e.next=e:(u=o.next,o.next=e,e.next=u,n.lastEffect=e)),e}function Dd(){return hr().memoizedState}function xl(e,n,o,u){var p=Qr();Ft.flags|=e,p.memoizedState=ua(1|n,o,void 0,u===void 0?null:u)}function wl(e,n,o,u){var p=hr();u=u===void 0?null:u;var g=void 0;if(Gt!==null){var E=Gt.memoizedState;if(g=E.destroy,u!==null&&dc(u,E.deps)){p.memoizedState=ua(n,o,g,u);return}}Ft.flags|=e,p.memoizedState=ua(1|n,o,g,u)}function zd(e,n){return xl(8390656,8,e,n)}function yc(e,n){return wl(2048,8,e,n)}function Fd(e,n){return wl(4,2,e,n)}function Bd(e,n){return wl(4,4,e,n)}function Hd(e,n){if(typeof n=="function")return e=e(),n(e),function(){n(null)};if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Vd(e,n,o){return o=o!=null?o.concat([e]):null,wl(4,4,Hd.bind(null,n,e),o)}function vc(){}function Ud(e,n){var o=hr();n=n===void 0?null:n;var u=o.memoizedState;return u!==null&&n!==null&&dc(n,u[1])?u[0]:(o.memoizedState=[e,n],e)}function Kd(e,n){var o=hr();n=n===void 0?null:n;var u=o.memoizedState;return u!==null&&n!==null&&dc(n,u[1])?u[0]:(e=e(),o.memoizedState=[e,n],e)}function qd(e,n,o){return(ji&21)===0?(e.baseState&&(e.baseState=!1,Fn=!0),e.memoizedState=o):(ue(o,n)||(o=Ur(),Ft.lanes|=o,Pi|=o,e.baseState=!0),n)}function $g(e,n){var o=wt;wt=o!==0&&4>o?o:4,e(!0);var u=fc.transition;fc.transition={};try{e(!1),n()}finally{wt=o,fc.transition=u}}function Wd(){return hr().memoizedState}function Tg(e,n,o){var u=ii(e);if(o={lane:u,action:o,hasEagerState:!1,eagerState:null,next:null},Yd(e))Xd(n,o);else if(o=Nd(e,n,o,u),o!==null){var p=Mn();Ar(o,e,u,p),Qd(o,n,u)}}function Ig(e,n,o){var u=ii(e),p={lane:u,action:o,hasEagerState:!1,eagerState:null,next:null};if(Yd(e))Xd(n,p);else{var g=e.alternate;if(e.lanes===0&&(g===null||g.lanes===0)&&(g=n.lastRenderedReducer,g!==null))try{var E=n.lastRenderedState,D=g(E,o);if(p.hasEagerState=!0,p.eagerState=D,ue(D,E)){var X=n.interleaved;X===null?(p.next=p,ic(n)):(p.next=X.next,X.next=p),n.interleaved=p;return}}catch{}finally{}o=Nd(e,n,p,u),o!==null&&(p=Mn(),Ar(o,e,u,p),Qd(o,n,u))}}function Yd(e){var n=e.alternate;return e===Ft||n!==null&&n===Ft}function Xd(e,n){sa=vl=!0;var o=e.pending;o===null?n.next=n:(n.next=o.next,o.next=n),e.pending=n}function Qd(e,n,o){if((o&4194240)!==0){var u=n.lanes;u&=e.pendingLanes,o|=u,n.lanes=o,zo(e,o)}}var bl={readContext:pr,useCallback:vn,useContext:vn,useEffect:vn,useImperativeHandle:vn,useInsertionEffect:vn,useLayoutEffect:vn,useMemo:vn,useReducer:vn,useRef:vn,useState:vn,useDebugValue:vn,useDeferredValue:vn,useTransition:vn,useMutableSource:vn,useSyncExternalStore:vn,useId:vn,unstable_isNewReconciler:!1},Ag={readContext:pr,useCallback:function(e,n){return Qr().memoizedState=[e,n===void 0?null:n],e},useContext:pr,useEffect:zd,useImperativeHandle:function(e,n,o){return o=o!=null?o.concat([e]):null,xl(4194308,4,Hd.bind(null,n,e),o)},useLayoutEffect:function(e,n){return xl(4194308,4,e,n)},useInsertionEffect:function(e,n){return xl(4,2,e,n)},useMemo:function(e,n){var o=Qr();return n=n===void 0?null:n,e=e(),o.memoizedState=[e,n],e},useReducer:function(e,n,o){var u=Qr();return n=o!==void 0?o(n):n,u.memoizedState=u.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},u.queue=e,e=e.dispatch=Tg.bind(null,Ft,e),[u.memoizedState,e]},useRef:function(e){var n=Qr();return e={current:e},n.memoizedState=e},useState:Ld,useDebugValue:vc,useDeferredValue:function(e){return Qr().memoizedState=e},useTransition:function(){var e=Ld(!1),n=e[0];return e=$g.bind(null,e[1]),Qr().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,o){var u=Ft,p=Qr();if(Ot){if(o===void 0)throw Error(i(407));o=o()}else{if(o=n(),rn===null)throw Error(i(349));(ji&30)!==0||Td(u,n,o)}p.memoizedState=o;var g={value:o,getSnapshot:n};return p.queue=g,zd(Ad.bind(null,u,g,e),[e]),u.flags|=2048,ua(9,Id.bind(null,u,g,o,n),void 0,null),o},useId:function(){var e=Qr(),n=rn.identifierPrefix;if(Ot){var o=ko,u=So;o=(u&~(1<<32-hn(u)-1)).toString(32)+o,n=":"+n+"R"+o,o=aa++,0<o&&(n+="H"+o.toString(32)),n+=":"}else o=Mg++,n=":"+n+"r"+o.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},Og={readContext:pr,useCallback:Ud,useContext:pr,useEffect:yc,useImperativeHandle:Vd,useInsertionEffect:Fd,useLayoutEffect:Bd,useMemo:Kd,useReducer:mc,useRef:Dd,useState:function(){return mc(la)},useDebugValue:vc,useDeferredValue:function(e){var n=hr();return qd(n,Gt.memoizedState,e)},useTransition:function(){var e=mc(la)[0],n=hr().memoizedState;return[e,n]},useMutableSource:Md,useSyncExternalStore:$d,useId:Wd,unstable_isNewReconciler:!1},Rg={readContext:pr,useCallback:Ud,useContext:pr,useEffect:yc,useImperativeHandle:Vd,useInsertionEffect:Fd,useLayoutEffect:Bd,useMemo:Kd,useReducer:gc,useRef:Dd,useState:function(){return gc(la)},useDebugValue:vc,useDeferredValue:function(e){var n=hr();return Gt===null?n.memoizedState=e:qd(n,Gt.memoizedState,e)},useTransition:function(){var e=gc(la)[0],n=hr().memoizedState;return[e,n]},useMutableSource:Md,useSyncExternalStore:$d,useId:Wd,unstable_isNewReconciler:!1};function $r(e,n){if(e&&e.defaultProps){n=F({},n),e=e.defaultProps;for(var o in e)n[o]===void 0&&(n[o]=e[o]);return n}return n}function xc(e,n,o,u){n=e.memoizedState,o=o(u,n),o=o==null?n:F({},n,o),e.memoizedState=o,e.lanes===0&&(e.updateQueue.baseState=o)}var _l={isMounted:function(e){return(e=e._reactInternals)?Ve(e)===e:!1},enqueueSetState:function(e,n,o){e=e._reactInternals;var u=Mn(),p=ii(e),g=Eo(u,p);g.payload=n,o!=null&&(g.callback=o),n=ti(e,g,p),n!==null&&(Ar(n,e,p,u),hl(n,e,p))},enqueueReplaceState:function(e,n,o){e=e._reactInternals;var u=Mn(),p=ii(e),g=Eo(u,p);g.tag=1,g.payload=n,o!=null&&(g.callback=o),n=ti(e,g,p),n!==null&&(Ar(n,e,p,u),hl(n,e,p))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var o=Mn(),u=ii(e),p=Eo(o,u);p.tag=2,n!=null&&(p.callback=n),n=ti(e,p,u),n!==null&&(Ar(n,e,u,o),hl(n,e,u))}};function Gd(e,n,o,u,p,g,E){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(u,g,E):n.prototype&&n.prototype.isPureReactComponent?!te(o,u)||!te(p,g):!0}function Jd(e,n,o){var u=!1,p=Jo,g=n.contextType;return typeof g=="object"&&g!==null?g=pr(g):(p=zn(n)?Si:yn.current,u=n.contextTypes,g=(u=u!=null)?us(e,p):Jo),n=new n(o,g),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=_l,e.stateNode=n,n._reactInternals=e,u&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=p,e.__reactInternalMemoizedMaskedChildContext=g),n}function Zd(e,n,o,u){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(o,u),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(o,u),n.state!==e&&_l.enqueueReplaceState(n,n.state,null)}function wc(e,n,o,u){var p=e.stateNode;p.props=o,p.state=e.memoizedState,p.refs={},sc(e);var g=n.contextType;typeof g=="object"&&g!==null?p.context=pr(g):(g=zn(n)?Si:yn.current,p.context=us(e,g)),p.state=e.memoizedState,g=n.getDerivedStateFromProps,typeof g=="function"&&(xc(e,n,g,o),p.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(n=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),n!==p.state&&_l.enqueueReplaceState(p,p.state,null),ml(e,o,p,u),p.state=e.memoizedState),typeof p.componentDidMount=="function"&&(e.flags|=4194308)}function ys(e,n){try{var o="",u=n;do o+=Me(u),u=u.return;while(u);var p=o}catch(g){p=`
39
+ Error generating stack: `+g.message+`
40
+ `+g.stack}return{value:e,source:n,stack:p,digest:null}}function bc(e,n,o){return{value:e,source:null,stack:o??null,digest:n??null}}function _c(e,n){try{console.error(n.value)}catch(o){setTimeout(function(){throw o})}}var Lg=typeof WeakMap=="function"?WeakMap:Map;function ep(e,n,o){o=Eo(-1,o),o.tag=3,o.payload={element:null};var u=n.value;return o.callback=function(){Pl||(Pl=!0,Lc=u),_c(e,n)},o}function tp(e,n,o){o=Eo(-1,o),o.tag=3;var u=e.type.getDerivedStateFromError;if(typeof u=="function"){var p=n.value;o.payload=function(){return u(p)},o.callback=function(){_c(e,n)}}var g=e.stateNode;return g!==null&&typeof g.componentDidCatch=="function"&&(o.callback=function(){_c(e,n),typeof u!="function"&&(ri===null?ri=new Set([this]):ri.add(this));var E=n.stack;this.componentDidCatch(n.value,{componentStack:E!==null?E:""})}),o}function np(e,n,o){var u=e.pingCache;if(u===null){u=e.pingCache=new Lg;var p=new Set;u.set(n,p)}else p=u.get(n),p===void 0&&(p=new Set,u.set(n,p));p.has(o)||(p.add(o),e=Gg.bind(null,e,n,o),n.then(e,e))}function rp(e){do{var n;if((n=e.tag===13)&&(n=e.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return e;e=e.return}while(e!==null);return null}function op(e,n,o,u,p){return(e.mode&1)===0?(e===n?e.flags|=65536:(e.flags|=128,o.flags|=131072,o.flags&=-52805,o.tag===1&&(o.alternate===null?o.tag=17:(n=Eo(-1,1),n.tag=2,ti(o,n,1))),o.lanes|=1),e):(e.flags|=65536,e.lanes=p,e)}var Dg=R.ReactCurrentOwner,Fn=!1;function Pn(e,n,o,u){n.child=e===null?kd(n,null,o,u):ps(n,e.child,o,u)}function ip(e,n,o,u,p){o=o.render;var g=n.ref;return ms(n,p),u=pc(e,n,o,u,g,p),o=hc(),e!==null&&!Fn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~p,Co(e,n,p)):(Ot&&o&&Qu(n),n.flags|=1,Pn(e,n,u,p),n.child)}function sp(e,n,o,u,p){if(e===null){var g=o.type;return typeof g=="function"&&!Uc(g)&&g.defaultProps===void 0&&o.compare===null&&o.defaultProps===void 0?(n.tag=15,n.type=g,ap(e,n,g,u,p)):(e=Ol(o.type,null,u,n,n.mode,p),e.ref=n.ref,e.return=n,n.child=e)}if(g=e.child,(e.lanes&p)===0){var E=g.memoizedProps;if(o=o.compare,o=o!==null?o:te,o(E,u)&&e.ref===n.ref)return Co(e,n,p)}return n.flags|=1,e=ai(g,u),e.ref=n.ref,e.return=n,n.child=e}function ap(e,n,o,u,p){if(e!==null){var g=e.memoizedProps;if(te(g,u)&&e.ref===n.ref)if(Fn=!1,n.pendingProps=u=g,(e.lanes&p)!==0)(e.flags&131072)!==0&&(Fn=!0);else return n.lanes=e.lanes,Co(e,n,p)}return Sc(e,n,o,u,p)}function lp(e,n,o){var u=n.pendingProps,p=u.children,g=e!==null?e.memoizedState:null;if(u.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ct(xs,nr),nr|=o;else{if((o&1073741824)===0)return e=g!==null?g.baseLanes|o:o,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,Ct(xs,nr),nr|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},u=g!==null?g.baseLanes:o,Ct(xs,nr),nr|=u}else g!==null?(u=g.baseLanes|o,n.memoizedState=null):u=o,Ct(xs,nr),nr|=u;return Pn(e,n,p,o),n.child}function up(e,n){var o=n.ref;(e===null&&o!==null||e!==null&&e.ref!==o)&&(n.flags|=512,n.flags|=2097152)}function Sc(e,n,o,u,p){var g=zn(o)?Si:yn.current;return g=us(n,g),ms(n,p),o=pc(e,n,o,u,g,p),u=hc(),e!==null&&!Fn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~p,Co(e,n,p)):(Ot&&u&&Qu(n),n.flags|=1,Pn(e,n,o,p),n.child)}function cp(e,n,o,u,p){if(zn(o)){var g=!0;sl(n)}else g=!1;if(ms(n,p),n.stateNode===null)kl(e,n),Jd(n,o,u),wc(n,o,u,p),u=!0;else if(e===null){var E=n.stateNode,D=n.memoizedProps;E.props=D;var X=E.context,ye=o.contextType;typeof ye=="object"&&ye!==null?ye=pr(ye):(ye=zn(o)?Si:yn.current,ye=us(n,ye));var Pe=o.getDerivedStateFromProps,Te=typeof Pe=="function"||typeof E.getSnapshotBeforeUpdate=="function";Te||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(D!==u||X!==ye)&&Zd(n,E,u,ye),ei=!1;var je=n.memoizedState;E.state=je,ml(n,u,E,p),X=n.memoizedState,D!==u||je!==X||Dn.current||ei?(typeof Pe=="function"&&(xc(n,o,Pe,u),X=n.memoizedState),(D=ei||Gd(n,o,D,u,je,X,ye))?(Te||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=ye,u=D):(typeof E.componentDidMount=="function"&&(n.flags|=4194308),u=!1)}else{E=n.stateNode,Ed(e,n),D=n.memoizedProps,ye=n.type===n.elementType?D:$r(n.type,D),E.props=ye,Te=n.pendingProps,je=E.context,X=o.contextType,typeof X=="object"&&X!==null?X=pr(X):(X=zn(o)?Si:yn.current,X=us(n,X));var qe=o.getDerivedStateFromProps;(Pe=typeof qe=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(D!==Te||je!==X)&&Zd(n,E,u,X),ei=!1,je=n.memoizedState,E.state=je,ml(n,u,E,p);var Qe=n.memoizedState;D!==Te||je!==Qe||Dn.current||ei?(typeof qe=="function"&&(xc(n,o,qe,u),Qe=n.memoizedState),(ye=ei||Gd(n,o,ye,u,je,Qe,X)||!1)?(Pe||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(u,Qe,X),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(u,Qe,X)),typeof E.componentDidUpdate=="function"&&(n.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof E.componentDidUpdate!="function"||D===e.memoizedProps&&je===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&je===e.memoizedState||(n.flags|=1024),n.memoizedProps=u,n.memoizedState=Qe),E.props=u,E.state=Qe,E.context=X,u=ye):(typeof E.componentDidUpdate!="function"||D===e.memoizedProps&&je===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&je===e.memoizedState||(n.flags|=1024),u=!1)}return kc(e,n,o,u,g,p)}function kc(e,n,o,u,p,g){up(e,n);var E=(n.flags&128)!==0;if(!u&&!E)return p&&md(n,o,!1),Co(e,n,g);u=n.stateNode,Dg.current=n;var D=E&&typeof o.getDerivedStateFromError!="function"?null:u.render();return n.flags|=1,e!==null&&E?(n.child=ps(n,e.child,null,g),n.child=ps(n,null,D,g)):Pn(e,n,D,g),n.memoizedState=u.state,p&&md(n,o,!0),n.child}function fp(e){var n=e.stateNode;n.pendingContext?pd(e,n.pendingContext,n.pendingContext!==n.context):n.context&&pd(e,n.context,!1),ac(e,n.containerInfo)}function dp(e,n,o,u,p){return ds(),ec(p),n.flags|=256,Pn(e,n,o,u),n.child}var Nc={dehydrated:null,treeContext:null,retryLane:0};function Ec(e){return{baseLanes:e,cachePool:null,transitions:null}}function pp(e,n,o){var u=n.pendingProps,p=zt.current,g=!1,E=(n.flags&128)!==0,D;if((D=E)||(D=e!==null&&e.memoizedState===null?!1:(p&2)!==0),D?(g=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(p|=1),Ct(zt,p&1),e===null)return Zu(n),e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((n.mode&1)===0?n.lanes=1:e.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(E=u.children,e=u.fallback,g?(u=n.mode,g=n.child,E={mode:"hidden",children:E},(u&1)===0&&g!==null?(g.childLanes=0,g.pendingProps=E):g=Rl(E,u,0,null),e=Ii(e,u,o,null),g.return=n,e.return=n,g.sibling=e,n.child=g,n.child.memoizedState=Ec(o),n.memoizedState=Nc,e):Cc(n,E));if(p=e.memoizedState,p!==null&&(D=p.dehydrated,D!==null))return zg(e,n,E,u,D,p,o);if(g){g=u.fallback,E=n.mode,p=e.child,D=p.sibling;var X={mode:"hidden",children:u.children};return(E&1)===0&&n.child!==p?(u=n.child,u.childLanes=0,u.pendingProps=X,n.deletions=null):(u=ai(p,X),u.subtreeFlags=p.subtreeFlags&14680064),D!==null?g=ai(D,g):(g=Ii(g,E,o,null),g.flags|=2),g.return=n,u.return=n,u.sibling=g,n.child=u,u=g,g=n.child,E=e.child.memoizedState,E=E===null?Ec(o):{baseLanes:E.baseLanes|o,cachePool:null,transitions:E.transitions},g.memoizedState=E,g.childLanes=e.childLanes&~o,n.memoizedState=Nc,u}return g=e.child,e=g.sibling,u=ai(g,{mode:"visible",children:u.children}),(n.mode&1)===0&&(u.lanes=o),u.return=n,u.sibling=null,e!==null&&(o=n.deletions,o===null?(n.deletions=[e],n.flags|=16):o.push(e)),n.child=u,n.memoizedState=null,u}function Cc(e,n){return n=Rl({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function Sl(e,n,o,u){return u!==null&&ec(u),ps(n,e.child,null,o),e=Cc(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function zg(e,n,o,u,p,g,E){if(o)return n.flags&256?(n.flags&=-257,u=bc(Error(i(422))),Sl(e,n,E,u)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(g=u.fallback,p=n.mode,u=Rl({mode:"visible",children:u.children},p,0,null),g=Ii(g,p,E,null),g.flags|=2,u.return=n,g.return=n,u.sibling=g,n.child=u,(n.mode&1)!==0&&ps(n,e.child,null,E),n.child.memoizedState=Ec(E),n.memoizedState=Nc,g);if((n.mode&1)===0)return Sl(e,n,E,null);if(p.data==="$!"){if(u=p.nextSibling&&p.nextSibling.dataset,u)var D=u.dgst;return u=D,g=Error(i(419)),u=bc(g,u,void 0),Sl(e,n,E,u)}if(D=(E&e.childLanes)!==0,Fn||D){if(u=rn,u!==null){switch(E&-E){case 4:p=2;break;case 16:p=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:p=32;break;case 536870912:p=268435456;break;default:p=0}p=(p&(u.suspendedLanes|E))!==0?0:p,p!==0&&p!==g.retryLane&&(g.retryLane=p,No(e,p),Ar(u,e,p,-1))}return Vc(),u=bc(Error(i(421))),Sl(e,n,E,u)}return p.data==="$?"?(n.flags|=128,n.child=e.child,n=Jg.bind(null,e),p._reactRetry=n,null):(e=g.treeContext,tr=Qo(p.nextSibling),er=n,Ot=!0,Mr=null,e!==null&&(fr[dr++]=So,fr[dr++]=ko,fr[dr++]=ki,So=e.id,ko=e.overflow,ki=n),n=Cc(n,u.children),n.flags|=4096,n)}function hp(e,n,o){e.lanes|=n;var u=e.alternate;u!==null&&(u.lanes|=n),oc(e.return,n,o)}function jc(e,n,o,u,p){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:p}:(g.isBackwards=n,g.rendering=null,g.renderingStartTime=0,g.last=u,g.tail=o,g.tailMode=p)}function mp(e,n,o){var u=n.pendingProps,p=u.revealOrder,g=u.tail;if(Pn(e,n,u.children,o),u=zt.current,(u&2)!==0)u=u&1|2,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&hp(e,o,n);else if(e.tag===19)hp(e,o,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}u&=1}if(Ct(zt,u),(n.mode&1)===0)n.memoizedState=null;else switch(p){case"forwards":for(o=n.child,p=null;o!==null;)e=o.alternate,e!==null&&gl(e)===null&&(p=o),o=o.sibling;o=p,o===null?(p=n.child,n.child=null):(p=o.sibling,o.sibling=null),jc(n,!1,p,o,g);break;case"backwards":for(o=null,p=n.child,n.child=null;p!==null;){if(e=p.alternate,e!==null&&gl(e)===null){n.child=p;break}e=p.sibling,p.sibling=o,o=p,p=e}jc(n,!0,o,null,g);break;case"together":jc(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function kl(e,n){(n.mode&1)===0&&e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2)}function Co(e,n,o){if(e!==null&&(n.dependencies=e.dependencies),Pi|=n.lanes,(o&n.childLanes)===0)return null;if(e!==null&&n.child!==e.child)throw Error(i(153));if(n.child!==null){for(e=n.child,o=ai(e,e.pendingProps),n.child=o,o.return=n;e.sibling!==null;)e=e.sibling,o=o.sibling=ai(e,e.pendingProps),o.return=n;o.sibling=null}return n.child}function Fg(e,n,o){switch(n.tag){case 3:fp(n),ds();break;case 5:Pd(n);break;case 1:zn(n.type)&&sl(n);break;case 4:ac(n,n.stateNode.containerInfo);break;case 10:var u=n.type._context,p=n.memoizedProps.value;Ct(dl,u._currentValue),u._currentValue=p;break;case 13:if(u=n.memoizedState,u!==null)return u.dehydrated!==null?(Ct(zt,zt.current&1),n.flags|=128,null):(o&n.child.childLanes)!==0?pp(e,n,o):(Ct(zt,zt.current&1),e=Co(e,n,o),e!==null?e.sibling:null);Ct(zt,zt.current&1);break;case 19:if(u=(o&n.childLanes)!==0,(e.flags&128)!==0){if(u)return mp(e,n,o);n.flags|=128}if(p=n.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),Ct(zt,zt.current),u)break;return null;case 22:case 23:return n.lanes=0,lp(e,n,o)}return Co(e,n,o)}var gp,Pc,yp,vp;gp=function(e,n){for(var o=n.child;o!==null;){if(o.tag===5||o.tag===6)e.appendChild(o.stateNode);else if(o.tag!==4&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===n)break;for(;o.sibling===null;){if(o.return===null||o.return===n)return;o=o.return}o.sibling.return=o.return,o=o.sibling}},Pc=function(){},yp=function(e,n,o,u){var p=e.memoizedProps;if(p!==u){e=n.stateNode,Ci(Xr.current);var g=null;switch(o){case"input":p=lt(e,p),u=lt(e,u),g=[];break;case"select":p=F({},p,{value:void 0}),u=F({},u,{value:void 0}),g=[];break;case"textarea":p=Bt(e,p),u=Bt(e,u),g=[];break;default:typeof p.onClick!="function"&&typeof u.onClick=="function"&&(e.onclick=rl)}Ye(o,u);var E;o=null;for(ye in p)if(!u.hasOwnProperty(ye)&&p.hasOwnProperty(ye)&&p[ye]!=null)if(ye==="style"){var D=p[ye];for(E in D)D.hasOwnProperty(E)&&(o||(o={}),o[E]="")}else ye!=="dangerouslySetInnerHTML"&&ye!=="children"&&ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&ye!=="autoFocus"&&(l.hasOwnProperty(ye)?g||(g=[]):(g=g||[]).push(ye,null));for(ye in u){var X=u[ye];if(D=p!=null?p[ye]:void 0,u.hasOwnProperty(ye)&&X!==D&&(X!=null||D!=null))if(ye==="style")if(D){for(E in D)!D.hasOwnProperty(E)||X&&X.hasOwnProperty(E)||(o||(o={}),o[E]="");for(E in X)X.hasOwnProperty(E)&&D[E]!==X[E]&&(o||(o={}),o[E]=X[E])}else o||(g||(g=[]),g.push(ye,o)),o=X;else ye==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,D=D?D.__html:void 0,X!=null&&D!==X&&(g=g||[]).push(ye,X)):ye==="children"?typeof X!="string"&&typeof X!="number"||(g=g||[]).push(ye,""+X):ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&(l.hasOwnProperty(ye)?(X!=null&&ye==="onScroll"&&Mt("scroll",e),g||D===X||(g=[])):(g=g||[]).push(ye,X))}o&&(g=g||[]).push("style",o);var ye=g;(n.updateQueue=ye)&&(n.flags|=4)}},vp=function(e,n,o,u){o!==u&&(n.flags|=4)};function ca(e,n){if(!Ot)switch(e.tailMode){case"hidden":n=e.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?e.tail=null:o.sibling=null;break;case"collapsed":o=e.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:u.sibling=null}}function xn(e){var n=e.alternate!==null&&e.alternate.child===e.child,o=0,u=0;if(n)for(var p=e.child;p!==null;)o|=p.lanes|p.childLanes,u|=p.subtreeFlags&14680064,u|=p.flags&14680064,p.return=e,p=p.sibling;else for(p=e.child;p!==null;)o|=p.lanes|p.childLanes,u|=p.subtreeFlags,u|=p.flags,p.return=e,p=p.sibling;return e.subtreeFlags|=u,e.childLanes=o,n}function Bg(e,n,o){var u=n.pendingProps;switch(Gu(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xn(n),null;case 1:return zn(n.type)&&il(),xn(n),null;case 3:return u=n.stateNode,gs(),$t(Dn),$t(yn),cc(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(e===null||e.child===null)&&(cl(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Mr!==null&&(Fc(Mr),Mr=null))),Pc(e,n),xn(n),null;case 5:lc(n);var p=Ci(ia.current);if(o=n.type,e!==null&&n.stateNode!=null)yp(e,n,o,u,p),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!u){if(n.stateNode===null)throw Error(i(166));return xn(n),null}if(e=Ci(Xr.current),cl(n)){u=n.stateNode,o=n.type;var g=n.memoizedProps;switch(u[Yr]=n,u[ea]=g,e=(n.mode&1)!==0,o){case"dialog":Mt("cancel",u),Mt("close",u);break;case"iframe":case"object":case"embed":Mt("load",u);break;case"video":case"audio":for(p=0;p<wo.length;p++)Mt(wo[p],u);break;case"source":Mt("error",u);break;case"img":case"image":case"link":Mt("error",u),Mt("load",u);break;case"details":Mt("toggle",u);break;case"input":ut(u,g),Mt("invalid",u);break;case"select":u._wrapperState={wasMultiple:!!g.multiple},Mt("invalid",u);break;case"textarea":fn(u,g),Mt("invalid",u)}Ye(o,g),p=null;for(var E in g)if(g.hasOwnProperty(E)){var D=g[E];E==="children"?typeof D=="string"?u.textContent!==D&&(g.suppressHydrationWarning!==!0&&nl(u.textContent,D,e),p=["children",D]):typeof D=="number"&&u.textContent!==""+D&&(g.suppressHydrationWarning!==!0&&nl(u.textContent,D,e),p=["children",""+D]):l.hasOwnProperty(E)&&D!=null&&E==="onScroll"&&Mt("scroll",u)}switch(o){case"input":He(u),Xt(u,g,!0);break;case"textarea":He(u),bn(u);break;case"select":case"option":break;default:typeof g.onClick=="function"&&(u.onclick=rl)}u=p,n.updateQueue=u,u!==null&&(n.flags|=4)}else{E=p.nodeType===9?p:p.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=St(o)),e==="http://www.w3.org/1999/xhtml"?o==="script"?(e=E.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof u.is=="string"?e=E.createElement(o,{is:u.is}):(e=E.createElement(o),o==="select"&&(E=e,u.multiple?E.multiple=!0:u.size&&(E.size=u.size))):e=E.createElementNS(e,o),e[Yr]=n,e[ea]=u,gp(e,n,!1,!1),n.stateNode=e;e:{switch(E=Wn(o,u),o){case"dialog":Mt("cancel",e),Mt("close",e),p=u;break;case"iframe":case"object":case"embed":Mt("load",e),p=u;break;case"video":case"audio":for(p=0;p<wo.length;p++)Mt(wo[p],e);p=u;break;case"source":Mt("error",e),p=u;break;case"img":case"image":case"link":Mt("error",e),Mt("load",e),p=u;break;case"details":Mt("toggle",e),p=u;break;case"input":ut(e,u),p=lt(e,u),Mt("invalid",e);break;case"option":p=u;break;case"select":e._wrapperState={wasMultiple:!!u.multiple},p=F({},u,{value:void 0}),Mt("invalid",e);break;case"textarea":fn(e,u),p=Bt(e,u),Mt("invalid",e);break;default:p=u}Ye(o,p),D=p;for(g in D)if(D.hasOwnProperty(g)){var X=D[g];g==="style"?vr(e,X):g==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,X!=null&&Kn(e,X)):g==="children"?typeof X=="string"?(o!=="textarea"||X!=="")&&Sn(e,X):typeof X=="number"&&Sn(e,""+X):g!=="suppressContentEditableWarning"&&g!=="suppressHydrationWarning"&&g!=="autoFocus"&&(l.hasOwnProperty(g)?X!=null&&g==="onScroll"&&Mt("scroll",e):X!=null&&P(e,g,X,E))}switch(o){case"input":He(e),Xt(e,u,!1);break;case"textarea":He(e),bn(e);break;case"option":u.value!=null&&e.setAttribute("value",""+_e(u.value));break;case"select":e.multiple=!!u.multiple,g=u.value,g!=null?Et(e,!!u.multiple,g,!1):u.defaultValue!=null&&Et(e,!!u.multiple,u.defaultValue,!0);break;default:typeof p.onClick=="function"&&(e.onclick=rl)}switch(o){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}}u&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return xn(n),null;case 6:if(e&&n.stateNode!=null)vp(e,n,e.memoizedProps,u);else{if(typeof u!="string"&&n.stateNode===null)throw Error(i(166));if(o=Ci(ia.current),Ci(Xr.current),cl(n)){if(u=n.stateNode,o=n.memoizedProps,u[Yr]=n,(g=u.nodeValue!==o)&&(e=er,e!==null))switch(e.tag){case 3:nl(u.nodeValue,o,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&nl(u.nodeValue,o,(e.mode&1)!==0)}g&&(n.flags|=4)}else u=(o.nodeType===9?o:o.ownerDocument).createTextNode(u),u[Yr]=n,n.stateNode=u}return xn(n),null;case 13:if($t(zt),u=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ot&&tr!==null&&(n.mode&1)!==0&&(n.flags&128)===0)bd(),ds(),n.flags|=98560,g=!1;else if(g=cl(n),u!==null&&u.dehydrated!==null){if(e===null){if(!g)throw Error(i(318));if(g=n.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(i(317));g[Yr]=n}else ds(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;xn(n),g=!1}else Mr!==null&&(Fc(Mr),Mr=null),g=!0;if(!g)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=o,n):(u=u!==null,u!==(e!==null&&e.memoizedState!==null)&&u&&(n.child.flags|=8192,(n.mode&1)!==0&&(e===null||(zt.current&1)!==0?Jt===0&&(Jt=3):Vc())),n.updateQueue!==null&&(n.flags|=4),xn(n),null);case 4:return gs(),Pc(e,n),e===null&&Js(n.stateNode.containerInfo),xn(n),null;case 10:return rc(n.type._context),xn(n),null;case 17:return zn(n.type)&&il(),xn(n),null;case 19:if($t(zt),g=n.memoizedState,g===null)return xn(n),null;if(u=(n.flags&128)!==0,E=g.rendering,E===null)if(u)ca(g,!1);else{if(Jt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(E=gl(e),E!==null){for(n.flags|=128,ca(g,!1),u=E.updateQueue,u!==null&&(n.updateQueue=u,n.flags|=4),n.subtreeFlags=0,u=o,o=n.child;o!==null;)g=o,e=u,g.flags&=14680066,E=g.alternate,E===null?(g.childLanes=0,g.lanes=e,g.child=null,g.subtreeFlags=0,g.memoizedProps=null,g.memoizedState=null,g.updateQueue=null,g.dependencies=null,g.stateNode=null):(g.childLanes=E.childLanes,g.lanes=E.lanes,g.child=E.child,g.subtreeFlags=0,g.deletions=null,g.memoizedProps=E.memoizedProps,g.memoizedState=E.memoizedState,g.updateQueue=E.updateQueue,g.type=E.type,e=E.dependencies,g.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),o=o.sibling;return Ct(zt,zt.current&1|2),n.child}e=e.sibling}g.tail!==null&&ht()>ws&&(n.flags|=128,u=!0,ca(g,!1),n.lanes=4194304)}else{if(!u)if(e=gl(E),e!==null){if(n.flags|=128,u=!0,o=e.updateQueue,o!==null&&(n.updateQueue=o,n.flags|=4),ca(g,!0),g.tail===null&&g.tailMode==="hidden"&&!E.alternate&&!Ot)return xn(n),null}else 2*ht()-g.renderingStartTime>ws&&o!==1073741824&&(n.flags|=128,u=!0,ca(g,!1),n.lanes=4194304);g.isBackwards?(E.sibling=n.child,n.child=E):(o=g.last,o!==null?o.sibling=E:n.child=E,g.last=E)}return g.tail!==null?(n=g.tail,g.rendering=n,g.tail=n.sibling,g.renderingStartTime=ht(),n.sibling=null,o=zt.current,Ct(zt,u?o&1|2:o&1),n):(xn(n),null);case 22:case 23:return Hc(),u=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==u&&(n.flags|=8192),u&&(n.mode&1)!==0?(nr&1073741824)!==0&&(xn(n),n.subtreeFlags&6&&(n.flags|=8192)):xn(n),null;case 24:return null;case 25:return null}throw Error(i(156,n.tag))}function Hg(e,n){switch(Gu(n),n.tag){case 1:return zn(n.type)&&il(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return gs(),$t(Dn),$t(yn),cc(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return lc(n),null;case 13:if($t(zt),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));ds()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return $t(zt),null;case 4:return gs(),null;case 10:return rc(n.type._context),null;case 22:case 23:return Hc(),null;case 24:return null;default:return null}}var Nl=!1,wn=!1,Vg=typeof WeakSet=="function"?WeakSet:Set,Xe=null;function vs(e,n){var o=e.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(u){Ht(e,n,u)}else o.current=null}function Mc(e,n,o){try{o()}catch(u){Ht(e,n,u)}}var xp=!1;function Ug(e,n){if(Hu=Ki,e=oe(),re(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var u=o.getSelection&&o.getSelection();if(u&&u.rangeCount!==0){o=u.anchorNode;var p=u.anchorOffset,g=u.focusNode;u=u.focusOffset;try{o.nodeType,g.nodeType}catch{o=null;break e}var E=0,D=-1,X=-1,ye=0,Pe=0,Te=e,je=null;t:for(;;){for(var qe;Te!==o||p!==0&&Te.nodeType!==3||(D=E+p),Te!==g||u!==0&&Te.nodeType!==3||(X=E+u),Te.nodeType===3&&(E+=Te.nodeValue.length),(qe=Te.firstChild)!==null;)je=Te,Te=qe;for(;;){if(Te===e)break t;if(je===o&&++ye===p&&(D=E),je===g&&++Pe===u&&(X=E),(qe=Te.nextSibling)!==null)break;Te=je,je=Te.parentNode}Te=qe}o=D===-1||X===-1?null:{start:D,end:X}}else o=null}o=o||{start:0,end:0}}else o=null;for(Vu={focusedElem:e,selectionRange:o},Ki=!1,Xe=n;Xe!==null;)if(n=Xe,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,Xe=e;else for(;Xe!==null;){n=Xe;try{var Qe=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(Qe!==null){var Ge=Qe.memoizedProps,Ut=Qe.memoizedState,he=n.stateNode,ne=he.getSnapshotBeforeUpdate(n.elementType===n.type?Ge:$r(n.type,Ge),Ut);he.__reactInternalSnapshotBeforeUpdate=ne}break;case 3:var me=n.stateNode.containerInfo;me.nodeType===1?me.textContent="":me.nodeType===9&&me.documentElement&&me.removeChild(me.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(Fe){Ht(n,n.return,Fe)}if(e=n.sibling,e!==null){e.return=n.return,Xe=e;break}Xe=n.return}return Qe=xp,xp=!1,Qe}function fa(e,n,o){var u=n.updateQueue;if(u=u!==null?u.lastEffect:null,u!==null){var p=u=u.next;do{if((p.tag&e)===e){var g=p.destroy;p.destroy=void 0,g!==void 0&&Mc(n,o,g)}p=p.next}while(p!==u)}}function El(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var u=o.create;o.destroy=u()}o=o.next}while(o!==n)}}function $c(e){var n=e.ref;if(n!==null){var o=e.stateNode;switch(e.tag){case 5:e=o;break;default:e=o}typeof n=="function"?n(e):n.current=e}}function wp(e){var n=e.alternate;n!==null&&(e.alternate=null,wp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[Yr],delete n[ea],delete n[Wu],delete n[Eg],delete n[Cg])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function bp(e){return e.tag===5||e.tag===3||e.tag===4}function _p(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||bp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Tc(e,n,o){var u=e.tag;if(u===5||u===6)e=e.stateNode,n?o.nodeType===8?o.parentNode.insertBefore(e,n):o.insertBefore(e,n):(o.nodeType===8?(n=o.parentNode,n.insertBefore(e,o)):(n=o,n.appendChild(e)),o=o._reactRootContainer,o!=null||n.onclick!==null||(n.onclick=rl));else if(u!==4&&(e=e.child,e!==null))for(Tc(e,n,o),e=e.sibling;e!==null;)Tc(e,n,o),e=e.sibling}function Ic(e,n,o){var u=e.tag;if(u===5||u===6)e=e.stateNode,n?o.insertBefore(e,n):o.appendChild(e);else if(u!==4&&(e=e.child,e!==null))for(Ic(e,n,o),e=e.sibling;e!==null;)Ic(e,n,o),e=e.sibling}var un=null,Tr=!1;function ni(e,n,o){for(o=o.child;o!==null;)Sp(e,n,o),o=o.sibling}function Sp(e,n,o){if(jn&&typeof jn.onCommitFiberUnmount=="function")try{jn.onCommitFiberUnmount(lr,o)}catch{}switch(o.tag){case 5:wn||vs(o,n);case 6:var u=un,p=Tr;un=null,ni(e,n,o),un=u,Tr=p,un!==null&&(Tr?(e=un,o=o.stateNode,e.nodeType===8?e.parentNode.removeChild(o):e.removeChild(o)):un.removeChild(o.stateNode));break;case 18:un!==null&&(Tr?(e=un,o=o.stateNode,e.nodeType===8?qu(e.parentNode,o):e.nodeType===1&&qu(e,o),co(e)):qu(un,o.stateNode));break;case 4:u=un,p=Tr,un=o.stateNode.containerInfo,Tr=!0,ni(e,n,o),un=u,Tr=p;break;case 0:case 11:case 14:case 15:if(!wn&&(u=o.updateQueue,u!==null&&(u=u.lastEffect,u!==null))){p=u=u.next;do{var g=p,E=g.destroy;g=g.tag,E!==void 0&&((g&2)!==0||(g&4)!==0)&&Mc(o,n,E),p=p.next}while(p!==u)}ni(e,n,o);break;case 1:if(!wn&&(vs(o,n),u=o.stateNode,typeof u.componentWillUnmount=="function"))try{u.props=o.memoizedProps,u.state=o.memoizedState,u.componentWillUnmount()}catch(D){Ht(o,n,D)}ni(e,n,o);break;case 21:ni(e,n,o);break;case 22:o.mode&1?(wn=(u=wn)||o.memoizedState!==null,ni(e,n,o),wn=u):ni(e,n,o);break;default:ni(e,n,o)}}function kp(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var o=e.stateNode;o===null&&(o=e.stateNode=new Vg),n.forEach(function(u){var p=Zg.bind(null,e,u);o.has(u)||(o.add(u),u.then(p,p))})}}function Ir(e,n){var o=n.deletions;if(o!==null)for(var u=0;u<o.length;u++){var p=o[u];try{var g=e,E=n,D=E;e:for(;D!==null;){switch(D.tag){case 5:un=D.stateNode,Tr=!1;break e;case 3:un=D.stateNode.containerInfo,Tr=!0;break e;case 4:un=D.stateNode.containerInfo,Tr=!0;break e}D=D.return}if(un===null)throw Error(i(160));Sp(g,E,p),un=null,Tr=!1;var X=p.alternate;X!==null&&(X.return=null),p.return=null}catch(ye){Ht(p,n,ye)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)Np(n,e),n=n.sibling}function Np(e,n){var o=e.alternate,u=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ir(n,e),Gr(e),u&4){try{fa(3,e,e.return),El(3,e)}catch(Ge){Ht(e,e.return,Ge)}try{fa(5,e,e.return)}catch(Ge){Ht(e,e.return,Ge)}}break;case 1:Ir(n,e),Gr(e),u&512&&o!==null&&vs(o,o.return);break;case 5:if(Ir(n,e),Gr(e),u&512&&o!==null&&vs(o,o.return),e.flags&32){var p=e.stateNode;try{Sn(p,"")}catch(Ge){Ht(e,e.return,Ge)}}if(u&4&&(p=e.stateNode,p!=null)){var g=e.memoizedProps,E=o!==null?o.memoizedProps:g,D=e.type,X=e.updateQueue;if(e.updateQueue=null,X!==null)try{D==="input"&&g.type==="radio"&&g.name!=null&&at(p,g),Wn(D,E);var ye=Wn(D,g);for(E=0;E<X.length;E+=2){var Pe=X[E],Te=X[E+1];Pe==="style"?vr(p,Te):Pe==="dangerouslySetInnerHTML"?Kn(p,Te):Pe==="children"?Sn(p,Te):P(p,Pe,Te,ye)}switch(D){case"input":Nt(p,g);break;case"textarea":It(p,g);break;case"select":var je=p._wrapperState.wasMultiple;p._wrapperState.wasMultiple=!!g.multiple;var qe=g.value;qe!=null?Et(p,!!g.multiple,qe,!1):je!==!!g.multiple&&(g.defaultValue!=null?Et(p,!!g.multiple,g.defaultValue,!0):Et(p,!!g.multiple,g.multiple?[]:"",!1))}p[ea]=g}catch(Ge){Ht(e,e.return,Ge)}}break;case 6:if(Ir(n,e),Gr(e),u&4){if(e.stateNode===null)throw Error(i(162));p=e.stateNode,g=e.memoizedProps;try{p.nodeValue=g}catch(Ge){Ht(e,e.return,Ge)}}break;case 3:if(Ir(n,e),Gr(e),u&4&&o!==null&&o.memoizedState.isDehydrated)try{co(n.containerInfo)}catch(Ge){Ht(e,e.return,Ge)}break;case 4:Ir(n,e),Gr(e);break;case 13:Ir(n,e),Gr(e),p=e.child,p.flags&8192&&(g=p.memoizedState!==null,p.stateNode.isHidden=g,!g||p.alternate!==null&&p.alternate.memoizedState!==null||(Rc=ht())),u&4&&kp(e);break;case 22:if(Pe=o!==null&&o.memoizedState!==null,e.mode&1?(wn=(ye=wn)||Pe,Ir(n,e),wn=ye):Ir(n,e),Gr(e),u&8192){if(ye=e.memoizedState!==null,(e.stateNode.isHidden=ye)&&!Pe&&(e.mode&1)!==0)for(Xe=e,Pe=e.child;Pe!==null;){for(Te=Xe=Pe;Xe!==null;){switch(je=Xe,qe=je.child,je.tag){case 0:case 11:case 14:case 15:fa(4,je,je.return);break;case 1:vs(je,je.return);var Qe=je.stateNode;if(typeof Qe.componentWillUnmount=="function"){u=je,o=je.return;try{n=u,Qe.props=n.memoizedProps,Qe.state=n.memoizedState,Qe.componentWillUnmount()}catch(Ge){Ht(u,o,Ge)}}break;case 5:vs(je,je.return);break;case 22:if(je.memoizedState!==null){jp(Te);continue}}qe!==null?(qe.return=je,Xe=qe):jp(Te)}Pe=Pe.sibling}e:for(Pe=null,Te=e;;){if(Te.tag===5){if(Pe===null){Pe=Te;try{p=Te.stateNode,ye?(g=p.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none"):(D=Te.stateNode,X=Te.memoizedProps.style,E=X!=null&&X.hasOwnProperty("display")?X.display:null,D.style.display=yr("display",E))}catch(Ge){Ht(e,e.return,Ge)}}}else if(Te.tag===6){if(Pe===null)try{Te.stateNode.nodeValue=ye?"":Te.memoizedProps}catch(Ge){Ht(e,e.return,Ge)}}else if((Te.tag!==22&&Te.tag!==23||Te.memoizedState===null||Te===e)&&Te.child!==null){Te.child.return=Te,Te=Te.child;continue}if(Te===e)break e;for(;Te.sibling===null;){if(Te.return===null||Te.return===e)break e;Pe===Te&&(Pe=null),Te=Te.return}Pe===Te&&(Pe=null),Te.sibling.return=Te.return,Te=Te.sibling}}break;case 19:Ir(n,e),Gr(e),u&4&&kp(e);break;case 21:break;default:Ir(n,e),Gr(e)}}function Gr(e){var n=e.flags;if(n&2){try{e:{for(var o=e.return;o!==null;){if(bp(o)){var u=o;break e}o=o.return}throw Error(i(160))}switch(u.tag){case 5:var p=u.stateNode;u.flags&32&&(Sn(p,""),u.flags&=-33);var g=_p(e);Ic(e,g,p);break;case 3:case 4:var E=u.stateNode.containerInfo,D=_p(e);Tc(e,D,E);break;default:throw Error(i(161))}}catch(X){Ht(e,e.return,X)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Kg(e,n,o){Xe=e,Ep(e)}function Ep(e,n,o){for(var u=(e.mode&1)!==0;Xe!==null;){var p=Xe,g=p.child;if(p.tag===22&&u){var E=p.memoizedState!==null||Nl;if(!E){var D=p.alternate,X=D!==null&&D.memoizedState!==null||wn;D=Nl;var ye=wn;if(Nl=E,(wn=X)&&!ye)for(Xe=p;Xe!==null;)E=Xe,X=E.child,E.tag===22&&E.memoizedState!==null?Pp(p):X!==null?(X.return=E,Xe=X):Pp(p);for(;g!==null;)Xe=g,Ep(g),g=g.sibling;Xe=p,Nl=D,wn=ye}Cp(e)}else(p.subtreeFlags&8772)!==0&&g!==null?(g.return=p,Xe=g):Cp(e)}}function Cp(e){for(;Xe!==null;){var n=Xe;if((n.flags&8772)!==0){var o=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:wn||El(5,n);break;case 1:var u=n.stateNode;if(n.flags&4&&!wn)if(o===null)u.componentDidMount();else{var p=n.elementType===n.type?o.memoizedProps:$r(n.type,o.memoizedProps);u.componentDidUpdate(p,o.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}var g=n.updateQueue;g!==null&&jd(n,g,u);break;case 3:var E=n.updateQueue;if(E!==null){if(o=null,n.child!==null)switch(n.child.tag){case 5:o=n.child.stateNode;break;case 1:o=n.child.stateNode}jd(n,E,o)}break;case 5:var D=n.stateNode;if(o===null&&n.flags&4){o=D;var X=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":X.autoFocus&&o.focus();break;case"img":X.src&&(o.src=X.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var ye=n.alternate;if(ye!==null){var Pe=ye.memoizedState;if(Pe!==null){var Te=Pe.dehydrated;Te!==null&&co(Te)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}wn||n.flags&512&&$c(n)}catch(je){Ht(n,n.return,je)}}if(n===e){Xe=null;break}if(o=n.sibling,o!==null){o.return=n.return,Xe=o;break}Xe=n.return}}function jp(e){for(;Xe!==null;){var n=Xe;if(n===e){Xe=null;break}var o=n.sibling;if(o!==null){o.return=n.return,Xe=o;break}Xe=n.return}}function Pp(e){for(;Xe!==null;){var n=Xe;try{switch(n.tag){case 0:case 11:case 15:var o=n.return;try{El(4,n)}catch(X){Ht(n,o,X)}break;case 1:var u=n.stateNode;if(typeof u.componentDidMount=="function"){var p=n.return;try{u.componentDidMount()}catch(X){Ht(n,p,X)}}var g=n.return;try{$c(n)}catch(X){Ht(n,g,X)}break;case 5:var E=n.return;try{$c(n)}catch(X){Ht(n,E,X)}}}catch(X){Ht(n,n.return,X)}if(n===e){Xe=null;break}var D=n.sibling;if(D!==null){D.return=n.return,Xe=D;break}Xe=n.return}}var qg=Math.ceil,Cl=R.ReactCurrentDispatcher,Ac=R.ReactCurrentOwner,mr=R.ReactCurrentBatchConfig,xt=0,rn=null,Wt=null,cn=0,nr=0,xs=Go(0),Jt=0,da=null,Pi=0,jl=0,Oc=0,pa=null,Bn=null,Rc=0,ws=1/0,jo=null,Pl=!1,Lc=null,ri=null,Ml=!1,oi=null,$l=0,ha=0,Dc=null,Tl=-1,Il=0;function Mn(){return(xt&6)!==0?ht():Tl!==-1?Tl:Tl=ht()}function ii(e){return(e.mode&1)===0?1:(xt&2)!==0&&cn!==0?cn&-cn:Pg.transition!==null?(Il===0&&(Il=Ur()),Il):(e=wt,e!==0||(e=window.event,e=e===void 0?16:qi(e.type)),e)}function Ar(e,n,o,u){if(50<ha)throw ha=0,Dc=null,Error(i(185));cr(e,o,u),((xt&2)===0||e!==rn)&&(e===rn&&((xt&2)===0&&(jl|=o),Jt===4&&si(e,cn)),Hn(e,u),o===1&&xt===0&&(n.mode&1)===0&&(ws=ht()+500,al&&Zo()))}function Hn(e,n){var o=e.callbackNode;ao(e,n);var u=vt(e,e===rn?cn:0);if(u===0)o!==null&&Gn(o),e.callbackNode=null,e.callbackPriority=0;else if(n=u&-u,e.callbackPriority!==n){if(o!=null&&Gn(o),n===1)e.tag===0?jg($p.bind(null,e)):gd($p.bind(null,e)),kg(function(){(xt&6)===0&&Zo()}),o=null;else{switch(Ba(u)){case 1:o=ar;break;case 4:o=Lo;break;case 16:o=Hr;break;case 536870912:o=di;break;default:o=Hr}o=zp(o,Mp.bind(null,e))}e.callbackPriority=n,e.callbackNode=o}}function Mp(e,n){if(Tl=-1,Il=0,(xt&6)!==0)throw Error(i(327));var o=e.callbackNode;if(bs()&&e.callbackNode!==o)return null;var u=vt(e,e===rn?cn:0);if(u===0)return null;if((u&30)!==0||(u&e.expiredLanes)!==0||n)n=Al(e,u);else{n=u;var p=xt;xt|=2;var g=Ip();(rn!==e||cn!==n)&&(jo=null,ws=ht()+500,$i(e,n));do try{Xg();break}catch(D){Tp(e,D)}while(!0);nc(),Cl.current=g,xt=p,Wt!==null?n=0:(rn=null,cn=0,n=Jt)}if(n!==0){if(n===2&&(p=ur(e),p!==0&&(u=p,n=zc(e,p))),n===1)throw o=da,$i(e,0),si(e,u),Hn(e,ht()),o;if(n===6)si(e,u);else{if(p=e.current.alternate,(u&30)===0&&!Wg(p)&&(n=Al(e,u),n===2&&(g=ur(e),g!==0&&(u=g,n=zc(e,g))),n===1))throw o=da,$i(e,0),si(e,u),Hn(e,ht()),o;switch(e.finishedWork=p,e.finishedLanes=u,n){case 0:case 1:throw Error(i(345));case 2:Ti(e,Bn,jo);break;case 3:if(si(e,u),(u&130023424)===u&&(n=Rc+500-ht(),10<n)){if(vt(e,0)!==0)break;if(p=e.suspendedLanes,(p&u)!==u){Mn(),e.pingedLanes|=e.suspendedLanes&p;break}e.timeoutHandle=Ku(Ti.bind(null,e,Bn,jo),n);break}Ti(e,Bn,jo);break;case 4:if(si(e,u),(u&4194240)===u)break;for(n=e.eventTimes,p=-1;0<u;){var E=31-hn(u);g=1<<E,E=n[E],E>p&&(p=E),u&=~g}if(u=p,u=ht()-u,u=(120>u?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*qg(u/1960))-u,10<u){e.timeoutHandle=Ku(Ti.bind(null,e,Bn,jo),u);break}Ti(e,Bn,jo);break;case 5:Ti(e,Bn,jo);break;default:throw Error(i(329))}}}return Hn(e,ht()),e.callbackNode===o?Mp.bind(null,e):null}function zc(e,n){var o=pa;return e.current.memoizedState.isDehydrated&&($i(e,n).flags|=256),e=Al(e,n),e!==2&&(n=Bn,Bn=o,n!==null&&Fc(n)),e}function Fc(e){Bn===null?Bn=e:Bn.push.apply(Bn,e)}function Wg(e){for(var n=e;;){if(n.flags&16384){var o=n.updateQueue;if(o!==null&&(o=o.stores,o!==null))for(var u=0;u<o.length;u++){var p=o[u],g=p.getSnapshot;p=p.value;try{if(!ue(g(),p))return!1}catch{return!1}}}if(o=n.child,n.subtreeFlags&16384&&o!==null)o.return=n,n=o;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function si(e,n){for(n&=~Oc,n&=~jl,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var o=31-hn(n),u=1<<o;e[o]=-1,n&=~u}}function $p(e){if((xt&6)!==0)throw Error(i(327));bs();var n=vt(e,0);if((n&1)===0)return Hn(e,ht()),null;var o=Al(e,n);if(e.tag!==0&&o===2){var u=ur(e);u!==0&&(n=u,o=zc(e,u))}if(o===1)throw o=da,$i(e,0),si(e,n),Hn(e,ht()),o;if(o===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,Ti(e,Bn,jo),Hn(e,ht()),null}function Bc(e,n){var o=xt;xt|=1;try{return e(n)}finally{xt=o,xt===0&&(ws=ht()+500,al&&Zo())}}function Mi(e){oi!==null&&oi.tag===0&&(xt&6)===0&&bs();var n=xt;xt|=1;var o=mr.transition,u=wt;try{if(mr.transition=null,wt=1,e)return e()}finally{wt=u,mr.transition=o,xt=n,(xt&6)===0&&Zo()}}function Hc(){nr=xs.current,$t(xs)}function $i(e,n){e.finishedWork=null,e.finishedLanes=0;var o=e.timeoutHandle;if(o!==-1&&(e.timeoutHandle=-1,Sg(o)),Wt!==null)for(o=Wt.return;o!==null;){var u=o;switch(Gu(u),u.tag){case 1:u=u.type.childContextTypes,u!=null&&il();break;case 3:gs(),$t(Dn),$t(yn),cc();break;case 5:lc(u);break;case 4:gs();break;case 13:$t(zt);break;case 19:$t(zt);break;case 10:rc(u.type._context);break;case 22:case 23:Hc()}o=o.return}if(rn=e,Wt=e=ai(e.current,null),cn=nr=n,Jt=0,da=null,Oc=jl=Pi=0,Bn=pa=null,Ei!==null){for(n=0;n<Ei.length;n++)if(o=Ei[n],u=o.interleaved,u!==null){o.interleaved=null;var p=u.next,g=o.pending;if(g!==null){var E=g.next;g.next=p,u.next=E}o.pending=u}Ei=null}return e}function Tp(e,n){do{var o=Wt;try{if(nc(),yl.current=bl,vl){for(var u=Ft.memoizedState;u!==null;){var p=u.queue;p!==null&&(p.pending=null),u=u.next}vl=!1}if(ji=0,nn=Gt=Ft=null,sa=!1,aa=0,Ac.current=null,o===null||o.return===null){Jt=1,da=n,Wt=null;break}e:{var g=e,E=o.return,D=o,X=n;if(n=cn,D.flags|=32768,X!==null&&typeof X=="object"&&typeof X.then=="function"){var ye=X,Pe=D,Te=Pe.tag;if((Pe.mode&1)===0&&(Te===0||Te===11||Te===15)){var je=Pe.alternate;je?(Pe.updateQueue=je.updateQueue,Pe.memoizedState=je.memoizedState,Pe.lanes=je.lanes):(Pe.updateQueue=null,Pe.memoizedState=null)}var qe=rp(E);if(qe!==null){qe.flags&=-257,op(qe,E,D,g,n),qe.mode&1&&np(g,ye,n),n=qe,X=ye;var Qe=n.updateQueue;if(Qe===null){var Ge=new Set;Ge.add(X),n.updateQueue=Ge}else Qe.add(X);break e}else{if((n&1)===0){np(g,ye,n),Vc();break e}X=Error(i(426))}}else if(Ot&&D.mode&1){var Ut=rp(E);if(Ut!==null){(Ut.flags&65536)===0&&(Ut.flags|=256),op(Ut,E,D,g,n),ec(ys(X,D));break e}}g=X=ys(X,D),Jt!==4&&(Jt=2),pa===null?pa=[g]:pa.push(g),g=E;do{switch(g.tag){case 3:g.flags|=65536,n&=-n,g.lanes|=n;var he=ep(g,X,n);Cd(g,he);break e;case 1:D=X;var ne=g.type,me=g.stateNode;if((g.flags&128)===0&&(typeof ne.getDerivedStateFromError=="function"||me!==null&&typeof me.componentDidCatch=="function"&&(ri===null||!ri.has(me)))){g.flags|=65536,n&=-n,g.lanes|=n;var Fe=tp(g,D,n);Cd(g,Fe);break e}}g=g.return}while(g!==null)}Op(o)}catch(Je){n=Je,Wt===o&&o!==null&&(Wt=o=o.return);continue}break}while(!0)}function Ip(){var e=Cl.current;return Cl.current=bl,e===null?bl:e}function Vc(){(Jt===0||Jt===3||Jt===2)&&(Jt=4),rn===null||(Pi&268435455)===0&&(jl&268435455)===0||si(rn,cn)}function Al(e,n){var o=xt;xt|=2;var u=Ip();(rn!==e||cn!==n)&&(jo=null,$i(e,n));do try{Yg();break}catch(p){Tp(e,p)}while(!0);if(nc(),xt=o,Cl.current=u,Wt!==null)throw Error(i(261));return rn=null,cn=0,Jt}function Yg(){for(;Wt!==null;)Ap(Wt)}function Xg(){for(;Wt!==null&&!kt();)Ap(Wt)}function Ap(e){var n=Dp(e.alternate,e,nr);e.memoizedProps=e.pendingProps,n===null?Op(e):Wt=n,Ac.current=null}function Op(e){var n=e;do{var o=n.alternate;if(e=n.return,(n.flags&32768)===0){if(o=Bg(o,n,nr),o!==null){Wt=o;return}}else{if(o=Hg(o,n),o!==null){o.flags&=32767,Wt=o;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Jt=6,Wt=null;return}}if(n=n.sibling,n!==null){Wt=n;return}Wt=n=e}while(n!==null);Jt===0&&(Jt=5)}function Ti(e,n,o){var u=wt,p=mr.transition;try{mr.transition=null,wt=1,Qg(e,n,o,u)}finally{mr.transition=p,wt=u}return null}function Qg(e,n,o,u){do bs();while(oi!==null);if((xt&6)!==0)throw Error(i(327));o=e.finishedWork;var p=e.finishedLanes;if(o===null)return null;if(e.finishedWork=null,e.finishedLanes=0,o===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0;var g=o.lanes|o.childLanes;if(pi(e,g),e===rn&&(Wt=rn=null,cn=0),(o.subtreeFlags&2064)===0&&(o.flags&2064)===0||Ml||(Ml=!0,zp(Hr,function(){return bs(),null})),g=(o.flags&15990)!==0,(o.subtreeFlags&15990)!==0||g){g=mr.transition,mr.transition=null;var E=wt;wt=1;var D=xt;xt|=4,Ac.current=null,Ug(e,o),Np(o,e),se(Vu),Ki=!!Hu,Vu=Hu=null,e.current=o,Kg(o),Cn(),xt=D,wt=E,mr.transition=g}else e.current=o;if(Ml&&(Ml=!1,oi=e,$l=p),g=e.pendingLanes,g===0&&(ri=null),ct(o.stateNode),Hn(e,ht()),n!==null)for(u=e.onRecoverableError,o=0;o<n.length;o++)p=n[o],u(p.value,{componentStack:p.stack,digest:p.digest});if(Pl)throw Pl=!1,e=Lc,Lc=null,e;return($l&1)!==0&&e.tag!==0&&bs(),g=e.pendingLanes,(g&1)!==0?e===Dc?ha++:(ha=0,Dc=e):ha=0,Zo(),null}function bs(){if(oi!==null){var e=Ba($l),n=mr.transition,o=wt;try{if(mr.transition=null,wt=16>e?16:e,oi===null)var u=!1;else{if(e=oi,oi=null,$l=0,(xt&6)!==0)throw Error(i(331));var p=xt;for(xt|=4,Xe=e.current;Xe!==null;){var g=Xe,E=g.child;if((Xe.flags&16)!==0){var D=g.deletions;if(D!==null){for(var X=0;X<D.length;X++){var ye=D[X];for(Xe=ye;Xe!==null;){var Pe=Xe;switch(Pe.tag){case 0:case 11:case 15:fa(8,Pe,g)}var Te=Pe.child;if(Te!==null)Te.return=Pe,Xe=Te;else for(;Xe!==null;){Pe=Xe;var je=Pe.sibling,qe=Pe.return;if(wp(Pe),Pe===ye){Xe=null;break}if(je!==null){je.return=qe,Xe=je;break}Xe=qe}}}var Qe=g.alternate;if(Qe!==null){var Ge=Qe.child;if(Ge!==null){Qe.child=null;do{var Ut=Ge.sibling;Ge.sibling=null,Ge=Ut}while(Ge!==null)}}Xe=g}}if((g.subtreeFlags&2064)!==0&&E!==null)E.return=g,Xe=E;else e:for(;Xe!==null;){if(g=Xe,(g.flags&2048)!==0)switch(g.tag){case 0:case 11:case 15:fa(9,g,g.return)}var he=g.sibling;if(he!==null){he.return=g.return,Xe=he;break e}Xe=g.return}}var ne=e.current;for(Xe=ne;Xe!==null;){E=Xe;var me=E.child;if((E.subtreeFlags&2064)!==0&&me!==null)me.return=E,Xe=me;else e:for(E=ne;Xe!==null;){if(D=Xe,(D.flags&2048)!==0)try{switch(D.tag){case 0:case 11:case 15:El(9,D)}}catch(Je){Ht(D,D.return,Je)}if(D===E){Xe=null;break e}var Fe=D.sibling;if(Fe!==null){Fe.return=D.return,Xe=Fe;break e}Xe=D.return}}if(xt=p,Zo(),jn&&typeof jn.onPostCommitFiberRoot=="function")try{jn.onPostCommitFiberRoot(lr,e)}catch{}u=!0}return u}finally{wt=o,mr.transition=n}}return!1}function Rp(e,n,o){n=ys(o,n),n=ep(e,n,1),e=ti(e,n,1),n=Mn(),e!==null&&(cr(e,1,n),Hn(e,n))}function Ht(e,n,o){if(e.tag===3)Rp(e,e,o);else for(;n!==null;){if(n.tag===3){Rp(n,e,o);break}else if(n.tag===1){var u=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(ri===null||!ri.has(u))){e=ys(o,e),e=tp(n,e,1),n=ti(n,e,1),e=Mn(),n!==null&&(cr(n,1,e),Hn(n,e));break}}n=n.return}}function Gg(e,n,o){var u=e.pingCache;u!==null&&u.delete(n),n=Mn(),e.pingedLanes|=e.suspendedLanes&o,rn===e&&(cn&o)===o&&(Jt===4||Jt===3&&(cn&130023424)===cn&&500>ht()-Rc?$i(e,0):Oc|=o),Hn(e,n)}function Lp(e,n){n===0&&((e.mode&1)===0?n=1:(n=so,so<<=1,(so&130023424)===0&&(so=4194304)));var o=Mn();e=No(e,n),e!==null&&(cr(e,n,o),Hn(e,o))}function Jg(e){var n=e.memoizedState,o=0;n!==null&&(o=n.retryLane),Lp(e,o)}function Zg(e,n){var o=0;switch(e.tag){case 13:var u=e.stateNode,p=e.memoizedState;p!==null&&(o=p.retryLane);break;case 19:u=e.stateNode;break;default:throw Error(i(314))}u!==null&&u.delete(n),Lp(e,o)}var Dp;Dp=function(e,n,o){if(e!==null)if(e.memoizedProps!==n.pendingProps||Dn.current)Fn=!0;else{if((e.lanes&o)===0&&(n.flags&128)===0)return Fn=!1,Fg(e,n,o);Fn=(e.flags&131072)!==0}else Fn=!1,Ot&&(n.flags&1048576)!==0&&yd(n,ul,n.index);switch(n.lanes=0,n.tag){case 2:var u=n.type;kl(e,n),e=n.pendingProps;var p=us(n,yn.current);ms(n,o),p=pc(null,n,u,e,p,o);var g=hc();return n.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,zn(u)?(g=!0,sl(n)):g=!1,n.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,sc(n),p.updater=_l,n.stateNode=p,p._reactInternals=n,wc(n,u,e,o),n=kc(null,n,u,!0,g,o)):(n.tag=0,Ot&&g&&Qu(n),Pn(null,n,p,o),n=n.child),n;case 16:u=n.elementType;e:{switch(kl(e,n),e=n.pendingProps,p=u._init,u=p(u._payload),n.type=u,p=n.tag=ty(u),e=$r(u,e),p){case 0:n=Sc(null,n,u,e,o);break e;case 1:n=cp(null,n,u,e,o);break e;case 11:n=ip(null,n,u,e,o);break e;case 14:n=sp(null,n,u,$r(u.type,e),o);break e}throw Error(i(306,u,""))}return n;case 0:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:$r(u,p),Sc(e,n,u,p,o);case 1:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:$r(u,p),cp(e,n,u,p,o);case 3:e:{if(fp(n),e===null)throw Error(i(387));u=n.pendingProps,g=n.memoizedState,p=g.element,Ed(e,n),ml(n,u,null,o);var E=n.memoizedState;if(u=E.element,g.isDehydrated)if(g={element:u,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},n.updateQueue.baseState=g,n.memoizedState=g,n.flags&256){p=ys(Error(i(423)),n),n=dp(e,n,u,o,p);break e}else if(u!==p){p=ys(Error(i(424)),n),n=dp(e,n,u,o,p);break e}else for(tr=Qo(n.stateNode.containerInfo.firstChild),er=n,Ot=!0,Mr=null,o=kd(n,null,u,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(ds(),u===p){n=Co(e,n,o);break e}Pn(e,n,u,o)}n=n.child}return n;case 5:return Pd(n),e===null&&Zu(n),u=n.type,p=n.pendingProps,g=e!==null?e.memoizedProps:null,E=p.children,Uu(u,p)?E=null:g!==null&&Uu(u,g)&&(n.flags|=32),up(e,n),Pn(e,n,E,o),n.child;case 6:return e===null&&Zu(n),null;case 13:return pp(e,n,o);case 4:return ac(n,n.stateNode.containerInfo),u=n.pendingProps,e===null?n.child=ps(n,null,u,o):Pn(e,n,u,o),n.child;case 11:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:$r(u,p),ip(e,n,u,p,o);case 7:return Pn(e,n,n.pendingProps,o),n.child;case 8:return Pn(e,n,n.pendingProps.children,o),n.child;case 12:return Pn(e,n,n.pendingProps.children,o),n.child;case 10:e:{if(u=n.type._context,p=n.pendingProps,g=n.memoizedProps,E=p.value,Ct(dl,u._currentValue),u._currentValue=E,g!==null)if(ue(g.value,E)){if(g.children===p.children&&!Dn.current){n=Co(e,n,o);break e}}else for(g=n.child,g!==null&&(g.return=n);g!==null;){var D=g.dependencies;if(D!==null){E=g.child;for(var X=D.firstContext;X!==null;){if(X.context===u){if(g.tag===1){X=Eo(-1,o&-o),X.tag=2;var ye=g.updateQueue;if(ye!==null){ye=ye.shared;var Pe=ye.pending;Pe===null?X.next=X:(X.next=Pe.next,Pe.next=X),ye.pending=X}}g.lanes|=o,X=g.alternate,X!==null&&(X.lanes|=o),oc(g.return,o,n),D.lanes|=o;break}X=X.next}}else if(g.tag===10)E=g.type===n.type?null:g.child;else if(g.tag===18){if(E=g.return,E===null)throw Error(i(341));E.lanes|=o,D=E.alternate,D!==null&&(D.lanes|=o),oc(E,o,n),E=g.sibling}else E=g.child;if(E!==null)E.return=g;else for(E=g;E!==null;){if(E===n){E=null;break}if(g=E.sibling,g!==null){g.return=E.return,E=g;break}E=E.return}g=E}Pn(e,n,p.children,o),n=n.child}return n;case 9:return p=n.type,u=n.pendingProps.children,ms(n,o),p=pr(p),u=u(p),n.flags|=1,Pn(e,n,u,o),n.child;case 14:return u=n.type,p=$r(u,n.pendingProps),p=$r(u.type,p),sp(e,n,u,p,o);case 15:return ap(e,n,n.type,n.pendingProps,o);case 17:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:$r(u,p),kl(e,n),n.tag=1,zn(u)?(e=!0,sl(n)):e=!1,ms(n,o),Jd(n,u,p),wc(n,u,p,o),kc(null,n,u,!0,e,o);case 19:return mp(e,n,o);case 22:return lp(e,n,o)}throw Error(i(156,n.tag))};function zp(e,n){return wr(e,n)}function ey(e,n,o,u){this.tag=e,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gr(e,n,o,u){return new ey(e,n,o,u)}function Uc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ty(e){if(typeof e=="function")return Uc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===fe)return 11;if(e===le)return 14}return 2}function ai(e,n){var o=e.alternate;return o===null?(o=gr(e.tag,n,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=n,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&14680064,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,n=e.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o}function Ol(e,n,o,u,p,g){var E=2;if(u=e,typeof e=="function")Uc(e)&&(E=1);else if(typeof e=="string")E=5;else e:switch(e){case Q:return Ii(o.children,p,g,n);case ce:E=8,p|=8;break;case de:return e=gr(12,o,n,p|2),e.elementType=de,e.lanes=g,e;case xe:return e=gr(13,o,n,p),e.elementType=xe,e.lanes=g,e;case L:return e=gr(19,o,n,p),e.elementType=L,e.lanes=g,e;case ie:return Rl(o,p,g,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case we:E=10;break e;case q:E=9;break e;case fe:E=11;break e;case le:E=14;break e;case G:E=16,u=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return n=gr(E,o,n,p),n.elementType=e,n.type=u,n.lanes=g,n}function Ii(e,n,o,u){return e=gr(7,e,u,n),e.lanes=o,e}function Rl(e,n,o,u){return e=gr(22,e,u,n),e.elementType=ie,e.lanes=o,e.stateNode={isHidden:!1},e}function Kc(e,n,o){return e=gr(6,e,null,n),e.lanes=o,e}function qc(e,n,o){return n=gr(4,e.children!==null?e.children:[],e.key,n),n.lanes=o,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function ny(e,n,o,u,p){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=lo(0),this.expirationTimes=lo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lo(0),this.identifierPrefix=u,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function Wc(e,n,o,u,p,g,E,D,X){return e=new ny(e,n,o,D,X),n===1?(n=1,g===!0&&(n|=8)):n=0,g=gr(3,null,null,n),e.current=g,g.stateNode=e,g.memoizedState={element:u,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},sc(g),e}function ry(e,n,o){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:H,key:u==null?null:""+u,children:e,containerInfo:n,implementation:o}}function Fp(e){if(!e)return Jo;e=e._reactInternals;e:{if(Ve(e)!==e||e.tag!==1)throw Error(i(170));var n=e;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(zn(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(i(171))}if(e.tag===1){var o=e.type;if(zn(o))return hd(e,o,n)}return n}function Bp(e,n,o,u,p,g,E,D,X){return e=Wc(o,u,!0,e,p,g,E,D,X),e.context=Fp(null),o=e.current,u=Mn(),p=ii(o),g=Eo(u,p),g.callback=n??null,ti(o,g,p),e.current.lanes=p,cr(e,p,u),Hn(e,u),e}function Ll(e,n,o,u){var p=n.current,g=Mn(),E=ii(p);return o=Fp(o),n.context===null?n.context=o:n.pendingContext=o,n=Eo(g,E),n.payload={element:e},u=u===void 0?null:u,u!==null&&(n.callback=u),e=ti(p,n,E),e!==null&&(Ar(e,p,E,g),hl(e,p,E)),E}function Dl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Hp(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o<n?o:n}}function Yc(e,n){Hp(e,n),(e=e.alternate)&&Hp(e,n)}function oy(){return null}var Vp=typeof reportError=="function"?reportError:function(e){console.error(e)};function Xc(e){this._internalRoot=e}zl.prototype.render=Xc.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));Ll(e,n,null,null)},zl.prototype.unmount=Xc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Mi(function(){Ll(null,e,null,null)}),n[bo]=null}};function zl(e){this._internalRoot=e}zl.prototype.unstable_scheduleHydration=function(e){if(e){var n=Va();e={blockedOn:null,target:e,priority:n};for(var o=0;o<Rn.length&&n!==0&&n<Rn[o].priority;o++);Rn.splice(o,0,e),o===0&&Zn(e)}};function Qc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Fl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Up(){}function iy(e,n,o,u,p){if(p){if(typeof u=="function"){var g=u;u=function(){var ye=Dl(E);g.call(ye)}}var E=Bp(n,u,e,0,null,!1,!1,"",Up);return e._reactRootContainer=E,e[bo]=E.current,Js(e.nodeType===8?e.parentNode:e),Mi(),E}for(;p=e.lastChild;)e.removeChild(p);if(typeof u=="function"){var D=u;u=function(){var ye=Dl(X);D.call(ye)}}var X=Wc(e,0,!1,null,null,!1,!1,"",Up);return e._reactRootContainer=X,e[bo]=X.current,Js(e.nodeType===8?e.parentNode:e),Mi(function(){Ll(n,X,o,u)}),X}function Bl(e,n,o,u,p){var g=o._reactRootContainer;if(g){var E=g;if(typeof p=="function"){var D=p;p=function(){var X=Dl(E);D.call(X)}}Ll(n,E,e,p)}else E=iy(o,n,e,p,u);return Dl(E)}gt=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var o=Jn(n.pendingLanes);o!==0&&(zo(n,o|1),Hn(n,ht()),(xt&6)===0&&(ws=ht()+500,Zo()))}break;case 13:Mi(function(){var u=No(e,1);if(u!==null){var p=Mn();Ar(u,e,1,p)}}),Yc(e,1)}},Vi=function(e){if(e.tag===13){var n=No(e,134217728);if(n!==null){var o=Mn();Ar(n,e,134217728,o)}Yc(e,134217728)}},Ha=function(e){if(e.tag===13){var n=ii(e),o=No(e,n);if(o!==null){var u=Mn();Ar(o,e,n,u)}Yc(e,n)}},Va=function(){return wt},mn=function(e,n){var o=wt;try{return wt=e,n()}finally{wt=o}},Be=function(e,n,o){switch(n){case"input":if(Nt(e,o),n=o.name,o.type==="radio"&&n!=null){for(o=e;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<o.length;n++){var u=o[n];if(u!==e&&u.form===e.form){var p=ol(u);if(!p)throw Error(i(90));Oe(u),Nt(u,p)}}}break;case"textarea":It(e,o);break;case"select":n=o.value,n!=null&&Et(e,!!o.multiple,n,!1)}},Ao=Bc,Oo=Mi;var sy={usingClientEntryPoint:!1,Events:[ta,as,ol,ro,Br,Bc]},ma={findFiberByHostInstance:_i,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ay={bundleType:ma.bundleType,version:ma.version,rendererPackageName:ma.rendererPackageName,rendererConfig:ma.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:R.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=pn(e),e===null?null:e.stateNode},findFiberByHostInstance:ma.findFiberByHostInstance||oy,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Hl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hl.isDisabled&&Hl.supportsFiber)try{lr=Hl.inject(ay),jn=Hl}catch{}}return Vn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sy,Vn.createPortal=function(e,n){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Qc(n))throw Error(i(200));return ry(e,n,null,o)},Vn.createRoot=function(e,n){if(!Qc(e))throw Error(i(299));var o=!1,u="",p=Vp;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onRecoverableError!==void 0&&(p=n.onRecoverableError)),n=Wc(e,1,!1,null,null,o,!1,u,p),e[bo]=n.current,Js(e.nodeType===8?e.parentNode:e),new Xc(n)},Vn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=pn(n),e=e===null?null:e.stateNode,e},Vn.flushSync=function(e){return Mi(e)},Vn.hydrate=function(e,n,o){if(!Fl(n))throw Error(i(200));return Bl(null,e,n,!0,o)},Vn.hydrateRoot=function(e,n,o){if(!Qc(e))throw Error(i(405));var u=o!=null&&o.hydratedSources||null,p=!1,g="",E=Vp;if(o!=null&&(o.unstable_strictMode===!0&&(p=!0),o.identifierPrefix!==void 0&&(g=o.identifierPrefix),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),n=Bp(n,null,e,1,o??null,p,!1,g,E),e[bo]=n.current,Js(e),u)for(e=0;e<u.length;e++)o=u[e],p=o._getVersion,p=p(o._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[o,p]:n.mutableSourceEagerHydrationData.push(o,p);return new zl(n)},Vn.render=function(e,n,o){if(!Fl(n))throw Error(i(200));return Bl(null,e,n,!1,o)},Vn.unmountComponentAtNode=function(e){if(!Fl(e))throw Error(i(40));return e._reactRootContainer?(Mi(function(){Bl(null,null,e,!1,function(){e._reactRootContainer=null,e[bo]=null})}),!0):!1},Vn.unstable_batchedUpdates=Bc,Vn.unstable_renderSubtreeIntoContainer=function(e,n,o,u){if(!Fl(o))throw Error(i(200));if(e==null||e._reactInternals===void 0)throw Error(i(38));return Bl(e,n,o,!1,u)},Vn.version="18.3.1-next-f1338f8080-20240426",Vn}var Jp;function ym(){if(Jp)return Zc.exports;Jp=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),Zc.exports=yy(),Zc.exports}var Zp;function vy(){if(Zp)return Vl;Zp=1;var t=ym();return Vl.createRoot=t.createRoot,Vl.hydrateRoot=t.hydrateRoot,Vl}var xy=vy();const wy=wu(xy),by="x-api-doc-tor-llm-key";function Zl(t){switch(t){case"anthropic":return"claude-sonnet-4-20250514";case"openai":return"gpt-4o-mini";case"openrouter":return"openai/gpt-4o-mini";default:return"gpt-4o-mini"}}const _y=["get","post","put","patch","delete","options","head","trace"];function eh(t){return t.replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_|_$/g,"").replace(/_+/g,"_")}function bu(t,r,i,s){if(i)return eh(i).replace(/^[0-9]/,"_$&")||`op_${s}`;const l=eh(r.replace(/[{}]/g,""));return`${t}_${l}`||`op_${s}`}function _u(t){var s;return`${(((s=t.info)==null?void 0:s.title)??"Api").replace(/[^a-zA-Z0-9]+/g," ").trim().split(/\s+/).filter(Boolean).map(l=>l.charAt(0).toUpperCase()+l.slice(1).toLowerCase()).join("")||"Api"}Client`}function Su(t){return(t.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(i=>i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join("")||"Api")+"Service"}function to(t){const r=[];if(!t.paths)return r;for(const[i,s]of Object.entries(t.paths)){if(!s||typeof s!="object"||"$ref"in s)continue;const l=s;for(const c of _y){const d=l[c];d&&typeof d=="object"&&r.push({method:c,path:i,operationId:d.operationId,tags:d.tags})}}return r}function Sy(t,r,i,s="baseUrl"){var c,d;const l=r.toUpperCase();return`const ${s} = "${((d=(c=t.servers)==null?void 0:c[0])==null?void 0:d.url)??"http://localhost:3000"}";
41
+ /** @returns {Promise<unknown>} */
42
+ const res = await fetch(\`${s}${i}\`, {
43
+ method: "${l}",
44
+ headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
45
+ ${l==="GET"||l==="HEAD"?"":"body: JSON.stringify({}),"}
46
+ });
47
+ const data = await res.json();
48
+ `}function vm(t,r){const i=t.map((s,l)=>` /**
49
+ * @param {{ headers?: Record<string, string> }} [options]
50
+ * @returns {Promise<unknown>}
51
+ */
52
+ async ${bu(s.method,s.path,s.operationId,l)}(options) {
53
+ const res = await fetch(\`\${this.baseUrl}${s.path}\`, {
54
+ method: "${s.method.toUpperCase()}",
55
+ headers: { ...this.defaultHeaders, ...options?.headers },
56
+ });
57
+ return res.json();
58
+ }`);return`export class ${r} {
59
+ /**
60
+ * @param {string} baseUrl
61
+ * @param {Record<string, string>} [defaultHeaders]
62
+ */
63
+ constructor(baseUrl, defaultHeaders = {}) {
64
+ this.baseUrl = baseUrl;
65
+ this.defaultHeaders = defaultHeaders;
66
+ }
67
+
68
+ ${i.join(`
69
+
70
+ `)}
71
+ }
72
+ `}function ky(t){return vm(to(t),_u(t))}function Ny(t,r){const i=Su(r),s=to(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return vm(s,i)}function Ey(t,r,i){var c,d;const s=((d=(c=t.servers)==null?void 0:c[0])==null?void 0:d.url)??"http://localhost:3000",l=r.toUpperCase();return`<?php
73
+ $baseUrl = '${s}';
74
+ $url = $baseUrl . '${i}';
75
+ $opts = [
76
+ 'http' => [
77
+ 'method' => '${l}',
78
+ 'header' => "Content-Type: application/json\\r\\nAuthorization: Bearer {$token}\\r\\n",
79
+ ${l==="GET"||l==="HEAD"?"":"'content' => json_encode([]),"}
80
+ ],
81
+ ];
82
+ $context = stream_context_create($opts);
83
+ $response = file_get_contents($url, false, $context);
84
+ $data = json_decode($response, true);
85
+ `}function xm(t,r){const i=t.map((s,l)=>` public function ${bu(s.method,s.path,s.operationId,l)}(array $extraHeaders = []): array
86
+ {
87
+ $url = $this->baseUrl . '${s.path}';
88
+ $headers = array_merge($this->defaultHeaders, $extraHeaders);
89
+ $opts = [
90
+ 'http' => [
91
+ 'method' => '${s.method.toUpperCase()}',
92
+ 'header' => $this->formatHeaders($headers),
93
+ ],
94
+ ];
95
+ $ctx = stream_context_create($opts);
96
+ $raw = file_get_contents($url, false, $ctx);
97
+ return json_decode($raw ?: '[]', true) ?: [];
98
+ }`);return`<?php
99
+
100
+ declare(strict_types=1);
101
+
102
+ final class ${r}
103
+ {
104
+ public function __construct(
105
+ private string $baseUrl,
106
+ /** @var array<string, string> */
107
+ private array $defaultHeaders = [],
108
+ ) {
109
+ $this->baseUrl = rtrim($baseUrl, '/');
110
+ }
111
+
112
+ /** @param array<string, string> $headers */
113
+ private function formatHeaders(array $headers): string
114
+ {
115
+ $lines = [];
116
+ foreach ($headers as $k => $v) {
117
+ $lines[] = $k . ': ' . $v;
118
+ }
119
+ return implode("\\r\\n", $lines) . "\\r\\n";
120
+ }
121
+
122
+ ${i.join(`
123
+
124
+ `)}
125
+ }
126
+ `}function Cy(t){return xm(to(t),_u(t))}function jy(t,r){const i=Su(r),s=to(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return xm(s,i)}function Py(t,r,i){var d,h;const s=((h=(d=t.servers)==null?void 0:d[0])==null?void 0:h.url)??"http://localhost:3000",l=r.toLowerCase();return`import httpx
127
+
128
+ base_url = "${s}"
129
+ url = f"{base_url}${i}"
130
+ headers = {"Authorization": f"Bearer {token}"}
131
+ with httpx.Client() as client:
132
+ response = client.${l}(url, headers=headers${l==="get"||l==="head"?"":", json={}"})
133
+ data = response.json()
134
+ `}function wm(t,r){const i=t.map((s,l)=>{const c=bu(s.method,s.path,s.operationId,l),d=s.method.toLowerCase(),h=d==="get"||d==="head"?"":", json={}";return` def ${c}(self, headers: dict | None = None) -> dict:
135
+ h = {**self.default_headers, **(headers or {})}
136
+ r = self._client.${d}(f"{self.base_url}${s.path}", headers=h${h})
137
+ return r.json()`});return`from __future__ import annotations
138
+ import httpx
139
+
140
+ class ${r}:
141
+ def __init__(self, base_url: str, default_headers: dict | None = None) -> None:
142
+ self.base_url = base_url.rstrip("/")
143
+ self.default_headers = default_headers or {}
144
+ self._client = httpx.Client()
145
+
146
+ def close(self) -> None:
147
+ self._client.close()
148
+
149
+ ${i.join(`
150
+
151
+ `)}
152
+ `}function My(t){return wm(to(t),_u(t))}function $y(t,r){const i=Su(r),s=to(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return wm(s,i)}function Ty(t){const r=t.split("/");return(r[r.length-1]??"Unknown").replace(/[^a-zA-Z0-9_]/g,"_")}function xf(t){if(!t)return"unknown";if("$ref"in t&&t.$ref)return Ty(t.$ref);const r=t;return r.type==="string"?"string":r.type==="number"||r.type==="integer"?"number":r.type==="boolean"?"boolean":r.type==="array"&&r.items?`${xf(r.items)}[]`:r.type==="object"&&r.properties?`{
153
+ ${Object.entries(r.properties).map(([s,l])=>` ${JSON.stringify(s)}?: ${xf(l)};`).join(`
154
+ `)}
155
+ }`:"Record<string, unknown>"}function Iy(t,r,i,s="baseUrl"){var b,k,x,S,C,j;const l=(k=(b=t.paths)==null?void 0:b[i])==null?void 0:k[r],c=l==null?void 0:l.requestBody;let d;if((S=(x=c==null?void 0:c.content)==null?void 0:x["application/json"])!=null&&S.schema){const $=c.content["application/json"].schema;$&&!("$ref"in $)&&(d=$)}const h=d?xf(d):"Record<string, unknown>",y=r.toUpperCase();return`const ${s} = "${((j=(C=t.servers)==null?void 0:C[0])==null?void 0:j.url)??"http://localhost:3000"}";
156
+ const res = await fetch(\`${s}${i}\`, {
157
+ method: "${y}",
158
+ headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
159
+ ${y==="GET"||y==="HEAD"?"":`body: JSON.stringify({} as ${h}),`}
160
+ });
161
+ const data = await res.json() as unknown;
162
+ `}function bm(t,r){const i=t.map((s,l)=>` async ${bu(s.method,s.path,s.operationId,l)}(options?: { headers?: Record<string, string> }): Promise<unknown> {
163
+ const res = await fetch(\`\${this.baseUrl}${s.path}\`, {
164
+ method: "${s.method.toUpperCase()}",
165
+ headers: { ...this.defaultHeaders, ...options?.headers },
166
+ });
167
+ return res.json();
168
+ }`);return`export class ${r} {
169
+ constructor(
170
+ private baseUrl: string,
171
+ private defaultHeaders: Record<string, string> = {},
172
+ ) {}
173
+
174
+ ${i.join(`
175
+
176
+ `)}
177
+ }
178
+ `}function Ay(t){const r=to(t),i=_u(t);return bm(r,i)}function Oy(t,r){const i=Su(r),s=to(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return bm(s,i)}function Ry(t,r,i,s){switch(r){case"typescript":return Iy(t,i,s);case"javascript":return Sy(t,i,s);case"python":return Py(t,i,s);case"php":return Ey(t,i,s);default:{const l=r;throw new Error(`Unsupported language: ${l}`)}}}function Ly(t,r,i){switch(r){case"typescript":return Oy(t,i);case"javascript":return Ny(t,i);case"python":return $y(t,i);case"php":return jy(t,i);default:{const s=r;throw new Error(`Unsupported language: ${s}`)}}}function Dy(t,r,i){if(i===null)switch(r){case"typescript":return Ay(t);case"javascript":return ky(t);case"python":return My(t);case"php":return Cy(t);default:{const s=r;throw new Error(`Unsupported language: ${s}`)}}return Ly(t,r,i)}function zy(t){const r=new Set;for(const i of to(t))for(const s of i.tags??[])r.add(s);return r.size===0&&r.add("default"),[...r].sort()}function ks(t,r){var i,s,l;return r!=null&&r.trim()?r.replace(/\/$/,""):((l=(s=(i=t.servers)==null?void 0:i[0])==null?void 0:s.url)==null?void 0:l.replace(/\/$/,""))??window.location.origin}function Fy(t){var i;const r=(i=t.components)==null?void 0:i.securitySchemes;return r?Object.keys(r):[]}function Rf(t,r){if(!r.startsWith("$"))return;let i=t;const s=r.slice(1);if(s.startsWith(".")){for(const l of s.slice(1).split("."))if(i&&typeof i=="object"&&l in i)i=i[l];else return;return i}return i}var eu={exports:{}},By=eu.exports,th;function Hy(){return th||(th=1,(function(t,r){((i,s)=>{t.exports=s()})(By,function(){var i=function(a,f){return(i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(m,v){m.__proto__=v}:function(m,v){for(var _ in v)Object.prototype.hasOwnProperty.call(v,_)&&(m[_]=v[_])}))(a,f)},s=function(){return(s=Object.assign||function(a){for(var f,m=1,v=arguments.length;m<v;m++)for(var _ in f=arguments[m])Object.prototype.hasOwnProperty.call(f,_)&&(a[_]=f[_]);return a}).apply(this,arguments)};function l(a,f,m){for(var v,_=0,N=f.length;_<N;_++)!v&&_ in f||((v=v||Array.prototype.slice.call(f,0,_))[_]=f[_]);return a.concat(v||Array.prototype.slice.call(f))}var c=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:fy,d=Object.keys,h=Array.isArray;function y(a,f){return typeof f=="object"&&d(f).forEach(function(m){a[m]=f[m]}),a}typeof Promise>"u"||c.Promise||(c.Promise=Promise);var b=Object.getPrototypeOf,k={}.hasOwnProperty;function x(a,f){return k.call(a,f)}function S(a,f){typeof f=="function"&&(f=f(b(a))),(typeof Reflect>"u"?d:Reflect.ownKeys)(f).forEach(function(m){j(a,m,f[m])})}var C=Object.defineProperty;function j(a,f,m,v){C(a,f,y(m&&x(m,"get")&&typeof m.get=="function"?{get:m.get,set:m.set,configurable:!0}:{value:m,configurable:!0,writable:!0},v))}function $(a){return{from:function(f){return a.prototype=Object.create(f.prototype),j(a.prototype,"constructor",a),{extend:S.bind(null,a.prototype)}}}}var T=Object.getOwnPropertyDescriptor,I=[].slice;function U(a,f,m){return I.call(a,f,m)}function P(a,f){return f(a)}function R(a){if(!a)throw new Error("Assertion Failed")}function B(a){c.setImmediate?setImmediate(a):setTimeout(a,0)}function H(a,f){if(typeof f=="string"&&x(a,f))return a[f];if(!f)return a;if(typeof f!="string"){for(var m=[],v=0,_=f.length;v<_;++v){var N=H(a,f[v]);m.push(N)}return m}var M,O=f.indexOf(".");return O===-1||(M=a[f.substr(0,O)])==null?void 0:H(M,f.substr(O+1))}function Q(a,f,m){if(a&&f!==void 0&&!("isFrozen"in Object&&Object.isFrozen(a)))if(typeof f!="string"&&"length"in f){R(typeof m!="string"&&"length"in m);for(var v=0,_=f.length;v<_;++v)Q(a,f[v],m[v])}else{var N,M,O=f.indexOf(".");O!==-1?(N=f.substr(0,O),(O=f.substr(O+1))===""?m===void 0?h(a)&&!isNaN(parseInt(N))?a.splice(N,1):delete a[N]:a[N]=m:Q(M=(M=a[N])&&x(a,N)?M:a[N]={},O,m)):m===void 0?h(a)&&!isNaN(parseInt(f))?a.splice(f,1):delete a[f]:a[f]=m}}function ce(a){var f,m={};for(f in a)x(a,f)&&(m[f]=a[f]);return m}var de=[].concat;function we(a){return de.apply([],a)}var K="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(a){return["Int","Uint","Float"].map(function(f){return f+a+"Array"})}))).filter(function(a){return c[a]}),q=new Set(K.map(function(a){return c[a]})),fe=null;function xe(a){return fe=new WeakMap,a=(function f(m){if(!m||typeof m!="object")return m;var v=fe.get(m);if(v)return v;if(h(m)){v=[],fe.set(m,v);for(var _=0,N=m.length;_<N;++_)v.push(f(m[_]))}else if(q.has(m.constructor))v=m;else{var M,O=b(m);for(M in v=O===Object.prototype?{}:Object.create(O),fe.set(m,v),m)x(m,M)&&(v[M]=f(m[M]))}return v})(a),fe=null,a}var L={}.toString;function le(a){return L.call(a).slice(8,-1)}var G=typeof Symbol<"u"?Symbol.iterator:"@@iterator",ie=typeof G=="symbol"?function(a){var f;return a!=null&&(f=a[G])&&f.apply(a)}:function(){return null};function z(a,f){f=a.indexOf(f),0<=f&&a.splice(f,1)}var W={};function F(a){var f,m,v,_;if(arguments.length===1){if(h(a))return a.slice();if(this===W&&typeof a=="string")return[a];if(_=ie(a))for(m=[];!(v=_.next()).done;)m.push(v.value);else{if(a==null)return[a];if(typeof(f=a.length)!="number")return[a];for(m=new Array(f);f--;)m[f]=a[f]}}else for(f=arguments.length,m=new Array(f);f--;)m[f]=arguments[f];return m}var A=typeof Symbol<"u"?function(a){return a[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},K=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],St=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(K),be={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 Se(a,f){this.name=a,this.message=f}function Me(a,f){return a+". Errors: "+Object.keys(f).map(function(m){return f[m].toString()}).filter(function(m,v,_){return _.indexOf(m)===v}).join(`
179
+ `)}function Ie(a,f,m,v){this.failures=f,this.failedKeys=v,this.successCount=m,this.message=Me(a,f)}function Ae(a,f){this.name="BulkError",this.failures=Object.keys(f).map(function(m){return f[m]}),this.failuresByPos=f,this.message=Me(a,this.failures)}$(Se).from(Error).extend({toString:function(){return this.name+": "+this.message}}),$(Ie).from(Se),$(Ae).from(Se);var _e=St.reduce(function(a,f){return a[f]=f+"Error",a},{}),ze=Se,ke=St.reduce(function(a,f){var m=f+"Error";function v(_,N){this.name=m,_?typeof _=="string"?(this.message="".concat(_).concat(N?`
180
+ `+N:""),this.inner=N||null):typeof _=="object"&&(this.message="".concat(_.name," ").concat(_.message),this.inner=_):(this.message=be[f]||m,this.inner=null)}return $(v).from(ze),a[f]=v,a},{}),He=(ke.Syntax=SyntaxError,ke.Type=TypeError,ke.Range=RangeError,K.reduce(function(a,f){return a[f+"Error"]=ke[f],a},{}));K=St.reduce(function(a,f){return["Syntax","Type","Range"].indexOf(f)===-1&&(a[f+"Error"]=ke[f]),a},{});function Oe(){}function Ke(a){return a}function lt(a,f){return a==null||a===Ke?f:function(m){return f(a(m))}}function ut(a,f){return function(){a.apply(this,arguments),f.apply(this,arguments)}}function at(a,f){return a===Oe?f:function(){var m=a.apply(this,arguments),v=(m!==void 0&&(arguments[0]=m),this.onsuccess),_=this.onerror,N=(this.onsuccess=null,this.onerror=null,f.apply(this,arguments));return v&&(this.onsuccess=this.onsuccess?ut(v,this.onsuccess):v),_&&(this.onerror=this.onerror?ut(_,this.onerror):_),N!==void 0?N:m}}function Nt(a,f){return a===Oe?f:function(){a.apply(this,arguments);var m=this.onsuccess,v=this.onerror;this.onsuccess=this.onerror=null,f.apply(this,arguments),m&&(this.onsuccess=this.onsuccess?ut(m,this.onsuccess):m),v&&(this.onerror=this.onerror?ut(v,this.onerror):v)}}function Xt(a,f){return a===Oe?f:function(_){var v=a.apply(this,arguments),_=(y(_,v),this.onsuccess),N=this.onerror,M=(this.onsuccess=null,this.onerror=null,f.apply(this,arguments));return _&&(this.onsuccess=this.onsuccess?ut(_,this.onsuccess):_),N&&(this.onerror=this.onerror?ut(N,this.onerror):N),v===void 0?M===void 0?void 0:M:y(v,M)}}function Zt(a,f){return a===Oe?f:function(){return f.apply(this,arguments)!==!1&&a.apply(this,arguments)}}function Vt(a,f){return a===Oe?f:function(){var m=a.apply(this,arguments);if(m&&typeof m.then=="function"){for(var v=this,_=arguments.length,N=new Array(_);_--;)N[_]=arguments[_];return m.then(function(){return f.apply(v,N)})}return f.apply(this,arguments)}}K.ModifyError=Ie,K.DexieError=Se,K.BulkError=Ae;var Et=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Bt(a){Et=a}var fn={},It=100,bn=typeof Promise>"u"?[]:(St=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[bn=crypto.subtle.digest("SHA-512",new Uint8Array([0])),b(bn),St]:[St,b(St),St]),St=bn[0],go=bn[1],go=go&&go.then,Lt=St&&St.constructor,_n=!!bn[2],Kn=function(a,f){Wn.push([a,f]),$n&&(queueMicrotask(Oo),$n=!1)},Sn=!0,$n=!0,qn=[],yr=[],vr=Ke,kn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Oe,pgp:!1,env:{},finalize:Oe},Ye=kn,Wn=[],Nn=0,ir=[];function Be(a){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var f=this._PSD=Ye;if(typeof a!="function"){if(a!==fn)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&Fr(this,this._value)}else this._state=null,this._value=null,++f.ref,(function m(v,_){try{_(function(N){if(v._state===null){if(N===v)throw new TypeError("A promise cannot be resolved with itself.");var M=v._lib&&Tn();N&&typeof N.then=="function"?m(v,function(O,Z){N instanceof Be?N._then(O,Z):N.then(O,Z)}):(v._state=!0,v._value=N,ro(v)),M&&Xn()}},Fr.bind(null,v))}catch(N){Fr(v,N)}})(this,a)}var dn={get:function(){var a=Ye,f=On;function m(v,_){var N=this,M=!a.global&&(a!==Ye||f!==On),O=M&&!Ve(),Z=new Be(function(ue,te){Br(N,new Yn(wr(v,a,M,O),wr(_,a,M,O),ue,te,a))});return this._consoleTask&&(Z._consoleTask=this._consoleTask),Z}return m.prototype=fn,m},set:function(a){j(this,"then",a&&a.prototype===fn?dn:{get:function(){return a},set:dn.set})}};function Yn(a,f,m,v,_){this.onFulfilled=typeof a=="function"?a:null,this.onRejected=typeof f=="function"?f:null,this.resolve=m,this.reject=v,this.psd=_}function Fr(a,f){var m,v;yr.push(f),a._state===null&&(m=a._lib&&Tn(),f=vr(f),a._state=!1,a._value=f,v=a,qn.some(function(_){return _._value===v._value})||qn.push(v),ro(a),m)&&Xn()}function ro(a){var f=a._listeners;a._listeners=[];for(var m=0,v=f.length;m<v;++m)Br(a,f[m]);var _=a._PSD;--_.ref||_.finalize(),Nn===0&&(++Nn,Kn(function(){--Nn==0&&In()},[]))}function Br(a,f){if(a._state===null)a._listeners.push(f);else{var m=a._state?f.onFulfilled:f.onRejected;if(m===null)return(a._state?f.resolve:f.reject)(a._value);++f.psd.ref,++Nn,Kn(Ao,[m,a,f])}}function Ao(a,f,m){try{var v,_=f._value;!f._state&&yr.length&&(yr=[]),v=Et&&f._consoleTask?f._consoleTask.run(function(){return a(_)}):a(_),f._state||yr.indexOf(_)!==-1||(N=>{for(var M=qn.length;M;)if(qn[--M]._value===N._value)return qn.splice(M,1)})(f),m.resolve(v)}catch(N){m.reject(N)}finally{--Nn==0&&In(),--m.psd.ref||m.psd.finalize()}}function Oo(){Qt(kn,function(){Tn()&&Xn()})}function Tn(){var a=Sn;return $n=Sn=!1,a}function Xn(){var a,f,m;do for(;0<Wn.length;)for(a=Wn,Wn=[],m=a.length,f=0;f<m;++f){var v=a[f];v[0].apply(null,v[1])}while(0<Wn.length);$n=Sn=!0}function In(){for(var a=qn,f=(qn=[],a.forEach(function(v){v._PSD.onunhandled.call(null,v._value,v)}),ir.slice(0)),m=f.length;m;)f[--m]()}function sr(a){return new Be(fn,!1,a)}function mt(a,f){var m=Ye;return function(){var v=Tn(),_=Ye;try{return Kt(m,!0),a.apply(this,arguments)}catch(N){f&&f(N)}finally{Kt(_,!1),v&&Xn()}}}S(Be.prototype,{then:dn,_then:function(a,f){Br(this,new Yn(null,null,a,f,Ye))},catch:function(a){var f,m;return arguments.length===1?this.then(null,a):(f=a,m=arguments[1],typeof f=="function"?this.then(null,function(v){return(v instanceof f?m:sr)(v)}):this.then(null,function(v){return(v&&v.name===f?m:sr)(v)}))},finally:function(a){return this.then(function(f){return Be.resolve(a()).then(function(){return f})},function(f){return Be.resolve(a()).then(function(){return sr(f)})})},timeout:function(a,f){var m=this;return a<1/0?new Be(function(v,_){var N=setTimeout(function(){return _(new ke.Timeout(f))},a);m.then(v,_).finally(clearTimeout.bind(null,N))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&j(Be.prototype,Symbol.toStringTag,"Dexie.Promise"),kn.env=pn(),S(Be,{all:function(){var a=F.apply(null,arguments).map(dt);return new Be(function(f,m){a.length===0&&f([]);var v=a.length;a.forEach(function(_,N){return Be.resolve(_).then(function(M){a[N]=M,--v||f(a)},m)})})},resolve:function(a){return a instanceof Be?a:a&&typeof a.then=="function"?new Be(function(f,m){a.then(f,m)}):new Be(fn,!0,a)},reject:sr,race:function(){var a=F.apply(null,arguments).map(dt);return new Be(function(f,m){a.map(function(v){return Be.resolve(v).then(f,m)})})},PSD:{get:function(){return Ye},set:function(a){return Ye=a}},totalEchoes:{get:function(){return On}},newPSD:V,usePSD:Qt,scheduler:{get:function(){return Kn},set:function(a){Kn=a}},rejectionMapper:{get:function(){return vr},set:function(a){vr=a}},follow:function(a,f){return new Be(function(m,v){return V(function(_,N){var M=Ye;M.unhandleds=[],M.onunhandled=N,M.finalize=ut(function(){var O,Z=this;O=function(){Z.unhandleds.length===0?_():N(Z.unhandleds[0])},ir.push(function ue(){O(),ir.splice(ir.indexOf(ue),1)}),++Nn,Kn(function(){--Nn==0&&In()},[])},M.finalize),a()},f,m,v)})}}),Lt&&(Lt.allSettled&&j(Be,"allSettled",function(){var a=F.apply(null,arguments).map(dt);return new Be(function(f){a.length===0&&f([]);var m=a.length,v=new Array(m);a.forEach(function(_,N){return Be.resolve(_).then(function(M){return v[N]={status:"fulfilled",value:M}},function(M){return v[N]={status:"rejected",reason:M}}).then(function(){return--m||f(v)})})})}),Lt.any&&typeof AggregateError<"u"&&j(Be,"any",function(){var a=F.apply(null,arguments).map(dt);return new Be(function(f,m){a.length===0&&m(new AggregateError([]));var v=a.length,_=new Array(v);a.forEach(function(N,M){return Be.resolve(N).then(function(O){return f(O)},function(O){_[M]=O,--v||m(new AggregateError(_))})})})}),Lt.withResolvers)&&(Be.withResolvers=Lt.withResolvers);var jt={awaits:0,echoes:0,id:0},xr=0,Qn=[],An=0,On=0,Ro=0;function V(a,M,m,v){var _=Ye,N=Object.create(_),M=(N.parent=_,N.ref=0,N.global=!1,N.id=++Ro,kn.env,N.env=_n?{Promise:Be,PromiseProp:{value:Be,configurable:!0,writable:!0},all:Be.all,race:Be.race,allSettled:Be.allSettled,any:Be.any,resolve:Be.resolve,reject:Be.reject}:{},M&&y(N,M),++_.ref,N.finalize=function(){--this.parent.ref||this.parent.finalize()},Qt(N,a,m,v));return N.ref===0&&N.finalize(),M}function Le(){return jt.id||(jt.id=++xr),++jt.awaits,jt.echoes+=It,jt.id}function Ve(){return!!jt.awaits&&(--jt.awaits==0&&(jt.id=0),jt.echoes=jt.awaits*It,!0)}function dt(a){return jt.echoes&&a&&a.constructor===Lt?(Le(),a.then(function(f){return Ve(),f},function(f){return Ve(),kt(f)})):a}function En(){var a=Qn[Qn.length-1];Qn.pop(),Kt(a,!1)}function Kt(a,f){var m,v,_=Ye;(f?!jt.echoes||An++&&a===Ye:!An||--An&&a===Ye)||queueMicrotask(f?(function(N){++On,jt.echoes&&--jt.echoes!=0||(jt.echoes=jt.awaits=jt.id=0),Qn.push(Ye),Kt(N,!0)}).bind(null,a):En),a!==Ye&&(Ye=a,_===kn&&(kn.env=pn()),_n)&&(m=kn.env.Promise,v=a.env,_.global||a.global)&&(Object.defineProperty(c,"Promise",v.PromiseProp),m.all=v.all,m.race=v.race,m.resolve=v.resolve,m.reject=v.reject,v.allSettled&&(m.allSettled=v.allSettled),v.any)&&(m.any=v.any)}function pn(){var a=c.Promise;return _n?{Promise:a,PromiseProp:Object.getOwnPropertyDescriptor(c,"Promise"),all:a.all,race:a.race,allSettled:a.allSettled,any:a.any,resolve:a.resolve,reject:a.reject}:{}}function Qt(a,f,m,v,_){var N=Ye;try{return Kt(a,!0),f(m,v,_)}finally{Kt(N,!1)}}function wr(a,f,m,v){return typeof a!="function"?a:function(){var _=Ye;m&&Le(),Kt(f,!0);try{return a.apply(this,arguments)}finally{Kt(_,!1),v&&queueMicrotask(Ve)}}}function Gn(a){Promise===Lt&&jt.echoes===0?An===0?a():enqueueNativeMicroTask(a):setTimeout(a,0)}(""+go).indexOf("[native code]")===-1&&(Le=Ve=Oe);var kt=Be.reject,Cn="￿",ht="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",br="String expected.",ar="__dbnames",Lo="readonly",Hr="readwrite";function _r(a,f){return a?f?function(){return a.apply(this,arguments)&&f.apply(this,arguments)}:a:f}var di={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function lr(a){return typeof a!="string"||/\./.test(a)?function(f){return f}:function(f){return f[a]===void 0&&a in f&&delete(f=xe(f))[a],f}}function jn(){throw ke.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function ct(a,f){try{var m=hn(a),v=hn(f);if(m!==v)return m==="Array"?1:v==="Array"?-1:m==="binary"?1:v==="binary"?-1:m==="string"?1:v==="string"?-1:m==="Date"?1:v!=="Date"?NaN:-1;switch(m){case"number":case"Date":case"string":return f<a?1:a<f?-1:0;case"binary":for(var _=Hi(a),N=Hi(f),M=_.length,O=N.length,Z=M<O?M:O,ue=0;ue<Z;++ue)if(_[ue]!==N[ue])return _[ue]<N[ue]?-1:1;return M===O?0:M<O?-1:1;case"Array":for(var te=a,J=f,ee=te.length,ae=J.length,oe=ee<ae?ee:ae,re=0;re<oe;++re){var se=ct(te[re],J[re]);if(se!==0)return se}return ee===ae?0:ee<ae?-1:1}}catch{}return NaN}function hn(a){var f=typeof a;return f=="object"&&(ArrayBuffer.isView(a)||(f=le(a))==="ArrayBuffer")?"binary":f}function Hi(a){return a instanceof Uint8Array?a:ArrayBuffer.isView(a)?new Uint8Array(a.buffer,a.byteOffset,a.byteLength):new Uint8Array(a)}function Do(a,f,m){var v=a.schema.yProps;return v?(f&&0<m.numFailures&&(f=f.filter(function(_,N){return!m.failures[N]})),Promise.all(v.map(function(_){return _=_.updatesTable,f?a.db.table(_).where("k").anyOf(f).delete():a.db.table(_).clear()})).then(function(){return m})):m}io.prototype.execute=function(a){var f=this["@@propmod"];if(f.add!==void 0){var m=f.add;if(h(m))return l(l([],h(a)?a:[],!0),m).sort();if(typeof m=="number")return(Number(a)||0)+m;if(typeof m=="bigint")try{return BigInt(a)+m}catch{return BigInt(0)+m}throw new TypeError("Invalid term ".concat(m))}if(f.remove!==void 0){var v=f.remove;if(h(v))return h(a)?a.filter(function(_){return!v.includes(_)}).sort():[];if(typeof v=="number")return Number(a)-v;if(typeof v=="bigint")try{return BigInt(a)-v}catch{return BigInt(0)-v}throw new TypeError("Invalid subtrahend ".concat(v))}return m=(m=f.replacePrefix)==null?void 0:m[0],m&&typeof a=="string"&&a.startsWith(m)?f.replacePrefix[1]+a.substring(m.length):a};var oo=io;function io(a){this["@@propmod"]=a}function so(a,f){for(var m=d(f),v=m.length,_=!1,N=0;N<v;++N){var M=m[N],O=f[M],Z=H(a,M);O instanceof oo?(Q(a,M,O.execute(Z)),_=!0):Z!==O&&(Q(a,M,O),_=!0)}return _}vt.prototype._trans=function(a,f,m){var v=this._tx||Ye.trans,_=this.name,N=Et&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(a==="readonly"?"read":"write"," ").concat(this.name));function M(ue,te,J){if(J.schema[_])return f(J.idbtrans,J);throw new ke.NotFound("Table "+_+" not part of transaction")}var O=Tn();try{var Z=v&&v.db._novip===this.db._novip?v===Ye.trans?v._promise(a,M,m):V(function(){return v._promise(a,M,m)},{trans:v,transless:Ye.transless||Ye}):(function ue(te,J,ee,ae){if(te.idbdb&&(te._state.openComplete||Ye.letThrough||te._vip)){var oe=te._createTransaction(J,ee,te._dbSchema);try{oe.create(),te._state.PR1398_maxLoop=3}catch(re){return re.name===_e.InvalidState&&te.isOpen()&&0<--te._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),te.close({disableAutoOpen:!1}),te.open().then(function(){return ue(te,J,ee,ae)})):kt(re)}return oe._promise(J,function(re,se){return V(function(){return Ye.trans=oe,ae(re,se,oe)})}).then(function(re){if(J==="readwrite")try{oe.idbtrans.commit()}catch{}return J==="readonly"?re:oe._completion.then(function(){return re})})}if(te._state.openComplete)return kt(new ke.DatabaseClosed(te._state.dbOpenError));if(!te._state.isBeingOpened){if(!te._state.autoOpen)return kt(new ke.DatabaseClosed);te.open().catch(Oe)}return te._state.dbReadyPromise.then(function(){return ue(te,J,ee,ae)})})(this.db,a,[this.name],M);return N&&(Z._consoleTask=N,Z=Z.catch(function(ue){return console.trace(ue),kt(ue)})),Z}finally{O&&Xn()}},vt.prototype.get=function(a,f){var m=this;return a&&a.constructor===Object?this.where(a).first(f):a==null?kt(new ke.Type("Invalid argument to Table.get()")):this._trans("readonly",function(v){return m.core.get({trans:v,key:a}).then(function(_){return m.hook.reading.fire(_)})}).then(f)},vt.prototype.where=function(a){if(typeof a=="string")return new this.db.WhereClause(this,a);if(h(a))return new this.db.WhereClause(this,"[".concat(a.join("+"),"]"));var f=d(a);if(f.length===1)return this.where(f[0]).equals(a[f[0]]);var m=this.schema.indexes.concat(this.schema.primKey).filter(function(O){if(O.compound&&f.every(function(ue){return 0<=O.keyPath.indexOf(ue)})){for(var Z=0;Z<f.length;++Z)if(f.indexOf(O.keyPath[Z])===-1)return!1;return!0}return!1}).sort(function(O,Z){return O.keyPath.length-Z.keyPath.length})[0];if(m&&this.db._maxKey!==Cn)return M=m.keyPath.slice(0,f.length),this.where(M).equals(M.map(function(O){return a[O]}));!m&&Et&&console.warn("The query ".concat(JSON.stringify(a)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(f.join("+"),"]"));var v=this.schema.idxByName;function _(O,Z){return ct(O,Z)===0}var M=f.reduce(function(te,Z){var ue=te[0],te=te[1],J=v[Z],ee=a[Z];return[ue||J,ue||!J?_r(te,J&&J.multi?function(ae){return ae=H(ae,Z),h(ae)&&ae.some(function(oe){return _(ee,oe)})}:function(ae){return _(ee,H(ae,Z))}):te]},[null,null]),N=M[0],M=M[1];return N?this.where(N.name).equals(a[N.keyPath]).filter(M):m?this.filter(M):this.where(f).equals("")},vt.prototype.filter=function(a){return this.toCollection().and(a)},vt.prototype.count=function(a){return this.toCollection().count(a)},vt.prototype.offset=function(a){return this.toCollection().offset(a)},vt.prototype.limit=function(a){return this.toCollection().limit(a)},vt.prototype.each=function(a){return this.toCollection().each(a)},vt.prototype.toArray=function(a){return this.toCollection().toArray(a)},vt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},vt.prototype.orderBy=function(a){return new this.db.Collection(new this.db.WhereClause(this,h(a)?"[".concat(a.join("+"),"]"):a))},vt.prototype.reverse=function(){return this.toCollection().reverse()},vt.prototype.mapToClass=function(a){for(var f=this.db,m=this.name,v=((this.schema.mappedClass=a).prototype instanceof jn&&(a=(M=>{var O=te,Z=M;if(typeof Z!="function"&&Z!==null)throw new TypeError("Class extends value "+String(Z)+" is not a constructor or null");function ue(){this.constructor=O}function te(){return M!==null&&M.apply(this,arguments)||this}return i(O,Z),O.prototype=Z===null?Object.create(Z):(ue.prototype=Z.prototype,new ue),Object.defineProperty(te.prototype,"db",{get:function(){return f},enumerable:!1,configurable:!0}),te.prototype.table=function(){return m},te})(a)),new Set),_=a.prototype;_;_=b(_))Object.getOwnPropertyNames(_).forEach(function(M){return v.add(M)});function N(M){if(!M)return M;var O,Z=Object.create(a.prototype);for(O in M)if(!v.has(O))try{Z[O]=M[O]}catch{}return Z}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=N,this.hook("reading",N),a},vt.prototype.defineClass=function(){return this.mapToClass(function(a){y(this,a)})},vt.prototype.add=function(a,f){var m=this,v=this.schema.primKey,_=v.auto,N=v.keyPath,M=a;return N&&_&&(M=lr(N)(a)),this._trans("readwrite",function(O){return m.core.mutate({trans:O,type:"add",keys:f!=null?[f]:null,values:[M]})}).then(function(O){return O.numFailures?Be.reject(O.failures[0]):O.lastResult}).then(function(O){if(N)try{Q(a,N,O)}catch{}return O})},vt.prototype.upsert=function(a,f){var m=this,v=this.schema.primKey.keyPath;return this._trans("readwrite",function(_){return m.core.get({trans:_,key:a}).then(function(N){var M=N??{};return so(M,f),v&&Q(M,v,a),m.core.mutate({trans:_,type:"put",values:[M],keys:[a],upsert:!0,updates:{keys:[a],changeSpecs:[f]}}).then(function(O){return O.numFailures?Be.reject(O.failures[0]):!!N})})})},vt.prototype.update=function(a,f){return typeof a!="object"||h(a)?this.where(":id").equals(a).modify(f):(a=H(a,this.schema.primKey.keyPath))===void 0?kt(new ke.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(a).modify(f)},vt.prototype.put=function(a,f){var m=this,v=this.schema.primKey,_=v.auto,N=v.keyPath,M=a;return N&&_&&(M=lr(N)(a)),this._trans("readwrite",function(O){return m.core.mutate({trans:O,type:"put",values:[M],keys:f!=null?[f]:null})}).then(function(O){return O.numFailures?Be.reject(O.failures[0]):O.lastResult}).then(function(O){if(N)try{Q(a,N,O)}catch{}return O})},vt.prototype.delete=function(a){var f=this;return this._trans("readwrite",function(m){return f.core.mutate({trans:m,type:"delete",keys:[a]}).then(function(v){return Do(f,[a],v)}).then(function(v){return v.numFailures?Be.reject(v.failures[0]):void 0})})},vt.prototype.clear=function(){var a=this;return this._trans("readwrite",function(f){return a.core.mutate({trans:f,type:"deleteRange",range:di}).then(function(m){return Do(a,null,m)})}).then(function(f){return f.numFailures?Be.reject(f.failures[0]):void 0})},vt.prototype.bulkGet=function(a){var f=this;return this._trans("readonly",function(m){return f.core.getMany({keys:a,trans:m}).then(function(v){return v.map(function(_){return f.hook.reading.fire(_)})})})},vt.prototype.bulkAdd=function(a,f,m){var v=this,_=Array.isArray(f)?f:void 0,N=(m=m||(_?void 0:f))?m.allKeys:void 0;return this._trans("readwrite",function(M){var O=v.schema.primKey,ue=O.auto,O=O.keyPath;if(O&&_)throw new ke.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(_&&_.length!==a.length)throw new ke.InvalidArgument("Arguments objects and keys must have the same length");var Z=a.length,ue=O&&ue?a.map(lr(O)):a;return v.core.mutate({trans:M,type:"add",keys:_,values:ue,wantResults:N}).then(function(te){var J=te.numFailures,ee=te.failures;if(J===0)return N?te.results:te.lastResult;throw new Ae("".concat(v.name,".bulkAdd(): ").concat(J," of ").concat(Z," operations failed"),ee)})})},vt.prototype.bulkPut=function(a,f,m){var v=this,_=Array.isArray(f)?f:void 0,N=(m=m||(_?void 0:f))?m.allKeys:void 0;return this._trans("readwrite",function(M){var O=v.schema.primKey,ue=O.auto,O=O.keyPath;if(O&&_)throw new ke.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(_&&_.length!==a.length)throw new ke.InvalidArgument("Arguments objects and keys must have the same length");var Z=a.length,ue=O&&ue?a.map(lr(O)):a;return v.core.mutate({trans:M,type:"put",keys:_,values:ue,wantResults:N}).then(function(te){var J=te.numFailures,ee=te.failures;if(J===0)return N?te.results:te.lastResult;throw new Ae("".concat(v.name,".bulkPut(): ").concat(J," of ").concat(Z," operations failed"),ee)})})},vt.prototype.bulkUpdate=function(a){var f=this,m=this.core,v=a.map(function(M){return M.key}),_=a.map(function(M){return M.changes}),N=[];return this._trans("readwrite",function(M){return m.getMany({trans:M,keys:v,cache:"clone"}).then(function(O){var Z=[],ue=[],te=(a.forEach(function(J,ee){var ae=J.key,oe=J.changes,re=O[ee];if(re){for(var se=0,ge=Object.keys(oe);se<ge.length;se++){var pe=ge[se],ve=oe[pe];if(pe===f.schema.primKey.keyPath){if(ct(ve,ae)!==0)throw new ke.Constraint("Cannot update primary key in bulkUpdate()")}else Q(re,pe,ve)}N.push(ee),Z.push(ae),ue.push(re)}}),Z.length);return m.mutate({trans:M,type:"put",keys:Z,values:ue,updates:{keys:v,changeSpecs:_}}).then(function(J){var ee=J.numFailures,ae=J.failures;if(ee===0)return te;for(var oe=0,re=Object.keys(ae);oe<re.length;oe++){var se,ge=re[oe],pe=N[Number(ge)];pe!=null&&(se=ae[ge],delete ae[ge],ae[pe]=se)}throw new Ae("".concat(f.name,".bulkUpdate(): ").concat(ee," of ").concat(te," operations failed"),ae)})})})},vt.prototype.bulkDelete=function(a){var f=this,m=a.length;return this._trans("readwrite",function(v){return f.core.mutate({trans:v,type:"delete",keys:a}).then(function(_){return Do(f,a,_)})}).then(function(v){var _=v.numFailures,N=v.failures;if(_===0)return v.lastResult;throw new Ae("".concat(f.name,".bulkDelete(): ").concat(_," of ").concat(m," operations failed"),N)})};var Jn=vt;function vt(){}function Vr(a){function f(M,O){if(O){for(var Z=arguments.length,ue=new Array(Z-1);--Z;)ue[Z-1]=arguments[Z];return m[M].subscribe.apply(null,ue),a}if(typeof M=="string")return m[M]}var m={};f.addEventType=N;for(var v=1,_=arguments.length;v<_;++v)N(arguments[v]);return f;function N(M,O,Z){var ue,te;if(typeof M!="object")return O=O||Zt,te={subscribers:[],fire:Z=Z||Oe,subscribe:function(J){te.subscribers.indexOf(J)===-1&&(te.subscribers.push(J),te.fire=O(te.fire,J))},unsubscribe:function(J){te.subscribers=te.subscribers.filter(function(ee){return ee!==J}),te.fire=te.subscribers.reduce(O,Z)}},m[M]=f[M]=te;d(ue=M).forEach(function(J){var ee=ue[J];if(h(ee))N(J,ue[J][0],ue[J][1]);else{if(ee!=="asap")throw new ke.InvalidArgument("Invalid event config");var ae=N(J,Ke,function(){for(var oe=arguments.length,re=new Array(oe);oe--;)re[oe]=arguments[oe];ae.subscribers.forEach(function(se){B(function(){se.apply(null,re)})})})}})}}function ao(a,f){return $(f).from({prototype:a}),f}function ur(a,f){return!(a.filter||a.algorithm||a.or)&&(f?a.justLimit:!a.replayFilter)}function Ur(a,f){a.filter=_r(a.filter,f)}function lo(a,f,m){var v=a.replayFilter;a.replayFilter=v?function(){return _r(v(),f())}:f,a.justLimit=m&&!v}function cr(a,f){if(a.isPrimKey)return f.primaryKey;var m=f.getIndexByKeyPath(a.index);if(m)return m;throw new ke.Schema("KeyPath "+a.index+" on object store "+f.name+" is not indexed")}function pi(a,f,m){var v=cr(a,f.schema);return f.openCursor({trans:m,values:!a.keysOnly,reverse:a.dir==="prev",unique:!!a.unique,query:{index:v,range:a.range}})}function zo(a,f,m,v){var _,N,M=a.replayFilter?_r(a.filter,a.replayFilter()):a.filter;return a.or?(_={},N=function(O,Z,ue){var te,J;M&&!M(Z,ue,function(ee){return Z.stop(ee)},function(ee){return Z.fail(ee)})||((J=""+(te=Z.primaryKey))=="[object ArrayBuffer]"&&(J=""+new Uint8Array(te)),x(_,J))||(_[J]=!0,f(O,Z,ue))},Promise.all([a.or._iterate(N,m),wt(pi(a,v,m),a.algorithm,N,!a.keysOnly&&a.valueMapper)])):wt(pi(a,v,m),_r(a.algorithm,M),f,!a.keysOnly&&a.valueMapper)}function wt(a,f,m,v){var _=mt(v?function(N,M,O){return m(v(N),M,O)}:m);return a.then(function(N){if(N)return N.start(function(){var M=function(){return N.continue()};f&&!f(N,function(O){return M=O},function(O){N.stop(O),M=Oe},function(O){N.fail(O),M=Oe})||_(N.value,N,function(O){return M=O}),M()})})}gt.prototype._read=function(a,f){var m=this._ctx;return m.error?m.table._trans(null,kt.bind(null,m.error)):m.table._trans("readonly",a).then(f)},gt.prototype._write=function(a){var f=this._ctx;return f.error?f.table._trans(null,kt.bind(null,f.error)):f.table._trans("readwrite",a,"locked")},gt.prototype._addAlgorithm=function(a){var f=this._ctx;f.algorithm=_r(f.algorithm,a)},gt.prototype._iterate=function(a,f){return zo(this._ctx,a,f,this._ctx.table.core)},gt.prototype.clone=function(a){var f=Object.create(this.constructor.prototype),m=Object.create(this._ctx);return a&&y(m,a),f._ctx=m,f},gt.prototype.raw=function(){return this._ctx.valueMapper=null,this},gt.prototype.each=function(a){var f=this._ctx;return this._read(function(m){return zo(f,a,m,f.table.core)})},gt.prototype.count=function(a){var f=this;return this._read(function(m){var v,_=f._ctx,N=_.table.core;return ur(_,!0)?N.count({trans:m,query:{index:cr(_,N.schema),range:_.range}}).then(function(M){return Math.min(M,_.limit)}):(v=0,zo(_,function(){return++v,!1},m,N).then(function(){return v}))}).then(a)},gt.prototype.sortBy=function(a,f){var m=a.split(".").reverse(),v=m[0],_=m.length-1;function N(Z,ue){return ue?N(Z[m[ue]],ue-1):Z[v]}var M=this._ctx.dir==="next"?1:-1;function O(Z,ue){return ct(N(Z,_),N(ue,_))*M}return this.toArray(function(Z){return Z.sort(O)}).then(f)},gt.prototype.toArray=function(a){var f=this;return this._read(function(m){var v,_,N,M=f._ctx;return ur(M,!0)&&0<M.limit?(v=M.valueMapper,_=cr(M,M.table.core.schema),M.table.core.query({trans:m,limit:M.limit,values:!0,direction:M.dir==="prev"?"prev":void 0,query:{index:_,range:M.range}}).then(function(O){return O=O.result,v?O.map(v):O})):(N=[],zo(M,function(O){return N.push(O)},m,M.table.core).then(function(){return N}))},a)},gt.prototype.offset=function(a){var f=this._ctx;return a<=0||(f.offset+=a,ur(f)?lo(f,function(){var m=a;return function(v,_){return m===0||(m===1?--m:_(function(){v.advance(m),m=0}),!1)}}):lo(f,function(){var m=a;return function(){return--m<0}})),this},gt.prototype.limit=function(a){return this._ctx.limit=Math.min(this._ctx.limit,a),lo(this._ctx,function(){var f=a;return function(m,v,_){return--f<=0&&v(_),0<=f}},!0),this},gt.prototype.until=function(a,f){return Ur(this._ctx,function(m,v,_){return!a(m.value)||(v(_),f)}),this},gt.prototype.first=function(a){return this.limit(1).toArray(function(f){return f[0]}).then(a)},gt.prototype.last=function(a){return this.reverse().first(a)},gt.prototype.filter=function(a){var f;return Ur(this._ctx,function(m){return a(m.value)}),(f=this._ctx).isMatch=_r(f.isMatch,a),this},gt.prototype.and=function(a){return this.filter(a)},gt.prototype.or=function(a){return new this.db.WhereClause(this._ctx.table,a,this)},gt.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},gt.prototype.desc=function(){return this.reverse()},gt.prototype.eachKey=function(a){var f=this._ctx;return f.keysOnly=!f.isMatch,this.each(function(m,v){a(v.key,v)})},gt.prototype.eachUniqueKey=function(a){return this._ctx.unique="unique",this.eachKey(a)},gt.prototype.eachPrimaryKey=function(a){var f=this._ctx;return f.keysOnly=!f.isMatch,this.each(function(m,v){a(v.primaryKey,v)})},gt.prototype.keys=function(a){var f=this._ctx,m=(f.keysOnly=!f.isMatch,[]);return this.each(function(v,_){m.push(_.key)}).then(function(){return m}).then(a)},gt.prototype.primaryKeys=function(a){var f=this._ctx;if(ur(f,!0)&&0<f.limit)return this._read(function(v){var _=cr(f,f.table.core.schema);return f.table.core.query({trans:v,values:!1,limit:f.limit,direction:f.dir==="prev"?"prev":void 0,query:{index:_,range:f.range}})}).then(function(v){return v.result}).then(a);f.keysOnly=!f.isMatch;var m=[];return this.each(function(v,_){m.push(_.primaryKey)}).then(function(){return m}).then(a)},gt.prototype.uniqueKeys=function(a){return this._ctx.unique="unique",this.keys(a)},gt.prototype.firstKey=function(a){return this.limit(1).keys(function(f){return f[0]}).then(a)},gt.prototype.lastKey=function(a){return this.reverse().firstKey(a)},gt.prototype.distinct=function(){var a,f=this._ctx,f=f.index&&f.table.schema.idxByName[f.index];return f&&f.multi&&(a={},Ur(this._ctx,function(v){var v=v.primaryKey.toString(),_=x(a,v);return a[v]=!0,!_})),this},gt.prototype.modify=function(a){var f=this,m=this._ctx;return this._write(function(v){function _(re,se){var ge=se.failures;ee+=re-se.numFailures;for(var pe=0,ve=d(ge);pe<ve.length;pe++){var Ne=ve[pe];J.push(ge[Ne])}}var N=typeof a=="function"?a:function(re){return so(re,a)},M=m.table.core,te=M.schema.primaryKey,O=te.outbound,Z=te.extractKey,ue=200,te=f.db._options.modifyChunkSize,J=(te&&(ue=typeof te=="object"?te[M.name]||te["*"]||200:te),[]),ee=0,ae=[],oe=a===Vi;return f.clone().primaryKeys().then(function(re){function se(pe){var ve=Math.min(ue,re.length-pe),Ne=re.slice(pe,pe+ve);return(oe?Promise.resolve([]):M.getMany({trans:v,keys:Ne,cache:"immutable"})).then(function(Ce){var De=[],$e=[],Ue=O?[]:null,Re=oe?Ne:[];if(!oe)for(var We=0;We<ve;++We){var Ee=Ce[We],nt={value:xe(Ee),primKey:re[pe+We]};N.call(nt,nt.value,nt)!==!1&&(nt.value==null?Re.push(re[pe+We]):O||ct(Z(Ee),Z(nt.value))===0?($e.push(nt.value),O&&Ue.push(re[pe+We])):(Re.push(re[pe+We]),De.push(nt.value)))}return Promise.resolve(0<De.length&&M.mutate({trans:v,type:"add",values:De}).then(function(rt){for(var st in rt.failures)Re.splice(parseInt(st),1);_(De.length,rt)})).then(function(){return(0<$e.length||ge&&typeof a=="object")&&M.mutate({trans:v,type:"put",keys:Ue,values:$e,criteria:ge,changeSpec:typeof a!="function"&&a,isAdditionalChunk:0<pe}).then(function(rt){return _($e.length,rt)})}).then(function(){return(0<Re.length||ge&&oe)&&M.mutate({trans:v,type:"delete",keys:Re,criteria:ge,isAdditionalChunk:0<pe}).then(function(rt){return Do(m.table,Re,rt)}).then(function(rt){return _(Re.length,rt)})}).then(function(){return re.length>pe+ve&&se(pe+ue)})})}var ge=ur(m)&&m.limit===1/0&&(typeof a!="function"||oe)&&{index:m.index,range:m.range};return se(0).then(function(){if(0<J.length)throw new Ie("Error modifying one or more objects",J,ee,ae);return re.length})})})},gt.prototype.delete=function(){var a=this._ctx,f=a.range;return!ur(a)||a.table.schema.yProps||!a.isPrimKey&&f.type!==3?this.modify(Vi):this._write(function(m){var v=a.table.core.schema.primaryKey,_=f;return a.table.core.count({trans:m,query:{index:v,range:_}}).then(function(N){return a.table.core.mutate({trans:m,type:"deleteRange",range:_}).then(function(Z){var O=Z.failures,Z=Z.numFailures;if(Z)throw new Ie("Could not delete some values",Object.keys(O).map(function(ue){return O[ue]}),N-Z);return N-Z})})})};var Ba=gt;function gt(){}var Vi=function(a,f){return f.value=null};function Ha(a,f){return a<f?-1:a===f?0:1}function Va(a,f){return f<a?-1:a===f?0:1}function mn(a,f,m){return a=a instanceof kr?new a.Collection(a):a,a._ctx.error=new(m||TypeError)(f),a}function Kr(a){return new a.Collection(a,function(){return Sr("")}).limit(0)}function uo(ae,f,m,v){var _,N,M,O,Z,ue,te,J=m.length;if(!m.every(function(re){return typeof re=="string"}))return mn(ae,br);function ee(re){_=re==="next"?function(ge){return ge.toUpperCase()}:function(ge){return ge.toLowerCase()},N=re==="next"?function(ge){return ge.toLowerCase()}:function(ge){return ge.toUpperCase()},M=re==="next"?Ha:Va;var se=m.map(function(ge){return{lower:N(ge),upper:_(ge)}}).sort(function(ge,pe){return M(ge.lower,pe.lower)});O=se.map(function(ge){return ge.upper}),Z=se.map(function(ge){return ge.lower}),te=(ue=re)==="next"?"":v}ee("next");var ae=new ae.Collection(ae,function(){return sn(O[0],Z[J-1]+v)}),oe=(ae._ondirectionchange=function(re){ee(re)},0);return ae._addAlgorithm(function(re,se,ge){var pe=re.key;if(typeof pe=="string"){var ve=N(pe);if(f(ve,Z,oe))return!0;for(var Ne=null,Ce=oe;Ce<J;++Ce){var De=(($e,Ue,Re,We,Ee,nt)=>{for(var rt=Math.min($e.length,We.length),st=-1,ft=0;ft<rt;++ft){var gn=Ue[ft];if(gn!==We[ft])return Ee($e[ft],Re[ft])<0?$e.substr(0,ft)+Re[ft]+Re.substr(ft+1):Ee($e[ft],We[ft])<0?$e.substr(0,ft)+We[ft]+Re.substr(ft+1):0<=st?$e.substr(0,st)+Ue[st]+Re.substr(st+1):null;Ee($e[ft],gn)<0&&(st=ft)}return rt<We.length&&nt==="next"?$e+Re.substr($e.length):rt<$e.length&&nt==="prev"?$e.substr(0,Re.length):st<0?null:$e.substr(0,st)+We[st]+Re.substr(st+1)})(pe,ve,O[Ce],Z[Ce],M,ue);De===null&&Ne===null?oe=Ce+1:(Ne===null||0<M(Ne,De))&&(Ne=De)}se(Ne!==null?function(){re.continue(Ne+te)}:ge)}return!1}),ae}function sn(a,f,m,v){return{type:2,lower:a,upper:f,lowerOpen:m,upperOpen:v}}function Sr(a){return{type:1,lower:a,upper:a}}Object.defineProperty(At.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),At.prototype.between=function(a,f,m,v){m=m!==!1,v=v===!0;try{return 0<this._cmp(a,f)||this._cmp(a,f)===0&&(m||v)&&(!m||!v)?Kr(this):new this.Collection(this,function(){return sn(a,f,!m,!v)})}catch{return mn(this,ht)}},At.prototype.equals=function(a){return a==null?mn(this,ht):new this.Collection(this,function(){return Sr(a)})},At.prototype.above=function(a){return a==null?mn(this,ht):new this.Collection(this,function(){return sn(a,void 0,!0)})},At.prototype.aboveOrEqual=function(a){return a==null?mn(this,ht):new this.Collection(this,function(){return sn(a,void 0,!1)})},At.prototype.below=function(a){return a==null?mn(this,ht):new this.Collection(this,function(){return sn(void 0,a,!1,!0)})},At.prototype.belowOrEqual=function(a){return a==null?mn(this,ht):new this.Collection(this,function(){return sn(void 0,a)})},At.prototype.startsWith=function(a){return typeof a!="string"?mn(this,br):this.between(a,a+Cn,!0,!0)},At.prototype.startsWithIgnoreCase=function(a){return a===""?this.startsWith(a):uo(this,function(f,m){return f.indexOf(m[0])===0},[a],Cn)},At.prototype.equalsIgnoreCase=function(a){return uo(this,function(f,m){return f===m[0]},[a],"")},At.prototype.anyOfIgnoreCase=function(){var a=F.apply(W,arguments);return a.length===0?Kr(this):uo(this,function(f,m){return m.indexOf(f)!==-1},a,"")},At.prototype.startsWithAnyOfIgnoreCase=function(){var a=F.apply(W,arguments);return a.length===0?Kr(this):uo(this,function(f,m){return m.some(function(v){return f.indexOf(v)===0})},a,Cn)},At.prototype.anyOf=function(){var a,f,m=this,v=F.apply(W,arguments),_=this._cmp;try{v.sort(_)}catch{return mn(this,ht)}return v.length===0?Kr(this):((a=new this.Collection(this,function(){return sn(v[0],v[v.length-1])}))._ondirectionchange=function(N){_=N==="next"?m._ascending:m._descending,v.sort(_)},f=0,a._addAlgorithm(function(N,M,O){for(var Z=N.key;0<_(Z,v[f]);)if(++f===v.length)return M(O),!1;return _(Z,v[f])===0||(M(function(){N.continue(v[f])}),!1)}),a)},At.prototype.notEqual=function(a){return this.inAnyRange([[-1/0,a],[a,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},At.prototype.noneOf=function(){var a=F.apply(W,arguments);if(a.length===0)return new this.Collection(this);try{a.sort(this._ascending)}catch{return mn(this,ht)}var f=a.reduce(function(m,v){return m?m.concat([[m[m.length-1][1],v]]):[[-1/0,v]]},null);return f.push([a[a.length-1],this.db._maxKey]),this.inAnyRange(f,{includeLowers:!1,includeUppers:!1})},At.prototype.inAnyRange=function(a,ge){var m=this,v=this._cmp,_=this._ascending,N=this._descending,M=this._min,O=this._max;if(a.length===0)return Kr(this);if(!a.every(function(pe){return pe[0]!==void 0&&pe[1]!==void 0&&_(pe[0],pe[1])<=0}))return mn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",ke.InvalidArgument);var Z=!ge||ge.includeLowers!==!1,ue=ge&&ge.includeUppers===!0,te,J=_;function ee(pe,ve){return J(pe[0],ve[0])}try{(te=a.reduce(function(pe,ve){for(var Ne=0,Ce=pe.length;Ne<Ce;++Ne){var De=pe[Ne];if(v(ve[0],De[1])<0&&0<v(ve[1],De[0])){De[0]=M(De[0],ve[0]),De[1]=O(De[1],ve[1]);break}}return Ne===Ce&&pe.push(ve),pe},[])).sort(ee)}catch{return mn(this,ht)}var ae=0,oe=ue?function(pe){return 0<_(pe,te[ae][1])}:function(pe){return 0<=_(pe,te[ae][1])},re=Z?function(pe){return 0<N(pe,te[ae][0])}:function(pe){return 0<=N(pe,te[ae][0])},se=oe,ge=new this.Collection(this,function(){return sn(te[0][0],te[te.length-1][1],!Z,!ue)});return ge._ondirectionchange=function(pe){J=pe==="next"?(se=oe,_):(se=re,N),te.sort(ee)},ge._addAlgorithm(function(pe,ve,Ne){for(var Ce,De=pe.key;se(De);)if(++ae===te.length)return ve(Ne),!1;return!oe(Ce=De)&&!re(Ce)||(m._cmp(De,te[ae][1])===0||m._cmp(De,te[ae][0])===0||ve(function(){J===_?pe.continue(te[ae][0]):pe.continue(te[ae][1])}),!1)}),ge},At.prototype.startsWithAnyOf=function(){var a=F.apply(W,arguments);return a.every(function(f){return typeof f=="string"})?a.length===0?Kr(this):this.inAnyRange(a.map(function(f){return[f,f+Cn]})):mn(this,"startsWithAnyOf() only works with strings")};var kr=At;function At(){}function an(a){return mt(function(f){return Rn(f),a(f.target.error),!1})}function Rn(a){a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault()}var hi="storagemutated",Ui="x-storagemutated-1",Ln=Vr(null,hi),Ou=(Zn.prototype._lock=function(){return R(!Ye.global),++this._reculock,this._reculock!==1||Ye.global||(Ye.lockOwnerFor=this),this},Zn.prototype._unlock=function(){if(R(!Ye.global),--this._reculock==0)for(Ye.global||(Ye.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var a=this._blockedFuncs.shift();try{Qt(a[1],a[0])}catch{}}return this},Zn.prototype._locked=function(){return this._reculock&&Ye.lockOwnerFor!==this},Zn.prototype.create=function(a){var f=this;if(this.mode){var m=this.db.idbdb,v=this.db._state.dbOpenError;if(R(!this.idbtrans),!a&&!m)switch(v&&v.name){case"DatabaseClosedError":throw new ke.DatabaseClosed(v);case"MissingAPIError":throw new ke.MissingAPI(v.message,v);default:throw new ke.OpenFailed(v)}if(!this.active)throw new ke.TransactionInactive;R(this._completion._state===null),(a=this.idbtrans=a||(this.db.core||m).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=mt(function(_){Rn(_),f._reject(a.error)}),a.onabort=mt(function(_){Rn(_),f.active&&f._reject(new ke.Abort(a.error)),f.active=!1,f.on("abort").fire(_)}),a.oncomplete=mt(function(){f.active=!1,f._resolve(),"mutatedParts"in a&&Ln.storagemutated.fire(a.mutatedParts)})}return this},Zn.prototype._promise=function(a,f,m){var v,_=this;return a==="readwrite"&&this.mode!=="readwrite"?kt(new ke.ReadOnly("Transaction is readonly")):this.active?this._locked()?new Be(function(N,M){_._blockedFuncs.push([function(){_._promise(a,f,m).then(N,M)},Ye])}):m?V(function(){var N=new Be(function(M,O){_._lock();var Z=f(M,O,_);Z&&Z.then&&Z.then(M,O)});return N.finally(function(){return _._unlock()}),N._lib=!0,N}):((v=new Be(function(N,M){var O=f(N,M,_);O&&O.then&&O.then(N,M)}))._lib=!0,v):kt(new ke.TransactionInactive)},Zn.prototype._root=function(){return this.parent?this.parent._root():this},Zn.prototype.waitFor=function(a){var f,m=this._root(),v=Be.resolve(a),_=(m._waitingFor?m._waitingFor=m._waitingFor.then(function(){return v}):(m._waitingFor=v,m._waitingQueue=[],f=m.idbtrans.objectStore(m.storeNames[0]),(function N(){for(++m._spinCount;m._waitingQueue.length;)m._waitingQueue.shift()();m._waitingFor&&(f.get(-1/0).onsuccess=N)})()),m._waitingFor);return new Be(function(N,M){v.then(function(O){return m._waitingQueue.push(mt(N.bind(null,O)))},function(O){return m._waitingQueue.push(mt(M.bind(null,O)))}).finally(function(){m._waitingFor===_&&(m._waitingFor=null)})})},Zn.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new ke.Abort))},Zn.prototype.table=function(a){var f=this._memoizedTables||(this._memoizedTables={});if(x(f,a))return f[a];var m=this.schema[a];if(m)return(m=new this.db.Table(a,m,this)).core=this.db.core.table(a),f[a]=m;throw new ke.NotFound("Table "+a+" not part of transaction")},Zn);function Zn(){}function Fo(a,f,m,v,_,N,M,O){return{name:a,keyPath:f,unique:m,multi:v,auto:_,compound:N,src:(m&&!M?"&":"")+(v?"*":"")+(_?"++":"")+Ls(f),type:O}}function Ls(a){return typeof a=="string"?a:a?"["+[].join.call(a,"+")+"]":""}function Ds(a,f,m){return{name:a,primKey:f,indexes:m,mappedClass:null,idxByName:(v=function(_){return[_.name,_]},m.reduce(function(_,N,M){return N=v(N,M),N&&(_[N[0]]=N[1]),_},{}))};var v}var Nr=function(a){try{return a.only([[]]),Nr=function(){return[[]]},[[]]}catch{return Nr=function(){return Cn},Cn}};function co(a){return a==null?function(){}:typeof a=="string"?(f=a).split(".").length===1?function(m){return m[f]}:function(m){return H(m,f)}:function(m){return H(m,a)};var f}function fo(a){return[].slice.call(a)}var Ki=0;function mi(a){return a==null?":id":typeof a=="string"?a:"[".concat(a.join("+"),"]")}function Ru(a,f,M){function v(se){if(se.type===3)return null;if(se.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var ae=se.lower,oe=se.upper,re=se.lowerOpen,se=se.upperOpen;return ae===void 0?oe===void 0?null:f.upperBound(oe,!!se):oe===void 0?f.lowerBound(ae,!!re):f.bound(ae,oe,!!re,!!se)}function _(ee){var ae,oe,re=ee.name;return{name:re,schema:ee,mutate:function(se){var ge=se.trans,pe=se.type,ve=se.keys,Ne=se.values,Ce=se.range;return new Promise(function(De,$e){De=mt(De);var Ue=ge.objectStore(re),Re=Ue.keyPath==null,We=pe==="put"||pe==="add";if(!We&&pe!=="delete"&&pe!=="deleteRange")throw new Error("Invalid operation type: "+pe);var Ee,nt=(ve||Ne||{length:1}).length;if(ve&&Ne&&ve.length!==Ne.length)throw new Error("Given keys array must have same length as given values array.");if(nt===0)return De({numFailures:0,failures:{},results:[],lastResult:void 0});function rt(ln){++gn,Rn(ln)}var st=[],ft=[],gn=0;if(pe==="deleteRange"){if(Ce.type===4)return De({numFailures:gn,failures:ft,results:[],lastResult:void 0});Ce.type===3?st.push(Ee=Ue.clear()):st.push(Ee=Ue.delete(v(Ce)))}else{var Re=We?Re?[Ne,ve]:[Ne,null]:[ve,null],it=Re[0],Pt=Re[1];if(We)for(var qt=0;qt<nt;++qt)st.push(Ee=Pt&&Pt[qt]!==void 0?Ue[pe](it[qt],Pt[qt]):Ue[pe](it[qt])),Ee.onerror=rt;else for(qt=0;qt<nt;++qt)st.push(Ee=Ue[pe](it[qt])),Ee.onerror=rt}function Xo(ln){ln=ln.target.result,st.forEach(function(xo,wo){return xo.error!=null&&(ft[wo]=xo.error)}),De({numFailures:gn,failures:ft,results:pe==="delete"?ve:st.map(function(xo){return xo.result}),lastResult:ln})}Ee.onerror=function(ln){rt(ln),Xo(ln)},Ee.onsuccess=Xo})},getMany:function(se){var ge=se.trans,pe=se.keys;return new Promise(function(ve,Ne){ve=mt(ve);for(var Ce,De=ge.objectStore(re),$e=pe.length,Ue=new Array($e),Re=0,We=0,Ee=function(st){st=st.target,Ue[st._pos]=st.result,++We===Re&&ve(Ue)},nt=an(Ne),rt=0;rt<$e;++rt)pe[rt]!=null&&((Ce=De.get(pe[rt]))._pos=rt,Ce.onsuccess=Ee,Ce.onerror=nt,++Re);Re===0&&ve(Ue)})},get:function(se){var ge=se.trans,pe=se.key;return new Promise(function(ve,Ne){ve=mt(ve);var Ce=ge.objectStore(re).get(pe);Ce.onsuccess=function(De){return ve(De.target.result)},Ce.onerror=an(Ne)})},query:(ae=Z,oe=ue,function(se){return new Promise(function(ge,pe){ge=mt(ge);var ve,Ne,Ce,De,nt=se.trans,$e=se.values,Ue=se.limit,Ee=se.query,Re=(Re=se.direction)!=null?Re:"next",We=Ue===1/0?void 0:Ue,rt=Ee.index,Ee=Ee.range,nt=nt.objectStore(re),nt=rt.isPrimaryKey?nt:nt.index(rt.name),rt=v(Ee);if(Ue===0)return ge({result:[]});oe?(Ee={query:rt,count:We,direction:Re},(ve=$e?nt.getAll(Ee):nt.getAllKeys(Ee)).onsuccess=function(st){return ge({result:st.target.result})},ve.onerror=an(pe)):ae&&Re==="next"?((ve=$e?nt.getAll(rt,We):nt.getAllKeys(rt,We)).onsuccess=function(st){return ge({result:st.target.result})},ve.onerror=an(pe)):(Ne=0,Ce=!$e&&"openKeyCursor"in nt?nt.openKeyCursor(rt,Re):nt.openCursor(rt,Re),De=[],Ce.onsuccess=function(){var st=Ce.result;return!st||(De.push($e?st.value:st.primaryKey),++Ne===Ue)?ge({result:De}):void st.continue()},Ce.onerror=an(pe))})}),openCursor:function(se){var ge=se.trans,pe=se.values,ve=se.query,Ne=se.reverse,Ce=se.unique;return new Promise(function(De,$e){De=mt(De);var We=ve.index,Ue=ve.range,Re=ge.objectStore(re),Re=We.isPrimaryKey?Re:Re.index(We.name),We=Ne?Ce?"prevunique":"prev":Ce?"nextunique":"next",Ee=!pe&&"openKeyCursor"in Re?Re.openKeyCursor(v(Ue),We):Re.openCursor(v(Ue),We);Ee.onerror=an($e),Ee.onsuccess=mt(function(nt){var rt,st,ft,gn,it=Ee.result;it?(it.___id=++Ki,it.done=!1,rt=it.continue.bind(it),st=(st=it.continuePrimaryKey)&&st.bind(it),ft=it.advance.bind(it),gn=function(){throw new Error("Cursor not stopped")},it.trans=ge,it.stop=it.continue=it.continuePrimaryKey=it.advance=function(){throw new Error("Cursor not started")},it.fail=mt($e),it.next=function(){var Pt=this,qt=1;return this.start(function(){return qt--?Pt.continue():Pt.stop()}).then(function(){return Pt})},it.start=function(Pt){function qt(){if(Ee.result)try{Pt()}catch(ln){it.fail(ln)}else it.done=!0,it.start=function(){throw new Error("Cursor behind last entry")},it.stop()}var Xo=new Promise(function(ln,xo){ln=mt(ln),Ee.onerror=an(xo),it.fail=xo,it.stop=function(wo){it.stop=it.continue=it.continuePrimaryKey=it.advance=gn,ln(wo)}});return Ee.onsuccess=mt(function(ln){Ee.onsuccess=qt,qt()}),it.continue=rt,it.continuePrimaryKey=st,it.advance=ft,qt(),Xo},De(it)):De(null)},$e)})},count:function(se){var ge=se.query,pe=se.trans,ve=ge.index,Ne=ge.range;return new Promise(function(Ce,De){var $e=pe.objectStore(re),$e=ve.isPrimaryKey?$e:$e.index(ve.name),Ue=v(Ne),Ue=Ue?$e.count(Ue):$e.count();Ue.onsuccess=mt(function(Re){return Ce(Re.target.result)}),Ue.onerror=an(De)})}}}N=M,O=fo((M=a).objectStoreNames),te=0<O.length?N.objectStore(O[0]):{};var N,M={schema:{name:M.name,tables:O.map(function(ee){return N.objectStore(ee)}).map(function(ee){var ae=ee.keyPath,oe=ee.autoIncrement,se=h(ae),re={},se={name:ee.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:ae==null,compound:se,keyPath:ae,autoIncrement:oe,unique:!0,extractKey:co(ae)},indexes:fo(ee.indexNames).map(function(ge){return ee.index(ge)}).map(function(Ne){var Ce=Ne.name,pe=Ne.unique,ve=Ne.multiEntry,Ne=Ne.keyPath,Ce={name:Ce,compound:h(Ne),keyPath:Ne,unique:pe,multiEntry:ve,extractKey:co(Ne)};return re[mi(Ne)]=Ce}),getIndexByKeyPath:function(ge){return re[mi(ge)]}};return re[":id"]=se.primaryKey,ae!=null&&(re[mi(ae)]=se.primaryKey),se})},hasGetAll:0<O.length&&"getAll"in te&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604),hasIdb3Features:"getAllRecords"in te},O=M.schema,Z=M.hasGetAll,ue=M.hasIdb3Features,te=O.tables.map(_),J={};return te.forEach(function(ee){return J[ee.name]=ee}),{stack:"dbcore",transaction:a.transaction.bind(a),table:function(ee){if(J[ee])return J[ee];throw new Error("Table '".concat(ee,"' not found"))},MIN_KEY:-1/0,MAX_KEY:Nr(f),schema:O}}function zs(a,f,m,v){return m=m.IDBKeyRange,f=Ru(f,m,v),{dbcore:a.dbcore.reduce(function(_,N){return N=N.create,s(s({},_),N(_))},f)}}function po(a,f){var m=f.db,m=zs(a._middlewares,m,a._deps,f);a.core=m.dbcore,a.tables.forEach(function(v){var _=v.name;a.core.schema.tables.some(function(N){return N.name===_})&&(v.core=a.core.table(_),a[_]instanceof a.Table)&&(a[_].core=v.core)})}function Bo(a,f,m,v){m.forEach(function(_){var N=v[_];f.forEach(function(M){var O=(function Z(ue,te){return T(ue,te)||(ue=b(ue))&&Z(ue,te)})(M,_);(!O||"value"in O&&O.value===void 0)&&(M===a.Transaction.prototype||M instanceof a.Transaction?j(M,_,{get:function(){return this.table(_)},set:function(Z){C(this,_,{value:Z,writable:!0,configurable:!0,enumerable:!0})}}):M[_]=new a.Table(_,N))})})}function qi(a,f){f.forEach(function(m){for(var v in m)m[v]instanceof a.Table&&delete m[v]})}function qr(a,f){return a._cfg.version-f._cfg.version}function Fs(a,f,m,v){var _=a._dbSchema,N=(m.objectStoreNames.contains("$meta")&&!_.$meta&&(_.$meta=Ds("$meta",Xi("")[0],[]),a._storeNames.push("$meta")),a._createTransaction("readwrite",a._storeNames,_)),M=(N.create(m),N._completion.catch(v),N._reject.bind(N)),O=Ye.transless||Ye;V(function(){if(Ye.trans=N,Ye.transless=O,f!==0)return po(a,m),ue=f,((Z=N).storeNames.includes("$meta")?Z.table("$meta").get("version").then(function(te){return te??ue}):Be.resolve(ue)).then(function(se){var J=a,ee=se,ae=N,oe=m,re=[],se=J._versions,ge=J._dbSchema=en(0,J.idbdb,oe);return(se=se.filter(function(pe){return pe._cfg.version>=ee})).length===0?Be.resolve():(se.forEach(function(pe){re.push(function(){var ve,Ne,Ce,De=ge,$e=pe._cfg.dbschema,Ue=(Er(J,De,oe),Er(J,$e,oe),ge=J._dbSchema=$e,Yi(De,$e)),Re=(Ue.add.forEach(function(We){Ho(oe,We[0],We[1].primKey,We[1].indexes)}),Ue.change.forEach(function(We){if(We.recreate)throw new ke.Upgrade("Not yet support for changing primary key");var Ee=oe.objectStore(We.name);We.add.forEach(function(nt){return yi(Ee,nt)}),We.change.forEach(function(nt){Ee.deleteIndex(nt.name),yi(Ee,nt)}),We.del.forEach(function(nt){return Ee.deleteIndex(nt)})}),pe._cfg.contentUpgrade);if(Re&&pe._cfg.version>ee)return po(J,oe),ae._memoizedTables={},ve=ce($e),Ue.del.forEach(function(We){ve[We]=De[We]}),qi(J,[J.Transaction.prototype]),Bo(J,[J.Transaction.prototype],d(ve),ve),ae.schema=ve,(Ne=A(Re))&&Le(),$e=Be.follow(function(){var We;(Ce=Re(ae))&&Ne&&(We=Ve.bind(null,null),Ce.then(We,We))}),Ce&&typeof Ce.then=="function"?Be.resolve(Ce):$e.then(function(){return Ce})}),re.push(function(ve){var Ne,Ce,De=pe._cfg.dbschema;Ne=De,Ce=ve,[].slice.call(Ce.db.objectStoreNames).forEach(function($e){return Ne[$e]==null&&Ce.db.deleteObjectStore($e)}),qi(J,[J.Transaction.prototype]),Bo(J,[J.Transaction.prototype],J._storeNames,J._dbSchema),ae.schema=J._dbSchema}),re.push(function(ve){J.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(J.idbdb.version/10)===pe._cfg.version?(J.idbdb.deleteObjectStore("$meta"),delete J._dbSchema.$meta,J._storeNames=J._storeNames.filter(function(Ne){return Ne!=="$meta"})):ve.objectStore("$meta").put(pe._cfg.version,"version"))})}),(function pe(){return re.length?Be.resolve(re.shift()(ae.idbtrans)).then(pe):Be.resolve()})().then(function(){gi(ge,oe)}))}).catch(M);var Z,ue;d(_).forEach(function(te){Ho(m,te,_[te].primKey,_[te].indexes)}),po(a,m),Be.follow(function(){return a.on.populate.fire(N)}).catch(M)})}function Wi(a,f){gi(a._dbSchema,f),f.db.version%10!=0||f.objectStoreNames.contains("$meta")||f.db.createObjectStore("$meta").add(Math.ceil(f.db.version/10-1),"version");var m=en(0,a.idbdb,f);Er(a,a._dbSchema,f);for(var v=0,_=Yi(m,a._dbSchema).change;v<_.length;v++){var N=(M=>{if(M.change.length||M.recreate)return console.warn("Unable to patch indexes of table ".concat(M.name," because it has changes on the type of index or primary key.")),{value:void 0};var O=f.objectStore(M.name);M.add.forEach(function(Z){Et&&console.debug("Dexie upgrade patch: Creating missing index ".concat(M.name,".").concat(Z.src)),yi(O,Z)})})(_[v]);if(typeof N=="object")return N.value}}function Yi(a,f){var m,v={del:[],add:[],change:[]};for(m in a)f[m]||v.del.push(m);for(m in f){var _=a[m],N=f[m];if(_){var M={name:m,def:N,recreate:!1,del:[],add:[],change:[]};if(""+(_.primKey.keyPath||"")!=""+(N.primKey.keyPath||"")||_.primKey.auto!==N.primKey.auto)M.recreate=!0,v.change.push(M);else{var O=_.idxByName,Z=N.idxByName,ue=void 0;for(ue in O)Z[ue]||M.del.push(ue);for(ue in Z){var te=O[ue],J=Z[ue];te?te.src!==J.src&&M.change.push(J):M.add.push(J)}(0<M.del.length||0<M.add.length||0<M.change.length)&&v.change.push(M)}}else v.add.push([m,N])}return v}function Ho(a,f,m,v){var _=a.db.createObjectStore(f,m.keyPath?{keyPath:m.keyPath,autoIncrement:m.auto}:{autoIncrement:m.auto});v.forEach(function(N){return yi(_,N)})}function gi(a,f){d(a).forEach(function(m){f.db.objectStoreNames.contains(m)||(Et&&console.debug("Dexie: Creating missing table",m),Ho(f,m,a[m].primKey,a[m].indexes))})}function yi(a,f){a.createIndex(f.name,f.keyPath,{unique:f.unique,multiEntry:f.multi})}function en(a,f,m){var v={};return U(f.objectStoreNames,0).forEach(function(_){for(var N=m.objectStore(_),M=Fo(Ls(ue=N.keyPath),ue||"",!0,!1,!!N.autoIncrement,ue&&typeof ue!="string",!0),O=[],Z=0;Z<N.indexNames.length;++Z){var te=N.index(N.indexNames[Z]),ue=te.keyPath,te=Fo(te.name,ue,!!te.unique,!!te.multiEntry,!1,ue&&typeof ue!="string",!1);O.push(te)}v[_]=Ds(_,M,O)}),v}function Er(a,f,m){for(var v=m.db.objectStoreNames,_=0;_<v.length;++_){var N=v[_],M=m.objectStore(N);a._hasGetAll="getAll"in M;for(var O=0;O<M.indexNames.length;++O){var Z,ue=M.indexNames[O],te=M.index(ue).keyPath,te=typeof te=="string"?te:"["+U(te).join("+")+"]";f[N]&&(Z=f[N].idxByName[te])&&(Z.name=ue,delete f[N].idxByName[te],f[N].idxByName[ue]=Z)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&c.WorkerGlobalScope&&c instanceof c.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(a._hasGetAll=!1)}function Xi(a){return a.split(",").map(function(f,m){var _=f.split(":"),v=(v=_[1])==null?void 0:v.trim(),_=(f=_[0].trim()).replace(/([&*]|\+\+)/g,""),N=/^\[/.test(_)?_.match(/^\[(.*)\]$/)[1].split("+"):_;return Fo(_,N||null,/\&/.test(f),/\*/.test(f),/\+\+/.test(f),h(N),m===0,v)})}Vo.prototype._createTableSchema=Ds,Vo.prototype._parseIndexSyntax=Xi,Vo.prototype._parseStoresSpec=function(a,f){var m=this;d(a).forEach(function(v){if(a[v]!==null){var _=m._parseIndexSyntax(a[v]),N=_.shift();if(!N)throw new ke.Schema("Invalid schema for table "+v+": "+a[v]);if(N.unique=!0,N.multi)throw new ke.Schema("Primary key cannot be multiEntry*");_.forEach(function(M){if(M.auto)throw new ke.Schema("Only primary key can be marked as autoIncrement (++)");if(!M.keyPath)throw new ke.Schema("Index must have a name and cannot be an empty string")}),N=m._createTableSchema(v,N,_),f[v]=N}})},Vo.prototype.stores=function(m){var f=this.db,m=(this._cfg.storesSource=this._cfg.storesSource?y(this._cfg.storesSource,m):m,f._versions),v={},_={};return m.forEach(function(N){y(v,N._cfg.storesSource),_=N._cfg.dbschema={},N._parseStoresSpec(v,_)}),f._dbSchema=_,qi(f,[f._allTables,f,f.Transaction.prototype]),Bo(f,[f._allTables,f,f.Transaction.prototype,this._cfg.tables],d(_),_),f._storeNames=d(_),this},Vo.prototype.upgrade=function(a){return this._cfg.contentUpgrade=Vt(this._cfg.contentUpgrade||Oe,a),this};var vi=Vo;function Vo(){}var ho=(()=>{var a,f,m;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(a=new Set,f=new FinalizationRegistry(function(v){a.delete(v)}),{toArray:function(){return Array.from(a).map(function(v){return v.deref()}).filter(function(v){return v!==void 0})},add:function(v){var _=new WeakRef(v._novip);a.add(_),f.register(v._novip,_,_),a.size>v._options.maxConnections&&(_=a.values().next().value,a.delete(_),f.unregister(_))},remove:function(v){if(v)for(var _=a.values(),N=_.next();!N.done;){var M=N.value;if(M.deref()===v._novip)return a.delete(M),void f.unregister(M);N=_.next()}}}):(m=[],{toArray:function(){return m},add:function(v){m.push(v._novip)},remove:function(v){v&&(v=m.indexOf(v._novip))!==-1&&m.splice(v,1)}})})();function xi(a,f){var m=a._dbNamesDB;return m||(m=a._dbNamesDB=new jr(ar,{addons:[],indexedDB:a,IDBKeyRange:f})).version(1).stores({dbnames:"name"}),m.table("dbnames")}function mo(a){return a&&typeof a.databases=="function"}function Uo(a){return V(function(){return Ye.letThrough=!0,a()})}function Qi(a){return!("from"in a)}var tn=function(a,f){var m;if(!this)return m=new tn,a&&"d"in a&&y(m,a),m;y(this,arguments.length?{d:1,from:a,to:1<arguments.length?f:a}:{d:0})};function wi(a,f,m){var v=ct(f,m);if(!isNaN(v)){if(0<v)throw RangeError();if(Qi(a))return y(a,{from:f,to:m,d:1});var v=a.l,_=a.r;if(ct(m,a.from)<0)return v?wi(v,f,m):a.l={from:f,to:m,d:1,l:null,r:null},Ua(a);if(0<ct(f,a.to))return _?wi(_,f,m):a.r={from:f,to:m,d:1,l:null,r:null},Ua(a);ct(f,a.from)<0&&(a.from=f,a.l=null,a.d=_?_.d+1:1),0<ct(m,a.to)&&(a.to=m,a.r=null,a.d=a.l?a.l.d+1:1),f=!a.r,v&&!a.l&&bi(a,v),_&&f&&bi(a,_)}}function bi(a,f){Qi(f)||(function m(v,_){var N=_.from,M=_.l,O=_.r;wi(v,N,_.to),M&&m(v,M),O&&m(v,O)})(a,f)}function Gi(a,f){var m=Ji(f),v=m.next();if(!v.done)for(var _=v.value,N=Ji(a),M=N.next(_.from),O=M.value;!v.done&&!M.done;){if(ct(O.from,_.to)<=0&&0<=ct(O.to,_.from))return!0;ct(_.from,O.from)<0?_=(v=m.next(O.from)).value:O=(M=N.next(_.from)).value}return!1}function Ji(a){var f=Qi(a)?null:{s:0,n:a};return{next:function(m){for(var v=0<arguments.length;f;)switch(f.s){case 0:if(f.s=1,v)for(;f.n.l&&ct(m,f.n.from)<0;)f={up:f,n:f.n.l,s:1};else for(;f.n.l;)f={up:f,n:f.n.l,s:1};case 1:if(f.s=2,!v||ct(m,f.n.to)<=0)return{value:f.n,done:!1};case 2:if(f.n.r){f.s=3,f={up:f,n:f.n.r,s:0};continue}case 3:f=f.up}return{done:!0}}}}function Ua(a){var f,m,v,_=(((_=a.r)==null?void 0:_.d)||0)-(((_=a.l)==null?void 0:_.d)||0),_=1<_?"r":_<-1?"l":"";_&&(f=_=="r"?"l":"r",m=s({},a),v=a[_],a.from=v.from,a.to=v.to,a[_]=v[_],m[_]=v[f],(a[f]=m).d=Ka(m)),a.d=Ka(a)}function Ka(m){var f=m.r,m=m.l;return(f?m?Math.max(f.d,m.d):f.d:m?m.d:0)+1}function Zi(a,f){return d(f).forEach(function(m){a[m]?bi(a[m],f[m]):a[m]=(function v(_){var N,M,O={};for(N in _)x(_,N)&&(M=_[N],O[N]=!M||typeof M!="object"||q.has(M.constructor)?M:v(M));return O})(f[m])}),a}function Bs(a,f){return a.all||f.all||Object.keys(a).some(function(m){return f[m]&&Gi(f[m],a[m])})}S(tn.prototype,((St={add:function(a){return bi(this,a),this},addKey:function(a){return wi(this,a,a),this},addKeys:function(a){var f=this;return a.forEach(function(m){return wi(f,m,m)}),this},hasKey:function(a){var f=Ji(this).next(a).value;return f&&ct(f.from,a)<=0&&0<=ct(f.to,a)}})[G]=function(){return Ji(this)},St));var Wr={},Hs={},Vs=!1;function es(a){Zi(Hs,a),Vs||(Vs=!0,setTimeout(function(){Vs=!1,Us(Hs,!(Hs={}))},0))}function Us(a,f){f===void 0&&(f=!1);var m=new Set;if(a.all)for(var v=0,_=Object.values(Wr);v<_.length;v++)ts(O=_[v],a,m,f);else for(var N in a){var M,O,N=/^idb\:\/\/(.*)\/(.*)\//.exec(N);N&&(M=N[1],N=N[2],O=Wr["idb://".concat(M,"/").concat(N)])&&ts(O,a,m,f)}m.forEach(function(Z){return Z()})}function ts(a,f,m,v){for(var _=[],N=0,M=Object.entries(a.queries.query);N<M.length;N++){for(var O=M[N],Z=O[0],ue=[],te=0,J=O[1];te<J.length;te++){var ee=J[te];Bs(f,ee.obsSet)?ee.subscribers.forEach(function(se){return m.add(se)}):v&&ue.push(ee)}v&&_.push([Z,ue])}if(v)for(var ae=0,oe=_;ae<oe.length;ae++){var re=oe[ae],Z=re[0],ue=re[1];a.queries.query[Z]=ue}}function Lu(a){var f=a._state,m=a._deps.indexedDB;if(f.isBeingOpened||a.idbdb)return f.dbReadyPromise.then(function(){return f.dbOpenError?kt(f.dbOpenError):a});f.isBeingOpened=!0,f.dbOpenError=null,f.openComplete=!1;var v=f.openCanceller,_=Math.round(10*a.verno),N=!1;function M(){if(f.openCanceller!==v)throw new ke.DatabaseClosed("db.open() was cancelled")}function O(){return new Be(function(ee,ae){if(M(),!m)throw new ke.MissingAPI;var oe=a.name,re=f.autoSchema||!_?m.open(oe):m.open(oe,_);if(!re)throw new ke.MissingAPI;re.onerror=an(ae),re.onblocked=mt(a._fireOnBlocked),re.onupgradeneeded=mt(function(se){var ge;te=re.transaction,f.autoSchema&&!a._options.allowEmptyDB?(re.onerror=Rn,te.abort(),re.result.close(),(ge=m.deleteDatabase(oe)).onsuccess=ge.onerror=mt(function(){ae(new ke.NoSuchDatabase("Database ".concat(oe," doesnt exist")))})):(te.onerror=an(ae),ge=se.oldVersion>Math.pow(2,62)?0:se.oldVersion,J=ge<1,a.idbdb=re.result,N&&Wi(a,te),Fs(a,ge/10,te,ae))},ae),re.onsuccess=mt(function(){te=null;var se,ge,pe,ve,Ne,Ce,De=a.idbdb=re.result,$e=U(De.objectStoreNames);if(0<$e.length)try{var Ue=De.transaction((Ne=$e).length===1?Ne[0]:Ne,"readonly");if(f.autoSchema)Ce=De,ve=Ue,(pe=a).verno=Ce.version/10,ve=pe._dbSchema=en(0,Ce,ve),pe._storeNames=U(Ce.objectStoreNames,0),Bo(pe,[pe._allTables],d(ve),ve);else if(Er(a,a._dbSchema,Ue),ge=Ue,((ge=Yi(en(0,(se=a).idbdb,ge),se._dbSchema)).add.length||ge.change.some(function(Re){return Re.add.length||Re.change.length}))&&!N)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),De.close(),_=De.version+1,N=!0,ee(O());po(a,Ue)}catch{}ho.add(a),De.onversionchange=mt(function(Re){f.vcFired=!0,a.on("versionchange").fire(Re)}),De.onclose=mt(function(){a.close({disableAutoOpen:!1})}),J&&($e=a._deps,Ne=oe,mo(Ce=$e.indexedDB)||Ne===ar||xi(Ce,$e.IDBKeyRange).put({name:Ne}).catch(Oe)),ee()},ae)}).catch(function(ee){switch(ee==null?void 0:ee.name){case"UnknownError":if(0<f.PR1398_maxLoop)return f.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),O();break;case"VersionError":if(0<_)return _=0,O()}return Be.reject(ee)})}var Z,ue=f.dbReadyResolve,te=null,J=!1;return Be.race([v,(typeof navigator>"u"?Be.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(ee){function ae(){return indexedDB.databases().finally(ee)}Z=setInterval(ae,100),ae()}).finally(function(){return clearInterval(Z)}):Promise.resolve()).then(O)]).then(function(){return M(),f.onReadyBeingFired=[],Be.resolve(Uo(function(){return a.on.ready.fire(a.vip)})).then(function ee(){var ae;if(0<f.onReadyBeingFired.length)return ae=f.onReadyBeingFired.reduce(Vt,Oe),f.onReadyBeingFired=[],Be.resolve(Uo(function(){return ae(a.vip)})).then(ee)})}).finally(function(){f.openCanceller===v&&(f.onReadyBeingFired=null,f.isBeingOpened=!1)}).catch(function(ee){f.dbOpenError=ee;try{te&&te.abort()}catch{}return v===f.openCanceller&&a._close(),kt(ee)}).finally(function(){f.openComplete=!0,ue()}).then(function(){var ee;return J&&(ee={},a.tables.forEach(function(ae){ae.schema.indexes.forEach(function(oe){oe.name&&(ee["idb://".concat(a.name,"/").concat(ae.name,"/").concat(oe.name)]=new tn(-1/0,[[[]]]))}),ee["idb://".concat(a.name,"/").concat(ae.name,"/")]=ee["idb://".concat(a.name,"/").concat(ae.name,"/:dels")]=new tn(-1/0,[[[]]])}),Ln(hi).fire(ee),Us(ee,!0)),a})}function Ks(a){function f(N){return a.next(N)}var m=_(f),v=_(function(N){return a.throw(N)});function _(N){return function(O){var O=N(O),Z=O.value;return O.done?Z:Z&&typeof Z.then=="function"?Z.then(m,v):h(Z)?Promise.all(Z).then(m,v):m(Z)}}return _(f)()}function ns(a,f,m){for(var v=h(a)?a.slice():[a],_=0;_<m;++_)v.push(f);return v}var qa={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(a){return s(s({},a),{table:function(v){var m=a.table(v),v=m.schema,_={},N=[];function M(ee,ae,oe){var pe=mi(ee),re=_[pe]=_[pe]||[],se=ee==null?0:typeof ee=="string"?1:ee.length,ge=0<ae,pe=s(s({},oe),{name:ge?"".concat(pe,"(virtual-from:").concat(oe.name,")"):oe.name,lowLevelIndex:oe,isVirtual:ge,keyTail:ae,keyLength:se,extractKey:co(ee),unique:!ge&&oe.unique});return re.push(pe),pe.isPrimaryKey||N.push(pe),1<se&&M(se===2?ee[0]:ee.slice(0,se-1),ae+1,oe),re.sort(function(ve,Ne){return ve.keyTail-Ne.keyTail}),pe}var O=M(v.primaryKey.keyPath,0,v.primaryKey);_[":id"]=[O];for(var Z=0,ue=v.indexes;Z<ue.length;Z++){var te=ue[Z];M(te.keyPath,0,te)}function J(ee){var ae,oe=ee.query.index;return oe.isVirtual?s(s({},ee),{query:{index:oe.lowLevelIndex,range:(ae=ee.query.range,oe=oe.keyTail,{type:ae.type===1?2:ae.type,lower:ns(ae.lower,ae.lowerOpen?a.MAX_KEY:a.MIN_KEY,oe),lowerOpen:!0,upper:ns(ae.upper,ae.upperOpen?a.MIN_KEY:a.MAX_KEY,oe),upperOpen:!0})}}):ee}return s(s({},m),{schema:s(s({},v),{primaryKey:O,indexes:N,getIndexByKeyPath:function(ee){return(ee=_[mi(ee)])&&ee[0]}}),count:function(ee){return m.count(J(ee))},query:function(ee){return m.query(J(ee))},openCursor:function(ee){var ae=ee.query.index,oe=ae.keyTail,re=ae.keyLength;return ae.isVirtual?m.openCursor(J(ee)).then(function(ge){return ge&&se(ge)}):m.openCursor(ee);function se(ge){return Object.create(ge,{continue:{value:function(pe){pe!=null?ge.continue(ns(pe,ee.reverse?a.MAX_KEY:a.MIN_KEY,oe)):ee.unique?ge.continue(ge.key.slice(0,re).concat(ee.reverse?a.MIN_KEY:a.MAX_KEY,oe)):ge.continue()}},continuePrimaryKey:{value:function(pe,ve){ge.continuePrimaryKey(ns(pe,a.MAX_KEY,oe),ve)}},primaryKey:{get:function(){return ge.primaryKey}},key:{get:function(){var pe=ge.key;return re===1?pe[0]:pe.slice(0,re)}},value:{get:function(){return ge.value}}})}}})}})}};function qs(a,f,m,v){return m=m||{},v=v||"",d(a).forEach(function(_){var N,M,O;x(f,_)?(N=a[_],M=f[_],typeof N=="object"&&typeof M=="object"&&N&&M?(O=le(N))!==le(M)?m[v+_]=f[_]:O==="Object"?qs(N,M,m,v+_+"."):N!==M&&(m[v+_]=f[_]):N!==M&&(m[v+_]=f[_])):m[v+_]=void 0}),d(f).forEach(function(_){x(a,_)||(m[v+_]=f[_])}),m}function Ws(a,f){return f.type==="delete"?f.keys:f.keys||f.values.map(a.extractKey)}var Du={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(a){return s(s({},a),{table:function(f){var m=a.table(f),v=m.schema.primaryKey;return s(s({},m),{mutate:function(_){var N=Ye.trans,M=N.table(f).hook,O=M.deleting,Z=M.creating,ue=M.updating;switch(_.type){case"add":if(Z.fire===Oe)break;return N._promise("readwrite",function(){return te(_)},!0);case"put":if(Z.fire===Oe&&ue.fire===Oe)break;return N._promise("readwrite",function(){return te(_)},!0);case"delete":if(O.fire===Oe)break;return N._promise("readwrite",function(){return te(_)},!0);case"deleteRange":if(O.fire===Oe)break;return N._promise("readwrite",function(){return(function J(ee,ae,oe){return m.query({trans:ee,values:!1,query:{index:v,range:ae},limit:oe}).then(function(re){var se=re.result;return te({type:"delete",keys:se,trans:ee}).then(function(ge){return 0<ge.numFailures?Promise.reject(ge.failures[0]):se.length<oe?{failures:[],numFailures:0,lastResult:void 0}:J(ee,s(s({},ae),{lower:se[se.length-1],lowerOpen:!0}),oe)})})})(_.trans,_.range,1e4)},!0)}return m.mutate(_);function te(J){var ee,ae,oe,re=Ye.trans,se=J.keys||Ws(v,J);if(se)return(J=J.type==="add"||J.type==="put"?s(s({},J),{keys:se}):s({},J)).type!=="delete"&&(J.values=l([],J.values)),J.keys&&(J.keys=l([],J.keys)),ee=m,oe=se,((ae=J).type==="add"?Promise.resolve([]):ee.getMany({trans:ae.trans,keys:oe,cache:"immutable"})).then(function(ge){var pe=se.map(function(ve,Ne){var Ce,De,$e,Ue=ge[Ne],Re={onerror:null,onsuccess:null};return J.type==="delete"?O.fire.call(Re,ve,Ue,re):J.type==="add"||Ue===void 0?(Ce=Z.fire.call(Re,ve,J.values[Ne],re),ve==null&&Ce!=null&&(J.keys[Ne]=ve=Ce,v.outbound||Q(J.values[Ne],v.keyPath,ve))):(Ce=qs(Ue,J.values[Ne]),(De=ue.fire.call(Re,Ce,ve,Ue,re))&&($e=J.values[Ne],Object.keys(De).forEach(function(We){x($e,We)?$e[We]=De[We]:Q($e,We,De[We])}))),Re});return m.mutate(J).then(function(ve){for(var Ne=ve.failures,Ce=ve.results,De=ve.numFailures,ve=ve.lastResult,$e=0;$e<se.length;++$e){var Ue=(Ce||se)[$e],Re=pe[$e];Ue==null?Re.onerror&&Re.onerror(Ne[$e]):Re.onsuccess&&Re.onsuccess(J.type==="put"&&ge[$e]?J.values[$e]:Ue)}return{failures:Ne,results:Ce,numFailures:De,lastResult:ve}}).catch(function(ve){return pe.forEach(function(Ne){return Ne.onerror&&Ne.onerror(ve)}),Promise.reject(ve)})});throw new Error("Keys missing")}}})}})}};function Wa(a,f,m){try{if(!f||f.keys.length<a.length)return null;for(var v=[],_=0,N=0;_<f.keys.length&&N<a.length;++_)ct(f.keys[_],a[N])===0&&(v.push(m?xe(f.values[_]):f.values[_]),++N);return v.length===a.length?v:null}catch{return null}}var zu={stack:"dbcore",level:-1,create:function(a){return{table:function(f){var m=a.table(f);return s(s({},m),{getMany:function(v){var _;return v.cache?(_=Wa(v.keys,v.trans._cache,v.cache==="clone"))?Be.resolve(_):m.getMany(v).then(function(N){return v.trans._cache={keys:v.keys,values:v.cache==="clone"?xe(N):N},N}):m.getMany(v)},mutate:function(v){return v.type!=="add"&&(v.trans._cache=null),m.mutate(v)}})}}}};function Ya(a,f){return a.trans.mode==="readonly"&&!!a.subscr&&!a.trans.explicit&&a.trans.db._options.cache!=="disabled"&&!f.schema.primaryKey.outbound}function Xa(a,f){switch(a){case"query":return f.values&&!f.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Ys={stack:"dbcore",level:0,name:"Observability",create:function(a){var f=a.schema.name,m=new tn(a.MIN_KEY,a.MAX_KEY);return s(s({},a),{transaction:function(v,_,N){if(Ye.subscr&&_!=="readonly")throw new ke.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Ye.querier));return a.transaction(v,_,N)},table:function(v){function _(se){var re,se=se.query;return[re=se.index,new tn((re=(se=se.range).lower)!=null?re:a.MIN_KEY,(re=se.upper)!=null?re:a.MAX_KEY)]}var N=a.table(v),M=N.schema,O=M.primaryKey,Z=M.indexes,ue=O.extractKey,te=O.outbound,J=O.autoIncrement&&Z.filter(function(oe){return oe.compound&&oe.keyPath.includes(O.keyPath)}),ee=s(s({},N),{mutate:function(oe){function re(Ee){return Ee="idb://".concat(f,"/").concat(v,"/").concat(Ee),Ne[Ee]||(Ne[Ee]=new tn)}var se,ge,pe,ve=oe.trans,Ne=oe.mutatedParts||(oe.mutatedParts={}),Ce=re(""),De=re(":dels"),$e=oe.type,Re=oe.type==="deleteRange"?[oe.range]:oe.type==="delete"?[oe.keys]:oe.values.length<50?[Ws(O,oe).filter(function(Ee){return Ee}),oe.values]:[],Ue=Re[0],Re=Re[1],We=oe.trans._cache;return h(Ue)?(Ce.addKeys(Ue),($e=$e==="delete"||Ue.length===Re.length?Wa(Ue,We):null)||De.addKeys(Ue),($e||Re)&&(se=re,ge=$e,pe=Re,M.indexes.forEach(function(Ee){var nt=se(Ee.name||"");function rt(ft){return ft!=null?Ee.extractKey(ft):null}function st(ft){Ee.multiEntry&&h(ft)?ft.forEach(function(gn){return nt.addKey(gn)}):nt.addKey(ft)}(ge||pe).forEach(function(ft,Pt){var it=ge&&rt(ge[Pt]),Pt=pe&&rt(pe[Pt]);ct(it,Pt)!==0&&(it!=null&&st(it),Pt!=null)&&st(Pt)})}))):Ue?(Re={from:(We=Ue.lower)!=null?We:a.MIN_KEY,to:($e=Ue.upper)!=null?$e:a.MAX_KEY},De.add(Re),Ce.add(Re)):(Ce.add(m),De.add(m),M.indexes.forEach(function(Ee){return re(Ee.name).add(m)})),N.mutate(oe).then(function(Ee){return!Ue||oe.type!=="add"&&oe.type!=="put"||(Ce.addKeys(Ee.results),J&&J.forEach(function(nt){for(var rt=oe.values.map(function(it){return nt.extractKey(it)}),st=nt.keyPath.findIndex(function(it){return it===O.keyPath}),ft=0,gn=Ee.results.length;ft<gn;++ft)rt[ft][st]=Ee.results[ft];re(nt.name).addKeys(rt)})),ve.mutatedParts=Zi(ve.mutatedParts||{},Ne),Ee})}}),ae={get:function(oe){return[O,new tn(oe.key)]},getMany:function(oe){return[O,new tn().addKeys(oe.keys)]},count:_,query:_,openCursor:_};return d(ae).forEach(function(oe){ee[oe]=function(re){var se=Ye.subscr,ge=!!se,pe=Ya(Ye,N)&&Xa(oe,re)?re.obsSet={}:se;if(ge){var ve,se=function(Re){return Re="idb://".concat(f,"/").concat(v,"/").concat(Re),pe[Re]||(pe[Re]=new tn)},Ne=se(""),Ce=se(":dels"),ge=ae[oe](re),De=ge[0],ge=ge[1];if((oe==="query"&&De.isPrimaryKey&&!re.values?Ce:se(De.name||"")).add(ge),!De.isPrimaryKey){if(oe!=="count")return ve=oe==="query"&&te&&re.values&&N.query(s(s({},re),{values:!1})),N[oe].apply(this,arguments).then(function(Re){if(oe==="query"){if(te&&re.values)return ve.then(function(rt){return rt=rt.result,Ne.addKeys(rt),Re});var We=re.values?Re.result.map(ue):Re.result;(re.values?Ne:Ce).addKeys(We)}else{var Ee,nt;if(oe==="openCursor")return nt=re.values,(Ee=Re)&&Object.create(Ee,{key:{get:function(){return Ce.addKey(Ee.primaryKey),Ee.key}},primaryKey:{get:function(){var rt=Ee.primaryKey;return Ce.addKey(rt),rt}},value:{get:function(){return nt&&Ne.addKey(Ee.primaryKey),Ee.value}}})}return Re});Ce.add(m)}}return N[oe].apply(this,arguments)}}),ee}})}};function Ko(a,f,m){var v;return m.numFailures===0?f:f.type==="deleteRange"||(v=f.keys?f.keys.length:"values"in f&&f.values?f.values.length:1,m.numFailures===v)?null:(v=s({},f),h(v.keys)&&(v.keys=v.keys.filter(function(_,N){return!(N in m.failures)})),"values"in v&&h(v.values)&&(v.values=v.values.filter(function(_,N){return!(N in m.failures)})),v)}function Xs(a,f){return m=a,((v=f).lower===void 0||(v.lowerOpen?0<ct(m,v.lower):0<=ct(m,v.lower)))&&(m=a,(v=f).upper===void 0||(v.upperOpen?ct(m,v.upper)<0:ct(m,v.upper)<=0));var m,v}function Qs(a,f,m,v,_,N){var M,O,Z,ue,te,J,ee;return!m||m.length===0||(M=f.query.index,O=M.multiEntry,Z=f.query.range,ue=v.schema.primaryKey.extractKey,te=M.extractKey,J=(M.lowLevelIndex||M).extractKey,(v=m.reduce(function(ae,oe){var re=ae,se=[];if(oe.type==="add"||oe.type==="put")for(var ge=new tn,pe=oe.values.length-1;0<=pe;--pe){var ve,Ne=oe.values[pe],Ce=ue(Ne);!ge.hasKey(Ce)&&(ve=te(Ne),O&&h(ve)?ve.some(function(We){return Xs(We,Z)}):Xs(ve,Z))&&(ge.addKey(Ce),se.push(Ne))}switch(oe.type){case"add":var De=new tn().addKeys(f.values?ae.map(function(Ee){return ue(Ee)}):ae),re=ae.concat(f.values?se.filter(function(Ee){return Ee=ue(Ee),!De.hasKey(Ee)&&(De.addKey(Ee),!0)}):se.map(function(Ee){return ue(Ee)}).filter(function(Ee){return!De.hasKey(Ee)&&(De.addKey(Ee),!0)}));break;case"put":var $e=new tn().addKeys(oe.values.map(function(Ee){return ue(Ee)}));re=ae.filter(function(Ee){return!$e.hasKey(f.values?ue(Ee):Ee)}).concat(f.values?se:se.map(function(Ee){return ue(Ee)}));break;case"delete":var Ue=new tn().addKeys(oe.keys);re=ae.filter(function(Ee){return!Ue.hasKey(f.values?ue(Ee):Ee)});break;case"deleteRange":var Re=oe.range;re=ae.filter(function(Ee){return!Xs(ue(Ee),Re)})}return re},a))===a)?a:(ee=function(ae,oe){return ct(J(ae),J(oe))||ct(ue(ae),ue(oe))},v.sort(f.direction==="prev"||f.direction==="prevunique"?function(ae,oe){return ee(oe,ae)}:ee),f.limit&&f.limit<1/0&&(v.length>f.limit?v.length=f.limit:a.length===f.limit&&v.length<f.limit&&(_.dirty=!0)),N?Object.freeze(v):v)}function Gs(a,f){return ct(a.lower,f.lower)===0&&ct(a.upper,f.upper)===0&&!!a.lowerOpen==!!f.lowerOpen&&!!a.upperOpen==!!f.upperOpen}function Qa(a,f){return((m,v,_,N)=>{if(m===void 0)return v!==void 0?-1:0;if(v===void 0)return 1;if((m=ct(m,v))===0){if(_&&N)return 0;if(_)return 1;if(N)return-1}return m})(a.lower,f.lower,a.lowerOpen,f.lowerOpen)<=0&&0<=((m,v,_,N)=>{if(m===void 0)return v!==void 0?1:0;if(v===void 0)return-1;if((m=ct(m,v))===0){if(_&&N)return 0;if(_)return-1;if(N)return 1}return m})(a.upper,f.upper,a.upperOpen,f.upperOpen)}function Ga(a,f,m,v){a.subscribers.add(m),v.addEventListener("abort",function(){var _,N;a.subscribers.delete(m),a.subscribers.size===0&&(_=a,N=f,setTimeout(function(){_.subscribers.size===0&&z(N,_)},3e3))})}var Ja={stack:"dbcore",level:0,name:"Cache",create:function(a){var f=a.schema.name;return s(s({},a),{transaction:function(m,v,_){var N,M,O=a.transaction(m,v,_);return v==="readwrite"&&(_=(N=new AbortController).signal,O.addEventListener("abort",(M=function(Z){return function(){if(N.abort(),v==="readwrite"){for(var ue=new Set,te=0,J=m;te<J.length;te++){var ee=J[te],ae=Wr["idb://".concat(f,"/").concat(ee)];if(ae){var oe=a.table(ee),re=ae.optimisticOps.filter(function(Ee){return Ee.trans===O});if(O._explicit&&Z&&O.mutatedParts)for(var se=0,ge=Object.values(ae.queries.query);se<ge.length;se++)for(var pe=0,ve=(De=ge[se]).slice();pe<ve.length;pe++)Bs(($e=ve[pe]).obsSet,O.mutatedParts)&&(z(De,$e),$e.subscribers.forEach(function(Ee){return ue.add(Ee)}));else if(0<re.length){ae.optimisticOps=ae.optimisticOps.filter(function(Ee){return Ee.trans!==O});for(var Ne=0,Ce=Object.values(ae.queries.query);Ne<Ce.length;Ne++)for(var De,$e,Ue,Re=0,We=(De=Ce[Ne]).slice();Re<We.length;Re++)($e=We[Re]).res!=null&&O.mutatedParts&&(Z&&!$e.dirty?(Ue=Object.isFrozen($e.res),Ue=Qs($e.res,$e.req,re,oe,$e,Ue),$e.dirty?(z(De,$e),$e.subscribers.forEach(function(Ee){return ue.add(Ee)})):Ue!==$e.res&&($e.res=Ue,$e.promise=Be.resolve({result:Ue}))):($e.dirty&&z(De,$e),$e.subscribers.forEach(function(Ee){return ue.add(Ee)})))}}}ue.forEach(function(Ee){return Ee()})}}})(!1),{signal:_}),O.addEventListener("error",M(!1),{signal:_}),O.addEventListener("complete",M(!0),{signal:_})),O},table:function(m){var v=a.table(m),_=v.schema.primaryKey;return s(s({},v),{mutate:function(N){var M,O=Ye.trans;return!_.outbound&&O.db._options.cache!=="disabled"&&!O.explicit&&O.idbtrans.mode==="readwrite"&&(M=Wr["idb://".concat(f,"/").concat(m)])?(O=v.mutate(N),N.type!=="add"&&N.type!=="put"||!(50<=N.values.length||Ws(_,N).some(function(Z){return Z==null}))?(M.optimisticOps.push(N),N.mutatedParts&&es(N.mutatedParts),O.then(function(Z){0<Z.numFailures&&(z(M.optimisticOps,N),(Z=Ko(0,N,Z))&&M.optimisticOps.push(Z),N.mutatedParts)&&es(N.mutatedParts)}),O.catch(function(){z(M.optimisticOps,N),N.mutatedParts&&es(N.mutatedParts)})):O.then(function(Z){var ue=Ko(0,s(s({},N),{values:N.values.map(function(te,J){var ee;return Z.failures[J]?te:(Q(ee=(ee=_.keyPath)!=null&&ee.includes(".")?xe(te):s({},te),_.keyPath,Z.results[J]),ee)})}),Z);M.optimisticOps.push(ue),queueMicrotask(function(){return N.mutatedParts&&es(N.mutatedParts)})}),O):v.mutate(N)},query:function(N){var M,O,Z,ue,te,J,ee;return Ya(Ye,v)&&Xa("query",N)?(M=((Z=Ye.trans)==null?void 0:Z.db._options.cache)==="immutable",O=(Z=Ye).requery,Z=Z.signal,J=((ae,oe,re,se)=>{var ge=Wr["idb://".concat(ae,"/").concat(oe)];if(!ge)return[];if(!(ae=ge.queries[re]))return[null,!1,ge,null];var pe=ae[(se.query?se.query.index.name:null)||""];if(!pe)return[null,!1,ge,null];switch(re){case"query":var ve=(Ne=se.direction)!=null?Ne:"next",Ne=pe.find(function(Ce){var De;return Ce.req.limit===se.limit&&Ce.req.values===se.values&&((De=Ce.req.direction)!=null?De:"next")===ve&&Gs(Ce.req.query.range,se.query.range)});return Ne?[Ne,!0,ge,pe]:[pe.find(function(Ce){var De;return("limit"in Ce.req?Ce.req.limit:1/0)>=se.limit&&((De=Ce.req.direction)!=null?De:"next")===ve&&(!se.values||Ce.req.values)&&Qa(Ce.req.query.range,se.query.range)}),!1,ge,pe];case"count":return Ne=pe.find(function(Ce){return Gs(Ce.req.query.range,se.query.range)}),[Ne,!!Ne,ge,pe]}})(f,m,"query",N),ee=J[0],ue=J[2],te=J[3],ee&&J[1]?ee.obsSet=N.obsSet:(J=v.query(N).then(function(ae){var oe=ae.result;if(ee&&(ee.res=oe),M){for(var re=0,se=oe.length;re<se;++re)Object.freeze(oe[re]);Object.freeze(oe)}else ae.result=xe(oe);return ae}).catch(function(ae){return te&&ee&&z(te,ee),Promise.reject(ae)}),ee={obsSet:N.obsSet,promise:J,subscribers:new Set,type:"query",req:N,dirty:!1},te?te.push(ee):(te=[ee],(ue=ue||(Wr["idb://".concat(f,"/").concat(m)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[N.query.index.name||""]=te)),Ga(ee,te,O,Z),ee.promise.then(function(ae){return{result:Qs(ae.result,N,ue==null?void 0:ue.optimisticOps,v,ee,M)}})):v.query(N)}})}})}};function Cr(a,f){return new Proxy(a,{get:function(m,v,_){return v==="db"?f:Reflect.get(m,v,_)}})}Dt.prototype.version=function(a){if(isNaN(a)||a<.1)throw new ke.Type("Given version is not a positive number");if(a=Math.round(10*a)/10,this.idbdb||this._state.isBeingOpened)throw new ke.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,a);var f=this._versions,m=f.filter(function(v){return v._cfg.version===a})[0];return m||(m=new this.Version(a),f.push(m),f.sort(qr),m.stores({}),this._state.autoSchema=!1),m},Dt.prototype._whenReady=function(a){var f=this;return this.idbdb&&(this._state.openComplete||Ye.letThrough||this._vip)?a():new Be(function(m,v){if(f._state.openComplete)return v(new ke.DatabaseClosed(f._state.dbOpenError));if(!f._state.isBeingOpened){if(!f._state.autoOpen)return void v(new ke.DatabaseClosed);f.open().catch(Oe)}f._state.dbReadyPromise.then(m,v)}).then(a)},Dt.prototype.use=function(_){var f=_.stack,m=_.create,v=_.level,_=_.name,N=(_&&this.unuse({stack:f,name:_}),this._middlewares[f]||(this._middlewares[f]=[]));return N.push({stack:f,create:m,level:v??10,name:_}),N.sort(function(M,O){return M.level-O.level}),this},Dt.prototype.unuse=function(a){var f=a.stack,m=a.name,v=a.create;return f&&this._middlewares[f]&&(this._middlewares[f]=this._middlewares[f].filter(function(_){return v?_.create!==v:!!m&&_.name!==m})),this},Dt.prototype.open=function(){var a=this;return Qt(kn,function(){return Lu(a)})},Dt.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var a=this._state;if(ho.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}a.isBeingOpened||(a.dbReadyPromise=new Be(function(f){a.dbReadyResolve=f}),a.openCanceller=new Be(function(f,m){a.cancelOpen=m}))},Dt.prototype.close=function(f){var f=(f===void 0?{disableAutoOpen:!0}:f).disableAutoOpen,m=this._state;f?(m.isBeingOpened&&m.cancelOpen(new ke.DatabaseClosed),this._close(),m.autoOpen=!1,m.dbOpenError=new ke.DatabaseClosed):(this._close(),m.autoOpen=this._options.autoOpen||m.isBeingOpened,m.openComplete=!1,m.dbOpenError=null)},Dt.prototype.delete=function(a){var f=this,m=(a===void 0&&(a={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),v=this._state;return new Be(function(_,N){function M(){f.close(a);var O=f._deps.indexedDB.deleteDatabase(f.name);O.onsuccess=mt(function(){var Z,ue,te;Z=f._deps,ue=f.name,mo(te=Z.indexedDB)||ue===ar||xi(te,Z.IDBKeyRange).delete(ue).catch(Oe),_()}),O.onerror=an(N),O.onblocked=f._fireOnBlocked}if(m)throw new ke.InvalidArgument("Invalid closeOptions argument to db.delete()");v.isBeingOpened?v.dbReadyPromise.then(M):M()})},Dt.prototype.backendDB=function(){return this.idbdb},Dt.prototype.isOpen=function(){return this.idbdb!==null},Dt.prototype.hasBeenClosed=function(){var a=this._state.dbOpenError;return a&&a.name==="DatabaseClosed"},Dt.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Dt.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Dt.prototype,"tables",{get:function(){var a=this;return d(this._allTables).map(function(f){return a._allTables[f]})},enumerable:!1,configurable:!0}),Dt.prototype.transaction=function(){var a=(function(f,m,v){var _=arguments.length;if(_<2)throw new ke.InvalidArgument("Too few arguments");for(var N=new Array(_-1);--_;)N[_-1]=arguments[_];return v=N.pop(),[f,we(N),v]}).apply(this,arguments);return this._transaction.apply(this,a)},Dt.prototype._transaction=function(a,f,m){var v,_,N=this,M=Ye.trans,O=(M&&M.db===this&&a.indexOf("!")===-1||(M=null),a.indexOf("?")!==-1);a=a.replace("!","").replace("?","");try{if(_=f.map(function(ue){if(ue=ue instanceof N.Table?ue.name:ue,typeof ue!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return ue}),a=="r"||a===Lo)v=Lo;else{if(a!="rw"&&a!=Hr)throw new ke.InvalidArgument("Invalid transaction mode: "+a);v=Hr}if(M){if(M.mode===Lo&&v===Hr){if(!O)throw new ke.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");M=null}M&&_.forEach(function(ue){if(M&&M.storeNames.indexOf(ue)===-1){if(!O)throw new ke.SubTransaction("Table "+ue+" not included in parent transaction.");M=null}}),O&&M&&!M.active&&(M=null)}}catch(ue){return M?M._promise(null,function(te,J){J(ue)}):kt(ue)}var Z=(function ue(te,J,ee,ae,oe){return Be.resolve().then(function(){var pe=Ye.transless||Ye,re=te._createTransaction(J,ee,te._dbSchema,ae),pe=(re.explicit=!0,{trans:re,transless:pe});if(ae)re.idbtrans=ae.idbtrans;else try{re.create(),re.idbtrans._explicit=!0,te._state.PR1398_maxLoop=3}catch(ve){return ve.name===_e.InvalidState&&te.isOpen()&&0<--te._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),te.close({disableAutoOpen:!1}),te.open().then(function(){return ue(te,J,ee,null,oe)})):kt(ve)}var se,ge=A(oe),pe=(ge&&Le(),Be.follow(function(){var ve;(se=oe.call(re,re))&&(ge?(ve=Ve.bind(null,null),se.then(ve,ve)):typeof se.next=="function"&&typeof se.throw=="function"&&(se=Ks(se)))},pe));return(se&&typeof se.then=="function"?Be.resolve(se).then(function(ve){return re.active?ve:kt(new ke.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):pe.then(function(){return se})).then(function(ve){return ae&&re._resolve(),re._completion.then(function(){return ve})}).catch(function(ve){return re._reject(ve),kt(ve)})})}).bind(null,this,v,_,M,m);return M?M._promise(v,Z,"lock"):Ye.trans?Qt(Ye.transless,function(){return N._whenReady(Z)}):this._whenReady(Z)},Dt.prototype.table=function(a){if(x(this._allTables,a))return this._allTables[a];throw new ke.InvalidTable("Table ".concat(a," does not exist"))};var jr=Dt;function Dt(a,f){var m,v,_,N,M,O=this,Z=(this._middlewares={},this.verno=0,Dt.dependencies),Z=(this._options=f=s({addons:Dt.addons,autoOpen:!0,indexedDB:Z.indexedDB,IDBKeyRange:Z.IDBKeyRange,cache:"cloned",maxConnections:1e3},f),this._deps={indexedDB:f.indexedDB,IDBKeyRange:f.IDBKeyRange},f.addons),ue=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Oe,dbReadyPromise:null,cancelOpen:Oe,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:f.autoOpen}),te=(ue.dbReadyPromise=new Be(function(J){ue.dbReadyResolve=J}),ue.openCanceller=new Be(function(J,ee){ue.cancelOpen=ee}),this._state=ue,this.name=a,this.on=Vr(this,"populate","blocked","versionchange","close",{ready:[Vt,Oe]}),this.once=function(J,ee){var ae=function(){for(var oe=[],re=0;re<arguments.length;re++)oe[re]=arguments[re];O.on(J).unsubscribe(ae),ee.apply(O,oe)};return O.on(J,ae)},this.on.ready.subscribe=P(this.on.ready.subscribe,function(J){return function(ee,ae){Dt.vip(function(){var oe,re=O._state;re.openComplete?(re.dbOpenError||Be.resolve().then(ee),ae&&J(ee)):re.onReadyBeingFired?(re.onReadyBeingFired.push(ee),ae&&J(ee)):(J(ee),oe=O,ae||J(function se(){oe.on.ready.unsubscribe(ee),oe.on.ready.unsubscribe(se)}))})}}),this.Collection=(m=this,ao(Ba.prototype,function(se,re){this.db=m;var ae=di,oe=null;if(re)try{ae=re()}catch(pe){oe=pe}var re=se._ctx,se=re.table,ge=se.hook.reading.fire;this._ctx={table:se,index:re.index,isPrimKey:!re.index||se.schema.primKey.keyPath&&re.index===se.schema.primKey.name,range:ae,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:oe,or:re.or,valueMapper:ge!==Ke?ge:null}})),this.Table=(v=this,ao(Jn.prototype,function(J,ee,ae){this.db=v,this._tx=ae,this.name=J,this.schema=ee,this.hook=v._allTables[J]?v._allTables[J].hook:Vr(null,{creating:[at,Oe],reading:[lt,Ke],updating:[Xt,Oe],deleting:[Nt,Oe]})})),this.Transaction=(_=this,ao(Ou.prototype,function(J,ee,ae,oe,re){var se=this;J!=="readonly"&&ee.forEach(function(ge){ge=(ge=ae[ge])==null?void 0:ge.yProps,ge&&(ee=ee.concat(ge.map(function(pe){return pe.updatesTable})))}),this.db=_,this.mode=J,this.storeNames=ee,this.schema=ae,this.chromeTransactionDurability=oe,this.idbtrans=null,this.on=Vr(this,"complete","error","abort"),this.parent=re||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 Be(function(ge,pe){se._resolve=ge,se._reject=pe}),this._completion.then(function(){se.active=!1,se.on.complete.fire()},function(ge){var pe=se.active;return se.active=!1,se.on.error.fire(ge),se.parent?se.parent._reject(ge):pe&&se.idbtrans&&se.idbtrans.abort(),kt(ge)})})),this.Version=(N=this,ao(vi.prototype,function(J){this.db=N,this._cfg={version:J,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(M=this,ao(kr.prototype,function(J,ee,ae){if(this.db=M,this._ctx={table:J,index:ee===":id"?null:ee,or:ae},this._cmp=this._ascending=ct,this._descending=function(oe,re){return ct(re,oe)},this._max=function(oe,re){return 0<ct(oe,re)?oe:re},this._min=function(oe,re){return ct(oe,re)<0?oe:re},this._IDBKeyRange=M._deps.IDBKeyRange,!this._IDBKeyRange)throw new ke.MissingAPI})),this.on("versionchange",function(J){0<J.newVersion?console.warn("Another connection wants to upgrade database '".concat(O.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(O.name,"'. Closing db now to resume the delete request.")),O.close({disableAutoOpen:!1})}),this.on("blocked",function(J){!J.newVersion||J.newVersion<J.oldVersion?console.warn("Dexie.delete('".concat(O.name,"') was blocked")):console.warn("Upgrade '".concat(O.name,"' blocked by other connection holding version ").concat(J.oldVersion/10))}),this._maxKey=Nr(f.IDBKeyRange),this._createTransaction=function(J,ee,ae,oe){return new O.Transaction(J,ee,ae,O._options.chromeTransactionDurability,oe)},this._fireOnBlocked=function(J){O.on("blocked").fire(J),ho.toArray().filter(function(ee){return ee.name===O.name&&ee!==O&&!ee._state.vcFired}).map(function(ee){return ee.on("versionchange").fire(J)})},this.use(zu),this.use(Ja),this.use(Ys),this.use(qa),this.use(Du),new Proxy(this,{get:function(J,ee,ae){var oe;return ee==="_vip"||(ee==="table"?function(re){return Cr(O.table(re),te)}:(oe=Reflect.get(J,ee,ae))instanceof Jn?Cr(oe,te):ee==="tables"?oe.map(function(re){return Cr(re,te)}):ee==="_createTransaction"?function(){return Cr(oe.apply(this,arguments),te)}:oe)}}));this.vip=te,Z.forEach(function(J){return J(O)})}var rs,go=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Za=(yo.prototype.subscribe=function(a,f,m){return this._subscribe(a&&typeof a!="function"?a:{next:a,error:f,complete:m})},yo.prototype[go]=function(){return this},yo);function yo(a){this._subscribe=a}try{rs={indexedDB:c.indexedDB||c.mozIndexedDB||c.webkitIndexedDB||c.msIndexedDB,IDBKeyRange:c.IDBKeyRange||c.webkitIDBKeyRange}}catch{rs={indexedDB:null,IDBKeyRange:null}}function qo(a){var f,m=!1,v=new Za(function(_){var N=A(a),M,O=!1,Z={},ue={},te={get closed(){return O},unsubscribe:function(){O||(O=!0,M&&M.abort(),J&&Ln.storagemutated.unsubscribe(oe))}},J=(_.start&&_.start(te),!1),ee=function(){return Gn(re)};function ae(){return Bs(ue,Z)}var oe=function(se){Zi(Z,se),ae()&&ee()},re=function(){var se,ge,pe;!O&&rs.indexedDB&&(Z={},se={},M&&M.abort(),M=new AbortController,pe=(ve=>{var Ne=Tn();try{N&&Le();var Ce=V(a,ve);return Ce=N?Ce.finally(Ve):Ce}finally{Ne&&Xn()}})(ge={subscr:se,signal:M.signal,requery:ee,querier:a,trans:null}),J||(Ln(hi,oe),J=!0),Promise.resolve(pe).then(function(ve){m=!0,f=ve,O||ge.signal.aborted||(ae()||(ue=se,ae())?ee():(Z={},Gn(function(){return!O&&_.next&&_.next(ve)})))},function(ve){m=!1,["DatabaseClosedError","AbortError"].includes(ve==null?void 0:ve.name)||O||Gn(function(){O||_.error&&_.error(ve)})}))};return setTimeout(ee,0),te});return v.hasValue=function(){return m},v.getValue=function(){return f},v}var vo=jr;function Wo(a){var f=Pr;try{Pr=!0,Ln.storagemutated.fire(a),Us(a,!0)}finally{Pr=f}}S(vo,s(s({},K),{delete:function(a){return new vo(a,{addons:[]}).delete()},exists:function(a){return new vo(a,{addons:[]}).open().then(function(f){return f.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(a){try{return f=vo.dependencies,m=f.indexedDB,f=f.IDBKeyRange,(mo(m)?Promise.resolve(m.databases()).then(function(v){return v.map(function(_){return _.name}).filter(function(_){return _!==ar})}):xi(m,f).toCollection().primaryKeys()).then(a)}catch{return kt(new ke.MissingAPI)}var f,m},defineClass:function(){return function(a){y(this,a)}},ignoreTransaction:function(a){return Ye.trans?Qt(Ye.transless||kn,a):a()},vip:Uo,async:function(a){return function(){try{var f=Ks(a.apply(this,arguments));return f&&typeof f.then=="function"?f:Be.resolve(f)}catch(m){return kt(m)}}},spawn:function(a,f,m){try{var v=Ks(a.apply(m,f||[]));return v&&typeof v.then=="function"?v:Be.resolve(v)}catch(_){return kt(_)}},currentTransaction:{get:function(){return Ye.trans||null}},waitFor:function(a,f){return a=Be.resolve(typeof a=="function"?vo.ignoreTransaction(a):a).timeout(f||6e4),Ye.trans?Ye.trans.waitFor(a):a},Promise:Be,debug:{get:function(){return Et},set:function(a){Bt(a)}},derive:$,extend:y,props:S,override:P,Events:Vr,on:Ln,liveQuery:qo,extendObservabilitySet:Zi,getByKeyPath:H,setByKeyPath:Q,delByKeyPath:function(a,f){typeof f=="string"?Q(a,f,void 0):"length"in f&&[].map.call(f,function(m){Q(a,m,void 0)})},shallowClone:ce,deepClone:xe,getObjectDiff:qs,cmp:ct,asap:B,minKey:-1/0,addons:[],connections:{get:ho.toArray},errnames:_e,dependencies:rs,cache:Wr,semVer:"4.4.2",version:"4.4.2".split(".").map(function(a){return parseInt(a)}).reduce(function(a,f,m){return a+f/Math.pow(10,2*m)})})),vo.maxKey=Nr(vo.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Ln(hi,function(a){Pr||(a=new CustomEvent(Ui,{detail:a}),Pr=!0,dispatchEvent(a),Pr=!1)}),addEventListener(Ui,function(a){a=a.detail,Pr||Wo(a)}));var Yo,Pr=!1,os=function(){};return typeof BroadcastChannel<"u"&&((os=function(){(Yo=new BroadcastChannel(Ui)).onmessage=function(a){return a.data&&Wo(a.data)}})(),typeof Yo.unref=="function"&&Yo.unref(),Ln(hi,function(a){Pr||Yo.postMessage(a)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(a){if(!jr.disableBfCache&&a.persisted){Et&&console.debug("Dexie: handling persisted pagehide"),Yo!=null&&Yo.close();for(var f=0,m=ho.toArray();f<m.length;f++)m[f].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(a){!jr.disableBfCache&&a.persisted&&(Et&&console.debug("Dexie: handling persisted pageshow"),os(),Wo({all:new tn(-1/0,[[]])}))})),Be.rejectionMapper=function(a,f){return!a||a instanceof Se||a instanceof TypeError||a instanceof SyntaxError||!a.name||!He[a.name]?a:(f=new He[a.name](f||a.message,a),"stack"in a&&j(f,"stack",{get:function(){return this.inner.stack}}),f)},Bt(Et),s(jr,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:jr,Entity:jn,PropModification:oo,RangeSet:tn,add:function(a){return new oo({add:a})},cmp:ct,default:jr,liveQuery:qo,mergeRanges:bi,rangesOverlap:Gi,remove:function(a){return new oo({remove:a})},replacePrefix:function(a,f){return new oo({replacePrefix:[a,f]})}}),{default:jr}),jr})})(eu)),eu.exports}var Vy=Hy();const wf=wu(Vy),nh=Symbol.for("Dexie"),lu=globalThis[nh]||(globalThis[nh]=wf);if(wf.semVer!==lu.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${wf.semVer} and ${lu.semVer}`);const{liveQuery:Zk,mergeRanges:e2,rangesOverlap:t2,RangeSet:n2,cmp:r2,Entity:o2,PropModification:i2,replacePrefix:s2,add:a2,remove:l2,DexieYProvider:u2}=lu;class Uy extends lu{constructor(){super("api-doc-tor");ga(this,"flows");ga(this,"testSuites");ga(this,"environments");ga(this,"kv");this.version(1).stores({flows:"++id, name",testSuites:"++id, name",environments:"++id, name",kv:"key"})}}const _t=new Uy;async function Ky(){const[t,r,i]=await Promise.all([_t.flows.toArray(),_t.testSuites.toArray(),_t.environments.toArray()]),s=await _t.kv.get("authTokens");let l;try{l=s!=null&&s.value?JSON.parse(s.value):void 0}catch{l=void 0}return{formatVersion:1,exportedAt:new Date().toISOString(),flows:t,testSuites:r,environments:i,authTokens:l}}async function _m(t){await _t.transaction("rw",_t.flows,_t.testSuites,_t.environments,_t.kv,async()=>{await _t.flows.clear(),await _t.testSuites.clear(),await _t.environments.clear();for(const r of t.flows)await _t.flows.add({name:r.name,steps:r.steps,graph:r.graph});for(const r of t.testSuites)await _t.testSuites.add({name:r.name,cases:r.cases});for(const r of t.environments)await _t.environments.add({name:r.name,baseUrl:r.baseUrl,vars:r.vars??{}});t.authTokens&&await _t.kv.put({key:"authTokens",value:JSON.stringify(t.authTokens)})})}async function qy(t){if(t.formatVersion!==1)return!1;const[r,i]=await Promise.all([_t.flows.count(),_t.testSuites.count()]);return r>0||i>0?!1:(await _m(t),!0)}function Wy(t,r,i){var d,h;const s=[],l=r===t.expectStatus;if(s.push(`HTTP ${r} ${l?"✓":`✗ (esperado ${t.expectStatus})`}`),!l)return{pass:!1,lines:s};if((d=t.contains)!=null&&d.trim()){const y=i.includes(t.contains);if(s.push(`Contiene texto "${t.contains}": ${y?"✓":"✗"}`),!y)return{pass:!1,lines:s}}const c=(h=t.jsonPath)==null?void 0:h.trim();if(c){let y;try{y=JSON.parse(i)}catch{return s.push("Body no es JSON válido: ✗"),{pass:!1,lines:s}}const b=Rf(y,c),k=t.expectJsonValue;if(k!==void 0&&k!==""){const x=b==null?String(b):typeof b=="object"?JSON.stringify(b):String(b),S=k.trim(),C=x===S||String(b)===S;if(s.push(`JSON path ${c} → ${x} vs "${S}": ${C?"✓":"✗"}`),!C)return{pass:!1,lines:s}}else{const x=b!=null;if(s.push(`JSON path ${c} existe: ${x?"✓":"✗"}`),!x)return{pass:!1,lines:s}}}return{pass:!0,lines:s}}function Yt(t){if(typeof t=="string"||typeof t=="number")return""+t;let r="";if(Array.isArray(t))for(let i=0,s;i<t.length;i++)(s=Yt(t[i]))!==""&&(r+=(r&&" ")+s);else for(let i in t)t[i]&&(r+=(r&&" ")+i);return r}var Yy={value:()=>{}};function ku(){for(var t=0,r=arguments.length,i={},s;t<r;++t){if(!(s=arguments[t]+"")||s in i||/[\s.]/.test(s))throw new Error("illegal type: "+s);i[s]=[]}return new tu(i)}function tu(t){this._=t}function Xy(t,r){return t.trim().split(/^|\s+/).map(function(i){var s="",l=i.indexOf(".");if(l>=0&&(s=i.slice(l+1),i=i.slice(0,l)),i&&!r.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:s}})}tu.prototype=ku.prototype={constructor:tu,on:function(t,r){var i=this._,s=Xy(t+"",i),l,c=-1,d=s.length;if(arguments.length<2){for(;++c<d;)if((l=(t=s[c]).type)&&(l=Qy(i[l],t.name)))return l;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++c<d;)if(l=(t=s[c]).type)i[l]=rh(i[l],t.name,r);else if(r==null)for(l in i)i[l]=rh(i[l],t.name,null);return this},copy:function(){var t={},r=this._;for(var i in r)t[i]=r[i].slice();return new tu(t)},call:function(t,r){if((l=arguments.length-2)>0)for(var i=new Array(l),s=0,l,c;s<l;++s)i[s]=arguments[s+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(c=this._[t],s=0,l=c.length;s<l;++s)c[s].value.apply(r,i)},apply:function(t,r,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var s=this._[t],l=0,c=s.length;l<c;++l)s[l].value.apply(r,i)}};function Qy(t,r){for(var i=0,s=t.length,l;i<s;++i)if((l=t[i]).name===r)return l.value}function rh(t,r,i){for(var s=0,l=t.length;s<l;++s)if(t[s].name===r){t[s]=Yy,t=t.slice(0,s).concat(t.slice(s+1));break}return i!=null&&t.push({name:r,value:i}),t}var bf="http://www.w3.org/1999/xhtml";const oh={svg:"http://www.w3.org/2000/svg",xhtml:bf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Nu(t){var r=t+="",i=r.indexOf(":");return i>=0&&(r=t.slice(0,i))!=="xmlns"&&(t=t.slice(i+1)),oh.hasOwnProperty(r)?{space:oh[r],local:t}:t}function Gy(t){return function(){var r=this.ownerDocument,i=this.namespaceURI;return i===bf&&r.documentElement.namespaceURI===bf?r.createElement(t):r.createElementNS(i,t)}}function Jy(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Sm(t){var r=Nu(t);return(r.local?Jy:Gy)(r)}function Zy(){}function Lf(t){return t==null?Zy:function(){return this.querySelector(t)}}function ev(t){typeof t!="function"&&(t=Lf(t));for(var r=this._groups,i=r.length,s=new Array(i),l=0;l<i;++l)for(var c=r[l],d=c.length,h=s[l]=new Array(d),y,b,k=0;k<d;++k)(y=c[k])&&(b=t.call(y,y.__data__,k,c))&&("__data__"in y&&(b.__data__=y.__data__),h[k]=b);return new or(s,this._parents)}function tv(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function nv(){return[]}function km(t){return t==null?nv:function(){return this.querySelectorAll(t)}}function rv(t){return function(){return tv(t.apply(this,arguments))}}function ov(t){typeof t=="function"?t=rv(t):t=km(t);for(var r=this._groups,i=r.length,s=[],l=[],c=0;c<i;++c)for(var d=r[c],h=d.length,y,b=0;b<h;++b)(y=d[b])&&(s.push(t.call(y,y.__data__,b,d)),l.push(y));return new or(s,l)}function Nm(t){return function(){return this.matches(t)}}function Em(t){return function(r){return r.matches(t)}}var iv=Array.prototype.find;function sv(t){return function(){return iv.call(this.children,t)}}function av(){return this.firstElementChild}function lv(t){return this.select(t==null?av:sv(typeof t=="function"?t:Em(t)))}var uv=Array.prototype.filter;function cv(){return Array.from(this.children)}function fv(t){return function(){return uv.call(this.children,t)}}function dv(t){return this.selectAll(t==null?cv:fv(typeof t=="function"?t:Em(t)))}function pv(t){typeof t!="function"&&(t=Nm(t));for(var r=this._groups,i=r.length,s=new Array(i),l=0;l<i;++l)for(var c=r[l],d=c.length,h=s[l]=[],y,b=0;b<d;++b)(y=c[b])&&t.call(y,y.__data__,b,c)&&h.push(y);return new or(s,this._parents)}function Cm(t){return new Array(t.length)}function hv(){return new or(this._enter||this._groups.map(Cm),this._parents)}function uu(t,r){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=r}uu.prototype={constructor:uu,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,r){return this._parent.insertBefore(t,r)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function mv(t){return function(){return t}}function gv(t,r,i,s,l,c){for(var d=0,h,y=r.length,b=c.length;d<b;++d)(h=r[d])?(h.__data__=c[d],s[d]=h):i[d]=new uu(t,c[d]);for(;d<y;++d)(h=r[d])&&(l[d]=h)}function yv(t,r,i,s,l,c,d){var h,y,b=new Map,k=r.length,x=c.length,S=new Array(k),C;for(h=0;h<k;++h)(y=r[h])&&(S[h]=C=d.call(y,y.__data__,h,r)+"",b.has(C)?l[h]=y:b.set(C,y));for(h=0;h<x;++h)C=d.call(t,c[h],h,c)+"",(y=b.get(C))?(s[h]=y,y.__data__=c[h],b.delete(C)):i[h]=new uu(t,c[h]);for(h=0;h<k;++h)(y=r[h])&&b.get(S[h])===y&&(l[h]=y)}function vv(t){return t.__data__}function xv(t,r){if(!arguments.length)return Array.from(this,vv);var i=r?yv:gv,s=this._parents,l=this._groups;typeof t!="function"&&(t=mv(t));for(var c=l.length,d=new Array(c),h=new Array(c),y=new Array(c),b=0;b<c;++b){var k=s[b],x=l[b],S=x.length,C=wv(t.call(k,k&&k.__data__,b,s)),j=C.length,$=h[b]=new Array(j),T=d[b]=new Array(j),I=y[b]=new Array(S);i(k,x,$,T,I,C,r);for(var U=0,P=0,R,B;U<j;++U)if(R=$[U]){for(U>=P&&(P=U+1);!(B=T[P])&&++P<j;);R._next=B||null}}return d=new or(d,s),d._enter=h,d._exit=y,d}function wv(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function bv(){return new or(this._exit||this._groups.map(Cm),this._parents)}function _v(t,r,i){var s=this.enter(),l=this,c=this.exit();return typeof t=="function"?(s=t(s),s&&(s=s.selection())):s=s.append(t+""),r!=null&&(l=r(l),l&&(l=l.selection())),i==null?c.remove():i(c),s&&l?s.merge(l).order():l}function Sv(t){for(var r=t.selection?t.selection():t,i=this._groups,s=r._groups,l=i.length,c=s.length,d=Math.min(l,c),h=new Array(l),y=0;y<d;++y)for(var b=i[y],k=s[y],x=b.length,S=h[y]=new Array(x),C,j=0;j<x;++j)(C=b[j]||k[j])&&(S[j]=C);for(;y<l;++y)h[y]=i[y];return new or(h,this._parents)}function kv(){for(var t=this._groups,r=-1,i=t.length;++r<i;)for(var s=t[r],l=s.length-1,c=s[l],d;--l>=0;)(d=s[l])&&(c&&d.compareDocumentPosition(c)^4&&c.parentNode.insertBefore(d,c),c=d);return this}function Nv(t){t||(t=Ev);function r(x,S){return x&&S?t(x.__data__,S.__data__):!x-!S}for(var i=this._groups,s=i.length,l=new Array(s),c=0;c<s;++c){for(var d=i[c],h=d.length,y=l[c]=new Array(h),b,k=0;k<h;++k)(b=d[k])&&(y[k]=b);y.sort(r)}return new or(l,this._parents).order()}function Ev(t,r){return t<r?-1:t>r?1:t>=r?0:NaN}function Cv(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function jv(){return Array.from(this)}function Pv(){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var s=t[r],l=0,c=s.length;l<c;++l){var d=s[l];if(d)return d}return null}function Mv(){let t=0;for(const r of this)++t;return t}function $v(){return!this.node()}function Tv(t){for(var r=this._groups,i=0,s=r.length;i<s;++i)for(var l=r[i],c=0,d=l.length,h;c<d;++c)(h=l[c])&&t.call(h,h.__data__,c,l);return this}function Iv(t){return function(){this.removeAttribute(t)}}function Av(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ov(t,r){return function(){this.setAttribute(t,r)}}function Rv(t,r){return function(){this.setAttributeNS(t.space,t.local,r)}}function Lv(t,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttribute(t):this.setAttribute(t,i)}}function Dv(t,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,i)}}function zv(t,r){var i=Nu(t);if(arguments.length<2){var s=this.node();return i.local?s.getAttributeNS(i.space,i.local):s.getAttribute(i)}return this.each((r==null?i.local?Av:Iv:typeof r=="function"?i.local?Dv:Lv:i.local?Rv:Ov)(i,r))}function jm(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Fv(t){return function(){this.style.removeProperty(t)}}function Bv(t,r,i){return function(){this.style.setProperty(t,r,i)}}function Hv(t,r,i){return function(){var s=r.apply(this,arguments);s==null?this.style.removeProperty(t):this.style.setProperty(t,s,i)}}function Vv(t,r,i){return arguments.length>1?this.each((r==null?Fv:typeof r=="function"?Hv:Bv)(t,r,i??"")):Ps(this.node(),t)}function Ps(t,r){return t.style.getPropertyValue(r)||jm(t).getComputedStyle(t,null).getPropertyValue(r)}function Uv(t){return function(){delete this[t]}}function Kv(t,r){return function(){this[t]=r}}function qv(t,r){return function(){var i=r.apply(this,arguments);i==null?delete this[t]:this[t]=i}}function Wv(t,r){return arguments.length>1?this.each((r==null?Uv:typeof r=="function"?qv:Kv)(t,r)):this.node()[t]}function Pm(t){return t.trim().split(/^|\s+/)}function Df(t){return t.classList||new Mm(t)}function Mm(t){this._node=t,this._names=Pm(t.getAttribute("class")||"")}Mm.prototype={add:function(t){var r=this._names.indexOf(t);r<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var r=this._names.indexOf(t);r>=0&&(this._names.splice(r,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function $m(t,r){for(var i=Df(t),s=-1,l=r.length;++s<l;)i.add(r[s])}function Tm(t,r){for(var i=Df(t),s=-1,l=r.length;++s<l;)i.remove(r[s])}function Yv(t){return function(){$m(this,t)}}function Xv(t){return function(){Tm(this,t)}}function Qv(t,r){return function(){(r.apply(this,arguments)?$m:Tm)(this,t)}}function Gv(t,r){var i=Pm(t+"");if(arguments.length<2){for(var s=Df(this.node()),l=-1,c=i.length;++l<c;)if(!s.contains(i[l]))return!1;return!0}return this.each((typeof r=="function"?Qv:r?Yv:Xv)(i,r))}function Jv(){this.textContent=""}function Zv(t){return function(){this.textContent=t}}function ex(t){return function(){var r=t.apply(this,arguments);this.textContent=r??""}}function tx(t){return arguments.length?this.each(t==null?Jv:(typeof t=="function"?ex:Zv)(t)):this.node().textContent}function nx(){this.innerHTML=""}function rx(t){return function(){this.innerHTML=t}}function ox(t){return function(){var r=t.apply(this,arguments);this.innerHTML=r??""}}function ix(t){return arguments.length?this.each(t==null?nx:(typeof t=="function"?ox:rx)(t)):this.node().innerHTML}function sx(){this.nextSibling&&this.parentNode.appendChild(this)}function ax(){return this.each(sx)}function lx(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ux(){return this.each(lx)}function cx(t){var r=typeof t=="function"?t:Sm(t);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function fx(){return null}function dx(t,r){var i=typeof t=="function"?t:Sm(t),s=r==null?fx:typeof r=="function"?r:Lf(r);return this.select(function(){return this.insertBefore(i.apply(this,arguments),s.apply(this,arguments)||null)})}function px(){var t=this.parentNode;t&&t.removeChild(this)}function hx(){return this.each(px)}function mx(){var t=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function gx(){var t=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function yx(t){return this.select(t?gx:mx)}function vx(t){return arguments.length?this.property("__data__",t):this.node().__data__}function xx(t){return function(r){t.call(this,r,this.__data__)}}function wx(t){return t.trim().split(/^|\s+/).map(function(r){var i="",s=r.indexOf(".");return s>=0&&(i=r.slice(s+1),r=r.slice(0,s)),{type:r,name:i}})}function bx(t){return function(){var r=this.__on;if(r){for(var i=0,s=-1,l=r.length,c;i<l;++i)c=r[i],(!t.type||c.type===t.type)&&c.name===t.name?this.removeEventListener(c.type,c.listener,c.options):r[++s]=c;++s?r.length=s:delete this.__on}}}function _x(t,r,i){return function(){var s=this.__on,l,c=xx(r);if(s){for(var d=0,h=s.length;d<h;++d)if((l=s[d]).type===t.type&&l.name===t.name){this.removeEventListener(l.type,l.listener,l.options),this.addEventListener(l.type,l.listener=c,l.options=i),l.value=r;return}}this.addEventListener(t.type,c,i),l={type:t.type,name:t.name,value:r,listener:c,options:i},s?s.push(l):this.__on=[l]}}function Sx(t,r,i){var s=wx(t+""),l,c=s.length,d;if(arguments.length<2){var h=this.node().__on;if(h){for(var y=0,b=h.length,k;y<b;++y)for(l=0,k=h[y];l<c;++l)if((d=s[l]).type===k.type&&d.name===k.name)return k.value}return}for(h=r?_x:bx,l=0;l<c;++l)this.each(h(s[l],r,i));return this}function Im(t,r,i){var s=jm(t),l=s.CustomEvent;typeof l=="function"?l=new l(r,i):(l=s.document.createEvent("Event"),i?(l.initEvent(r,i.bubbles,i.cancelable),l.detail=i.detail):l.initEvent(r,!1,!1)),t.dispatchEvent(l)}function kx(t,r){return function(){return Im(this,t,r)}}function Nx(t,r){return function(){return Im(this,t,r.apply(this,arguments))}}function Ex(t,r){return this.each((typeof r=="function"?Nx:kx)(t,r))}function*Cx(){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var s=t[r],l=0,c=s.length,d;l<c;++l)(d=s[l])&&(yield d)}var Am=[null];function or(t,r){this._groups=t,this._parents=r}function Aa(){return new or([[document.documentElement]],Am)}function jx(){return this}or.prototype=Aa.prototype={constructor:or,select:ev,selectAll:ov,selectChild:lv,selectChildren:dv,filter:pv,data:xv,enter:hv,exit:bv,join:_v,merge:Sv,selection:jx,order:kv,sort:Nv,call:Cv,nodes:jv,node:Pv,size:Mv,empty:$v,each:Tv,attr:zv,style:Vv,property:Wv,classed:Gv,text:tx,html:ix,raise:ax,lower:ux,append:cx,insert:dx,remove:hx,clone:yx,datum:vx,on:Sx,dispatch:Ex,[Symbol.iterator]:Cx};function rr(t){return typeof t=="string"?new or([[document.querySelector(t)]],[document.documentElement]):new or([[t]],Am)}function Px(t){let r;for(;r=t.sourceEvent;)t=r;return t}function Or(t,r){if(t=Px(t),r===void 0&&(r=t.currentTarget),r){var i=r.ownerSVGElement||r;if(i.createSVGPoint){var s=i.createSVGPoint();return s.x=t.clientX,s.y=t.clientY,s=s.matrixTransform(r.getScreenCTM().inverse()),[s.x,s.y]}if(r.getBoundingClientRect){var l=r.getBoundingClientRect();return[t.clientX-l.left-r.clientLeft,t.clientY-l.top-r.clientTop]}}return[t.pageX,t.pageY]}const Mx={passive:!1},ka={capture:!0,passive:!1};function nf(t){t.stopImmediatePropagation()}function Cs(t){t.preventDefault(),t.stopImmediatePropagation()}function Om(t){var r=t.document.documentElement,i=rr(t).on("dragstart.drag",Cs,ka);"onselectstart"in r?i.on("selectstart.drag",Cs,ka):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function Rm(t,r){var i=t.document.documentElement,s=rr(t).on("dragstart.drag",null);r&&(s.on("click.drag",Cs,ka),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in i?s.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const Ul=t=>()=>t;function _f(t,{sourceEvent:r,subject:i,target:s,identifier:l,active:c,x:d,y:h,dx:y,dy:b,dispatch:k}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:l,enumerable:!0,configurable:!0},active:{value:c,enumerable:!0,configurable:!0},x:{value:d,enumerable:!0,configurable:!0},y:{value:h,enumerable:!0,configurable:!0},dx:{value:y,enumerable:!0,configurable:!0},dy:{value:b,enumerable:!0,configurable:!0},_:{value:k}})}_f.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function $x(t){return!t.ctrlKey&&!t.button}function Tx(){return this.parentNode}function Ix(t,r){return r??{x:t.x,y:t.y}}function Ax(){return navigator.maxTouchPoints||"ontouchstart"in this}function Lm(){var t=$x,r=Tx,i=Ix,s=Ax,l={},c=ku("start","drag","end"),d=0,h,y,b,k,x=0;function S(R){R.on("mousedown.drag",C).filter(s).on("touchstart.drag",T).on("touchmove.drag",I,Mx).on("touchend.drag touchcancel.drag",U).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function C(R,B){if(!(k||!t.call(this,R,B))){var H=P(this,r.call(this,R,B),R,B,"mouse");H&&(rr(R.view).on("mousemove.drag",j,ka).on("mouseup.drag",$,ka),Om(R.view),nf(R),b=!1,h=R.clientX,y=R.clientY,H("start",R))}}function j(R){if(Cs(R),!b){var B=R.clientX-h,H=R.clientY-y;b=B*B+H*H>x}l.mouse("drag",R)}function $(R){rr(R.view).on("mousemove.drag mouseup.drag",null),Rm(R.view,b),Cs(R),l.mouse("end",R)}function T(R,B){if(t.call(this,R,B)){var H=R.changedTouches,Q=r.call(this,R,B),ce=H.length,de,we;for(de=0;de<ce;++de)(we=P(this,Q,R,B,H[de].identifier,H[de]))&&(nf(R),we("start",R,H[de]))}}function I(R){var B=R.changedTouches,H=B.length,Q,ce;for(Q=0;Q<H;++Q)(ce=l[B[Q].identifier])&&(Cs(R),ce("drag",R,B[Q]))}function U(R){var B=R.changedTouches,H=B.length,Q,ce;for(k&&clearTimeout(k),k=setTimeout(function(){k=null},500),Q=0;Q<H;++Q)(ce=l[B[Q].identifier])&&(nf(R),ce("end",R,B[Q]))}function P(R,B,H,Q,ce,de){var we=c.copy(),q=Or(de||H,B),fe,xe,L;if((L=i.call(R,new _f("beforestart",{sourceEvent:H,target:S,identifier:ce,active:d,x:q[0],y:q[1],dx:0,dy:0,dispatch:we}),Q))!=null)return fe=L.x-q[0]||0,xe=L.y-q[1]||0,function le(G,ie,z){var W=q,F;switch(G){case"start":l[ce]=le,F=d++;break;case"end":delete l[ce],--d;case"drag":q=Or(z||ie,B),F=d;break}we.call(G,R,new _f(G,{sourceEvent:ie,subject:L,target:S,identifier:ce,active:F,x:q[0]+fe,y:q[1]+xe,dx:q[0]-W[0],dy:q[1]-W[1],dispatch:we}),Q)}}return S.filter=function(R){return arguments.length?(t=typeof R=="function"?R:Ul(!!R),S):t},S.container=function(R){return arguments.length?(r=typeof R=="function"?R:Ul(R),S):r},S.subject=function(R){return arguments.length?(i=typeof R=="function"?R:Ul(R),S):i},S.touchable=function(R){return arguments.length?(s=typeof R=="function"?R:Ul(!!R),S):s},S.on=function(){var R=c.on.apply(c,arguments);return R===c?S:R},S.clickDistance=function(R){return arguments.length?(x=(R=+R)*R,S):Math.sqrt(x)},S}function zf(t,r,i){t.prototype=r.prototype=i,i.constructor=t}function Dm(t,r){var i=Object.create(t.prototype);for(var s in r)i[s]=r[s];return i}function Oa(){}var Na=.7,cu=1/Na,js="\\s*([+-]?\\d+)\\s*",Ea="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Zr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ox=/^#([0-9a-f]{3,8})$/,Rx=new RegExp(`^rgb\\(${js},${js},${js}\\)$`),Lx=new RegExp(`^rgb\\(${Zr},${Zr},${Zr}\\)$`),Dx=new RegExp(`^rgba\\(${js},${js},${js},${Ea}\\)$`),zx=new RegExp(`^rgba\\(${Zr},${Zr},${Zr},${Ea}\\)$`),Fx=new RegExp(`^hsl\\(${Ea},${Zr},${Zr}\\)$`),Bx=new RegExp(`^hsla\\(${Ea},${Zr},${Zr},${Ea}\\)$`),ih={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};zf(Oa,Di,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:sh,formatHex:sh,formatHex8:Hx,formatHsl:Vx,formatRgb:ah,toString:ah});function sh(){return this.rgb().formatHex()}function Hx(){return this.rgb().formatHex8()}function Vx(){return zm(this).formatHsl()}function ah(){return this.rgb().formatRgb()}function Di(t){var r,i;return t=(t+"").trim().toLowerCase(),(r=Ox.exec(t))?(i=r[1].length,r=parseInt(r[1],16),i===6?lh(r):i===3?new Un(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):i===8?Kl(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):i===4?Kl(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=Rx.exec(t))?new Un(r[1],r[2],r[3],1):(r=Lx.exec(t))?new Un(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=Dx.exec(t))?Kl(r[1],r[2],r[3],r[4]):(r=zx.exec(t))?Kl(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=Fx.exec(t))?fh(r[1],r[2]/100,r[3]/100,1):(r=Bx.exec(t))?fh(r[1],r[2]/100,r[3]/100,r[4]):ih.hasOwnProperty(t)?lh(ih[t]):t==="transparent"?new Un(NaN,NaN,NaN,0):null}function lh(t){return new Un(t>>16&255,t>>8&255,t&255,1)}function Kl(t,r,i,s){return s<=0&&(t=r=i=NaN),new Un(t,r,i,s)}function Ux(t){return t instanceof Oa||(t=Di(t)),t?(t=t.rgb(),new Un(t.r,t.g,t.b,t.opacity)):new Un}function Sf(t,r,i,s){return arguments.length===1?Ux(t):new Un(t,r,i,s??1)}function Un(t,r,i,s){this.r=+t,this.g=+r,this.b=+i,this.opacity=+s}zf(Un,Sf,Dm(Oa,{brighter(t){return t=t==null?cu:Math.pow(cu,t),new Un(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Na:Math.pow(Na,t),new Un(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Un(Ri(this.r),Ri(this.g),Ri(this.b),fu(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:uh,formatHex:uh,formatHex8:Kx,formatRgb:ch,toString:ch}));function uh(){return`#${Oi(this.r)}${Oi(this.g)}${Oi(this.b)}`}function Kx(){return`#${Oi(this.r)}${Oi(this.g)}${Oi(this.b)}${Oi((isNaN(this.opacity)?1:this.opacity)*255)}`}function ch(){const t=fu(this.opacity);return`${t===1?"rgb(":"rgba("}${Ri(this.r)}, ${Ri(this.g)}, ${Ri(this.b)}${t===1?")":`, ${t})`}`}function fu(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ri(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Oi(t){return t=Ri(t),(t<16?"0":"")+t.toString(16)}function fh(t,r,i,s){return s<=0?t=r=i=NaN:i<=0||i>=1?t=r=NaN:r<=0&&(t=NaN),new Rr(t,r,i,s)}function zm(t){if(t instanceof Rr)return new Rr(t.h,t.s,t.l,t.opacity);if(t instanceof Oa||(t=Di(t)),!t)return new Rr;if(t instanceof Rr)return t;t=t.rgb();var r=t.r/255,i=t.g/255,s=t.b/255,l=Math.min(r,i,s),c=Math.max(r,i,s),d=NaN,h=c-l,y=(c+l)/2;return h?(r===c?d=(i-s)/h+(i<s)*6:i===c?d=(s-r)/h+2:d=(r-i)/h+4,h/=y<.5?c+l:2-c-l,d*=60):h=y>0&&y<1?0:d,new Rr(d,h,y,t.opacity)}function qx(t,r,i,s){return arguments.length===1?zm(t):new Rr(t,r,i,s??1)}function Rr(t,r,i,s){this.h=+t,this.s=+r,this.l=+i,this.opacity=+s}zf(Rr,qx,Dm(Oa,{brighter(t){return t=t==null?cu:Math.pow(cu,t),new Rr(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Na:Math.pow(Na,t),new Rr(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,r=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,s=i+(i<.5?i:1-i)*r,l=2*i-s;return new Un(rf(t>=240?t-240:t+120,l,s),rf(t,l,s),rf(t<120?t+240:t-120,l,s),this.opacity)},clamp(){return new Rr(dh(this.h),ql(this.s),ql(this.l),fu(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=fu(this.opacity);return`${t===1?"hsl(":"hsla("}${dh(this.h)}, ${ql(this.s)*100}%, ${ql(this.l)*100}%${t===1?")":`, ${t})`}`}}));function dh(t){return t=(t||0)%360,t<0?t+360:t}function ql(t){return Math.max(0,Math.min(1,t||0))}function rf(t,r,i){return(t<60?r+(i-r)*t/60:t<180?i:t<240?r+(i-r)*(240-t)/60:r)*255}const Ff=t=>()=>t;function Wx(t,r){return function(i){return t+i*r}}function Yx(t,r,i){return t=Math.pow(t,i),r=Math.pow(r,i)-t,i=1/i,function(s){return Math.pow(t+s*r,i)}}function Xx(t){return(t=+t)==1?Fm:function(r,i){return i-r?Yx(r,i,t):Ff(isNaN(r)?i:r)}}function Fm(t,r){var i=r-t;return i?Wx(t,i):Ff(isNaN(t)?r:t)}const du=(function t(r){var i=Xx(r);function s(l,c){var d=i((l=Sf(l)).r,(c=Sf(c)).r),h=i(l.g,c.g),y=i(l.b,c.b),b=Fm(l.opacity,c.opacity);return function(k){return l.r=d(k),l.g=h(k),l.b=y(k),l.opacity=b(k),l+""}}return s.gamma=t,s})(1);function Qx(t,r){r||(r=[]);var i=t?Math.min(r.length,t.length):0,s=r.slice(),l;return function(c){for(l=0;l<i;++l)s[l]=t[l]*(1-c)+r[l]*c;return s}}function Gx(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Jx(t,r){var i=r?r.length:0,s=t?Math.min(i,t.length):0,l=new Array(s),c=new Array(i),d;for(d=0;d<s;++d)l[d]=_a(t[d],r[d]);for(;d<i;++d)c[d]=r[d];return function(h){for(d=0;d<s;++d)c[d]=l[d](h);return c}}function Zx(t,r){var i=new Date;return t=+t,r=+r,function(s){return i.setTime(t*(1-s)+r*s),i}}function Jr(t,r){return t=+t,r=+r,function(i){return t*(1-i)+r*i}}function ew(t,r){var i={},s={},l;(t===null||typeof t!="object")&&(t={}),(r===null||typeof r!="object")&&(r={});for(l in r)l in t?i[l]=_a(t[l],r[l]):s[l]=r[l];return function(c){for(l in i)s[l]=i[l](c);return s}}var kf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,of=new RegExp(kf.source,"g");function tw(t){return function(){return t}}function nw(t){return function(r){return t(r)+""}}function Bm(t,r){var i=kf.lastIndex=of.lastIndex=0,s,l,c,d=-1,h=[],y=[];for(t=t+"",r=r+"";(s=kf.exec(t))&&(l=of.exec(r));)(c=l.index)>i&&(c=r.slice(i,c),h[d]?h[d]+=c:h[++d]=c),(s=s[0])===(l=l[0])?h[d]?h[d]+=l:h[++d]=l:(h[++d]=null,y.push({i:d,x:Jr(s,l)})),i=of.lastIndex;return i<r.length&&(c=r.slice(i),h[d]?h[d]+=c:h[++d]=c),h.length<2?y[0]?nw(y[0].x):tw(r):(r=y.length,function(b){for(var k=0,x;k<r;++k)h[(x=y[k]).i]=x.x(b);return h.join("")})}function _a(t,r){var i=typeof r,s;return r==null||i==="boolean"?Ff(r):(i==="number"?Jr:i==="string"?(s=Di(r))?(r=s,du):Bm:r instanceof Di?du:r instanceof Date?Zx:Gx(r)?Qx:Array.isArray(r)?Jx:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?ew:Jr)(t,r)}var ph=180/Math.PI,Nf={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Hm(t,r,i,s,l,c){var d,h,y;return(d=Math.sqrt(t*t+r*r))&&(t/=d,r/=d),(y=t*i+r*s)&&(i-=t*y,s-=r*y),(h=Math.sqrt(i*i+s*s))&&(i/=h,s/=h,y/=h),t*s<r*i&&(t=-t,r=-r,y=-y,d=-d),{translateX:l,translateY:c,rotate:Math.atan2(r,t)*ph,skewX:Math.atan(y)*ph,scaleX:d,scaleY:h}}var Wl;function rw(t){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return r.isIdentity?Nf:Hm(r.a,r.b,r.c,r.d,r.e,r.f)}function ow(t){return t==null||(Wl||(Wl=document.createElementNS("http://www.w3.org/2000/svg","g")),Wl.setAttribute("transform",t),!(t=Wl.transform.baseVal.consolidate()))?Nf:(t=t.matrix,Hm(t.a,t.b,t.c,t.d,t.e,t.f))}function Vm(t,r,i,s){function l(b){return b.length?b.pop()+" ":""}function c(b,k,x,S,C,j){if(b!==x||k!==S){var $=C.push("translate(",null,r,null,i);j.push({i:$-4,x:Jr(b,x)},{i:$-2,x:Jr(k,S)})}else(x||S)&&C.push("translate("+x+r+S+i)}function d(b,k,x,S){b!==k?(b-k>180?k+=360:k-b>180&&(b+=360),S.push({i:x.push(l(x)+"rotate(",null,s)-2,x:Jr(b,k)})):k&&x.push(l(x)+"rotate("+k+s)}function h(b,k,x,S){b!==k?S.push({i:x.push(l(x)+"skewX(",null,s)-2,x:Jr(b,k)}):k&&x.push(l(x)+"skewX("+k+s)}function y(b,k,x,S,C,j){if(b!==x||k!==S){var $=C.push(l(C)+"scale(",null,",",null,")");j.push({i:$-4,x:Jr(b,x)},{i:$-2,x:Jr(k,S)})}else(x!==1||S!==1)&&C.push(l(C)+"scale("+x+","+S+")")}return function(b,k){var x=[],S=[];return b=t(b),k=t(k),c(b.translateX,b.translateY,k.translateX,k.translateY,x,S),d(b.rotate,k.rotate,x,S),h(b.skewX,k.skewX,x,S),y(b.scaleX,b.scaleY,k.scaleX,k.scaleY,x,S),b=k=null,function(C){for(var j=-1,$=S.length,T;++j<$;)x[(T=S[j]).i]=T.x(C);return x.join("")}}}var iw=Vm(rw,"px, ","px)","deg)"),sw=Vm(ow,", ",")",")"),aw=1e-12;function hh(t){return((t=Math.exp(t))+1/t)/2}function lw(t){return((t=Math.exp(t))-1/t)/2}function uw(t){return((t=Math.exp(2*t))-1)/(t+1)}const nu=(function t(r,i,s){function l(c,d){var h=c[0],y=c[1],b=c[2],k=d[0],x=d[1],S=d[2],C=k-h,j=x-y,$=C*C+j*j,T,I;if($<aw)I=Math.log(S/b)/r,T=function(Q){return[h+Q*C,y+Q*j,b*Math.exp(r*Q*I)]};else{var U=Math.sqrt($),P=(S*S-b*b+s*$)/(2*b*i*U),R=(S*S-b*b-s*$)/(2*S*i*U),B=Math.log(Math.sqrt(P*P+1)-P),H=Math.log(Math.sqrt(R*R+1)-R);I=(H-B)/r,T=function(Q){var ce=Q*I,de=hh(B),we=b/(i*U)*(de*uw(r*ce+B)-lw(B));return[h+we*C,y+we*j,b*de/hh(r*ce+B)]}}return T.duration=I*1e3*r/Math.SQRT2,T}return l.rho=function(c){var d=Math.max(.001,+c),h=d*d,y=h*h;return t(d,h,y)},l})(Math.SQRT2,2,4);var Ms=0,wa=0,va=0,Um=1e3,pu,ba,hu=0,zi=0,Eu=0,Ca=typeof performance=="object"&&performance.now?performance:Date,Km=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Bf(){return zi||(Km(cw),zi=Ca.now()+Eu)}function cw(){zi=0}function mu(){this._call=this._time=this._next=null}mu.prototype=qm.prototype={constructor:mu,restart:function(t,r,i){if(typeof t!="function")throw new TypeError("callback is not a function");i=(i==null?Bf():+i)+(r==null?0:+r),!this._next&&ba!==this&&(ba?ba._next=this:pu=this,ba=this),this._call=t,this._time=i,Ef()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ef())}};function qm(t,r,i){var s=new mu;return s.restart(t,r,i),s}function fw(){Bf(),++Ms;for(var t=pu,r;t;)(r=zi-t._time)>=0&&t._call.call(void 0,r),t=t._next;--Ms}function mh(){zi=(hu=Ca.now())+Eu,Ms=wa=0;try{fw()}finally{Ms=0,pw(),zi=0}}function dw(){var t=Ca.now(),r=t-hu;r>Um&&(Eu-=r,hu=t)}function pw(){for(var t,r=pu,i,s=1/0;r;)r._call?(s>r._time&&(s=r._time),t=r,r=r._next):(i=r._next,r._next=null,r=t?t._next=i:pu=i);ba=t,Ef(s)}function Ef(t){if(!Ms){wa&&(wa=clearTimeout(wa));var r=t-zi;r>24?(t<1/0&&(wa=setTimeout(mh,t-Ca.now()-Eu)),va&&(va=clearInterval(va))):(va||(hu=Ca.now(),va=setInterval(dw,Um)),Ms=1,Km(mh))}}function gh(t,r,i){var s=new mu;return r=r==null?0:+r,s.restart(l=>{s.stop(),t(l+r)},r,i),s}var hw=ku("start","end","cancel","interrupt"),mw=[],Wm=0,yh=1,Cf=2,ru=3,vh=4,jf=5,ou=6;function Cu(t,r,i,s,l,c){var d=t.__transition;if(!d)t.__transition={};else if(i in d)return;gw(t,i,{name:r,index:s,group:l,on:hw,tween:mw,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:Wm})}function Hf(t,r){var i=zr(t,r);if(i.state>Wm)throw new Error("too late; already scheduled");return i}function no(t,r){var i=zr(t,r);if(i.state>ru)throw new Error("too late; already running");return i}function zr(t,r){var i=t.__transition;if(!i||!(i=i[r]))throw new Error("transition not found");return i}function gw(t,r,i){var s=t.__transition,l;s[r]=i,i.timer=qm(c,0,i.time);function c(b){i.state=yh,i.timer.restart(d,i.delay,i.time),i.delay<=b&&d(b-i.delay)}function d(b){var k,x,S,C;if(i.state!==yh)return y();for(k in s)if(C=s[k],C.name===i.name){if(C.state===ru)return gh(d);C.state===vh?(C.state=ou,C.timer.stop(),C.on.call("interrupt",t,t.__data__,C.index,C.group),delete s[k]):+k<r&&(C.state=ou,C.timer.stop(),C.on.call("cancel",t,t.__data__,C.index,C.group),delete s[k])}if(gh(function(){i.state===ru&&(i.state=vh,i.timer.restart(h,i.delay,i.time),h(b))}),i.state=Cf,i.on.call("start",t,t.__data__,i.index,i.group),i.state===Cf){for(i.state=ru,l=new Array(S=i.tween.length),k=0,x=-1;k<S;++k)(C=i.tween[k].value.call(t,t.__data__,i.index,i.group))&&(l[++x]=C);l.length=x+1}}function h(b){for(var k=b<i.duration?i.ease.call(null,b/i.duration):(i.timer.restart(y),i.state=jf,1),x=-1,S=l.length;++x<S;)l[x].call(t,k);i.state===jf&&(i.on.call("end",t,t.__data__,i.index,i.group),y())}function y(){i.state=ou,i.timer.stop(),delete s[r];for(var b in s)return;delete t.__transition}}function iu(t,r){var i=t.__transition,s,l,c=!0,d;if(i){r=r==null?null:r+"";for(d in i){if((s=i[d]).name!==r){c=!1;continue}l=s.state>Cf&&s.state<jf,s.state=ou,s.timer.stop(),s.on.call(l?"interrupt":"cancel",t,t.__data__,s.index,s.group),delete i[d]}c&&delete t.__transition}}function yw(t){return this.each(function(){iu(this,t)})}function vw(t,r){var i,s;return function(){var l=no(this,t),c=l.tween;if(c!==i){s=i=c;for(var d=0,h=s.length;d<h;++d)if(s[d].name===r){s=s.slice(),s.splice(d,1);break}}l.tween=s}}function xw(t,r,i){var s,l;if(typeof i!="function")throw new Error;return function(){var c=no(this,t),d=c.tween;if(d!==s){l=(s=d).slice();for(var h={name:r,value:i},y=0,b=l.length;y<b;++y)if(l[y].name===r){l[y]=h;break}y===b&&l.push(h)}c.tween=l}}function ww(t,r){var i=this._id;if(t+="",arguments.length<2){for(var s=zr(this.node(),i).tween,l=0,c=s.length,d;l<c;++l)if((d=s[l]).name===t)return d.value;return null}return this.each((r==null?vw:xw)(i,t,r))}function Vf(t,r,i){var s=t._id;return t.each(function(){var l=no(this,s);(l.value||(l.value={}))[r]=i.apply(this,arguments)}),function(l){return zr(l,s).value[r]}}function Ym(t,r){var i;return(typeof r=="number"?Jr:r instanceof Di?du:(i=Di(r))?(r=i,du):Bm)(t,r)}function bw(t){return function(){this.removeAttribute(t)}}function _w(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Sw(t,r,i){var s,l=i+"",c;return function(){var d=this.getAttribute(t);return d===l?null:d===s?c:c=r(s=d,i)}}function kw(t,r,i){var s,l=i+"",c;return function(){var d=this.getAttributeNS(t.space,t.local);return d===l?null:d===s?c:c=r(s=d,i)}}function Nw(t,r,i){var s,l,c;return function(){var d,h=i(this),y;return h==null?void this.removeAttribute(t):(d=this.getAttribute(t),y=h+"",d===y?null:d===s&&y===l?c:(l=y,c=r(s=d,h)))}}function Ew(t,r,i){var s,l,c;return function(){var d,h=i(this),y;return h==null?void this.removeAttributeNS(t.space,t.local):(d=this.getAttributeNS(t.space,t.local),y=h+"",d===y?null:d===s&&y===l?c:(l=y,c=r(s=d,h)))}}function Cw(t,r){var i=Nu(t),s=i==="transform"?sw:Ym;return this.attrTween(t,typeof r=="function"?(i.local?Ew:Nw)(i,s,Vf(this,"attr."+t,r)):r==null?(i.local?_w:bw)(i):(i.local?kw:Sw)(i,s,r))}function jw(t,r){return function(i){this.setAttribute(t,r.call(this,i))}}function Pw(t,r){return function(i){this.setAttributeNS(t.space,t.local,r.call(this,i))}}function Mw(t,r){var i,s;function l(){var c=r.apply(this,arguments);return c!==s&&(i=(s=c)&&Pw(t,c)),i}return l._value=r,l}function $w(t,r){var i,s;function l(){var c=r.apply(this,arguments);return c!==s&&(i=(s=c)&&jw(t,c)),i}return l._value=r,l}function Tw(t,r){var i="attr."+t;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(r==null)return this.tween(i,null);if(typeof r!="function")throw new Error;var s=Nu(t);return this.tween(i,(s.local?Mw:$w)(s,r))}function Iw(t,r){return function(){Hf(this,t).delay=+r.apply(this,arguments)}}function Aw(t,r){return r=+r,function(){Hf(this,t).delay=r}}function Ow(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?Iw:Aw)(r,t)):zr(this.node(),r).delay}function Rw(t,r){return function(){no(this,t).duration=+r.apply(this,arguments)}}function Lw(t,r){return r=+r,function(){no(this,t).duration=r}}function Dw(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?Rw:Lw)(r,t)):zr(this.node(),r).duration}function zw(t,r){if(typeof r!="function")throw new Error;return function(){no(this,t).ease=r}}function Fw(t){var r=this._id;return arguments.length?this.each(zw(r,t)):zr(this.node(),r).ease}function Bw(t,r){return function(){var i=r.apply(this,arguments);if(typeof i!="function")throw new Error;no(this,t).ease=i}}function Hw(t){if(typeof t!="function")throw new Error;return this.each(Bw(this._id,t))}function Vw(t){typeof t!="function"&&(t=Nm(t));for(var r=this._groups,i=r.length,s=new Array(i),l=0;l<i;++l)for(var c=r[l],d=c.length,h=s[l]=[],y,b=0;b<d;++b)(y=c[b])&&t.call(y,y.__data__,b,c)&&h.push(y);return new To(s,this._parents,this._name,this._id)}function Uw(t){if(t._id!==this._id)throw new Error;for(var r=this._groups,i=t._groups,s=r.length,l=i.length,c=Math.min(s,l),d=new Array(s),h=0;h<c;++h)for(var y=r[h],b=i[h],k=y.length,x=d[h]=new Array(k),S,C=0;C<k;++C)(S=y[C]||b[C])&&(x[C]=S);for(;h<s;++h)d[h]=r[h];return new To(d,this._parents,this._name,this._id)}function Kw(t){return(t+"").trim().split(/^|\s+/).every(function(r){var i=r.indexOf(".");return i>=0&&(r=r.slice(0,i)),!r||r==="start"})}function qw(t,r,i){var s,l,c=Kw(r)?Hf:no;return function(){var d=c(this,t),h=d.on;h!==s&&(l=(s=h).copy()).on(r,i),d.on=l}}function Ww(t,r){var i=this._id;return arguments.length<2?zr(this.node(),i).on.on(t):this.each(qw(i,t,r))}function Yw(t){return function(){var r=this.parentNode;for(var i in this.__transition)if(+i!==t)return;r&&r.removeChild(this)}}function Xw(){return this.on("end.remove",Yw(this._id))}function Qw(t){var r=this._name,i=this._id;typeof t!="function"&&(t=Lf(t));for(var s=this._groups,l=s.length,c=new Array(l),d=0;d<l;++d)for(var h=s[d],y=h.length,b=c[d]=new Array(y),k,x,S=0;S<y;++S)(k=h[S])&&(x=t.call(k,k.__data__,S,h))&&("__data__"in k&&(x.__data__=k.__data__),b[S]=x,Cu(b[S],r,i,S,b,zr(k,i)));return new To(c,this._parents,r,i)}function Gw(t){var r=this._name,i=this._id;typeof t!="function"&&(t=km(t));for(var s=this._groups,l=s.length,c=[],d=[],h=0;h<l;++h)for(var y=s[h],b=y.length,k,x=0;x<b;++x)if(k=y[x]){for(var S=t.call(k,k.__data__,x,y),C,j=zr(k,i),$=0,T=S.length;$<T;++$)(C=S[$])&&Cu(C,r,i,$,S,j);c.push(S),d.push(k)}return new To(c,d,r,i)}var Jw=Aa.prototype.constructor;function Zw(){return new Jw(this._groups,this._parents)}function e1(t,r){var i,s,l;return function(){var c=Ps(this,t),d=(this.style.removeProperty(t),Ps(this,t));return c===d?null:c===i&&d===s?l:l=r(i=c,s=d)}}function Xm(t){return function(){this.style.removeProperty(t)}}function t1(t,r,i){var s,l=i+"",c;return function(){var d=Ps(this,t);return d===l?null:d===s?c:c=r(s=d,i)}}function n1(t,r,i){var s,l,c;return function(){var d=Ps(this,t),h=i(this),y=h+"";return h==null&&(y=h=(this.style.removeProperty(t),Ps(this,t))),d===y?null:d===s&&y===l?c:(l=y,c=r(s=d,h))}}function r1(t,r){var i,s,l,c="style."+r,d="end."+c,h;return function(){var y=no(this,t),b=y.on,k=y.value[c]==null?h||(h=Xm(r)):void 0;(b!==i||l!==k)&&(s=(i=b).copy()).on(d,l=k),y.on=s}}function o1(t,r,i){var s=(t+="")=="transform"?iw:Ym;return r==null?this.styleTween(t,e1(t,s)).on("end.style."+t,Xm(t)):typeof r=="function"?this.styleTween(t,n1(t,s,Vf(this,"style."+t,r))).each(r1(this._id,t)):this.styleTween(t,t1(t,s,r),i).on("end.style."+t,null)}function i1(t,r,i){return function(s){this.style.setProperty(t,r.call(this,s),i)}}function s1(t,r,i){var s,l;function c(){var d=r.apply(this,arguments);return d!==l&&(s=(l=d)&&i1(t,d,i)),s}return c._value=r,c}function a1(t,r,i){var s="style."+(t+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(r==null)return this.tween(s,null);if(typeof r!="function")throw new Error;return this.tween(s,s1(t,r,i??""))}function l1(t){return function(){this.textContent=t}}function u1(t){return function(){var r=t(this);this.textContent=r??""}}function c1(t){return this.tween("text",typeof t=="function"?u1(Vf(this,"text",t)):l1(t==null?"":t+""))}function f1(t){return function(r){this.textContent=t.call(this,r)}}function d1(t){var r,i;function s(){var l=t.apply(this,arguments);return l!==i&&(r=(i=l)&&f1(l)),r}return s._value=t,s}function p1(t){var r="text";if(arguments.length<1)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,d1(t))}function h1(){for(var t=this._name,r=this._id,i=Qm(),s=this._groups,l=s.length,c=0;c<l;++c)for(var d=s[c],h=d.length,y,b=0;b<h;++b)if(y=d[b]){var k=zr(y,r);Cu(y,t,i,b,d,{time:k.time+k.delay+k.duration,delay:0,duration:k.duration,ease:k.ease})}return new To(s,this._parents,t,i)}function m1(){var t,r,i=this,s=i._id,l=i.size();return new Promise(function(c,d){var h={value:d},y={value:function(){--l===0&&c()}};i.each(function(){var b=no(this,s),k=b.on;k!==t&&(r=(t=k).copy(),r._.cancel.push(h),r._.interrupt.push(h),r._.end.push(y)),b.on=r}),l===0&&c()})}var g1=0;function To(t,r,i,s){this._groups=t,this._parents=r,this._name=i,this._id=s}function Qm(){return++g1}var Po=Aa.prototype;To.prototype={constructor:To,select:Qw,selectAll:Gw,selectChild:Po.selectChild,selectChildren:Po.selectChildren,filter:Vw,merge:Uw,selection:Zw,transition:h1,call:Po.call,nodes:Po.nodes,node:Po.node,size:Po.size,empty:Po.empty,each:Po.each,on:Ww,attr:Cw,attrTween:Tw,style:o1,styleTween:a1,text:c1,textTween:p1,remove:Xw,tween:ww,delay:Ow,duration:Dw,ease:Fw,easeVarying:Hw,end:m1,[Symbol.iterator]:Po[Symbol.iterator]};function y1(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var v1={time:null,delay:0,duration:250,ease:y1};function x1(t,r){for(var i;!(i=t.__transition)||!(i=i[r]);)if(!(t=t.parentNode))throw new Error(`transition ${r} not found`);return i}function w1(t){var r,i;t instanceof To?(r=t._id,t=t._name):(r=Qm(),(i=v1).time=Bf(),t=t==null?null:t+"");for(var s=this._groups,l=s.length,c=0;c<l;++c)for(var d=s[c],h=d.length,y,b=0;b<h;++b)(y=d[b])&&Cu(y,t,r,b,d,i||x1(y,r));return new To(s,this._parents,t,r)}Aa.prototype.interrupt=yw;Aa.prototype.transition=w1;const Yl=t=>()=>t;function b1(t,{sourceEvent:r,target:i,transform:s,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:l}})}function Mo(t,r,i){this.k=t,this.x=r,this.y=i}Mo.prototype={constructor:Mo,scale:function(t){return t===1?this:new Mo(this.k*t,this.x,this.y)},translate:function(t,r){return t===0&r===0?this:new Mo(this.k,this.x+this.k*t,this.y+this.k*r)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ju=new Mo(1,0,0);Gm.prototype=Mo.prototype;function Gm(t){for(;!t.__zoom;)if(!(t=t.parentNode))return ju;return t.__zoom}function sf(t){t.stopImmediatePropagation()}function xa(t){t.preventDefault(),t.stopImmediatePropagation()}function _1(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function S1(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function xh(){return this.__zoom||ju}function k1(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function N1(){return navigator.maxTouchPoints||"ontouchstart"in this}function E1(t,r,i){var s=t.invertX(r[0][0])-i[0][0],l=t.invertX(r[1][0])-i[1][0],c=t.invertY(r[0][1])-i[0][1],d=t.invertY(r[1][1])-i[1][1];return t.translate(l>s?(s+l)/2:Math.min(0,s)||Math.max(0,l),d>c?(c+d)/2:Math.min(0,c)||Math.max(0,d))}function Jm(){var t=_1,r=S1,i=E1,s=k1,l=N1,c=[0,1/0],d=[[-1/0,-1/0],[1/0,1/0]],h=250,y=nu,b=ku("start","zoom","end"),k,x,S,C=500,j=150,$=0,T=10;function I(L){L.property("__zoom",xh).on("wheel.zoom",ce,{passive:!1}).on("mousedown.zoom",de).on("dblclick.zoom",we).filter(l).on("touchstart.zoom",q).on("touchmove.zoom",fe).on("touchend.zoom touchcancel.zoom",xe).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}I.transform=function(L,le,G,ie){var z=L.selection?L.selection():L;z.property("__zoom",xh),L!==z?B(L,le,G,ie):z.interrupt().each(function(){H(this,arguments).event(ie).start().zoom(null,typeof le=="function"?le.apply(this,arguments):le).end()})},I.scaleBy=function(L,le,G,ie){I.scaleTo(L,function(){var z=this.__zoom.k,W=typeof le=="function"?le.apply(this,arguments):le;return z*W},G,ie)},I.scaleTo=function(L,le,G,ie){I.transform(L,function(){var z=r.apply(this,arguments),W=this.__zoom,F=G==null?R(z):typeof G=="function"?G.apply(this,arguments):G,A=W.invert(F),K=typeof le=="function"?le.apply(this,arguments):le;return i(P(U(W,K),F,A),z,d)},G,ie)},I.translateBy=function(L,le,G,ie){I.transform(L,function(){return i(this.__zoom.translate(typeof le=="function"?le.apply(this,arguments):le,typeof G=="function"?G.apply(this,arguments):G),r.apply(this,arguments),d)},null,ie)},I.translateTo=function(L,le,G,ie,z){I.transform(L,function(){var W=r.apply(this,arguments),F=this.__zoom,A=ie==null?R(W):typeof ie=="function"?ie.apply(this,arguments):ie;return i(ju.translate(A[0],A[1]).scale(F.k).translate(typeof le=="function"?-le.apply(this,arguments):-le,typeof G=="function"?-G.apply(this,arguments):-G),W,d)},ie,z)};function U(L,le){return le=Math.max(c[0],Math.min(c[1],le)),le===L.k?L:new Mo(le,L.x,L.y)}function P(L,le,G){var ie=le[0]-G[0]*L.k,z=le[1]-G[1]*L.k;return ie===L.x&&z===L.y?L:new Mo(L.k,ie,z)}function R(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function B(L,le,G,ie){L.on("start.zoom",function(){H(this,arguments).event(ie).start()}).on("interrupt.zoom end.zoom",function(){H(this,arguments).event(ie).end()}).tween("zoom",function(){var z=this,W=arguments,F=H(z,W).event(ie),A=r.apply(z,W),K=G==null?R(A):typeof G=="function"?G.apply(z,W):G,be=Math.max(A[1][0]-A[0][0],A[1][1]-A[0][1]),Se=z.__zoom,Me=typeof le=="function"?le.apply(z,W):le,Ie=y(Se.invert(K).concat(be/Se.k),Me.invert(K).concat(be/Me.k));return function(Ae){if(Ae===1)Ae=Me;else{var _e=Ie(Ae),ze=be/_e[2];Ae=new Mo(ze,K[0]-_e[0]*ze,K[1]-_e[1]*ze)}F.zoom(null,Ae)}})}function H(L,le,G){return!G&&L.__zooming||new Q(L,le)}function Q(L,le){this.that=L,this.args=le,this.active=0,this.sourceEvent=null,this.extent=r.apply(L,le),this.taps=0}Q.prototype={event:function(L){return L&&(this.sourceEvent=L),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(L,le){return this.mouse&&L!=="mouse"&&(this.mouse[1]=le.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=le.invert(this.touch0[0])),this.touch1&&L!=="touch"&&(this.touch1[1]=le.invert(this.touch1[0])),this.that.__zoom=le,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(L){var le=rr(this.that).datum();b.call(L,this.that,new b1(L,{sourceEvent:this.sourceEvent,target:I,transform:this.that.__zoom,dispatch:b}),le)}};function ce(L,...le){if(!t.apply(this,arguments))return;var G=H(this,le).event(L),ie=this.__zoom,z=Math.max(c[0],Math.min(c[1],ie.k*Math.pow(2,s.apply(this,arguments)))),W=Or(L);if(G.wheel)(G.mouse[0][0]!==W[0]||G.mouse[0][1]!==W[1])&&(G.mouse[1]=ie.invert(G.mouse[0]=W)),clearTimeout(G.wheel);else{if(ie.k===z)return;G.mouse=[W,ie.invert(W)],iu(this),G.start()}xa(L),G.wheel=setTimeout(F,j),G.zoom("mouse",i(P(U(ie,z),G.mouse[0],G.mouse[1]),G.extent,d));function F(){G.wheel=null,G.end()}}function de(L,...le){if(S||!t.apply(this,arguments))return;var G=L.currentTarget,ie=H(this,le,!0).event(L),z=rr(L.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",be,!0),W=Or(L,G),F=L.clientX,A=L.clientY;Om(L.view),sf(L),ie.mouse=[W,this.__zoom.invert(W)],iu(this),ie.start();function K(Se){if(xa(Se),!ie.moved){var Me=Se.clientX-F,Ie=Se.clientY-A;ie.moved=Me*Me+Ie*Ie>$}ie.event(Se).zoom("mouse",i(P(ie.that.__zoom,ie.mouse[0]=Or(Se,G),ie.mouse[1]),ie.extent,d))}function be(Se){z.on("mousemove.zoom mouseup.zoom",null),Rm(Se.view,ie.moved),xa(Se),ie.event(Se).end()}}function we(L,...le){if(t.apply(this,arguments)){var G=this.__zoom,ie=Or(L.changedTouches?L.changedTouches[0]:L,this),z=G.invert(ie),W=G.k*(L.shiftKey?.5:2),F=i(P(U(G,W),ie,z),r.apply(this,le),d);xa(L),h>0?rr(this).transition().duration(h).call(B,F,ie,L):rr(this).call(I.transform,F,ie,L)}}function q(L,...le){if(t.apply(this,arguments)){var G=L.touches,ie=G.length,z=H(this,le,L.changedTouches.length===ie).event(L),W,F,A,K;for(sf(L),F=0;F<ie;++F)A=G[F],K=Or(A,this),K=[K,this.__zoom.invert(K),A.identifier],z.touch0?!z.touch1&&z.touch0[2]!==K[2]&&(z.touch1=K,z.taps=0):(z.touch0=K,W=!0,z.taps=1+!!k);k&&(k=clearTimeout(k)),W&&(z.taps<2&&(x=K[0],k=setTimeout(function(){k=null},C)),iu(this),z.start())}}function fe(L,...le){if(this.__zooming){var G=H(this,le).event(L),ie=L.changedTouches,z=ie.length,W,F,A,K;for(xa(L),W=0;W<z;++W)F=ie[W],A=Or(F,this),G.touch0&&G.touch0[2]===F.identifier?G.touch0[0]=A:G.touch1&&G.touch1[2]===F.identifier&&(G.touch1[0]=A);if(F=G.that.__zoom,G.touch1){var be=G.touch0[0],Se=G.touch0[1],Me=G.touch1[0],Ie=G.touch1[1],Ae=(Ae=Me[0]-be[0])*Ae+(Ae=Me[1]-be[1])*Ae,_e=(_e=Ie[0]-Se[0])*_e+(_e=Ie[1]-Se[1])*_e;F=U(F,Math.sqrt(Ae/_e)),A=[(be[0]+Me[0])/2,(be[1]+Me[1])/2],K=[(Se[0]+Ie[0])/2,(Se[1]+Ie[1])/2]}else if(G.touch0)A=G.touch0[0],K=G.touch0[1];else return;G.zoom("touch",i(P(F,A,K),G.extent,d))}}function xe(L,...le){if(this.__zooming){var G=H(this,le).event(L),ie=L.changedTouches,z=ie.length,W,F;for(sf(L),S&&clearTimeout(S),S=setTimeout(function(){S=null},C),W=0;W<z;++W)F=ie[W],G.touch0&&G.touch0[2]===F.identifier?delete G.touch0:G.touch1&&G.touch1[2]===F.identifier&&delete G.touch1;if(G.touch1&&!G.touch0&&(G.touch0=G.touch1,delete G.touch1),G.touch0)G.touch0[1]=this.__zoom.invert(G.touch0[0]);else if(G.end(),G.taps===2&&(F=Or(F,this),Math.hypot(x[0]-F[0],x[1]-F[1])<T)){var A=rr(this).on("dblclick.zoom");A&&A.apply(this,arguments)}}}return I.wheelDelta=function(L){return arguments.length?(s=typeof L=="function"?L:Yl(+L),I):s},I.filter=function(L){return arguments.length?(t=typeof L=="function"?L:Yl(!!L),I):t},I.touchable=function(L){return arguments.length?(l=typeof L=="function"?L:Yl(!!L),I):l},I.extent=function(L){return arguments.length?(r=typeof L=="function"?L:Yl([[+L[0][0],+L[0][1]],[+L[1][0],+L[1][1]]]),I):r},I.scaleExtent=function(L){return arguments.length?(c[0]=+L[0],c[1]=+L[1],I):[c[0],c[1]]},I.translateExtent=function(L){return arguments.length?(d[0][0]=+L[0][0],d[1][0]=+L[1][0],d[0][1]=+L[0][1],d[1][1]=+L[1][1],I):[[d[0][0],d[0][1]],[d[1][0],d[1][1]]]},I.constrain=function(L){return arguments.length?(i=L,I):i},I.duration=function(L){return arguments.length?(h=+L,I):h},I.interpolate=function(L){return arguments.length?(y=L,I):y},I.on=function(){var L=b.on.apply(b,arguments);return L===b?I:L},I.clickDistance=function(L){return arguments.length?($=(L=+L)*L,I):Math.sqrt($)},I.tapDistance=function(L){return arguments.length?(T=+L,I):T},I}const eo={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:r,sourceHandle:i,targetHandle:s})=>`Couldn't create edge for ${t} handle id: "${t==="source"?i:s}", edge id: ${r}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},ja=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Zm=["Enter"," ","Escape"],e0={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:r,y:i})=>`Moved selected node ${t}. New position, x: ${r}, y: ${i}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var $s;(function(t){t.Strict="strict",t.Loose="loose"})($s||($s={}));var Li;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(Li||(Li={}));var Pa;(function(t){t.Partial="partial",t.Full="full"})(Pa||(Pa={}));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 fi;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(fi||(fi={}));var gu;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(gu||(gu={}));var Ze;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(Ze||(Ze={}));const wh={[Ze.Left]:Ze.Right,[Ze.Right]:Ze.Left,[Ze.Top]:Ze.Bottom,[Ze.Bottom]:Ze.Top};function n0(t){return t===null?null:t?"valid":"invalid"}const r0=t=>"id"in t&&"source"in t&&"target"in t,C1=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Uf=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),Ra=(t,r=[0,0])=>{const{width:i,height:s}=Io(t),l=t.origin??r,c=i*l[0],d=s*l[1];return{x:t.position.x-c,y:t.position.y-d}},j1=(t,r={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const i=t.reduce((s,l)=>{const c=typeof l=="string";let d=!r.nodeLookup&&!c?l:void 0;r.nodeLookup&&(d=c?r.nodeLookup.get(l):Uf(l)?l:r.nodeLookup.get(l.id));const h=d?yu(d,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Pu(s,h)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Mu(i)},La=(t,r={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return t.forEach(l=>{(r.filter===void 0||r.filter(l))&&(i=Pu(i,yu(l)),s=!0)}),s?Mu(i):{x:0,y:0,width:0,height:0}},Kf=(t,r,[i,s,l]=[0,0,1],c=!1,d=!1)=>{const h={...za(r,[i,s,l]),width:r.width/l,height:r.height/l},y=[];for(const b of t.values()){const{measured:k,selectable:x=!0,hidden:S=!1}=b;if(d&&!x||S)continue;const C=k.width??b.width??b.initialWidth??null,j=k.height??b.height??b.initialHeight??null,$=Ma(h,Is(b)),T=(C??0)*(j??0),I=c&&$>0;(!b.internals.handleBounds||I||$>=T||b.dragging)&&y.push(b)}return y},P1=(t,r)=>{const i=new Set;return t.forEach(s=>{i.add(s.id)}),r.filter(s=>i.has(s.source)||i.has(s.target))};function M1(t,r){const i=new Map,s=r!=null&&r.nodes?new Set(r.nodes.map(l=>l.id)):null;return t.forEach(l=>{l.measured.width&&l.measured.height&&((r==null?void 0:r.includeHiddenNodes)||!l.hidden)&&(!s||s.has(l.id))&&i.set(l.id,l)}),i}async function $1({nodes:t,width:r,height:i,panZoom:s,minZoom:l,maxZoom:c},d){if(t.size===0)return Promise.resolve(!0);const h=M1(t,d),y=La(h),b=qf(y,r,i,(d==null?void 0:d.minZoom)??l,(d==null?void 0:d.maxZoom)??c,(d==null?void 0:d.padding)??.1);return await s.setViewport(b,{duration:d==null?void 0:d.duration,ease:d==null?void 0:d.ease,interpolate:d==null?void 0:d.interpolate}),Promise.resolve(!0)}function o0({nodeId:t,nextPosition:r,nodeLookup:i,nodeOrigin:s=[0,0],nodeExtent:l,onError:c}){const d=i.get(t),h=d.parentId?i.get(d.parentId):void 0,{x:y,y:b}=h?h.internals.positionAbsolute:{x:0,y:0},k=d.origin??s;let x=d.extent||l;if(d.extent==="parent"&&!d.expandParent)if(!h)c==null||c("005",eo.error005());else{const C=h.measured.width,j=h.measured.height;C&&j&&(x=[[y,b],[y+C,b+j]])}else h&&As(d.extent)&&(x=[[d.extent[0][0]+y,d.extent[0][1]+b],[d.extent[1][0]+y,d.extent[1][1]+b]]);const S=As(x)?Fi(r,x,d.measured):r;return(d.measured.width===void 0||d.measured.height===void 0)&&(c==null||c("015",eo.error015())),{position:{x:S.x-y+(d.measured.width??0)*k[0],y:S.y-b+(d.measured.height??0)*k[1]},positionAbsolute:S}}async function T1({nodesToRemove:t=[],edgesToRemove:r=[],nodes:i,edges:s,onBeforeDelete:l}){const c=new Set(t.map(S=>S.id)),d=[];for(const S of i){if(S.deletable===!1)continue;const C=c.has(S.id),j=!C&&S.parentId&&d.find($=>$.id===S.parentId);(C||j)&&d.push(S)}const h=new Set(r.map(S=>S.id)),y=s.filter(S=>S.deletable!==!1),k=P1(d,y);for(const S of y)h.has(S.id)&&!k.find(j=>j.id===S.id)&&k.push(S);if(!l)return{edges:k,nodes:d};const x=await l({nodes:d,edges:k});return typeof x=="boolean"?x?{edges:k,nodes:d}:{edges:[],nodes:[]}:x}const Ts=(t,r=0,i=1)=>Math.min(Math.max(t,r),i),Fi=(t={x:0,y:0},r,i)=>({x:Ts(t.x,r[0][0],r[1][0]-((i==null?void 0:i.width)??0)),y:Ts(t.y,r[0][1],r[1][1]-((i==null?void 0:i.height)??0))});function i0(t,r,i){const{width:s,height:l}=Io(i),{x:c,y:d}=i.internals.positionAbsolute;return Fi(t,[[c,d],[c+s,d+l]],r)}const bh=(t,r,i)=>t<r?Ts(Math.abs(t-r),1,r)/r:t>i?-Ts(Math.abs(t-i),1,r)/r:0,s0=(t,r,i=15,s=40)=>{const l=bh(t.x,s,r.width-s)*i,c=bh(t.y,s,r.height-s)*i;return[l,c]},Pu=(t,r)=>({x:Math.min(t.x,r.x),y:Math.min(t.y,r.y),x2:Math.max(t.x2,r.x2),y2:Math.max(t.y2,r.y2)}),Pf=({x:t,y:r,width:i,height:s})=>({x:t,y:r,x2:t+i,y2:r+s}),Mu=({x:t,y:r,x2:i,y2:s})=>({x:t,y:r,width:i-t,height:s-r}),Is=(t,r=[0,0])=>{var l,c;const{x:i,y:s}=Uf(t)?t.internals.positionAbsolute:Ra(t,r);return{x:i,y:s,width:((l=t.measured)==null?void 0:l.width)??t.width??t.initialWidth??0,height:((c=t.measured)==null?void 0:c.height)??t.height??t.initialHeight??0}},yu=(t,r=[0,0])=>{var l,c;const{x:i,y:s}=Uf(t)?t.internals.positionAbsolute:Ra(t,r);return{x:i,y:s,x2:i+(((l=t.measured)==null?void 0:l.width)??t.width??t.initialWidth??0),y2:s+(((c=t.measured)==null?void 0:c.height)??t.height??t.initialHeight??0)}},a0=(t,r)=>Mu(Pu(Pf(t),Pf(r))),Ma=(t,r)=>{const i=Math.max(0,Math.min(t.x+t.width,r.x+r.width)-Math.max(t.x,r.x)),s=Math.max(0,Math.min(t.y+t.height,r.y+r.height)-Math.max(t.y,r.y));return Math.ceil(i*s)},_h=t=>Lr(t.width)&&Lr(t.height)&&Lr(t.x)&&Lr(t.y),Lr=t=>!isNaN(t)&&isFinite(t),I1=(t,r)=>{},Da=(t,r=[1,1])=>({x:r[0]*Math.round(t.x/r[0]),y:r[1]*Math.round(t.y/r[1])}),za=({x:t,y:r},[i,s,l],c=!1,d=[1,1])=>{const h={x:(t-i)/l,y:(r-s)/l};return c?Da(h,d):h},vu=({x:t,y:r},[i,s,l])=>({x:t*l+i,y:r*l+s});function _s(t,r){if(typeof t=="number")return Math.floor((r-r/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(i)}if(typeof t=="string"&&t.endsWith("%")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(r*i*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function A1(t,r,i){if(typeof t=="string"||typeof t=="number"){const s=_s(t,i),l=_s(t,r);return{top:s,right:l,bottom:s,left:l,x:l*2,y:s*2}}if(typeof t=="object"){const s=_s(t.top??t.y??0,i),l=_s(t.bottom??t.y??0,i),c=_s(t.left??t.x??0,r),d=_s(t.right??t.x??0,r);return{top:s,right:d,bottom:l,left:c,x:c+d,y:s+l}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function O1(t,r,i,s,l,c){const{x:d,y:h}=vu(t,[r,i,s]),{x:y,y:b}=vu({x:t.x+t.width,y:t.y+t.height},[r,i,s]),k=l-y,x=c-b;return{left:Math.floor(d),top:Math.floor(h),right:Math.floor(k),bottom:Math.floor(x)}}const qf=(t,r,i,s,l,c)=>{const d=A1(c,r,i),h=(r-d.x)/t.width,y=(i-d.y)/t.height,b=Math.min(h,y),k=Ts(b,s,l),x=t.x+t.width/2,S=t.y+t.height/2,C=r/2-x*k,j=i/2-S*k,$=O1(t,C,j,k,r,i),T={left:Math.min($.left-d.left,0),top:Math.min($.top-d.top,0),right:Math.min($.right-d.right,0),bottom:Math.min($.bottom-d.bottom,0)};return{x:C-T.left+T.right,y:j-T.top+T.bottom,zoom:k}},$a=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function As(t){return t!=null&&t!=="parent"}function Io(t){var r,i;return{width:((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth??0,height:((i=t.measured)==null?void 0:i.height)??t.height??t.initialHeight??0}}function l0(t){var r,i;return(((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth)!==void 0&&(((i=t.measured)==null?void 0:i.height)??t.height??t.initialHeight)!==void 0}function u0(t,r={width:0,height:0},i,s,l){const c={...t},d=s.get(i);if(d){const h=d.origin||l;c.x+=d.internals.positionAbsolute.x-(r.width??0)*h[0],c.y+=d.internals.positionAbsolute.y-(r.height??0)*h[1]}return c}function Sh(t,r){if(t.size!==r.size)return!1;for(const i of t)if(!r.has(i))return!1;return!0}function R1(){let t,r;return{promise:new Promise((s,l)=>{t=s,r=l}),resolve:t,reject:r}}function L1(t){return{...e0,...t||{}}}function Sa(t,{snapGrid:r=[0,0],snapToGrid:i=!1,transform:s,containerBounds:l}){const{x:c,y:d}=Dr(t),h=za({x:c-((l==null?void 0:l.left)??0),y:d-((l==null?void 0:l.top)??0)},s),{x:y,y:b}=i?Da(h,r):h;return{xSnapped:y,ySnapped:b,...h}}const Wf=t=>({width:t.offsetWidth,height:t.offsetHeight}),c0=t=>{var r;return((r=t==null?void 0:t.getRootNode)==null?void 0:r.call(t))||(window==null?void 0:window.document)},D1=["INPUT","SELECT","TEXTAREA"];function f0(t){var s,l;const r=((l=(s=t.composedPath)==null?void 0:s.call(t))==null?void 0:l[0])||t.target;return(r==null?void 0:r.nodeType)!==1?!1:D1.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const d0=t=>"clientX"in t,Dr=(t,r)=>{var c,d;const i=d0(t),s=i?t.clientX:(c=t.touches)==null?void 0:c[0].clientX,l=i?t.clientY:(d=t.touches)==null?void 0:d[0].clientY;return{x:s-((r==null?void 0:r.left)??0),y:l-((r==null?void 0:r.top)??0)}},kh=(t,r,i,s,l)=>{const c=r.querySelectorAll(`.${t}`);return!c||!c.length?null:Array.from(c).map(d=>{const h=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),type:t,nodeId:l,position:d.getAttribute("data-handlepos"),x:(h.left-i.left)/s,y:(h.top-i.top)/s,...Wf(d)}})};function p0({sourceX:t,sourceY:r,targetX:i,targetY:s,sourceControlX:l,sourceControlY:c,targetControlX:d,targetControlY:h}){const y=t*.125+l*.375+d*.375+i*.125,b=r*.125+c*.375+h*.375+s*.125,k=Math.abs(y-t),x=Math.abs(b-r);return[y,b,k,x]}function Xl(t,r){return t>=0?.5*t:r*25*Math.sqrt(-t)}function Nh({pos:t,x1:r,y1:i,x2:s,y2:l,c}){switch(t){case Ze.Left:return[r-Xl(r-s,c),i];case Ze.Right:return[r+Xl(s-r,c),i];case Ze.Top:return[r,i-Xl(i-l,c)];case Ze.Bottom:return[r,i+Xl(l-i,c)]}}function h0({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:s,targetY:l,targetPosition:c=Ze.Top,curvature:d=.25}){const[h,y]=Nh({pos:i,x1:t,y1:r,x2:s,y2:l,c:d}),[b,k]=Nh({pos:c,x1:s,y1:l,x2:t,y2:r,c:d}),[x,S,C,j]=p0({sourceX:t,sourceY:r,targetX:s,targetY:l,sourceControlX:h,sourceControlY:y,targetControlX:b,targetControlY:k});return[`M${t},${r} C${h},${y} ${b},${k} ${s},${l}`,x,S,C,j]}function m0({sourceX:t,sourceY:r,targetX:i,targetY:s}){const l=Math.abs(i-t)/2,c=i<t?i+l:i-l,d=Math.abs(s-r)/2,h=s<r?s+d:s-d;return[c,h,l,d]}function z1({sourceNode:t,targetNode:r,selected:i=!1,zIndex:s=0,elevateOnSelect:l=!1,zIndexMode:c="basic"}){if(c==="manual")return s;const d=l&&i?s+1e3:s,h=Math.max(t.parentId||l&&t.selected?t.internals.z:0,r.parentId||l&&r.selected?r.internals.z:0);return d+h}function F1({sourceNode:t,targetNode:r,width:i,height:s,transform:l}){const c=Pu(yu(t),yu(r));c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const d={x:-l[0]/l[2],y:-l[1]/l[2],width:i/l[2],height:s/l[2]};return Ma(d,Mu(c))>0}const B1=({source:t,sourceHandle:r,target:i,targetHandle:s})=>`xy-edge__${t}${r||""}-${i}${s||""}`,H1=(t,r)=>r.some(i=>i.source===t.source&&i.target===t.target&&(i.sourceHandle===t.sourceHandle||!i.sourceHandle&&!t.sourceHandle)&&(i.targetHandle===t.targetHandle||!i.targetHandle&&!t.targetHandle)),g0=(t,r,i={})=>{if(!t.source||!t.target)return r;const s=i.getEdgeId||B1;let l;return r0(t)?l={...t}:l={...t,id:s(t)},H1(l,r)?r:(l.sourceHandle===null&&delete l.sourceHandle,l.targetHandle===null&&delete l.targetHandle,r.concat(l))};function y0({sourceX:t,sourceY:r,targetX:i,targetY:s}){const[l,c,d,h]=m0({sourceX:t,sourceY:r,targetX:i,targetY:s});return[`M ${t},${r}L ${i},${s}`,l,c,d,h]}const Eh={[Ze.Left]:{x:-1,y:0},[Ze.Right]:{x:1,y:0},[Ze.Top]:{x:0,y:-1},[Ze.Bottom]:{x:0,y:1}},V1=({source:t,sourcePosition:r=Ze.Bottom,target:i})=>r===Ze.Left||r===Ze.Right?t.x<i.x?{x:1,y:0}:{x:-1,y:0}:t.y<i.y?{x:0,y:1}:{x:0,y:-1},Ch=(t,r)=>Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2));function U1({source:t,sourcePosition:r=Ze.Bottom,target:i,targetPosition:s=Ze.Top,center:l,offset:c,stepPosition:d}){const h=Eh[r],y=Eh[s],b={x:t.x+h.x*c,y:t.y+h.y*c},k={x:i.x+y.x*c,y:i.y+y.y*c},x=V1({source:b,sourcePosition:r,target:k}),S=x.x!==0?"x":"y",C=x[S];let j=[],$,T;const I={x:0,y:0},U={x:0,y:0},[,,P,R]=m0({sourceX:t.x,sourceY:t.y,targetX:i.x,targetY:i.y});if(h[S]*y[S]===-1){S==="x"?($=l.x??b.x+(k.x-b.x)*d,T=l.y??(b.y+k.y)/2):($=l.x??(b.x+k.x)/2,T=l.y??b.y+(k.y-b.y)*d);const ce=[{x:$,y:b.y},{x:$,y:k.y}],de=[{x:b.x,y:T},{x:k.x,y:T}];h[S]===C?j=S==="x"?ce:de:j=S==="x"?de:ce}else{const ce=[{x:b.x,y:k.y}],de=[{x:k.x,y:b.y}];if(S==="x"?j=h.x===C?de:ce:j=h.y===C?ce:de,r===s){const L=Math.abs(t[S]-i[S]);if(L<=c){const le=Math.min(c-1,c-L);h[S]===C?I[S]=(b[S]>t[S]?-1:1)*le:U[S]=(k[S]>i[S]?-1:1)*le}}if(r!==s){const L=S==="x"?"y":"x",le=h[S]===y[L],G=b[L]>k[L],ie=b[L]<k[L];(h[S]===1&&(!le&&G||le&&ie)||h[S]!==1&&(!le&&ie||le&&G))&&(j=S==="x"?ce:de)}const we={x:b.x+I.x,y:b.y+I.y},q={x:k.x+U.x,y:k.y+U.y},fe=Math.max(Math.abs(we.x-j[0].x),Math.abs(q.x-j[0].x)),xe=Math.max(Math.abs(we.y-j[0].y),Math.abs(q.y-j[0].y));fe>=xe?($=(we.x+q.x)/2,T=j[0].y):($=j[0].x,T=(we.y+q.y)/2)}const B={x:b.x+I.x,y:b.y+I.y},H={x:k.x+U.x,y:k.y+U.y};return[[t,...B.x!==j[0].x||B.y!==j[0].y?[B]:[],...j,...H.x!==j[j.length-1].x||H.y!==j[j.length-1].y?[H]:[],i],$,T,P,R]}function K1(t,r,i,s){const l=Math.min(Ch(t,r)/2,Ch(r,i)/2,s),{x:c,y:d}=r;if(t.x===c&&c===i.x||t.y===d&&d===i.y)return`L${c} ${d}`;if(t.y===d){const b=t.x<i.x?-1:1,k=t.y<i.y?1:-1;return`L ${c+l*b},${d}Q ${c},${d} ${c},${d+l*k}`}const h=t.x<i.x?1:-1,y=t.y<i.y?-1:1;return`L ${c},${d+l*y}Q ${c},${d} ${c+l*h},${d}`}function Mf({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:s,targetY:l,targetPosition:c=Ze.Top,borderRadius:d=5,centerX:h,centerY:y,offset:b=20,stepPosition:k=.5}){const[x,S,C,j,$]=U1({source:{x:t,y:r},sourcePosition:i,target:{x:s,y:l},targetPosition:c,center:{x:h,y},offset:b,stepPosition:k});let T=`M${x[0].x} ${x[0].y}`;for(let I=1;I<x.length-1;I++)T+=K1(x[I-1],x[I],x[I+1],d);return T+=`L${x[x.length-1].x} ${x[x.length-1].y}`,[T,S,C,j,$]}function jh(t){var r;return t&&!!(t.internals.handleBounds||(r=t.handles)!=null&&r.length)&&!!(t.measured.width||t.width||t.initialWidth)}function q1(t){var x;const{sourceNode:r,targetNode:i}=t;if(!jh(r)||!jh(i))return null;const s=r.internals.handleBounds||Ph(r.handles),l=i.internals.handleBounds||Ph(i.handles),c=Mh((s==null?void 0:s.source)??[],t.sourceHandle),d=Mh(t.connectionMode===$s.Strict?(l==null?void 0:l.target)??[]:((l==null?void 0:l.target)??[]).concat((l==null?void 0:l.source)??[]),t.targetHandle);if(!c||!d)return(x=t.onError)==null||x.call(t,"008",eo.error008(c?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const h=(c==null?void 0:c.position)||Ze.Bottom,y=(d==null?void 0:d.position)||Ze.Top,b=Bi(r,c,h),k=Bi(i,d,y);return{sourceX:b.x,sourceY:b.y,targetX:k.x,targetY:k.y,sourcePosition:h,targetPosition:y}}function Ph(t){if(!t)return null;const r=[],i=[];for(const s of t)s.width=s.width??1,s.height=s.height??1,s.type==="source"?r.push(s):s.type==="target"&&i.push(s);return{source:r,target:i}}function Bi(t,r,i=Ze.Left,s=!1){const l=((r==null?void 0:r.x)??0)+t.internals.positionAbsolute.x,c=((r==null?void 0:r.y)??0)+t.internals.positionAbsolute.y,{width:d,height:h}=r??Io(t);if(s)return{x:l+d/2,y:c+h/2};switch((r==null?void 0:r.position)??i){case Ze.Top:return{x:l+d/2,y:c};case Ze.Right:return{x:l+d,y:c+h/2};case Ze.Bottom:return{x:l+d/2,y:c+h};case Ze.Left:return{x:l,y:c+h/2}}}function Mh(t,r){return t&&(r?t.find(i=>i.id===r):t[0])||null}function $f(t,r){return t?typeof t=="string"?t:`${r?`${r}__`:""}${Object.keys(t).sort().map(s=>`${s}=${t[s]}`).join("&")}`:""}function W1(t,{id:r,defaultColor:i,defaultMarkerStart:s,defaultMarkerEnd:l}){const c=new Set;return t.reduce((d,h)=>([h.markerStart||s,h.markerEnd||l].forEach(y=>{if(y&&typeof y=="object"){const b=$f(y,r);c.has(b)||(d.push({id:b,color:y.color||i,...y}),c.add(b))}}),d),[]).sort((d,h)=>d.id.localeCompare(h.id))}const v0=1e3,Y1=10,Yf={nodeOrigin:[0,0],nodeExtent:ja,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},X1={...Yf,checkEquality:!0};function Xf(t,r){const i={...t};for(const s in r)r[s]!==void 0&&(i[s]=r[s]);return i}function Q1(t,r,i){const s=Xf(Yf,i);for(const l of t.values())if(l.parentId)Gf(l,t,r,s);else{const c=Ra(l,s.nodeOrigin),d=As(l.extent)?l.extent:s.nodeExtent,h=Fi(c,d,Io(l));l.internals.positionAbsolute=h}}function G1(t,r){if(!t.handles)return t.measured?r==null?void 0:r.internals.handleBounds:void 0;const i=[],s=[];for(const l of t.handles){const c={id:l.id,width:l.width??1,height:l.height??1,nodeId:t.id,x:l.x,y:l.y,position:l.position,type:l.type};l.type==="source"?i.push(c):l.type==="target"&&s.push(c)}return{source:i,target:s}}function Qf(t){return t==="manual"}function Tf(t,r,i,s={}){var k,x;const l=Xf(X1,s),c={i:0},d=new Map(r),h=l!=null&&l.elevateNodesOnSelect&&!Qf(l.zIndexMode)?v0:0;let y=t.length>0,b=!1;r.clear(),i.clear();for(const S of t){let C=d.get(S.id);if(l.checkEquality&&S===(C==null?void 0:C.internals.userNode))r.set(S.id,C);else{const j=Ra(S,l.nodeOrigin),$=As(S.extent)?S.extent:l.nodeExtent,T=Fi(j,$,Io(S));C={...l.defaults,...S,measured:{width:(k=S.measured)==null?void 0:k.width,height:(x=S.measured)==null?void 0:x.height},internals:{positionAbsolute:T,handleBounds:G1(S,C),z:x0(S,h,l.zIndexMode),userNode:S}},r.set(S.id,C)}(C.measured===void 0||C.measured.width===void 0||C.measured.height===void 0)&&!C.hidden&&(y=!1),S.parentId&&Gf(C,r,i,s,c),b||(b=S.selected??!1)}return{nodesInitialized:y,hasSelectedNodes:b}}function J1(t,r){if(!t.parentId)return;const i=r.get(t.parentId);i?i.set(t.id,t):r.set(t.parentId,new Map([[t.id,t]]))}function Gf(t,r,i,s,l){const{elevateNodesOnSelect:c,nodeOrigin:d,nodeExtent:h,zIndexMode:y}=Xf(Yf,s),b=t.parentId,k=r.get(b);if(!k){console.warn(`Parent node ${b} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}J1(t,i),l&&!k.parentId&&k.internals.rootParentIndex===void 0&&y==="auto"&&(k.internals.rootParentIndex=++l.i,k.internals.z=k.internals.z+l.i*Y1),l&&k.internals.rootParentIndex!==void 0&&(l.i=k.internals.rootParentIndex);const x=c&&!Qf(y)?v0:0,{x:S,y:C,z:j}=Z1(t,k,d,h,x,y),{positionAbsolute:$}=t.internals,T=S!==$.x||C!==$.y;(T||j!==t.internals.z)&&r.set(t.id,{...t,internals:{...t.internals,positionAbsolute:T?{x:S,y:C}:$,z:j}})}function x0(t,r,i){const s=Lr(t.zIndex)?t.zIndex:0;return Qf(i)?s:s+(t.selected?r:0)}function Z1(t,r,i,s,l,c){const{x:d,y:h}=r.internals.positionAbsolute,y=Io(t),b=Ra(t,i),k=As(t.extent)?Fi(b,t.extent,y):b;let x=Fi({x:d+k.x,y:h+k.y},s,y);t.extent==="parent"&&(x=i0(x,y,r));const S=x0(t,l,c),C=r.internals.z??0;return{x:x.x,y:x.y,z:C>=S?C+1:S}}function Jf(t,r,i,s=[0,0]){var d;const l=[],c=new Map;for(const h of t){const y=r.get(h.parentId);if(!y)continue;const b=((d=c.get(h.parentId))==null?void 0:d.expandedRect)??Is(y),k=a0(b,h.rect);c.set(h.parentId,{expandedRect:k,parent:y})}return c.size>0&&c.forEach(({expandedRect:h,parent:y},b)=>{var P;const k=y.internals.positionAbsolute,x=Io(y),S=y.origin??s,C=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,$=Math.max(x.width,Math.round(h.width)),T=Math.max(x.height,Math.round(h.height)),I=($-x.width)*S[0],U=(T-x.height)*S[1];(C>0||j>0||I||U)&&(l.push({id:b,type:"position",position:{x:y.position.x-C+I,y:y.position.y-j+U}}),(P=i.get(b))==null||P.forEach(R=>{t.some(B=>B.id===R.id)||l.push({id:R.id,type:"position",position:{x:R.position.x+C,y:R.position.y+j}})})),(x.width<h.width||x.height<h.height||C||j)&&l.push({id:b,type:"dimensions",setAttributes:!0,dimensions:{width:$+(C?S[0]*C-I:0),height:T+(j?S[1]*j-U:0)}})}),l}function eb(t,r,i,s,l,c,d){const h=s==null?void 0:s.querySelector(".xyflow__viewport");let y=!1;if(!h)return{changes:[],updatedInternals:y};const b=[],k=window.getComputedStyle(h),{m22:x}=new window.DOMMatrixReadOnly(k.transform),S=[];for(const C of t.values()){const j=r.get(C.id);if(!j)continue;if(j.hidden){r.set(j.id,{...j,internals:{...j.internals,handleBounds:void 0}}),y=!0;continue}const $=Wf(C.nodeElement),T=j.measured.width!==$.width||j.measured.height!==$.height;if(!!($.width&&$.height&&(T||!j.internals.handleBounds||C.force))){const U=C.nodeElement.getBoundingClientRect(),P=As(j.extent)?j.extent:c;let{positionAbsolute:R}=j.internals;j.parentId&&j.extent==="parent"?R=i0(R,$,r.get(j.parentId)):P&&(R=Fi(R,P,$));const B={...j,measured:$,internals:{...j.internals,positionAbsolute:R,handleBounds:{source:kh("source",C.nodeElement,U,x,j.id),target:kh("target",C.nodeElement,U,x,j.id)}}};r.set(j.id,B),j.parentId&&Gf(B,r,i,{nodeOrigin:l,zIndexMode:d}),y=!0,T&&(b.push({id:j.id,type:"dimensions",dimensions:$}),j.expandParent&&j.parentId&&S.push({id:j.id,parentId:j.parentId,rect:Is(B,l)}))}}if(S.length>0){const C=Jf(S,r,i,l);b.push(...C)}return{changes:b,updatedInternals:y}}async function tb({delta:t,panZoom:r,transform:i,translateExtent:s,width:l,height:c}){if(!r||!t.x&&!t.y)return Promise.resolve(!1);const d=await r.setViewportConstrained({x:i[0]+t.x,y:i[1]+t.y,zoom:i[2]},[[0,0],[l,c]],s),h=!!d&&(d.x!==i[0]||d.y!==i[1]||d.k!==i[2]);return Promise.resolve(h)}function $h(t,r,i,s,l,c){let d=l;const h=s.get(d)||new Map;s.set(d,h.set(i,r)),d=`${l}-${t}`;const y=s.get(d)||new Map;if(s.set(d,y.set(i,r)),c){d=`${l}-${t}-${c}`;const b=s.get(d)||new Map;s.set(d,b.set(i,r))}}function w0(t,r,i){t.clear(),r.clear();for(const s of i){const{source:l,target:c,sourceHandle:d=null,targetHandle:h=null}=s,y={edgeId:s.id,source:l,target:c,sourceHandle:d,targetHandle:h},b=`${l}-${d}--${c}-${h}`,k=`${c}-${h}--${l}-${d}`;$h("source",y,k,t,l,d),$h("target",y,b,t,c,h),r.set(s.id,s)}}function b0(t,r){if(!t.parentId)return!1;const i=r.get(t.parentId);return i?i.selected?!0:b0(i,r):!1}function Th(t,r,i){var l;let s=t;do{if((l=s==null?void 0:s.matches)!=null&&l.call(s,r))return!0;if(s===i)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function nb(t,r,i,s){const l=new Map;for(const[c,d]of t)if((d.selected||d.id===s)&&(!d.parentId||!b0(d,t))&&(d.draggable||r&&typeof d.draggable>"u")){const h=t.get(c);h&&l.set(c,{id:c,position:h.position||{x:0,y:0},distance:{x:i.x-h.internals.positionAbsolute.x,y:i.y-h.internals.positionAbsolute.y},extent:h.extent,parentId:h.parentId,origin:h.origin,expandParent:h.expandParent,internals:{positionAbsolute:h.internals.positionAbsolute||{x:0,y:0}},measured:{width:h.measured.width??0,height:h.measured.height??0}})}return l}function af({nodeId:t,dragItems:r,nodeLookup:i,dragging:s=!0}){var d,h,y;const l=[];for(const[b,k]of r){const x=(d=i.get(b))==null?void 0:d.internals.userNode;x&&l.push({...x,position:k.position,dragging:s})}if(!t)return[l[0],l];const c=(h=i.get(t))==null?void 0:h.internals.userNode;return[c?{...c,position:((y=r.get(t))==null?void 0:y.position)||c.position,dragging:s}:l[0],l]}function rb({dragItems:t,snapGrid:r,x:i,y:s}){const l=t.values().next().value;if(!l)return null;const c={x:i-l.distance.x,y:s-l.distance.y},d=Da(c,r);return{x:d.x-c.x,y:d.y-c.y}}function ob({onNodeMouseDown:t,getStoreItems:r,onDragStart:i,onDrag:s,onDragStop:l}){let c={x:null,y:null},d=0,h=new Map,y=!1,b={x:0,y:0},k=null,x=!1,S=null,C=!1,j=!1,$=null;function T({noDragClassName:U,handleSelector:P,domNode:R,isSelectable:B,nodeId:H,nodeClickDistance:Q=0}){S=rr(R);function ce({x:fe,y:xe}){const{nodeLookup:L,nodeExtent:le,snapGrid:G,snapToGrid:ie,nodeOrigin:z,onNodeDrag:W,onSelectionDrag:F,onError:A,updateNodePositions:K}=r();c={x:fe,y:xe};let be=!1;const Se=h.size>1,Me=Se&&le?Pf(La(h)):null,Ie=Se&&ie?rb({dragItems:h,snapGrid:G,x:fe,y:xe}):null;for(const[Ae,_e]of h){if(!L.has(Ae))continue;let ze={x:fe-_e.distance.x,y:xe-_e.distance.y};ie&&(ze=Ie?{x:Math.round(ze.x+Ie.x),y:Math.round(ze.y+Ie.y)}:Da(ze,G));let ke=null;if(Se&&le&&!_e.extent&&Me){const{positionAbsolute:Ke}=_e.internals,lt=Ke.x-Me.x+le[0][0],ut=Ke.x+_e.measured.width-Me.x2+le[1][0],at=Ke.y-Me.y+le[0][1],Nt=Ke.y+_e.measured.height-Me.y2+le[1][1];ke=[[lt,at],[ut,Nt]]}const{position:He,positionAbsolute:Oe}=o0({nodeId:Ae,nextPosition:ze,nodeLookup:L,nodeExtent:ke||le,nodeOrigin:z,onError:A});be=be||_e.position.x!==He.x||_e.position.y!==He.y,_e.position=He,_e.internals.positionAbsolute=Oe}if(j=j||be,!!be&&(K(h,!0),$&&(s||W||!H&&F))){const[Ae,_e]=af({nodeId:H,dragItems:h,nodeLookup:L});s==null||s($,h,Ae,_e),W==null||W($,Ae,_e),H||F==null||F($,_e)}}async function de(){if(!k)return;const{transform:fe,panBy:xe,autoPanSpeed:L,autoPanOnNodeDrag:le}=r();if(!le){y=!1,cancelAnimationFrame(d);return}const[G,ie]=s0(b,k,L);(G!==0||ie!==0)&&(c.x=(c.x??0)-G/fe[2],c.y=(c.y??0)-ie/fe[2],await xe({x:G,y:ie})&&ce(c)),d=requestAnimationFrame(de)}function we(fe){var Se;const{nodeLookup:xe,multiSelectionActive:L,nodesDraggable:le,transform:G,snapGrid:ie,snapToGrid:z,selectNodesOnDrag:W,onNodeDragStart:F,onSelectionDragStart:A,unselectNodesAndEdges:K}=r();x=!0,(!W||!B)&&!L&&H&&((Se=xe.get(H))!=null&&Se.selected||K()),B&&W&&H&&(t==null||t(H));const be=Sa(fe.sourceEvent,{transform:G,snapGrid:ie,snapToGrid:z,containerBounds:k});if(c=be,h=nb(xe,le,be,H),h.size>0&&(i||F||!H&&A)){const[Me,Ie]=af({nodeId:H,dragItems:h,nodeLookup:xe});i==null||i(fe.sourceEvent,h,Me,Ie),F==null||F(fe.sourceEvent,Me,Ie),H||A==null||A(fe.sourceEvent,Ie)}}const q=Lm().clickDistance(Q).on("start",fe=>{const{domNode:xe,nodeDragThreshold:L,transform:le,snapGrid:G,snapToGrid:ie}=r();k=(xe==null?void 0:xe.getBoundingClientRect())||null,C=!1,j=!1,$=fe.sourceEvent,L===0&&we(fe),c=Sa(fe.sourceEvent,{transform:le,snapGrid:G,snapToGrid:ie,containerBounds:k}),b=Dr(fe.sourceEvent,k)}).on("drag",fe=>{const{autoPanOnNodeDrag:xe,transform:L,snapGrid:le,snapToGrid:G,nodeDragThreshold:ie,nodeLookup:z}=r(),W=Sa(fe.sourceEvent,{transform:L,snapGrid:le,snapToGrid:G,containerBounds:k});if($=fe.sourceEvent,(fe.sourceEvent.type==="touchmove"&&fe.sourceEvent.touches.length>1||H&&!z.has(H))&&(C=!0),!C){if(!y&&xe&&x&&(y=!0,de()),!x){const F=Dr(fe.sourceEvent,k),A=F.x-b.x,K=F.y-b.y;Math.sqrt(A*A+K*K)>ie&&we(fe)}(c.x!==W.xSnapped||c.y!==W.ySnapped)&&h&&x&&(b=Dr(fe.sourceEvent,k),ce(W))}}).on("end",fe=>{if(!(!x||C)&&(y=!1,x=!1,cancelAnimationFrame(d),h.size>0)){const{nodeLookup:xe,updateNodePositions:L,onNodeDragStop:le,onSelectionDragStop:G}=r();if(j&&(L(h,!1),j=!1),l||le||!H&&G){const[ie,z]=af({nodeId:H,dragItems:h,nodeLookup:xe,dragging:!1});l==null||l(fe.sourceEvent,h,ie,z),le==null||le(fe.sourceEvent,ie,z),H||G==null||G(fe.sourceEvent,z)}}}).filter(fe=>{const xe=fe.target;return!fe.button&&(!U||!Th(xe,`.${U}`,R))&&(!P||Th(xe,P,R))});S.call(q)}function I(){S==null||S.on(".drag",null)}return{update:T,destroy:I}}function ib(t,r,i){const s=[],l={x:t.x-i,y:t.y-i,width:i*2,height:i*2};for(const c of r.values())Ma(l,Is(c))>0&&s.push(c);return s}const sb=250;function ab(t,r,i,s){var h,y;let l=[],c=1/0;const d=ib(t,i,r+sb);for(const b of d){const k=[...((h=b.internals.handleBounds)==null?void 0:h.source)??[],...((y=b.internals.handleBounds)==null?void 0:y.target)??[]];for(const x of k){if(s.nodeId===x.nodeId&&s.type===x.type&&s.id===x.id)continue;const{x:S,y:C}=Bi(b,x,x.position,!0),j=Math.sqrt(Math.pow(S-t.x,2)+Math.pow(C-t.y,2));j>r||(j<c?(l=[{...x,x:S,y:C}],c=j):j===c&&l.push({...x,x:S,y:C}))}}if(!l.length)return null;if(l.length>1){const b=s.type==="source"?"target":"source";return l.find(k=>k.type===b)??l[0]}return l[0]}function _0(t,r,i,s,l,c=!1){var b,k,x;const d=s.get(t);if(!d)return null;const h=l==="strict"?(b=d.internals.handleBounds)==null?void 0:b[r]:[...((k=d.internals.handleBounds)==null?void 0:k.source)??[],...((x=d.internals.handleBounds)==null?void 0:x.target)??[]],y=(i?h==null?void 0:h.find(S=>S.id===i):h==null?void 0:h[0])??null;return y&&c?{...y,...Bi(d,y,y.position,!0)}:y}function S0(t,r){return t||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function lb(t,r){let i=null;return r?i=!0:t&&!r&&(i=!1),i}const k0=()=>!0;function ub(t,{connectionMode:r,connectionRadius:i,handleId:s,nodeId:l,edgeUpdaterType:c,isTarget:d,domNode:h,nodeLookup:y,lib:b,autoPanOnConnect:k,flowId:x,panBy:S,cancelConnection:C,onConnectStart:j,onConnect:$,onConnectEnd:T,isValidConnection:I=k0,onReconnectEnd:U,updateConnection:P,getTransform:R,getFromHandle:B,autoPanSpeed:H,dragThreshold:Q=1,handleDomNode:ce}){const de=c0(t.target);let we=0,q;const{x:fe,y:xe}=Dr(t),L=S0(c,ce),le=h==null?void 0:h.getBoundingClientRect();let G=!1;if(!le||!L)return;const ie=_0(l,L,s,y,r);if(!ie)return;let z=Dr(t,le),W=!1,F=null,A=!1,K=null;function be(){if(!k||!le)return;const[He,Oe]=s0(z,le,H);S({x:He,y:Oe}),we=requestAnimationFrame(be)}const Se={...ie,nodeId:l,type:L,position:ie.position},Me=y.get(l);let Ae={inProgress:!0,isValid:null,from:Bi(Me,Se,Ze.Left,!0),fromHandle:Se,fromPosition:Se.position,fromNode:Me,to:z,toHandle:null,toPosition:wh[Se.position],toNode:null,pointer:z};function _e(){G=!0,P(Ae),j==null||j(t,{nodeId:l,handleId:s,handleType:L})}Q===0&&_e();function ze(He){if(!G){const{x:Nt,y:Xt}=Dr(He),Zt=Nt-fe,Vt=Xt-xe;if(!(Zt*Zt+Vt*Vt>Q*Q))return;_e()}if(!B()||!Se){ke(He);return}const Oe=R();z=Dr(He,le),q=ab(za(z,Oe,!1,[1,1]),i,y,Se),W||(be(),W=!0);const Ke=N0(He,{handle:q,connectionMode:r,fromNodeId:l,fromHandleId:s,fromType:d?"target":"source",isValidConnection:I,doc:de,lib:b,flowId:x,nodeLookup:y});K=Ke.handleDomNode,F=Ke.connection,A=lb(!!q,Ke.isValid);const lt=y.get(l),ut=lt?Bi(lt,Se,Ze.Left,!0):Ae.from,at={...Ae,from:ut,isValid:A,to:Ke.toHandle&&A?vu({x:Ke.toHandle.x,y:Ke.toHandle.y},Oe):z,toHandle:Ke.toHandle,toPosition:A&&Ke.toHandle?Ke.toHandle.position:wh[Se.position],toNode:Ke.toHandle?y.get(Ke.toHandle.nodeId):null,pointer:z};P(at),Ae=at}function ke(He){if(!("touches"in He&&He.touches.length>0)){if(G){(q||K)&&F&&A&&($==null||$(F));const{inProgress:Oe,...Ke}=Ae,lt={...Ke,toPosition:Ae.toHandle?Ae.toPosition:null};T==null||T(He,lt),c&&(U==null||U(He,lt))}C(),cancelAnimationFrame(we),W=!1,A=!1,F=null,K=null,de.removeEventListener("mousemove",ze),de.removeEventListener("mouseup",ke),de.removeEventListener("touchmove",ze),de.removeEventListener("touchend",ke)}}de.addEventListener("mousemove",ze),de.addEventListener("mouseup",ke),de.addEventListener("touchmove",ze),de.addEventListener("touchend",ke)}function N0(t,{handle:r,connectionMode:i,fromNodeId:s,fromHandleId:l,fromType:c,doc:d,lib:h,flowId:y,isValidConnection:b=k0,nodeLookup:k}){const x=c==="target",S=r?d.querySelector(`.${h}-flow__handle[data-id="${y}-${r==null?void 0:r.nodeId}-${r==null?void 0:r.id}-${r==null?void 0:r.type}"]`):null,{x:C,y:j}=Dr(t),$=d.elementFromPoint(C,j),T=$!=null&&$.classList.contains(`${h}-flow__handle`)?$:S,I={handleDomNode:T,isValid:!1,connection:null,toHandle:null};if(T){const U=S0(void 0,T),P=T.getAttribute("data-nodeid"),R=T.getAttribute("data-handleid"),B=T.classList.contains("connectable"),H=T.classList.contains("connectableend");if(!P||!U)return I;const Q={source:x?P:s,sourceHandle:x?R:l,target:x?s:P,targetHandle:x?l:R};I.connection=Q;const de=B&&H&&(i===$s.Strict?x&&U==="source"||!x&&U==="target":P!==s||R!==l);I.isValid=de&&b(Q),I.toHandle=_0(P,U,R,k,i,!0)}return I}const If={onPointerDown:ub,isValid:N0};function cb({domNode:t,panZoom:r,getTransform:i,getViewScale:s}){const l=rr(t);function c({translateExtent:h,width:y,height:b,zoomStep:k=1,pannable:x=!0,zoomable:S=!0,inversePan:C=!1}){const j=P=>{if(P.sourceEvent.type!=="wheel"||!r)return;const R=i(),B=P.sourceEvent.ctrlKey&&$a()?10:1,H=-P.sourceEvent.deltaY*(P.sourceEvent.deltaMode===1?.05:P.sourceEvent.deltaMode?1:.002)*k,Q=R[2]*Math.pow(2,H*B);r.scaleTo(Q)};let $=[0,0];const T=P=>{(P.sourceEvent.type==="mousedown"||P.sourceEvent.type==="touchstart")&&($=[P.sourceEvent.clientX??P.sourceEvent.touches[0].clientX,P.sourceEvent.clientY??P.sourceEvent.touches[0].clientY])},I=P=>{const R=i();if(P.sourceEvent.type!=="mousemove"&&P.sourceEvent.type!=="touchmove"||!r)return;const B=[P.sourceEvent.clientX??P.sourceEvent.touches[0].clientX,P.sourceEvent.clientY??P.sourceEvent.touches[0].clientY],H=[B[0]-$[0],B[1]-$[1]];$=B;const Q=s()*Math.max(R[2],Math.log(R[2]))*(C?-1:1),ce={x:R[0]-H[0]*Q,y:R[1]-H[1]*Q},de=[[0,0],[y,b]];r.setViewportConstrained({x:ce.x,y:ce.y,zoom:R[2]},de,h)},U=Jm().on("start",T).on("zoom",x?I:null).on("zoom.wheel",S?j:null);l.call(U,{})}function d(){l.on("zoom",null)}return{update:c,destroy:d,pointer:Or}}const $u=t=>({x:t.x,y:t.y,zoom:t.k}),lf=({x:t,y:r,zoom:i})=>ju.translate(t,r).scale(i),Ns=(t,r)=>t.target.closest(`.${r}`),E0=(t,r)=>r===2&&Array.isArray(t)&&t.includes(2),fb=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,uf=(t,r=0,i=fb,s=()=>{})=>{const l=typeof r=="number"&&r>0;return l||s(),l?t.transition().duration(r).ease(i).on("end",s):t},C0=t=>{const r=t.ctrlKey&&$a()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*r};function db({zoomPanValues:t,noWheelClassName:r,d3Selection:i,d3Zoom:s,panOnScrollMode:l,panOnScrollSpeed:c,zoomOnPinch:d,onPanZoomStart:h,onPanZoom:y,onPanZoomEnd:b}){return k=>{if(Ns(k,r))return k.ctrlKey&&k.preventDefault(),!1;k.preventDefault(),k.stopImmediatePropagation();const x=i.property("__zoom").k||1;if(k.ctrlKey&&d){const T=Or(k),I=C0(k),U=x*Math.pow(2,I);s.scaleTo(i,U,T,k);return}const S=k.deltaMode===1?20:1;let C=l===Li.Vertical?0:k.deltaX*S,j=l===Li.Horizontal?0:k.deltaY*S;!$a()&&k.shiftKey&&l!==Li.Vertical&&(C=k.deltaY*S,j=0),s.translateBy(i,-(C/x)*c,-(j/x)*c,{internal:!0});const $=$u(i.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(y==null||y(k,$),t.panScrollTimeout=setTimeout(()=>{b==null||b(k,$),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,h==null||h(k,$))}}function pb({noWheelClassName:t,preventScrolling:r,d3ZoomHandler:i}){return function(s,l){const c=s.type==="wheel",d=!r&&c&&!s.ctrlKey,h=Ns(s,t);if(s.ctrlKey&&c&&h&&s.preventDefault(),d||h)return null;s.preventDefault(),i.call(this,s,l)}}function hb({zoomPanValues:t,onDraggingChange:r,onPanZoomStart:i}){return s=>{var c,d,h;if((c=s.sourceEvent)!=null&&c.internal)return;const l=$u(s.transform);t.mouseButton=((d=s.sourceEvent)==null?void 0:d.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=l,((h=s.sourceEvent)==null?void 0:h.type)==="mousedown"&&r(!0),i&&(i==null||i(s.sourceEvent,l))}}function mb({zoomPanValues:t,panOnDrag:r,onPaneContextMenu:i,onTransformChange:s,onPanZoom:l}){return c=>{var d,h;t.usedRightMouseButton=!!(i&&E0(r,t.mouseButton??0)),(d=c.sourceEvent)!=null&&d.sync||s([c.transform.x,c.transform.y,c.transform.k]),l&&!((h=c.sourceEvent)!=null&&h.internal)&&(l==null||l(c.sourceEvent,$u(c.transform)))}}function gb({zoomPanValues:t,panOnDrag:r,panOnScroll:i,onDraggingChange:s,onPanZoomEnd:l,onPaneContextMenu:c}){return d=>{var h;if(!((h=d.sourceEvent)!=null&&h.internal)&&(t.isZoomingOrPanning=!1,c&&E0(r,t.mouseButton??0)&&!t.usedRightMouseButton&&d.sourceEvent&&c(d.sourceEvent),t.usedRightMouseButton=!1,s(!1),l)){const y=$u(d.transform);t.prevViewport=y,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{l==null||l(d.sourceEvent,y)},i?150:0)}}}function yb({zoomActivationKeyPressed:t,zoomOnScroll:r,zoomOnPinch:i,panOnDrag:s,panOnScroll:l,zoomOnDoubleClick:c,userSelectionActive:d,noWheelClassName:h,noPanClassName:y,lib:b,connectionInProgress:k}){return x=>{var T;const S=t||r,C=i&&x.ctrlKey,j=x.type==="wheel";if(x.button===1&&x.type==="mousedown"&&(Ns(x,`${b}-flow__node`)||Ns(x,`${b}-flow__edge`)))return!0;if(!s&&!S&&!l&&!c&&!i||d||k&&!j||Ns(x,h)&&j||Ns(x,y)&&(!j||l&&j&&!t)||!i&&x.ctrlKey&&j)return!1;if(!i&&x.type==="touchstart"&&((T=x.touches)==null?void 0:T.length)>1)return x.preventDefault(),!1;if(!S&&!l&&!C&&j||!s&&(x.type==="mousedown"||x.type==="touchstart")||Array.isArray(s)&&!s.includes(x.button)&&x.type==="mousedown")return!1;const $=Array.isArray(s)&&s.includes(x.button)||!x.button||x.button<=1;return(!x.ctrlKey||j)&&$}}function vb({domNode:t,minZoom:r,maxZoom:i,translateExtent:s,viewport:l,onPanZoom:c,onPanZoomStart:d,onPanZoomEnd:h,onDraggingChange:y}){const b={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},k=t.getBoundingClientRect(),x=Jm().scaleExtent([r,i]).translateExtent(s),S=rr(t).call(x);U({x:l.x,y:l.y,zoom:Ts(l.zoom,r,i)},[[0,0],[k.width,k.height]],s);const C=S.on("wheel.zoom"),j=S.on("dblclick.zoom");x.wheelDelta(C0);function $(q,fe){return S?new Promise(xe=>{x==null||x.interpolate((fe==null?void 0:fe.interpolate)==="linear"?_a:nu).transform(uf(S,fe==null?void 0:fe.duration,fe==null?void 0:fe.ease,()=>xe(!0)),q)}):Promise.resolve(!1)}function T({noWheelClassName:q,noPanClassName:fe,onPaneContextMenu:xe,userSelectionActive:L,panOnScroll:le,panOnDrag:G,panOnScrollMode:ie,panOnScrollSpeed:z,preventScrolling:W,zoomOnPinch:F,zoomOnScroll:A,zoomOnDoubleClick:K,zoomActivationKeyPressed:be,lib:Se,onTransformChange:Me,connectionInProgress:Ie,paneClickDistance:Ae,selectionOnDrag:_e}){L&&!b.isZoomingOrPanning&&I();const ze=le&&!be&&!L;x.clickDistance(_e?1/0:!Lr(Ae)||Ae<0?0:Ae);const ke=ze?db({zoomPanValues:b,noWheelClassName:q,d3Selection:S,d3Zoom:x,panOnScrollMode:ie,panOnScrollSpeed:z,zoomOnPinch:F,onPanZoomStart:d,onPanZoom:c,onPanZoomEnd:h}):pb({noWheelClassName:q,preventScrolling:W,d3ZoomHandler:C});if(S.on("wheel.zoom",ke,{passive:!1}),!L){const Oe=hb({zoomPanValues:b,onDraggingChange:y,onPanZoomStart:d});x.on("start",Oe);const Ke=mb({zoomPanValues:b,panOnDrag:G,onPaneContextMenu:!!xe,onPanZoom:c,onTransformChange:Me});x.on("zoom",Ke);const lt=gb({zoomPanValues:b,panOnDrag:G,panOnScroll:le,onPaneContextMenu:xe,onPanZoomEnd:h,onDraggingChange:y});x.on("end",lt)}const He=yb({zoomActivationKeyPressed:be,panOnDrag:G,zoomOnScroll:A,panOnScroll:le,zoomOnDoubleClick:K,zoomOnPinch:F,userSelectionActive:L,noPanClassName:fe,noWheelClassName:q,lib:Se,connectionInProgress:Ie});x.filter(He),K?S.on("dblclick.zoom",j):S.on("dblclick.zoom",null)}function I(){x.on("zoom",null)}async function U(q,fe,xe){const L=lf(q),le=x==null?void 0:x.constrain()(L,fe,xe);return le&&await $(le),new Promise(G=>G(le))}async function P(q,fe){const xe=lf(q);return await $(xe,fe),new Promise(L=>L(xe))}function R(q){if(S){const fe=lf(q),xe=S.property("__zoom");(xe.k!==q.zoom||xe.x!==q.x||xe.y!==q.y)&&(x==null||x.transform(S,fe,null,{sync:!0}))}}function B(){const q=S?Gm(S.node()):{x:0,y:0,k:1};return{x:q.x,y:q.y,zoom:q.k}}function H(q,fe){return S?new Promise(xe=>{x==null||x.interpolate((fe==null?void 0:fe.interpolate)==="linear"?_a:nu).scaleTo(uf(S,fe==null?void 0:fe.duration,fe==null?void 0:fe.ease,()=>xe(!0)),q)}):Promise.resolve(!1)}function Q(q,fe){return S?new Promise(xe=>{x==null||x.interpolate((fe==null?void 0:fe.interpolate)==="linear"?_a:nu).scaleBy(uf(S,fe==null?void 0:fe.duration,fe==null?void 0:fe.ease,()=>xe(!0)),q)}):Promise.resolve(!1)}function ce(q){x==null||x.scaleExtent(q)}function de(q){x==null||x.translateExtent(q)}function we(q){const fe=!Lr(q)||q<0?0:q;x==null||x.clickDistance(fe)}return{update:T,destroy:I,setViewport:P,setViewportConstrained:U,getViewport:B,scaleTo:H,scaleBy:Q,setScaleExtent:ce,setTranslateExtent:de,syncViewport:R,setClickDistance:we}}var Os;(function(t){t.Line="line",t.Handle="handle"})(Os||(Os={}));function xb({width:t,prevWidth:r,height:i,prevHeight:s,affectsX:l,affectsY:c}){const d=t-r,h=i-s,y=[d>0?1:d<0?-1:0,h>0?1:h<0?-1:0];return d&&l&&(y[0]=y[0]*-1),h&&c&&(y[1]=y[1]*-1),y}function Ih(t){const r=t.includes("right")||t.includes("left"),i=t.includes("bottom")||t.includes("top"),s=t.includes("left"),l=t.includes("top");return{isHorizontal:r,isVertical:i,affectsX:s,affectsY:l}}function ui(t,r){return Math.max(0,r-t)}function ci(t,r){return Math.max(0,t-r)}function Ql(t,r,i){return Math.max(0,r-t,t-i)}function Ah(t,r){return t?!r:r}function wb(t,r,i,s,l,c,d,h){let{affectsX:y,affectsY:b}=r;const{isHorizontal:k,isVertical:x}=r,S=k&&x,{xSnapped:C,ySnapped:j}=i,{minWidth:$,maxWidth:T,minHeight:I,maxHeight:U}=s,{x:P,y:R,width:B,height:H,aspectRatio:Q}=t;let ce=Math.floor(k?C-t.pointerX:0),de=Math.floor(x?j-t.pointerY:0);const we=B+(y?-ce:ce),q=H+(b?-de:de),fe=-c[0]*B,xe=-c[1]*H;let L=Ql(we,$,T),le=Ql(q,I,U);if(d){let z=0,W=0;y&&ce<0?z=ui(P+ce+fe,d[0][0]):!y&&ce>0&&(z=ci(P+we+fe,d[1][0])),b&&de<0?W=ui(R+de+xe,d[0][1]):!b&&de>0&&(W=ci(R+q+xe,d[1][1])),L=Math.max(L,z),le=Math.max(le,W)}if(h){let z=0,W=0;y&&ce>0?z=ci(P+ce,h[0][0]):!y&&ce<0&&(z=ui(P+we,h[1][0])),b&&de>0?W=ci(R+de,h[0][1]):!b&&de<0&&(W=ui(R+q,h[1][1])),L=Math.max(L,z),le=Math.max(le,W)}if(l){if(k){const z=Ql(we/Q,I,U)*Q;if(L=Math.max(L,z),d){let W=0;!y&&!b||y&&!b&&S?W=ci(R+xe+we/Q,d[1][1])*Q:W=ui(R+xe+(y?ce:-ce)/Q,d[0][1])*Q,L=Math.max(L,W)}if(h){let W=0;!y&&!b||y&&!b&&S?W=ui(R+we/Q,h[1][1])*Q:W=ci(R+(y?ce:-ce)/Q,h[0][1])*Q,L=Math.max(L,W)}}if(x){const z=Ql(q*Q,$,T)/Q;if(le=Math.max(le,z),d){let W=0;!y&&!b||b&&!y&&S?W=ci(P+q*Q+fe,d[1][0])/Q:W=ui(P+(b?de:-de)*Q+fe,d[0][0])/Q,le=Math.max(le,W)}if(h){let W=0;!y&&!b||b&&!y&&S?W=ui(P+q*Q,h[1][0])/Q:W=ci(P+(b?de:-de)*Q,h[0][0])/Q,le=Math.max(le,W)}}}de=de+(de<0?le:-le),ce=ce+(ce<0?L:-L),l&&(S?we>q*Q?de=(Ah(y,b)?-ce:ce)/Q:ce=(Ah(y,b)?-de:de)*Q:k?(de=ce/Q,b=y):(ce=de*Q,y=b));const G=y?P+ce:P,ie=b?R+de:R;return{width:B+(y?-ce:ce),height:H+(b?-de:de),x:c[0]*ce*(y?-1:1)+G,y:c[1]*de*(b?-1:1)+ie}}const j0={width:0,height:0,x:0,y:0},bb={...j0,pointerX:0,pointerY:0,aspectRatio:1};function _b(t){return[[0,0],[t.measured.width,t.measured.height]]}function Sb(t,r,i){const s=r.position.x+t.position.x,l=r.position.y+t.position.y,c=t.measured.width??0,d=t.measured.height??0,h=i[0]*c,y=i[1]*d;return[[s-h,l-y],[s+c-h,l+d-y]]}function kb({domNode:t,nodeId:r,getStoreItems:i,onChange:s,onEnd:l}){const c=rr(t);let d={controlDirection:Ih("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function h({controlPosition:b,boundaries:k,keepAspectRatio:x,resizeDirection:S,onResizeStart:C,onResize:j,onResizeEnd:$,shouldResize:T}){let I={...j0},U={...bb};d={boundaries:k,resizeDirection:S,keepAspectRatio:x,controlDirection:Ih(b)};let P,R=null,B=[],H,Q,ce,de=!1;const we=Lm().on("start",q=>{const{nodeLookup:fe,transform:xe,snapGrid:L,snapToGrid:le,nodeOrigin:G,paneDomNode:ie}=i();if(P=fe.get(r),!P)return;R=(ie==null?void 0:ie.getBoundingClientRect())??null;const{xSnapped:z,ySnapped:W}=Sa(q.sourceEvent,{transform:xe,snapGrid:L,snapToGrid:le,containerBounds:R});I={width:P.measured.width??0,height:P.measured.height??0,x:P.position.x??0,y:P.position.y??0},U={...I,pointerX:z,pointerY:W,aspectRatio:I.width/I.height},H=void 0,P.parentId&&(P.extent==="parent"||P.expandParent)&&(H=fe.get(P.parentId),Q=H&&P.extent==="parent"?_b(H):void 0),B=[],ce=void 0;for(const[F,A]of fe)if(A.parentId===r&&(B.push({id:F,position:{...A.position},extent:A.extent}),A.extent==="parent"||A.expandParent)){const K=Sb(A,P,A.origin??G);ce?ce=[[Math.min(K[0][0],ce[0][0]),Math.min(K[0][1],ce[0][1])],[Math.max(K[1][0],ce[1][0]),Math.max(K[1][1],ce[1][1])]]:ce=K}C==null||C(q,{...I})}).on("drag",q=>{const{transform:fe,snapGrid:xe,snapToGrid:L,nodeOrigin:le}=i(),G=Sa(q.sourceEvent,{transform:fe,snapGrid:xe,snapToGrid:L,containerBounds:R}),ie=[];if(!P)return;const{x:z,y:W,width:F,height:A}=I,K={},be=P.origin??le,{width:Se,height:Me,x:Ie,y:Ae}=wb(U,d.controlDirection,G,d.boundaries,d.keepAspectRatio,be,Q,ce),_e=Se!==F,ze=Me!==A,ke=Ie!==z&&_e,He=Ae!==W&&ze;if(!ke&&!He&&!_e&&!ze)return;if((ke||He||be[0]===1||be[1]===1)&&(K.x=ke?Ie:I.x,K.y=He?Ae:I.y,I.x=K.x,I.y=K.y,B.length>0)){const ut=Ie-z,at=Ae-W;for(const Nt of B)Nt.position={x:Nt.position.x-ut+be[0]*(Se-F),y:Nt.position.y-at+be[1]*(Me-A)},ie.push(Nt)}if((_e||ze)&&(K.width=_e&&(!d.resizeDirection||d.resizeDirection==="horizontal")?Se:I.width,K.height=ze&&(!d.resizeDirection||d.resizeDirection==="vertical")?Me:I.height,I.width=K.width,I.height=K.height),H&&P.expandParent){const ut=be[0]*(K.width??0);K.x&&K.x<ut&&(I.x=ut,U.x=U.x-(K.x-ut));const at=be[1]*(K.height??0);K.y&&K.y<at&&(I.y=at,U.y=U.y-(K.y-at))}const Oe=xb({width:I.width,prevWidth:F,height:I.height,prevHeight:A,affectsX:d.controlDirection.affectsX,affectsY:d.controlDirection.affectsY}),Ke={...I,direction:Oe};(T==null?void 0:T(q,Ke))!==!1&&(de=!0,j==null||j(q,Ke),s(K,ie))}).on("end",q=>{de&&($==null||$(q,{...I}),l==null||l({...I}),de=!1)});c.call(we)}function y(){c.on(".drag",null)}return{update:h,destroy:y}}var cf={exports:{}},ff={},df={exports:{}},pf={};/**
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 Oh;function Nb(){if(Oh)return pf;Oh=1;var t=Ia();function r(x,S){return x===S&&(x!==0||1/x===1/S)||x!==x&&S!==S}var i=typeof Object.is=="function"?Object.is:r,s=t.useState,l=t.useEffect,c=t.useLayoutEffect,d=t.useDebugValue;function h(x,S){var C=S(),j=s({inst:{value:C,getSnapshot:S}}),$=j[0].inst,T=j[1];return c(function(){$.value=C,$.getSnapshot=S,y($)&&T({inst:$})},[x,C,S]),l(function(){return y($)&&T({inst:$}),x(function(){y($)&&T({inst:$})})},[x]),d(C),C}function y(x){var S=x.getSnapshot;x=x.value;try{var C=S();return!i(x,C)}catch{return!0}}function b(x,S){return S()}var k=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?b:h;return pf.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:k,pf}var Rh;function Eb(){return Rh||(Rh=1,df.exports=Nb()),df.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 Lh;function Cb(){if(Lh)return ff;Lh=1;var t=Ia(),r=Eb();function i(b,k){return b===k&&(b!==0||1/b===1/k)||b!==b&&k!==k}var s=typeof Object.is=="function"?Object.is:i,l=r.useSyncExternalStore,c=t.useRef,d=t.useEffect,h=t.useMemo,y=t.useDebugValue;return ff.useSyncExternalStoreWithSelector=function(b,k,x,S,C){var j=c(null);if(j.current===null){var $={hasValue:!1,value:null};j.current=$}else $=j.current;j=h(function(){function I(H){if(!U){if(U=!0,P=H,H=S(H),C!==void 0&&$.hasValue){var Q=$.value;if(C(Q,H))return R=Q}return R=H}if(Q=R,s(P,H))return Q;var ce=S(H);return C!==void 0&&C(Q,ce)?(P=H,Q):(P=H,R=ce)}var U=!1,P,R,B=x===void 0?null:x;return[function(){return I(k())},B===null?void 0:function(){return I(B())}]},[k,x,S,C]);var T=l(b,j[0],j[1]);return d(function(){$.hasValue=!0,$.value=T},[T]),y(T),T},ff}var Dh;function jb(){return Dh||(Dh=1,cf.exports=Cb()),cf.exports}var Pb=jb();const Mb=wu(Pb),$b={},zh=t=>{let r;const i=new Set,s=(k,x)=>{const S=typeof k=="function"?k(r):k;if(!Object.is(S,r)){const C=r;r=x??(typeof S!="object"||S===null)?S:Object.assign({},r,S),i.forEach(j=>j(r,C))}},l=()=>r,y={setState:s,getState:l,getInitialState:()=>b,subscribe:k=>(i.add(k),()=>i.delete(k)),destroy:()=>{($b?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),i.clear()}},b=r=t(s,l,y);return y},Tb=t=>t?zh(t):zh,{useDebugValue:Ib}=gm,{useSyncExternalStoreWithSelector:Ab}=Mb,Ob=t=>t;function P0(t,r=Ob,i){const s=Ab(t.subscribe,t.getState,t.getServerState||t.getInitialState,r,i);return Ib(s),s}const Fh=(t,r)=>{const i=Tb(t),s=(l,c=r)=>P0(i,l,c);return Object.assign(s,i),s},Rb=(t,r)=>t?Fh(t,r):Fh;function Rt(t,r){if(Object.is(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(const[s,l]of t)if(!Object.is(l,r.get(s)))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(const s of t)if(!r.has(s))return!1;return!0}const i=Object.keys(t);if(i.length!==Object.keys(r).length)return!1;for(const s of i)if(!Object.prototype.hasOwnProperty.call(r,s)||!Object.is(t[s],r[s]))return!1;return!0}ym();const Tu=Y.createContext(null),Lb=Tu.Provider,M0=eo.error001();function yt(t,r){const i=Y.useContext(Tu);if(i===null)throw new Error(M0);return P0(i,t,r)}function Tt(){const t=Y.useContext(Tu);if(t===null)throw new Error(M0);return Y.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const Bh={display:"none"},Db={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},$0="react-flow__node-desc",T0="react-flow__edge-desc",zb="react-flow__aria-live",Fb=t=>t.ariaLiveMessage,Bb=t=>t.ariaLabelConfig;function Hb({rfId:t}){const r=yt(Fb);return w.jsx("div",{id:`${zb}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:Db,children:r})}function Vb({rfId:t,disableKeyboardA11y:r}){const i=yt(Bb);return w.jsxs(w.Fragment,{children:[w.jsx("div",{id:`${$0}-${t}`,style:Bh,children:r?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),w.jsx("div",{id:`${T0}-${t}`,style:Bh,children:i["edge.a11yDescription.default"]}),!r&&w.jsx(Hb,{rfId:t})]})}const Fa=Y.forwardRef(({position:t="top-left",children:r,className:i,style:s,...l},c)=>{const d=`${t}`.split("-");return w.jsx("div",{className:Yt(["react-flow__panel",i,...d]),style:s,ref:c,...l,children:r})});Fa.displayName="Panel";function Ub({proOptions:t,position:r="bottom-right"}){return t!=null&&t.hideAttribution?null:w.jsx(Fa,{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:w.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Kb=t=>{const r=[],i=[];for(const[,s]of t.nodeLookup)s.selected&&r.push(s.internals.userNode);for(const[,s]of t.edgeLookup)s.selected&&i.push(s);return{selectedNodes:r,selectedEdges:i}},Gl=t=>t.id;function qb(t,r){return Rt(t.selectedNodes.map(Gl),r.selectedNodes.map(Gl))&&Rt(t.selectedEdges.map(Gl),r.selectedEdges.map(Gl))}function Wb({onSelectionChange:t}){const r=Tt(),{selectedNodes:i,selectedEdges:s}=yt(Kb,qb);return Y.useEffect(()=>{const l={nodes:i,edges:s};t==null||t(l),r.getState().onSelectionChangeHandlers.forEach(c=>c(l))},[i,s,t]),null}const Yb=t=>!!t.onSelectionChangeHandlers;function Xb({onSelectionChange:t}){const r=yt(Yb);return t||r?w.jsx(Wb,{onSelectionChange:t}):null}const Af=typeof window<"u"?Y.useLayoutEffect:Y.useEffect,I0=[0,0],Qb={x:0,y:0,zoom:1},Gb=["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"],Hh=[...Gb,"rfId"],Jb=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),Vh={translateExtent:ja,nodeOrigin:I0,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Zb(t){const{setNodes:r,setEdges:i,setMinZoom:s,setMaxZoom:l,setTranslateExtent:c,setNodeExtent:d,reset:h,setDefaultNodesAndEdges:y}=yt(Jb,Rt),b=Tt();Af(()=>(y(t.defaultNodes,t.defaultEdges),()=>{k.current=Vh,h()}),[]);const k=Y.useRef(Vh);return Af(()=>{for(const x of Hh){const S=t[x],C=k.current[x];S!==C&&(typeof t[x]>"u"||(x==="nodes"?r(S):x==="edges"?i(S):x==="minZoom"?s(S):x==="maxZoom"?l(S):x==="translateExtent"?c(S):x==="nodeExtent"?d(S):x==="ariaLabelConfig"?b.setState({ariaLabelConfig:L1(S)}):x==="fitView"?b.setState({fitViewQueued:S}):x==="fitViewOptions"?b.setState({fitViewOptions:S}):b.setState({[x]:S})))}k.current=t},Hh.map(x=>t[x])),null}function Uh(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function e_(t){var s;const[r,i]=Y.useState(t==="system"?null:t);return Y.useEffect(()=>{if(t!=="system"){i(t);return}const l=Uh(),c=()=>i(l!=null&&l.matches?"dark":"light");return c(),l==null||l.addEventListener("change",c),()=>{l==null||l.removeEventListener("change",c)}},[t]),r!==null?r:(s=Uh())!=null&&s.matches?"dark":"light"}const Kh=typeof document<"u"?document:null;function Ta(t=null,r={target:Kh,actInsideInputWithModifier:!0}){const[i,s]=Y.useState(!1),l=Y.useRef(!1),c=Y.useRef(new Set([])),[d,h]=Y.useMemo(()=>{if(t!==null){const b=(Array.isArray(t)?t:[t]).filter(x=>typeof x=="string").map(x=>x.replace("+",`
197
+ `).replace(`
198
+
199
+ `,`
200
+ +`).split(`
201
+ `)),k=b.reduce((x,S)=>x.concat(...S),[]);return[b,k]}return[[],[]]},[t]);return Y.useEffect(()=>{const y=(r==null?void 0:r.target)??Kh,b=(r==null?void 0:r.actInsideInputWithModifier)??!0;if(t!==null){const k=C=>{var T,I;if(l.current=C.ctrlKey||C.metaKey||C.shiftKey||C.altKey,(!l.current||l.current&&!b)&&f0(C))return!1;const $=Wh(C.code,h);if(c.current.add(C[$]),qh(d,c.current,!1)){const U=((I=(T=C.composedPath)==null?void 0:T.call(C))==null?void 0:I[0])||C.target,P=(U==null?void 0:U.nodeName)==="BUTTON"||(U==null?void 0:U.nodeName)==="A";r.preventDefault!==!1&&(l.current||!P)&&C.preventDefault(),s(!0)}},x=C=>{const j=Wh(C.code,h);qh(d,c.current,!0)?(s(!1),c.current.clear()):c.current.delete(C[j]),C.key==="Meta"&&c.current.clear(),l.current=!1},S=()=>{c.current.clear(),s(!1)};return y==null||y.addEventListener("keydown",k),y==null||y.addEventListener("keyup",x),window.addEventListener("blur",S),window.addEventListener("contextmenu",S),()=>{y==null||y.removeEventListener("keydown",k),y==null||y.removeEventListener("keyup",x),window.removeEventListener("blur",S),window.removeEventListener("contextmenu",S)}}},[t,s]),i}function qh(t,r,i){return t.filter(s=>i||s.length===r.size).some(s=>s.every(l=>r.has(l)))}function Wh(t,r){return r.includes(t)?"code":"key"}const t_=()=>{const t=Tt();return Y.useMemo(()=>({zoomIn:r=>{const{panZoom:i}=t.getState();return i?i.scaleBy(1.2,r):Promise.resolve(!1)},zoomOut:r=>{const{panZoom:i}=t.getState();return i?i.scaleBy(1/1.2,r):Promise.resolve(!1)},zoomTo:(r,i)=>{const{panZoom:s}=t.getState();return s?s.scaleTo(r,i):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(r,i)=>{const{transform:[s,l,c],panZoom:d}=t.getState();return d?(await d.setViewport({x:r.x??s,y:r.y??l,zoom:r.zoom??c},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[r,i,s]=t.getState().transform;return{x:r,y:i,zoom:s}},setCenter:async(r,i,s)=>t.getState().setCenter(r,i,s),fitBounds:async(r,i)=>{const{width:s,height:l,minZoom:c,maxZoom:d,panZoom:h}=t.getState(),y=qf(r,s,l,c,d,(i==null?void 0:i.padding)??.1);return h?(await h.setViewport(y,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(r,i={})=>{const{transform:s,snapGrid:l,snapToGrid:c,domNode:d}=t.getState();if(!d)return r;const{x:h,y}=d.getBoundingClientRect(),b={x:r.x-h,y:r.y-y},k=i.snapGrid??l,x=i.snapToGrid??c;return za(b,s,x,k)},flowToScreenPosition:r=>{const{transform:i,domNode:s}=t.getState();if(!s)return r;const{x:l,y:c}=s.getBoundingClientRect(),d=vu(r,i);return{x:d.x+l,y:d.y+c}}}),[])};function A0(t,r){const i=[],s=new Map,l=[];for(const c of t)if(c.type==="add"){l.push(c);continue}else if(c.type==="remove"||c.type==="replace")s.set(c.id,[c]);else{const d=s.get(c.id);d?d.push(c):s.set(c.id,[c])}for(const c of r){const d=s.get(c.id);if(!d){i.push(c);continue}if(d[0].type==="remove")continue;if(d[0].type==="replace"){i.push({...d[0].item});continue}const h={...c};for(const y of d)n_(y,h);i.push(h)}return l.length&&l.forEach(c=>{c.index!==void 0?i.splice(c.index,0,{...c.item}):i.push({...c.item})}),i}function n_(t,r){switch(t.type){case"select":{r.selected=t.selected;break}case"position":{typeof t.position<"u"&&(r.position=t.position),typeof t.dragging<"u"&&(r.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(r.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(r.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(r.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(r.resizing=t.resizing);break}}}function O0(t,r){return A0(t,r)}function R0(t,r){return A0(t,r)}function Ai(t,r){return{id:t,type:"select",selected:r}}function Es(t,r=new Set,i=!1){const s=[];for(const[l,c]of t){const d=r.has(l);!(c.selected===void 0&&!d)&&c.selected!==d&&(i&&(c.selected=d),s.push(Ai(c.id,d)))}return s}function Yh({items:t=[],lookup:r}){var l;const i=[],s=new Map(t.map(c=>[c.id,c]));for(const[c,d]of t.entries()){const h=r.get(d.id),y=((l=h==null?void 0:h.internals)==null?void 0:l.userNode)??h;y!==void 0&&y!==d&&i.push({id:d.id,item:d,type:"replace"}),y===void 0&&i.push({item:d,type:"add",index:c})}for(const[c]of r)s.get(c)===void 0&&i.push({id:c,type:"remove"});return i}function Xh(t){return{id:t.id,type:"remove"}}const Qh=t=>C1(t),r_=t=>r0(t);function L0(t){return Y.forwardRef(t)}function Gh(t){const[r,i]=Y.useState(BigInt(0)),[s]=Y.useState(()=>o_(()=>i(l=>l+BigInt(1))));return Af(()=>{const l=s.get();l.length&&(t(l),s.reset())},[r]),s}function o_(t){let r=[];return{get:()=>r,reset:()=>{r=[]},push:i=>{r.push(i),t()}}}const D0=Y.createContext(null);function i_({children:t}){const r=Tt(),i=Y.useCallback(h=>{const{nodes:y=[],setNodes:b,hasDefaultNodes:k,onNodesChange:x,nodeLookup:S,fitViewQueued:C,onNodesChangeMiddlewareMap:j}=r.getState();let $=y;for(const I of h)$=typeof I=="function"?I($):I;let T=Yh({items:$,lookup:S});for(const I of j.values())T=I(T);k&&b($),T.length>0?x==null||x(T):C&&window.requestAnimationFrame(()=>{const{fitViewQueued:I,nodes:U,setNodes:P}=r.getState();I&&P(U)})},[]),s=Gh(i),l=Y.useCallback(h=>{const{edges:y=[],setEdges:b,hasDefaultEdges:k,onEdgesChange:x,edgeLookup:S}=r.getState();let C=y;for(const j of h)C=typeof j=="function"?j(C):j;k?b(C):x&&x(Yh({items:C,lookup:S}))},[]),c=Gh(l),d=Y.useMemo(()=>({nodeQueue:s,edgeQueue:c}),[]);return w.jsx(D0.Provider,{value:d,children:t})}function s_(){const t=Y.useContext(D0);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const a_=t=>!!t.panZoom;function Zf(){const t=t_(),r=Tt(),i=s_(),s=yt(a_),l=Y.useMemo(()=>{const c=x=>r.getState().nodeLookup.get(x),d=x=>{i.nodeQueue.push(x)},h=x=>{i.edgeQueue.push(x)},y=x=>{var I,U;const{nodeLookup:S,nodeOrigin:C}=r.getState(),j=Qh(x)?x:S.get(x.id),$=j.parentId?u0(j.position,j.measured,j.parentId,S,C):j.position,T={...j,position:$,width:((I=j.measured)==null?void 0:I.width)??j.width,height:((U=j.measured)==null?void 0:U.height)??j.height};return Is(T)},b=(x,S,C={replace:!1})=>{d(j=>j.map($=>{if($.id===x){const T=typeof S=="function"?S($):S;return C.replace&&Qh(T)?T:{...$,...T}}return $}))},k=(x,S,C={replace:!1})=>{h(j=>j.map($=>{if($.id===x){const T=typeof S=="function"?S($):S;return C.replace&&r_(T)?T:{...$,...T}}return $}))};return{getNodes:()=>r.getState().nodes.map(x=>({...x})),getNode:x=>{var S;return(S=c(x))==null?void 0:S.internals.userNode},getInternalNode:c,getEdges:()=>{const{edges:x=[]}=r.getState();return x.map(S=>({...S}))},getEdge:x=>r.getState().edgeLookup.get(x),setNodes:d,setEdges:h,addNodes:x=>{const S=Array.isArray(x)?x:[x];i.nodeQueue.push(C=>[...C,...S])},addEdges:x=>{const S=Array.isArray(x)?x:[x];i.edgeQueue.push(C=>[...C,...S])},toObject:()=>{const{nodes:x=[],edges:S=[],transform:C}=r.getState(),[j,$,T]=C;return{nodes:x.map(I=>({...I})),edges:S.map(I=>({...I})),viewport:{x:j,y:$,zoom:T}}},deleteElements:async({nodes:x=[],edges:S=[]})=>{const{nodes:C,edges:j,onNodesDelete:$,onEdgesDelete:T,triggerNodeChanges:I,triggerEdgeChanges:U,onDelete:P,onBeforeDelete:R}=r.getState(),{nodes:B,edges:H}=await T1({nodesToRemove:x,edgesToRemove:S,nodes:C,edges:j,onBeforeDelete:R}),Q=H.length>0,ce=B.length>0;if(Q){const de=H.map(Xh);T==null||T(H),U(de)}if(ce){const de=B.map(Xh);$==null||$(B),I(de)}return(ce||Q)&&(P==null||P({nodes:B,edges:H})),{deletedNodes:B,deletedEdges:H}},getIntersectingNodes:(x,S=!0,C)=>{const j=_h(x),$=j?x:y(x),T=C!==void 0;return $?(C||r.getState().nodes).filter(I=>{const U=r.getState().nodeLookup.get(I.id);if(U&&!j&&(I.id===x.id||!U.internals.positionAbsolute))return!1;const P=Is(T?I:U),R=Ma(P,$);return S&&R>0||R>=P.width*P.height||R>=$.width*$.height}):[]},isNodeIntersecting:(x,S,C=!0)=>{const $=_h(x)?x:y(x);if(!$)return!1;const T=Ma($,S);return C&&T>0||T>=S.width*S.height||T>=$.width*$.height},updateNode:b,updateNodeData:(x,S,C={replace:!1})=>{b(x,j=>{const $=typeof S=="function"?S(j):S;return C.replace?{...j,data:$}:{...j,data:{...j.data,...$}}},C)},updateEdge:k,updateEdgeData:(x,S,C={replace:!1})=>{k(x,j=>{const $=typeof S=="function"?S(j):S;return C.replace?{...j,data:$}:{...j,data:{...j.data,...$}}},C)},getNodesBounds:x=>{const{nodeLookup:S,nodeOrigin:C}=r.getState();return j1(x,{nodeLookup:S,nodeOrigin:C})},getHandleConnections:({type:x,id:S,nodeId:C})=>{var j;return Array.from(((j=r.getState().connectionLookup.get(`${C}-${x}${S?`-${S}`:""}`))==null?void 0:j.values())??[])},getNodeConnections:({type:x,handleId:S,nodeId:C})=>{var j;return Array.from(((j=r.getState().connectionLookup.get(`${C}${x?S?`-${x}-${S}`:`-${x}`:""}`))==null?void 0:j.values())??[])},fitView:async x=>{const S=r.getState().fitViewResolver??R1();return r.setState({fitViewQueued:!0,fitViewOptions:x,fitViewResolver:S}),i.nodeQueue.push(C=>[...C]),S.promise}}},[]);return Y.useMemo(()=>({...l,...t,viewportInitialized:s}),[s])}const Jh=t=>t.selected,l_=typeof window<"u"?window:void 0;function u_({deleteKeyCode:t,multiSelectionKeyCode:r}){const i=Tt(),{deleteElements:s}=Zf(),l=Ta(t,{actInsideInputWithModifier:!1}),c=Ta(r,{target:l_});Y.useEffect(()=>{if(l){const{edges:d,nodes:h}=i.getState();s({nodes:h.filter(Jh),edges:d.filter(Jh)}),i.setState({nodesSelectionActive:!1})}},[l]),Y.useEffect(()=>{i.setState({multiSelectionActive:c})},[c])}function c_(t){const r=Tt();Y.useEffect(()=>{const i=()=>{var l,c,d,h;if(!t.current||!(((c=(l=t.current).checkVisibility)==null?void 0:c.call(l))??!0))return!1;const s=Wf(t.current);(s.height===0||s.width===0)&&((h=(d=r.getState()).onError)==null||h.call(d,"004",eo.error004())),r.setState({width:s.width||500,height:s.height||500})};if(t.current){i(),window.addEventListener("resize",i);const s=new ResizeObserver(()=>i());return s.observe(t.current),()=>{window.removeEventListener("resize",i),s&&t.current&&s.unobserve(t.current)}}},[])}const Iu={position:"absolute",width:"100%",height:"100%",top:0,left:0},f_=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function d_({onPaneContextMenu:t,zoomOnScroll:r=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:l=.5,panOnScrollMode:c=Li.Free,zoomOnDoubleClick:d=!0,panOnDrag:h=!0,defaultViewport:y,translateExtent:b,minZoom:k,maxZoom:x,zoomActivationKeyCode:S,preventScrolling:C=!0,children:j,noWheelClassName:$,noPanClassName:T,onViewportChange:I,isControlledViewport:U,paneClickDistance:P,selectionOnDrag:R}){const B=Tt(),H=Y.useRef(null),{userSelectionActive:Q,lib:ce,connectionInProgress:de}=yt(f_,Rt),we=Ta(S),q=Y.useRef();c_(H);const fe=Y.useCallback(xe=>{I==null||I({x:xe[0],y:xe[1],zoom:xe[2]}),U||B.setState({transform:xe})},[I,U]);return Y.useEffect(()=>{if(H.current){q.current=vb({domNode:H.current,minZoom:k,maxZoom:x,translateExtent:b,viewport:y,onDraggingChange:G=>B.setState(ie=>ie.paneDragging===G?ie:{paneDragging:G}),onPanZoomStart:(G,ie)=>{const{onViewportChangeStart:z,onMoveStart:W}=B.getState();W==null||W(G,ie),z==null||z(ie)},onPanZoom:(G,ie)=>{const{onViewportChange:z,onMove:W}=B.getState();W==null||W(G,ie),z==null||z(ie)},onPanZoomEnd:(G,ie)=>{const{onViewportChangeEnd:z,onMoveEnd:W}=B.getState();W==null||W(G,ie),z==null||z(ie)}});const{x:xe,y:L,zoom:le}=q.current.getViewport();return B.setState({panZoom:q.current,transform:[xe,L,le],domNode:H.current.closest(".react-flow")}),()=>{var G;(G=q.current)==null||G.destroy()}}},[]),Y.useEffect(()=>{var xe;(xe=q.current)==null||xe.update({onPaneContextMenu:t,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:s,panOnScrollSpeed:l,panOnScrollMode:c,zoomOnDoubleClick:d,panOnDrag:h,zoomActivationKeyPressed:we,preventScrolling:C,noPanClassName:T,userSelectionActive:Q,noWheelClassName:$,lib:ce,onTransformChange:fe,connectionInProgress:de,selectionOnDrag:R,paneClickDistance:P})},[t,r,i,s,l,c,d,h,we,C,T,Q,$,ce,fe,de,R,P]),w.jsx("div",{className:"react-flow__renderer",ref:H,style:Iu,children:j})}const p_=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function h_(){const{userSelectionActive:t,userSelectionRect:r}=yt(p_,Rt);return t&&r?w.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 hf=(t,r)=>i=>{i.target===r.current&&(t==null||t(i))},m_=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function g_({isSelecting:t,selectionKeyPressed:r,selectionMode:i=Pa.Full,panOnDrag:s,paneClickDistance:l,selectionOnDrag:c,onSelectionStart:d,onSelectionEnd:h,onPaneClick:y,onPaneContextMenu:b,onPaneScroll:k,onPaneMouseEnter:x,onPaneMouseMove:S,onPaneMouseLeave:C,children:j}){const $=Tt(),{userSelectionActive:T,elementsSelectable:I,dragging:U,connectionInProgress:P}=yt(m_,Rt),R=I&&(t||T),B=Y.useRef(null),H=Y.useRef(),Q=Y.useRef(new Set),ce=Y.useRef(new Set),de=Y.useRef(!1),we=z=>{if(de.current||P){de.current=!1;return}y==null||y(z),$.getState().resetSelectedElements(),$.setState({nodesSelectionActive:!1})},q=z=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){z.preventDefault();return}b==null||b(z)},fe=k?z=>k(z):void 0,xe=z=>{de.current&&(z.stopPropagation(),de.current=!1)},L=z=>{var Me,Ie;const{domNode:W}=$.getState();if(H.current=W==null?void 0:W.getBoundingClientRect(),!H.current)return;const F=z.target===B.current;if(!F&&!!z.target.closest(".nokey")||!t||!(c&&F||r)||z.button!==0||!z.isPrimary)return;(Ie=(Me=z.target)==null?void 0:Me.setPointerCapture)==null||Ie.call(Me,z.pointerId),de.current=!1;const{x:be,y:Se}=Dr(z.nativeEvent,H.current);$.setState({userSelectionRect:{width:0,height:0,startX:be,startY:Se,x:be,y:Se}}),F||(z.stopPropagation(),z.preventDefault())},le=z=>{const{userSelectionRect:W,transform:F,nodeLookup:A,edgeLookup:K,connectionLookup:be,triggerNodeChanges:Se,triggerEdgeChanges:Me,defaultEdgeOptions:Ie,resetSelectedElements:Ae}=$.getState();if(!H.current||!W)return;const{x:_e,y:ze}=Dr(z.nativeEvent,H.current),{startX:ke,startY:He}=W;if(!de.current){const at=r?0:l;if(Math.hypot(_e-ke,ze-He)<=at)return;Ae(),d==null||d(z)}de.current=!0;const Oe={startX:ke,startY:He,x:_e<ke?_e:ke,y:ze<He?ze:He,width:Math.abs(_e-ke),height:Math.abs(ze-He)},Ke=Q.current,lt=ce.current;Q.current=new Set(Kf(A,Oe,F,i===Pa.Partial,!0).map(at=>at.id)),ce.current=new Set;const ut=(Ie==null?void 0:Ie.selectable)??!0;for(const at of Q.current){const Nt=be.get(at);if(Nt)for(const{edgeId:Xt}of Nt.values()){const Zt=K.get(Xt);Zt&&(Zt.selectable??ut)&&ce.current.add(Xt)}}if(!Sh(Ke,Q.current)){const at=Es(A,Q.current,!0);Se(at)}if(!Sh(lt,ce.current)){const at=Es(K,ce.current);Me(at)}$.setState({userSelectionRect:Oe,userSelectionActive:!0,nodesSelectionActive:!1})},G=z=>{var W,F;z.button===0&&((F=(W=z.target)==null?void 0:W.releasePointerCapture)==null||F.call(W,z.pointerId),!T&&z.target===B.current&&$.getState().userSelectionRect&&(we==null||we(z)),$.setState({userSelectionActive:!1,userSelectionRect:null}),de.current&&(h==null||h(z),$.setState({nodesSelectionActive:Q.current.size>0})))},ie=s===!0||Array.isArray(s)&&s.includes(0);return w.jsxs("div",{className:Yt(["react-flow__pane",{draggable:ie,dragging:U,selection:t}]),onClick:R?void 0:hf(we,B),onContextMenu:hf(q,B),onWheel:hf(fe,B),onPointerEnter:R?void 0:x,onPointerMove:R?le:S,onPointerUp:R?G:void 0,onPointerDownCapture:R?L:void 0,onClickCapture:R?xe:void 0,onPointerLeave:C,ref:B,style:Iu,children:[j,w.jsx(h_,{})]})}function Of({id:t,store:r,unselect:i=!1,nodeRef:s}){const{addSelectedNodes:l,unselectNodesAndEdges:c,multiSelectionActive:d,nodeLookup:h,onError:y}=r.getState(),b=h.get(t);if(!b){y==null||y("012",eo.error012(t));return}r.setState({nodesSelectionActive:!1}),b.selected?(i||b.selected&&d)&&(c({nodes:[b],edges:[]}),requestAnimationFrame(()=>{var k;return(k=s==null?void 0:s.current)==null?void 0:k.blur()})):l([t])}function z0({nodeRef:t,disabled:r=!1,noDragClassName:i,handleSelector:s,nodeId:l,isSelectable:c,nodeClickDistance:d}){const h=Tt(),[y,b]=Y.useState(!1),k=Y.useRef();return Y.useEffect(()=>{k.current=ob({getStoreItems:()=>h.getState(),onNodeMouseDown:x=>{Of({id:x,store:h,nodeRef:t})},onDragStart:()=>{b(!0)},onDragStop:()=>{b(!1)}})},[]),Y.useEffect(()=>{if(!(r||!t.current||!k.current))return k.current.update({noDragClassName:i,handleSelector:s,domNode:t.current,isSelectable:c,nodeId:l,nodeClickDistance:d}),()=>{var x;(x=k.current)==null||x.destroy()}},[i,s,r,c,t,l,d]),y}const y_=t=>r=>r.selected&&(r.draggable||t&&typeof r.draggable>"u");function F0(){const t=Tt();return Y.useCallback(i=>{const{nodeExtent:s,snapToGrid:l,snapGrid:c,nodesDraggable:d,onError:h,updateNodePositions:y,nodeLookup:b,nodeOrigin:k}=t.getState(),x=new Map,S=y_(d),C=l?c[0]:5,j=l?c[1]:5,$=i.direction.x*C*i.factor,T=i.direction.y*j*i.factor;for(const[,I]of b){if(!S(I))continue;let U={x:I.internals.positionAbsolute.x+$,y:I.internals.positionAbsolute.y+T};l&&(U=Da(U,c));const{position:P,positionAbsolute:R}=o0({nodeId:I.id,nextPosition:U,nodeLookup:b,nodeExtent:s,nodeOrigin:k,onError:h});I.position=P,I.internals.positionAbsolute=R,x.set(I.id,I)}y(x)},[])}const ed=Y.createContext(null),v_=ed.Provider;ed.Consumer;const B0=()=>Y.useContext(ed),x_=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),w_=(t,r,i)=>s=>{const{connectionClickStartHandle:l,connectionMode:c,connection:d}=s,{fromHandle:h,toHandle:y,isValid:b}=d,k=(y==null?void 0:y.nodeId)===t&&(y==null?void 0:y.id)===r&&(y==null?void 0:y.type)===i;return{connectingFrom:(h==null?void 0:h.nodeId)===t&&(h==null?void 0:h.id)===r&&(h==null?void 0:h.type)===i,connectingTo:k,clickConnecting:(l==null?void 0:l.nodeId)===t&&(l==null?void 0:l.id)===r&&(l==null?void 0:l.type)===i,isPossibleEndHandle:c===$s.Strict?(h==null?void 0:h.type)!==i:t!==(h==null?void 0:h.nodeId)||r!==(h==null?void 0:h.id),connectionInProcess:!!h,clickConnectionInProcess:!!l,valid:k&&b}};function b_({type:t="source",position:r=Ze.Top,isValidConnection:i,isConnectable:s=!0,isConnectableStart:l=!0,isConnectableEnd:c=!0,id:d,onConnect:h,children:y,className:b,onMouseDown:k,onTouchStart:x,...S},C){var le,G;const j=d||null,$=t==="target",T=Tt(),I=B0(),{connectOnClick:U,noPanClassName:P,rfId:R}=yt(x_,Rt),{connectingFrom:B,connectingTo:H,clickConnecting:Q,isPossibleEndHandle:ce,connectionInProcess:de,clickConnectionInProcess:we,valid:q}=yt(w_(I,j,t),Rt);I||(G=(le=T.getState()).onError)==null||G.call(le,"010",eo.error010());const fe=ie=>{const{defaultEdgeOptions:z,onConnect:W,hasDefaultEdges:F}=T.getState(),A={...z,...ie};if(F){const{edges:K,setEdges:be}=T.getState();be(g0(A,K))}W==null||W(A),h==null||h(A)},xe=ie=>{if(!I)return;const z=d0(ie.nativeEvent);if(l&&(z&&ie.button===0||!z)){const W=T.getState();If.onPointerDown(ie.nativeEvent,{handleDomNode:ie.currentTarget,autoPanOnConnect:W.autoPanOnConnect,connectionMode:W.connectionMode,connectionRadius:W.connectionRadius,domNode:W.domNode,nodeLookup:W.nodeLookup,lib:W.lib,isTarget:$,handleId:j,nodeId:I,flowId:W.rfId,panBy:W.panBy,cancelConnection:W.cancelConnection,onConnectStart:W.onConnectStart,onConnectEnd:(...F)=>{var A,K;return(K=(A=T.getState()).onConnectEnd)==null?void 0:K.call(A,...F)},updateConnection:W.updateConnection,onConnect:fe,isValidConnection:i||((...F)=>{var A,K;return((K=(A=T.getState()).isValidConnection)==null?void 0:K.call(A,...F))??!0}),getTransform:()=>T.getState().transform,getFromHandle:()=>T.getState().connection.fromHandle,autoPanSpeed:W.autoPanSpeed,dragThreshold:W.connectionDragThreshold})}z?k==null||k(ie):x==null||x(ie)},L=ie=>{const{onClickConnectStart:z,onClickConnectEnd:W,connectionClickStartHandle:F,connectionMode:A,isValidConnection:K,lib:be,rfId:Se,nodeLookup:Me,connection:Ie}=T.getState();if(!I||!F&&!l)return;if(!F){z==null||z(ie.nativeEvent,{nodeId:I,handleId:j,handleType:t}),T.setState({connectionClickStartHandle:{nodeId:I,type:t,id:j}});return}const Ae=c0(ie.target),_e=i||K,{connection:ze,isValid:ke}=If.isValid(ie.nativeEvent,{handle:{nodeId:I,id:j,type:t},connectionMode:A,fromNodeId:F.nodeId,fromHandleId:F.id||null,fromType:F.type,isValidConnection:_e,flowId:Se,doc:Ae,lib:be,nodeLookup:Me});ke&&ze&&fe(ze);const He=structuredClone(Ie);delete He.inProgress,He.toPosition=He.toHandle?He.toHandle.position:null,W==null||W(ie,He),T.setState({connectionClickStartHandle:null})};return w.jsx("div",{"data-handleid":j,"data-nodeid":I,"data-handlepos":r,"data-id":`${R}-${I}-${j}-${t}`,className:Yt(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",P,b,{source:!$,target:$,connectable:s,connectablestart:l,connectableend:c,clickconnecting:Q,connectingfrom:B,connectingto:H,valid:q,connectionindicator:s&&(!de||ce)&&(de||we?c:l)}]),onMouseDown:xe,onTouchStart:xe,onClick:U?L:void 0,ref:C,...S,children:y})}const Rs=Y.memo(L0(b_));function __({data:t,isConnectable:r,sourcePosition:i=Ze.Bottom}){return w.jsxs(w.Fragment,{children:[t==null?void 0:t.label,w.jsx(Rs,{type:"source",position:i,isConnectable:r})]})}function S_({data:t,isConnectable:r,targetPosition:i=Ze.Top,sourcePosition:s=Ze.Bottom}){return w.jsxs(w.Fragment,{children:[w.jsx(Rs,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label,w.jsx(Rs,{type:"source",position:s,isConnectable:r})]})}function k_(){return null}function N_({data:t,isConnectable:r,targetPosition:i=Ze.Top}){return w.jsxs(w.Fragment,{children:[w.jsx(Rs,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label]})}const xu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Zh={input:__,default:S_,output:N_,group:k_};function E_(t){var r,i,s,l;return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??((r=t.style)==null?void 0:r.width),height:t.height??t.initialHeight??((i=t.style)==null?void 0:i.height)}:{width:t.width??((s=t.style)==null?void 0:s.width),height:t.height??((l=t.style)==null?void 0:l.height)}}const C_=t=>{const{width:r,height:i,x:s,y:l}=La(t.nodeLookup,{filter:c=>!!c.selected});return{width:Lr(r)?r:null,height:Lr(i)?i:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${s}px,${l}px)`}};function j_({onSelectionContextMenu:t,noPanClassName:r,disableKeyboardA11y:i}){const s=Tt(),{width:l,height:c,transformString:d,userSelectionActive:h}=yt(C_,Rt),y=F0(),b=Y.useRef(null);Y.useEffect(()=>{var C;i||(C=b.current)==null||C.focus({preventScroll:!0})},[i]);const k=!h&&l!==null&&c!==null;if(z0({nodeRef:b,disabled:!k}),!k)return null;const x=t?C=>{const j=s.getState().nodes.filter($=>$.selected);t(C,j)}:void 0,S=C=>{Object.prototype.hasOwnProperty.call(xu,C.key)&&(C.preventDefault(),y({direction:xu[C.key],factor:C.shiftKey?4:1}))};return w.jsx("div",{className:Yt(["react-flow__nodesselection","react-flow__container",r]),style:{transform:d},children:w.jsx("div",{ref:b,className:"react-flow__nodesselection-rect",onContextMenu:x,tabIndex:i?void 0:-1,onKeyDown:i?void 0:S,style:{width:l,height:c}})})}const em=typeof window<"u"?window:void 0,P_=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function H0({children:t,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:l,onPaneContextMenu:c,onPaneScroll:d,paneClickDistance:h,deleteKeyCode:y,selectionKeyCode:b,selectionOnDrag:k,selectionMode:x,onSelectionStart:S,onSelectionEnd:C,multiSelectionKeyCode:j,panActivationKeyCode:$,zoomActivationKeyCode:T,elementsSelectable:I,zoomOnScroll:U,zoomOnPinch:P,panOnScroll:R,panOnScrollSpeed:B,panOnScrollMode:H,zoomOnDoubleClick:Q,panOnDrag:ce,defaultViewport:de,translateExtent:we,minZoom:q,maxZoom:fe,preventScrolling:xe,onSelectionContextMenu:L,noWheelClassName:le,noPanClassName:G,disableKeyboardA11y:ie,onViewportChange:z,isControlledViewport:W}){const{nodesSelectionActive:F,userSelectionActive:A}=yt(P_,Rt),K=Ta(b,{target:em}),be=Ta($,{target:em}),Se=be||ce,Me=be||R,Ie=k&&Se!==!0,Ae=K||A||Ie;return u_({deleteKeyCode:y,multiSelectionKeyCode:j}),w.jsx(d_,{onPaneContextMenu:c,elementsSelectable:I,zoomOnScroll:U,zoomOnPinch:P,panOnScroll:Me,panOnScrollSpeed:B,panOnScrollMode:H,zoomOnDoubleClick:Q,panOnDrag:!K&&Se,defaultViewport:de,translateExtent:we,minZoom:q,maxZoom:fe,zoomActivationKeyCode:T,preventScrolling:xe,noWheelClassName:le,noPanClassName:G,onViewportChange:z,isControlledViewport:W,paneClickDistance:h,selectionOnDrag:Ie,children:w.jsxs(g_,{onSelectionStart:S,onSelectionEnd:C,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:l,onPaneContextMenu:c,onPaneScroll:d,panOnDrag:Se,isSelecting:!!Ae,selectionMode:x,selectionKeyPressed:K,paneClickDistance:h,selectionOnDrag:Ie,children:[t,F&&w.jsx(j_,{onSelectionContextMenu:L,noPanClassName:G,disableKeyboardA11y:ie})]})})}H0.displayName="FlowRenderer";const M_=Y.memo(H0),$_=t=>r=>t?Kf(r.nodeLookup,{x:0,y:0,width:r.width,height:r.height},r.transform,!0).map(i=>i.id):Array.from(r.nodeLookup.keys());function T_(t){return yt(Y.useCallback($_(t),[t]),Rt)}const I_=t=>t.updateNodeInternals;function A_(){const t=yt(I_),[r]=Y.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const s=new Map;i.forEach(l=>{const c=l.target.getAttribute("data-id");s.set(c,{id:c,nodeElement:l.target,force:!0})}),t(s)}));return Y.useEffect(()=>()=>{r==null||r.disconnect()},[r]),r}function O_({node:t,nodeType:r,hasDimensions:i,resizeObserver:s}){const l=Tt(),c=Y.useRef(null),d=Y.useRef(null),h=Y.useRef(t.sourcePosition),y=Y.useRef(t.targetPosition),b=Y.useRef(r),k=i&&!!t.internals.handleBounds;return Y.useEffect(()=>{c.current&&!t.hidden&&(!k||d.current!==c.current)&&(d.current&&(s==null||s.unobserve(d.current)),s==null||s.observe(c.current),d.current=c.current)},[k,t.hidden]),Y.useEffect(()=>()=>{d.current&&(s==null||s.unobserve(d.current),d.current=null)},[]),Y.useEffect(()=>{if(c.current){const x=b.current!==r,S=h.current!==t.sourcePosition,C=y.current!==t.targetPosition;(x||S||C)&&(b.current=r,h.current=t.sourcePosition,y.current=t.targetPosition,l.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:c.current,force:!0}]])))}},[t.id,r,t.sourcePosition,t.targetPosition]),c}function R_({id:t,onClick:r,onMouseEnter:i,onMouseMove:s,onMouseLeave:l,onContextMenu:c,onDoubleClick:d,nodesDraggable:h,elementsSelectable:y,nodesConnectable:b,nodesFocusable:k,resizeObserver:x,noDragClassName:S,noPanClassName:C,disableKeyboardA11y:j,rfId:$,nodeTypes:T,nodeClickDistance:I,onError:U}){const{node:P,internals:R,isParent:B}=yt(_e=>{const ze=_e.nodeLookup.get(t),ke=_e.parentLookup.has(t);return{node:ze,internals:ze.internals,isParent:ke}},Rt);let H=P.type||"default",Q=(T==null?void 0:T[H])||Zh[H];Q===void 0&&(U==null||U("003",eo.error003(H)),H="default",Q=(T==null?void 0:T.default)||Zh.default);const ce=!!(P.draggable||h&&typeof P.draggable>"u"),de=!!(P.selectable||y&&typeof P.selectable>"u"),we=!!(P.connectable||b&&typeof P.connectable>"u"),q=!!(P.focusable||k&&typeof P.focusable>"u"),fe=Tt(),xe=l0(P),L=O_({node:P,nodeType:H,hasDimensions:xe,resizeObserver:x}),le=z0({nodeRef:L,disabled:P.hidden||!ce,noDragClassName:S,handleSelector:P.dragHandle,nodeId:t,isSelectable:de,nodeClickDistance:I}),G=F0();if(P.hidden)return null;const ie=Io(P),z=E_(P),W=de||ce||r||i||s||l,F=i?_e=>i(_e,{...R.userNode}):void 0,A=s?_e=>s(_e,{...R.userNode}):void 0,K=l?_e=>l(_e,{...R.userNode}):void 0,be=c?_e=>c(_e,{...R.userNode}):void 0,Se=d?_e=>d(_e,{...R.userNode}):void 0,Me=_e=>{const{selectNodesOnDrag:ze,nodeDragThreshold:ke}=fe.getState();de&&(!ze||!ce||ke>0)&&Of({id:t,store:fe,nodeRef:L}),r&&r(_e,{...R.userNode})},Ie=_e=>{if(!(f0(_e.nativeEvent)||j)){if(Zm.includes(_e.key)&&de){const ze=_e.key==="Escape";Of({id:t,store:fe,unselect:ze,nodeRef:L})}else if(ce&&P.selected&&Object.prototype.hasOwnProperty.call(xu,_e.key)){_e.preventDefault();const{ariaLabelConfig:ze}=fe.getState();fe.setState({ariaLiveMessage:ze["node.a11yDescription.ariaLiveMessage"]({direction:_e.key.replace("Arrow","").toLowerCase(),x:~~R.positionAbsolute.x,y:~~R.positionAbsolute.y})}),G({direction:xu[_e.key],factor:_e.shiftKey?4:1})}}},Ae=()=>{var lt;if(j||!((lt=L.current)!=null&&lt.matches(":focus-visible")))return;const{transform:_e,width:ze,height:ke,autoPanOnNodeFocus:He,setCenter:Oe}=fe.getState();if(!He)return;Kf(new Map([[t,P]]),{x:0,y:0,width:ze,height:ke},_e,!0).length>0||Oe(P.position.x+ie.width/2,P.position.y+ie.height/2,{zoom:_e[2]})};return w.jsx("div",{className:Yt(["react-flow__node",`react-flow__node-${H}`,{[C]:ce},P.className,{selected:P.selected,selectable:de,parent:B,draggable:ce,dragging:le}]),ref:L,style:{zIndex:R.z,transform:`translate(${R.positionAbsolute.x}px,${R.positionAbsolute.y}px)`,pointerEvents:W?"all":"none",visibility:xe?"visible":"hidden",...P.style,...z},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:F,onMouseMove:A,onMouseLeave:K,onContextMenu:be,onClick:Me,onDoubleClick:Se,onKeyDown:q?Ie:void 0,tabIndex:q?0:void 0,onFocus:q?Ae:void 0,role:P.ariaRole??(q?"group":void 0),"aria-roledescription":"node","aria-describedby":j?void 0:`${$0}-${$}`,"aria-label":P.ariaLabel,...P.domAttributes,children:w.jsx(v_,{value:t,children:w.jsx(Q,{id:t,data:P.data,type:H,positionAbsoluteX:R.positionAbsolute.x,positionAbsoluteY:R.positionAbsolute.y,selected:P.selected??!1,selectable:de,draggable:ce,deletable:P.deletable??!0,isConnectable:we,sourcePosition:P.sourcePosition,targetPosition:P.targetPosition,dragging:le,dragHandle:P.dragHandle,zIndex:R.z,parentId:P.parentId,...ie})})})}var L_=Y.memo(R_);const D_=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function V0(t){const{nodesDraggable:r,nodesConnectable:i,nodesFocusable:s,elementsSelectable:l,onError:c}=yt(D_,Rt),d=T_(t.onlyRenderVisibleElements),h=A_();return w.jsx("div",{className:"react-flow__nodes",style:Iu,children:d.map(y=>w.jsx(L_,{id:y,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:h,nodesDraggable:r,nodesConnectable:i,nodesFocusable:s,elementsSelectable:l,nodeClickDistance:t.nodeClickDistance,onError:c},y))})}V0.displayName="NodeRenderer";const z_=Y.memo(V0);function F_(t){return yt(Y.useCallback(i=>{if(!t)return i.edges.map(l=>l.id);const s=[];if(i.width&&i.height)for(const l of i.edges){const c=i.nodeLookup.get(l.source),d=i.nodeLookup.get(l.target);c&&d&&F1({sourceNode:c,targetNode:d,width:i.width,height:i.height,transform:i.transform})&&s.push(l.id)}return s},[t]),Rt)}const B_=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t}};return w.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},H_=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t,fill:t}};return w.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},tm={[gu.Arrow]:B_,[gu.ArrowClosed]:H_};function V_(t){const r=Tt();return Y.useMemo(()=>{var l,c;return Object.prototype.hasOwnProperty.call(tm,t)?tm[t]:((c=(l=r.getState()).onError)==null||c.call(l,"009",eo.error009(t)),null)},[t])}const U_=({id:t,type:r,color:i,width:s=12.5,height:l=12.5,markerUnits:c="strokeWidth",strokeWidth:d,orient:h="auto-start-reverse"})=>{const y=V_(r);return y?w.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${s}`,markerHeight:`${l}`,viewBox:"-10 -10 20 20",markerUnits:c,orient:h,refX:"0",refY:"0",children:w.jsx(y,{color:i,strokeWidth:d})}):null},U0=({defaultColor:t,rfId:r})=>{const i=yt(c=>c.edges),s=yt(c=>c.defaultEdgeOptions),l=Y.useMemo(()=>W1(i,{id:r,defaultColor:t,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[i,s,r,t]);return l.length?w.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:w.jsx("defs",{children:l.map(c=>w.jsx(U_,{id:c.id,type:c.type,color:c.color,width:c.width,height:c.height,markerUnits:c.markerUnits,strokeWidth:c.strokeWidth,orient:c.orient},c.id))})}):null};U0.displayName="MarkerDefinitions";var K_=Y.memo(U0);function K0({x:t,y:r,label:i,labelStyle:s,labelShowBg:l=!0,labelBgStyle:c,labelBgPadding:d=[2,4],labelBgBorderRadius:h=2,children:y,className:b,...k}){const[x,S]=Y.useState({x:1,y:0,width:0,height:0}),C=Yt(["react-flow__edge-textwrapper",b]),j=Y.useRef(null);return Y.useEffect(()=>{if(j.current){const $=j.current.getBBox();S({x:$.x,y:$.y,width:$.width,height:$.height})}},[i]),i?w.jsxs("g",{transform:`translate(${t-x.width/2} ${r-x.height/2})`,className:C,visibility:x.width?"visible":"hidden",...k,children:[l&&w.jsx("rect",{width:x.width+2*d[0],x:-d[0],y:-d[1],height:x.height+2*d[1],className:"react-flow__edge-textbg",style:c,rx:h,ry:h}),w.jsx("text",{className:"react-flow__edge-text",y:x.height/2,dy:"0.3em",ref:j,style:s,children:i}),y]}):null}K0.displayName="EdgeText";const q_=Y.memo(K0);function Au({path:t,labelX:r,labelY:i,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:y,interactionWidth:b=20,...k}){return w.jsxs(w.Fragment,{children:[w.jsx("path",{...k,d:t,fill:"none",className:Yt(["react-flow__edge-path",k.className])}),b?w.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:b,className:"react-flow__edge-interaction"}):null,s&&Lr(r)&&Lr(i)?w.jsx(q_,{x:r,y:i,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:y}):null]})}function nm({pos:t,x1:r,y1:i,x2:s,y2:l}){return t===Ze.Left||t===Ze.Right?[.5*(r+s),i]:[r,.5*(i+l)]}function q0({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:s,targetY:l,targetPosition:c=Ze.Top}){const[d,h]=nm({pos:i,x1:t,y1:r,x2:s,y2:l}),[y,b]=nm({pos:c,x1:s,y1:l,x2:t,y2:r}),[k,x,S,C]=p0({sourceX:t,sourceY:r,targetX:s,targetY:l,sourceControlX:d,sourceControlY:h,targetControlX:y,targetControlY:b});return[`M${t},${r} C${d},${h} ${y},${b} ${s},${l}`,k,x,S,C]}function W0(t){return Y.memo(({id:r,sourceX:i,sourceY:s,targetX:l,targetY:c,sourcePosition:d,targetPosition:h,label:y,labelStyle:b,labelShowBg:k,labelBgStyle:x,labelBgPadding:S,labelBgBorderRadius:C,style:j,markerEnd:$,markerStart:T,interactionWidth:I})=>{const[U,P,R]=q0({sourceX:i,sourceY:s,sourcePosition:d,targetX:l,targetY:c,targetPosition:h}),B=t.isInternal?void 0:r;return w.jsx(Au,{id:B,path:U,labelX:P,labelY:R,label:y,labelStyle:b,labelShowBg:k,labelBgStyle:x,labelBgPadding:S,labelBgBorderRadius:C,style:j,markerEnd:$,markerStart:T,interactionWidth:I})})}const W_=W0({isInternal:!1}),Y0=W0({isInternal:!0});W_.displayName="SimpleBezierEdge";Y0.displayName="SimpleBezierEdgeInternal";function X0(t){return Y.memo(({id:r,sourceX:i,sourceY:s,targetX:l,targetY:c,label:d,labelStyle:h,labelShowBg:y,labelBgStyle:b,labelBgPadding:k,labelBgBorderRadius:x,style:S,sourcePosition:C=Ze.Bottom,targetPosition:j=Ze.Top,markerEnd:$,markerStart:T,pathOptions:I,interactionWidth:U})=>{const[P,R,B]=Mf({sourceX:i,sourceY:s,sourcePosition:C,targetX:l,targetY:c,targetPosition:j,borderRadius:I==null?void 0:I.borderRadius,offset:I==null?void 0:I.offset,stepPosition:I==null?void 0:I.stepPosition}),H=t.isInternal?void 0:r;return w.jsx(Au,{id:H,path:P,labelX:R,labelY:B,label:d,labelStyle:h,labelShowBg:y,labelBgStyle:b,labelBgPadding:k,labelBgBorderRadius:x,style:S,markerEnd:$,markerStart:T,interactionWidth:U})})}const Q0=X0({isInternal:!1}),G0=X0({isInternal:!0});Q0.displayName="SmoothStepEdge";G0.displayName="SmoothStepEdgeInternal";function J0(t){return Y.memo(({id:r,...i})=>{var l;const s=t.isInternal?void 0:r;return w.jsx(Q0,{...i,id:s,pathOptions:Y.useMemo(()=>{var c;return{borderRadius:0,offset:(c=i.pathOptions)==null?void 0:c.offset}},[(l=i.pathOptions)==null?void 0:l.offset])})})}const Y_=J0({isInternal:!1}),Z0=J0({isInternal:!0});Y_.displayName="StepEdge";Z0.displayName="StepEdgeInternal";function eg(t){return Y.memo(({id:r,sourceX:i,sourceY:s,targetX:l,targetY:c,label:d,labelStyle:h,labelShowBg:y,labelBgStyle:b,labelBgPadding:k,labelBgBorderRadius:x,style:S,markerEnd:C,markerStart:j,interactionWidth:$})=>{const[T,I,U]=y0({sourceX:i,sourceY:s,targetX:l,targetY:c}),P=t.isInternal?void 0:r;return w.jsx(Au,{id:P,path:T,labelX:I,labelY:U,label:d,labelStyle:h,labelShowBg:y,labelBgStyle:b,labelBgPadding:k,labelBgBorderRadius:x,style:S,markerEnd:C,markerStart:j,interactionWidth:$})})}const X_=eg({isInternal:!1}),tg=eg({isInternal:!0});X_.displayName="StraightEdge";tg.displayName="StraightEdgeInternal";function ng(t){return Y.memo(({id:r,sourceX:i,sourceY:s,targetX:l,targetY:c,sourcePosition:d=Ze.Bottom,targetPosition:h=Ze.Top,label:y,labelStyle:b,labelShowBg:k,labelBgStyle:x,labelBgPadding:S,labelBgBorderRadius:C,style:j,markerEnd:$,markerStart:T,pathOptions:I,interactionWidth:U})=>{const[P,R,B]=h0({sourceX:i,sourceY:s,sourcePosition:d,targetX:l,targetY:c,targetPosition:h,curvature:I==null?void 0:I.curvature}),H=t.isInternal?void 0:r;return w.jsx(Au,{id:H,path:P,labelX:R,labelY:B,label:y,labelStyle:b,labelShowBg:k,labelBgStyle:x,labelBgPadding:S,labelBgBorderRadius:C,style:j,markerEnd:$,markerStart:T,interactionWidth:U})})}const Q_=ng({isInternal:!1}),rg=ng({isInternal:!0});Q_.displayName="BezierEdge";rg.displayName="BezierEdgeInternal";const rm={default:rg,straight:tg,step:Z0,smoothstep:G0,simplebezier:Y0},om={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},G_=(t,r,i)=>i===Ze.Left?t-r:i===Ze.Right?t+r:t,J_=(t,r,i)=>i===Ze.Top?t-r:i===Ze.Bottom?t+r:t,im="react-flow__edgeupdater";function sm({position:t,centerX:r,centerY:i,radius:s=10,onMouseDown:l,onMouseEnter:c,onMouseOut:d,type:h}){return w.jsx("circle",{onMouseDown:l,onMouseEnter:c,onMouseOut:d,className:Yt([im,`${im}-${h}`]),cx:G_(r,s,t),cy:J_(i,s,t),r:s,stroke:"transparent",fill:"transparent"})}function Z_({isReconnectable:t,reconnectRadius:r,edge:i,sourceX:s,sourceY:l,targetX:c,targetY:d,sourcePosition:h,targetPosition:y,onReconnect:b,onReconnectStart:k,onReconnectEnd:x,setReconnecting:S,setUpdateHover:C}){const j=Tt(),$=(R,B)=>{if(R.button!==0)return;const{autoPanOnConnect:H,domNode:Q,connectionMode:ce,connectionRadius:de,lib:we,onConnectStart:q,cancelConnection:fe,nodeLookup:xe,rfId:L,panBy:le,updateConnection:G}=j.getState(),ie=B.type==="target",z=(A,K)=>{S(!1),x==null||x(A,i,B.type,K)},W=A=>b==null?void 0:b(i,A),F=(A,K)=>{S(!0),k==null||k(R,i,B.type),q==null||q(A,K)};If.onPointerDown(R.nativeEvent,{autoPanOnConnect:H,connectionMode:ce,connectionRadius:de,domNode:Q,handleId:B.id,nodeId:B.nodeId,nodeLookup:xe,isTarget:ie,edgeUpdaterType:B.type,lib:we,flowId:L,cancelConnection:fe,panBy:le,isValidConnection:(...A)=>{var K,be;return((be=(K=j.getState()).isValidConnection)==null?void 0:be.call(K,...A))??!0},onConnect:W,onConnectStart:F,onConnectEnd:(...A)=>{var K,be;return(be=(K=j.getState()).onConnectEnd)==null?void 0:be.call(K,...A)},onReconnectEnd:z,updateConnection:G,getTransform:()=>j.getState().transform,getFromHandle:()=>j.getState().connection.fromHandle,dragThreshold:j.getState().connectionDragThreshold,handleDomNode:R.currentTarget})},T=R=>$(R,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),I=R=>$(R,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),U=()=>C(!0),P=()=>C(!1);return w.jsxs(w.Fragment,{children:[(t===!0||t==="source")&&w.jsx(sm,{position:h,centerX:s,centerY:l,radius:r,onMouseDown:T,onMouseEnter:U,onMouseOut:P,type:"source"}),(t===!0||t==="target")&&w.jsx(sm,{position:y,centerX:c,centerY:d,radius:r,onMouseDown:I,onMouseEnter:U,onMouseOut:P,type:"target"})]})}function eS({id:t,edgesFocusable:r,edgesReconnectable:i,elementsSelectable:s,onClick:l,onDoubleClick:c,onContextMenu:d,onMouseEnter:h,onMouseMove:y,onMouseLeave:b,reconnectRadius:k,onReconnect:x,onReconnectStart:S,onReconnectEnd:C,rfId:j,edgeTypes:$,noPanClassName:T,onError:I,disableKeyboardA11y:U}){let P=yt(Oe=>Oe.edgeLookup.get(t));const R=yt(Oe=>Oe.defaultEdgeOptions);P=R?{...R,...P}:P;let B=P.type||"default",H=($==null?void 0:$[B])||rm[B];H===void 0&&(I==null||I("011",eo.error011(B)),B="default",H=($==null?void 0:$.default)||rm.default);const Q=!!(P.focusable||r&&typeof P.focusable>"u"),ce=typeof x<"u"&&(P.reconnectable||i&&typeof P.reconnectable>"u"),de=!!(P.selectable||s&&typeof P.selectable>"u"),we=Y.useRef(null),[q,fe]=Y.useState(!1),[xe,L]=Y.useState(!1),le=Tt(),{zIndex:G,sourceX:ie,sourceY:z,targetX:W,targetY:F,sourcePosition:A,targetPosition:K}=yt(Y.useCallback(Oe=>{const Ke=Oe.nodeLookup.get(P.source),lt=Oe.nodeLookup.get(P.target);if(!Ke||!lt)return{zIndex:P.zIndex,...om};const ut=q1({id:t,sourceNode:Ke,targetNode:lt,sourceHandle:P.sourceHandle||null,targetHandle:P.targetHandle||null,connectionMode:Oe.connectionMode,onError:I});return{zIndex:z1({selected:P.selected,zIndex:P.zIndex,sourceNode:Ke,targetNode:lt,elevateOnSelect:Oe.elevateEdgesOnSelect,zIndexMode:Oe.zIndexMode}),...ut||om}},[P.source,P.target,P.sourceHandle,P.targetHandle,P.selected,P.zIndex]),Rt),be=Y.useMemo(()=>P.markerStart?`url('#${$f(P.markerStart,j)}')`:void 0,[P.markerStart,j]),Se=Y.useMemo(()=>P.markerEnd?`url('#${$f(P.markerEnd,j)}')`:void 0,[P.markerEnd,j]);if(P.hidden||ie===null||z===null||W===null||F===null)return null;const Me=Oe=>{var at;const{addSelectedEdges:Ke,unselectNodesAndEdges:lt,multiSelectionActive:ut}=le.getState();de&&(le.setState({nodesSelectionActive:!1}),P.selected&&ut?(lt({nodes:[],edges:[P]}),(at=we.current)==null||at.blur()):Ke([t])),l&&l(Oe,P)},Ie=c?Oe=>{c(Oe,{...P})}:void 0,Ae=d?Oe=>{d(Oe,{...P})}:void 0,_e=h?Oe=>{h(Oe,{...P})}:void 0,ze=y?Oe=>{y(Oe,{...P})}:void 0,ke=b?Oe=>{b(Oe,{...P})}:void 0,He=Oe=>{var Ke;if(!U&&Zm.includes(Oe.key)&&de){const{unselectNodesAndEdges:lt,addSelectedEdges:ut}=le.getState();Oe.key==="Escape"?((Ke=we.current)==null||Ke.blur(),lt({edges:[P]})):ut([t])}};return w.jsx("svg",{style:{zIndex:G},children:w.jsxs("g",{className:Yt(["react-flow__edge",`react-flow__edge-${B}`,P.className,T,{selected:P.selected,animated:P.animated,inactive:!de&&!l,updating:q,selectable:de}]),onClick:Me,onDoubleClick:Ie,onContextMenu:Ae,onMouseEnter:_e,onMouseMove:ze,onMouseLeave:ke,onKeyDown:Q?He:void 0,tabIndex:Q?0:void 0,role:P.ariaRole??(Q?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":P.ariaLabel===null?void 0:P.ariaLabel||`Edge from ${P.source} to ${P.target}`,"aria-describedby":Q?`${T0}-${j}`:void 0,ref:we,...P.domAttributes,children:[!xe&&w.jsx(H,{id:t,source:P.source,target:P.target,type:P.type,selected:P.selected,animated:P.animated,selectable:de,deletable:P.deletable??!0,label:P.label,labelStyle:P.labelStyle,labelShowBg:P.labelShowBg,labelBgStyle:P.labelBgStyle,labelBgPadding:P.labelBgPadding,labelBgBorderRadius:P.labelBgBorderRadius,sourceX:ie,sourceY:z,targetX:W,targetY:F,sourcePosition:A,targetPosition:K,data:P.data,style:P.style,sourceHandleId:P.sourceHandle,targetHandleId:P.targetHandle,markerStart:be,markerEnd:Se,pathOptions:"pathOptions"in P?P.pathOptions:void 0,interactionWidth:P.interactionWidth}),ce&&w.jsx(Z_,{edge:P,isReconnectable:ce,reconnectRadius:k,onReconnect:x,onReconnectStart:S,onReconnectEnd:C,sourceX:ie,sourceY:z,targetX:W,targetY:F,sourcePosition:A,targetPosition:K,setUpdateHover:fe,setReconnecting:L})]})})}var tS=Y.memo(eS);const nS=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function og({defaultMarkerColor:t,onlyRenderVisibleElements:r,rfId:i,edgeTypes:s,noPanClassName:l,onReconnect:c,onEdgeContextMenu:d,onEdgeMouseEnter:h,onEdgeMouseMove:y,onEdgeMouseLeave:b,onEdgeClick:k,reconnectRadius:x,onEdgeDoubleClick:S,onReconnectStart:C,onReconnectEnd:j,disableKeyboardA11y:$}){const{edgesFocusable:T,edgesReconnectable:I,elementsSelectable:U,onError:P}=yt(nS,Rt),R=F_(r);return w.jsxs("div",{className:"react-flow__edges",children:[w.jsx(K_,{defaultColor:t,rfId:i}),R.map(B=>w.jsx(tS,{id:B,edgesFocusable:T,edgesReconnectable:I,elementsSelectable:U,noPanClassName:l,onReconnect:c,onContextMenu:d,onMouseEnter:h,onMouseMove:y,onMouseLeave:b,onClick:k,reconnectRadius:x,onDoubleClick:S,onReconnectStart:C,onReconnectEnd:j,rfId:i,onError:P,edgeTypes:s,disableKeyboardA11y:$},B))]})}og.displayName="EdgeRenderer";const rS=Y.memo(og),oS=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function iS({children:t}){const r=yt(oS);return w.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:t})}function sS(t){const r=Zf(),i=Y.useRef(!1);Y.useEffect(()=>{!i.current&&r.viewportInitialized&&t&&(setTimeout(()=>t(r),1),i.current=!0)},[t,r.viewportInitialized])}const aS=t=>{var r;return(r=t.panZoom)==null?void 0:r.syncViewport};function lS(t){const r=yt(aS),i=Tt();return Y.useEffect(()=>{t&&(r==null||r(t),i.setState({transform:[t.x,t.y,t.zoom]}))},[t,r]),null}function uS(t){return t.connection.inProgress?{...t.connection,to:za(t.connection.to,t.transform)}:{...t.connection}}function cS(t){return uS}function fS(t){const r=cS();return yt(r,Rt)}const dS=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function pS({containerStyle:t,style:r,type:i,component:s}){const{nodesConnectable:l,width:c,height:d,isValid:h,inProgress:y}=yt(dS,Rt);return!(c&&l&&y)?null:w.jsx("svg",{style:t,width:c,height:d,className:"react-flow__connectionline react-flow__container",children:w.jsx("g",{className:Yt(["react-flow__connection",n0(h)]),children:w.jsx(ig,{style:r,type:i,CustomComponent:s,isValid:h})})})}const ig=({style:t,type:r=fi.Bezier,CustomComponent:i,isValid:s})=>{const{inProgress:l,from:c,fromNode:d,fromHandle:h,fromPosition:y,to:b,toNode:k,toHandle:x,toPosition:S,pointer:C}=fS();if(!l)return;if(i)return w.jsx(i,{connectionLineType:r,connectionLineStyle:t,fromNode:d,fromHandle:h,fromX:c.x,fromY:c.y,toX:b.x,toY:b.y,fromPosition:y,toPosition:S,connectionStatus:n0(s),toNode:k,toHandle:x,pointer:C});let j="";const $={sourceX:c.x,sourceY:c.y,sourcePosition:y,targetX:b.x,targetY:b.y,targetPosition:S};switch(r){case fi.Bezier:[j]=h0($);break;case fi.SimpleBezier:[j]=q0($);break;case fi.Step:[j]=Mf({...$,borderRadius:0});break;case fi.SmoothStep:[j]=Mf($);break;default:[j]=y0($)}return w.jsx("path",{d:j,fill:"none",className:"react-flow__connection-path",style:t})};ig.displayName="ConnectionLine";const hS={};function am(t=hS){Y.useRef(t),Tt(),Y.useEffect(()=>{},[t])}function mS(){Tt(),Y.useRef(!1),Y.useEffect(()=>{},[])}function sg({nodeTypes:t,edgeTypes:r,onInit:i,onNodeClick:s,onEdgeClick:l,onNodeDoubleClick:c,onEdgeDoubleClick:d,onNodeMouseEnter:h,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:k,onSelectionContextMenu:x,onSelectionStart:S,onSelectionEnd:C,connectionLineType:j,connectionLineStyle:$,connectionLineComponent:T,connectionLineContainerStyle:I,selectionKeyCode:U,selectionOnDrag:P,selectionMode:R,multiSelectionKeyCode:B,panActivationKeyCode:H,zoomActivationKeyCode:Q,deleteKeyCode:ce,onlyRenderVisibleElements:de,elementsSelectable:we,defaultViewport:q,translateExtent:fe,minZoom:xe,maxZoom:L,preventScrolling:le,defaultMarkerColor:G,zoomOnScroll:ie,zoomOnPinch:z,panOnScroll:W,panOnScrollSpeed:F,panOnScrollMode:A,zoomOnDoubleClick:K,panOnDrag:be,onPaneClick:Se,onPaneMouseEnter:Me,onPaneMouseMove:Ie,onPaneMouseLeave:Ae,onPaneScroll:_e,onPaneContextMenu:ze,paneClickDistance:ke,nodeClickDistance:He,onEdgeContextMenu:Oe,onEdgeMouseEnter:Ke,onEdgeMouseMove:lt,onEdgeMouseLeave:ut,reconnectRadius:at,onReconnect:Nt,onReconnectStart:Xt,onReconnectEnd:Zt,noDragClassName:Vt,noWheelClassName:Et,noPanClassName:Bt,disableKeyboardA11y:fn,nodeExtent:It,rfId:bn,viewport:St,onViewportChange:Lt}){return am(t),am(r),mS(),sS(i),lS(St),w.jsx(M_,{onPaneClick:Se,onPaneMouseEnter:Me,onPaneMouseMove:Ie,onPaneMouseLeave:Ae,onPaneContextMenu:ze,onPaneScroll:_e,paneClickDistance:ke,deleteKeyCode:ce,selectionKeyCode:U,selectionOnDrag:P,selectionMode:R,onSelectionStart:S,onSelectionEnd:C,multiSelectionKeyCode:B,panActivationKeyCode:H,zoomActivationKeyCode:Q,elementsSelectable:we,zoomOnScroll:ie,zoomOnPinch:z,zoomOnDoubleClick:K,panOnScroll:W,panOnScrollSpeed:F,panOnScrollMode:A,panOnDrag:be,defaultViewport:q,translateExtent:fe,minZoom:xe,maxZoom:L,onSelectionContextMenu:x,preventScrolling:le,noDragClassName:Vt,noWheelClassName:Et,noPanClassName:Bt,disableKeyboardA11y:fn,onViewportChange:Lt,isControlledViewport:!!St,children:w.jsxs(iS,{children:[w.jsx(rS,{edgeTypes:r,onEdgeClick:l,onEdgeDoubleClick:d,onReconnect:Nt,onReconnectStart:Xt,onReconnectEnd:Zt,onlyRenderVisibleElements:de,onEdgeContextMenu:Oe,onEdgeMouseEnter:Ke,onEdgeMouseMove:lt,onEdgeMouseLeave:ut,reconnectRadius:at,defaultMarkerColor:G,noPanClassName:Bt,disableKeyboardA11y:fn,rfId:bn}),w.jsx(pS,{style:$,type:j,component:T,containerStyle:I}),w.jsx("div",{className:"react-flow__edgelabel-renderer"}),w.jsx(z_,{nodeTypes:t,onNodeClick:s,onNodeDoubleClick:c,onNodeMouseEnter:h,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:k,nodeClickDistance:He,onlyRenderVisibleElements:de,noPanClassName:Bt,noDragClassName:Vt,disableKeyboardA11y:fn,nodeExtent:It,rfId:bn}),w.jsx("div",{className:"react-flow__viewport-portal"})]})})}sg.displayName="GraphView";const gS=Y.memo(sg),lm=({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:l,height:c,fitView:d,fitViewOptions:h,minZoom:y=.5,maxZoom:b=2,nodeOrigin:k,nodeExtent:x,zIndexMode:S="basic"}={})=>{const C=new Map,j=new Map,$=new Map,T=new Map,I=s??r??[],U=i??t??[],P=k??[0,0],R=x??ja;w0($,T,I);const{nodesInitialized:B}=Tf(U,C,j,{nodeOrigin:P,nodeExtent:R,zIndexMode:S});let H=[0,0,1];if(d&&l&&c){const Q=La(C,{filter:q=>!!((q.width||q.initialWidth)&&(q.height||q.initialHeight))}),{x:ce,y:de,zoom:we}=qf(Q,l,c,y,b,(h==null?void 0:h.padding)??.1);H=[ce,de,we]}return{rfId:"1",width:l??0,height:c??0,transform:H,nodes:U,nodesInitialized:B,nodeLookup:C,parentLookup:j,edges:I,edgeLookup:T,connectionLookup:$,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:y,maxZoom:b,translateExtent:ja,nodeExtent:R,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:$s.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:P,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:d??!1,fitViewOptions:h,fitViewResolver:null,connection:{...t0},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:I1,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:e0,zIndexMode:S,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},yS=({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:l,height:c,fitView:d,fitViewOptions:h,minZoom:y,maxZoom:b,nodeOrigin:k,nodeExtent:x,zIndexMode:S})=>Rb((C,j)=>{async function $(){const{nodeLookup:T,panZoom:I,fitViewOptions:U,fitViewResolver:P,width:R,height:B,minZoom:H,maxZoom:Q}=j();I&&(await $1({nodes:T,width:R,height:B,panZoom:I,minZoom:H,maxZoom:Q},U),P==null||P.resolve(!0),C({fitViewResolver:null}))}return{...lm({nodes:t,edges:r,width:l,height:c,fitView:d,fitViewOptions:h,minZoom:y,maxZoom:b,nodeOrigin:k,nodeExtent:x,defaultNodes:i,defaultEdges:s,zIndexMode:S}),setNodes:T=>{const{nodeLookup:I,parentLookup:U,nodeOrigin:P,elevateNodesOnSelect:R,fitViewQueued:B,zIndexMode:H,nodesSelectionActive:Q}=j(),{nodesInitialized:ce,hasSelectedNodes:de}=Tf(T,I,U,{nodeOrigin:P,nodeExtent:x,elevateNodesOnSelect:R,checkEquality:!0,zIndexMode:H}),we=Q&&de;B&&ce?($(),C({nodes:T,nodesInitialized:ce,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:we})):C({nodes:T,nodesInitialized:ce,nodesSelectionActive:we})},setEdges:T=>{const{connectionLookup:I,edgeLookup:U}=j();w0(I,U,T),C({edges:T})},setDefaultNodesAndEdges:(T,I)=>{if(T){const{setNodes:U}=j();U(T),C({hasDefaultNodes:!0})}if(I){const{setEdges:U}=j();U(I),C({hasDefaultEdges:!0})}},updateNodeInternals:T=>{const{triggerNodeChanges:I,nodeLookup:U,parentLookup:P,domNode:R,nodeOrigin:B,nodeExtent:H,debug:Q,fitViewQueued:ce,zIndexMode:de}=j(),{changes:we,updatedInternals:q}=eb(T,U,P,R,B,H,de);q&&(Q1(U,P,{nodeOrigin:B,nodeExtent:H,zIndexMode:de}),ce?($(),C({fitViewQueued:!1,fitViewOptions:void 0})):C({}),(we==null?void 0:we.length)>0&&(Q&&console.log("React Flow: trigger node changes",we),I==null||I(we)))},updateNodePositions:(T,I=!1)=>{const U=[];let P=[];const{nodeLookup:R,triggerNodeChanges:B,connection:H,updateConnection:Q,onNodesChangeMiddlewareMap:ce}=j();for(const[de,we]of T){const q=R.get(de),fe=!!(q!=null&&q.expandParent&&(q!=null&&q.parentId)&&(we!=null&&we.position)),xe={id:de,type:"position",position:fe?{x:Math.max(0,we.position.x),y:Math.max(0,we.position.y)}:we.position,dragging:I};if(q&&H.inProgress&&H.fromNode.id===q.id){const L=Bi(q,H.fromHandle,Ze.Left,!0);Q({...H,from:L})}fe&&q.parentId&&U.push({id:de,parentId:q.parentId,rect:{...we.internals.positionAbsolute,width:we.measured.width??0,height:we.measured.height??0}}),P.push(xe)}if(U.length>0){const{parentLookup:de,nodeOrigin:we}=j(),q=Jf(U,R,de,we);P.push(...q)}for(const de of ce.values())P=de(P);B(P)},triggerNodeChanges:T=>{const{onNodesChange:I,setNodes:U,nodes:P,hasDefaultNodes:R,debug:B}=j();if(T!=null&&T.length){if(R){const H=O0(T,P);U(H)}B&&console.log("React Flow: trigger node changes",T),I==null||I(T)}},triggerEdgeChanges:T=>{const{onEdgesChange:I,setEdges:U,edges:P,hasDefaultEdges:R,debug:B}=j();if(T!=null&&T.length){if(R){const H=R0(T,P);U(H)}B&&console.log("React Flow: trigger edge changes",T),I==null||I(T)}},addSelectedNodes:T=>{const{multiSelectionActive:I,edgeLookup:U,nodeLookup:P,triggerNodeChanges:R,triggerEdgeChanges:B}=j();if(I){const H=T.map(Q=>Ai(Q,!0));R(H);return}R(Es(P,new Set([...T]),!0)),B(Es(U))},addSelectedEdges:T=>{const{multiSelectionActive:I,edgeLookup:U,nodeLookup:P,triggerNodeChanges:R,triggerEdgeChanges:B}=j();if(I){const H=T.map(Q=>Ai(Q,!0));B(H);return}B(Es(U,new Set([...T]))),R(Es(P,new Set,!0))},unselectNodesAndEdges:({nodes:T,edges:I}={})=>{const{edges:U,nodes:P,nodeLookup:R,triggerNodeChanges:B,triggerEdgeChanges:H}=j(),Q=T||P,ce=I||U,de=[];for(const q of Q){if(!q.selected)continue;const fe=R.get(q.id);fe&&(fe.selected=!1),de.push(Ai(q.id,!1))}const we=[];for(const q of ce)q.selected&&we.push(Ai(q.id,!1));B(de),H(we)},setMinZoom:T=>{const{panZoom:I,maxZoom:U}=j();I==null||I.setScaleExtent([T,U]),C({minZoom:T})},setMaxZoom:T=>{const{panZoom:I,minZoom:U}=j();I==null||I.setScaleExtent([U,T]),C({maxZoom:T})},setTranslateExtent:T=>{var I;(I=j().panZoom)==null||I.setTranslateExtent(T),C({translateExtent:T})},resetSelectedElements:()=>{const{edges:T,nodes:I,triggerNodeChanges:U,triggerEdgeChanges:P,elementsSelectable:R}=j();if(!R)return;const B=I.reduce((Q,ce)=>ce.selected?[...Q,Ai(ce.id,!1)]:Q,[]),H=T.reduce((Q,ce)=>ce.selected?[...Q,Ai(ce.id,!1)]:Q,[]);U(B),P(H)},setNodeExtent:T=>{const{nodes:I,nodeLookup:U,parentLookup:P,nodeOrigin:R,elevateNodesOnSelect:B,nodeExtent:H,zIndexMode:Q}=j();T[0][0]===H[0][0]&&T[0][1]===H[0][1]&&T[1][0]===H[1][0]&&T[1][1]===H[1][1]||(Tf(I,U,P,{nodeOrigin:R,nodeExtent:T,elevateNodesOnSelect:B,checkEquality:!1,zIndexMode:Q}),C({nodeExtent:T}))},panBy:T=>{const{transform:I,width:U,height:P,panZoom:R,translateExtent:B}=j();return tb({delta:T,panZoom:R,transform:I,translateExtent:B,width:U,height:P})},setCenter:async(T,I,U)=>{const{width:P,height:R,maxZoom:B,panZoom:H}=j();if(!H)return Promise.resolve(!1);const Q=typeof(U==null?void 0:U.zoom)<"u"?U.zoom:B;return await H.setViewport({x:P/2-T*Q,y:R/2-I*Q,zoom:Q},{duration:U==null?void 0:U.duration,ease:U==null?void 0:U.ease,interpolate:U==null?void 0:U.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{C({connection:{...t0}})},updateConnection:T=>{C({connection:T})},reset:()=>C({...lm()})}},Object.is);function vS({initialNodes:t,initialEdges:r,defaultNodes:i,defaultEdges:s,initialWidth:l,initialHeight:c,initialMinZoom:d,initialMaxZoom:h,initialFitViewOptions:y,fitView:b,nodeOrigin:k,nodeExtent:x,zIndexMode:S,children:C}){const[j]=Y.useState(()=>yS({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:l,height:c,fitView:b,minZoom:d,maxZoom:h,fitViewOptions:y,nodeOrigin:k,nodeExtent:x,zIndexMode:S}));return w.jsx(Lb,{value:j,children:w.jsx(i_,{children:C})})}function xS({children:t,nodes:r,edges:i,defaultNodes:s,defaultEdges:l,width:c,height:d,fitView:h,fitViewOptions:y,minZoom:b,maxZoom:k,nodeOrigin:x,nodeExtent:S,zIndexMode:C}){return Y.useContext(Tu)?w.jsx(w.Fragment,{children:t}):w.jsx(vS,{initialNodes:r,initialEdges:i,defaultNodes:s,defaultEdges:l,initialWidth:c,initialHeight:d,fitView:h,initialFitViewOptions:y,initialMinZoom:b,initialMaxZoom:k,nodeOrigin:x,nodeExtent:S,zIndexMode:C,children:t})}const wS={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function bS({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,className:l,nodeTypes:c,edgeTypes:d,onNodeClick:h,onEdgeClick:y,onInit:b,onMove:k,onMoveStart:x,onMoveEnd:S,onConnect:C,onConnectStart:j,onConnectEnd:$,onClickConnectStart:T,onClickConnectEnd:I,onNodeMouseEnter:U,onNodeMouseMove:P,onNodeMouseLeave:R,onNodeContextMenu:B,onNodeDoubleClick:H,onNodeDragStart:Q,onNodeDrag:ce,onNodeDragStop:de,onNodesDelete:we,onEdgesDelete:q,onDelete:fe,onSelectionChange:xe,onSelectionDragStart:L,onSelectionDrag:le,onSelectionDragStop:G,onSelectionContextMenu:ie,onSelectionStart:z,onSelectionEnd:W,onBeforeDelete:F,connectionMode:A,connectionLineType:K=fi.Bezier,connectionLineStyle:be,connectionLineComponent:Se,connectionLineContainerStyle:Me,deleteKeyCode:Ie="Backspace",selectionKeyCode:Ae="Shift",selectionOnDrag:_e=!1,selectionMode:ze=Pa.Full,panActivationKeyCode:ke="Space",multiSelectionKeyCode:He=$a()?"Meta":"Control",zoomActivationKeyCode:Oe=$a()?"Meta":"Control",snapToGrid:Ke,snapGrid:lt,onlyRenderVisibleElements:ut=!1,selectNodesOnDrag:at,nodesDraggable:Nt,autoPanOnNodeFocus:Xt,nodesConnectable:Zt,nodesFocusable:Vt,nodeOrigin:Et=I0,edgesFocusable:Bt,edgesReconnectable:fn,elementsSelectable:It=!0,defaultViewport:bn=Qb,minZoom:St=.5,maxZoom:Lt=2,translateExtent:_n=ja,preventScrolling:Kn=!0,nodeExtent:Sn,defaultMarkerColor:$n="#b1b1b7",zoomOnScroll:qn=!0,zoomOnPinch:yr=!0,panOnScroll:vr=!1,panOnScrollSpeed:kn=.5,panOnScrollMode:Ye=Li.Free,zoomOnDoubleClick:Wn=!0,panOnDrag:Nn=!0,onPaneClick:ir,onPaneMouseEnter:Be,onPaneMouseMove:dn,onPaneMouseLeave:Yn,onPaneScroll:Fr,onPaneContextMenu:ro,paneClickDistance:Br=1,nodeClickDistance:Ao=0,children:Oo,onReconnect:Tn,onReconnectStart:Xn,onReconnectEnd:In,onEdgeContextMenu:sr,onEdgeDoubleClick:mt,onEdgeMouseEnter:jt,onEdgeMouseMove:xr,onEdgeMouseLeave:Qn,reconnectRadius:An=10,onNodesChange:On,onEdgesChange:Ro,noDragClassName:V="nodrag",noWheelClassName:Le="nowheel",noPanClassName:Ve="nopan",fitView:dt,fitViewOptions:En,connectOnClick:Kt,attributionPosition:pn,proOptions:Qt,defaultEdgeOptions:wr,elevateNodesOnSelect:Gn=!0,elevateEdgesOnSelect:kt=!1,disableKeyboardA11y:Cn=!1,autoPanOnConnect:ht,autoPanOnNodeDrag:br,autoPanSpeed:ar,connectionRadius:Lo,isValidConnection:Hr,onError:_r,style:di,id:lr,nodeDragThreshold:jn,connectionDragThreshold:ct,viewport:hn,onViewportChange:Hi,width:Do,height:oo,colorMode:io="light",debug:so,onScroll:Jn,ariaLabelConfig:vt,zIndexMode:Vr="basic",...ao},ur){const Ur=lr||"1",lo=e_(io),cr=Y.useCallback(pi=>{pi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Jn==null||Jn(pi)},[Jn]);return w.jsx("div",{"data-testid":"rf__wrapper",...ao,onScroll:cr,style:{...di,...wS},ref:ur,className:Yt(["react-flow",l,lo]),id:lr,role:"application",children:w.jsxs(xS,{nodes:t,edges:r,width:Do,height:oo,fitView:dt,fitViewOptions:En,minZoom:St,maxZoom:Lt,nodeOrigin:Et,nodeExtent:Sn,zIndexMode:Vr,children:[w.jsx(Zb,{nodes:t,edges:r,defaultNodes:i,defaultEdges:s,onConnect:C,onConnectStart:j,onConnectEnd:$,onClickConnectStart:T,onClickConnectEnd:I,nodesDraggable:Nt,autoPanOnNodeFocus:Xt,nodesConnectable:Zt,nodesFocusable:Vt,edgesFocusable:Bt,edgesReconnectable:fn,elementsSelectable:It,elevateNodesOnSelect:Gn,elevateEdgesOnSelect:kt,minZoom:St,maxZoom:Lt,nodeExtent:Sn,onNodesChange:On,onEdgesChange:Ro,snapToGrid:Ke,snapGrid:lt,connectionMode:A,translateExtent:_n,connectOnClick:Kt,defaultEdgeOptions:wr,fitView:dt,fitViewOptions:En,onNodesDelete:we,onEdgesDelete:q,onDelete:fe,onNodeDragStart:Q,onNodeDrag:ce,onNodeDragStop:de,onSelectionDrag:le,onSelectionDragStart:L,onSelectionDragStop:G,onMove:k,onMoveStart:x,onMoveEnd:S,noPanClassName:Ve,nodeOrigin:Et,rfId:Ur,autoPanOnConnect:ht,autoPanOnNodeDrag:br,autoPanSpeed:ar,onError:_r,connectionRadius:Lo,isValidConnection:Hr,selectNodesOnDrag:at,nodeDragThreshold:jn,connectionDragThreshold:ct,onBeforeDelete:F,debug:so,ariaLabelConfig:vt,zIndexMode:Vr}),w.jsx(gS,{onInit:b,onNodeClick:h,onEdgeClick:y,onNodeMouseEnter:U,onNodeMouseMove:P,onNodeMouseLeave:R,onNodeContextMenu:B,onNodeDoubleClick:H,nodeTypes:c,edgeTypes:d,connectionLineType:K,connectionLineStyle:be,connectionLineComponent:Se,connectionLineContainerStyle:Me,selectionKeyCode:Ae,selectionOnDrag:_e,selectionMode:ze,deleteKeyCode:Ie,multiSelectionKeyCode:He,panActivationKeyCode:ke,zoomActivationKeyCode:Oe,onlyRenderVisibleElements:ut,defaultViewport:bn,translateExtent:_n,minZoom:St,maxZoom:Lt,preventScrolling:Kn,zoomOnScroll:qn,zoomOnPinch:yr,zoomOnDoubleClick:Wn,panOnScroll:vr,panOnScrollSpeed:kn,panOnScrollMode:Ye,panOnDrag:Nn,onPaneClick:ir,onPaneMouseEnter:Be,onPaneMouseMove:dn,onPaneMouseLeave:Yn,onPaneScroll:Fr,onPaneContextMenu:ro,paneClickDistance:Br,nodeClickDistance:Ao,onSelectionContextMenu:ie,onSelectionStart:z,onSelectionEnd:W,onReconnect:Tn,onReconnectStart:Xn,onReconnectEnd:In,onEdgeContextMenu:sr,onEdgeDoubleClick:mt,onEdgeMouseEnter:jt,onEdgeMouseMove:xr,onEdgeMouseLeave:Qn,reconnectRadius:An,defaultMarkerColor:$n,noDragClassName:V,noWheelClassName:Le,noPanClassName:Ve,rfId:Ur,disableKeyboardA11y:Cn,nodeExtent:Sn,viewport:hn,onViewportChange:Hi}),w.jsx(Xb,{onSelectionChange:xe}),Oo,w.jsx(Ub,{proOptions:Qt,position:pn}),w.jsx(Vb,{rfId:Ur,disableKeyboardA11y:Cn})]})})}var _S=L0(bS);function SS(){const t=Tt();return Y.useCallback(r=>{const{domNode:i,updateNodeInternals:s}=t.getState(),l=Array.isArray(r)?r:[r],c=new Map;l.forEach(d=>{const h=i==null?void 0:i.querySelector(`.react-flow__node[data-id="${d}"]`);h&&c.set(d,{id:d,nodeElement:h,force:!0})}),requestAnimationFrame(()=>s(c,{triggerFitView:!1}))},[])}function kS(t){const[r,i]=Y.useState(t),s=Y.useCallback(l=>i(c=>O0(l,c)),[]);return[r,i,s]}function NS(t){const[r,i]=Y.useState(t),s=Y.useCallback(l=>i(c=>R0(l,c)),[]);return[r,i,s]}function ES({dimensions:t,lineWidth:r,variant:i,className:s}){return w.jsx("path",{strokeWidth:r,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:Yt(["react-flow__background-pattern",i,s])})}function CS({radius:t,className:r}){return w.jsx("circle",{cx:t,cy:t,r:t,className:Yt(["react-flow__background-pattern","dots",r])})}var $o;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})($o||($o={}));const jS={[$o.Dots]:1,[$o.Lines]:1,[$o.Cross]:6},PS=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function ag({id:t,variant:r=$o.Dots,gap:i=20,size:s,lineWidth:l=1,offset:c=0,color:d,bgColor:h,style:y,className:b,patternClassName:k}){const x=Y.useRef(null),{transform:S,patternId:C}=yt(PS,Rt),j=s||jS[r],$=r===$o.Dots,T=r===$o.Cross,I=Array.isArray(i)?i:[i,i],U=[I[0]*S[2]||1,I[1]*S[2]||1],P=j*S[2],R=Array.isArray(c)?c:[c,c],B=T?[P,P]:U,H=[R[0]*S[2]||1+B[0]/2,R[1]*S[2]||1+B[1]/2],Q=`${C}${t||""}`;return w.jsxs("svg",{className:Yt(["react-flow__background",b]),style:{...y,...Iu,"--xy-background-color-props":h,"--xy-background-pattern-color-props":d},ref:x,"data-testid":"rf__background",children:[w.jsx("pattern",{id:Q,x:S[0]%U[0],y:S[1]%U[1],width:U[0],height:U[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${H[0]},-${H[1]})`,children:$?w.jsx(CS,{radius:P/2,className:k}):w.jsx(ES,{dimensions:B,lineWidth:l,variant:r,className:k})}),w.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${Q})`})]})}ag.displayName="Background";const MS=Y.memo(ag);function $S(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:w.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function TS(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:w.jsx("path",{d:"M0 0h32v4.2H0z"})})}function IS(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:w.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 AS(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:w.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 OS(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:w.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 Jl({children:t,className:r,...i}){return w.jsx("button",{type:"button",className:Yt(["react-flow__controls-button",r]),...i,children:t})}const RS=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function lg({style:t,showZoom:r=!0,showFitView:i=!0,showInteractive:s=!0,fitViewOptions:l,onZoomIn:c,onZoomOut:d,onFitView:h,onInteractiveChange:y,className:b,children:k,position:x="bottom-left",orientation:S="vertical","aria-label":C}){const j=Tt(),{isInteractive:$,minZoomReached:T,maxZoomReached:I,ariaLabelConfig:U}=yt(RS,Rt),{zoomIn:P,zoomOut:R,fitView:B}=Zf(),H=()=>{P(),c==null||c()},Q=()=>{R(),d==null||d()},ce=()=>{B(l),h==null||h()},de=()=>{j.setState({nodesDraggable:!$,nodesConnectable:!$,elementsSelectable:!$}),y==null||y(!$)},we=S==="horizontal"?"horizontal":"vertical";return w.jsxs(Fa,{className:Yt(["react-flow__controls",we,b]),position:x,style:t,"data-testid":"rf__controls","aria-label":C??U["controls.ariaLabel"],children:[r&&w.jsxs(w.Fragment,{children:[w.jsx(Jl,{onClick:H,className:"react-flow__controls-zoomin",title:U["controls.zoomIn.ariaLabel"],"aria-label":U["controls.zoomIn.ariaLabel"],disabled:I,children:w.jsx($S,{})}),w.jsx(Jl,{onClick:Q,className:"react-flow__controls-zoomout",title:U["controls.zoomOut.ariaLabel"],"aria-label":U["controls.zoomOut.ariaLabel"],disabled:T,children:w.jsx(TS,{})})]}),i&&w.jsx(Jl,{className:"react-flow__controls-fitview",onClick:ce,title:U["controls.fitView.ariaLabel"],"aria-label":U["controls.fitView.ariaLabel"],children:w.jsx(IS,{})}),s&&w.jsx(Jl,{className:"react-flow__controls-interactive",onClick:de,title:U["controls.interactive.ariaLabel"],"aria-label":U["controls.interactive.ariaLabel"],children:$?w.jsx(OS,{}):w.jsx(AS,{})}),k]})}lg.displayName="Controls";const LS=Y.memo(lg);function DS({id:t,x:r,y:i,width:s,height:l,style:c,color:d,strokeColor:h,strokeWidth:y,className:b,borderRadius:k,shapeRendering:x,selected:S,onClick:C}){const{background:j,backgroundColor:$}=c||{},T=d||j||$;return w.jsx("rect",{className:Yt(["react-flow__minimap-node",{selected:S},b]),x:r,y:i,rx:k,ry:k,width:s,height:l,style:{fill:T,stroke:h,strokeWidth:y},shapeRendering:x,onClick:C?I=>C(I,t):void 0})}const zS=Y.memo(DS),FS=t=>t.nodes.map(r=>r.id),mf=t=>t instanceof Function?t:()=>t;function BS({nodeStrokeColor:t,nodeColor:r,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:l,nodeComponent:c=zS,onClick:d}){const h=yt(FS,Rt),y=mf(r),b=mf(t),k=mf(i),x=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return w.jsx(w.Fragment,{children:h.map(S=>w.jsx(VS,{id:S,nodeColorFunc:y,nodeStrokeColorFunc:b,nodeClassNameFunc:k,nodeBorderRadius:s,nodeStrokeWidth:l,NodeComponent:c,onClick:d,shapeRendering:x},S))})}function HS({id:t,nodeColorFunc:r,nodeStrokeColorFunc:i,nodeClassNameFunc:s,nodeBorderRadius:l,nodeStrokeWidth:c,shapeRendering:d,NodeComponent:h,onClick:y}){const{node:b,x:k,y:x,width:S,height:C}=yt(j=>{const $=j.nodeLookup.get(t);if(!$)return{node:void 0,x:0,y:0,width:0,height:0};const T=$.internals.userNode,{x:I,y:U}=$.internals.positionAbsolute,{width:P,height:R}=Io(T);return{node:T,x:I,y:U,width:P,height:R}},Rt);return!b||b.hidden||!l0(b)?null:w.jsx(h,{x:k,y:x,width:S,height:C,style:b.style,selected:!!b.selected,className:s(b),color:r(b),borderRadius:l,strokeColor:i(b),strokeWidth:c,shapeRendering:d,onClick:y,id:b.id})}const VS=Y.memo(HS);var US=Y.memo(BS);const KS=200,qS=150,WS=t=>!t.hidden,YS=t=>{const r={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:r,boundingRect:t.nodeLookup.size>0?a0(La(t.nodeLookup,{filter:WS}),r):r,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},XS="react-flow__minimap-desc";function ug({style:t,className:r,nodeStrokeColor:i,nodeColor:s,nodeClassName:l="",nodeBorderRadius:c=5,nodeStrokeWidth:d,nodeComponent:h,bgColor:y,maskColor:b,maskStrokeColor:k,maskStrokeWidth:x,position:S="bottom-right",onClick:C,onNodeClick:j,pannable:$=!1,zoomable:T=!1,ariaLabel:I,inversePan:U,zoomStep:P=1,offsetScale:R=5}){const B=Tt(),H=Y.useRef(null),{boundingRect:Q,viewBB:ce,rfId:de,panZoom:we,translateExtent:q,flowWidth:fe,flowHeight:xe,ariaLabelConfig:L}=yt(YS,Rt),le=(t==null?void 0:t.width)??KS,G=(t==null?void 0:t.height)??qS,ie=Q.width/le,z=Q.height/G,W=Math.max(ie,z),F=W*le,A=W*G,K=R*W,be=Q.x-(F-Q.width)/2-K,Se=Q.y-(A-Q.height)/2-K,Me=F+K*2,Ie=A+K*2,Ae=`${XS}-${de}`,_e=Y.useRef(0),ze=Y.useRef();_e.current=W,Y.useEffect(()=>{if(H.current&&we)return ze.current=cb({domNode:H.current,panZoom:we,getTransform:()=>B.getState().transform,getViewScale:()=>_e.current}),()=>{var Ke;(Ke=ze.current)==null||Ke.destroy()}},[we]),Y.useEffect(()=>{var Ke;(Ke=ze.current)==null||Ke.update({translateExtent:q,width:fe,height:xe,inversePan:U,pannable:$,zoomStep:P,zoomable:T})},[$,T,U,P,q,fe,xe]);const ke=C?Ke=>{var at;const[lt,ut]=((at=ze.current)==null?void 0:at.pointer(Ke))||[0,0];C(Ke,{x:lt,y:ut})}:void 0,He=j?Y.useCallback((Ke,lt)=>{const ut=B.getState().nodeLookup.get(lt).internals.userNode;j(Ke,ut)},[]):void 0,Oe=I??L["minimap.ariaLabel"];return w.jsx(Fa,{position:S,style:{...t,"--xy-minimap-background-color-props":typeof y=="string"?y:void 0,"--xy-minimap-mask-background-color-props":typeof b=="string"?b:void 0,"--xy-minimap-mask-stroke-color-props":typeof k=="string"?k:void 0,"--xy-minimap-mask-stroke-width-props":typeof x=="number"?x*W:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-width-props":typeof d=="number"?d:void 0},className:Yt(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:w.jsxs("svg",{width:le,height:G,viewBox:`${be} ${Se} ${Me} ${Ie}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Ae,ref:H,onClick:ke,children:[Oe&&w.jsx("title",{id:Ae,children:Oe}),w.jsx(US,{onClick:He,nodeColor:s,nodeStrokeColor:i,nodeBorderRadius:c,nodeClassName:l,nodeStrokeWidth:d,nodeComponent:h}),w.jsx("path",{className:"react-flow__minimap-mask",d:`M${be-K},${Se-K}h${Me+K*2}v${Ie+K*2}h${-Me-K*2}z
202
+ M${ce.x},${ce.y}h${ce.width}v${ce.height}h${-ce.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}ug.displayName="MiniMap";const QS=Y.memo(ug),GS=t=>r=>t?`${Math.max(1/r.transform[2],1)}`:void 0,JS={[Os.Line]:"right",[Os.Handle]:"bottom-right"};function ZS({nodeId:t,position:r,variant:i=Os.Handle,className:s,style:l=void 0,children:c,color:d,minWidth:h=10,minHeight:y=10,maxWidth:b=Number.MAX_VALUE,maxHeight:k=Number.MAX_VALUE,keepAspectRatio:x=!1,resizeDirection:S,autoScale:C=!0,shouldResize:j,onResizeStart:$,onResize:T,onResizeEnd:I}){const U=B0(),P=typeof t=="string"?t:U,R=Tt(),B=Y.useRef(null),H=i===Os.Handle,Q=yt(Y.useCallback(GS(H&&C),[H,C]),Rt),ce=Y.useRef(null),de=r??JS[i];Y.useEffect(()=>{if(!(!B.current||!P))return ce.current||(ce.current=kb({domNode:B.current,nodeId:P,getStoreItems:()=>{const{nodeLookup:q,transform:fe,snapGrid:xe,snapToGrid:L,nodeOrigin:le,domNode:G}=R.getState();return{nodeLookup:q,transform:fe,snapGrid:xe,snapToGrid:L,nodeOrigin:le,paneDomNode:G}},onChange:(q,fe)=>{const{triggerNodeChanges:xe,nodeLookup:L,parentLookup:le,nodeOrigin:G}=R.getState(),ie=[],z={x:q.x,y:q.y},W=L.get(P);if(W&&W.expandParent&&W.parentId){const F=W.origin??G,A=q.width??W.measured.width??0,K=q.height??W.measured.height??0,be={id:W.id,parentId:W.parentId,rect:{width:A,height:K,...u0({x:q.x??W.position.x,y:q.y??W.position.y},{width:A,height:K},W.parentId,L,F)}},Se=Jf([be],L,le,G);ie.push(...Se),z.x=q.x?Math.max(F[0]*A,q.x):void 0,z.y=q.y?Math.max(F[1]*K,q.y):void 0}if(z.x!==void 0&&z.y!==void 0){const F={id:P,type:"position",position:{...z}};ie.push(F)}if(q.width!==void 0&&q.height!==void 0){const A={id:P,type:"dimensions",resizing:!0,setAttributes:S?S==="horizontal"?"width":"height":!0,dimensions:{width:q.width,height:q.height}};ie.push(A)}for(const F of fe){const A={...F,type:"position"};ie.push(A)}xe(ie)},onEnd:({width:q,height:fe})=>{const xe={id:P,type:"dimensions",resizing:!1,dimensions:{width:q,height:fe}};R.getState().triggerNodeChanges([xe])}})),ce.current.update({controlPosition:de,boundaries:{minWidth:h,minHeight:y,maxWidth:b,maxHeight:k},keepAspectRatio:x,resizeDirection:S,onResizeStart:$,onResize:T,onResizeEnd:I,shouldResize:j}),()=>{var q;(q=ce.current)==null||q.destroy()}},[de,h,y,b,k,x,$,T,I,j]);const we=de.split("-");return w.jsx("div",{className:Yt(["react-flow__resize-control","nodrag",...we,i,s]),ref:B,style:{...l,scale:Q,...d&&{[H?"backgroundColor":"borderColor"]:d}},children:c})}Y.memo(ZS);const ek={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 su({method:t,className:r="",size:i="sm"}){const s=t.toLowerCase().trim(),l=ek[s]??"bg-accent/15 text-accent border-accent/40",c=i==="md"?"text-xs px-2.5 py-1 min-w-[3.25rem] justify-center":"text-[10px] px-1.5 py-0.5 min-w-[2.75rem] justify-center";return w.jsx("span",{className:`inline-flex items-center rounded-md font-semibold uppercase tracking-wide border shrink-0 transition-colors duration-200 ${l} ${c} ${r}`,children:t.toUpperCase()})}function td(t,r,i){var c,d;const s=r.toLowerCase(),l=(d=(c=t.paths)==null?void 0:c[i])==null?void 0:d[s];return(l==null?void 0:l.summary)??(l==null?void 0:l.operationId)??`${r.toUpperCase()} ${i}`}function nd(t,r,i){var h,y,b,k;const s=r.toLowerCase(),l=(y=(h=t.paths)==null?void 0:h[i])==null?void 0:y[s];if(!(l!=null&&l.requestBody))return"— sin body";const d=(k=(b=l.requestBody.content)==null?void 0:b["application/json"])==null?void 0:k.schema;return d&&"$ref"in d?`body: ${d.$ref}`:"body: JSON"}function rd(t,r,i){var h,y,b,k,x,S;const s=r.toLowerCase(),l=(y=(h=t.paths)==null?void 0:h[i])==null?void 0:y[s],c=((b=l==null?void 0:l.responses)==null?void 0:b["200"])??((k=l==null?void 0:l.responses)==null?void 0:k["201"]);if(!c)return"—";const d=typeof c=="object"&&c&&"content"in c?(S=(x=c.content)==null?void 0:x["application/json"])==null?void 0:S.schema:void 0;return d&&"$ref"in d?String(d.$ref):"JSON"}const au=()=>({sourceJsonPath:"$",variableName:"v",useInTarget:"vars_only",targetKey:""});function gf(t,r){return`${t.toLowerCase()} ${r}`}function tk(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}const cg=Y.createContext(null);function nk(t){const{id:r,selected:i}=t,s=t.data,l=Y.useContext(cg),c=SS();return Y.useEffect(()=>{c(r)},[s.path,s.method,r,c]),w.jsxs("div",{className:`rounded-xl border bg-surface-950/90 px-3 py-2 min-w-[200px] max-w-[280px] shadow-lg ${i?"border-accent ring-2 ring-accent/40":"border-surface-600"}`,children:[w.jsx(Rs,{type:"target",position:Ze.Left,id:"in",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-teal-500"}),w.jsxs("div",{className:"flex items-center gap-2 mb-1 min-w-0",children:[w.jsx(su,{method:s.method}),w.jsx("span",{className:"text-[10px] text-slate-500 truncate",title:s.summary,children:s.summary})]}),l?w.jsxs("label",{className:"block text-[10px] text-slate-500 mb-1",children:["Endpoint",w.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:gf(s.method,s.path),onChange:d=>{const{method:h,path:y}=tk(d.target.value);l.updateNodeData(r,{method:h,path:y,summary:td(l.doc,h,y),reqHint:nd(l.doc,h,y),resHint:rd(l.doc,h,y)})},children:l.ops.map(d=>w.jsxs("option",{value:gf(d.method,d.path),children:[d.method.toUpperCase()," ",d.path]},gf(d.method,d.path)))})]}):w.jsx("p",{className:"font-mono text-[11px] text-slate-300 truncate",children:s.path}),w.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-1 text-[9px] text-slate-500 leading-tight",children:[w.jsxs("div",{children:[w.jsx("span",{className:"text-slate-600",children:"req"})," ",s.reqHint]}),w.jsxs("div",{children:[w.jsx("span",{className:"text-slate-600",children:"res"})," ",s.resHint]})]}),w.jsx(Rs,{type:"source",position:Ze.Right,id:"out",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-amber-500"})]})}const rk={apiOp:nk};function ok(t,r){const i=r.nodes.map(l=>({id:l.id,type:"apiOp",position:{x:l.x,y:l.y},data:{method:l.method.toLowerCase(),path:l.path,summary:td(t,l.method,l.path),reqHint:nd(t,l.method,l.path),resHint:rd(t,l.method,l.path)}})),s=r.edges.map(l=>({id:l.id,source:l.source,target:l.target,sourceHandle:"out",targetHandle:"in",data:{mapping:{...l.mapping}},label:l.mapping.variableName,style:{stroke:"rgb(148 163 184 / 0.9)",strokeWidth:2}}));return{nodes:i,edges:s}}function ik(t,r){return{nodes:t.map(i=>({id:i.id,method:i.data.method,path:i.data.path,x:i.position.x,y:i.position.y})),edges:r.map(i=>{var s;return{id:i.id,source:i.source,target:i.target,mapping:((s=i.data)==null?void 0:s.mapping)??au()}})}}const sk=[{value:"vars_only",label:"Solo variable ({nombre} en la ruta)"},{value:"path_param",label:"Path param {clave}"},{value:"header",label:"Header"},{value:"query",label:"Query string"}];function ak({doc:t,ops:r,graph:i,onGraphChange:s}){var P,R,B,H,Q,ce,de,we;const l=Y.useMemo(()=>ok(t,i),[t,i]),[c,d,h]=kS(l.nodes),[y,b,k]=NS(l.edges),[x,S]=Y.useState(null);Y.useEffect(()=>{s(ik(c,y))},[c,y,s]);const C=Y.useCallback((q,fe)=>{d(xe=>xe.map(L=>L.id===q?{...L,data:{...L.data,...fe}}:L))},[d]),j=Y.useMemo(()=>({doc:t,ops:r,updateNodeData:C}),[t,r,C]),$=Y.useCallback(q=>{q.sourceHandle!=="out"||q.targetHandle!=="in"||b(fe=>g0({...q,id:`e-${q.source}-${q.target}-${crypto.randomUUID().slice(0,8)}`,sourceHandle:"out",targetHandle:"in",data:{mapping:au()},label:au().variableName,style:{stroke:"rgb(148 163 184 / 0.9)",strokeWidth:2}},fe))},[b]),T=y.find(q=>q.id===x),I=q=>{x&&b(fe=>fe.map(xe=>{var le;if(xe.id!==x)return xe;const L={...((le=xe.data)==null?void 0:le.mapping)??au(),...q};return{...xe,data:{mapping:L},label:L.variableName}}))},U=()=>{const q=c.reduce((ie,z)=>z.position.x>ie?z.position.x:ie,0),fe=r[0];if(!fe)return;const xe=crypto.randomUUID(),L=q>0?q+40:80,G={id:xe,type:"apiOp",position:{x:L,y:120},data:{method:fe.method.toLowerCase(),path:fe.path,summary:td(t,fe.method,fe.path),reqHint:nd(t,fe.method,fe.path),resHint:rd(t,fe.method,fe.path)}};d(ie=>[...ie,G])};return w.jsx(cg.Provider,{value:j,children:w.jsxs("div",{className:"space-y-3",children:[w.jsx("div",{className:"h-[min(520px,70vh)] w-full rounded-xl border border-surface-700 bg-surface-950",children:w.jsxs(_S,{nodes:c,edges:y,onNodesChange:h,onEdgesChange:k,onConnect:$,nodeTypes:rk,onEdgeClick:(q,fe)=>S(fe.id),onPaneClick:()=>S(null),fitView:!0,minZoom:.4,maxZoom:1.5,proOptions:{hideAttribution:!0},isValidConnection:q=>q.sourceHandle==="out"&&q.targetHandle==="in",children:[w.jsx(MS,{variant:$o.Dots,gap:16,size:1,color:"rgb(51 65 85 / 0.5)"}),w.jsx(LS,{className:"!bg-surface-900 !border-surface-600 !shadow-lg"}),w.jsx(QS,{className:"!bg-surface-900/95 !border-surface-600",nodeColor:()=>"rgb(45 212 191 / 0.5)"}),w.jsx(Fa,{position:"top-left",children:w.jsx("button",{type:"button",onClick:U,className:"text-xs px-3 py-2 rounded-lg bg-accent/90 text-surface-950 font-medium shadow",children:"+ Nodo (endpoint)"})})]})}),w.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[w.jsx("h4",{className:"text-xs font-semibold text-slate-300",children:"Cable seleccionado (respuesta → request)"}),T?w.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs",children:[w.jsxs("label",{className:"text-slate-500",children:["JSON path en la respuesta",w.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:((P=T.data)==null?void 0:P.mapping.sourceJsonPath)??"$",onChange:q=>I({sourceJsonPath:q.target.value}),placeholder:"$.access_token"})]}),w.jsxs("label",{className:"text-slate-500",children:["Nombre de variable",w.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5",value:((R=T.data)==null?void 0:R.mapping.variableName)??"",onChange:q=>I({variableName:q.target.value}),placeholder:"token"})]}),w.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Cómo se usa en el request del nodo destino",w.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5",value:((B=T.data)==null?void 0:B.mapping.useInTarget)??"vars_only",onChange:q=>I({useInTarget:q.target.value}),children:sk.map(q=>w.jsx("option",{value:q.value,children:q.label},q.value))})]}),(((H=T.data)==null?void 0:H.mapping.useInTarget)==="path_param"||((Q=T.data)==null?void 0:Q.mapping.useInTarget)==="header"||((ce=T.data)==null?void 0:ce.mapping.useInTarget)==="query")&&w.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Clave (nombre del param / header / query)",w.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:((de=T.data)==null?void 0:de.mapping.targetKey)??"",onChange:q=>I({targetKey:q.target.value}),placeholder:"id / Authorization / q"})]}),w.jsxs("p",{className:"sm:col-span-2 text-[11px] text-slate-500 leading-relaxed",children:["El valor extraído se guarda en la variable y, según la opción, se inyecta en la ruta"," ",w.jsx("code",{className:"text-accent",children:"{clave}"}),", en un header, o en query. Con «solo variable», usa"," ",w.jsx("code",{className:"text-accent",children:"{"+(((we=T.data)==null?void 0:we.mapping.variableName)||"var")+"}"})," ","en la ruta del endpoint destino."]})]}):w.jsx("p",{className:"text-xs text-slate-500",children:"Conecta la salida derecha (res) de un nodo con la entrada izquierda (req) de otro. Haz clic en un cable para definir el mapeo."})]})]})})}function fg(t,r){const i=new Map(t.map(y=>[y.id,y])),s=new Set(t.map(y=>y.id)),l=new Map,c=new Map;for(const y of s)l.set(y,0),c.set(y,[]);for(const y of r)!s.has(y.source)||!s.has(y.target)||(l.set(y.target,(l.get(y.target)??0)+1),c.get(y.source).push(y.target));const d=[];for(const[y,b]of l)b===0&&d.push(y);d.sort((y,b)=>i.get(y).x-i.get(b).x||i.get(y).y-i.get(b).y);const h=[];for(;d.length;){const y=d.shift();h.push(y);for(const b of c.get(y)??[]){const k=(l.get(b)??0)-1;l.set(b,k),k===0&&(d.push(b),d.sort((x,S)=>i.get(x).x-i.get(S).x||i.get(x).y-i.get(S).y))}}if(h.length<t.length){const y=t.filter(b=>!h.includes(b.id)).sort((b,k)=>b.x-k.x||b.y-k.y);return[...h.map(b=>i.get(b)),...y]}return h.map(y=>i.get(y))}async function um(t,r,i){var y;const{nodes:s,edges:l}=t;if(s.length===0)return"Sin nodos en el flujo.";const c=fg(s,l),d={};let h="";for(let b=0;b<c.length;b++){const k=c[b];let x=k.path;const S={...i()},C=l.filter(B=>B.target===k.id);for(const B of C){const{mapping:H}=B,Q=d[H.variableName];if(Q!==void 0)switch(H.useInTarget){case"path_param":H.targetKey&&(x=x.split(`{${H.targetKey}}`).join(Q));break;case"header":if(H.targetKey){const ce=H.targetKey;S[ce]=ce.toLowerCase()==="authorization"&&!Q.startsWith("Bearer ")?`Bearer ${Q}`:Q}break;case"query":{const ce=x.includes("?")?"&":"?";x=`${x}${ce}${encodeURIComponent(H.targetKey)}=${encodeURIComponent(Q)}`;break}case"vars_only":default:x=x.split(`{${H.variableName}}`).join(Q);break}}for(const[B,H]of Object.entries(d))x=x.split(`{${B}}`).join(H);const j=`${r.replace(/\/$/,"")}${x}`,$={method:k.method.toUpperCase(),headers:S},T=k.method.toLowerCase();T!=="get"&&T!=="head"&&($.body="{}");const I=await fetch(j,{...$,credentials:"include"});let U={};const P=await I.text();try{U=P?JSON.parse(P):{}}catch{U={_raw:P}}h+=`▸ ${k.method.toUpperCase()} ${k.path} → ${I.status}
203
+ ${JSON.stringify(U,null,2)}
204
+
205
+ `;const R=l.filter(B=>B.source===k.id);for(const B of R){const H=((y=B.mapping.sourceJsonPath)==null?void 0:y.trim())||"$",Q=Rf(U,H);Q!=null&&(d[B.mapping.variableName]=typeof Q=="object"?JSON.stringify(Q):String(Q))}}return h+=`
206
+ Variables finales: ${JSON.stringify(d,null,2)}`,h}function lk(t){const r=fg(t.nodes,t.edges);return r.map((i,s)=>{const l=r[s+1];if(!l)return{method:i.method,path:i.path};const c=t.edges.find(d=>d.source===i.id&&d.target===l.id);return c?{method:i.method,path:i.path,extract:{varName:c.mapping.variableName,jsonPath:c.mapping.sourceJsonPath||"$"}}:{method:i.method,path:i.path}})}function uk(t){var s;const r=t.map((l,c)=>({id:`n-${c}`,method:l.method,path:l.path,x:40+c*300,y:120})),i=[];for(let l=0;l<t.length-1;l++){const c=(s=t[l])==null?void 0:s.extract;c!=null&&c.jsonPath&&i.push({id:`e-${l}`,source:`n-${l}`,target:`n-${l+1}`,mapping:{sourceJsonPath:c.jsonPath,variableName:c.varName,useInTarget:"vars_only",targetKey:""}})}return{nodes:r,edges:i}}const dg=Y.createContext({productName:null,logoDataUrl:null});function ck({value:t,children:r}){return w.jsx(dg.Provider,{value:t,children:r})}function fk(){return Y.useContext(dg)}function dk({data:t,defaultOpenDepth:r=3}){return w.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:w.jsx(od,{value:t,depth:0,defaultOpenDepth:r})})}function od({value:t,depth:r,defaultOpenDepth:i,name:s}){return t===null||typeof t!="object"?w.jsx(pk,{name:s,value:t}):Array.isArray(t)?w.jsx(hk,{name:s,value:t,depth:r,defaultOpenDepth:i}):w.jsx(mk,{name:s,value:t,depth:r,defaultOpenDepth:i})}function pk({name:t,value:r}){return w.jsxs("div",{className:"pl-1 break-all",children:[t!=null&&w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),w.jsx("span",{className:"text-slate-500",children:": "})]}),w.jsx("span",{className:"text-emerald-200/95",children:JSON.stringify(r)})]})}function hk({name:t,value:r,depth:i,defaultOpenDepth:s}){const l=i<s,[c,d]=Y.useState(l);return r.length===0?w.jsxs("div",{className:"pl-1",children:[t!=null&&w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),w.jsx("span",{className:"text-slate-500",children:": "})]}),w.jsx("span",{className:"text-slate-500",children:"[]"})]}):w.jsxs("div",{className:"pl-1",children:[t!=null&&w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),w.jsx("span",{className:"text-slate-500",children:": "})]}),w.jsx("button",{type:"button","aria-expanded":c,onClick:()=>d(!c),className:"inline align-middle text-slate-400 hover:text-slate-200 mr-1 select-none w-4",children:c?"▼":"▶"}),w.jsx("span",{className:"text-slate-500",children:"["}),w.jsx("span",{className:"text-slate-600 text-[10px] ml-1",children:r.length}),c&&w.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,y)=>w.jsxs("li",{children:[w.jsx("span",{className:"text-violet-400/90 mr-1",children:y}),w.jsx(od,{value:h,depth:i+1,defaultOpenDepth:s})]},y))}),!c&&w.jsx("span",{className:"text-slate-600",children:" … "}),w.jsx("span",{className:"text-slate-500",children:"]"})]})}function mk({name:t,value:r,depth:i,defaultOpenDepth:s}){const l=Object.keys(r),c=i<s,[d,h]=Y.useState(c);return l.length===0?w.jsxs("div",{className:"pl-1",children:[t!=null&&w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),w.jsx("span",{className:"text-slate-500",children:": "})]}),w.jsx("span",{className:"text-slate-500",children:"{}"})]}):w.jsxs("div",{className:"pl-1",children:[t!=null&&w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),w.jsx("span",{className:"text-slate-500",children:": "})]}),w.jsx("button",{type:"button","aria-expanded":d,onClick:()=>h(!d),className:"inline align-middle text-slate-400 hover:text-slate-200 mr-1 select-none w-4",children:d?"▼":"▶"}),w.jsx("span",{className:"text-slate-500",children:"{"}),w.jsx("span",{className:"text-slate-600 text-[10px] ml-1",children:l.length}),d&&w.jsx("ul",{className:"list-none my-0.5 ml-4 border-l border-surface-600 pl-2 space-y-0.5",children:l.map(y=>w.jsx("li",{children:w.jsx(od,{name:y,value:r[y],depth:i+1,defaultOpenDepth:s})},y))}),!d&&w.jsx("span",{className:"text-slate-600",children:" … "}),w.jsx("span",{className:"text-slate-500",children:"}"})]})}function id(t,r){if(!r.startsWith("#/"))return;const i=r.slice(2).split("/");let s=t;for(const l of i)if(s&&typeof s=="object"&&l in s)s=s[l];else return;return s}function gk(t,r){return"$ref"in r?id(t,r.$ref):r}function cm(t,r){return"$ref"in r?id(t,r.$ref):r}function yk(t,r,i){var b;const s=(b=t.paths)==null?void 0:b[i],l=s==null?void 0:s[r.toLowerCase()];if(!l)return[];const c=(s==null?void 0:s.parameters)??[],d=l.parameters??[],h=new Set,y=[];for(const k of[...c,...d]){const x=gk(t,k);if(!x||!["query","path","header","cookie"].includes(x.in))continue;const S=`${x.in}:${x.name}`;h.has(S)||(h.add(S),y.push({name:x.name,in:x.in,required:!!x.required,description:typeof x.description=="string"?x.description:void 0}))}return y}function fm(t,r,i){var y,b,k,x;const s=(b=(y=t.paths)==null?void 0:y[i])==null?void 0:b[r.toLowerCase()];if(!(s!=null&&s.requestBody))return null;const l=s.requestBody,c="$ref"in l?id(t,l.$ref):l;if(!((x=(k=c==null?void 0:c.content)==null?void 0:k["application/json"])!=null&&x.schema))return null;const d=c.content["application/json"].schema,h=cm(t,d);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(C=>{const j=h.properties[C],$=j&&"$ref"in j?cm(t,j):j;return{key:C,required:S.has(C),description:$==null?void 0:$.description,format:$==null?void 0:$.format,type:$==null?void 0:$.type}})}return null}function vk(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function xk(t,r){let i=t;for(const[s,l]of Object.entries(r))i=i.replace(new RegExp(`\\{${vk(s)}\\}`,"g"),encodeURIComponent(l));return i}function wk(t,r){const i=new URLSearchParams;for(const l of r){if(l.in!=="query")continue;const c=t[l.name];c!==void 0&&c!==""&&i.set(l.name,c)}const s=i.toString();return s?`?${s}`:""}function pg(t,r){var s;if(!(t!=null&&t.length))return{};const i={};for(const l of t){const c=((s=r[l.key])==null?void 0:s.trim())??"";if(c==="")continue;const d=l.type;if(d==="integer"||d==="number"){const h=Number(c);i[l.key]=Number.isFinite(h)?h:c}else if(d==="boolean")i[l.key]=c==="true"||c==="1";else try{i[l.key]=JSON.parse(c)}catch{i[l.key]=c}}return i}function dm(t,r){const i=pg(t,r);return JSON.stringify(i,null,2)}function bk(t,r){if(!(t!=null&&t.length))return{};try{const i=JSON.parse(r||"{}"),s={};for(const l of t)if(l.key in i&&i[l.key]!==void 0){const c=i[l.key];s[l.key]=typeof c=="string"?c:JSON.stringify(c)}else s[l.key]="";return s}catch{return Object.fromEntries(t.map(i=>[i.key,""]))}}function _k(t){return/\{[^/}]+\}/.test(t)}function Sk(t,r,i,s,l){var h,y;const c={...t};for(const b of r){const k=(h=i[b.name])==null?void 0:h.trim();k&&(c[b.name]=k)}const d=[];for(const b of s){const k=(y=l[b.name])==null?void 0:y.trim();k&&d.push(`${b.name}=${k}`)}return d.length&&(c.Cookie=c.Cookie?`${c.Cookie}; ${d.join("; ")}`:d.join("; ")),c}function kk({doc:t,selectedOp:r,baseUrl:i,buildHeaders:s}){const[l,c]=Y.useState({}),[d,h]=Y.useState({}),[y,b]=Y.useState({}),[k,x]=Y.useState({}),[S,C]=Y.useState({}),[j,$]=Y.useState("{}"),[T,I]=Y.useState("raw"),[U,P]=Y.useState(null),[R,B]=Y.useState(null),H=Y.useMemo(()=>yk(t,r.method,r.path),[t,r.method,r.path]),Q=Y.useMemo(()=>H.filter(F=>F.in==="path"),[H]),ce=Y.useMemo(()=>H.filter(F=>F.in==="query"),[H]),de=Y.useMemo(()=>H.filter(F=>F.in==="header"),[H]),we=Y.useMemo(()=>H.filter(F=>F.in==="cookie"),[H]),q=Y.useMemo(()=>fm(t,r.method,r.path),[t,r.method,r.path]),fe=r.method.toLowerCase(),xe=fe!=="get"&&fe!=="head";Y.useEffect(()=>{c({}),h({}),b({}),x({}),B(null),P(null);const F=fm(t,r.method,r.path);F!=null&&F.length?(C(Object.fromEntries(F.map(A=>[A.key,""]))),I("fields"),$(dm(F,{}))):(C({}),I("raw"),$("{}"))},[t,r.method,r.path]);const L=Y.useCallback((F,A)=>{C(K=>({...K,[F]:A}))},[]),le=Y.useCallback(()=>{q!=null&&q.length&&$(dm(q,S)),I("raw")},[q,S]),G=Y.useCallback(()=>{q!=null&&q.length&&C(bk(q,j)),I("fields")},[q,j]),ie=async()=>{var Ie,Ae,_e,ze,ke;B(null);const F=ks(t,i);for(const He of Q)if(He.required&&!((Ie=l[He.name])!=null&&Ie.trim())){B(`Parámetro de ruta obligatorio: ${He.name}`);return}for(const He of ce)if(He.required&&!((Ae=d[He.name])!=null&&Ae.trim())){B(`Query obligatorio: ${He.name}`);return}for(const He of de)if(He.required&&!((_e=y[He.name])!=null&&_e.trim())){B(`Header obligatorio: ${He.name}`);return}for(const He of we)if(He.required&&!((ze=k[He.name])!=null&&ze.trim())){B(`Cookie obligatorio: ${He.name}`);return}let A=xk(r.path,l);if(_k(A)){B("Quedan placeholders `{…}` en la ruta sin valor.");return}const K=wk(d,H),be=`${F}${A}${K}`,Se=Sk(s(),de,y,we,k),Me={method:r.method.toUpperCase(),headers:Se,credentials:"include"};if(xe)if(T==="fields"&&(q!=null&&q.length)){for(const Oe of q)if(Oe.required&&!((ke=S[Oe.key])!=null&&ke.trim())){B(`Campo de body obligatorio: ${Oe.key}`);return}const He=pg(q,S);Me.body=JSON.stringify(He)}else{const He=j.trim()||"{}";Me.body=He}try{const He=await fetch(be,Me),Oe=await He.text();let Ke=null;try{Ke=Oe?JSON.parse(Oe):null}catch{Ke=null}P({status:He.status,statusText:He.statusText,bodyText:Oe,json:Ke})}catch(He){P(null),B(He instanceof Error?He.message:String(He))}},z=(F,A,K)=>w.jsxs("label",{className:"block text-xs",children:[w.jsxs("span",{className:"text-slate-400",children:[F.name,F.required?w.jsx("span",{className:"text-rose-400/90",children:" *"}):null,F.in!=="path"?w.jsxs("span",{className:"text-slate-600 ml-1",children:["(",F.in,")"]}):null]}),w.jsx("input",{type:"text",className:"mt-0.5 w-full min-h-[44px] sm:min-h-0 bg-surface-900 border border-surface-600 rounded-lg px-3 py-2 font-mono text-[11px] text-slate-200 transition-colors duration-150 hover:border-surface-500",value:A[F.name]??"",onChange:be=>K(Se=>({...Se,[F.name]:be.target.value})),placeholder:F.description||(F.in==="path"?`{${F.name}}`:""),autoComplete:"off"})]},`${F.in}:${F.name}`),W=F=>w.jsxs("label",{className:"block text-xs",children:[w.jsxs("span",{className:"text-slate-400",children:[F.key,F.required?w.jsx("span",{className:"text-rose-400/90",children:" *"}):null,F.type?w.jsxs("span",{className:"text-slate-600 ml-1",children:["(",F.type,")"]}):null]}),w.jsx("input",{type:"text",className:"mt-0.5 w-full min-h-[44px] sm:min-h-0 bg-surface-900 border border-surface-600 rounded-lg px-3 py-2 font-mono text-[11px] text-slate-200 transition-colors duration-150 hover:border-surface-500",value:S[F.key]??"",onChange:A=>L(F.key,A.target.value),placeholder:F.description||"valor o JSON para objetos anidados",autoComplete:"off"})]},F.key);return w.jsxs("section",{className:"space-y-4 rounded-2xl border border-surface-700/80 bg-surface-900/30 p-4 shadow-lg shadow-black/10",children:[w.jsx("h3",{className:"text-sm font-semibold tracking-tight text-slate-200",children:"Probar"}),(Q.length>0||ce.length>0||de.length>0||we.length>0)&&w.jsxs("div",{className:"space-y-2 rounded-lg border border-surface-700 bg-surface-900/40 p-3",children:[w.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:"Parámetros"}),w.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[Q.map(F=>z(F,l,c)),ce.map(F=>z(F,d,h)),de.map(F=>z(F,y,b)),we.map(F=>z(F,k,x))]})]}),xe&&w.jsxs("div",{className:"space-y-2",children:[w.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[w.jsx("span",{className:"text-xs text-slate-400",children:"Body"}),q!=null&&q.length?w.jsxs("div",{className:"flex rounded-lg border border-surface-600 overflow-hidden text-xs shadow-inner shadow-black/20",role:"group","aria-label":"Modo de body",children:[w.jsx("button",{type:"button",className:`min-h-[40px] px-3 py-2 transition-colors duration-200 sm:min-h-0 sm:py-1.5 ${T==="fields"?"bg-accent/25 text-accent font-medium":"bg-surface-800 text-slate-400 hover:text-slate-200"}`,onClick:G,children:"Campos"}),w.jsx("button",{type:"button",className:`min-h-[40px] px-3 py-2 transition-colors duration-200 sm:min-h-0 sm:py-1.5 border-l border-surface-600/80 ${T==="raw"?"bg-accent/25 text-accent font-medium":"bg-surface-800 text-slate-400 hover:text-slate-200"}`,onClick:le,children:"JSON raw"})]}):w.jsx("span",{className:"text-[10px] text-slate-500",children:"(solo JSON — sin propiedades `object` en el spec)"})]}),T==="fields"&&(q!=null&&q.length)?w.jsx("div",{className:"grid gap-2 sm:grid-cols-2 rounded-lg border border-surface-700 bg-surface-900/40 p-3",children:q.map(F=>W(F))}):w.jsx("textarea",{className:"w-full h-28 min-h-[7rem] bg-surface-900 border border-surface-600 rounded-lg p-3 font-mono text-xs text-slate-200 leading-relaxed transition-colors duration-150 hover:border-surface-500",value:j,onChange:F=>$(F.target.value),placeholder:'{"key": "value"}',spellCheck:!1})]}),R&&w.jsx("p",{role:"alert",className:"text-xs text-rose-200 bg-rose-950/40 border border-rose-700/50 rounded-lg px-3 py-2 leading-relaxed",children:R}),w.jsx("button",{type:"button",onClick:()=>void ie(),className:"min-h-[48px] sm:min-h-0 px-6 py-3 sm:px-5 sm:py-2.5 rounded-xl bg-accent text-surface-950 font-semibold text-sm shadow-lg shadow-accent/15 transition-[transform,filter] duration-200 hover:brightness-110 active:scale-[0.98] motion-reduce:active:scale-100 cursor-pointer",children:"Ejecutar"}),w.jsxs("div",{className:"space-y-2",children:[w.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:"Respuesta"}),U?w.jsxs(w.Fragment,{children:[w.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:[w.jsx("span",{className:U.status>=200&&U.status<300?"text-emerald-400":U.status>=400?"text-rose-400":"text-amber-300",children:U.status})," ",U.statusText]}),U.json!==null?w.jsx(dk,{data:U.json,defaultOpenDepth:3}):w.jsx("pre",{className:"text-xs bg-surface-900 border border-surface-700 rounded-lg p-3 overflow-auto max-h-64 text-emerald-300/90 whitespace-pre-wrap font-mono",children:U.bodyText||"—"})]}):w.jsx("p",{className:"text-xs text-slate-500",children:"—"})]})]})}function Nk(t){const r=t.toLowerCase().trim();return`border-l-[3px] ${r==="get"?"border-l-emerald-400":r==="post"?"border-l-sky-400":r==="put"?"border-l-amber-400":r==="patch"?"border-l-violet-400":r==="delete"?"border-l-rose-400":r==="head"||r==="options"||r==="trace"?"border-l-slate-400":"border-l-cyan-400/80"}`}function Ek(t){return w.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[w.jsx("circle",{cx:"11",cy:"11",r:"8"}),w.jsx("path",{d:"m21 21-4.3-4.3"})]})}function Ck(t){return w.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[w.jsx("circle",{cx:"18",cy:"5",r:"3"}),w.jsx("circle",{cx:"6",cy:"12",r:"3"}),w.jsx("circle",{cx:"18",cy:"19",r:"3"}),w.jsx("path",{d:"m8.59 13.51 6.83 3.98"}),w.jsx("path",{d:"m15.41 6.51-6.82 3.98"})]})}function jk(t){return w.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[w.jsx("path",{d:"M9 11l3 3L22 4"}),w.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})}function hg(t){return w.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[w.jsx("path",{d:"M12 8V4H8"}),w.jsx("rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"}),w.jsx("path",{d:"M2 14h2"}),w.jsx("path",{d:"M20 14h2"}),w.jsx("path",{d:"M15 13v2"}),w.jsx("path",{d:"M9 13v2"})]})}function Pk(t){return w.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[w.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),w.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}function Mk(t){return w.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[w.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),w.jsx("polyline",{points:"7 10 12 15 17 10"}),w.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function $k(t){return w.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[w.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),w.jsx("polyline",{points:"17 8 12 3 7 8"}),w.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]})}function Tk(t){return w.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[w.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),w.jsx("polyline",{points:"16 17 21 12 16 7"}),w.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]})}function pm(t){return w.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[w.jsx("path",{d:"M15 3h6v6"}),w.jsx("path",{d:"M9 21H3v-6"}),w.jsx("path",{d:"M21 3l-7 7"}),w.jsx("path",{d:"M3 21l7-7"})]})}const Ik=["get","post","put","patch","delete","options","head","trace"];function mg(t,r){const i=t.trim().replace(/\s+/g," ");return i.length<=r?i:`${i.slice(0,r-1)}…`}function Ak(t,r,i,s,l){const c=[`${t.toUpperCase()} ${r}`];return i&&c.push(`— ${mg(i,140)}`),s!=null&&s.length&&c.push(`[tags: ${s.join(", ")}]`),l&&c.push(`(operationId: ${l})`),c.join(" ")}function Ok(t,r){const i=[];let s=0;const l=t.paths;if(!l)return{lines:i,total:0};for(const[c,d]of Object.entries(l)){if(!d||typeof d!="object"||"$ref"in d)continue;const h=d;for(const y of Ik){const b=h[y];if(!(!b||typeof b!="object")&&(s+=1,i.length<r)){const k=b.summary||(b.description?mg(b.description,200):void 0);i.push(Ak(y,c,k,b.tags,b.operationId))}}}return{lines:i,total:s}}function Rk(t){var i,s,l,c,d,h,y;const r=[`Flujo «${t.name}»`];if((i=t.steps)!=null&&i.length){const b=t.steps.map(x=>`${x.method.toUpperCase()} ${x.path}`).join(" → ");r.push(`secuencia (pasos): ${b}`);const k=t.steps.filter(x=>x.extract).map(x=>`${x.extract.varName} ← ${x.extract.jsonPath}`);k.length&&r.push(`extracciones: ${k.join("; ")}`)}if((l=(s=t.graph)==null?void 0:s.nodes)!=null&&l.length){const b=t.graph.nodes.map(k=>`${k.method.toUpperCase()} ${k.path}`).join(" → ");r.push(`grafo (nodos en orden guardado): ${b}`),(c=t.graph.edges)!=null&&c.length&&r.push(`cables: ${t.graph.edges.length} (mapeo respuesta → siguiente request; detalle en la UI Flujos)`)}return!((d=t.steps)!=null&&d.length)&&!((y=(h=t.graph)==null?void 0:h.nodes)!=null&&y.length)&&r.push("(sin pasos ni nodos)"),r.join(". ")}function Lk(t){var i;if(!((i=t.cases)!=null&&i.length))return`Suite «${t.name}»: sin casos`;const r=t.cases.map(s=>`${s.method.toUpperCase()} ${s.path} → esperado HTTP ${s.expectStatus}`).join("; ");return`Suite «${t.name}» (${t.cases.length} caso(s)): ${r}`}function Dk(t,r){var T,I,U,P;const i=t.info.title??"API",s=t.info.version??"",l=`Documentación OpenAPI «${i}»${s?` v${s}`:""}.`,c=((T=t.servers)==null?void 0:T.map(R=>`${R.url}${R.description?` (${R.description})`:""}`).join(`
207
+ `))||"(sin servers en el spec; usa la Base URL de la barra superior en la UI)",d=(I=t.components)!=null&&I.securitySchemes?Object.entries(t.components.securitySchemes).map(([R,B])=>{if(!B||typeof B!="object"||"$ref"in B)return`${R}: ref`;const H=B.type??"?";return`${R} (${H})`}).join("; "):"",{lines:h,total:y}=Ok(t,400),b=y>h.length?`
208
+ … y ${y-h.length} operación(es) más en el spec.`:"";let k="";const x=((U=r==null?void 0:r.savedFlows)==null?void 0:U.filter(R=>R.name))??[];x.length&&(k=`
209
+
210
+ --- Flujos guardados por el usuario en esta app (${x.length}) ---
211
+ ${x.map(Rk).join(`
212
+ `)}`);let S="";const C=((P=r==null?void 0:r.testSuites)==null?void 0:P.filter(R=>R.name))??[];C.length&&(S=`
213
+
214
+ --- Suites de tests guardadas (${C.length}) ---
215
+ ${C.map(Lk).join(`
216
+ `)}`);let j="";const $=r==null?void 0:r.selectedOperation;return $!=null&&$.path&&(j=`
217
+
218
+ --- Operación enfocada en la UI (Explorar) ---
219
+ ${$.method.toUpperCase()} ${$.path}
220
+ (Prioriza explicar esta ruta si el usuario pregunta en genérico «este endpoint».)`),`${l}
221
+
222
+ --- Servidores (servers) ---
223
+ ${c}
224
+
225
+ --- Seguridad (components.securitySchemes) ---
226
+ ${d||"(ninguno declarado o solo referencias)"}
227
+
228
+ --- Catálogo de endpoints (método, ruta, resumen/tags) ---
229
+ Total de operaciones en el spec: ${y}.
230
+ ${h.join(`
231
+ `)}${b}
232
+ ${k}
233
+ ${S}${j}
234
+
235
+ Instrucciones:
236
+ - Responde en el idioma del usuario. Sé preciso: cita método y ruta cuando hables de un endpoint.
237
+ - Puedes explicar cómo encadenar llamadas (flujos), qué variables extraer entre pasos, y cómo se relacionan con los tests guardados.
238
+ - Para probar requests reales, el usuario debe usar la pestaña Explorar (o Flujos/Tests); tú no ejecutas HTTP.
239
+ - Si falta detalle en este resumen, indica que puede ver el cuerpo completo de la operación en la UI (Explorar) o en el JSON OpenAPI.`}async function zk(t,r,i,s,l){const c=`${t.replace(/\/?$/,"/")}__chat`,d=await fetch(c,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",[by]:r},body:JSON.stringify({provider:i,model:s,messages:l})}),h=await d.text();if(!d.ok){let y=h;try{const b=JSON.parse(h);y=b.message??b.error??h}catch{}throw new Error(y||`HTTP ${d.status}`)}return JSON.parse(h)}function Fk({doc:t,contextExtras:r,provider:i,model:s,apiKey:l,onOpenLlmSettings:c}){const d="/docs/",[h,y]=Y.useState(!1),[b,k]=Y.useState([]),[x,S]=Y.useState(""),[C,j]=Y.useState(!1),[$,T]=Y.useState(null),I=Y.useRef(null),U=Y.useMemo(()=>Dk(t,r),[t,r]);Y.useEffect(()=>{var B;(B=I.current)==null||B.scrollIntoView({behavior:"smooth"})},[b]);const P=Y.useCallback(async()=>{const B=x.trim();if(!B||C)return;if(!l.trim()){T("Configura tu API key en el menú lateral (Asistente LLM)."),c==null||c();return}T(null);const H=s.trim()||Zl(i),Q={role:"user",content:B},ce=[{role:"system",content:U},...b.filter(de=>de.role!=="system"),Q];S(""),k(de=>[...de,Q]),j(!0);try{const de=await zk(d,l.trim(),i,H,ce);k(we=>[...we,{role:"assistant",content:de.content??""}])}catch(de){T(de instanceof Error?de.message:String(de))}finally{j(!1)}},[l,d,x,C,b,s,c,i,U]),R=Y.useCallback(()=>{k([]),T(null)},[]);return w.jsxs("div",{className:"fixed bottom-4 right-4 z-[100] flex flex-col items-end gap-2 pointer-events-none [&>*]:pointer-events-auto",style:{paddingBottom:"max(0.5rem, env(safe-area-inset-bottom))"},children:[h?w.jsxs("div",{className:"w-[min(100vw-1.5rem,24rem)] h-[min(72vh,28rem)] flex flex-col rounded-2xl border border-surface-600 bg-surface-900/95 backdrop-blur-md shadow-2xl shadow-black/40 overflow-hidden",role:"dialog","aria-label":"Asistente de la API",children:[w.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 border-b border-surface-700/90 bg-surface-950/80",children:[w.jsx("span",{className:"text-sm font-medium text-slate-200",children:"Asistente"}),w.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[w.jsx("button",{type:"button",onClick:R,className:"text-[11px] text-slate-500 hover:text-slate-300 px-2 py-1 rounded-md hover:bg-surface-800",children:"Vaciar"}),w.jsx("button",{type:"button",onClick:()=>y(!1),className:"touch-target min-w-[2.25rem] min-h-[2.25rem] rounded-lg text-slate-400 hover:text-white hover:bg-surface-800 text-lg leading-none","aria-label":"Cerrar panel del asistente",children:"×"})]})]}),$?w.jsxs("div",{className:"px-3 py-2 text-xs text-rose-300 bg-rose-950/50 border-b border-rose-900/40 flex flex-wrap items-center gap-2",children:[w.jsx("span",{className:"flex-1 min-w-0",children:$}),c?w.jsx("button",{type:"button",className:"shrink-0 underline text-accent",onClick:c,children:"Ir a claves"}):null]}):null,w.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-3 min-h-0",children:[b.length===0?w.jsx("p",{className:"text-xs text-slate-500 text-center py-6 leading-relaxed px-1",children:"Pregunta por endpoints, flujos o tests. Las claves del modelo están en el menú lateral."}):b.map((B,H)=>w.jsxs("div",{className:`text-xs leading-relaxed rounded-xl px-2.5 py-2 ${B.role==="user"?"bg-accent/12 text-slate-100 ml-3 border border-accent/25":"bg-surface-800/90 text-slate-200 mr-3 border border-surface-600/60"}`,children:[w.jsx("span",{className:"text-[10px] uppercase tracking-wider text-slate-500 block mb-0.5",children:B.role==="user"?"Tú":"Asistente"}),w.jsx("div",{className:"whitespace-pre-wrap break-words",children:B.content})]},`${H}-${B.role}`)),w.jsx("div",{ref:I})]}),w.jsxs("div",{className:"p-2.5 border-t border-surface-700/90 flex gap-2 bg-surface-950/60",children:[w.jsx("textarea",{className:"flex-1 min-h-[44px] max-h-32 bg-surface-900 border border-surface-600 rounded-xl px-2.5 py-2 text-xs text-slate-200 resize-y",rows:2,value:x,onChange:B=>S(B.target.value),onKeyDown:B=>{B.key==="Enter"&&!B.shiftKey&&(B.preventDefault(),P())},placeholder:"Pregunta sobre el spec…",disabled:C}),w.jsx("button",{type:"button",onClick:()=>void P(),disabled:C||!x.trim(),className:"self-end shrink-0 min-h-[44px] px-3 rounded-xl bg-accent text-surface-950 font-semibold text-xs disabled:opacity-40",children:C?"…":"Enviar"})]})]}):null,w.jsx("button",{type:"button",onClick:()=>y(B=>!B),className:`touch-target min-w-[3.25rem] min-h-[3.25rem] rounded-full border-2 flex items-center justify-center shadow-lg transition-[transform,box-shadow] ${h?"border-surface-500 bg-surface-800 text-slate-300 scale-95":"border-accent/80 bg-accent text-surface-950 hover:brightness-110 hover:scale-[1.02]"}`,"aria-expanded":h,"aria-label":h?"Ocultar asistente":"Abrir asistente",title:"Asistente",children:w.jsx(hg,{className:h?"opacity-80":void 0})})]})}const gg="adt-llm-provider",yg="adt-llm-model",vg="adt-llm-key";function Bk(){try{const t=localStorage.getItem(gg),r=t==="anthropic"||t==="openai"||t==="openrouter"?t:"openrouter",i=localStorage.getItem(yg)??"",s=localStorage.getItem(vg)??"";return{provider:r,model:i,apiKey:s}}catch{return{provider:"openrouter",model:"",apiKey:""}}}function Hk(t,r,i){try{localStorage.setItem(gg,t),localStorage.setItem(yg,r),localStorage.setItem(vg,i)}catch{}}const xg=[{value:200,label:"200 OK"},{value:201,label:"201 Created"},{value:202,label:"202 Accepted"},{value:204,label:"204 No Content"},{value:400,label:"400 Bad Request"},{value:401,label:"401 Unauthorized"},{value:403,label:"403 Forbidden"},{value:404,label:"404 Not Found"},{value:409,label:"409 Conflict"},{value:422,label:"422 Unprocessable"},{value:429,label:"429 Too Many Requests"},{value:500,label:"500 Server Error"},{value:502,label:"502 Bad Gateway"},{value:503,label:"503 Unavailable"}];function hm(t){return xg.some(r=>r.value===t)}const yf=[{id:"typescript",label:"TypeScript"},{id:"javascript",label:"JavaScript"},{id:"python",label:"Python"},{id:"php",label:"PHP"}];function vf(t,r){return`${t.toLowerCase()} ${r}`}function Vk(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}async function mm(t){await navigator.clipboard.writeText(t)}function Uk(){var Ro;const t=fk(),[r,i]=Y.useState(null),[s,l]=Y.useState(null),[c,d]=Y.useState("explore"),[h,y]=Y.useState(""),[b,k]=Y.useState(null),[x,S]=Y.useState(null),[C,j]=Y.useState("typescript"),[$,T]=Y.useState(""),[I,U]=Y.useState(""),[P,R]=Y.useState("X-Api-Key"),[B,H]=Y.useState({nodes:[],edges:[]}),[Q,ce]=Y.useState(0),[de,we]=Y.useState("Mi flujo"),[q,fe]=Y.useState([]),[xe,L]=Y.useState(""),[le,G]=Y.useState({name:"Suite 1",cases:[]}),[ie,z]=Y.useState([]),[W,F]=Y.useState(""),[A,K]=Y.useState(""),[be,Se]=Y.useState(null),[Me,Ie]=Y.useState(null),[Ae,_e]=Y.useState(null),[ze,ke]=Y.useState("openrouter"),[He,Oe]=Y.useState(""),[Ke,lt]=Y.useState(""),ut=(V,Le)=>{try{const Ve=sessionStorage.getItem(V);if(Ve==="1")return!0;if(Ve==="0")return!1}catch{}return Le},[at,Nt]=Y.useState(()=>ut("adt-collapse-main",!1)),[Xt,Zt]=Y.useState(()=>ut("adt-collapse-explore",!1)),Vt="/docs/openapi.json",Et="/docs/preset.json",Bt=Y.useCallback(async()=>{const[V,Le]=await Promise.all([_t.flows.toArray(),_t.testSuites.toArray()]);fe(V.sort((Ve,dt)=>(Ve.name??"").localeCompare(dt.name??""))),z(Le.sort((Ve,dt)=>(Ve.name??"").localeCompare(dt.name??"")))},[]);Y.useEffect(()=>{var Le,Ve;if(!r)return;const V=((Le=t.productName)==null?void 0:Le.trim())||((Ve=r.info.title)==null?void 0:Ve.trim())||"API";document.title=V},[r,t.productName]),Y.useEffect(()=>{fetch(Vt,{credentials:"include"}).then(async V=>{if(V.status===401){let Le="/docs/__auth/login";try{const Ve=await V.json();Ve.loginPath&&(Le=Ve.loginPath)}catch{}return window.location.href=Le,null}if(!V.ok)throw new Error(`${V.status} ${V.statusText}`);return V.json()}).then(V=>{V&&(i(V),y(ks(V)),l(null))}).catch(V=>l(V.message))},[Vt]),Y.useEffect(()=>{try{sessionStorage.setItem("adt-collapse-main",at?"1":"0")}catch{}},[at]),Y.useEffect(()=>{try{sessionStorage.setItem("adt-collapse-explore",Xt?"1":"0")}catch{}},[Xt]),Y.useEffect(()=>{(async()=>{try{const V=await fetch("/docs/__auth/session",{credentials:"include"});if(V.ok){const Le=await V.json();_e({username:Le.username})}else _e(null)}catch{_e(null)}})()},[]),Y.useEffect(()=>{if(!r)return;let V=!1;return(async()=>{try{const Le=await fetch(Et,{credentials:"include"});if(!Le.ok||V)return;const Ve=await Le.json(),dt=await qy(Ve);!V&&dt&&await Bt()}catch{}})(),()=>{V=!0}},[r,Et,Bt]),Y.useEffect(()=>{Bt(),_t.kv.get("bearer").then(V=>V&&T(V.value)),_t.kv.get("apiKey").then(V=>V&&U(V.value))},[Bt]),Y.useEffect(()=>{const V=Bk();ke(V.provider),Oe(V.model||Zl(V.provider)),lt(V.apiKey)},[]);const fn=Y.useMemo(()=>r?zy(r):[],[r]),It=Y.useMemo(()=>r?to(r):[],[r]),bn=Y.useMemo(()=>({savedFlows:q,testSuites:ie,selectedOperation:x}),[q,ie,x]),St=Y.useMemo(()=>b?It.filter(V=>(V.tags??["default"]).includes(b)):It,[It,b]);Y.useEffect(()=>{if(It.length&&!A){const V=It[0];K(vf(V.method,V.path))}},[It,A]),Y.useEffect(()=>{if(It.length===0||B.nodes.length>0||c!=="flows"||be!=null)return;const V=It[0];H({nodes:[{id:crypto.randomUUID(),method:V.method.toLowerCase(),path:V.path,x:80,y:120}],edges:[]}),ce(Le=>Le+1)},[It,B.nodes.length,c,be]);const Lt=Y.useCallback(()=>{const V={"Content-Type":"application/json"};return $.trim()&&(V.Authorization=`Bearer ${$.trim()}`),I.trim()&&(V[P]=I.trim()),V},[$,I,P]),_n=Y.useMemo(()=>{if(!r||!x)return null;const V={};for(const{id:Le}of yf)V[Le]=Ry(r,Le,x.method,x.path);return V},[r,x]),Kn=Y.useMemo(()=>r?Dy(r,C,b):"",[r,C,b]),Sn=async V=>{var En;if(!r)return"";const Le={};let Ve="";const dt=ks(r,h);for(let Kt=0;Kt<V.length;Kt++){const pn=V[Kt];let Qt=pn.path;for(const[br,ar]of Object.entries(Le))Qt=Qt.replace(`{${br}}`,ar);const wr=`${dt}${Qt}`,Gn={method:pn.method.toUpperCase(),headers:Lt()},kt=pn.method.toLowerCase();kt!=="get"&&kt!=="head"&&(Gn.body="{}");const Cn=await fetch(wr,{...Gn,credentials:"include"}),ht=await Cn.json().catch(()=>({}));if(Ve+=`Paso ${Kt+1}: ${Cn.status}
240
+ ${JSON.stringify(ht,null,2)}
241
+
242
+ `,(En=pn.extract)!=null&&En.jsonPath){const br=Rf(ht,pn.extract.jsonPath);br!==void 0&&(Le[pn.extract.varName]=String(br))}}return Ve},$n=async()=>{if(!r)return;const V=ks(r,h);if(B.nodes.length===0){L("Añade al menos un nodo al flujo.");return}const Le=await um(B,V,Lt);L(Le)},qn=async V=>{if(!r)return;const Le=ks(r,h),Ve=V.graph&&V.graph.nodes.length>0?await um(V.graph,Le,Lt):await Sn(V.steps);L(Ve),d("flows")},yr=V=>{we(V.name),H(V.graph&&V.graph.nodes.length>0?V.graph:uk(V.steps.length?V.steps:[{method:"get",path:"/"}])),ce(Le=>Le+1),Se(V.id??null),d("flows")},vr=()=>{Se(null),we("Nuevo flujo"),It[0]?H({nodes:[{id:crypto.randomUUID(),method:It[0].method.toLowerCase(),path:It[0].path,x:80,y:120}],edges:[]}):H({nodes:[],edges:[]}),ce(V=>V+1)},kn=Y.useCallback(V=>{H(V)},[]),Ye=async()=>{const V=lk(B);if(be!=null)await _t.flows.update(be,{name:de,steps:V,graph:B});else{const Le=await _t.flows.add({name:de,steps:V,graph:B});Se(Le)}await Bt()},Wn=async V=>{V!==void 0&&(V===be&&(Se(null),vr()),await _t.flows.delete(V),await Bt())},Nn=()=>{if(!A)return;const{method:V,path:Le}=Vk(A),Ve={id:crypto.randomUUID(),method:V,path:Le,expectStatus:200,contains:void 0,jsonPath:void 0,expectJsonValue:void 0};G(dt=>({...dt,cases:[...dt.cases,Ve]}))},ir=V=>{G(Le=>({...Le,cases:Le.cases.filter(Ve=>Ve.id!==V)}))},Be=(V,Le)=>{G(Ve=>({...Ve,cases:Ve.cases.map(dt=>dt.id===V?{...dt,...Le}:dt)}))},dn=async V=>{if(!r)return"";const Le=ks(r,h);let Ve="";for(const dt of V){const En=`${Le}${dt.path}`,Kt=await fetch(En,{method:dt.method.toUpperCase(),headers:Lt(),credentials:"include"}),pn=await Kt.text(),Qt=Wy(dt,Kt.status,pn),wr=`${Qt.pass?"PASS":"FAIL"} ${dt.method.toUpperCase()} ${dt.path}`;Ve+=`${wr}
243
+ ${Qt.lines.map(Gn=>` ${Gn}`).join(`
244
+ `)}
245
+
246
+ `}return Ve},Yn=async()=>{const V=await dn(le.cases);F(V)},Fr=async()=>{if(!r||ie.length===0)return;let V="";for(const Le of ie)V+=`━━━ ${Le.name} (${Le.cases.length} casos) ━━━
247
+ `,V+=await dn(Le.cases);F(V),d("tests")},ro=async V=>{const Le=await dn(V.cases);F(Le),d("tests")},Br=V=>{G({name:V.name,cases:V.cases.map(Le=>({...Le,id:Le.id&&Le.id.length>0?Le.id:crypto.randomUUID()}))}),Ie(V.id??null),d("tests")},Ao=()=>{Ie(null),G({name:"Nueva suite",cases:[]})},Oo=async()=>{if(Me!=null)await _t.testSuites.update(Me,{name:le.name,cases:le.cases});else{const V=await _t.testSuites.add({name:le.name,cases:le.cases});Ie(V)}await Bt()},Tn=async V=>{V!==void 0&&(V===Me&&(Ie(null),G({name:"Nueva suite",cases:[]})),await _t.testSuites.delete(V),await Bt())},Xn=async()=>{await _t.kv.put({key:"bearer",value:$}),await _t.kv.put({key:"apiKey",value:I})},In=async()=>{const V=await Ky(),Le=new Blob([JSON.stringify(V,null,2)],{type:"application/json"}),Ve=document.createElement("a");Ve.href=URL.createObjectURL(Le),Ve.download="api-doc-tor-export.json",Ve.click()},sr=async V=>{var En;const Le=(En=V.target.files)==null?void 0:En[0];if(!Le)return;const Ve=await Le.text(),dt=JSON.parse(Ve);await _m(dt),await Bt()},mt=async()=>{await fetch("/docs/__auth/logout",{method:"POST",credentials:"include"}),window.location.href="/docs/__auth/login"},jt=Y.useCallback(()=>{Nt(!1),window.setTimeout(()=>{var V;(V=document.getElementById("adt-llm-settings"))==null||V.scrollIntoView({behavior:"smooth",block:"nearest"})},150)},[]),xr=Y.useCallback(()=>{Hk(ze,He.trim(),Ke)},[Ke,He,ze]),Qn=()=>{x&&(H(V=>{const Le=V.nodes[V.nodes.length-1],Ve=Le?Le.x+280:80,dt=(Le==null?void 0:Le.y)??120;return{nodes:[...V.nodes,{id:crypto.randomUUID(),method:x.method.toLowerCase(),path:x.path,x:Ve,y:dt}],edges:V.edges}}),ce(V=>V+1),d("flows"))};if(s)return w.jsx("div",{className:"min-h-screen flex items-center justify-center p-8",children:w.jsxs("div",{role:"alert",className:"max-w-lg rounded-2xl border border-red-500/35 bg-surface-900/95 p-6 text-red-200 shadow-xl shadow-black/20",children:[w.jsx("h1",{className:"font-display text-xl font-bold mb-2",children:"No se pudo cargar OpenAPI"}),w.jsx("p",{className:"text-sm opacity-90 leading-relaxed",children:s}),w.jsxs("p",{className:"text-xs mt-4 text-slate-500",children:["URL intentada: ",Vt]})]})});if(!r)return w.jsx("div",{className:"min-h-screen flex items-center justify-center p-6",children:w.jsx("p",{className:"text-slate-400 motion-safe:animate-pulse",children:"Cargando especificación…"})});const An=b===null?"Todos los endpoints (cliente único con todas las operaciones)":`Tag «${b}» (solo operaciones de este grupo)`,On=((Ro=t.productName)==null?void 0:Ro.trim())||r.info.title;return w.jsxs("div",{className:"min-h-screen flex flex-col bg-surface-950 selection:bg-accent/25 selection:text-slate-50",children:[w.jsx("a",{href:"#main-content",className:"skip-link",children:"Saltar al contenido"}),w.jsxs("div",{className:"flex flex-1 flex-col md:flex-row min-h-0",children:[w.jsxs("aside",{className:`w-full border-b md:border-b-0 md:border-r border-surface-700 bg-surface-900/90 shrink-0 transition-[width] duration-200 ease-out flex flex-col backdrop-blur-sm ${at?"md:w-14 md:min-w-[3.5rem]":"md:w-64"}`,children:[w.jsx("input",{id:"adt-state-import",type:"file",accept:"application/json",className:"hidden",onChange:sr}),w.jsxs("div",{className:at?"max-md:block md:hidden":"block",children:[w.jsxs("div",{className:"p-4 border-b border-surface-700 flex justify-between items-start gap-2",children:[w.jsxs("div",{className:"min-w-0",children:[t.logoDataUrl?w.jsx("img",{src:t.logoDataUrl,alt:On,className:"h-9 max-w-[200px] object-contain object-left mb-2"}):null,w.jsx("h1",{className:"font-display text-lg font-bold text-white tracking-tight",children:On}),w.jsx("p",{className:"text-xs text-slate-500 mt-1",children:On===r.info.title?`v${r.info.version}`:`${r.info.title} · v${r.info.version}`})]}),w.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:()=>Nt(!0),"aria-label":"Ocultar menú lateral",title:"Ocultar menú",children:"‹"})]}),w.jsx("nav",{className:"p-2 flex flex-row md:flex-col gap-1 overflow-x-auto","aria-label":"Navegación principal",children:[["explore","Explorar"],["flows",`Flujos (${q.length})`],["tests",`Tests (${ie.length})`],["auth","Auth"]].map(([V,Le])=>w.jsx("button",{type:"button",onClick:()=>d(V),className:`text-left px-3 py-2.5 md:py-2 rounded-lg text-sm transition-colors duration-200 ease-out min-h-[44px] md:min-h-0 flex items-center ${c===V?"bg-accent/20 text-accent shadow-inner shadow-accent/5":"text-slate-400 hover:bg-surface-800 hover:text-slate-200"}`,children:Le},V))}),w.jsxs("div",{id:"adt-llm-settings",className:"px-3 py-3 border-t border-surface-700 space-y-2",children:[w.jsx("p",{className:"text-[11px] font-semibold text-slate-400 uppercase tracking-wide",children:"Asistente LLM"}),w.jsx("p",{className:"text-[10px] text-slate-500 leading-snug",children:"Tu clave vive solo en este navegador; el servidor la reenvía al proveedor."}),w.jsxs("label",{className:"block text-[11px] text-slate-400",children:["Proveedor",w.jsxs("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded-lg px-2 py-1.5 text-xs text-slate-200",value:ze,onChange:V=>{const Le=V.target.value;ke(Le),Oe(Ve=>Ve.trim()?Ve:Zl(Le))},children:[w.jsx("option",{value:"anthropic",children:"Anthropic (Claude)"}),w.jsx("option",{value:"openai",children:"OpenAI"}),w.jsx("option",{value:"openrouter",children:"OpenRouter"})]})]}),w.jsxs("label",{className:"block text-[11px] text-slate-400",children:["Modelo (opcional)",w.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded-lg px-2 py-1.5 text-xs font-mono text-slate-200",value:He,onChange:V=>Oe(V.target.value),placeholder:Zl(ze),spellCheck:!1})]}),w.jsxs("label",{className:"block text-[11px] text-slate-400",children:["API key",w.jsx("input",{type:"password",className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded-lg px-2 py-1.5 text-xs font-mono text-slate-200",value:Ke,onChange:V=>lt(V.target.value),placeholder:ze==="anthropic"?"sk-ant-…":ze==="openai"?"sk-…":"sk-or-v1-…",autoComplete:"off"})]}),w.jsx("button",{type:"button",onClick:xr,className:"w-full text-xs py-2 rounded-lg bg-accent text-surface-950 font-medium hover:brightness-110 transition-[filter] min-h-[40px] md:min-h-0",children:"Guardar claves"})]}),Ae?w.jsxs("div",{className:"px-3 py-2 border-t border-surface-700 flex items-center justify-between gap-2 text-xs",children:[w.jsx("span",{className:"text-slate-400 truncate",title:Ae.username,children:Ae.username}),w.jsx("button",{type:"button",className:"shrink-0 text-accent hover:underline",onClick:()=>void mt(),children:"Salir"})]}):null,w.jsxs("div",{className:"p-3 border-t border-surface-700 space-y-2",children:[w.jsx("button",{type:"button",onClick:In,className:"w-full text-xs py-2.5 rounded-lg bg-surface-800 hover:bg-surface-700 transition-colors duration-200 min-h-[44px] md:min-h-0",children:"Exportar estado"}),w.jsx("label",{htmlFor:"adt-state-import",className:"block w-full text-xs py-2.5 rounded-lg bg-surface-800 hover:bg-surface-700 text-center cursor-pointer transition-colors duration-200 min-h-[44px] md:min-h-0 flex items-center justify-center",children:"Importar JSON"})]})]}),at?w.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:[w.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:()=>Nt(!1),"aria-label":"Mostrar menú lateral completo",title:"Expandir panel completo",children:w.jsx(pm,{className:"text-slate-300"})}),w.jsxs("nav",{className:"flex flex-col gap-0.5 items-center w-full py-1 border-b border-surface-700/80","aria-label":"Secciones",children:[w.jsx("button",{type:"button",onClick:()=>d("explore"),title:"Explorar","aria-current":c==="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 ${c==="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:w.jsx(Ek,{})}),w.jsxs("button",{type:"button",onClick:()=>d("flows"),title:`Flujos (${q.length})`,"aria-current":c==="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 ${c==="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:[w.jsx(Ck,{}),q.length>0?w.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:q.length>99?"99+":q.length}):null]}),w.jsxs("button",{type:"button",onClick:()=>d("tests"),title:`Tests (${ie.length})`,"aria-current":c==="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 ${c==="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:[w.jsx(jk,{}),ie.length>0?w.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:ie.length>99?"99+":ie.length}):null]}),w.jsx("button",{type:"button",onClick:jt,title:"Claves del asistente LLM",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:w.jsx(hg,{})}),w.jsxs("button",{type:"button",onClick:()=>d("auth"),title:"Auth","aria-current":c==="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 ${c==="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:[w.jsx(Pk,{}),Ae?w.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]})]}),w.jsxs("div",{className:"flex flex-col gap-0.5 items-center w-full py-1 mt-auto border-t border-surface-700/80",children:[w.jsx("button",{type:"button",onClick:In,title:"Exportar estado",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:w.jsx(Mk,{})}),w.jsx("button",{type:"button",onClick:()=>{var V;return(V=document.getElementById("adt-state-import"))==null?void 0:V.click()},title:"Importar JSON",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:w.jsx($k,{})}),Ae?w.jsx("button",{type:"button",onClick:()=>void mt(),title:`Salir (${Ae.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:w.jsx(Tk,{})}):null]})]}):null]}),w.jsxs("main",{id:"main-content",tabIndex:-1,className:"flex-1 flex flex-col min-h-0 outline-none",children:[w.jsx("header",{className:"sticky top-0 z-20 border-b border-surface-700/90 px-4 py-3 flex flex-wrap gap-3 items-center bg-surface-900/75 backdrop-blur-md supports-[backdrop-filter]:bg-surface-900/60",children:w.jsxs("label",{className:"text-xs text-slate-500 flex flex-col gap-1 sm:flex-row sm:items-center",children:[w.jsx("span",{className:"shrink-0 font-medium text-slate-400",children:"Base URL"}),w.jsx("input",{className:"sm:ml-2 min-h-[44px] sm:min-h-0 bg-surface-800 border border-surface-600 rounded-lg px-3 py-2 text-sm w-full max-w-md text-slate-200 placeholder:text-slate-500 transition-colors duration-200 hover:border-surface-500",value:h,onChange:V=>y(V.target.value),placeholder:"https://api.ejemplo.com",autoComplete:"url",spellCheck:!1})]})}),c==="explore"&&w.jsxs("div",{className:"flex-1 flex flex-col lg:flex-row min-h-0",children:[w.jsxs("div",{className:`shrink-0 border-b lg:border-b-0 lg:border-r border-surface-700 overflow-auto transition-[width] duration-200 ease-out ${Xt?"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:[w.jsxs("div",{className:Xt?"max-lg:block lg:hidden":"block",children:[w.jsxs("div",{className:"p-2 flex items-start justify-between gap-2 border-b border-surface-700 lg:border-b-0",children:[w.jsx("p",{className:"text-xs uppercase tracking-wider text-slate-500 shrink-0",children:"Tags"}),w.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:()=>Zt(!0),"aria-label":"Ocultar lista de endpoints",title:"Ocultar endpoints",children:"‹"})]}),w.jsx("div",{className:"p-2 pt-1",children:w.jsxs("div",{className:"flex flex-wrap gap-1",children:[w.jsx("button",{type:"button",onClick:()=>k(null),className:`text-xs px-3 py-2 sm:py-1 rounded-lg min-h-[40px] sm:min-h-0 transition-colors duration-200 ${b===null?"bg-accent/30 text-slate-100":"bg-surface-800 text-slate-300 hover:bg-surface-700"}`,children:"Todos"}),fn.map(V=>w.jsx("button",{type:"button",onClick:()=>k(V),className:`text-xs px-3 py-2 sm:py-1 rounded-lg min-h-[40px] sm:min-h-0 transition-colors duration-200 ${b===V?"bg-accent/30 text-slate-100":"bg-surface-800 text-slate-300 hover:bg-surface-700"}`,children:V},V))]})}),w.jsx("ul",{className:"text-sm",children:St.map(V=>w.jsx("li",{children:w.jsxs("button",{type:"button",onClick:()=>S({method:V.method,path:V.path}),className:`w-full text-left px-3 py-2.5 sm:py-2 min-h-[44px] sm:min-h-0 hover:bg-surface-800 flex gap-2 items-center transition-colors duration-150 rounded-r-md ${(x==null?void 0:x.method)===V.method&&x.path===V.path?"bg-surface-800/90 border-l-2 border-accent":""}`,children:[w.jsx(su,{method:V.method}),w.jsx("span",{className:"truncate text-slate-300",children:V.path})]})},`${V.method}:${V.path}`))})]}),Xt?w.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:[w.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:()=>Zt(!1),"aria-label":"Mostrar lista de endpoints completa",title:"Expandir lista de endpoints",children:w.jsx(pm,{className:"text-slate-300"})}),w.jsxs("div",{className:"text-center text-[9px] font-mono text-slate-500 leading-none px-0.5",title:`${St.length} operación(es) (filtro actual)`,children:[w.jsx("span",{className:"block text-slate-400 font-semibold text-[11px]",children:St.length}),w.jsx("span",{className:"text-[8px] uppercase tracking-tighter",children:"ops"})]}),w.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col gap-0.5 min-h-0 max-h-[min(70vh,32rem)] items-center w-full",role:"list","aria-label":"Endpoints numerados",children:St.map((V,Le)=>{const Ve=(x==null?void 0:x.method)===V.method&&x.path===V.path;return w.jsx("button",{type:"button",role:"listitem",title:`${V.method.toUpperCase()} ${V.path}`,onClick:()=>S({method:V.method,path:V.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 ${Nk(V.method)} ${Ve?"ring-2 ring-accent/80 shadow-[inset_0_0_0_1px_rgba(56,189,248,0.2)]":""}`,children:Le+1},`${V.method}:${V.path}`)})})]}):null]}),w.jsx("div",{className:"flex-1 p-4 overflow-auto space-y-6",children:x?w.jsxs(w.Fragment,{children:[w.jsxs("div",{children:[w.jsxs("h2",{className:"font-display font-semibold text-white text-lg flex flex-wrap items-center gap-2",children:[w.jsx(su,{method:x.method,size:"md"}),w.jsx("span",{className:"font-mono text-slate-200 break-all",children:x.path})]}),w.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:["Filtro de exportación de servicio: ",An]})]}),r?w.jsx(kk,{doc:r,selectedOp:x,baseUrl:h,buildHeaders:Lt}):null,w.jsxs("section",{className:"space-y-3",children:[w.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Snippets por lenguaje"}),w.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:_n&&yf.map(({id:V,label:Le})=>w.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/60 overflow-hidden",children:[w.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-surface-700 bg-surface-800/50",children:[w.jsx("span",{className:"text-xs font-medium text-accent",children:Le}),w.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-surface-600",onClick:()=>void mm(_n[V]),children:"Copiar"})]}),w.jsx("pre",{className:"text-[11px] p-3 overflow-auto max-h-56 text-slate-300 font-mono whitespace-pre-wrap",children:_n[V]})]},V))})]}),w.jsxs("section",{className:"space-y-3 rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[w.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Cliente / servicio generado"}),w.jsx("p",{className:"text-xs text-slate-500",children:An}),w.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[w.jsxs("label",{className:"text-xs text-slate-400",children:["Lenguaje del archivo",w.jsx("select",{className:"ml-2 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:C,onChange:V=>j(V.target.value),children:yf.map(({id:V,label:Le})=>w.jsx("option",{value:V,children:Le},V))})]}),w.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg bg-surface-700 hover:bg-surface-600",onClick:()=>void mm(Kn),children:"Copiar servicio"})]}),w.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:Kn})]}),w.jsx("div",{className:"flex flex-wrap gap-2 pt-2 border-t border-surface-800",children:w.jsx("button",{type:"button",className:"text-xs px-3 py-2 rounded-lg bg-surface-800 hover:bg-surface-700",onClick:Qn,children:"Añadir operación actual a un flujo (ve a Flujos)"})})]}):w.jsx("p",{className:"text-slate-500",children:"Selecciona una operación en la lista."})})]}),c==="flows"&&w.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[w.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4",children:[w.jsx("h3",{className:"text-sm font-semibold text-white mb-3",children:"Flujos guardados"}),q.length===0?w.jsx("p",{className:"text-sm text-slate-500",children:"Aún no hay flujos. Crea uno en el editor y guarda."}):w.jsx("ul",{className:"space-y-2",children:q.map(V=>{var Le,Ve;return w.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:[w.jsxs("div",{children:[w.jsx("span",{className:"text-sm text-slate-200 font-medium",children:V.name}),w.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[(((Ve=(Le=V.graph)==null?void 0:Le.nodes)==null?void 0:Ve.length)??V.steps.length)||0," nodo(s)"]})]}),w.jsxs("div",{className:"flex flex-wrap gap-2",children:[w.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded-lg bg-emerald-600/30 text-emerald-300 hover:bg-emerald-600/50",title:"Ejecutar sin cargar el editor",onClick:()=>void qn(V),children:"Play"}),w.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent hover:bg-accent/30",onClick:()=>yr(V),children:"Editar"}),w.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 Wn(V.id),children:"Eliminar"})]})]},V.id!=null?`flow-${V.id}`:`flow-${V.name}`)})})]}),w.jsxs("section",{className:"space-y-4 max-w-6xl",children:[w.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[w.jsx("h3",{className:"text-sm font-semibold text-white",children:"Editor de flujo (nodos y cables)"}),w.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:vr,children:"Nuevo flujo"})]}),be!=null&&w.jsxs("p",{className:"text-xs text-accent",children:["Editando flujo guardado (#",be,")"]}),w.jsxs("p",{className:"text-sm text-slate-400",children:["Cada nodo es un endpoint del spec. Conecta ",w.jsx("strong",{className:"text-slate-300",children:"res → req"})," ","y define qué campo de la respuesta pasa al siguiente request (JSON path, variable, header, query o ",w.jsx("code",{className:"text-accent",children:"{variable}"})," en la ruta)."]}),w.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm w-full max-w-md",value:de,onChange:V=>we(V.target.value),placeholder:"Nombre del flujo"}),w.jsx(ak,{doc:r,ops:It,graph:B,onGraphChange:kn},Q),w.jsxs("div",{className:"flex flex-wrap gap-2",children:[w.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 $n(),children:"Play (grafo)"}),w.jsx("button",{type:"button",className:"px-3 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void Ye(),children:be!=null?"Guardar cambios":"Guardar flujo"})]}),w.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:xe||"Resultado de la ejecución aquí."})]})]}),c==="tests"&&w.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[w.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[w.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[w.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suites guardadas"}),ie.length>0&&w.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 Fr(),children:"Ejecutar todas las suites"})]}),ie.length===0?w.jsx("p",{className:"text-sm text-slate-500",children:"Ninguna suite guardada."}):w.jsx("ul",{className:"space-y-2",children:ie.map(V=>w.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:[w.jsxs("div",{children:[w.jsx("span",{className:"text-sm text-slate-200 font-medium",children:V.name}),w.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[V.cases.length," caso(s)"]})]}),w.jsxs("div",{className:"flex flex-wrap gap-2",children:[w.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 ro(V),children:"Play"}),w.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent",onClick:()=>Br(V),children:"Editar"}),w.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-red-900/40",onClick:()=>void Tn(V.id),children:"Eliminar"})]})]},V.id!=null?`suite-${V.id}`:`suite-${V.name}`))})]}),w.jsxs("section",{className:"space-y-4",children:[w.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[w.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suite en edición"}),w.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:Ao,children:"Nueva suite"})]}),Me!=null&&w.jsxs("p",{className:"text-xs text-accent",children:["Editando suite guardada (#",Me,")"]}),w.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm max-w-md",value:le.name,onChange:V=>G(Le=>({...Le,name:V.target.value})),placeholder:"Nombre de la suite"}),w.jsxs("div",{className:"flex flex-wrap gap-2 items-end rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[w.jsxs("label",{className:"text-xs text-slate-400 flex-1 min-w-[200px]",children:["Añadir endpoint del spec",w.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm font-mono",value:A,onChange:V=>K(V.target.value),children:It.map(V=>w.jsxs("option",{value:vf(V.method,V.path),children:[V.method.toUpperCase()," ",V.path]},vf(V.method,V.path)))})]}),w.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-800 text-sm hover:bg-surface-700",onClick:Nn,children:"Añadir a la suite"})]}),w.jsx("ul",{className:"space-y-4",children:le.cases.map(V=>{const Le=hm(V.expectStatus)?String(V.expectStatus):"custom";return w.jsxs("li",{className:"rounded-xl border border-surface-700 bg-surface-950/40 p-4 space-y-3 text-sm",children:[w.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[w.jsxs("span",{className:"flex flex-wrap items-center gap-2 min-w-0",children:[w.jsx(su,{method:V.method}),w.jsx("span",{className:"font-mono text-xs text-slate-300 break-all",children:V.path})]}),w.jsx("button",{type:"button",className:"text-xs text-red-400 hover:underline shrink-0",onClick:()=>ir(V.id),children:"Quitar"})]}),w.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[w.jsxs("label",{className:"text-xs text-slate-400 block",children:["Código HTTP esperado",w.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[w.jsxs("select",{className:"bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm max-w-[200px]",value:Le,onChange:Ve=>{const dt=Ve.target.value;if(dt==="custom"){Be(V.id,{expectStatus:hm(V.expectStatus)?1e3:V.expectStatus});return}Be(V.id,{expectStatus:Number(dt)})},children:[xg.map(Ve=>w.jsx("option",{value:String(Ve.value),children:Ve.label},Ve.value)),w.jsx("option",{value:"custom",children:"Otro…"})]}),Le==="custom"&&w.jsx("input",{type:"number",className:"w-20 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:V.expectStatus,onChange:Ve=>Be(V.id,{expectStatus:Number(Ve.target.value)||0})})]})]}),w.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["El body contiene (opcional)",w.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono text-xs",placeholder:'ej. "ok"',value:V.contains??"",onChange:Ve=>Be(V.id,{contains:Ve.target.value||void 0})})]}),w.jsxs("label",{className:"text-xs text-slate-400 block",children:["JSON path (opcional)",w.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono text-xs",placeholder:"$.data.id",value:V.jsonPath??"",onChange:Ve=>Be(V.id,{jsonPath:Ve.target.value||void 0})})]}),w.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["Valor esperado en JSON path (opcional)",w.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono text-xs",placeholder:"Vacío = solo comprobar que existe",value:V.expectJsonValue??"",onChange:Ve=>Be(V.id,{expectJsonValue:Ve.target.value||void 0})})]})]})]},V.id)})}),w.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[w.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 Yn(),children:"Correr todos los casos (suite actual)"}),w.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void Oo(),children:Me!=null?"Guardar cambios":"Guardar suite"})]}),w.jsx("pre",{className:"text-xs bg-surface-950 border border-surface-700 rounded-lg p-3 whitespace-pre-wrap min-h-[4rem]",children:W||"—"})]})]}),c==="auth"&&w.jsxs("div",{className:"p-4 space-y-4 max-w-lg",children:[w.jsxs("p",{className:"text-sm text-slate-400",children:["Esquemas en el spec: ",Fy(r).join(", ")||"ninguno"]}),w.jsxs("label",{className:"block text-sm",children:["Bearer token",w.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:$,onChange:V=>T(V.target.value),placeholder:"eyJ..."})]}),w.jsxs("label",{className:"block text-sm",children:["API key header",w.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:P,onChange:V=>R(V.target.value)})]}),w.jsxs("label",{className:"block text-sm",children:["API key",w.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:I,onChange:V=>U(V.target.value),type:"password",autoComplete:"off"})]}),w.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void Xn(),children:"Recordar en este navegador"})]})]})]}),w.jsx(Fk,{doc:r,contextExtras:bn,provider:ze,model:He,apiKey:Ke,onOpenLlmSettings:jt}),w.jsx("footer",{className:"border-t border-surface-700 px-3 py-2.5 text-center text-[11px] text-slate-600 bg-surface-950 shrink-0",children:"made with ♥ by andres arcila"})]})}const Kk={surface950:"#0c0f14",surface900:"#12171f",surface800:"#1a2230",surface700:"#243044",accent:"#38bdf8",accentDim:"#0ea5e9"};function Ss(t){const r=t.trim(),i=/^#?([0-9a-f]{6})$/i.exec(r);if(!i)return"12 15 20";const s=parseInt(i[1],16);return`${s>>16&255} ${s>>8&255} ${s&255}`}function qk(t){return{...Kk,...t}}function Wk(t){var s,l;const r=(s=t.logoBase64)==null?void 0:s.trim();return r?r.startsWith("data:")?r:`data:${((l=t.logoMimeType)==null?void 0:l.trim())||"image/png"};base64,${r}`:null}function Yk(t){var i;const r=qk(t==null?void 0:t.colors);return{productName:((i=t==null?void 0:t.productName)==null?void 0:i.trim())||null,logoDataUrl:t?Wk(t):null,colors:r,colorsRgb:{surface950:Ss(r.surface950),surface900:Ss(r.surface900),surface800:Ss(r.surface800),surface700:Ss(r.surface700),accent:Ss(r.accent),accentDim:Ss(r.accentDim)}}}const Xk={credentials:"include"};function Qk(t){const r=document.documentElement;r.style.setProperty("--surface-950",t.surface950),r.style.setProperty("--surface-900",t.surface900),r.style.setProperty("--surface-800",t.surface800),r.style.setProperty("--surface-700",t.surface700),r.style.setProperty("--accent",t.accent),r.style.setProperty("--accent-dim",t.accentDim)}async function Gk(){const t=Yk(void 0);try{const r=await fetch("/docs/ui-config.json",Xk);return r.status===401?{...t,docsAuthRequired:!0}:r.ok?await r.json():t}catch{return t}}(async()=>{const t=await Gk();Qk(t.colorsRgb),wy.createRoot(document.getElementById("root")).render(w.jsx(gm.StrictMode,{children:w.jsx(ck,{value:{productName:t.productName,logoDataUrl:t.logoDataUrl},children:w.jsx(Uk,{})})}))})();