@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,214 @@
1
+ var ry=Object.defineProperty;var oy=(t,r,i)=>r in t?ry(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i;var ga=(t,r,i)=>oy(t,typeof r!="symbol"?r+"":r,i);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))s(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const d of f.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function i(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function s(u){if(u.ep)return;u.ep=!0;const f=i(u);fetch(u.href,f)}})();var iy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Qc={exports:{}},ya={},Gc={exports:{}},ht={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Uh;function sy(){if(Uh)return ht;Uh=1;var t=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),d=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),w=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),x=Symbol.iterator;function S($){return $===null||typeof $!="object"?null:($=x&&$[x]||$["@@iterator"],typeof $=="function"?$:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,T={};function I($,H,we){this.props=$,this.context=H,this.refs=T,this.updater=we||C}I.prototype.isReactComponent={},I.prototype.setState=function($,H){if(typeof $!="object"&&typeof $!="function"&&$!=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,$,H,"setState")},I.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")};function A(){}A.prototype=I.prototype;function V($,H,we){this.props=$,this.context=H,this.refs=T,this.updater=we||C}var P=V.prototype=new A;P.constructor=V,j(P,I.prototype),P.isPureReactComponent=!0;var R=Array.isArray,W=Object.prototype.hasOwnProperty,B={current:null},X={key:!0,ref:!0,__self:!0,__source:!0};function fe($,H,we){var Se,Me={},$e=null,Ae=null;if(H!=null)for(Se in H.ref!==void 0&&(Ae=H.ref),H.key!==void 0&&($e=""+H.key),H)W.call(H,Se)&&!X.hasOwnProperty(Se)&&(Me[Se]=H[Se]);var be=arguments.length-2;if(be===1)Me.children=we;else if(1<be){for(var Be=Array(be),ke=0;ke<be;ke++)Be[ke]=arguments[ke+2];Me.children=Be}if($&&$.defaultProps)for(Se in be=$.defaultProps,be)Me[Se]===void 0&&(Me[Se]=be[Se]);return{$$typeof:t,type:$,key:$e,ref:Ae,props:Me,_owner:B.current}}function pe($,H){return{$$typeof:t,type:$.type,key:H,ref:$.ref,props:$.props,_owner:$._owner}}function _e($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function U($){var H={"=":"=0",":":"=2"};return"$"+$.replace(/[=:]/g,function(we){return H[we]})}var ce=/\/+/g;function xe($,H){return typeof $=="object"&&$!==null&&$.key!=null?U(""+$.key):H.toString(36)}function D($,H,we,Se,Me){var $e=typeof $;($e==="undefined"||$e==="boolean")&&($=null);var Ae=!1;if($===null)Ae=!0;else switch($e){case"string":case"number":Ae=!0;break;case"object":switch($.$$typeof){case t:case r:Ae=!0}}if(Ae)return Ae=$,Me=Me(Ae),$=Se===""?"."+xe(Ae,0):Se,R(Me)?(we="",$!=null&&(we=$.replace(ce,"$&/")+"/"),D(Me,H,we,"",function(ke){return ke})):Me!=null&&(_e(Me)&&(Me=pe(Me,we+(!Me.key||Ae&&Ae.key===Me.key?"":(""+Me.key).replace(ce,"$&/")+"/")+$)),H.push(Me)),1;if(Ae=0,Se=Se===""?".":Se+":",R($))for(var be=0;be<$.length;be++){$e=$[be];var Be=Se+xe($e,be);Ae+=D($e,H,we,Be,Me)}else if(Be=S($),typeof Be=="function")for($=Be.call($),be=0;!($e=$.next()).done;)$e=$e.value,Be=Se+xe($e,be++),Ae+=D($e,H,we,Be,Me);else if($e==="object")throw H=String($),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys($).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.");return Ae}function le($,H,we){if($==null)return $;var Se=[],Me=0;return D($,Se,"","",function($e){return H.call(we,$e,Me++)}),Se}function Q($){if($._status===-1){var H=$._result;H=H(),H.then(function(we){($._status===0||$._status===-1)&&($._status=1,$._result=we)},function(we){($._status===0||$._status===-1)&&($._status=2,$._result=we)}),$._status===-1&&($._status=0,$._result=H)}if($._status===1)return $._result.default;throw $._result}var ie={current:null},z={transition:null},K={ReactCurrentDispatcher:ie,ReactCurrentBatchConfig:z,ReactCurrentOwner:B};function F(){throw Error("act(...) is not supported in production builds of React.")}return ht.Children={map:le,forEach:function($,H,we){le($,function(){H.apply(this,arguments)},we)},count:function($){var H=0;return le($,function(){H++}),H},toArray:function($){return le($,function(H){return H})||[]},only:function($){if(!_e($))throw Error("React.Children.only expected to receive a single React element child.");return $}},ht.Component=I,ht.Fragment=i,ht.Profiler=u,ht.PureComponent=V,ht.StrictMode=s,ht.Suspense=v,ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=K,ht.act=F,ht.cloneElement=function($,H,we){if($==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+$+".");var Se=j({},$.props),Me=$.key,$e=$.ref,Ae=$._owner;if(H!=null){if(H.ref!==void 0&&($e=H.ref,Ae=B.current),H.key!==void 0&&(Me=""+H.key),$.type&&$.type.defaultProps)var be=$.type.defaultProps;for(Be in H)W.call(H,Be)&&!X.hasOwnProperty(Be)&&(Se[Be]=H[Be]===void 0&&be!==void 0?be[Be]:H[Be])}var Be=arguments.length-2;if(Be===1)Se.children=we;else if(1<Be){be=Array(Be);for(var ke=0;ke<Be;ke++)be[ke]=arguments[ke+2];Se.children=be}return{$$typeof:t,type:$.type,key:Me,ref:$e,props:Se,_owner:Ae}},ht.createContext=function($){return $={$$typeof:d,_currentValue:$,_currentValue2:$,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},$.Provider={$$typeof:f,_context:$},$.Consumer=$},ht.createElement=fe,ht.createFactory=function($){var H=fe.bind(null,$);return H.type=$,H},ht.createRef=function(){return{current:null}},ht.forwardRef=function($){return{$$typeof:m,render:$}},ht.isValidElement=_e,ht.lazy=function($){return{$$typeof:k,_payload:{_status:-1,_result:$},_init:Q}},ht.memo=function($,H){return{$$typeof:w,type:$,compare:H===void 0?null:H}},ht.startTransition=function($){var H=z.transition;z.transition={};try{$()}finally{z.transition=H}},ht.unstable_act=F,ht.useCallback=function($,H){return ie.current.useCallback($,H)},ht.useContext=function($){return ie.current.useContext($)},ht.useDebugValue=function(){},ht.useDeferredValue=function($){return ie.current.useDeferredValue($)},ht.useEffect=function($,H){return ie.current.useEffect($,H)},ht.useId=function(){return ie.current.useId()},ht.useImperativeHandle=function($,H,we){return ie.current.useImperativeHandle($,H,we)},ht.useInsertionEffect=function($,H){return ie.current.useInsertionEffect($,H)},ht.useLayoutEffect=function($,H){return ie.current.useLayoutEffect($,H)},ht.useMemo=function($,H){return ie.current.useMemo($,H)},ht.useReducer=function($,H,we){return ie.current.useReducer($,H,we)},ht.useRef=function($){return ie.current.useRef($)},ht.useState=function($){return ie.current.useState($)},ht.useSyncExternalStore=function($,H,we){return ie.current.useSyncExternalStore($,H,we)},ht.useTransition=function(){return ie.current.useTransition()},ht.version="18.3.1",ht}var Kh;function $a(){return Kh||(Kh=1,Gc.exports=sy()),Gc.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 qh;function ay(){if(qh)return ya;qh=1;var t=$a(),r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,u=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function d(m,v,w){var k,x={},S=null,C=null;w!==void 0&&(S=""+w),v.key!==void 0&&(S=""+v.key),v.ref!==void 0&&(C=v.ref);for(k in v)s.call(v,k)&&!f.hasOwnProperty(k)&&(x[k]=v[k]);if(m&&m.defaultProps)for(k in v=m.defaultProps,v)x[k]===void 0&&(x[k]=v[k]);return{$$typeof:r,type:m,key:S,ref:C,props:x,_owner:u.current}}return ya.Fragment=i,ya.jsx=d,ya.jsxs=d,ya}var Wh;function ly(){return Wh||(Wh=1,Qc.exports=ay()),Qc.exports}var b=ly(),ee=$a();const mm=xu(ee);var Vl={},Jc={exports:{}},Fn={},Zc={exports:{}},ef={};/**
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 Yh;function uy(){return Yh||(Yh=1,(function(t){function r(z,K){var F=z.length;z.push(K);e:for(;0<F;){var $=F-1>>>1,H=z[$];if(0<u(H,K))z[$]=K,z[F]=H,F=$;else break e}}function i(z){return z.length===0?null:z[0]}function s(z){if(z.length===0)return null;var K=z[0],F=z.pop();if(F!==K){z[0]=F;e:for(var $=0,H=z.length,we=H>>>1;$<we;){var Se=2*($+1)-1,Me=z[Se],$e=Se+1,Ae=z[$e];if(0>u(Me,F))$e<H&&0>u(Ae,Me)?(z[$]=Ae,z[$e]=F,$=$e):(z[$]=Me,z[Se]=F,$=Se);else if($e<H&&0>u(Ae,F))z[$]=Ae,z[$e]=F,$=$e;else break e}}return K}function u(z,K){var F=z.sortIndex-K.sortIndex;return F!==0?F:z.id-K.id}if(typeof performance=="object"&&typeof performance.now=="function"){var f=performance;t.unstable_now=function(){return f.now()}}else{var d=Date,m=d.now();t.unstable_now=function(){return d.now()-m}}var v=[],w=[],k=1,x=null,S=3,C=!1,j=!1,T=!1,I=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,V=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(z){for(var K=i(w);K!==null;){if(K.callback===null)s(w);else if(K.startTime<=z)s(w),K.sortIndex=K.expirationTime,r(v,K);else break;K=i(w)}}function R(z){if(T=!1,P(z),!j)if(i(v)!==null)j=!0,Q(W);else{var K=i(w);K!==null&&ie(R,K.startTime-z)}}function W(z,K){j=!1,T&&(T=!1,A(fe),fe=-1),C=!0;var F=S;try{for(P(K),x=i(v);x!==null&&(!(x.expirationTime>K)||z&&!U());){var $=x.callback;if(typeof $=="function"){x.callback=null,S=x.priorityLevel;var H=$(x.expirationTime<=K);K=t.unstable_now(),typeof H=="function"?x.callback=H:x===i(v)&&s(v),P(K)}else s(v);x=i(v)}if(x!==null)var we=!0;else{var Se=i(w);Se!==null&&ie(R,Se.startTime-K),we=!1}return we}finally{x=null,S=F,C=!1}}var B=!1,X=null,fe=-1,pe=5,_e=-1;function U(){return!(t.unstable_now()-_e<pe)}function ce(){if(X!==null){var z=t.unstable_now();_e=z;var K=!0;try{K=X(!0,z)}finally{K?xe():(B=!1,X=null)}}else B=!1}var xe;if(typeof V=="function")xe=function(){V(ce)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,le=D.port2;D.port1.onmessage=ce,xe=function(){le.postMessage(null)}}else xe=function(){I(ce,0)};function Q(z){X=z,B||(B=!0,xe())}function ie(z,K){fe=I(function(){z(t.unstable_now())},K)}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,Q(W))},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"):pe=0<z?Math.floor(1e3/z):5},t.unstable_getCurrentPriorityLevel=function(){return S},t.unstable_getFirstCallbackNode=function(){return i(v)},t.unstable_next=function(z){switch(S){case 1:case 2:case 3:var K=3;break;default:K=S}var F=S;S=K;try{return z()}finally{S=F}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(z,K){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var F=S;S=z;try{return K()}finally{S=F}},t.unstable_scheduleCallback=function(z,K,F){var $=t.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?$+F:$):F=$,z){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=F+H,z={id:k++,callback:K,priorityLevel:z,startTime:F,expirationTime:H,sortIndex:-1},F>$?(z.sortIndex=F,r(w,z),i(v)===null&&z===i(w)&&(T?(A(fe),fe=-1):T=!0,ie(R,F-$))):(z.sortIndex=H,r(v,z),j||C||(j=!0,Q(W))),z},t.unstable_shouldYield=U,t.unstable_wrapCallback=function(z){var K=S;return function(){var F=S;S=K;try{return z.apply(this,arguments)}finally{S=F}}}})(ef)),ef}var Xh;function cy(){return Xh||(Xh=1,Zc.exports=uy()),Zc.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 Qh;function fy(){if(Qh)return Fn;Qh=1;var t=$a(),r=cy();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,u={};function f(e,n){d(e,n),d(e+"Capture",n)}function d(e,n){for(u[e]=n,e=0;e<n.length;e++)s.add(n[e])}var m=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),v=Object.prototype.hasOwnProperty,w=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,k={},x={};function S(e){return v.call(x,e)?!0:v.call(k,e)?!1:w.test(e)?x[e]=!0:(k[e]=!0,!1)}function C(e,n,o,l){if(o!==null&&o.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return l?!1:o!==null?!o.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function j(e,n,o,l){if(n===null||typeof n>"u"||C(e,n,o,l))return!0;if(l)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 T(e,n,o,l,h,g,E){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=l,this.attributeNamespace=h,this.mustUseProperty=o,this.propertyName=e,this.type=n,this.sanitizeURL=g,this.removeEmptyString=E}var I={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){I[e]=new T(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];I[n]=new T(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){I[e]=new T(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){I[e]=new T(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){I[e]=new T(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){I[e]=new T(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){I[e]=new T(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){I[e]=new T(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){I[e]=new T(e,5,!1,e.toLowerCase(),null,!1,!1)});var A=/[\-:]([a-z])/g;function V(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(A,V);I[n]=new T(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(A,V);I[n]=new T(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(A,V);I[n]=new T(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){I[e]=new T(e,1,!1,e.toLowerCase(),null,!1,!1)}),I.xlinkHref=new T("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){I[e]=new T(e,1,!1,e.toLowerCase(),null,!0,!0)});function P(e,n,o,l){var h=I.hasOwnProperty(n)?I[n]:null;(h!==null?h.type!==0:l||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(j(n,o,h,l)&&(o=null),l||h===null?S(n)&&(o===null?e.removeAttribute(n):e.setAttribute(n,""+o)):h.mustUseProperty?e[h.propertyName]=o===null?h.type===3?!1:"":o:(n=h.attributeName,l=h.attributeNamespace,o===null?e.removeAttribute(n):(h=h.type,o=h===3||h===4&&o===!0?"":""+o,l?e.setAttributeNS(l,n,o):e.setAttribute(n,o))))}var R=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,W=Symbol.for("react.element"),B=Symbol.for("react.portal"),X=Symbol.for("react.fragment"),fe=Symbol.for("react.strict_mode"),pe=Symbol.for("react.profiler"),_e=Symbol.for("react.provider"),U=Symbol.for("react.context"),ce=Symbol.for("react.forward_ref"),xe=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),ie=Symbol.for("react.offscreen"),z=Symbol.iterator;function K(e){return e===null||typeof e!="object"?null:(e=z&&e[z]||e["@@iterator"],typeof e=="function"?e:null)}var F=Object.assign,$;function H(e){if($===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);$=n&&n[1]||""}return`
34
+ `+$+e}var we=!1;function Se(e,n){if(!e||we)return"";we=!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 l=ye}Reflect.construct(e,[],n)}else{try{n.call()}catch(ye){l=ye}e.call(n.prototype)}else{try{throw Error()}catch(ye){l=ye}e()}}catch(ye){if(ye&&l&&typeof ye.stack=="string"){for(var h=ye.stack.split(`
35
+ `),g=l.stack.split(`
36
+ `),E=h.length-1,L=g.length-1;1<=E&&0<=L&&h[E]!==g[L];)L--;for(;1<=E&&0<=L;E--,L--)if(h[E]!==g[L]){if(E!==1||L!==1)do if(E--,L--,0>L||h[E]!==g[L]){var Y=`
37
+ `+h[E].replace(" at new "," at ");return e.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",e.displayName)),Y}while(1<=E&&0<=L);break}}}finally{we=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?H(e):""}function Me(e){switch(e.tag){case 5:return H(e.type);case 16:return H("Lazy");case 13:return H("Suspense");case 19:return H("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 $e(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 X:return"Fragment";case B:return"Portal";case pe:return"Profiler";case fe:return"StrictMode";case xe:return"Suspense";case D:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case U:return(e.displayName||"Context")+".Consumer";case _e:return(e._context.displayName||"Context")+".Provider";case ce: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:$e(e.type)||"Memo";case Q:n=e._payload,e=e._init;try{return $e(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 $e(n);case 8:return n===fe?"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 be(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Be(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ke(e){var n=Be(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),l=""+e[n];if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var h=o.get,g=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return h.call(this)},set:function(E){l=""+E,g.call(this,E)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return l},setValue:function(E){l=""+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(),l="";return e&&(l=Be(e)?e.checked?"true":"false":e.value),e=l,e!==o?(n.setValue(e),!0):!1}function qe(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 ut(e,n){var o=n.checked;return F({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??e._wrapperState.initialChecked})}function ct(e,n){var o=n.defaultValue==null?"":n.defaultValue,l=n.checked!=null?n.checked:n.defaultChecked;o=be(n.value!=null?n.value:o),e._wrapperState={initialChecked:l,initialValue:o,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function it(e,n){n=n.checked,n!=null&&P(e,"checked",n,!1)}function Tt(e,n){it(e,n);var o=be(n.value),l=n.type;if(o!=null)l==="number"?(o===0&&e.value===""||e.value!=o)&&(e.value=""+o):e.value!==""+o&&(e.value=""+o);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?Ht(e,n.type,o):n.hasOwnProperty("defaultValue")&&Ht(e,n.type,be(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function _t(e,n,o){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var l=n.type;if(!(l!=="submit"&&l!=="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 Ht(e,n,o){(n!=="number"||qe(e.ownerDocument)!==e)&&(o==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+o&&(e.defaultValue=""+o))}var Ot=Array.isArray;function St(e,n,o,l){if(e=e.options,n){n={};for(var h=0;h<o.length;h++)n["$"+o[h]]=!0;for(o=0;o<e.length;o++)h=n.hasOwnProperty("$"+e[o].value),e[o].selected!==h&&(e[o].selected=h),h&&l&&(e[o].defaultSelected=!0)}else{for(o=""+be(o),n=null,h=0;h<e.length;h++){if(e[h].value===o){e[h].selected=!0,l&&(e[h].defaultSelected=!0);return}n!==null||e[h].disabled||(n=e[h])}n!==null&&(n.selected=!0)}}function wn(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(Ot(o)){if(1<o.length)throw Error(i(93));o=o[0]}n=o}n==null&&(n=""),o=n}e._wrapperState={initialValue:be(o)}}function gr(e,n){var o=be(n.value),l=be(n.defaultValue);o!=null&&(o=""+o,o!==e.value&&(e.value=o),n.defaultValue==null&&e.defaultValue!==o&&(e.defaultValue=o)),l!=null&&(e.defaultValue=""+l)}function bn(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function Nt(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 Vt(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?Nt(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Hn,tr=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,o,l,h){MSApp.execUnsafeLocalFunction(function(){return e(n,o,l,h)})}:e})(function(e,n){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=n;else{for(Hn=Hn||document.createElement("div"),Hn.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=Hn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function _n(e,n){if(n){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=n;return}}e.textContent=n}var Pn={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},Vn=["Webkit","ms","Moz","O"];Object.keys(Pn).forEach(function(e){Vn.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),Pn[n]=Pn[e]})});function dn(e,n,o){return n==null||typeof n=="boolean"||n===""?"":o||typeof n!="number"||n===0||Pn.hasOwnProperty(e)&&Pn[e]?(""+n).trim():n+"px"}function nr(e,n){e=e.style;for(var o in n)if(n.hasOwnProperty(o)){var l=o.indexOf("--")===0,h=dn(o,n[o],l);o==="float"&&(o="cssFloat"),l?e.setProperty(o,h):e[o]=h}}var Sn=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(Sn[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 Un(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 kn=null;function rr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ve=null,Mn=null,Kn=null;function yr(e){if(e=ta(e)){if(typeof Ve!="function")throw Error(i(280));var n=e.stateNode;n&&(n=ol(n),Ve(e.stateNode,e.type,n))}}function Zr(e){Mn?Kn?Kn.push(e):Kn=[e]:Mn=e}function vr(){if(Mn){var e=Mn,n=Kn;if(Kn=Mn=null,yr(e),n)for(e=0;e<n.length;e++)yr(n[e])}}function Io(e,n){return e(n)}function eo(){}var Nn=!1;function Tn(e,n,o){if(Nn)return e(n,o);Nn=!0;try{return Io(e,n,o)}finally{Nn=!1,(Mn!==null||Kn!==null)&&(eo(),vr())}}function q(e,n){var o=e.stateNode;if(o===null)return null;var l=ol(o);if(l===null)return null;o=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(o&&typeof o!="function")throw Error(i(231,n,typeof o));return o}var Fe=!1;if(m)try{var Le={};Object.defineProperty(Le,"passive",{get:function(){Fe=!0}}),window.addEventListener("test",Le,Le),window.removeEventListener("test",Le,Le)}catch{Fe=!1}function nt(e,n,o,l,h,g,E,L,Y){var ye=Array.prototype.slice.call(arguments,3);try{n.apply(o,ye)}catch(Pe){this.onError(Pe)}}var nn=!1,Yt=null,Ut=!1,rn=null,to={onError:function(e){nn=!0,Yt=e}};function on(e,n,o,l,h,g,E,L,Y){nn=!1,Yt=null,nt.apply(to,arguments)}function qn(e,n,o,l,h,g,E,L,Y){if(on.apply(this,arguments),nn){if(nn){var ye=Yt;nn=!1,Yt=null}else throw Error(i(198));Ut||(Ut=!0,rn=ye)}}function zt(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 Wn(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 or(e){if(zt(e)!==e)throw Error(i(188))}function In(e){var n=e.alternate;if(!n){if(n=zt(e),n===null)throw Error(i(188));return n!==e?null:e}for(var o=e,l=n;;){var h=o.return;if(h===null)break;var g=h.alternate;if(g===null){if(l=h.return,l!==null){o=l;continue}break}if(h.child===g.child){for(g=h.child;g;){if(g===o)return or(h),e;if(g===l)return or(h),n;g=g.sibling}throw Error(i(188))}if(o.return!==l.return)o=h,l=g;else{for(var E=!1,L=h.child;L;){if(L===o){E=!0,o=h,l=g;break}if(L===l){E=!0,l=h,o=g;break}L=L.sibling}if(!E){for(L=g.child;L;){if(L===o){E=!0,o=g,l=h;break}if(L===l){E=!0,l=g,o=h;break}L=L.sibling}if(!E)throw Error(i(189))}}if(o.alternate!==l)throw Error(i(190))}if(o.tag!==3)throw Error(i(188));return o.stateNode.current===o?e:n}function ui(e){return e=In(e),e!==null?ir(e):null}function ir(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=ir(e);if(n!==null)return n;e=e.sibling}return null}var ci=r.unstable_scheduleCallback,$o=r.unstable_cancelCallback,Et=r.unstable_shouldYield,sr=r.unstable_requestPaint,gt=r.unstable_now,Bi=r.unstable_getCurrentPriorityLevel,Dr=r.unstable_ImmediatePriority,Ao=r.unstable_UserBlockingPriority,Lr=r.unstable_NormalPriority,xr=r.unstable_LowPriority,fi=r.unstable_IdlePriority,ar=null,En=null;function ft(e){if(En&&typeof En.onCommitFiberRoot=="function")try{En.onCommitFiberRoot(ar,e,void 0,(e.current.flags&128)===128)}catch{}}var hn=Math.clz32?Math.clz32:no,Hi=Math.log,Oo=Math.LN2;function no(e){return e>>>=0,e===0?32:31-(Hi(e)/Oo|0)|0}var ro=64,oo=4194304;function Yn(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 yt(e,n){var o=e.pendingLanes;if(o===0)return 0;var l=0,h=e.suspendedLanes,g=e.pingedLanes,E=o&268435455;if(E!==0){var L=E&~h;L!==0?l=Yn(L):(g&=E,g!==0&&(l=Yn(g)))}else E=o&~h,E!==0?l=Yn(E):g!==0&&(l=Yn(g));if(l===0)return 0;if(n!==0&&n!==l&&(n&h)===0&&(h=l&-l,g=n&-n,h>=g||h===16&&(g&4194240)!==0))return n;if((l&4)!==0&&(l|=o&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=l;0<n;)o=31-hn(n),h=1<<o,l|=e[o],n&=~h;return l}function zr(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 io(e,n){for(var o=e.suspendedLanes,l=e.pingedLanes,h=e.expirationTimes,g=e.pendingLanes;0<g;){var E=31-hn(g),L=1<<E,Y=h[E];Y===-1?((L&o)===0||(L&l)!==0)&&(h[E]=zr(L,n)):Y<=n&&(e.expiredLanes|=L),g&=~L}}function lr(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Fr(){var e=ro;return ro<<=1,(ro&4194240)===0&&(ro=64),e}function so(e){for(var n=[],o=0;31>o;o++)n.push(e);return n}function ur(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 di(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 l=e.eventTimes;for(e=e.expirationTimes;0<o;){var h=31-hn(o),g=1<<h;n[h]=0,l[h]=-1,e[h]=-1,o&=~g}}function Ro(e,n){var o=e.entangledLanes|=n;for(e=e.entanglements;o;){var l=31-hn(o),h=1<<l;h&n|e[l]&n&&(e[l]|=n),o&=~h}}var xt=0;function Ba(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var pt,Vi,Ha,Va,pn,Br=!1,ao=[],sn=null,wr=null,br=null,It=new Map,an=new Map,$n=[],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":wr=null;break;case"mouseover":case"mouseout":br=null;break;case"pointerover":case"pointerout":It.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":an.delete(n.pointerId)}}function An(e,n,o,l,h,g){return e===null||e.nativeEvent!==g?(e={blockedOn:n,domEventName:o,eventSystemFlags:l,nativeEvent:g,targetContainers:[h]},n!==null&&(n=ta(n),n!==null&&Vi(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,h!==null&&n.indexOf(h)===-1&&n.push(h),e)}function Au(e,n,o,l,h){switch(n){case"focusin":return sn=An(sn,e,n,o,l,h),!0;case"dragenter":return wr=An(wr,e,n,o,l,h),!0;case"mouseover":return br=An(br,e,n,o,l,h),!0;case"pointerover":var g=h.pointerId;return It.set(g,An(It.get(g)||null,e,n,o,l,h)),!0;case"gotpointercapture":return g=h.pointerId,an.set(g,An(an.get(g)||null,e,n,o,l,h)),!0}return!1}function Xn(e){var n=bi(e.target);if(n!==null){var o=zt(n);if(o!==null){if(n=o.tag,n===13){if(n=Wn(o),n!==null){e.blockedOn=n,pn(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 Do(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var o=Lo(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(o===null){o=e.nativeEvent;var l=new o.constructor(o.type,o);kn=l,o.target.dispatchEvent(l),kn=null}else return n=ta(o),n!==null&&Vi(n),e.blockedOn=o,!1;n.shift()}return!0}function Ds(e,n,o){Do(e)&&o.delete(n)}function Ls(){Br=!1,sn!==null&&Do(sn)&&(sn=null),wr!==null&&Do(wr)&&(wr=null),br!==null&&Do(br)&&(br=null),It.forEach(Ds),an.forEach(Ds)}function _r(e,n){e.blockedOn===n&&(e.blockedOn=null,Br||(Br=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Ls)))}function lo(e){function n(h){return _r(h,e)}if(0<ao.length){_r(ao[0],e);for(var o=1;o<ao.length;o++){var l=ao[o];l.blockedOn===e&&(l.blockedOn=null)}}for(sn!==null&&_r(sn,e),wr!==null&&_r(wr,e),br!==null&&_r(br,e),It.forEach(n),an.forEach(n),o=0;o<$n.length;o++)l=$n[o],l.blockedOn===e&&(l.blockedOn=null);for(;0<$n.length&&(o=$n[0],o.blockedOn===null);)Xn(o),o.blockedOn===null&&$n.shift()}var uo=R.ReactCurrentBatchConfig,Ki=!0;function pi(e,n,o,l){var h=xt,g=uo.transition;uo.transition=null;try{xt=1,zs(e,n,o,l)}finally{xt=h,uo.transition=g}}function Ou(e,n,o,l){var h=xt,g=uo.transition;uo.transition=null;try{xt=4,zs(e,n,o,l)}finally{xt=h,uo.transition=g}}function zs(e,n,o,l){if(Ki){var h=Lo(e,n,o,l);if(h===null)Fu(e,n,l,co,o),Ui(e,l);else if(Au(h,e,n,o,l))l.stopPropagation();else if(Ui(e,l),n&4&&-1<hi.indexOf(e)){for(;h!==null;){var g=ta(h);if(g!==null&&pt(g),g=Lo(e,n,o,l),g===null&&Fu(e,n,l,co,o),g===h)break;h=g}h!==null&&l.stopPropagation()}else Fu(e,n,l,null,o)}}var co=null;function Lo(e,n,o,l){if(co=null,e=rr(l),e=bi(e),e!==null)if(n=zt(e),n===null)e=null;else if(o=n.tag,o===13){if(e=Wn(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 co=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(Bi()){case Dr:return 1;case Ao:return 4;case Lr:case xr:return 16;case fi:return 536870912;default:return 16}default:return 16}}var Hr=null,Fs=null,Wi=null;function Yi(){if(Wi)return Wi;var e,n=Fs,o=n.length,l,h="value"in Hr?Hr.value:Hr.textContent,g=h.length;for(e=0;e<o&&n[e]===h[e];e++);var E=o-e;for(l=1;l<=E&&n[o-l]===h[g-l];l++);return Wi=h.slice(e,1<l?1-l:void 0)}function zo(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 mi(){return!0}function gi(){return!1}function Gt(e){function n(o,l,h,g,E){this._reactName=o,this._targetInst=h,this.type=l,this.nativeEvent=g,this.target=E,this.currentTarget=null;for(var L in e)e.hasOwnProperty(L)&&(o=e[L],this[L]=o?o(g):g[L]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?mi:gi,this.isPropagationStopped=gi,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=mi)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=mi)},persist:function(){},isPersistent:mi}),n}var Sr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xi=Gt(Sr),yi=F({},Sr,{view:0,detail:0}),Fo=Gt(yi),fo,vi,ho,Bo=F({},yi,{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!==ho&&(ho&&e.type==="mousemove"?(fo=e.screenX-ho.screenX,vi=e.screenY-ho.screenY):vi=fo=0,ho=e),fo)},movementY:function(e){return"movementY"in e?e.movementY:vi}}),Qi=Gt(Bo),Jt=F({},Bo,{dataTransfer:0}),xi=Gt(Jt),wi=F({},yi,{relatedTarget:0}),Gi=Gt(wi),Ji=F({},Sr,{animationName:0,elapsedTime:0,pseudoElement:0}),Ua=Gt(Ji),Ka=F({},Sr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Zi=Gt(Ka),Bs=F({},Sr,{data:0}),Vr=Gt(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 Ru=F({},yi,{key:function(e){if(e.key){var n=Hs[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=zo(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"?zo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?zo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ks=Gt(Ru),ns=F({},Bo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qa=Gt(ns),qs=F({},yi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ts}),Ws=Gt(qs),Du=F({},Sr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Wa=Gt(Du),Lu=F({},Bo,{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=Gt(Lu),Xa=[9,13,27,32],Ys=m&&"CompositionEvent"in window,Ho=null;m&&"documentMode"in document&&(Ho=document.documentMode);var Xs=m&&"TextEvent"in window&&!Ho,Qs=m&&(!Ys||Ho&&8<Ho&&11>=Ho),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 kr=!1;function Nr(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 Rt(e,n){if(kr)return e==="compositionend"||!Ys&&Ga(e,n)?(e=Yi(),Wi=Fs=Hr=null,kr=!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 po(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!rs[e.type]:n==="textarea"}function Za(e,n,o,l){Zr(l),n=tl(n,"onChange"),0<n.length&&(o=new Xi("onChange","change",null,o,l),e.push({event:o,listeners:n}))}var mo=null,Vo=null;function go(e){sd(e,0)}function Uo(e){var n=as(e);if(Oe(n))return e}function Ko(e,n){if(e==="change")return n}var Er=!1;if(m){var os;if(m){var a="oninput"in document;if(!a){var c=document.createElement("div");c.setAttribute("oninput","return;"),a=typeof c.oninput=="function"}os=a}else os=!1;Er=os&&(!document.documentMode||9<document.documentMode)}function p(){mo&&(mo.detachEvent("onpropertychange",y),Vo=mo=null)}function y(e){if(e.propertyName==="value"&&Uo(Vo)){var n=[];Za(n,Vo,e,rr(e)),Tn(go,n)}}function _(e,n,o){e==="focusin"?(p(),mo=n,Vo=o,mo.attachEvent("onpropertychange",y)):e==="focusout"&&p()}function N(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Uo(Vo)}function M(e,n){if(e==="click")return Uo(n)}function O(e,n){if(e==="input"||e==="change")return Uo(n)}function J(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var ue=typeof Object.is=="function"?Object.is:J;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),l=Object.keys(n);if(o.length!==l.length)return!1;for(l=0;l<o.length;l++){var h=o[l];if(!v.call(n,h)||!ue(e[h],n[h]))return!1}return!0}function G(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Z(e,n){var o=G(e);e=0;for(var l;o;){if(o.nodeType===3){if(l=e+o.textContent.length,e<=n&&l>=n)return{node:o,offset:n-e};e=l}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=G(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=qe();n instanceof e.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)e=n.contentWindow;else break;n=qe(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,l=e.selectionRange;if(n!==o&&o&&o.ownerDocument&&ae(o.ownerDocument.documentElement,o)){if(l!==null&&re(o)){if(n=l.start,e=l.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 h=o.textContent.length,g=Math.min(l.start,h);l=l.end===void 0?g:Math.min(l.end,h),!e.extend&&g>l&&(h=l,l=g,g=h),h=Z(o,g);var E=Z(o,l);h&&E&&(e.rangeCount!==1||e.anchorNode!==h.node||e.anchorOffset!==h.offset||e.focusNode!==E.node||e.focusOffset!==E.offset)&&(n=n.createRange(),n.setStart(h.node,h.offset),e.removeAllRanges(),g>l?(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=m&&"documentMode"in document&&11>=document.documentMode,de=null,ve=null,Ne=null,Ce=!1;function De(e,n,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Ce||de==null||de!==qe(l)||(l=de,"selectionStart"in l&&re(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ne&&te(Ne,l)||(Ne=l,l=tl(ve,"onSelect"),0<l.length&&(n=new Xi("onSelect","select",null,n,o),e.push({event:n,listeners:l}),n.target=de)))}function Te(e,n){var o={};return o[e.toLowerCase()]=n.toLowerCase(),o["Webkit"+e]="webkit"+n,o["Moz"+e]="moz"+n,o}var Ue={animationend:Te("Animation","AnimationEnd"),animationiteration:Te("Animation","AnimationIteration"),animationstart:Te("Animation","AnimationStart"),transitionend:Te("Transition","TransitionEnd")},Re={},We={};m&&(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 rt=Ee("animationend"),ot=Ee("animationiteration"),lt=Ee("animationstart"),dt=Ee("transitionend"),mn=new Map,at="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 Ct(e,n){mn.set(e,n),f(n,[e])}for(var Kt=0;Kt<at.length;Kt++){var qo=at[Kt],ln=qo.toLowerCase(),yo=qo[0].toUpperCase()+qo.slice(1);Ct(ln,"on"+yo)}Ct(rt,"onAnimationEnd"),Ct(ot,"onAnimationIteration"),Ct(lt,"onAnimationStart"),Ct("dblclick","onDoubleClick"),Ct("focusin","onFocus"),Ct("focusout","onBlur"),Ct(dt,"onTransitionEnd"),d("onMouseEnter",["mouseout","mouseover"]),d("onMouseLeave",["mouseout","mouseover"]),d("onPointerEnter",["pointerout","pointerover"]),d("onPointerLeave",["pointerout","pointerover"]),f("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),f("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),f("onBeforeInput",["compositionend","keypress","textInput","paste"]),f("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vo="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(" "),p0=new Set("cancel close invalid load scroll toggle".split(" ").concat(vo));function id(e,n,o){var l=e.type||"unknown-event";e.currentTarget=o,qn(l,n,void 0,e),e.currentTarget=null}function sd(e,n){n=(n&4)!==0;for(var o=0;o<e.length;o++){var l=e[o],h=l.event;l=l.listeners;e:{var g=void 0;if(n)for(var E=l.length-1;0<=E;E--){var L=l[E],Y=L.instance,ye=L.currentTarget;if(L=L.listener,Y!==g&&h.isPropagationStopped())break e;id(h,L,ye),g=Y}else for(E=0;E<l.length;E++){if(L=l[E],Y=L.instance,ye=L.currentTarget,L=L.listener,Y!==g&&h.isPropagationStopped())break e;id(h,L,ye),g=Y}}}if(Ut)throw e=rn,Ut=!1,rn=null,e}function jt(e,n){var o=n[qu];o===void 0&&(o=n[qu]=new Set);var l=e+"__bubble";o.has(l)||(ad(n,e,2,!1),o.add(l))}function zu(e,n,o){var l=0;n&&(l|=4),ad(o,e,l,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"&&(p0.has(o)||zu(o,!1,e),zu(o,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[el]||(n[el]=!0,zu("selectionchange",!1,n))}}function ad(e,n,o,l){switch(qi(n)){case 1:var h=pi;break;case 4:h=Ou;break;default:h=zs}o=h.bind(null,n,o,e),h=void 0,!Fe||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(h=!0),l?h!==void 0?e.addEventListener(n,o,{capture:!0,passive:h}):e.addEventListener(n,o,!0):h!==void 0?e.addEventListener(n,o,{passive:h}):e.addEventListener(n,o,!1)}function Fu(e,n,o,l,h){var g=l;if((n&1)===0&&(n&2)===0&&l!==null)e:for(;;){if(l===null)return;var E=l.tag;if(E===3||E===4){var L=l.stateNode.containerInfo;if(L===h||L.nodeType===8&&L.parentNode===h)break;if(E===4)for(E=l.return;E!==null;){var Y=E.tag;if((Y===3||Y===4)&&(Y=E.stateNode.containerInfo,Y===h||Y.nodeType===8&&Y.parentNode===h))return;E=E.return}for(;L!==null;){if(E=bi(L),E===null)return;if(Y=E.tag,Y===5||Y===6){l=g=E;continue e}L=L.parentNode}}l=l.return}Tn(function(){var ye=g,Pe=rr(o),Ie=[];e:{var je=mn.get(e);if(je!==void 0){var Ke=Xi,Qe=e;switch(e){case"keypress":if(zo(o)===0)break e;case"keydown":case"keyup":Ke=Ks;break;case"focusin":Qe="focus",Ke=Gi;break;case"focusout":Qe="blur",Ke=Gi;break;case"beforeblur":case"afterblur":Ke=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":Ke=Qi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ke=xi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ke=Ws;break;case rt:case ot:case lt:Ke=Ua;break;case dt:Ke=Wa;break;case"scroll":Ke=Fo;break;case"wheel":Ke=Ya;break;case"copy":case"cut":case"paste":Ke=Zi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ke=qa}var Ge=(n&4)!==0,Bt=!Ge&&e==="scroll",he=Ge?je!==null?je+"Capture":null:je;Ge=[];for(var ne=ye,me;ne!==null;){me=ne;var ze=me.stateNode;if(me.tag===5&&ze!==null&&(me=ze,he!==null&&(ze=q(ne,he),ze!=null&&Ge.push(Zs(ne,ze,me)))),Bt)break;ne=ne.return}0<Ge.length&&(je=new Ke(je,Qe,null,o,Pe),Ie.push({event:je,listeners:Ge}))}}if((n&7)===0){e:{if(je=e==="mouseover"||e==="pointerover",Ke=e==="mouseout"||e==="pointerout",je&&o!==kn&&(Qe=o.relatedTarget||o.fromElement)&&(bi(Qe)||Qe[xo]))break e;if((Ke||je)&&(je=Pe.window===Pe?Pe:(je=Pe.ownerDocument)?je.defaultView||je.parentWindow:window,Ke?(Qe=o.relatedTarget||o.toElement,Ke=ye,Qe=Qe?bi(Qe):null,Qe!==null&&(Bt=zt(Qe),Qe!==Bt||Qe.tag!==5&&Qe.tag!==6)&&(Qe=null)):(Ke=null,Qe=ye),Ke!==Qe)){if(Ge=Qi,ze="onMouseLeave",he="onMouseEnter",ne="mouse",(e==="pointerout"||e==="pointerover")&&(Ge=qa,ze="onPointerLeave",he="onPointerEnter",ne="pointer"),Bt=Ke==null?je:as(Ke),me=Qe==null?je:as(Qe),je=new Ge(ze,ne+"leave",Ke,o,Pe),je.target=Bt,je.relatedTarget=me,ze=null,bi(Pe)===ye&&(Ge=new Ge(he,ne+"enter",Qe,o,Pe),Ge.target=me,Ge.relatedTarget=Bt,ze=Ge),Bt=ze,Ke&&Qe)t:{for(Ge=Ke,he=Qe,ne=0,me=Ge;me;me=is(me))ne++;for(me=0,ze=he;ze;ze=is(ze))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;Ke!==null&&ld(Ie,je,Ke,Ge,!1),Qe!==null&&Bt!==null&&ld(Ie,Bt,Qe,Ge,!0)}}e:{if(je=ye?as(ye):window,Ke=je.nodeName&&je.nodeName.toLowerCase(),Ke==="select"||Ke==="input"&&je.type==="file")var Je=Ko;else if(po(je))if(Er)Je=O;else{Je=N;var et=_}else(Ke=je.nodeName)&&Ke.toLowerCase()==="input"&&(je.type==="checkbox"||je.type==="radio")&&(Je=M);if(Je&&(Je=Je(e,ye))){Za(Ie,Je,o,Pe);break e}et&&et(e,je,ye),e==="focusout"&&(et=je._wrapperState)&&et.controlled&&je.type==="number"&&Ht(je,"number",je.value)}switch(et=ye?as(ye):window,e){case"focusin":(po(et)||et.contentEditable==="true")&&(de=et,ve=ye,Ne=null);break;case"focusout":Ne=ve=de=null;break;case"mousedown":Ce=!0;break;case"contextmenu":case"mouseup":case"dragend":Ce=!1,De(Ie,o,Pe);break;case"selectionchange":if(ge)break;case"keydown":case"keyup":De(Ie,o,Pe)}var tt;if(Ys)e:{switch(e){case"compositionstart":var st="onCompositionStart";break e;case"compositionend":st="onCompositionEnd";break e;case"compositionupdate":st="onCompositionUpdate";break e}st=void 0}else kr?Ga(e,o)&&(st="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(st="onCompositionStart");st&&(Qs&&o.locale!=="ko"&&(kr||st!=="onCompositionStart"?st==="onCompositionEnd"&&kr&&(tt=Yi()):(Hr=Pe,Fs="value"in Hr?Hr.value:Hr.textContent,kr=!0)),et=tl(ye,st),0<et.length&&(st=new Vr(st,e,null,o,Pe),Ie.push({event:st,listeners:et}),tt?st.data=tt:(tt=Ja(o),tt!==null&&(st.data=tt)))),(tt=Xs?Nr(e,o):Rt(e,o))&&(ye=tl(ye,"onBeforeInput"),0<ye.length&&(Pe=new Vr("onBeforeInput","beforeinput",null,o,Pe),Ie.push({event:Pe,listeners:ye}),Pe.data=tt))}sd(Ie,n)})}function Zs(e,n,o){return{instance:e,listener:n,currentTarget:o}}function tl(e,n){for(var o=n+"Capture",l=[];e!==null;){var h=e,g=h.stateNode;h.tag===5&&g!==null&&(h=g,g=q(e,o),g!=null&&l.unshift(Zs(e,g,h)),g=q(e,n),g!=null&&l.push(Zs(e,g,h))),e=e.return}return l}function is(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ld(e,n,o,l,h){for(var g=n._reactName,E=[];o!==null&&o!==l;){var L=o,Y=L.alternate,ye=L.stateNode;if(Y!==null&&Y===l)break;L.tag===5&&ye!==null&&(L=ye,h?(Y=q(o,g),Y!=null&&E.unshift(Zs(o,Y,L))):h||(Y=q(o,g),Y!=null&&E.push(Zs(o,Y,L)))),o=o.return}E.length!==0&&e.push({event:n,listeners:E})}var m0=/\r\n?/g,g0=/\u0000|\uFFFD/g;function ud(e){return(typeof e=="string"?e:""+e).replace(m0,`
38
+ `).replace(g0,"")}function nl(e,n,o){if(n=ud(n),ud(e)!==n&&o)throw Error(i(425))}function rl(){}var Bu=null,Hu=null;function Vu(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 Uu=typeof setTimeout=="function"?setTimeout:void 0,y0=typeof clearTimeout=="function"?clearTimeout:void 0,cd=typeof Promise=="function"?Promise:void 0,v0=typeof queueMicrotask=="function"?queueMicrotask:typeof cd<"u"?function(e){return cd.resolve(null).then(e).catch(x0)}:Uu;function x0(e){setTimeout(function(){throw e})}function Ku(e,n){var o=n,l=0;do{var h=o.nextSibling;if(e.removeChild(o),h&&h.nodeType===8)if(o=h.data,o==="/$"){if(l===0){e.removeChild(h),lo(n);return}l--}else o!=="$"&&o!=="$?"&&o!=="$!"||l++;o=h}while(o);lo(n)}function Wo(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 fd(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),Ur="__reactFiber$"+ss,ea="__reactProps$"+ss,xo="__reactContainer$"+ss,qu="__reactEvents$"+ss,w0="__reactListeners$"+ss,b0="__reactHandles$"+ss;function bi(e){var n=e[Ur];if(n)return n;for(var o=e.parentNode;o;){if(n=o[xo]||o[Ur]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(e=fd(e);e!==null;){if(o=e[Ur])return o;e=fd(e)}return n}e=o,o=e.parentNode}return null}function ta(e){return e=e[Ur]||e[xo],!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 Wu=[],ls=-1;function Yo(e){return{current:e}}function Pt(e){0>ls||(e.current=Wu[ls],Wu[ls]=null,ls--)}function kt(e,n){ls++,Wu[ls]=e.current,e.current=n}var Xo={},gn=Yo(Xo),On=Yo(!1),_i=Xo;function us(e,n){var o=e.type.contextTypes;if(!o)return Xo;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===n)return l.__reactInternalMemoizedMaskedChildContext;var h={},g;for(g in o)h[g]=n[g];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=h),h}function Rn(e){return e=e.childContextTypes,e!=null}function il(){Pt(On),Pt(gn)}function dd(e,n,o){if(gn.current!==Xo)throw Error(i(168));kt(gn,n),kt(On,o)}function hd(e,n,o){var l=e.stateNode;if(n=n.childContextTypes,typeof l.getChildContext!="function")return o;l=l.getChildContext();for(var h in l)if(!(h in n))throw Error(i(108,Ae(e)||"Unknown",h));return F({},o,l)}function sl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Xo,_i=gn.current,kt(gn,e),kt(On,On.current),!0}function pd(e,n,o){var l=e.stateNode;if(!l)throw Error(i(169));o?(e=hd(e,n,_i),l.__reactInternalMemoizedMergedChildContext=e,Pt(On),Pt(gn),kt(gn,e)):Pt(On),kt(On,o)}var wo=null,al=!1,Yu=!1;function md(e){wo===null?wo=[e]:wo.push(e)}function _0(e){al=!0,md(e)}function Qo(){if(!Yu&&wo!==null){Yu=!0;var e=0,n=xt;try{var o=wo;for(xt=1;e<o.length;e++){var l=o[e];do l=l(!0);while(l!==null)}wo=null,al=!1}catch(h){throw wo!==null&&(wo=wo.slice(e+1)),ci(Dr,Qo),h}finally{xt=n,Yu=!1}}return null}var cs=[],fs=0,ll=null,ul=0,cr=[],fr=0,Si=null,bo=1,_o="";function ki(e,n){cs[fs++]=ul,cs[fs++]=ll,ll=e,ul=n}function gd(e,n,o){cr[fr++]=bo,cr[fr++]=_o,cr[fr++]=Si,Si=e;var l=bo;e=_o;var h=32-hn(l)-1;l&=~(1<<h),o+=1;var g=32-hn(n)+h;if(30<g){var E=h-h%5;g=(l&(1<<E)-1).toString(32),l>>=E,h-=E,bo=1<<32-hn(n)+h|o<<h|l,_o=g+e}else bo=1<<g|o<<h|l,_o=e}function Xu(e){e.return!==null&&(ki(e,1),gd(e,1,0))}function Qu(e){for(;e===ll;)ll=cs[--fs],cs[fs]=null,ul=cs[--fs],cs[fs]=null;for(;e===Si;)Si=cr[--fr],cr[fr]=null,_o=cr[--fr],cr[fr]=null,bo=cr[--fr],cr[fr]=null}var Qn=null,Gn=null,$t=!1,Cr=null;function yd(e,n){var o=mr(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 vd(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,Qn=e,Gn=Wo(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,Qn=e,Gn=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(o=Si!==null?{id:bo,overflow:_o}:null,e.memoizedState={dehydrated:n,treeContext:o,retryLane:1073741824},o=mr(18,null,null,0),o.stateNode=n,o.return=e,e.child=o,Qn=e,Gn=null,!0):!1;default:return!1}}function Gu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ju(e){if($t){var n=Gn;if(n){var o=n;if(!vd(e,n)){if(Gu(e))throw Error(i(418));n=Wo(o.nextSibling);var l=Qn;n&&vd(e,n)?yd(l,o):(e.flags=e.flags&-4097|2,$t=!1,Qn=e)}}else{if(Gu(e))throw Error(i(418));e.flags=e.flags&-4097|2,$t=!1,Qn=e}}}function xd(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Qn=e}function cl(e){if(e!==Qn)return!1;if(!$t)return xd(e),$t=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!Vu(e.type,e.memoizedProps)),n&&(n=Gn)){if(Gu(e))throw wd(),Error(i(418));for(;n;)yd(e,n),n=Wo(n.nextSibling)}if(xd(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){Gn=Wo(e.nextSibling);break e}n--}else o!=="$"&&o!=="$!"&&o!=="$?"||n++}e=e.nextSibling}Gn=null}}else Gn=Qn?Wo(e.stateNode.nextSibling):null;return!0}function wd(){for(var e=Gn;e;)e=Wo(e.nextSibling)}function ds(){Gn=Qn=null,$t=!1}function Zu(e){Cr===null?Cr=[e]:Cr.push(e)}var S0=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 l=o.stateNode}if(!l)throw Error(i(147,e));var h=l,g=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===g?n.ref:(n=function(E){var L=h.refs;E===null?delete L[g]:L[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 bd(e){var n=e._init;return n(e._payload)}function _d(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 l(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 h(he,ne){return he=oi(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 L(he,ne,me,ze){return ne===null||ne.tag!==6?(ne=Uc(me,he.mode,ze),ne.return=he,ne):(ne=h(ne,me),ne.return=he,ne)}function Y(he,ne,me,ze){var Je=me.type;return Je===X?Pe(he,ne,me.props.children,ze,me.key):ne!==null&&(ne.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===Q&&bd(Je)===ne.type)?(ze=h(ne,me.props),ze.ref=na(he,ne,me),ze.return=he,ze):(ze=Ol(me.type,me.key,me.props,null,he.mode,ze),ze.ref=na(he,ne,me),ze.return=he,ze)}function ye(he,ne,me,ze){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==me.containerInfo||ne.stateNode.implementation!==me.implementation?(ne=Kc(me,he.mode,ze),ne.return=he,ne):(ne=h(ne,me.children||[]),ne.return=he,ne)}function Pe(he,ne,me,ze,Je){return ne===null||ne.tag!==7?(ne=Ii(me,he.mode,ze,Je),ne.return=he,ne):(ne=h(ne,me),ne.return=he,ne)}function Ie(he,ne,me){if(typeof ne=="string"&&ne!==""||typeof ne=="number")return ne=Uc(""+ne,he.mode,me),ne.return=he,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case W:return me=Ol(ne.type,ne.key,ne.props,null,he.mode,me),me.ref=na(he,null,ne),me.return=he,me;case B:return ne=Kc(ne,he.mode,me),ne.return=he,ne;case Q:var ze=ne._init;return Ie(he,ze(ne._payload),me)}if(Ot(ne)||K(ne))return ne=Ii(ne,he.mode,me,null),ne.return=he,ne;fl(he,ne)}return null}function je(he,ne,me,ze){var Je=ne!==null?ne.key:null;if(typeof me=="string"&&me!==""||typeof me=="number")return Je!==null?null:L(he,ne,""+me,ze);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case W:return me.key===Je?Y(he,ne,me,ze):null;case B:return me.key===Je?ye(he,ne,me,ze):null;case Q:return Je=me._init,je(he,ne,Je(me._payload),ze)}if(Ot(me)||K(me))return Je!==null?null:Pe(he,ne,me,ze,null);fl(he,me)}return null}function Ke(he,ne,me,ze,Je){if(typeof ze=="string"&&ze!==""||typeof ze=="number")return he=he.get(me)||null,L(ne,he,""+ze,Je);if(typeof ze=="object"&&ze!==null){switch(ze.$$typeof){case W:return he=he.get(ze.key===null?me:ze.key)||null,Y(ne,he,ze,Je);case B:return he=he.get(ze.key===null?me:ze.key)||null,ye(ne,he,ze,Je);case Q:var et=ze._init;return Ke(he,ne,me,et(ze._payload),Je)}if(Ot(ze)||K(ze))return he=he.get(me)||null,Pe(ne,he,ze,Je,null);fl(ne,ze)}return null}function Qe(he,ne,me,ze){for(var Je=null,et=null,tt=ne,st=ne=0,tn=null;tt!==null&&st<me.length;st++){tt.index>st?(tn=tt,tt=null):tn=tt.sibling;var wt=je(he,tt,me[st],ze);if(wt===null){tt===null&&(tt=tn);break}e&&tt&&wt.alternate===null&&n(he,tt),ne=g(wt,ne,st),et===null?Je=wt:et.sibling=wt,et=wt,tt=tn}if(st===me.length)return o(he,tt),$t&&ki(he,st),Je;if(tt===null){for(;st<me.length;st++)tt=Ie(he,me[st],ze),tt!==null&&(ne=g(tt,ne,st),et===null?Je=tt:et.sibling=tt,et=tt);return $t&&ki(he,st),Je}for(tt=l(he,tt);st<me.length;st++)tn=Ke(tt,he,st,me[st],ze),tn!==null&&(e&&tn.alternate!==null&&tt.delete(tn.key===null?st:tn.key),ne=g(tn,ne,st),et===null?Je=tn:et.sibling=tn,et=tn);return e&&tt.forEach(function(ii){return n(he,ii)}),$t&&ki(he,st),Je}function Ge(he,ne,me,ze){var Je=K(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,st=ne=0,tn=null,wt=me.next();tt!==null&&!wt.done;st++,wt=me.next()){tt.index>st?(tn=tt,tt=null):tn=tt.sibling;var ii=je(he,tt,wt.value,ze);if(ii===null){tt===null&&(tt=tn);break}e&&tt&&ii.alternate===null&&n(he,tt),ne=g(ii,ne,st),et===null?Je=ii:et.sibling=ii,et=ii,tt=tn}if(wt.done)return o(he,tt),$t&&ki(he,st),Je;if(tt===null){for(;!wt.done;st++,wt=me.next())wt=Ie(he,wt.value,ze),wt!==null&&(ne=g(wt,ne,st),et===null?Je=wt:et.sibling=wt,et=wt);return $t&&ki(he,st),Je}for(tt=l(he,tt);!wt.done;st++,wt=me.next())wt=Ke(tt,he,st,wt.value,ze),wt!==null&&(e&&wt.alternate!==null&&tt.delete(wt.key===null?st:wt.key),ne=g(wt,ne,st),et===null?Je=wt:et.sibling=wt,et=wt);return e&&tt.forEach(function(ny){return n(he,ny)}),$t&&ki(he,st),Je}function Bt(he,ne,me,ze){if(typeof me=="object"&&me!==null&&me.type===X&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case W:e:{for(var Je=me.key,et=ne;et!==null;){if(et.key===Je){if(Je=me.type,Je===X){if(et.tag===7){o(he,et.sibling),ne=h(et,me.props.children),ne.return=he,he=ne;break e}}else if(et.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===Q&&bd(Je)===et.type){o(he,et.sibling),ne=h(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===X?(ne=Ii(me.props.children,he.mode,ze,me.key),ne.return=he,he=ne):(ze=Ol(me.type,me.key,me.props,null,he.mode,ze),ze.ref=na(he,ne,me),ze.return=he,he=ze)}return E(he);case B: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=h(ne,me.children||[]),ne.return=he,he=ne;break e}else{o(he,ne);break}else n(he,ne);ne=ne.sibling}ne=Kc(me,he.mode,ze),ne.return=he,he=ne}return E(he);case Q:return et=me._init,Bt(he,ne,et(me._payload),ze)}if(Ot(me))return Qe(he,ne,me,ze);if(K(me))return Ge(he,ne,me,ze);fl(he,me)}return typeof me=="string"&&me!==""||typeof me=="number"?(me=""+me,ne!==null&&ne.tag===6?(o(he,ne.sibling),ne=h(ne,me),ne.return=he,he=ne):(o(he,ne),ne=Uc(me,he.mode,ze),ne.return=he,he=ne),E(he)):o(he,ne)}return Bt}var hs=_d(!0),Sd=_d(!1),dl=Yo(null),hl=null,ps=null,ec=null;function tc(){ec=ps=hl=null}function nc(e){var n=dl.current;Pt(dl),e._currentValue=n}function rc(e,n,o){for(;e!==null;){var l=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),e===o)break;e=e.return}}function ms(e,n){hl=e,ec=ps=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(Dn=!0),e.firstContext=null)}function dr(e){var n=e._currentValue;if(ec!==e)if(e={context:e,memoizedValue:n,next:null},ps===null){if(hl===null)throw Error(i(308));ps=e,hl.dependencies={lanes:0,firstContext:e}}else ps=ps.next=e;return n}var Ni=null;function oc(e){Ni===null?Ni=[e]:Ni.push(e)}function kd(e,n,o,l){var h=n.interleaved;return h===null?(o.next=o,oc(n)):(o.next=h.next,h.next=o),n.interleaved=o,So(e,l)}function So(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 Go=!1;function ic(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Nd(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 ko(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function Jo(e,n,o){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(vt&2)!==0){var h=l.pending;return h===null?n.next=n:(n.next=h.next,h.next=n),l.pending=n,So(e,o)}return h=l.interleaved,h===null?(n.next=n,oc(l)):(n.next=h.next,h.next=n),l.interleaved=n,So(e,o)}function pl(e,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194240)!==0)){var l=n.lanes;l&=e.pendingLanes,o|=l,n.lanes=o,Ro(e,o)}}function Ed(e,n){var o=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,o===l)){var h=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?h=g=E:g=g.next=E,o=o.next}while(o!==null);g===null?h=g=n:g=g.next=n}else h=g=n;o={baseState:l.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:l.shared,effects:l.effects},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=n:e.next=n,o.lastBaseUpdate=n}function ml(e,n,o,l){var h=e.updateQueue;Go=!1;var g=h.firstBaseUpdate,E=h.lastBaseUpdate,L=h.shared.pending;if(L!==null){h.shared.pending=null;var Y=L,ye=Y.next;Y.next=null,E===null?g=ye:E.next=ye,E=Y;var Pe=e.alternate;Pe!==null&&(Pe=Pe.updateQueue,L=Pe.lastBaseUpdate,L!==E&&(L===null?Pe.firstBaseUpdate=ye:L.next=ye,Pe.lastBaseUpdate=Y))}if(g!==null){var Ie=h.baseState;E=0,Pe=ye=Y=null,L=g;do{var je=L.lane,Ke=L.eventTime;if((l&je)===je){Pe!==null&&(Pe=Pe.next={eventTime:Ke,lane:0,tag:L.tag,payload:L.payload,callback:L.callback,next:null});e:{var Qe=e,Ge=L;switch(je=n,Ke=o,Ge.tag){case 1:if(Qe=Ge.payload,typeof Qe=="function"){Ie=Qe.call(Ke,Ie,je);break e}Ie=Qe;break e;case 3:Qe.flags=Qe.flags&-65537|128;case 0:if(Qe=Ge.payload,je=typeof Qe=="function"?Qe.call(Ke,Ie,je):Qe,je==null)break e;Ie=F({},Ie,je);break e;case 2:Go=!0}}L.callback!==null&&L.lane!==0&&(e.flags|=64,je=h.effects,je===null?h.effects=[L]:je.push(L))}else Ke={eventTime:Ke,lane:je,tag:L.tag,payload:L.payload,callback:L.callback,next:null},Pe===null?(ye=Pe=Ke,Y=Ie):Pe=Pe.next=Ke,E|=je;if(L=L.next,L===null){if(L=h.shared.pending,L===null)break;je=L,L=je.next,je.next=null,h.lastBaseUpdate=je,h.shared.pending=null}}while(!0);if(Pe===null&&(Y=Ie),h.baseState=Y,h.firstBaseUpdate=ye,h.lastBaseUpdate=Pe,n=h.shared.interleaved,n!==null){h=n;do E|=h.lane,h=h.next;while(h!==n)}else g===null&&(h.shared.lanes=0);ji|=E,e.lanes=E,e.memoizedState=Ie}}function Cd(e,n,o){if(e=n.effects,n.effects=null,e!==null)for(n=0;n<e.length;n++){var l=e[n],h=l.callback;if(h!==null){if(l.callback=null,l=o,typeof h!="function")throw Error(i(191,h));h.call(l)}}}var ra={},Kr=Yo(ra),oa=Yo(ra),ia=Yo(ra);function Ei(e){if(e===ra)throw Error(i(174));return e}function sc(e,n){switch(kt(ia,n),kt(oa,e),kt(Kr,ra),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:Vt(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=Vt(n,e)}Pt(Kr),kt(Kr,n)}function gs(){Pt(Kr),Pt(oa),Pt(ia)}function jd(e){Ei(ia.current);var n=Ei(Kr.current),o=Vt(n,e.type);n!==o&&(kt(oa,e),kt(Kr,o))}function ac(e){oa.current===e&&(Pt(Kr),Pt(oa))}var Dt=Yo(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 lc=[];function uc(){for(var e=0;e<lc.length;e++)lc[e]._workInProgressVersionPrimary=null;lc.length=0}var yl=R.ReactCurrentDispatcher,cc=R.ReactCurrentBatchConfig,Ci=0,Lt=null,Xt=null,Zt=null,vl=!1,sa=!1,aa=0,k0=0;function yn(){throw Error(i(321))}function fc(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 dc(e,n,o,l,h,g){if(Ci=g,Lt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,yl.current=e===null||e.memoizedState===null?j0:P0,e=o(l,h),sa){g=0;do{if(sa=!1,aa=0,25<=g)throw Error(i(301));g+=1,Zt=Xt=null,n.updateQueue=null,yl.current=M0,e=o(l,h)}while(sa)}if(yl.current=bl,n=Xt!==null&&Xt.next!==null,Ci=0,Zt=Xt=Lt=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 Zt===null?Lt.memoizedState=Zt=e:Zt=Zt.next=e,Zt}function hr(){if(Xt===null){var e=Lt.alternate;e=e!==null?e.memoizedState:null}else e=Xt.next;var n=Zt===null?Lt.memoizedState:Zt.next;if(n!==null)Zt=n,Xt=e;else{if(e===null)throw Error(i(310));Xt=e,e={memoizedState:Xt.memoizedState,baseState:Xt.baseState,baseQueue:Xt.baseQueue,queue:Xt.queue,next:null},Zt===null?Lt.memoizedState=Zt=e:Zt=Zt.next=e}return Zt}function la(e,n){return typeof n=="function"?n(e):n}function pc(e){var n=hr(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var l=Xt,h=l.baseQueue,g=o.pending;if(g!==null){if(h!==null){var E=h.next;h.next=g.next,g.next=E}l.baseQueue=h=g,o.pending=null}if(h!==null){g=h.next,l=l.baseState;var L=E=null,Y=null,ye=g;do{var Pe=ye.lane;if((Ci&Pe)===Pe)Y!==null&&(Y=Y.next={lane:0,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null}),l=ye.hasEagerState?ye.eagerState:e(l,ye.action);else{var Ie={lane:Pe,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null};Y===null?(L=Y=Ie,E=l):Y=Y.next=Ie,Lt.lanes|=Pe,ji|=Pe}ye=ye.next}while(ye!==null&&ye!==g);Y===null?E=l:Y.next=L,ue(l,n.memoizedState)||(Dn=!0),n.memoizedState=l,n.baseState=E,n.baseQueue=Y,o.lastRenderedState=l}if(e=o.interleaved,e!==null){h=e;do g=h.lane,Lt.lanes|=g,ji|=g,h=h.next;while(h!==e)}else h===null&&(o.lanes=0);return[n.memoizedState,o.dispatch]}function mc(e){var n=hr(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var l=o.dispatch,h=o.pending,g=n.memoizedState;if(h!==null){o.pending=null;var E=h=h.next;do g=e(g,E.action),E=E.next;while(E!==h);ue(g,n.memoizedState)||(Dn=!0),n.memoizedState=g,n.baseQueue===null&&(n.baseState=g),o.lastRenderedState=g}return[g,l]}function Pd(){}function Md(e,n){var o=Lt,l=hr(),h=n(),g=!ue(l.memoizedState,h);if(g&&(l.memoizedState=h,Dn=!0),l=l.queue,gc($d.bind(null,o,l,e),[e]),l.getSnapshot!==n||g||Zt!==null&&Zt.memoizedState.tag&1){if(o.flags|=2048,ua(9,Id.bind(null,o,l,h,n),void 0,null),en===null)throw Error(i(349));(Ci&30)!==0||Td(o,n,h)}return h}function Td(e,n,o){e.flags|=16384,e={getSnapshot:n,value:o},n=Lt.updateQueue,n===null?(n={lastEffect:null,stores:null},Lt.updateQueue=n,n.stores=[e]):(o=n.stores,o===null?n.stores=[e]:o.push(e))}function Id(e,n,o,l){n.value=o,n.getSnapshot=l,Ad(n)&&Od(e)}function $d(e,n,o){return o(function(){Ad(n)&&Od(e)})}function Ad(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!ue(e,o)}catch{return!0}}function Od(e){var n=So(e,1);n!==null&&Tr(n,e,1,-1)}function Rd(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=C0.bind(null,Lt,e),[n.memoizedState,e]}function ua(e,n,o,l){return e={tag:e,create:n,destroy:o,deps:l,next:null},n=Lt.updateQueue,n===null?(n={lastEffect:null,stores:null},Lt.updateQueue=n,n.lastEffect=e.next=e):(o=n.lastEffect,o===null?n.lastEffect=e.next=e:(l=o.next,o.next=e,e.next=l,n.lastEffect=e)),e}function Dd(){return hr().memoizedState}function xl(e,n,o,l){var h=qr();Lt.flags|=e,h.memoizedState=ua(1|n,o,void 0,l===void 0?null:l)}function wl(e,n,o,l){var h=hr();l=l===void 0?null:l;var g=void 0;if(Xt!==null){var E=Xt.memoizedState;if(g=E.destroy,l!==null&&fc(l,E.deps)){h.memoizedState=ua(n,o,g,l);return}}Lt.flags|=e,h.memoizedState=ua(1|n,o,g,l)}function Ld(e,n){return xl(8390656,8,e,n)}function gc(e,n){return wl(2048,8,e,n)}function zd(e,n){return wl(4,2,e,n)}function Fd(e,n){return wl(4,4,e,n)}function Bd(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 Hd(e,n,o){return o=o!=null?o.concat([e]):null,wl(4,4,Bd.bind(null,n,e),o)}function yc(){}function Vd(e,n){var o=hr();n=n===void 0?null:n;var l=o.memoizedState;return l!==null&&n!==null&&fc(n,l[1])?l[0]:(o.memoizedState=[e,n],e)}function Ud(e,n){var o=hr();n=n===void 0?null:n;var l=o.memoizedState;return l!==null&&n!==null&&fc(n,l[1])?l[0]:(e=e(),o.memoizedState=[e,n],e)}function Kd(e,n,o){return(Ci&21)===0?(e.baseState&&(e.baseState=!1,Dn=!0),e.memoizedState=o):(ue(o,n)||(o=Fr(),Lt.lanes|=o,ji|=o,e.baseState=!0),n)}function N0(e,n){var o=xt;xt=o!==0&&4>o?o:4,e(!0);var l=cc.transition;cc.transition={};try{e(!1),n()}finally{xt=o,cc.transition=l}}function qd(){return hr().memoizedState}function E0(e,n,o){var l=ni(e);if(o={lane:l,action:o,hasEagerState:!1,eagerState:null,next:null},Wd(e))Yd(n,o);else if(o=kd(e,n,o,l),o!==null){var h=jn();Tr(o,e,l,h),Xd(o,n,l)}}function C0(e,n,o){var l=ni(e),h={lane:l,action:o,hasEagerState:!1,eagerState:null,next:null};if(Wd(e))Yd(n,h);else{var g=e.alternate;if(e.lanes===0&&(g===null||g.lanes===0)&&(g=n.lastRenderedReducer,g!==null))try{var E=n.lastRenderedState,L=g(E,o);if(h.hasEagerState=!0,h.eagerState=L,ue(L,E)){var Y=n.interleaved;Y===null?(h.next=h,oc(n)):(h.next=Y.next,Y.next=h),n.interleaved=h;return}}catch{}finally{}o=kd(e,n,h,l),o!==null&&(h=jn(),Tr(o,e,l,h),Xd(o,n,l))}}function Wd(e){var n=e.alternate;return e===Lt||n!==null&&n===Lt}function Yd(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 Xd(e,n,o){if((o&4194240)!==0){var l=n.lanes;l&=e.pendingLanes,o|=l,n.lanes=o,Ro(e,o)}}var bl={readContext:dr,useCallback:yn,useContext:yn,useEffect:yn,useImperativeHandle:yn,useInsertionEffect:yn,useLayoutEffect:yn,useMemo:yn,useReducer:yn,useRef:yn,useState:yn,useDebugValue:yn,useDeferredValue:yn,useTransition:yn,useMutableSource:yn,useSyncExternalStore:yn,useId:yn,unstable_isNewReconciler:!1},j0={readContext:dr,useCallback:function(e,n){return qr().memoizedState=[e,n===void 0?null:n],e},useContext:dr,useEffect:Ld,useImperativeHandle:function(e,n,o){return o=o!=null?o.concat([e]):null,xl(4194308,4,Bd.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 l=qr();return n=o!==void 0?o(n):n,l.memoizedState=l.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},l.queue=e,e=e.dispatch=E0.bind(null,Lt,e),[l.memoizedState,e]},useRef:function(e){var n=qr();return e={current:e},n.memoizedState=e},useState:Rd,useDebugValue:yc,useDeferredValue:function(e){return qr().memoizedState=e},useTransition:function(){var e=Rd(!1),n=e[0];return e=N0.bind(null,e[1]),qr().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,o){var l=Lt,h=qr();if($t){if(o===void 0)throw Error(i(407));o=o()}else{if(o=n(),en===null)throw Error(i(349));(Ci&30)!==0||Td(l,n,o)}h.memoizedState=o;var g={value:o,getSnapshot:n};return h.queue=g,Ld($d.bind(null,l,g,e),[e]),l.flags|=2048,ua(9,Id.bind(null,l,g,o,n),void 0,null),o},useId:function(){var e=qr(),n=en.identifierPrefix;if($t){var o=_o,l=bo;o=(l&~(1<<32-hn(l)-1)).toString(32)+o,n=":"+n+"R"+o,o=aa++,0<o&&(n+="H"+o.toString(32)),n+=":"}else o=k0++,n=":"+n+"r"+o.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},P0={readContext:dr,useCallback:Vd,useContext:dr,useEffect:gc,useImperativeHandle:Hd,useInsertionEffect:zd,useLayoutEffect:Fd,useMemo:Ud,useReducer:pc,useRef:Dd,useState:function(){return pc(la)},useDebugValue:yc,useDeferredValue:function(e){var n=hr();return Kd(n,Xt.memoizedState,e)},useTransition:function(){var e=pc(la)[0],n=hr().memoizedState;return[e,n]},useMutableSource:Pd,useSyncExternalStore:Md,useId:qd,unstable_isNewReconciler:!1},M0={readContext:dr,useCallback:Vd,useContext:dr,useEffect:gc,useImperativeHandle:Hd,useInsertionEffect:zd,useLayoutEffect:Fd,useMemo:Ud,useReducer:mc,useRef:Dd,useState:function(){return mc(la)},useDebugValue:yc,useDeferredValue:function(e){var n=hr();return Xt===null?n.memoizedState=e:Kd(n,Xt.memoizedState,e)},useTransition:function(){var e=mc(la)[0],n=hr().memoizedState;return[e,n]},useMutableSource:Pd,useSyncExternalStore:Md,useId:qd,unstable_isNewReconciler:!1};function jr(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 vc(e,n,o,l){n=e.memoizedState,o=o(l,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)?zt(e)===e:!1},enqueueSetState:function(e,n,o){e=e._reactInternals;var l=jn(),h=ni(e),g=ko(l,h);g.payload=n,o!=null&&(g.callback=o),n=Jo(e,g,h),n!==null&&(Tr(n,e,h,l),pl(n,e,h))},enqueueReplaceState:function(e,n,o){e=e._reactInternals;var l=jn(),h=ni(e),g=ko(l,h);g.tag=1,g.payload=n,o!=null&&(g.callback=o),n=Jo(e,g,h),n!==null&&(Tr(n,e,h,l),pl(n,e,h))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var o=jn(),l=ni(e),h=ko(o,l);h.tag=2,n!=null&&(h.callback=n),n=Jo(e,h,l),n!==null&&(Tr(n,e,l,o),pl(n,e,l))}};function Qd(e,n,o,l,h,g,E){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,g,E):n.prototype&&n.prototype.isPureReactComponent?!te(o,l)||!te(h,g):!0}function Gd(e,n,o){var l=!1,h=Xo,g=n.contextType;return typeof g=="object"&&g!==null?g=dr(g):(h=Rn(n)?_i:gn.current,l=n.contextTypes,g=(l=l!=null)?us(e,h):Xo),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,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=h,e.__reactInternalMemoizedMaskedChildContext=g),n}function Jd(e,n,o,l){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(o,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(o,l),n.state!==e&&_l.enqueueReplaceState(n,n.state,null)}function xc(e,n,o,l){var h=e.stateNode;h.props=o,h.state=e.memoizedState,h.refs={},ic(e);var g=n.contextType;typeof g=="object"&&g!==null?h.context=dr(g):(g=Rn(n)?_i:gn.current,h.context=us(e,g)),h.state=e.memoizedState,g=n.getDerivedStateFromProps,typeof g=="function"&&(vc(e,n,g,o),h.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(n=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),n!==h.state&&_l.enqueueReplaceState(h,h.state,null),ml(e,o,h,l),h.state=e.memoizedState),typeof h.componentDidMount=="function"&&(e.flags|=4194308)}function ys(e,n){try{var o="",l=n;do o+=Me(l),l=l.return;while(l);var h=o}catch(g){h=`
39
+ Error generating stack: `+g.message+`
40
+ `+g.stack}return{value:e,source:n,stack:h,digest:null}}function wc(e,n,o){return{value:e,source:null,stack:o??null,digest:n??null}}function bc(e,n){try{console.error(n.value)}catch(o){setTimeout(function(){throw o})}}var T0=typeof WeakMap=="function"?WeakMap:Map;function Zd(e,n,o){o=ko(-1,o),o.tag=3,o.payload={element:null};var l=n.value;return o.callback=function(){Pl||(Pl=!0,Rc=l),bc(e,n)},o}function eh(e,n,o){o=ko(-1,o),o.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var h=n.value;o.payload=function(){return l(h)},o.callback=function(){bc(e,n)}}var g=e.stateNode;return g!==null&&typeof g.componentDidCatch=="function"&&(o.callback=function(){bc(e,n),typeof l!="function"&&(ei===null?ei=new Set([this]):ei.add(this));var E=n.stack;this.componentDidCatch(n.value,{componentStack:E!==null?E:""})}),o}function th(e,n,o){var l=e.pingCache;if(l===null){l=e.pingCache=new T0;var h=new Set;l.set(n,h)}else h=l.get(n),h===void 0&&(h=new Set,l.set(n,h));h.has(o)||(h.add(o),e=K0.bind(null,e,n,o),n.then(e,e))}function nh(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 rh(e,n,o,l,h){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=ko(-1,1),n.tag=2,Jo(o,n,1))),o.lanes|=1),e):(e.flags|=65536,e.lanes=h,e)}var I0=R.ReactCurrentOwner,Dn=!1;function Cn(e,n,o,l){n.child=e===null?Sd(n,null,o,l):hs(n,e.child,o,l)}function oh(e,n,o,l,h){o=o.render;var g=n.ref;return ms(n,h),l=dc(e,n,o,l,g,h),o=hc(),e!==null&&!Dn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~h,No(e,n,h)):($t&&o&&Xu(n),n.flags|=1,Cn(e,n,l,h),n.child)}function ih(e,n,o,l,h){if(e===null){var g=o.type;return typeof g=="function"&&!Vc(g)&&g.defaultProps===void 0&&o.compare===null&&o.defaultProps===void 0?(n.tag=15,n.type=g,sh(e,n,g,l,h)):(e=Ol(o.type,null,l,n,n.mode,h),e.ref=n.ref,e.return=n,n.child=e)}if(g=e.child,(e.lanes&h)===0){var E=g.memoizedProps;if(o=o.compare,o=o!==null?o:te,o(E,l)&&e.ref===n.ref)return No(e,n,h)}return n.flags|=1,e=oi(g,l),e.ref=n.ref,e.return=n,n.child=e}function sh(e,n,o,l,h){if(e!==null){var g=e.memoizedProps;if(te(g,l)&&e.ref===n.ref)if(Dn=!1,n.pendingProps=l=g,(e.lanes&h)!==0)(e.flags&131072)!==0&&(Dn=!0);else return n.lanes=e.lanes,No(e,n,h)}return _c(e,n,o,l,h)}function ah(e,n,o){var l=n.pendingProps,h=l.children,g=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},kt(xs,Jn),Jn|=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,kt(xs,Jn),Jn|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=g!==null?g.baseLanes:o,kt(xs,Jn),Jn|=l}else g!==null?(l=g.baseLanes|o,n.memoizedState=null):l=o,kt(xs,Jn),Jn|=l;return Cn(e,n,h,o),n.child}function lh(e,n){var o=n.ref;(e===null&&o!==null||e!==null&&e.ref!==o)&&(n.flags|=512,n.flags|=2097152)}function _c(e,n,o,l,h){var g=Rn(o)?_i:gn.current;return g=us(n,g),ms(n,h),o=dc(e,n,o,l,g,h),l=hc(),e!==null&&!Dn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~h,No(e,n,h)):($t&&l&&Xu(n),n.flags|=1,Cn(e,n,o,h),n.child)}function uh(e,n,o,l,h){if(Rn(o)){var g=!0;sl(n)}else g=!1;if(ms(n,h),n.stateNode===null)kl(e,n),Gd(n,o,l),xc(n,o,l,h),l=!0;else if(e===null){var E=n.stateNode,L=n.memoizedProps;E.props=L;var Y=E.context,ye=o.contextType;typeof ye=="object"&&ye!==null?ye=dr(ye):(ye=Rn(o)?_i:gn.current,ye=us(n,ye));var Pe=o.getDerivedStateFromProps,Ie=typeof Pe=="function"||typeof E.getSnapshotBeforeUpdate=="function";Ie||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(L!==l||Y!==ye)&&Jd(n,E,l,ye),Go=!1;var je=n.memoizedState;E.state=je,ml(n,l,E,h),Y=n.memoizedState,L!==l||je!==Y||On.current||Go?(typeof Pe=="function"&&(vc(n,o,Pe,l),Y=n.memoizedState),(L=Go||Qd(n,o,L,l,je,Y,ye))?(Ie||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=l,n.memoizedState=Y),E.props=l,E.state=Y,E.context=ye,l=L):(typeof E.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{E=n.stateNode,Nd(e,n),L=n.memoizedProps,ye=n.type===n.elementType?L:jr(n.type,L),E.props=ye,Ie=n.pendingProps,je=E.context,Y=o.contextType,typeof Y=="object"&&Y!==null?Y=dr(Y):(Y=Rn(o)?_i:gn.current,Y=us(n,Y));var Ke=o.getDerivedStateFromProps;(Pe=typeof Ke=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(L!==Ie||je!==Y)&&Jd(n,E,l,Y),Go=!1,je=n.memoizedState,E.state=je,ml(n,l,E,h);var Qe=n.memoizedState;L!==Ie||je!==Qe||On.current||Go?(typeof Ke=="function"&&(vc(n,o,Ke,l),Qe=n.memoizedState),(ye=Go||Qd(n,o,ye,l,je,Qe,Y)||!1)?(Pe||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(l,Qe,Y),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(l,Qe,Y)),typeof E.componentDidUpdate=="function"&&(n.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof E.componentDidUpdate!="function"||L===e.memoizedProps&&je===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||L===e.memoizedProps&&je===e.memoizedState||(n.flags|=1024),n.memoizedProps=l,n.memoizedState=Qe),E.props=l,E.state=Qe,E.context=Y,l=ye):(typeof E.componentDidUpdate!="function"||L===e.memoizedProps&&je===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||L===e.memoizedProps&&je===e.memoizedState||(n.flags|=1024),l=!1)}return Sc(e,n,o,l,g,h)}function Sc(e,n,o,l,h,g){lh(e,n);var E=(n.flags&128)!==0;if(!l&&!E)return h&&pd(n,o,!1),No(e,n,g);l=n.stateNode,I0.current=n;var L=E&&typeof o.getDerivedStateFromError!="function"?null:l.render();return n.flags|=1,e!==null&&E?(n.child=hs(n,e.child,null,g),n.child=hs(n,null,L,g)):Cn(e,n,L,g),n.memoizedState=l.state,h&&pd(n,o,!0),n.child}function ch(e){var n=e.stateNode;n.pendingContext?dd(e,n.pendingContext,n.pendingContext!==n.context):n.context&&dd(e,n.context,!1),sc(e,n.containerInfo)}function fh(e,n,o,l,h){return ds(),Zu(h),n.flags|=256,Cn(e,n,o,l),n.child}var kc={dehydrated:null,treeContext:null,retryLane:0};function Nc(e){return{baseLanes:e,cachePool:null,transitions:null}}function dh(e,n,o){var l=n.pendingProps,h=Dt.current,g=!1,E=(n.flags&128)!==0,L;if((L=E)||(L=e!==null&&e.memoizedState===null?!1:(h&2)!==0),L?(g=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(h|=1),kt(Dt,h&1),e===null)return Ju(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=l.children,e=l.fallback,g?(l=n.mode,g=n.child,E={mode:"hidden",children:E},(l&1)===0&&g!==null?(g.childLanes=0,g.pendingProps=E):g=Rl(E,l,0,null),e=Ii(e,l,o,null),g.return=n,e.return=n,g.sibling=e,n.child=g,n.child.memoizedState=Nc(o),n.memoizedState=kc,e):Ec(n,E));if(h=e.memoizedState,h!==null&&(L=h.dehydrated,L!==null))return $0(e,n,E,l,L,h,o);if(g){g=l.fallback,E=n.mode,h=e.child,L=h.sibling;var Y={mode:"hidden",children:l.children};return(E&1)===0&&n.child!==h?(l=n.child,l.childLanes=0,l.pendingProps=Y,n.deletions=null):(l=oi(h,Y),l.subtreeFlags=h.subtreeFlags&14680064),L!==null?g=oi(L,g):(g=Ii(g,E,o,null),g.flags|=2),g.return=n,l.return=n,l.sibling=g,n.child=l,l=g,g=n.child,E=e.child.memoizedState,E=E===null?Nc(o):{baseLanes:E.baseLanes|o,cachePool:null,transitions:E.transitions},g.memoizedState=E,g.childLanes=e.childLanes&~o,n.memoizedState=kc,l}return g=e.child,e=g.sibling,l=oi(g,{mode:"visible",children:l.children}),(n.mode&1)===0&&(l.lanes=o),l.return=n,l.sibling=null,e!==null&&(o=n.deletions,o===null?(n.deletions=[e],n.flags|=16):o.push(e)),n.child=l,n.memoizedState=null,l}function Ec(e,n){return n=Rl({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function Sl(e,n,o,l){return l!==null&&Zu(l),hs(n,e.child,null,o),e=Ec(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function $0(e,n,o,l,h,g,E){if(o)return n.flags&256?(n.flags&=-257,l=wc(Error(i(422))),Sl(e,n,E,l)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(g=l.fallback,h=n.mode,l=Rl({mode:"visible",children:l.children},h,0,null),g=Ii(g,h,E,null),g.flags|=2,l.return=n,g.return=n,l.sibling=g,n.child=l,(n.mode&1)!==0&&hs(n,e.child,null,E),n.child.memoizedState=Nc(E),n.memoizedState=kc,g);if((n.mode&1)===0)return Sl(e,n,E,null);if(h.data==="$!"){if(l=h.nextSibling&&h.nextSibling.dataset,l)var L=l.dgst;return l=L,g=Error(i(419)),l=wc(g,l,void 0),Sl(e,n,E,l)}if(L=(E&e.childLanes)!==0,Dn||L){if(l=en,l!==null){switch(E&-E){case 4:h=2;break;case 16:h=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:h=32;break;case 536870912:h=268435456;break;default:h=0}h=(h&(l.suspendedLanes|E))!==0?0:h,h!==0&&h!==g.retryLane&&(g.retryLane=h,So(e,h),Tr(l,e,h,-1))}return Hc(),l=wc(Error(i(421))),Sl(e,n,E,l)}return h.data==="$?"?(n.flags|=128,n.child=e.child,n=q0.bind(null,e),h._reactRetry=n,null):(e=g.treeContext,Gn=Wo(h.nextSibling),Qn=n,$t=!0,Cr=null,e!==null&&(cr[fr++]=bo,cr[fr++]=_o,cr[fr++]=Si,bo=e.id,_o=e.overflow,Si=n),n=Ec(n,l.children),n.flags|=4096,n)}function hh(e,n,o){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n),rc(e.return,n,o)}function Cc(e,n,o,l,h){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:o,tailMode:h}:(g.isBackwards=n,g.rendering=null,g.renderingStartTime=0,g.last=l,g.tail=o,g.tailMode=h)}function ph(e,n,o){var l=n.pendingProps,h=l.revealOrder,g=l.tail;if(Cn(e,n,l.children,o),l=Dt.current,(l&2)!==0)l=l&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&&hh(e,o,n);else if(e.tag===19)hh(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}l&=1}if(kt(Dt,l),(n.mode&1)===0)n.memoizedState=null;else switch(h){case"forwards":for(o=n.child,h=null;o!==null;)e=o.alternate,e!==null&&gl(e)===null&&(h=o),o=o.sibling;o=h,o===null?(h=n.child,n.child=null):(h=o.sibling,o.sibling=null),Cc(n,!1,h,o,g);break;case"backwards":for(o=null,h=n.child,n.child=null;h!==null;){if(e=h.alternate,e!==null&&gl(e)===null){n.child=h;break}e=h.sibling,h.sibling=o,o=h,h=e}Cc(n,!0,o,null,g);break;case"together":Cc(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 No(e,n,o){if(e!==null&&(n.dependencies=e.dependencies),ji|=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=oi(e,e.pendingProps),n.child=o,o.return=n;e.sibling!==null;)e=e.sibling,o=o.sibling=oi(e,e.pendingProps),o.return=n;o.sibling=null}return n.child}function A0(e,n,o){switch(n.tag){case 3:ch(n),ds();break;case 5:jd(n);break;case 1:Rn(n.type)&&sl(n);break;case 4:sc(n,n.stateNode.containerInfo);break;case 10:var l=n.type._context,h=n.memoizedProps.value;kt(dl,l._currentValue),l._currentValue=h;break;case 13:if(l=n.memoizedState,l!==null)return l.dehydrated!==null?(kt(Dt,Dt.current&1),n.flags|=128,null):(o&n.child.childLanes)!==0?dh(e,n,o):(kt(Dt,Dt.current&1),e=No(e,n,o),e!==null?e.sibling:null);kt(Dt,Dt.current&1);break;case 19:if(l=(o&n.childLanes)!==0,(e.flags&128)!==0){if(l)return ph(e,n,o);n.flags|=128}if(h=n.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),kt(Dt,Dt.current),l)break;return null;case 22:case 23:return n.lanes=0,ah(e,n,o)}return No(e,n,o)}var mh,jc,gh,yh;mh=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}},jc=function(){},gh=function(e,n,o,l){var h=e.memoizedProps;if(h!==l){e=n.stateNode,Ei(Kr.current);var g=null;switch(o){case"input":h=ut(e,h),l=ut(e,l),g=[];break;case"select":h=F({},h,{value:void 0}),l=F({},l,{value:void 0}),g=[];break;case"textarea":h=wn(e,h),l=wn(e,l),g=[];break;default:typeof h.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=rl)}Ye(o,l);var E;o=null;for(ye in h)if(!l.hasOwnProperty(ye)&&h.hasOwnProperty(ye)&&h[ye]!=null)if(ye==="style"){var L=h[ye];for(E in L)L.hasOwnProperty(E)&&(o||(o={}),o[E]="")}else ye!=="dangerouslySetInnerHTML"&&ye!=="children"&&ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&ye!=="autoFocus"&&(u.hasOwnProperty(ye)?g||(g=[]):(g=g||[]).push(ye,null));for(ye in l){var Y=l[ye];if(L=h!=null?h[ye]:void 0,l.hasOwnProperty(ye)&&Y!==L&&(Y!=null||L!=null))if(ye==="style")if(L){for(E in L)!L.hasOwnProperty(E)||Y&&Y.hasOwnProperty(E)||(o||(o={}),o[E]="");for(E in Y)Y.hasOwnProperty(E)&&L[E]!==Y[E]&&(o||(o={}),o[E]=Y[E])}else o||(g||(g=[]),g.push(ye,o)),o=Y;else ye==="dangerouslySetInnerHTML"?(Y=Y?Y.__html:void 0,L=L?L.__html:void 0,Y!=null&&L!==Y&&(g=g||[]).push(ye,Y)):ye==="children"?typeof Y!="string"&&typeof Y!="number"||(g=g||[]).push(ye,""+Y):ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&(u.hasOwnProperty(ye)?(Y!=null&&ye==="onScroll"&&jt("scroll",e),g||L===Y||(g=[])):(g=g||[]).push(ye,Y))}o&&(g=g||[]).push("style",o);var ye=g;(n.updateQueue=ye)&&(n.flags|=4)}},yh=function(e,n,o,l){o!==l&&(n.flags|=4)};function ca(e,n){if(!$t)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 l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function vn(e){var n=e.alternate!==null&&e.alternate.child===e.child,o=0,l=0;if(n)for(var h=e.child;h!==null;)o|=h.lanes|h.childLanes,l|=h.subtreeFlags&14680064,l|=h.flags&14680064,h.return=e,h=h.sibling;else for(h=e.child;h!==null;)o|=h.lanes|h.childLanes,l|=h.subtreeFlags,l|=h.flags,h.return=e,h=h.sibling;return e.subtreeFlags|=l,e.childLanes=o,n}function O0(e,n,o){var l=n.pendingProps;switch(Qu(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vn(n),null;case 1:return Rn(n.type)&&il(),vn(n),null;case 3:return l=n.stateNode,gs(),Pt(On),Pt(gn),uc(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(cl(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Cr!==null&&(zc(Cr),Cr=null))),jc(e,n),vn(n),null;case 5:ac(n);var h=Ei(ia.current);if(o=n.type,e!==null&&n.stateNode!=null)gh(e,n,o,l,h),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!l){if(n.stateNode===null)throw Error(i(166));return vn(n),null}if(e=Ei(Kr.current),cl(n)){l=n.stateNode,o=n.type;var g=n.memoizedProps;switch(l[Ur]=n,l[ea]=g,e=(n.mode&1)!==0,o){case"dialog":jt("cancel",l),jt("close",l);break;case"iframe":case"object":case"embed":jt("load",l);break;case"video":case"audio":for(h=0;h<vo.length;h++)jt(vo[h],l);break;case"source":jt("error",l);break;case"img":case"image":case"link":jt("error",l),jt("load",l);break;case"details":jt("toggle",l);break;case"input":ct(l,g),jt("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!g.multiple},jt("invalid",l);break;case"textarea":fn(l,g),jt("invalid",l)}Ye(o,g),h=null;for(var E in g)if(g.hasOwnProperty(E)){var L=g[E];E==="children"?typeof L=="string"?l.textContent!==L&&(g.suppressHydrationWarning!==!0&&nl(l.textContent,L,e),h=["children",L]):typeof L=="number"&&l.textContent!==""+L&&(g.suppressHydrationWarning!==!0&&nl(l.textContent,L,e),h=["children",""+L]):u.hasOwnProperty(E)&&L!=null&&E==="onScroll"&&jt("scroll",l)}switch(o){case"input":He(l),_t(l,g,!0);break;case"textarea":He(l),bn(l);break;case"select":case"option":break;default:typeof g.onClick=="function"&&(l.onclick=rl)}l=h,n.updateQueue=l,l!==null&&(n.flags|=4)}else{E=h.nodeType===9?h:h.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Nt(o)),e==="http://www.w3.org/1999/xhtml"?o==="script"?(e=E.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=E.createElement(o,{is:l.is}):(e=E.createElement(o),o==="select"&&(E=e,l.multiple?E.multiple=!0:l.size&&(E.size=l.size))):e=E.createElementNS(e,o),e[Ur]=n,e[ea]=l,mh(e,n,!1,!1),n.stateNode=e;e:{switch(E=Un(o,l),o){case"dialog":jt("cancel",e),jt("close",e),h=l;break;case"iframe":case"object":case"embed":jt("load",e),h=l;break;case"video":case"audio":for(h=0;h<vo.length;h++)jt(vo[h],e);h=l;break;case"source":jt("error",e),h=l;break;case"img":case"image":case"link":jt("error",e),jt("load",e),h=l;break;case"details":jt("toggle",e),h=l;break;case"input":ct(e,l),h=ut(e,l),jt("invalid",e);break;case"option":h=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},h=F({},l,{value:void 0}),jt("invalid",e);break;case"textarea":fn(e,l),h=wn(e,l),jt("invalid",e);break;default:h=l}Ye(o,h),L=h;for(g in L)if(L.hasOwnProperty(g)){var Y=L[g];g==="style"?nr(e,Y):g==="dangerouslySetInnerHTML"?(Y=Y?Y.__html:void 0,Y!=null&&tr(e,Y)):g==="children"?typeof Y=="string"?(o!=="textarea"||Y!=="")&&_n(e,Y):typeof Y=="number"&&_n(e,""+Y):g!=="suppressContentEditableWarning"&&g!=="suppressHydrationWarning"&&g!=="autoFocus"&&(u.hasOwnProperty(g)?Y!=null&&g==="onScroll"&&jt("scroll",e):Y!=null&&P(e,g,Y,E))}switch(o){case"input":He(e),_t(e,l,!1);break;case"textarea":He(e),bn(e);break;case"option":l.value!=null&&e.setAttribute("value",""+be(l.value));break;case"select":e.multiple=!!l.multiple,g=l.value,g!=null?St(e,!!l.multiple,g,!1):l.defaultValue!=null&&St(e,!!l.multiple,l.defaultValue,!0);break;default:typeof h.onClick=="function"&&(e.onclick=rl)}switch(o){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return vn(n),null;case 6:if(e&&n.stateNode!=null)yh(e,n,e.memoizedProps,l);else{if(typeof l!="string"&&n.stateNode===null)throw Error(i(166));if(o=Ei(ia.current),Ei(Kr.current),cl(n)){if(l=n.stateNode,o=n.memoizedProps,l[Ur]=n,(g=l.nodeValue!==o)&&(e=Qn,e!==null))switch(e.tag){case 3:nl(l.nodeValue,o,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&nl(l.nodeValue,o,(e.mode&1)!==0)}g&&(n.flags|=4)}else l=(o.nodeType===9?o:o.ownerDocument).createTextNode(l),l[Ur]=n,n.stateNode=l}return vn(n),null;case 13:if(Pt(Dt),l=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if($t&&Gn!==null&&(n.mode&1)!==0&&(n.flags&128)===0)wd(),ds(),n.flags|=98560,g=!1;else if(g=cl(n),l!==null&&l.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[Ur]=n}else ds(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;vn(n),g=!1}else Cr!==null&&(zc(Cr),Cr=null),g=!0;if(!g)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=o,n):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(n.child.flags|=8192,(n.mode&1)!==0&&(e===null||(Dt.current&1)!==0?Qt===0&&(Qt=3):Hc())),n.updateQueue!==null&&(n.flags|=4),vn(n),null);case 4:return gs(),jc(e,n),e===null&&Js(n.stateNode.containerInfo),vn(n),null;case 10:return nc(n.type._context),vn(n),null;case 17:return Rn(n.type)&&il(),vn(n),null;case 19:if(Pt(Dt),g=n.memoizedState,g===null)return vn(n),null;if(l=(n.flags&128)!==0,E=g.rendering,E===null)if(l)ca(g,!1);else{if(Qt!==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),l=E.updateQueue,l!==null&&(n.updateQueue=l,n.flags|=4),n.subtreeFlags=0,l=o,o=n.child;o!==null;)g=o,e=l,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 kt(Dt,Dt.current&1|2),n.child}e=e.sibling}g.tail!==null&&gt()>ws&&(n.flags|=128,l=!0,ca(g,!1),n.lanes=4194304)}else{if(!l)if(e=gl(E),e!==null){if(n.flags|=128,l=!0,o=e.updateQueue,o!==null&&(n.updateQueue=o,n.flags|=4),ca(g,!0),g.tail===null&&g.tailMode==="hidden"&&!E.alternate&&!$t)return vn(n),null}else 2*gt()-g.renderingStartTime>ws&&o!==1073741824&&(n.flags|=128,l=!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=gt(),n.sibling=null,o=Dt.current,kt(Dt,l?o&1|2:o&1),n):(vn(n),null);case 22:case 23:return Bc(),l=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(n.flags|=8192),l&&(n.mode&1)!==0?(Jn&1073741824)!==0&&(vn(n),n.subtreeFlags&6&&(n.flags|=8192)):vn(n),null;case 24:return null;case 25:return null}throw Error(i(156,n.tag))}function R0(e,n){switch(Qu(n),n.tag){case 1:return Rn(n.type)&&il(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return gs(),Pt(On),Pt(gn),uc(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return ac(n),null;case 13:if(Pt(Dt),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 Pt(Dt),null;case 4:return gs(),null;case 10:return nc(n.type._context),null;case 22:case 23:return Bc(),null;case 24:return null;default:return null}}var Nl=!1,xn=!1,D0=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(l){Ft(e,n,l)}else o.current=null}function Pc(e,n,o){try{o()}catch(l){Ft(e,n,l)}}var vh=!1;function L0(e,n){if(Bu=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 l=o.getSelection&&o.getSelection();if(l&&l.rangeCount!==0){o=l.anchorNode;var h=l.anchorOffset,g=l.focusNode;l=l.focusOffset;try{o.nodeType,g.nodeType}catch{o=null;break e}var E=0,L=-1,Y=-1,ye=0,Pe=0,Ie=e,je=null;t:for(;;){for(var Ke;Ie!==o||h!==0&&Ie.nodeType!==3||(L=E+h),Ie!==g||l!==0&&Ie.nodeType!==3||(Y=E+l),Ie.nodeType===3&&(E+=Ie.nodeValue.length),(Ke=Ie.firstChild)!==null;)je=Ie,Ie=Ke;for(;;){if(Ie===e)break t;if(je===o&&++ye===h&&(L=E),je===g&&++Pe===l&&(Y=E),(Ke=Ie.nextSibling)!==null)break;Ie=je,je=Ie.parentNode}Ie=Ke}o=L===-1||Y===-1?null:{start:L,end:Y}}else o=null}o=o||{start:0,end:0}}else o=null;for(Hu={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,Bt=Qe.memoizedState,he=n.stateNode,ne=he.getSnapshotBeforeUpdate(n.elementType===n.type?Ge:jr(n.type,Ge),Bt);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(ze){Ft(n,n.return,ze)}if(e=n.sibling,e!==null){e.return=n.return,Xe=e;break}Xe=n.return}return Qe=vh,vh=!1,Qe}function fa(e,n,o){var l=n.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var h=l=l.next;do{if((h.tag&e)===e){var g=h.destroy;h.destroy=void 0,g!==void 0&&Pc(n,o,g)}h=h.next}while(h!==l)}}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 l=o.create;o.destroy=l()}o=o.next}while(o!==n)}}function Mc(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 xh(e){var n=e.alternate;n!==null&&(e.alternate=null,xh(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[Ur],delete n[ea],delete n[qu],delete n[w0],delete n[b0])),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 wh(e){return e.tag===5||e.tag===3||e.tag===4}function bh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||wh(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 l=e.tag;if(l===5||l===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(l!==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 l=e.tag;if(l===5||l===6)e=e.stateNode,n?o.insertBefore(e,n):o.appendChild(e);else if(l!==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,Pr=!1;function Zo(e,n,o){for(o=o.child;o!==null;)_h(e,n,o),o=o.sibling}function _h(e,n,o){if(En&&typeof En.onCommitFiberUnmount=="function")try{En.onCommitFiberUnmount(ar,o)}catch{}switch(o.tag){case 5:xn||vs(o,n);case 6:var l=un,h=Pr;un=null,Zo(e,n,o),un=l,Pr=h,un!==null&&(Pr?(e=un,o=o.stateNode,e.nodeType===8?e.parentNode.removeChild(o):e.removeChild(o)):un.removeChild(o.stateNode));break;case 18:un!==null&&(Pr?(e=un,o=o.stateNode,e.nodeType===8?Ku(e.parentNode,o):e.nodeType===1&&Ku(e,o),lo(e)):Ku(un,o.stateNode));break;case 4:l=un,h=Pr,un=o.stateNode.containerInfo,Pr=!0,Zo(e,n,o),un=l,Pr=h;break;case 0:case 11:case 14:case 15:if(!xn&&(l=o.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){h=l=l.next;do{var g=h,E=g.destroy;g=g.tag,E!==void 0&&((g&2)!==0||(g&4)!==0)&&Pc(o,n,E),h=h.next}while(h!==l)}Zo(e,n,o);break;case 1:if(!xn&&(vs(o,n),l=o.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=o.memoizedProps,l.state=o.memoizedState,l.componentWillUnmount()}catch(L){Ft(o,n,L)}Zo(e,n,o);break;case 21:Zo(e,n,o);break;case 22:o.mode&1?(xn=(l=xn)||o.memoizedState!==null,Zo(e,n,o),xn=l):Zo(e,n,o);break;default:Zo(e,n,o)}}function Sh(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var o=e.stateNode;o===null&&(o=e.stateNode=new D0),n.forEach(function(l){var h=W0.bind(null,e,l);o.has(l)||(o.add(l),l.then(h,h))})}}function Mr(e,n){var o=n.deletions;if(o!==null)for(var l=0;l<o.length;l++){var h=o[l];try{var g=e,E=n,L=E;e:for(;L!==null;){switch(L.tag){case 5:un=L.stateNode,Pr=!1;break e;case 3:un=L.stateNode.containerInfo,Pr=!0;break e;case 4:un=L.stateNode.containerInfo,Pr=!0;break e}L=L.return}if(un===null)throw Error(i(160));_h(g,E,h),un=null,Pr=!1;var Y=h.alternate;Y!==null&&(Y.return=null),h.return=null}catch(ye){Ft(h,n,ye)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)kh(n,e),n=n.sibling}function kh(e,n){var o=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Mr(n,e),Wr(e),l&4){try{fa(3,e,e.return),El(3,e)}catch(Ge){Ft(e,e.return,Ge)}try{fa(5,e,e.return)}catch(Ge){Ft(e,e.return,Ge)}}break;case 1:Mr(n,e),Wr(e),l&512&&o!==null&&vs(o,o.return);break;case 5:if(Mr(n,e),Wr(e),l&512&&o!==null&&vs(o,o.return),e.flags&32){var h=e.stateNode;try{_n(h,"")}catch(Ge){Ft(e,e.return,Ge)}}if(l&4&&(h=e.stateNode,h!=null)){var g=e.memoizedProps,E=o!==null?o.memoizedProps:g,L=e.type,Y=e.updateQueue;if(e.updateQueue=null,Y!==null)try{L==="input"&&g.type==="radio"&&g.name!=null&&it(h,g),Un(L,E);var ye=Un(L,g);for(E=0;E<Y.length;E+=2){var Pe=Y[E],Ie=Y[E+1];Pe==="style"?nr(h,Ie):Pe==="dangerouslySetInnerHTML"?tr(h,Ie):Pe==="children"?_n(h,Ie):P(h,Pe,Ie,ye)}switch(L){case"input":Tt(h,g);break;case"textarea":gr(h,g);break;case"select":var je=h._wrapperState.wasMultiple;h._wrapperState.wasMultiple=!!g.multiple;var Ke=g.value;Ke!=null?St(h,!!g.multiple,Ke,!1):je!==!!g.multiple&&(g.defaultValue!=null?St(h,!!g.multiple,g.defaultValue,!0):St(h,!!g.multiple,g.multiple?[]:"",!1))}h[ea]=g}catch(Ge){Ft(e,e.return,Ge)}}break;case 6:if(Mr(n,e),Wr(e),l&4){if(e.stateNode===null)throw Error(i(162));h=e.stateNode,g=e.memoizedProps;try{h.nodeValue=g}catch(Ge){Ft(e,e.return,Ge)}}break;case 3:if(Mr(n,e),Wr(e),l&4&&o!==null&&o.memoizedState.isDehydrated)try{lo(n.containerInfo)}catch(Ge){Ft(e,e.return,Ge)}break;case 4:Mr(n,e),Wr(e);break;case 13:Mr(n,e),Wr(e),h=e.child,h.flags&8192&&(g=h.memoizedState!==null,h.stateNode.isHidden=g,!g||h.alternate!==null&&h.alternate.memoizedState!==null||(Oc=gt())),l&4&&Sh(e);break;case 22:if(Pe=o!==null&&o.memoizedState!==null,e.mode&1?(xn=(ye=xn)||Pe,Mr(n,e),xn=ye):Mr(n,e),Wr(e),l&8192){if(ye=e.memoizedState!==null,(e.stateNode.isHidden=ye)&&!Pe&&(e.mode&1)!==0)for(Xe=e,Pe=e.child;Pe!==null;){for(Ie=Xe=Pe;Xe!==null;){switch(je=Xe,Ke=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"){l=je,o=je.return;try{n=l,Qe.props=n.memoizedProps,Qe.state=n.memoizedState,Qe.componentWillUnmount()}catch(Ge){Ft(l,o,Ge)}}break;case 5:vs(je,je.return);break;case 22:if(je.memoizedState!==null){Ch(Ie);continue}}Ke!==null?(Ke.return=je,Xe=Ke):Ch(Ie)}Pe=Pe.sibling}e:for(Pe=null,Ie=e;;){if(Ie.tag===5){if(Pe===null){Pe=Ie;try{h=Ie.stateNode,ye?(g=h.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none"):(L=Ie.stateNode,Y=Ie.memoizedProps.style,E=Y!=null&&Y.hasOwnProperty("display")?Y.display:null,L.style.display=dn("display",E))}catch(Ge){Ft(e,e.return,Ge)}}}else if(Ie.tag===6){if(Pe===null)try{Ie.stateNode.nodeValue=ye?"":Ie.memoizedProps}catch(Ge){Ft(e,e.return,Ge)}}else if((Ie.tag!==22&&Ie.tag!==23||Ie.memoizedState===null||Ie===e)&&Ie.child!==null){Ie.child.return=Ie,Ie=Ie.child;continue}if(Ie===e)break e;for(;Ie.sibling===null;){if(Ie.return===null||Ie.return===e)break e;Pe===Ie&&(Pe=null),Ie=Ie.return}Pe===Ie&&(Pe=null),Ie.sibling.return=Ie.return,Ie=Ie.sibling}}break;case 19:Mr(n,e),Wr(e),l&4&&Sh(e);break;case 21:break;default:Mr(n,e),Wr(e)}}function Wr(e){var n=e.flags;if(n&2){try{e:{for(var o=e.return;o!==null;){if(wh(o)){var l=o;break e}o=o.return}throw Error(i(160))}switch(l.tag){case 5:var h=l.stateNode;l.flags&32&&(_n(h,""),l.flags&=-33);var g=bh(e);Ic(e,g,h);break;case 3:case 4:var E=l.stateNode.containerInfo,L=bh(e);Tc(e,L,E);break;default:throw Error(i(161))}}catch(Y){Ft(e,e.return,Y)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function z0(e,n,o){Xe=e,Nh(e)}function Nh(e,n,o){for(var l=(e.mode&1)!==0;Xe!==null;){var h=Xe,g=h.child;if(h.tag===22&&l){var E=h.memoizedState!==null||Nl;if(!E){var L=h.alternate,Y=L!==null&&L.memoizedState!==null||xn;L=Nl;var ye=xn;if(Nl=E,(xn=Y)&&!ye)for(Xe=h;Xe!==null;)E=Xe,Y=E.child,E.tag===22&&E.memoizedState!==null?jh(h):Y!==null?(Y.return=E,Xe=Y):jh(h);for(;g!==null;)Xe=g,Nh(g),g=g.sibling;Xe=h,Nl=L,xn=ye}Eh(e)}else(h.subtreeFlags&8772)!==0&&g!==null?(g.return=h,Xe=g):Eh(e)}}function Eh(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:xn||El(5,n);break;case 1:var l=n.stateNode;if(n.flags&4&&!xn)if(o===null)l.componentDidMount();else{var h=n.elementType===n.type?o.memoizedProps:jr(n.type,o.memoizedProps);l.componentDidUpdate(h,o.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var g=n.updateQueue;g!==null&&Cd(n,g,l);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}Cd(n,E,o)}break;case 5:var L=n.stateNode;if(o===null&&n.flags&4){o=L;var Y=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":Y.autoFocus&&o.focus();break;case"img":Y.src&&(o.src=Y.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var ye=n.alternate;if(ye!==null){var Pe=ye.memoizedState;if(Pe!==null){var Ie=Pe.dehydrated;Ie!==null&&lo(Ie)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}xn||n.flags&512&&Mc(n)}catch(je){Ft(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 Ch(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 jh(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(Y){Ft(n,o,Y)}break;case 1:var l=n.stateNode;if(typeof l.componentDidMount=="function"){var h=n.return;try{l.componentDidMount()}catch(Y){Ft(n,h,Y)}}var g=n.return;try{Mc(n)}catch(Y){Ft(n,g,Y)}break;case 5:var E=n.return;try{Mc(n)}catch(Y){Ft(n,E,Y)}}}catch(Y){Ft(n,n.return,Y)}if(n===e){Xe=null;break}var L=n.sibling;if(L!==null){L.return=n.return,Xe=L;break}Xe=n.return}}var F0=Math.ceil,Cl=R.ReactCurrentDispatcher,$c=R.ReactCurrentOwner,pr=R.ReactCurrentBatchConfig,vt=0,en=null,qt=null,cn=0,Jn=0,xs=Yo(0),Qt=0,da=null,ji=0,jl=0,Ac=0,ha=null,Ln=null,Oc=0,ws=1/0,Eo=null,Pl=!1,Rc=null,ei=null,Ml=!1,ti=null,Tl=0,pa=0,Dc=null,Il=-1,$l=0;function jn(){return(vt&6)!==0?gt():Il!==-1?Il:Il=gt()}function ni(e){return(e.mode&1)===0?1:(vt&2)!==0&&cn!==0?cn&-cn:S0.transition!==null?($l===0&&($l=Fr()),$l):(e=xt,e!==0||(e=window.event,e=e===void 0?16:qi(e.type)),e)}function Tr(e,n,o,l){if(50<pa)throw pa=0,Dc=null,Error(i(185));ur(e,o,l),((vt&2)===0||e!==en)&&(e===en&&((vt&2)===0&&(jl|=o),Qt===4&&ri(e,cn)),zn(e,l),o===1&&vt===0&&(n.mode&1)===0&&(ws=gt()+500,al&&Qo()))}function zn(e,n){var o=e.callbackNode;io(e,n);var l=yt(e,e===en?cn:0);if(l===0)o!==null&&$o(o),e.callbackNode=null,e.callbackPriority=0;else if(n=l&-l,e.callbackPriority!==n){if(o!=null&&$o(o),n===1)e.tag===0?_0(Mh.bind(null,e)):md(Mh.bind(null,e)),v0(function(){(vt&6)===0&&Qo()}),o=null;else{switch(Ba(l)){case 1:o=Dr;break;case 4:o=Ao;break;case 16:o=Lr;break;case 536870912:o=fi;break;default:o=Lr}o=Lh(o,Ph.bind(null,e))}e.callbackPriority=n,e.callbackNode=o}}function Ph(e,n){if(Il=-1,$l=0,(vt&6)!==0)throw Error(i(327));var o=e.callbackNode;if(bs()&&e.callbackNode!==o)return null;var l=yt(e,e===en?cn:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||n)n=Al(e,l);else{n=l;var h=vt;vt|=2;var g=Ih();(en!==e||cn!==n)&&(Eo=null,ws=gt()+500,Mi(e,n));do try{V0();break}catch(L){Th(e,L)}while(!0);tc(),Cl.current=g,vt=h,qt!==null?n=0:(en=null,cn=0,n=Qt)}if(n!==0){if(n===2&&(h=lr(e),h!==0&&(l=h,n=Lc(e,h))),n===1)throw o=da,Mi(e,0),ri(e,l),zn(e,gt()),o;if(n===6)ri(e,l);else{if(h=e.current.alternate,(l&30)===0&&!B0(h)&&(n=Al(e,l),n===2&&(g=lr(e),g!==0&&(l=g,n=Lc(e,g))),n===1))throw o=da,Mi(e,0),ri(e,l),zn(e,gt()),o;switch(e.finishedWork=h,e.finishedLanes=l,n){case 0:case 1:throw Error(i(345));case 2:Ti(e,Ln,Eo);break;case 3:if(ri(e,l),(l&130023424)===l&&(n=Oc+500-gt(),10<n)){if(yt(e,0)!==0)break;if(h=e.suspendedLanes,(h&l)!==l){jn(),e.pingedLanes|=e.suspendedLanes&h;break}e.timeoutHandle=Uu(Ti.bind(null,e,Ln,Eo),n);break}Ti(e,Ln,Eo);break;case 4:if(ri(e,l),(l&4194240)===l)break;for(n=e.eventTimes,h=-1;0<l;){var E=31-hn(l);g=1<<E,E=n[E],E>h&&(h=E),l&=~g}if(l=h,l=gt()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*F0(l/1960))-l,10<l){e.timeoutHandle=Uu(Ti.bind(null,e,Ln,Eo),l);break}Ti(e,Ln,Eo);break;case 5:Ti(e,Ln,Eo);break;default:throw Error(i(329))}}}return zn(e,gt()),e.callbackNode===o?Ph.bind(null,e):null}function Lc(e,n){var o=ha;return e.current.memoizedState.isDehydrated&&(Mi(e,n).flags|=256),e=Al(e,n),e!==2&&(n=Ln,Ln=o,n!==null&&zc(n)),e}function zc(e){Ln===null?Ln=e:Ln.push.apply(Ln,e)}function B0(e){for(var n=e;;){if(n.flags&16384){var o=n.updateQueue;if(o!==null&&(o=o.stores,o!==null))for(var l=0;l<o.length;l++){var h=o[l],g=h.getSnapshot;h=h.value;try{if(!ue(g(),h))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 ri(e,n){for(n&=~Ac,n&=~jl,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var o=31-hn(n),l=1<<o;e[o]=-1,n&=~l}}function Mh(e){if((vt&6)!==0)throw Error(i(327));bs();var n=yt(e,0);if((n&1)===0)return zn(e,gt()),null;var o=Al(e,n);if(e.tag!==0&&o===2){var l=lr(e);l!==0&&(n=l,o=Lc(e,l))}if(o===1)throw o=da,Mi(e,0),ri(e,n),zn(e,gt()),o;if(o===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,Ti(e,Ln,Eo),zn(e,gt()),null}function Fc(e,n){var o=vt;vt|=1;try{return e(n)}finally{vt=o,vt===0&&(ws=gt()+500,al&&Qo())}}function Pi(e){ti!==null&&ti.tag===0&&(vt&6)===0&&bs();var n=vt;vt|=1;var o=pr.transition,l=xt;try{if(pr.transition=null,xt=1,e)return e()}finally{xt=l,pr.transition=o,vt=n,(vt&6)===0&&Qo()}}function Bc(){Jn=xs.current,Pt(xs)}function Mi(e,n){e.finishedWork=null,e.finishedLanes=0;var o=e.timeoutHandle;if(o!==-1&&(e.timeoutHandle=-1,y0(o)),qt!==null)for(o=qt.return;o!==null;){var l=o;switch(Qu(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&il();break;case 3:gs(),Pt(On),Pt(gn),uc();break;case 5:ac(l);break;case 4:gs();break;case 13:Pt(Dt);break;case 19:Pt(Dt);break;case 10:nc(l.type._context);break;case 22:case 23:Bc()}o=o.return}if(en=e,qt=e=oi(e.current,null),cn=Jn=n,Qt=0,da=null,Ac=jl=ji=0,Ln=ha=null,Ni!==null){for(n=0;n<Ni.length;n++)if(o=Ni[n],l=o.interleaved,l!==null){o.interleaved=null;var h=l.next,g=o.pending;if(g!==null){var E=g.next;g.next=h,l.next=E}o.pending=l}Ni=null}return e}function Th(e,n){do{var o=qt;try{if(tc(),yl.current=bl,vl){for(var l=Lt.memoizedState;l!==null;){var h=l.queue;h!==null&&(h.pending=null),l=l.next}vl=!1}if(Ci=0,Zt=Xt=Lt=null,sa=!1,aa=0,$c.current=null,o===null||o.return===null){Qt=1,da=n,qt=null;break}e:{var g=e,E=o.return,L=o,Y=n;if(n=cn,L.flags|=32768,Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var ye=Y,Pe=L,Ie=Pe.tag;if((Pe.mode&1)===0&&(Ie===0||Ie===11||Ie===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 Ke=nh(E);if(Ke!==null){Ke.flags&=-257,rh(Ke,E,L,g,n),Ke.mode&1&&th(g,ye,n),n=Ke,Y=ye;var Qe=n.updateQueue;if(Qe===null){var Ge=new Set;Ge.add(Y),n.updateQueue=Ge}else Qe.add(Y);break e}else{if((n&1)===0){th(g,ye,n),Hc();break e}Y=Error(i(426))}}else if($t&&L.mode&1){var Bt=nh(E);if(Bt!==null){(Bt.flags&65536)===0&&(Bt.flags|=256),rh(Bt,E,L,g,n),Zu(ys(Y,L));break e}}g=Y=ys(Y,L),Qt!==4&&(Qt=2),ha===null?ha=[g]:ha.push(g),g=E;do{switch(g.tag){case 3:g.flags|=65536,n&=-n,g.lanes|=n;var he=Zd(g,Y,n);Ed(g,he);break e;case 1:L=Y;var ne=g.type,me=g.stateNode;if((g.flags&128)===0&&(typeof ne.getDerivedStateFromError=="function"||me!==null&&typeof me.componentDidCatch=="function"&&(ei===null||!ei.has(me)))){g.flags|=65536,n&=-n,g.lanes|=n;var ze=eh(g,L,n);Ed(g,ze);break e}}g=g.return}while(g!==null)}Ah(o)}catch(Je){n=Je,qt===o&&o!==null&&(qt=o=o.return);continue}break}while(!0)}function Ih(){var e=Cl.current;return Cl.current=bl,e===null?bl:e}function Hc(){(Qt===0||Qt===3||Qt===2)&&(Qt=4),en===null||(ji&268435455)===0&&(jl&268435455)===0||ri(en,cn)}function Al(e,n){var o=vt;vt|=2;var l=Ih();(en!==e||cn!==n)&&(Eo=null,Mi(e,n));do try{H0();break}catch(h){Th(e,h)}while(!0);if(tc(),vt=o,Cl.current=l,qt!==null)throw Error(i(261));return en=null,cn=0,Qt}function H0(){for(;qt!==null;)$h(qt)}function V0(){for(;qt!==null&&!Et();)$h(qt)}function $h(e){var n=Dh(e.alternate,e,Jn);e.memoizedProps=e.pendingProps,n===null?Ah(e):qt=n,$c.current=null}function Ah(e){var n=e;do{var o=n.alternate;if(e=n.return,(n.flags&32768)===0){if(o=O0(o,n,Jn),o!==null){qt=o;return}}else{if(o=R0(o,n),o!==null){o.flags&=32767,qt=o;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Qt=6,qt=null;return}}if(n=n.sibling,n!==null){qt=n;return}qt=n=e}while(n!==null);Qt===0&&(Qt=5)}function Ti(e,n,o){var l=xt,h=pr.transition;try{pr.transition=null,xt=1,U0(e,n,o,l)}finally{pr.transition=h,xt=l}return null}function U0(e,n,o,l){do bs();while(ti!==null);if((vt&6)!==0)throw Error(i(327));o=e.finishedWork;var h=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(di(e,g),e===en&&(qt=en=null,cn=0),(o.subtreeFlags&2064)===0&&(o.flags&2064)===0||Ml||(Ml=!0,Lh(Lr,function(){return bs(),null})),g=(o.flags&15990)!==0,(o.subtreeFlags&15990)!==0||g){g=pr.transition,pr.transition=null;var E=xt;xt=1;var L=vt;vt|=4,$c.current=null,L0(e,o),kh(o,e),se(Hu),Ki=!!Bu,Hu=Bu=null,e.current=o,z0(o),sr(),vt=L,xt=E,pr.transition=g}else e.current=o;if(Ml&&(Ml=!1,ti=e,Tl=h),g=e.pendingLanes,g===0&&(ei=null),ft(o.stateNode),zn(e,gt()),n!==null)for(l=e.onRecoverableError,o=0;o<n.length;o++)h=n[o],l(h.value,{componentStack:h.stack,digest:h.digest});if(Pl)throw Pl=!1,e=Rc,Rc=null,e;return(Tl&1)!==0&&e.tag!==0&&bs(),g=e.pendingLanes,(g&1)!==0?e===Dc?pa++:(pa=0,Dc=e):pa=0,Qo(),null}function bs(){if(ti!==null){var e=Ba(Tl),n=pr.transition,o=xt;try{if(pr.transition=null,xt=16>e?16:e,ti===null)var l=!1;else{if(e=ti,ti=null,Tl=0,(vt&6)!==0)throw Error(i(331));var h=vt;for(vt|=4,Xe=e.current;Xe!==null;){var g=Xe,E=g.child;if((Xe.flags&16)!==0){var L=g.deletions;if(L!==null){for(var Y=0;Y<L.length;Y++){var ye=L[Y];for(Xe=ye;Xe!==null;){var Pe=Xe;switch(Pe.tag){case 0:case 11:case 15:fa(8,Pe,g)}var Ie=Pe.child;if(Ie!==null)Ie.return=Pe,Xe=Ie;else for(;Xe!==null;){Pe=Xe;var je=Pe.sibling,Ke=Pe.return;if(xh(Pe),Pe===ye){Xe=null;break}if(je!==null){je.return=Ke,Xe=je;break}Xe=Ke}}}var Qe=g.alternate;if(Qe!==null){var Ge=Qe.child;if(Ge!==null){Qe.child=null;do{var Bt=Ge.sibling;Ge.sibling=null,Ge=Bt}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(L=Xe,(L.flags&2048)!==0)try{switch(L.tag){case 0:case 11:case 15:El(9,L)}}catch(Je){Ft(L,L.return,Je)}if(L===E){Xe=null;break e}var ze=L.sibling;if(ze!==null){ze.return=L.return,Xe=ze;break e}Xe=L.return}}if(vt=h,Qo(),En&&typeof En.onPostCommitFiberRoot=="function")try{En.onPostCommitFiberRoot(ar,e)}catch{}l=!0}return l}finally{xt=o,pr.transition=n}}return!1}function Oh(e,n,o){n=ys(o,n),n=Zd(e,n,1),e=Jo(e,n,1),n=jn(),e!==null&&(ur(e,1,n),zn(e,n))}function Ft(e,n,o){if(e.tag===3)Oh(e,e,o);else for(;n!==null;){if(n.tag===3){Oh(n,e,o);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ei===null||!ei.has(l))){e=ys(o,e),e=eh(n,e,1),n=Jo(n,e,1),e=jn(),n!==null&&(ur(n,1,e),zn(n,e));break}}n=n.return}}function K0(e,n,o){var l=e.pingCache;l!==null&&l.delete(n),n=jn(),e.pingedLanes|=e.suspendedLanes&o,en===e&&(cn&o)===o&&(Qt===4||Qt===3&&(cn&130023424)===cn&&500>gt()-Oc?Mi(e,0):Ac|=o),zn(e,n)}function Rh(e,n){n===0&&((e.mode&1)===0?n=1:(n=oo,oo<<=1,(oo&130023424)===0&&(oo=4194304)));var o=jn();e=So(e,n),e!==null&&(ur(e,n,o),zn(e,o))}function q0(e){var n=e.memoizedState,o=0;n!==null&&(o=n.retryLane),Rh(e,o)}function W0(e,n){var o=0;switch(e.tag){case 13:var l=e.stateNode,h=e.memoizedState;h!==null&&(o=h.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(i(314))}l!==null&&l.delete(n),Rh(e,o)}var Dh;Dh=function(e,n,o){if(e!==null)if(e.memoizedProps!==n.pendingProps||On.current)Dn=!0;else{if((e.lanes&o)===0&&(n.flags&128)===0)return Dn=!1,A0(e,n,o);Dn=(e.flags&131072)!==0}else Dn=!1,$t&&(n.flags&1048576)!==0&&gd(n,ul,n.index);switch(n.lanes=0,n.tag){case 2:var l=n.type;kl(e,n),e=n.pendingProps;var h=us(n,gn.current);ms(n,o),h=dc(null,n,l,e,h,o);var g=hc();return n.flags|=1,typeof h=="object"&&h!==null&&typeof h.render=="function"&&h.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Rn(l)?(g=!0,sl(n)):g=!1,n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,ic(n),h.updater=_l,n.stateNode=h,h._reactInternals=n,xc(n,l,e,o),n=Sc(null,n,l,!0,g,o)):(n.tag=0,$t&&g&&Xu(n),Cn(null,n,h,o),n=n.child),n;case 16:l=n.elementType;e:{switch(kl(e,n),e=n.pendingProps,h=l._init,l=h(l._payload),n.type=l,h=n.tag=X0(l),e=jr(l,e),h){case 0:n=_c(null,n,l,e,o);break e;case 1:n=uh(null,n,l,e,o);break e;case 11:n=oh(null,n,l,e,o);break e;case 14:n=ih(null,n,l,jr(l.type,e),o);break e}throw Error(i(306,l,""))}return n;case 0:return l=n.type,h=n.pendingProps,h=n.elementType===l?h:jr(l,h),_c(e,n,l,h,o);case 1:return l=n.type,h=n.pendingProps,h=n.elementType===l?h:jr(l,h),uh(e,n,l,h,o);case 3:e:{if(ch(n),e===null)throw Error(i(387));l=n.pendingProps,g=n.memoizedState,h=g.element,Nd(e,n),ml(n,l,null,o);var E=n.memoizedState;if(l=E.element,g.isDehydrated)if(g={element:l,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},n.updateQueue.baseState=g,n.memoizedState=g,n.flags&256){h=ys(Error(i(423)),n),n=fh(e,n,l,o,h);break e}else if(l!==h){h=ys(Error(i(424)),n),n=fh(e,n,l,o,h);break e}else for(Gn=Wo(n.stateNode.containerInfo.firstChild),Qn=n,$t=!0,Cr=null,o=Sd(n,null,l,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(ds(),l===h){n=No(e,n,o);break e}Cn(e,n,l,o)}n=n.child}return n;case 5:return jd(n),e===null&&Ju(n),l=n.type,h=n.pendingProps,g=e!==null?e.memoizedProps:null,E=h.children,Vu(l,h)?E=null:g!==null&&Vu(l,g)&&(n.flags|=32),lh(e,n),Cn(e,n,E,o),n.child;case 6:return e===null&&Ju(n),null;case 13:return dh(e,n,o);case 4:return sc(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=hs(n,null,l,o):Cn(e,n,l,o),n.child;case 11:return l=n.type,h=n.pendingProps,h=n.elementType===l?h:jr(l,h),oh(e,n,l,h,o);case 7:return Cn(e,n,n.pendingProps,o),n.child;case 8:return Cn(e,n,n.pendingProps.children,o),n.child;case 12:return Cn(e,n,n.pendingProps.children,o),n.child;case 10:e:{if(l=n.type._context,h=n.pendingProps,g=n.memoizedProps,E=h.value,kt(dl,l._currentValue),l._currentValue=E,g!==null)if(ue(g.value,E)){if(g.children===h.children&&!On.current){n=No(e,n,o);break e}}else for(g=n.child,g!==null&&(g.return=n);g!==null;){var L=g.dependencies;if(L!==null){E=g.child;for(var Y=L.firstContext;Y!==null;){if(Y.context===l){if(g.tag===1){Y=ko(-1,o&-o),Y.tag=2;var ye=g.updateQueue;if(ye!==null){ye=ye.shared;var Pe=ye.pending;Pe===null?Y.next=Y:(Y.next=Pe.next,Pe.next=Y),ye.pending=Y}}g.lanes|=o,Y=g.alternate,Y!==null&&(Y.lanes|=o),rc(g.return,o,n),L.lanes|=o;break}Y=Y.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,L=E.alternate,L!==null&&(L.lanes|=o),rc(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}Cn(e,n,h.children,o),n=n.child}return n;case 9:return h=n.type,l=n.pendingProps.children,ms(n,o),h=dr(h),l=l(h),n.flags|=1,Cn(e,n,l,o),n.child;case 14:return l=n.type,h=jr(l,n.pendingProps),h=jr(l.type,h),ih(e,n,l,h,o);case 15:return sh(e,n,n.type,n.pendingProps,o);case 17:return l=n.type,h=n.pendingProps,h=n.elementType===l?h:jr(l,h),kl(e,n),n.tag=1,Rn(l)?(e=!0,sl(n)):e=!1,ms(n,o),Gd(n,l,h),xc(n,l,h,o),Sc(null,n,l,!0,e,o);case 19:return ph(e,n,o);case 22:return ah(e,n,o)}throw Error(i(156,n.tag))};function Lh(e,n){return ci(e,n)}function Y0(e,n,o,l){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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mr(e,n,o,l){return new Y0(e,n,o,l)}function Vc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function X0(e){if(typeof e=="function")return Vc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ce)return 11;if(e===le)return 14}return 2}function oi(e,n){var o=e.alternate;return o===null?(o=mr(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,l,h,g){var E=2;if(l=e,typeof e=="function")Vc(e)&&(E=1);else if(typeof e=="string")E=5;else e:switch(e){case X:return Ii(o.children,h,g,n);case fe:E=8,h|=8;break;case pe:return e=mr(12,o,n,h|2),e.elementType=pe,e.lanes=g,e;case xe:return e=mr(13,o,n,h),e.elementType=xe,e.lanes=g,e;case D:return e=mr(19,o,n,h),e.elementType=D,e.lanes=g,e;case ie:return Rl(o,h,g,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _e:E=10;break e;case U:E=9;break e;case ce:E=11;break e;case le:E=14;break e;case Q:E=16,l=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return n=mr(E,o,n,h),n.elementType=e,n.type=l,n.lanes=g,n}function Ii(e,n,o,l){return e=mr(7,e,l,n),e.lanes=o,e}function Rl(e,n,o,l){return e=mr(22,e,l,n),e.elementType=ie,e.lanes=o,e.stateNode={isHidden:!1},e}function Uc(e,n,o){return e=mr(6,e,null,n),e.lanes=o,e}function Kc(e,n,o){return n=mr(4,e.children!==null?e.children:[],e.key,n),n.lanes=o,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function Q0(e,n,o,l,h){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=so(0),this.expirationTimes=so(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=so(0),this.identifierPrefix=l,this.onRecoverableError=h,this.mutableSourceEagerHydrationData=null}function qc(e,n,o,l,h,g,E,L,Y){return e=new Q0(e,n,o,L,Y),n===1?(n=1,g===!0&&(n|=8)):n=0,g=mr(3,null,null,n),e.current=g,g.stateNode=e,g.memoizedState={element:l,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},ic(g),e}function G0(e,n,o){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:B,key:l==null?null:""+l,children:e,containerInfo:n,implementation:o}}function zh(e){if(!e)return Xo;e=e._reactInternals;e:{if(zt(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(Rn(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(Rn(o))return hd(e,o,n)}return n}function Fh(e,n,o,l,h,g,E,L,Y){return e=qc(o,l,!0,e,h,g,E,L,Y),e.context=zh(null),o=e.current,l=jn(),h=ni(o),g=ko(l,h),g.callback=n??null,Jo(o,g,h),e.current.lanes=h,ur(e,h,l),zn(e,l),e}function Dl(e,n,o,l){var h=n.current,g=jn(),E=ni(h);return o=zh(o),n.context===null?n.context=o:n.pendingContext=o,n=ko(g,E),n.payload={element:e},l=l===void 0?null:l,l!==null&&(n.callback=l),e=Jo(h,n,E),e!==null&&(Tr(e,h,E,g),pl(e,h,E)),E}function Ll(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 Bh(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o<n?o:n}}function Wc(e,n){Bh(e,n),(e=e.alternate)&&Bh(e,n)}function J0(){return null}var Hh=typeof reportError=="function"?reportError:function(e){console.error(e)};function Yc(e){this._internalRoot=e}zl.prototype.render=Yc.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));Dl(e,n,null,null)},zl.prototype.unmount=Yc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Pi(function(){Dl(null,e,null,null)}),n[xo]=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<$n.length&&n!==0&&n<$n[o].priority;o++);$n.splice(o,0,e),o===0&&Xn(e)}};function Xc(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 Vh(){}function Z0(e,n,o,l,h){if(h){if(typeof l=="function"){var g=l;l=function(){var ye=Ll(E);g.call(ye)}}var E=Fh(n,l,e,0,null,!1,!1,"",Vh);return e._reactRootContainer=E,e[xo]=E.current,Js(e.nodeType===8?e.parentNode:e),Pi(),E}for(;h=e.lastChild;)e.removeChild(h);if(typeof l=="function"){var L=l;l=function(){var ye=Ll(Y);L.call(ye)}}var Y=qc(e,0,!1,null,null,!1,!1,"",Vh);return e._reactRootContainer=Y,e[xo]=Y.current,Js(e.nodeType===8?e.parentNode:e),Pi(function(){Dl(n,Y,o,l)}),Y}function Bl(e,n,o,l,h){var g=o._reactRootContainer;if(g){var E=g;if(typeof h=="function"){var L=h;h=function(){var Y=Ll(E);L.call(Y)}}Dl(n,E,e,h)}else E=Z0(o,n,e,h,l);return Ll(E)}pt=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var o=Yn(n.pendingLanes);o!==0&&(Ro(n,o|1),zn(n,gt()),(vt&6)===0&&(ws=gt()+500,Qo()))}break;case 13:Pi(function(){var l=So(e,1);if(l!==null){var h=jn();Tr(l,e,1,h)}}),Wc(e,1)}},Vi=function(e){if(e.tag===13){var n=So(e,134217728);if(n!==null){var o=jn();Tr(n,e,134217728,o)}Wc(e,134217728)}},Ha=function(e){if(e.tag===13){var n=ni(e),o=So(e,n);if(o!==null){var l=jn();Tr(o,e,n,l)}Wc(e,n)}},Va=function(){return xt},pn=function(e,n){var o=xt;try{return xt=e,n()}finally{xt=o}},Ve=function(e,n,o){switch(n){case"input":if(Tt(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 l=o[n];if(l!==e&&l.form===e.form){var h=ol(l);if(!h)throw Error(i(90));Oe(l),Tt(l,h)}}}break;case"textarea":gr(e,o);break;case"select":n=o.value,n!=null&&St(e,!!o.multiple,n,!1)}},Io=Fc,eo=Pi;var ey={usingClientEntryPoint:!1,Events:[ta,as,ol,Zr,vr,Fc]},ma={findFiberByHostInstance:bi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ty={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=ui(e),e===null?null:e.stateNode},findFiberByHostInstance:ma.findFiberByHostInstance||J0,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{ar=Hl.inject(ty),En=Hl}catch{}}return Fn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ey,Fn.createPortal=function(e,n){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Xc(n))throw Error(i(200));return G0(e,n,null,o)},Fn.createRoot=function(e,n){if(!Xc(e))throw Error(i(299));var o=!1,l="",h=Hh;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(h=n.onRecoverableError)),n=qc(e,1,!1,null,null,o,!1,l,h),e[xo]=n.current,Js(e.nodeType===8?e.parentNode:e),new Yc(n)},Fn.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=ui(n),e=e===null?null:e.stateNode,e},Fn.flushSync=function(e){return Pi(e)},Fn.hydrate=function(e,n,o){if(!Fl(n))throw Error(i(200));return Bl(null,e,n,!0,o)},Fn.hydrateRoot=function(e,n,o){if(!Xc(e))throw Error(i(405));var l=o!=null&&o.hydratedSources||null,h=!1,g="",E=Hh;if(o!=null&&(o.unstable_strictMode===!0&&(h=!0),o.identifierPrefix!==void 0&&(g=o.identifierPrefix),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),n=Fh(n,null,e,1,o??null,h,!1,g,E),e[xo]=n.current,Js(e),l)for(e=0;e<l.length;e++)o=l[e],h=o._getVersion,h=h(o._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[o,h]:n.mutableSourceEagerHydrationData.push(o,h);return new zl(n)},Fn.render=function(e,n,o){if(!Fl(n))throw Error(i(200));return Bl(null,e,n,!1,o)},Fn.unmountComponentAtNode=function(e){if(!Fl(e))throw Error(i(40));return e._reactRootContainer?(Pi(function(){Bl(null,null,e,!1,function(){e._reactRootContainer=null,e[xo]=null})}),!0):!1},Fn.unstable_batchedUpdates=Fc,Fn.unstable_renderSubtreeIntoContainer=function(e,n,o,l){if(!Fl(o))throw Error(i(200));if(e==null||e._reactInternals===void 0)throw Error(i(38));return Bl(e,n,o,!1,l)},Fn.version="18.3.1-next-f1338f8080-20240426",Fn}var Gh;function gm(){if(Gh)return Jc.exports;Gh=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(),Jc.exports=fy(),Jc.exports}var Jh;function dy(){if(Jh)return Vl;Jh=1;var t=gm();return Vl.createRoot=t.createRoot,Vl.hydrateRoot=t.hydrateRoot,Vl}var hy=dy();const py=xu(hy),my=["get","post","put","patch","delete","options","head","trace"];function Zh(t){return t.replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_|_$/g,"").replace(/_+/g,"_")}function wu(t,r,i,s){if(i)return Zh(i).replace(/^[0-9]/,"_$&")||`op_${s}`;const u=Zh(r.replace(/[{}]/g,""));return`${t}_${u}`||`op_${s}`}function bu(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(u=>u.charAt(0).toUpperCase()+u.slice(1).toLowerCase()).join("")||"Api"}Client`}function _u(t){return(t.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(i=>i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join("")||"Api")+"Service"}function Gr(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 u=s;for(const f of my){const d=u[f];d&&typeof d=="object"&&r.push({method:f,path:i,operationId:d.operationId,tags:d.tags})}}return r}function gy(t,r,i,s="baseUrl"){var f,d;const u=r.toUpperCase();return`const ${s} = "${((d=(f=t.servers)==null?void 0:f[0])==null?void 0:d.url)??"http://localhost:3000"}";
41
+ /** @returns {Promise<unknown>} */
42
+ const res = await fetch(\`${s}${i}\`, {
43
+ method: "${u}",
44
+ headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
45
+ ${u==="GET"||u==="HEAD"?"":"body: JSON.stringify({}),"}
46
+ });
47
+ const data = await res.json();
48
+ `}function ym(t,r){const i=t.map((s,u)=>` /**
49
+ * @param {{ headers?: Record<string, string> }} [options]
50
+ * @returns {Promise<unknown>}
51
+ */
52
+ async ${wu(s.method,s.path,s.operationId,u)}(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 yy(t){return ym(Gr(t),bu(t))}function vy(t,r){const i=_u(r),s=Gr(t).filter(u=>{var f;return(f=u.tags)==null?void 0:f.includes(r)});return ym(s,i)}function xy(t,r,i){var f,d;const s=((d=(f=t.servers)==null?void 0:f[0])==null?void 0:d.url)??"http://localhost:3000",u=r.toUpperCase();return`<?php
73
+ $baseUrl = '${s}';
74
+ $url = $baseUrl . '${i}';
75
+ $opts = [
76
+ 'http' => [
77
+ 'method' => '${u}',
78
+ 'header' => "Content-Type: application/json\\r\\nAuthorization: Bearer {$token}\\r\\n",
79
+ ${u==="GET"||u==="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 vm(t,r){const i=t.map((s,u)=>` public function ${wu(s.method,s.path,s.operationId,u)}(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 wy(t){return vm(Gr(t),bu(t))}function by(t,r){const i=_u(r),s=Gr(t).filter(u=>{var f;return(f=u.tags)==null?void 0:f.includes(r)});return vm(s,i)}function _y(t,r,i){var d,m;const s=((m=(d=t.servers)==null?void 0:d[0])==null?void 0:m.url)??"http://localhost:3000",u=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.${u}(url, headers=headers${u==="get"||u==="head"?"":", json={}"})
133
+ data = response.json()
134
+ `}function xm(t,r){const i=t.map((s,u)=>{const f=wu(s.method,s.path,s.operationId,u),d=s.method.toLowerCase(),m=d==="get"||d==="head"?"":", json={}";return` def ${f}(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${m})
137
+ return r.json()`});return`from __future__ import annotations
138
+ import httpx
139
+
140
+ class ${r}:
141
+ def __init__(self, base_url: str, default_headers: dict | None = None) -> None:
142
+ self.base_url = base_url.rstrip("/")
143
+ self.default_headers = default_headers or {}
144
+ self._client = httpx.Client()
145
+
146
+ def close(self) -> None:
147
+ self._client.close()
148
+
149
+ ${i.join(`
150
+
151
+ `)}
152
+ `}function Sy(t){return xm(Gr(t),bu(t))}function ky(t,r){const i=_u(r),s=Gr(t).filter(u=>{var f;return(f=u.tags)==null?void 0:f.includes(r)});return xm(s,i)}function Ny(t){const r=t.split("/");return(r[r.length-1]??"Unknown").replace(/[^a-zA-Z0-9_]/g,"_")}function vf(t){if(!t)return"unknown";if("$ref"in t&&t.$ref)return Ny(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?`${vf(r.items)}[]`:r.type==="object"&&r.properties?`{
153
+ ${Object.entries(r.properties).map(([s,u])=>` ${JSON.stringify(s)}?: ${vf(u)};`).join(`
154
+ `)}
155
+ }`:"Record<string, unknown>"}function Ey(t,r,i,s="baseUrl"){var w,k,x,S,C,j;const u=(k=(w=t.paths)==null?void 0:w[i])==null?void 0:k[r],f=u==null?void 0:u.requestBody;let d;if((S=(x=f==null?void 0:f.content)==null?void 0:x["application/json"])!=null&&S.schema){const T=f.content["application/json"].schema;T&&!("$ref"in T)&&(d=T)}const m=d?vf(d):"Record<string, unknown>",v=r.toUpperCase();return`const ${s} = "${((j=(C=t.servers)==null?void 0:C[0])==null?void 0:j.url)??"http://localhost:3000"}";
156
+ const res = await fetch(\`${s}${i}\`, {
157
+ method: "${v}",
158
+ headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
159
+ ${v==="GET"||v==="HEAD"?"":`body: JSON.stringify({} as ${m}),`}
160
+ });
161
+ const data = await res.json() as unknown;
162
+ `}function wm(t,r){const i=t.map((s,u)=>` async ${wu(s.method,s.path,s.operationId,u)}(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 Cy(t){const r=Gr(t),i=bu(t);return wm(r,i)}function jy(t,r){const i=_u(r),s=Gr(t).filter(u=>{var f;return(f=u.tags)==null?void 0:f.includes(r)});return wm(s,i)}function Py(t,r,i,s){switch(r){case"typescript":return Ey(t,i,s);case"javascript":return gy(t,i,s);case"python":return _y(t,i,s);case"php":return xy(t,i,s);default:{const u=r;throw new Error(`Unsupported language: ${u}`)}}}function My(t,r,i){switch(r){case"typescript":return jy(t,i);case"javascript":return vy(t,i);case"python":return ky(t,i);case"php":return by(t,i);default:{const s=r;throw new Error(`Unsupported language: ${s}`)}}}function Ty(t,r,i){if(i===null)switch(r){case"typescript":return Cy(t);case"javascript":return yy(t);case"python":return Sy(t);case"php":return wy(t);default:{const s=r;throw new Error(`Unsupported language: ${s}`)}}return My(t,r,i)}function Iy(t){const r=new Set;for(const i of Gr(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,u;return r!=null&&r.trim()?r.replace(/\/$/,""):((u=(s=(i=t.servers)==null?void 0:i[0])==null?void 0:s.url)==null?void 0:u.replace(/\/$/,""))??window.location.origin}function $y(t){var i;const r=(i=t.components)==null?void 0:i.securitySchemes;return r?Object.keys(r):[]}function Of(t,r){if(!r.startsWith("$"))return;let i=t;const s=r.slice(1);if(s.startsWith(".")){for(const u of s.slice(1).split("."))if(i&&typeof i=="object"&&u in i)i=i[u];else return;return i}return i}var Zl={exports:{}},Ay=Zl.exports,ep;function Oy(){return ep||(ep=1,(function(t,r){((i,s)=>{t.exports=s()})(Ay,function(){var i=function(a,c){return(i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(p,y){p.__proto__=y}:function(p,y){for(var _ in y)Object.prototype.hasOwnProperty.call(y,_)&&(p[_]=y[_])}))(a,c)},s=function(){return(s=Object.assign||function(a){for(var c,p=1,y=arguments.length;p<y;p++)for(var _ in c=arguments[p])Object.prototype.hasOwnProperty.call(c,_)&&(a[_]=c[_]);return a}).apply(this,arguments)};function u(a,c,p){for(var y,_=0,N=c.length;_<N;_++)!y&&_ in c||((y=y||Array.prototype.slice.call(c,0,_))[_]=c[_]);return a.concat(y||Array.prototype.slice.call(c))}var f=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:iy,d=Object.keys,m=Array.isArray;function v(a,c){return typeof c=="object"&&d(c).forEach(function(p){a[p]=c[p]}),a}typeof Promise>"u"||f.Promise||(f.Promise=Promise);var w=Object.getPrototypeOf,k={}.hasOwnProperty;function x(a,c){return k.call(a,c)}function S(a,c){typeof c=="function"&&(c=c(w(a))),(typeof Reflect>"u"?d:Reflect.ownKeys)(c).forEach(function(p){j(a,p,c[p])})}var C=Object.defineProperty;function j(a,c,p,y){C(a,c,v(p&&x(p,"get")&&typeof p.get=="function"?{get:p.get,set:p.set,configurable:!0}:{value:p,configurable:!0,writable:!0},y))}function T(a){return{from:function(c){return a.prototype=Object.create(c.prototype),j(a.prototype,"constructor",a),{extend:S.bind(null,a.prototype)}}}}var I=Object.getOwnPropertyDescriptor,A=[].slice;function V(a,c,p){return A.call(a,c,p)}function P(a,c){return c(a)}function R(a){if(!a)throw new Error("Assertion Failed")}function W(a){f.setImmediate?setImmediate(a):setTimeout(a,0)}function B(a,c){if(typeof c=="string"&&x(a,c))return a[c];if(!c)return a;if(typeof c!="string"){for(var p=[],y=0,_=c.length;y<_;++y){var N=B(a,c[y]);p.push(N)}return p}var M,O=c.indexOf(".");return O===-1||(M=a[c.substr(0,O)])==null?void 0:B(M,c.substr(O+1))}function X(a,c,p){if(a&&c!==void 0&&!("isFrozen"in Object&&Object.isFrozen(a)))if(typeof c!="string"&&"length"in c){R(typeof p!="string"&&"length"in p);for(var y=0,_=c.length;y<_;++y)X(a,c[y],p[y])}else{var N,M,O=c.indexOf(".");O!==-1?(N=c.substr(0,O),(O=c.substr(O+1))===""?p===void 0?m(a)&&!isNaN(parseInt(N))?a.splice(N,1):delete a[N]:a[N]=p:X(M=(M=a[N])&&x(a,N)?M:a[N]={},O,p)):p===void 0?m(a)&&!isNaN(parseInt(c))?a.splice(c,1):delete a[c]:a[c]=p}}function fe(a){var c,p={};for(c in a)x(a,c)&&(p[c]=a[c]);return p}var pe=[].concat;function _e(a){return pe.apply([],a)}var H="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(_e([8,16,32,64].map(function(a){return["Int","Uint","Float"].map(function(c){return c+a+"Array"})}))).filter(function(a){return f[a]}),U=new Set(H.map(function(a){return f[a]})),ce=null;function xe(a){return ce=new WeakMap,a=(function c(p){if(!p||typeof p!="object")return p;var y=ce.get(p);if(y)return y;if(m(p)){y=[],ce.set(p,y);for(var _=0,N=p.length;_<N;++_)y.push(c(p[_]))}else if(U.has(p.constructor))y=p;else{var M,O=w(p);for(M in y=O===Object.prototype?{}:Object.create(O),ce.set(p,y),p)x(p,M)&&(y[M]=c(p[M]))}return y})(a),ce=null,a}var D={}.toString;function le(a){return D.call(a).slice(8,-1)}var Q=typeof Symbol<"u"?Symbol.iterator:"@@iterator",ie=typeof Q=="symbol"?function(a){var c;return a!=null&&(c=a[Q])&&c.apply(a)}:function(){return null};function z(a,c){c=a.indexOf(c),0<=c&&a.splice(c,1)}var K={};function F(a){var c,p,y,_;if(arguments.length===1){if(m(a))return a.slice();if(this===K&&typeof a=="string")return[a];if(_=ie(a))for(p=[];!(y=_.next()).done;)p.push(y.value);else{if(a==null)return[a];if(typeof(c=a.length)!="number")return[a];for(p=new Array(c);c--;)p[c]=a[c]}}else for(c=arguments.length,p=new Array(c);c--;)p[c]=arguments[c];return p}var $=typeof Symbol<"u"?function(a){return a[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},H=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Nt=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(H),we={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,c){this.name=a,this.message=c}function Me(a,c){return a+". Errors: "+Object.keys(c).map(function(p){return c[p].toString()}).filter(function(p,y,_){return _.indexOf(p)===y}).join(`
179
+ `)}function $e(a,c,p,y){this.failures=c,this.failedKeys=y,this.successCount=p,this.message=Me(a,c)}function Ae(a,c){this.name="BulkError",this.failures=Object.keys(c).map(function(p){return c[p]}),this.failuresByPos=c,this.message=Me(a,this.failures)}T(Se).from(Error).extend({toString:function(){return this.name+": "+this.message}}),T($e).from(Se),T(Ae).from(Se);var be=Nt.reduce(function(a,c){return a[c]=c+"Error",a},{}),Be=Se,ke=Nt.reduce(function(a,c){var p=c+"Error";function y(_,N){this.name=p,_?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=we[c]||p,this.inner=null)}return T(y).from(Be),a[c]=y,a},{}),He=(ke.Syntax=SyntaxError,ke.Type=TypeError,ke.Range=RangeError,H.reduce(function(a,c){return a[c+"Error"]=ke[c],a},{}));H=Nt.reduce(function(a,c){return["Syntax","Type","Range"].indexOf(c)===-1&&(a[c+"Error"]=ke[c]),a},{});function Oe(){}function qe(a){return a}function ut(a,c){return a==null||a===qe?c:function(p){return c(a(p))}}function ct(a,c){return function(){a.apply(this,arguments),c.apply(this,arguments)}}function it(a,c){return a===Oe?c:function(){var p=a.apply(this,arguments),y=(p!==void 0&&(arguments[0]=p),this.onsuccess),_=this.onerror,N=(this.onsuccess=null,this.onerror=null,c.apply(this,arguments));return y&&(this.onsuccess=this.onsuccess?ct(y,this.onsuccess):y),_&&(this.onerror=this.onerror?ct(_,this.onerror):_),N!==void 0?N:p}}function Tt(a,c){return a===Oe?c:function(){a.apply(this,arguments);var p=this.onsuccess,y=this.onerror;this.onsuccess=this.onerror=null,c.apply(this,arguments),p&&(this.onsuccess=this.onsuccess?ct(p,this.onsuccess):p),y&&(this.onerror=this.onerror?ct(y,this.onerror):y)}}function _t(a,c){return a===Oe?c:function(_){var y=a.apply(this,arguments),_=(v(_,y),this.onsuccess),N=this.onerror,M=(this.onsuccess=null,this.onerror=null,c.apply(this,arguments));return _&&(this.onsuccess=this.onsuccess?ct(_,this.onsuccess):_),N&&(this.onerror=this.onerror?ct(N,this.onerror):N),y===void 0?M===void 0?void 0:M:v(y,M)}}function Ht(a,c){return a===Oe?c:function(){return c.apply(this,arguments)!==!1&&a.apply(this,arguments)}}function Ot(a,c){return a===Oe?c:function(){var p=a.apply(this,arguments);if(p&&typeof p.then=="function"){for(var y=this,_=arguments.length,N=new Array(_);_--;)N[_]=arguments[_];return p.then(function(){return c.apply(y,N)})}return c.apply(this,arguments)}}H.ModifyError=$e,H.DexieError=Se,H.BulkError=Ae;var St=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function wn(a){St=a}var fn={},gr=100,bn=typeof Promise>"u"?[]:(Nt=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[bn=crypto.subtle.digest("SHA-512",new Uint8Array([0])),w(bn),Nt]:[Nt,w(Nt),Nt]),Nt=bn[0],po=bn[1],po=po&&po.then,Vt=Nt&&Nt.constructor,Hn=!!bn[2],tr=function(a,c){Un.push([a,c]),Pn&&(queueMicrotask(eo),Pn=!1)},_n=!0,Pn=!0,Vn=[],dn=[],nr=qe,Sn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Oe,pgp:!1,env:{},finalize:Oe},Ye=Sn,Un=[],kn=0,rr=[];function Ve(a){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var c=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&&yr(this,this._value)}else this._state=null,this._value=null,++c.ref,(function p(y,_){try{_(function(N){if(y._state===null){if(N===y)throw new TypeError("A promise cannot be resolved with itself.");var M=y._lib&&Nn();N&&typeof N.then=="function"?p(y,function(O,J){N instanceof Ve?N._then(O,J):N.then(O,J)}):(y._state=!0,y._value=N,Zr(y)),M&&Tn()}},yr.bind(null,y))}catch(N){yr(y,N)}})(this,a)}var Mn={get:function(){var a=Ye,c=rn;function p(y,_){var N=this,M=!a.global&&(a!==Ye||c!==rn),O=M&&!zt(),J=new Ve(function(ue,te){vr(N,new Kn(ci(y,a,M,O),ci(_,a,M,O),ue,te,a))});return this._consoleTask&&(J._consoleTask=this._consoleTask),J}return p.prototype=fn,p},set:function(a){j(this,"then",a&&a.prototype===fn?Mn:{get:function(){return a},set:Mn.set})}};function Kn(a,c,p,y,_){this.onFulfilled=typeof a=="function"?a:null,this.onRejected=typeof c=="function"?c:null,this.resolve=p,this.reject=y,this.psd=_}function yr(a,c){var p,y;dn.push(c),a._state===null&&(p=a._lib&&Nn(),c=nr(c),a._state=!1,a._value=c,y=a,Vn.some(function(_){return _._value===y._value})||Vn.push(y),Zr(a),p)&&Tn()}function Zr(a){var c=a._listeners;a._listeners=[];for(var p=0,y=c.length;p<y;++p)vr(a,c[p]);var _=a._PSD;--_.ref||_.finalize(),kn===0&&(++kn,tr(function(){--kn==0&&q()},[]))}function vr(a,c){if(a._state===null)a._listeners.push(c);else{var p=a._state?c.onFulfilled:c.onRejected;if(p===null)return(a._state?c.resolve:c.reject)(a._value);++c.psd.ref,++kn,tr(Io,[p,a,c])}}function Io(a,c,p){try{var y,_=c._value;!c._state&&dn.length&&(dn=[]),y=St&&c._consoleTask?c._consoleTask.run(function(){return a(_)}):a(_),c._state||dn.indexOf(_)!==-1||(N=>{for(var M=Vn.length;M;)if(Vn[--M]._value===N._value)return Vn.splice(M,1)})(c),p.resolve(y)}catch(N){p.reject(N)}finally{--kn==0&&q(),--p.psd.ref||p.psd.finalize()}}function eo(){ir(Sn,function(){Nn()&&Tn()})}function Nn(){var a=_n;return Pn=_n=!1,a}function Tn(){var a,c,p;do for(;0<Un.length;)for(a=Un,Un=[],p=a.length,c=0;c<p;++c){var y=a[c];y[0].apply(null,y[1])}while(0<Un.length);Pn=_n=!0}function q(){for(var a=Vn,c=(Vn=[],a.forEach(function(y){y._PSD.onunhandled.call(null,y._value,y)}),rr.slice(0)),p=c.length;p;)c[--p]()}function Fe(a){return new Ve(fn,!1,a)}function Le(a,c){var p=Ye;return function(){var y=Nn(),_=Ye;try{return In(p,!0),a.apply(this,arguments)}catch(N){c&&c(N)}finally{In(_,!1),y&&Tn()}}}S(Ve.prototype,{then:Mn,_then:function(a,c){vr(this,new Kn(null,null,a,c,Ye))},catch:function(a){var c,p;return arguments.length===1?this.then(null,a):(c=a,p=arguments[1],typeof c=="function"?this.then(null,function(y){return(y instanceof c?p:Fe)(y)}):this.then(null,function(y){return(y&&y.name===c?p:Fe)(y)}))},finally:function(a){return this.then(function(c){return Ve.resolve(a()).then(function(){return c})},function(c){return Ve.resolve(a()).then(function(){return Fe(c)})})},timeout:function(a,c){var p=this;return a<1/0?new Ve(function(y,_){var N=setTimeout(function(){return _(new ke.Timeout(c))},a);p.then(y,_).finally(clearTimeout.bind(null,N))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&j(Ve.prototype,Symbol.toStringTag,"Dexie.Promise"),Sn.env=ui(),S(Ve,{all:function(){var a=F.apply(null,arguments).map(Wn);return new Ve(function(c,p){a.length===0&&c([]);var y=a.length;a.forEach(function(_,N){return Ve.resolve(_).then(function(M){a[N]=M,--y||c(a)},p)})})},resolve:function(a){return a instanceof Ve?a:a&&typeof a.then=="function"?new Ve(function(c,p){a.then(c,p)}):new Ve(fn,!0,a)},reject:Fe,race:function(){var a=F.apply(null,arguments).map(Wn);return new Ve(function(c,p){a.map(function(y){return Ve.resolve(y).then(c,p)})})},PSD:{get:function(){return Ye},set:function(a){return Ye=a}},totalEchoes:{get:function(){return rn}},newPSD:on,usePSD:ir,scheduler:{get:function(){return tr},set:function(a){tr=a}},rejectionMapper:{get:function(){return nr},set:function(a){nr=a}},follow:function(a,c){return new Ve(function(p,y){return on(function(_,N){var M=Ye;M.unhandleds=[],M.onunhandled=N,M.finalize=ct(function(){var O,J=this;O=function(){J.unhandleds.length===0?_():N(J.unhandleds[0])},rr.push(function ue(){O(),rr.splice(rr.indexOf(ue),1)}),++kn,tr(function(){--kn==0&&q()},[])},M.finalize),a()},c,p,y)})}}),Vt&&(Vt.allSettled&&j(Ve,"allSettled",function(){var a=F.apply(null,arguments).map(Wn);return new Ve(function(c){a.length===0&&c([]);var p=a.length,y=new Array(p);a.forEach(function(_,N){return Ve.resolve(_).then(function(M){return y[N]={status:"fulfilled",value:M}},function(M){return y[N]={status:"rejected",reason:M}}).then(function(){return--p||c(y)})})})}),Vt.any&&typeof AggregateError<"u"&&j(Ve,"any",function(){var a=F.apply(null,arguments).map(Wn);return new Ve(function(c,p){a.length===0&&p(new AggregateError([]));var y=a.length,_=new Array(y);a.forEach(function(N,M){return Ve.resolve(N).then(function(O){return c(O)},function(O){_[M]=O,--y||p(new AggregateError(_))})})})}),Vt.withResolvers)&&(Ve.withResolvers=Vt.withResolvers);var nt={awaits:0,echoes:0,id:0},nn=0,Yt=[],Ut=0,rn=0,to=0;function on(a,M,p,y){var _=Ye,N=Object.create(_),M=(N.parent=_,N.ref=0,N.global=!1,N.id=++to,Sn.env,N.env=Hn?{Promise:Ve,PromiseProp:{value:Ve,configurable:!0,writable:!0},all:Ve.all,race:Ve.race,allSettled:Ve.allSettled,any:Ve.any,resolve:Ve.resolve,reject:Ve.reject}:{},M&&v(N,M),++_.ref,N.finalize=function(){--this.parent.ref||this.parent.finalize()},ir(N,a,p,y));return N.ref===0&&N.finalize(),M}function qn(){return nt.id||(nt.id=++nn),++nt.awaits,nt.echoes+=gr,nt.id}function zt(){return!!nt.awaits&&(--nt.awaits==0&&(nt.id=0),nt.echoes=nt.awaits*gr,!0)}function Wn(a){return nt.echoes&&a&&a.constructor===Vt?(qn(),a.then(function(c){return zt(),c},function(c){return zt(),Et(c)})):a}function or(){var a=Yt[Yt.length-1];Yt.pop(),In(a,!1)}function In(a,c){var p,y,_=Ye;(c?!nt.echoes||Ut++&&a===Ye:!Ut||--Ut&&a===Ye)||queueMicrotask(c?(function(N){++rn,nt.echoes&&--nt.echoes!=0||(nt.echoes=nt.awaits=nt.id=0),Yt.push(Ye),In(N,!0)}).bind(null,a):or),a!==Ye&&(Ye=a,_===Sn&&(Sn.env=ui()),Hn)&&(p=Sn.env.Promise,y=a.env,_.global||a.global)&&(Object.defineProperty(f,"Promise",y.PromiseProp),p.all=y.all,p.race=y.race,p.resolve=y.resolve,p.reject=y.reject,y.allSettled&&(p.allSettled=y.allSettled),y.any)&&(p.any=y.any)}function ui(){var a=f.Promise;return Hn?{Promise:a,PromiseProp:Object.getOwnPropertyDescriptor(f,"Promise"),all:a.all,race:a.race,allSettled:a.allSettled,any:a.any,resolve:a.resolve,reject:a.reject}:{}}function ir(a,c,p,y,_){var N=Ye;try{return In(a,!0),c(p,y,_)}finally{In(N,!1)}}function ci(a,c,p,y){return typeof a!="function"?a:function(){var _=Ye;p&&qn(),In(c,!0);try{return a.apply(this,arguments)}finally{In(_,!1),y&&queueMicrotask(zt)}}}function $o(a){Promise===Vt&&nt.echoes===0?Ut===0?a():enqueueNativeMicroTask(a):setTimeout(a,0)}(""+po).indexOf("[native code]")===-1&&(qn=zt=Oe);var Et=Ve.reject,sr="￿",gt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Bi="String expected.",Dr="__dbnames",Ao="readonly",Lr="readwrite";function xr(a,c){return a?c?function(){return a.apply(this,arguments)&&c.apply(this,arguments)}:a:c}var fi={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function ar(a){return typeof a!="string"||/\./.test(a)?function(c){return c}:function(c){return c[a]===void 0&&a in c&&delete(c=xe(c))[a],c}}function En(){throw ke.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function ft(a,c){try{var p=hn(a),y=hn(c);if(p!==y)return p==="Array"?1:y==="Array"?-1:p==="binary"?1:y==="binary"?-1:p==="string"?1:y==="string"?-1:p==="Date"?1:y!=="Date"?NaN:-1;switch(p){case"number":case"Date":case"string":return c<a?1:a<c?-1:0;case"binary":for(var _=Hi(a),N=Hi(c),M=_.length,O=N.length,J=M<O?M:O,ue=0;ue<J;++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,G=c,Z=te.length,ae=G.length,oe=Z<ae?Z:ae,re=0;re<oe;++re){var se=ft(te[re],G[re]);if(se!==0)return se}return Z===ae?0:Z<ae?-1:1}}catch{}return NaN}function hn(a){var c=typeof a;return c=="object"&&(ArrayBuffer.isView(a)||(c=le(a))==="ArrayBuffer")?"binary":c}function Hi(a){return a instanceof Uint8Array?a:ArrayBuffer.isView(a)?new Uint8Array(a.buffer,a.byteOffset,a.byteLength):new Uint8Array(a)}function Oo(a,c,p){var y=a.schema.yProps;return y?(c&&0<p.numFailures&&(c=c.filter(function(_,N){return!p.failures[N]})),Promise.all(y.map(function(_){return _=_.updatesTable,c?a.db.table(_).where("k").anyOf(c).delete():a.db.table(_).clear()})).then(function(){return p})):p}ro.prototype.execute=function(a){var c=this["@@propmod"];if(c.add!==void 0){var p=c.add;if(m(p))return u(u([],m(a)?a:[],!0),p).sort();if(typeof p=="number")return(Number(a)||0)+p;if(typeof p=="bigint")try{return BigInt(a)+p}catch{return BigInt(0)+p}throw new TypeError("Invalid term ".concat(p))}if(c.remove!==void 0){var y=c.remove;if(m(y))return m(a)?a.filter(function(_){return!y.includes(_)}).sort():[];if(typeof y=="number")return Number(a)-y;if(typeof y=="bigint")try{return BigInt(a)-y}catch{return BigInt(0)-y}throw new TypeError("Invalid subtrahend ".concat(y))}return p=(p=c.replacePrefix)==null?void 0:p[0],p&&typeof a=="string"&&a.startsWith(p)?c.replacePrefix[1]+a.substring(p.length):a};var no=ro;function ro(a){this["@@propmod"]=a}function oo(a,c){for(var p=d(c),y=p.length,_=!1,N=0;N<y;++N){var M=p[N],O=c[M],J=B(a,M);O instanceof no?(X(a,M,O.execute(J)),_=!0):J!==O&&(X(a,M,O),_=!0)}return _}yt.prototype._trans=function(a,c,p){var y=this._tx||Ye.trans,_=this.name,N=St&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(a==="readonly"?"read":"write"," ").concat(this.name));function M(ue,te,G){if(G.schema[_])return c(G.idbtrans,G);throw new ke.NotFound("Table "+_+" not part of transaction")}var O=Nn();try{var J=y&&y.db._novip===this.db._novip?y===Ye.trans?y._promise(a,M,p):on(function(){return y._promise(a,M,p)},{trans:y,transless:Ye.transless||Ye}):(function ue(te,G,Z,ae){if(te.idbdb&&(te._state.openComplete||Ye.letThrough||te._vip)){var oe=te._createTransaction(G,Z,te._dbSchema);try{oe.create(),te._state.PR1398_maxLoop=3}catch(re){return re.name===be.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,G,Z,ae)})):Et(re)}return oe._promise(G,function(re,se){return on(function(){return Ye.trans=oe,ae(re,se,oe)})}).then(function(re){if(G==="readwrite")try{oe.idbtrans.commit()}catch{}return G==="readonly"?re:oe._completion.then(function(){return re})})}if(te._state.openComplete)return Et(new ke.DatabaseClosed(te._state.dbOpenError));if(!te._state.isBeingOpened){if(!te._state.autoOpen)return Et(new ke.DatabaseClosed);te.open().catch(Oe)}return te._state.dbReadyPromise.then(function(){return ue(te,G,Z,ae)})})(this.db,a,[this.name],M);return N&&(J._consoleTask=N,J=J.catch(function(ue){return console.trace(ue),Et(ue)})),J}finally{O&&Tn()}},yt.prototype.get=function(a,c){var p=this;return a&&a.constructor===Object?this.where(a).first(c):a==null?Et(new ke.Type("Invalid argument to Table.get()")):this._trans("readonly",function(y){return p.core.get({trans:y,key:a}).then(function(_){return p.hook.reading.fire(_)})}).then(c)},yt.prototype.where=function(a){if(typeof a=="string")return new this.db.WhereClause(this,a);if(m(a))return new this.db.WhereClause(this,"[".concat(a.join("+"),"]"));var c=d(a);if(c.length===1)return this.where(c[0]).equals(a[c[0]]);var p=this.schema.indexes.concat(this.schema.primKey).filter(function(O){if(O.compound&&c.every(function(ue){return 0<=O.keyPath.indexOf(ue)})){for(var J=0;J<c.length;++J)if(c.indexOf(O.keyPath[J])===-1)return!1;return!0}return!1}).sort(function(O,J){return O.keyPath.length-J.keyPath.length})[0];if(p&&this.db._maxKey!==sr)return M=p.keyPath.slice(0,c.length),this.where(M).equals(M.map(function(O){return a[O]}));!p&&St&&console.warn("The query ".concat(JSON.stringify(a)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(c.join("+"),"]"));var y=this.schema.idxByName;function _(O,J){return ft(O,J)===0}var M=c.reduce(function(te,J){var ue=te[0],te=te[1],G=y[J],Z=a[J];return[ue||G,ue||!G?xr(te,G&&G.multi?function(ae){return ae=B(ae,J),m(ae)&&ae.some(function(oe){return _(Z,oe)})}:function(ae){return _(Z,B(ae,J))}):te]},[null,null]),N=M[0],M=M[1];return N?this.where(N.name).equals(a[N.keyPath]).filter(M):p?this.filter(M):this.where(c).equals("")},yt.prototype.filter=function(a){return this.toCollection().and(a)},yt.prototype.count=function(a){return this.toCollection().count(a)},yt.prototype.offset=function(a){return this.toCollection().offset(a)},yt.prototype.limit=function(a){return this.toCollection().limit(a)},yt.prototype.each=function(a){return this.toCollection().each(a)},yt.prototype.toArray=function(a){return this.toCollection().toArray(a)},yt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},yt.prototype.orderBy=function(a){return new this.db.Collection(new this.db.WhereClause(this,m(a)?"[".concat(a.join("+"),"]"):a))},yt.prototype.reverse=function(){return this.toCollection().reverse()},yt.prototype.mapToClass=function(a){for(var c=this.db,p=this.name,y=((this.schema.mappedClass=a).prototype instanceof En&&(a=(M=>{var O=te,J=M;if(typeof J!="function"&&J!==null)throw new TypeError("Class extends value "+String(J)+" is not a constructor or null");function ue(){this.constructor=O}function te(){return M!==null&&M.apply(this,arguments)||this}return i(O,J),O.prototype=J===null?Object.create(J):(ue.prototype=J.prototype,new ue),Object.defineProperty(te.prototype,"db",{get:function(){return c},enumerable:!1,configurable:!0}),te.prototype.table=function(){return p},te})(a)),new Set),_=a.prototype;_;_=w(_))Object.getOwnPropertyNames(_).forEach(function(M){return y.add(M)});function N(M){if(!M)return M;var O,J=Object.create(a.prototype);for(O in M)if(!y.has(O))try{J[O]=M[O]}catch{}return J}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=N,this.hook("reading",N),a},yt.prototype.defineClass=function(){return this.mapToClass(function(a){v(this,a)})},yt.prototype.add=function(a,c){var p=this,y=this.schema.primKey,_=y.auto,N=y.keyPath,M=a;return N&&_&&(M=ar(N)(a)),this._trans("readwrite",function(O){return p.core.mutate({trans:O,type:"add",keys:c!=null?[c]:null,values:[M]})}).then(function(O){return O.numFailures?Ve.reject(O.failures[0]):O.lastResult}).then(function(O){if(N)try{X(a,N,O)}catch{}return O})},yt.prototype.upsert=function(a,c){var p=this,y=this.schema.primKey.keyPath;return this._trans("readwrite",function(_){return p.core.get({trans:_,key:a}).then(function(N){var M=N??{};return oo(M,c),y&&X(M,y,a),p.core.mutate({trans:_,type:"put",values:[M],keys:[a],upsert:!0,updates:{keys:[a],changeSpecs:[c]}}).then(function(O){return O.numFailures?Ve.reject(O.failures[0]):!!N})})})},yt.prototype.update=function(a,c){return typeof a!="object"||m(a)?this.where(":id").equals(a).modify(c):(a=B(a,this.schema.primKey.keyPath))===void 0?Et(new ke.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(a).modify(c)},yt.prototype.put=function(a,c){var p=this,y=this.schema.primKey,_=y.auto,N=y.keyPath,M=a;return N&&_&&(M=ar(N)(a)),this._trans("readwrite",function(O){return p.core.mutate({trans:O,type:"put",values:[M],keys:c!=null?[c]:null})}).then(function(O){return O.numFailures?Ve.reject(O.failures[0]):O.lastResult}).then(function(O){if(N)try{X(a,N,O)}catch{}return O})},yt.prototype.delete=function(a){var c=this;return this._trans("readwrite",function(p){return c.core.mutate({trans:p,type:"delete",keys:[a]}).then(function(y){return Oo(c,[a],y)}).then(function(y){return y.numFailures?Ve.reject(y.failures[0]):void 0})})},yt.prototype.clear=function(){var a=this;return this._trans("readwrite",function(c){return a.core.mutate({trans:c,type:"deleteRange",range:fi}).then(function(p){return Oo(a,null,p)})}).then(function(c){return c.numFailures?Ve.reject(c.failures[0]):void 0})},yt.prototype.bulkGet=function(a){var c=this;return this._trans("readonly",function(p){return c.core.getMany({keys:a,trans:p}).then(function(y){return y.map(function(_){return c.hook.reading.fire(_)})})})},yt.prototype.bulkAdd=function(a,c,p){var y=this,_=Array.isArray(c)?c:void 0,N=(p=p||(_?void 0:c))?p.allKeys:void 0;return this._trans("readwrite",function(M){var O=y.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 J=a.length,ue=O&&ue?a.map(ar(O)):a;return y.core.mutate({trans:M,type:"add",keys:_,values:ue,wantResults:N}).then(function(te){var G=te.numFailures,Z=te.failures;if(G===0)return N?te.results:te.lastResult;throw new Ae("".concat(y.name,".bulkAdd(): ").concat(G," of ").concat(J," operations failed"),Z)})})},yt.prototype.bulkPut=function(a,c,p){var y=this,_=Array.isArray(c)?c:void 0,N=(p=p||(_?void 0:c))?p.allKeys:void 0;return this._trans("readwrite",function(M){var O=y.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 J=a.length,ue=O&&ue?a.map(ar(O)):a;return y.core.mutate({trans:M,type:"put",keys:_,values:ue,wantResults:N}).then(function(te){var G=te.numFailures,Z=te.failures;if(G===0)return N?te.results:te.lastResult;throw new Ae("".concat(y.name,".bulkPut(): ").concat(G," of ").concat(J," operations failed"),Z)})})},yt.prototype.bulkUpdate=function(a){var c=this,p=this.core,y=a.map(function(M){return M.key}),_=a.map(function(M){return M.changes}),N=[];return this._trans("readwrite",function(M){return p.getMany({trans:M,keys:y,cache:"clone"}).then(function(O){var J=[],ue=[],te=(a.forEach(function(G,Z){var ae=G.key,oe=G.changes,re=O[Z];if(re){for(var se=0,ge=Object.keys(oe);se<ge.length;se++){var de=ge[se],ve=oe[de];if(de===c.schema.primKey.keyPath){if(ft(ve,ae)!==0)throw new ke.Constraint("Cannot update primary key in bulkUpdate()")}else X(re,de,ve)}N.push(Z),J.push(ae),ue.push(re)}}),J.length);return p.mutate({trans:M,type:"put",keys:J,values:ue,updates:{keys:y,changeSpecs:_}}).then(function(G){var Z=G.numFailures,ae=G.failures;if(Z===0)return te;for(var oe=0,re=Object.keys(ae);oe<re.length;oe++){var se,ge=re[oe],de=N[Number(ge)];de!=null&&(se=ae[ge],delete ae[ge],ae[de]=se)}throw new Ae("".concat(c.name,".bulkUpdate(): ").concat(Z," of ").concat(te," operations failed"),ae)})})})},yt.prototype.bulkDelete=function(a){var c=this,p=a.length;return this._trans("readwrite",function(y){return c.core.mutate({trans:y,type:"delete",keys:a}).then(function(_){return Oo(c,a,_)})}).then(function(y){var _=y.numFailures,N=y.failures;if(_===0)return y.lastResult;throw new Ae("".concat(c.name,".bulkDelete(): ").concat(_," of ").concat(p," operations failed"),N)})};var Yn=yt;function yt(){}function zr(a){function c(M,O){if(O){for(var J=arguments.length,ue=new Array(J-1);--J;)ue[J-1]=arguments[J];return p[M].subscribe.apply(null,ue),a}if(typeof M=="string")return p[M]}var p={};c.addEventType=N;for(var y=1,_=arguments.length;y<_;++y)N(arguments[y]);return c;function N(M,O,J){var ue,te;if(typeof M!="object")return O=O||Ht,te={subscribers:[],fire:J=J||Oe,subscribe:function(G){te.subscribers.indexOf(G)===-1&&(te.subscribers.push(G),te.fire=O(te.fire,G))},unsubscribe:function(G){te.subscribers=te.subscribers.filter(function(Z){return Z!==G}),te.fire=te.subscribers.reduce(O,J)}},p[M]=c[M]=te;d(ue=M).forEach(function(G){var Z=ue[G];if(m(Z))N(G,ue[G][0],ue[G][1]);else{if(Z!=="asap")throw new ke.InvalidArgument("Invalid event config");var ae=N(G,qe,function(){for(var oe=arguments.length,re=new Array(oe);oe--;)re[oe]=arguments[oe];ae.subscribers.forEach(function(se){W(function(){se.apply(null,re)})})})}})}}function io(a,c){return T(c).from({prototype:a}),c}function lr(a,c){return!(a.filter||a.algorithm||a.or)&&(c?a.justLimit:!a.replayFilter)}function Fr(a,c){a.filter=xr(a.filter,c)}function so(a,c,p){var y=a.replayFilter;a.replayFilter=y?function(){return xr(y(),c())}:c,a.justLimit=p&&!y}function ur(a,c){if(a.isPrimKey)return c.primaryKey;var p=c.getIndexByKeyPath(a.index);if(p)return p;throw new ke.Schema("KeyPath "+a.index+" on object store "+c.name+" is not indexed")}function di(a,c,p){var y=ur(a,c.schema);return c.openCursor({trans:p,values:!a.keysOnly,reverse:a.dir==="prev",unique:!!a.unique,query:{index:y,range:a.range}})}function Ro(a,c,p,y){var _,N,M=a.replayFilter?xr(a.filter,a.replayFilter()):a.filter;return a.or?(_={},N=function(O,J,ue){var te,G;M&&!M(J,ue,function(Z){return J.stop(Z)},function(Z){return J.fail(Z)})||((G=""+(te=J.primaryKey))=="[object ArrayBuffer]"&&(G=""+new Uint8Array(te)),x(_,G))||(_[G]=!0,c(O,J,ue))},Promise.all([a.or._iterate(N,p),xt(di(a,y,p),a.algorithm,N,!a.keysOnly&&a.valueMapper)])):xt(di(a,y,p),xr(a.algorithm,M),c,!a.keysOnly&&a.valueMapper)}function xt(a,c,p,y){var _=Le(y?function(N,M,O){return p(y(N),M,O)}:p);return a.then(function(N){if(N)return N.start(function(){var M=function(){return N.continue()};c&&!c(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()})})}pt.prototype._read=function(a,c){var p=this._ctx;return p.error?p.table._trans(null,Et.bind(null,p.error)):p.table._trans("readonly",a).then(c)},pt.prototype._write=function(a){var c=this._ctx;return c.error?c.table._trans(null,Et.bind(null,c.error)):c.table._trans("readwrite",a,"locked")},pt.prototype._addAlgorithm=function(a){var c=this._ctx;c.algorithm=xr(c.algorithm,a)},pt.prototype._iterate=function(a,c){return Ro(this._ctx,a,c,this._ctx.table.core)},pt.prototype.clone=function(a){var c=Object.create(this.constructor.prototype),p=Object.create(this._ctx);return a&&v(p,a),c._ctx=p,c},pt.prototype.raw=function(){return this._ctx.valueMapper=null,this},pt.prototype.each=function(a){var c=this._ctx;return this._read(function(p){return Ro(c,a,p,c.table.core)})},pt.prototype.count=function(a){var c=this;return this._read(function(p){var y,_=c._ctx,N=_.table.core;return lr(_,!0)?N.count({trans:p,query:{index:ur(_,N.schema),range:_.range}}).then(function(M){return Math.min(M,_.limit)}):(y=0,Ro(_,function(){return++y,!1},p,N).then(function(){return y}))}).then(a)},pt.prototype.sortBy=function(a,c){var p=a.split(".").reverse(),y=p[0],_=p.length-1;function N(J,ue){return ue?N(J[p[ue]],ue-1):J[y]}var M=this._ctx.dir==="next"?1:-1;function O(J,ue){return ft(N(J,_),N(ue,_))*M}return this.toArray(function(J){return J.sort(O)}).then(c)},pt.prototype.toArray=function(a){var c=this;return this._read(function(p){var y,_,N,M=c._ctx;return lr(M,!0)&&0<M.limit?(y=M.valueMapper,_=ur(M,M.table.core.schema),M.table.core.query({trans:p,limit:M.limit,values:!0,direction:M.dir==="prev"?"prev":void 0,query:{index:_,range:M.range}}).then(function(O){return O=O.result,y?O.map(y):O})):(N=[],Ro(M,function(O){return N.push(O)},p,M.table.core).then(function(){return N}))},a)},pt.prototype.offset=function(a){var c=this._ctx;return a<=0||(c.offset+=a,lr(c)?so(c,function(){var p=a;return function(y,_){return p===0||(p===1?--p:_(function(){y.advance(p),p=0}),!1)}}):so(c,function(){var p=a;return function(){return--p<0}})),this},pt.prototype.limit=function(a){return this._ctx.limit=Math.min(this._ctx.limit,a),so(this._ctx,function(){var c=a;return function(p,y,_){return--c<=0&&y(_),0<=c}},!0),this},pt.prototype.until=function(a,c){return Fr(this._ctx,function(p,y,_){return!a(p.value)||(y(_),c)}),this},pt.prototype.first=function(a){return this.limit(1).toArray(function(c){return c[0]}).then(a)},pt.prototype.last=function(a){return this.reverse().first(a)},pt.prototype.filter=function(a){var c;return Fr(this._ctx,function(p){return a(p.value)}),(c=this._ctx).isMatch=xr(c.isMatch,a),this},pt.prototype.and=function(a){return this.filter(a)},pt.prototype.or=function(a){return new this.db.WhereClause(this._ctx.table,a,this)},pt.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},pt.prototype.desc=function(){return this.reverse()},pt.prototype.eachKey=function(a){var c=this._ctx;return c.keysOnly=!c.isMatch,this.each(function(p,y){a(y.key,y)})},pt.prototype.eachUniqueKey=function(a){return this._ctx.unique="unique",this.eachKey(a)},pt.prototype.eachPrimaryKey=function(a){var c=this._ctx;return c.keysOnly=!c.isMatch,this.each(function(p,y){a(y.primaryKey,y)})},pt.prototype.keys=function(a){var c=this._ctx,p=(c.keysOnly=!c.isMatch,[]);return this.each(function(y,_){p.push(_.key)}).then(function(){return p}).then(a)},pt.prototype.primaryKeys=function(a){var c=this._ctx;if(lr(c,!0)&&0<c.limit)return this._read(function(y){var _=ur(c,c.table.core.schema);return c.table.core.query({trans:y,values:!1,limit:c.limit,direction:c.dir==="prev"?"prev":void 0,query:{index:_,range:c.range}})}).then(function(y){return y.result}).then(a);c.keysOnly=!c.isMatch;var p=[];return this.each(function(y,_){p.push(_.primaryKey)}).then(function(){return p}).then(a)},pt.prototype.uniqueKeys=function(a){return this._ctx.unique="unique",this.keys(a)},pt.prototype.firstKey=function(a){return this.limit(1).keys(function(c){return c[0]}).then(a)},pt.prototype.lastKey=function(a){return this.reverse().firstKey(a)},pt.prototype.distinct=function(){var a,c=this._ctx,c=c.index&&c.table.schema.idxByName[c.index];return c&&c.multi&&(a={},Fr(this._ctx,function(y){var y=y.primaryKey.toString(),_=x(a,y);return a[y]=!0,!_})),this},pt.prototype.modify=function(a){var c=this,p=this._ctx;return this._write(function(y){function _(re,se){var ge=se.failures;Z+=re-se.numFailures;for(var de=0,ve=d(ge);de<ve.length;de++){var Ne=ve[de];G.push(ge[Ne])}}var N=typeof a=="function"?a:function(re){return oo(re,a)},M=p.table.core,te=M.schema.primaryKey,O=te.outbound,J=te.extractKey,ue=200,te=c.db._options.modifyChunkSize,G=(te&&(ue=typeof te=="object"?te[M.name]||te["*"]||200:te),[]),Z=0,ae=[],oe=a===Vi;return c.clone().primaryKeys().then(function(re){function se(de){var ve=Math.min(ue,re.length-de),Ne=re.slice(de,de+ve);return(oe?Promise.resolve([]):M.getMany({trans:y,keys:Ne,cache:"immutable"})).then(function(Ce){var De=[],Te=[],Ue=O?[]:null,Re=oe?Ne:[];if(!oe)for(var We=0;We<ve;++We){var Ee=Ce[We],rt={value:xe(Ee),primKey:re[de+We]};N.call(rt,rt.value,rt)!==!1&&(rt.value==null?Re.push(re[de+We]):O||ft(J(Ee),J(rt.value))===0?(Te.push(rt.value),O&&Ue.push(re[de+We])):(Re.push(re[de+We]),De.push(rt.value)))}return Promise.resolve(0<De.length&&M.mutate({trans:y,type:"add",values:De}).then(function(ot){for(var lt in ot.failures)Re.splice(parseInt(lt),1);_(De.length,ot)})).then(function(){return(0<Te.length||ge&&typeof a=="object")&&M.mutate({trans:y,type:"put",keys:Ue,values:Te,criteria:ge,changeSpec:typeof a!="function"&&a,isAdditionalChunk:0<de}).then(function(ot){return _(Te.length,ot)})}).then(function(){return(0<Re.length||ge&&oe)&&M.mutate({trans:y,type:"delete",keys:Re,criteria:ge,isAdditionalChunk:0<de}).then(function(ot){return Oo(p.table,Re,ot)}).then(function(ot){return _(Re.length,ot)})}).then(function(){return re.length>de+ve&&se(de+ue)})})}var ge=lr(p)&&p.limit===1/0&&(typeof a!="function"||oe)&&{index:p.index,range:p.range};return se(0).then(function(){if(0<G.length)throw new $e("Error modifying one or more objects",G,Z,ae);return re.length})})})},pt.prototype.delete=function(){var a=this._ctx,c=a.range;return!lr(a)||a.table.schema.yProps||!a.isPrimKey&&c.type!==3?this.modify(Vi):this._write(function(p){var y=a.table.core.schema.primaryKey,_=c;return a.table.core.count({trans:p,query:{index:y,range:_}}).then(function(N){return a.table.core.mutate({trans:p,type:"deleteRange",range:_}).then(function(J){var O=J.failures,J=J.numFailures;if(J)throw new $e("Could not delete some values",Object.keys(O).map(function(ue){return O[ue]}),N-J);return N-J})})})};var Ba=pt;function pt(){}var Vi=function(a,c){return c.value=null};function Ha(a,c){return a<c?-1:a===c?0:1}function Va(a,c){return c<a?-1:a===c?0:1}function pn(a,c,p){return a=a instanceof br?new a.Collection(a):a,a._ctx.error=new(p||TypeError)(c),a}function Br(a){return new a.Collection(a,function(){return wr("")}).limit(0)}function ao(ae,c,p,y){var _,N,M,O,J,ue,te,G=p.length;if(!p.every(function(re){return typeof re=="string"}))return pn(ae,Bi);function Z(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=p.map(function(ge){return{lower:N(ge),upper:_(ge)}}).sort(function(ge,de){return M(ge.lower,de.lower)});O=se.map(function(ge){return ge.upper}),J=se.map(function(ge){return ge.lower}),te=(ue=re)==="next"?"":y}Z("next");var ae=new ae.Collection(ae,function(){return sn(O[0],J[G-1]+y)}),oe=(ae._ondirectionchange=function(re){Z(re)},0);return ae._addAlgorithm(function(re,se,ge){var de=re.key;if(typeof de=="string"){var ve=N(de);if(c(ve,J,oe))return!0;for(var Ne=null,Ce=oe;Ce<G;++Ce){var De=((Te,Ue,Re,We,Ee,rt)=>{for(var ot=Math.min(Te.length,We.length),lt=-1,dt=0;dt<ot;++dt){var mn=Ue[dt];if(mn!==We[dt])return Ee(Te[dt],Re[dt])<0?Te.substr(0,dt)+Re[dt]+Re.substr(dt+1):Ee(Te[dt],We[dt])<0?Te.substr(0,dt)+We[dt]+Re.substr(dt+1):0<=lt?Te.substr(0,lt)+Ue[lt]+Re.substr(lt+1):null;Ee(Te[dt],mn)<0&&(lt=dt)}return ot<We.length&&rt==="next"?Te+Re.substr(Te.length):ot<Te.length&&rt==="prev"?Te.substr(0,Re.length):lt<0?null:Te.substr(0,lt)+We[lt]+Re.substr(lt+1)})(de,ve,O[Ce],J[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,c,p,y){return{type:2,lower:a,upper:c,lowerOpen:p,upperOpen:y}}function wr(a){return{type:1,lower:a,upper:a}}Object.defineProperty(It.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),It.prototype.between=function(a,c,p,y){p=p!==!1,y=y===!0;try{return 0<this._cmp(a,c)||this._cmp(a,c)===0&&(p||y)&&(!p||!y)?Br(this):new this.Collection(this,function(){return sn(a,c,!p,!y)})}catch{return pn(this,gt)}},It.prototype.equals=function(a){return a==null?pn(this,gt):new this.Collection(this,function(){return wr(a)})},It.prototype.above=function(a){return a==null?pn(this,gt):new this.Collection(this,function(){return sn(a,void 0,!0)})},It.prototype.aboveOrEqual=function(a){return a==null?pn(this,gt):new this.Collection(this,function(){return sn(a,void 0,!1)})},It.prototype.below=function(a){return a==null?pn(this,gt):new this.Collection(this,function(){return sn(void 0,a,!1,!0)})},It.prototype.belowOrEqual=function(a){return a==null?pn(this,gt):new this.Collection(this,function(){return sn(void 0,a)})},It.prototype.startsWith=function(a){return typeof a!="string"?pn(this,Bi):this.between(a,a+sr,!0,!0)},It.prototype.startsWithIgnoreCase=function(a){return a===""?this.startsWith(a):ao(this,function(c,p){return c.indexOf(p[0])===0},[a],sr)},It.prototype.equalsIgnoreCase=function(a){return ao(this,function(c,p){return c===p[0]},[a],"")},It.prototype.anyOfIgnoreCase=function(){var a=F.apply(K,arguments);return a.length===0?Br(this):ao(this,function(c,p){return p.indexOf(c)!==-1},a,"")},It.prototype.startsWithAnyOfIgnoreCase=function(){var a=F.apply(K,arguments);return a.length===0?Br(this):ao(this,function(c,p){return p.some(function(y){return c.indexOf(y)===0})},a,sr)},It.prototype.anyOf=function(){var a,c,p=this,y=F.apply(K,arguments),_=this._cmp;try{y.sort(_)}catch{return pn(this,gt)}return y.length===0?Br(this):((a=new this.Collection(this,function(){return sn(y[0],y[y.length-1])}))._ondirectionchange=function(N){_=N==="next"?p._ascending:p._descending,y.sort(_)},c=0,a._addAlgorithm(function(N,M,O){for(var J=N.key;0<_(J,y[c]);)if(++c===y.length)return M(O),!1;return _(J,y[c])===0||(M(function(){N.continue(y[c])}),!1)}),a)},It.prototype.notEqual=function(a){return this.inAnyRange([[-1/0,a],[a,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},It.prototype.noneOf=function(){var a=F.apply(K,arguments);if(a.length===0)return new this.Collection(this);try{a.sort(this._ascending)}catch{return pn(this,gt)}var c=a.reduce(function(p,y){return p?p.concat([[p[p.length-1][1],y]]):[[-1/0,y]]},null);return c.push([a[a.length-1],this.db._maxKey]),this.inAnyRange(c,{includeLowers:!1,includeUppers:!1})},It.prototype.inAnyRange=function(a,ge){var p=this,y=this._cmp,_=this._ascending,N=this._descending,M=this._min,O=this._max;if(a.length===0)return Br(this);if(!a.every(function(de){return de[0]!==void 0&&de[1]!==void 0&&_(de[0],de[1])<=0}))return pn(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 J=!ge||ge.includeLowers!==!1,ue=ge&&ge.includeUppers===!0,te,G=_;function Z(de,ve){return G(de[0],ve[0])}try{(te=a.reduce(function(de,ve){for(var Ne=0,Ce=de.length;Ne<Ce;++Ne){var De=de[Ne];if(y(ve[0],De[1])<0&&0<y(ve[1],De[0])){De[0]=M(De[0],ve[0]),De[1]=O(De[1],ve[1]);break}}return Ne===Ce&&de.push(ve),de},[])).sort(Z)}catch{return pn(this,gt)}var ae=0,oe=ue?function(de){return 0<_(de,te[ae][1])}:function(de){return 0<=_(de,te[ae][1])},re=J?function(de){return 0<N(de,te[ae][0])}:function(de){return 0<=N(de,te[ae][0])},se=oe,ge=new this.Collection(this,function(){return sn(te[0][0],te[te.length-1][1],!J,!ue)});return ge._ondirectionchange=function(de){G=de==="next"?(se=oe,_):(se=re,N),te.sort(Z)},ge._addAlgorithm(function(de,ve,Ne){for(var Ce,De=de.key;se(De);)if(++ae===te.length)return ve(Ne),!1;return!oe(Ce=De)&&!re(Ce)||(p._cmp(De,te[ae][1])===0||p._cmp(De,te[ae][0])===0||ve(function(){G===_?de.continue(te[ae][0]):de.continue(te[ae][1])}),!1)}),ge},It.prototype.startsWithAnyOf=function(){var a=F.apply(K,arguments);return a.every(function(c){return typeof c=="string"})?a.length===0?Br(this):this.inAnyRange(a.map(function(c){return[c,c+sr]})):pn(this,"startsWithAnyOf() only works with strings")};var br=It;function It(){}function an(a){return Le(function(c){return $n(c),a(c.target.error),!1})}function $n(a){a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault()}var hi="storagemutated",Ui="x-storagemutated-1",An=zr(null,hi),Au=(Xn.prototype._lock=function(){return R(!Ye.global),++this._reculock,this._reculock!==1||Ye.global||(Ye.lockOwnerFor=this),this},Xn.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{ir(a[1],a[0])}catch{}}return this},Xn.prototype._locked=function(){return this._reculock&&Ye.lockOwnerFor!==this},Xn.prototype.create=function(a){var c=this;if(this.mode){var p=this.db.idbdb,y=this.db._state.dbOpenError;if(R(!this.idbtrans),!a&&!p)switch(y&&y.name){case"DatabaseClosedError":throw new ke.DatabaseClosed(y);case"MissingAPIError":throw new ke.MissingAPI(y.message,y);default:throw new ke.OpenFailed(y)}if(!this.active)throw new ke.TransactionInactive;R(this._completion._state===null),(a=this.idbtrans=a||(this.db.core||p).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Le(function(_){$n(_),c._reject(a.error)}),a.onabort=Le(function(_){$n(_),c.active&&c._reject(new ke.Abort(a.error)),c.active=!1,c.on("abort").fire(_)}),a.oncomplete=Le(function(){c.active=!1,c._resolve(),"mutatedParts"in a&&An.storagemutated.fire(a.mutatedParts)})}return this},Xn.prototype._promise=function(a,c,p){var y,_=this;return a==="readwrite"&&this.mode!=="readwrite"?Et(new ke.ReadOnly("Transaction is readonly")):this.active?this._locked()?new Ve(function(N,M){_._blockedFuncs.push([function(){_._promise(a,c,p).then(N,M)},Ye])}):p?on(function(){var N=new Ve(function(M,O){_._lock();var J=c(M,O,_);J&&J.then&&J.then(M,O)});return N.finally(function(){return _._unlock()}),N._lib=!0,N}):((y=new Ve(function(N,M){var O=c(N,M,_);O&&O.then&&O.then(N,M)}))._lib=!0,y):Et(new ke.TransactionInactive)},Xn.prototype._root=function(){return this.parent?this.parent._root():this},Xn.prototype.waitFor=function(a){var c,p=this._root(),y=Ve.resolve(a),_=(p._waitingFor?p._waitingFor=p._waitingFor.then(function(){return y}):(p._waitingFor=y,p._waitingQueue=[],c=p.idbtrans.objectStore(p.storeNames[0]),(function N(){for(++p._spinCount;p._waitingQueue.length;)p._waitingQueue.shift()();p._waitingFor&&(c.get(-1/0).onsuccess=N)})()),p._waitingFor);return new Ve(function(N,M){y.then(function(O){return p._waitingQueue.push(Le(N.bind(null,O)))},function(O){return p._waitingQueue.push(Le(M.bind(null,O)))}).finally(function(){p._waitingFor===_&&(p._waitingFor=null)})})},Xn.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new ke.Abort))},Xn.prototype.table=function(a){var c=this._memoizedTables||(this._memoizedTables={});if(x(c,a))return c[a];var p=this.schema[a];if(p)return(p=new this.db.Table(a,p,this)).core=this.db.core.table(a),c[a]=p;throw new ke.NotFound("Table "+a+" not part of transaction")},Xn);function Xn(){}function Do(a,c,p,y,_,N,M,O){return{name:a,keyPath:c,unique:p,multi:y,auto:_,compound:N,src:(p&&!M?"&":"")+(y?"*":"")+(_?"++":"")+Ds(c),type:O}}function Ds(a){return typeof a=="string"?a:a?"["+[].join.call(a,"+")+"]":""}function Ls(a,c,p){return{name:a,primKey:c,indexes:p,mappedClass:null,idxByName:(y=function(_){return[_.name,_]},p.reduce(function(_,N,M){return N=y(N,M),N&&(_[N[0]]=N[1]),_},{}))};var y}var _r=function(a){try{return a.only([[]]),_r=function(){return[[]]},[[]]}catch{return _r=function(){return sr},sr}};function lo(a){return a==null?function(){}:typeof a=="string"?(c=a).split(".").length===1?function(p){return p[c]}:function(p){return B(p,c)}:function(p){return B(p,a)};var c}function uo(a){return[].slice.call(a)}var Ki=0;function pi(a){return a==null?":id":typeof a=="string"?a:"[".concat(a.join("+"),"]")}function Ou(a,c,M){function y(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:c.upperBound(oe,!!se):oe===void 0?c.lowerBound(ae,!!re):c.bound(ae,oe,!!re,!!se)}function _(Z){var ae,oe,re=Z.name;return{name:re,schema:Z,mutate:function(se){var ge=se.trans,de=se.type,ve=se.keys,Ne=se.values,Ce=se.range;return new Promise(function(De,Te){De=Le(De);var Ue=ge.objectStore(re),Re=Ue.keyPath==null,We=de==="put"||de==="add";if(!We&&de!=="delete"&&de!=="deleteRange")throw new Error("Invalid operation type: "+de);var Ee,rt=(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(rt===0)return De({numFailures:0,failures:{},results:[],lastResult:void 0});function ot(ln){++mn,$n(ln)}var lt=[],dt=[],mn=0;if(de==="deleteRange"){if(Ce.type===4)return De({numFailures:mn,failures:dt,results:[],lastResult:void 0});Ce.type===3?lt.push(Ee=Ue.clear()):lt.push(Ee=Ue.delete(y(Ce)))}else{var Re=We?Re?[Ne,ve]:[Ne,null]:[ve,null],at=Re[0],Ct=Re[1];if(We)for(var Kt=0;Kt<rt;++Kt)lt.push(Ee=Ct&&Ct[Kt]!==void 0?Ue[de](at[Kt],Ct[Kt]):Ue[de](at[Kt])),Ee.onerror=ot;else for(Kt=0;Kt<rt;++Kt)lt.push(Ee=Ue[de](at[Kt])),Ee.onerror=ot}function qo(ln){ln=ln.target.result,lt.forEach(function(yo,vo){return yo.error!=null&&(dt[vo]=yo.error)}),De({numFailures:mn,failures:dt,results:de==="delete"?ve:lt.map(function(yo){return yo.result}),lastResult:ln})}Ee.onerror=function(ln){ot(ln),qo(ln)},Ee.onsuccess=qo})},getMany:function(se){var ge=se.trans,de=se.keys;return new Promise(function(ve,Ne){ve=Le(ve);for(var Ce,De=ge.objectStore(re),Te=de.length,Ue=new Array(Te),Re=0,We=0,Ee=function(lt){lt=lt.target,Ue[lt._pos]=lt.result,++We===Re&&ve(Ue)},rt=an(Ne),ot=0;ot<Te;++ot)de[ot]!=null&&((Ce=De.get(de[ot]))._pos=ot,Ce.onsuccess=Ee,Ce.onerror=rt,++Re);Re===0&&ve(Ue)})},get:function(se){var ge=se.trans,de=se.key;return new Promise(function(ve,Ne){ve=Le(ve);var Ce=ge.objectStore(re).get(de);Ce.onsuccess=function(De){return ve(De.target.result)},Ce.onerror=an(Ne)})},query:(ae=J,oe=ue,function(se){return new Promise(function(ge,de){ge=Le(ge);var ve,Ne,Ce,De,rt=se.trans,Te=se.values,Ue=se.limit,Ee=se.query,Re=(Re=se.direction)!=null?Re:"next",We=Ue===1/0?void 0:Ue,ot=Ee.index,Ee=Ee.range,rt=rt.objectStore(re),rt=ot.isPrimaryKey?rt:rt.index(ot.name),ot=y(Ee);if(Ue===0)return ge({result:[]});oe?(Ee={query:ot,count:We,direction:Re},(ve=Te?rt.getAll(Ee):rt.getAllKeys(Ee)).onsuccess=function(lt){return ge({result:lt.target.result})},ve.onerror=an(de)):ae&&Re==="next"?((ve=Te?rt.getAll(ot,We):rt.getAllKeys(ot,We)).onsuccess=function(lt){return ge({result:lt.target.result})},ve.onerror=an(de)):(Ne=0,Ce=!Te&&"openKeyCursor"in rt?rt.openKeyCursor(ot,Re):rt.openCursor(ot,Re),De=[],Ce.onsuccess=function(){var lt=Ce.result;return!lt||(De.push(Te?lt.value:lt.primaryKey),++Ne===Ue)?ge({result:De}):void lt.continue()},Ce.onerror=an(de))})}),openCursor:function(se){var ge=se.trans,de=se.values,ve=se.query,Ne=se.reverse,Ce=se.unique;return new Promise(function(De,Te){De=Le(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=!de&&"openKeyCursor"in Re?Re.openKeyCursor(y(Ue),We):Re.openCursor(y(Ue),We);Ee.onerror=an(Te),Ee.onsuccess=Le(function(rt){var ot,lt,dt,mn,at=Ee.result;at?(at.___id=++Ki,at.done=!1,ot=at.continue.bind(at),lt=(lt=at.continuePrimaryKey)&&lt.bind(at),dt=at.advance.bind(at),mn=function(){throw new Error("Cursor not stopped")},at.trans=ge,at.stop=at.continue=at.continuePrimaryKey=at.advance=function(){throw new Error("Cursor not started")},at.fail=Le(Te),at.next=function(){var Ct=this,Kt=1;return this.start(function(){return Kt--?Ct.continue():Ct.stop()}).then(function(){return Ct})},at.start=function(Ct){function Kt(){if(Ee.result)try{Ct()}catch(ln){at.fail(ln)}else at.done=!0,at.start=function(){throw new Error("Cursor behind last entry")},at.stop()}var qo=new Promise(function(ln,yo){ln=Le(ln),Ee.onerror=an(yo),at.fail=yo,at.stop=function(vo){at.stop=at.continue=at.continuePrimaryKey=at.advance=mn,ln(vo)}});return Ee.onsuccess=Le(function(ln){Ee.onsuccess=Kt,Kt()}),at.continue=ot,at.continuePrimaryKey=lt,at.advance=dt,Kt(),qo},De(at)):De(null)},Te)})},count:function(se){var ge=se.query,de=se.trans,ve=ge.index,Ne=ge.range;return new Promise(function(Ce,De){var Te=de.objectStore(re),Te=ve.isPrimaryKey?Te:Te.index(ve.name),Ue=y(Ne),Ue=Ue?Te.count(Ue):Te.count();Ue.onsuccess=Le(function(Re){return Ce(Re.target.result)}),Ue.onerror=an(De)})}}}N=M,O=uo((M=a).objectStoreNames),te=0<O.length?N.objectStore(O[0]):{};var N,M={schema:{name:M.name,tables:O.map(function(Z){return N.objectStore(Z)}).map(function(Z){var ae=Z.keyPath,oe=Z.autoIncrement,se=m(ae),re={},se={name:Z.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:ae==null,compound:se,keyPath:ae,autoIncrement:oe,unique:!0,extractKey:lo(ae)},indexes:uo(Z.indexNames).map(function(ge){return Z.index(ge)}).map(function(Ne){var Ce=Ne.name,de=Ne.unique,ve=Ne.multiEntry,Ne=Ne.keyPath,Ce={name:Ce,compound:m(Ne),keyPath:Ne,unique:de,multiEntry:ve,extractKey:lo(Ne)};return re[pi(Ne)]=Ce}),getIndexByKeyPath:function(ge){return re[pi(ge)]}};return re[":id"]=se.primaryKey,ae!=null&&(re[pi(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,J=M.hasGetAll,ue=M.hasIdb3Features,te=O.tables.map(_),G={};return te.forEach(function(Z){return G[Z.name]=Z}),{stack:"dbcore",transaction:a.transaction.bind(a),table:function(Z){if(G[Z])return G[Z];throw new Error("Table '".concat(Z,"' not found"))},MIN_KEY:-1/0,MAX_KEY:_r(c),schema:O}}function zs(a,c,p,y){return p=p.IDBKeyRange,c=Ou(c,p,y),{dbcore:a.dbcore.reduce(function(_,N){return N=N.create,s(s({},_),N(_))},c)}}function co(a,c){var p=c.db,p=zs(a._middlewares,p,a._deps,c);a.core=p.dbcore,a.tables.forEach(function(y){var _=y.name;a.core.schema.tables.some(function(N){return N.name===_})&&(y.core=a.core.table(_),a[_]instanceof a.Table)&&(a[_].core=y.core)})}function Lo(a,c,p,y){p.forEach(function(_){var N=y[_];c.forEach(function(M){var O=(function J(ue,te){return I(ue,te)||(ue=w(ue))&&J(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(J){C(this,_,{value:J,writable:!0,configurable:!0,enumerable:!0})}}):M[_]=new a.Table(_,N))})})}function qi(a,c){c.forEach(function(p){for(var y in p)p[y]instanceof a.Table&&delete p[y]})}function Hr(a,c){return a._cfg.version-c._cfg.version}function Fs(a,c,p,y){var _=a._dbSchema,N=(p.objectStoreNames.contains("$meta")&&!_.$meta&&(_.$meta=Ls("$meta",Xi("")[0],[]),a._storeNames.push("$meta")),a._createTransaction("readwrite",a._storeNames,_)),M=(N.create(p),N._completion.catch(y),N._reject.bind(N)),O=Ye.transless||Ye;on(function(){if(Ye.trans=N,Ye.transless=O,c!==0)return co(a,p),ue=c,((J=N).storeNames.includes("$meta")?J.table("$meta").get("version").then(function(te){return te??ue}):Ve.resolve(ue)).then(function(se){var G=a,Z=se,ae=N,oe=p,re=[],se=G._versions,ge=G._dbSchema=Gt(0,G.idbdb,oe);return(se=se.filter(function(de){return de._cfg.version>=Z})).length===0?Ve.resolve():(se.forEach(function(de){re.push(function(){var ve,Ne,Ce,De=ge,Te=de._cfg.dbschema,Ue=(Sr(G,De,oe),Sr(G,Te,oe),ge=G._dbSchema=Te,Yi(De,Te)),Re=(Ue.add.forEach(function(We){zo(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(rt){return gi(Ee,rt)}),We.change.forEach(function(rt){Ee.deleteIndex(rt.name),gi(Ee,rt)}),We.del.forEach(function(rt){return Ee.deleteIndex(rt)})}),de._cfg.contentUpgrade);if(Re&&de._cfg.version>Z)return co(G,oe),ae._memoizedTables={},ve=fe(Te),Ue.del.forEach(function(We){ve[We]=De[We]}),qi(G,[G.Transaction.prototype]),Lo(G,[G.Transaction.prototype],d(ve),ve),ae.schema=ve,(Ne=$(Re))&&qn(),Te=Ve.follow(function(){var We;(Ce=Re(ae))&&Ne&&(We=zt.bind(null,null),Ce.then(We,We))}),Ce&&typeof Ce.then=="function"?Ve.resolve(Ce):Te.then(function(){return Ce})}),re.push(function(ve){var Ne,Ce,De=de._cfg.dbschema;Ne=De,Ce=ve,[].slice.call(Ce.db.objectStoreNames).forEach(function(Te){return Ne[Te]==null&&Ce.db.deleteObjectStore(Te)}),qi(G,[G.Transaction.prototype]),Lo(G,[G.Transaction.prototype],G._storeNames,G._dbSchema),ae.schema=G._dbSchema}),re.push(function(ve){G.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(G.idbdb.version/10)===de._cfg.version?(G.idbdb.deleteObjectStore("$meta"),delete G._dbSchema.$meta,G._storeNames=G._storeNames.filter(function(Ne){return Ne!=="$meta"})):ve.objectStore("$meta").put(de._cfg.version,"version"))})}),(function de(){return re.length?Ve.resolve(re.shift()(ae.idbtrans)).then(de):Ve.resolve()})().then(function(){mi(ge,oe)}))}).catch(M);var J,ue;d(_).forEach(function(te){zo(p,te,_[te].primKey,_[te].indexes)}),co(a,p),Ve.follow(function(){return a.on.populate.fire(N)}).catch(M)})}function Wi(a,c){mi(a._dbSchema,c),c.db.version%10!=0||c.objectStoreNames.contains("$meta")||c.db.createObjectStore("$meta").add(Math.ceil(c.db.version/10-1),"version");var p=Gt(0,a.idbdb,c);Sr(a,a._dbSchema,c);for(var y=0,_=Yi(p,a._dbSchema).change;y<_.length;y++){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=c.objectStore(M.name);M.add.forEach(function(J){St&&console.debug("Dexie upgrade patch: Creating missing index ".concat(M.name,".").concat(J.src)),gi(O,J)})})(_[y]);if(typeof N=="object")return N.value}}function Yi(a,c){var p,y={del:[],add:[],change:[]};for(p in a)c[p]||y.del.push(p);for(p in c){var _=a[p],N=c[p];if(_){var M={name:p,def:N,recreate:!1,del:[],add:[],change:[]};if(""+(_.primKey.keyPath||"")!=""+(N.primKey.keyPath||"")||_.primKey.auto!==N.primKey.auto)M.recreate=!0,y.change.push(M);else{var O=_.idxByName,J=N.idxByName,ue=void 0;for(ue in O)J[ue]||M.del.push(ue);for(ue in J){var te=O[ue],G=J[ue];te?te.src!==G.src&&M.change.push(G):M.add.push(G)}(0<M.del.length||0<M.add.length||0<M.change.length)&&y.change.push(M)}}else y.add.push([p,N])}return y}function zo(a,c,p,y){var _=a.db.createObjectStore(c,p.keyPath?{keyPath:p.keyPath,autoIncrement:p.auto}:{autoIncrement:p.auto});y.forEach(function(N){return gi(_,N)})}function mi(a,c){d(a).forEach(function(p){c.db.objectStoreNames.contains(p)||(St&&console.debug("Dexie: Creating missing table",p),zo(c,p,a[p].primKey,a[p].indexes))})}function gi(a,c){a.createIndex(c.name,c.keyPath,{unique:c.unique,multiEntry:c.multi})}function Gt(a,c,p){var y={};return V(c.objectStoreNames,0).forEach(function(_){for(var N=p.objectStore(_),M=Do(Ds(ue=N.keyPath),ue||"",!0,!1,!!N.autoIncrement,ue&&typeof ue!="string",!0),O=[],J=0;J<N.indexNames.length;++J){var te=N.index(N.indexNames[J]),ue=te.keyPath,te=Do(te.name,ue,!!te.unique,!!te.multiEntry,!1,ue&&typeof ue!="string",!1);O.push(te)}y[_]=Ls(_,M,O)}),y}function Sr(a,c,p){for(var y=p.db.objectStoreNames,_=0;_<y.length;++_){var N=y[_],M=p.objectStore(N);a._hasGetAll="getAll"in M;for(var O=0;O<M.indexNames.length;++O){var J,ue=M.indexNames[O],te=M.index(ue).keyPath,te=typeof te=="string"?te:"["+V(te).join("+")+"]";c[N]&&(J=c[N].idxByName[te])&&(J.name=ue,delete c[N].idxByName[te],c[N].idxByName[ue]=J)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&f.WorkerGlobalScope&&f instanceof f.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(a._hasGetAll=!1)}function Xi(a){return a.split(",").map(function(c,p){var _=c.split(":"),y=(y=_[1])==null?void 0:y.trim(),_=(c=_[0].trim()).replace(/([&*]|\+\+)/g,""),N=/^\[/.test(_)?_.match(/^\[(.*)\]$/)[1].split("+"):_;return Do(_,N||null,/\&/.test(c),/\*/.test(c),/\+\+/.test(c),m(N),p===0,y)})}Fo.prototype._createTableSchema=Ls,Fo.prototype._parseIndexSyntax=Xi,Fo.prototype._parseStoresSpec=function(a,c){var p=this;d(a).forEach(function(y){if(a[y]!==null){var _=p._parseIndexSyntax(a[y]),N=_.shift();if(!N)throw new ke.Schema("Invalid schema for table "+y+": "+a[y]);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=p._createTableSchema(y,N,_),c[y]=N}})},Fo.prototype.stores=function(p){var c=this.db,p=(this._cfg.storesSource=this._cfg.storesSource?v(this._cfg.storesSource,p):p,c._versions),y={},_={};return p.forEach(function(N){v(y,N._cfg.storesSource),_=N._cfg.dbschema={},N._parseStoresSpec(y,_)}),c._dbSchema=_,qi(c,[c._allTables,c,c.Transaction.prototype]),Lo(c,[c._allTables,c,c.Transaction.prototype,this._cfg.tables],d(_),_),c._storeNames=d(_),this},Fo.prototype.upgrade=function(a){return this._cfg.contentUpgrade=Ot(this._cfg.contentUpgrade||Oe,a),this};var yi=Fo;function Fo(){}var fo=(()=>{var a,c,p;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(a=new Set,c=new FinalizationRegistry(function(y){a.delete(y)}),{toArray:function(){return Array.from(a).map(function(y){return y.deref()}).filter(function(y){return y!==void 0})},add:function(y){var _=new WeakRef(y._novip);a.add(_),c.register(y._novip,_,_),a.size>y._options.maxConnections&&(_=a.values().next().value,a.delete(_),c.unregister(_))},remove:function(y){if(y)for(var _=a.values(),N=_.next();!N.done;){var M=N.value;if(M.deref()===y._novip)return a.delete(M),void c.unregister(M);N=_.next()}}}):(p=[],{toArray:function(){return p},add:function(y){p.push(y._novip)},remove:function(y){y&&(y=p.indexOf(y._novip))!==-1&&p.splice(y,1)}})})();function vi(a,c){var p=a._dbNamesDB;return p||(p=a._dbNamesDB=new Nr(Dr,{addons:[],indexedDB:a,IDBKeyRange:c})).version(1).stores({dbnames:"name"}),p.table("dbnames")}function ho(a){return a&&typeof a.databases=="function"}function Bo(a){return on(function(){return Ye.letThrough=!0,a()})}function Qi(a){return!("from"in a)}var Jt=function(a,c){var p;if(!this)return p=new Jt,a&&"d"in a&&v(p,a),p;v(this,arguments.length?{d:1,from:a,to:1<arguments.length?c:a}:{d:0})};function xi(a,c,p){var y=ft(c,p);if(!isNaN(y)){if(0<y)throw RangeError();if(Qi(a))return v(a,{from:c,to:p,d:1});var y=a.l,_=a.r;if(ft(p,a.from)<0)return y?xi(y,c,p):a.l={from:c,to:p,d:1,l:null,r:null},Ua(a);if(0<ft(c,a.to))return _?xi(_,c,p):a.r={from:c,to:p,d:1,l:null,r:null},Ua(a);ft(c,a.from)<0&&(a.from=c,a.l=null,a.d=_?_.d+1:1),0<ft(p,a.to)&&(a.to=p,a.r=null,a.d=a.l?a.l.d+1:1),c=!a.r,y&&!a.l&&wi(a,y),_&&c&&wi(a,_)}}function wi(a,c){Qi(c)||(function p(y,_){var N=_.from,M=_.l,O=_.r;xi(y,N,_.to),M&&p(y,M),O&&p(y,O)})(a,c)}function Gi(a,c){var p=Ji(c),y=p.next();if(!y.done)for(var _=y.value,N=Ji(a),M=N.next(_.from),O=M.value;!y.done&&!M.done;){if(ft(O.from,_.to)<=0&&0<=ft(O.to,_.from))return!0;ft(_.from,O.from)<0?_=(y=p.next(O.from)).value:O=(M=N.next(_.from)).value}return!1}function Ji(a){var c=Qi(a)?null:{s:0,n:a};return{next:function(p){for(var y=0<arguments.length;c;)switch(c.s){case 0:if(c.s=1,y)for(;c.n.l&&ft(p,c.n.from)<0;)c={up:c,n:c.n.l,s:1};else for(;c.n.l;)c={up:c,n:c.n.l,s:1};case 1:if(c.s=2,!y||ft(p,c.n.to)<=0)return{value:c.n,done:!1};case 2:if(c.n.r){c.s=3,c={up:c,n:c.n.r,s:0};continue}case 3:c=c.up}return{done:!0}}}}function Ua(a){var c,p,y,_=(((_=a.r)==null?void 0:_.d)||0)-(((_=a.l)==null?void 0:_.d)||0),_=1<_?"r":_<-1?"l":"";_&&(c=_=="r"?"l":"r",p=s({},a),y=a[_],a.from=y.from,a.to=y.to,a[_]=y[_],p[_]=y[c],(a[c]=p).d=Ka(p)),a.d=Ka(a)}function Ka(p){var c=p.r,p=p.l;return(c?p?Math.max(c.d,p.d):c.d:p?p.d:0)+1}function Zi(a,c){return d(c).forEach(function(p){a[p]?wi(a[p],c[p]):a[p]=(function y(_){var N,M,O={};for(N in _)x(_,N)&&(M=_[N],O[N]=!M||typeof M!="object"||U.has(M.constructor)?M:y(M));return O})(c[p])}),a}function Bs(a,c){return a.all||c.all||Object.keys(a).some(function(p){return c[p]&&Gi(c[p],a[p])})}S(Jt.prototype,((Nt={add:function(a){return wi(this,a),this},addKey:function(a){return xi(this,a,a),this},addKeys:function(a){var c=this;return a.forEach(function(p){return xi(c,p,p)}),this},hasKey:function(a){var c=Ji(this).next(a).value;return c&&ft(c.from,a)<=0&&0<=ft(c.to,a)}})[Q]=function(){return Ji(this)},Nt));var Vr={},Hs={},Vs=!1;function es(a){Zi(Hs,a),Vs||(Vs=!0,setTimeout(function(){Vs=!1,Us(Hs,!(Hs={}))},0))}function Us(a,c){c===void 0&&(c=!1);var p=new Set;if(a.all)for(var y=0,_=Object.values(Vr);y<_.length;y++)ts(O=_[y],a,p,c);else for(var N in a){var M,O,N=/^idb\:\/\/(.*)\/(.*)\//.exec(N);N&&(M=N[1],N=N[2],O=Vr["idb://".concat(M,"/").concat(N)])&&ts(O,a,p,c)}p.forEach(function(J){return J()})}function ts(a,c,p,y){for(var _=[],N=0,M=Object.entries(a.queries.query);N<M.length;N++){for(var O=M[N],J=O[0],ue=[],te=0,G=O[1];te<G.length;te++){var Z=G[te];Bs(c,Z.obsSet)?Z.subscribers.forEach(function(se){return p.add(se)}):y&&ue.push(Z)}y&&_.push([J,ue])}if(y)for(var ae=0,oe=_;ae<oe.length;ae++){var re=oe[ae],J=re[0],ue=re[1];a.queries.query[J]=ue}}function Ru(a){var c=a._state,p=a._deps.indexedDB;if(c.isBeingOpened||a.idbdb)return c.dbReadyPromise.then(function(){return c.dbOpenError?Et(c.dbOpenError):a});c.isBeingOpened=!0,c.dbOpenError=null,c.openComplete=!1;var y=c.openCanceller,_=Math.round(10*a.verno),N=!1;function M(){if(c.openCanceller!==y)throw new ke.DatabaseClosed("db.open() was cancelled")}function O(){return new Ve(function(Z,ae){if(M(),!p)throw new ke.MissingAPI;var oe=a.name,re=c.autoSchema||!_?p.open(oe):p.open(oe,_);if(!re)throw new ke.MissingAPI;re.onerror=an(ae),re.onblocked=Le(a._fireOnBlocked),re.onupgradeneeded=Le(function(se){var ge;te=re.transaction,c.autoSchema&&!a._options.allowEmptyDB?(re.onerror=$n,te.abort(),re.result.close(),(ge=p.deleteDatabase(oe)).onsuccess=ge.onerror=Le(function(){ae(new ke.NoSuchDatabase("Database ".concat(oe," doesnt exist")))})):(te.onerror=an(ae),ge=se.oldVersion>Math.pow(2,62)?0:se.oldVersion,G=ge<1,a.idbdb=re.result,N&&Wi(a,te),Fs(a,ge/10,te,ae))},ae),re.onsuccess=Le(function(){te=null;var se,ge,de,ve,Ne,Ce,De=a.idbdb=re.result,Te=V(De.objectStoreNames);if(0<Te.length)try{var Ue=De.transaction((Ne=Te).length===1?Ne[0]:Ne,"readonly");if(c.autoSchema)Ce=De,ve=Ue,(de=a).verno=Ce.version/10,ve=de._dbSchema=Gt(0,Ce,ve),de._storeNames=V(Ce.objectStoreNames,0),Lo(de,[de._allTables],d(ve),ve);else if(Sr(a,a._dbSchema,Ue),ge=Ue,((ge=Yi(Gt(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,Z(O());co(a,Ue)}catch{}fo.add(a),De.onversionchange=Le(function(Re){c.vcFired=!0,a.on("versionchange").fire(Re)}),De.onclose=Le(function(){a.close({disableAutoOpen:!1})}),G&&(Te=a._deps,Ne=oe,ho(Ce=Te.indexedDB)||Ne===Dr||vi(Ce,Te.IDBKeyRange).put({name:Ne}).catch(Oe)),Z()},ae)}).catch(function(Z){switch(Z==null?void 0:Z.name){case"UnknownError":if(0<c.PR1398_maxLoop)return c.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),O();break;case"VersionError":if(0<_)return _=0,O()}return Ve.reject(Z)})}var J,ue=c.dbReadyResolve,te=null,G=!1;return Ve.race([y,(typeof navigator>"u"?Ve.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(Z){function ae(){return indexedDB.databases().finally(Z)}J=setInterval(ae,100),ae()}).finally(function(){return clearInterval(J)}):Promise.resolve()).then(O)]).then(function(){return M(),c.onReadyBeingFired=[],Ve.resolve(Bo(function(){return a.on.ready.fire(a.vip)})).then(function Z(){var ae;if(0<c.onReadyBeingFired.length)return ae=c.onReadyBeingFired.reduce(Ot,Oe),c.onReadyBeingFired=[],Ve.resolve(Bo(function(){return ae(a.vip)})).then(Z)})}).finally(function(){c.openCanceller===y&&(c.onReadyBeingFired=null,c.isBeingOpened=!1)}).catch(function(Z){c.dbOpenError=Z;try{te&&te.abort()}catch{}return y===c.openCanceller&&a._close(),Et(Z)}).finally(function(){c.openComplete=!0,ue()}).then(function(){var Z;return G&&(Z={},a.tables.forEach(function(ae){ae.schema.indexes.forEach(function(oe){oe.name&&(Z["idb://".concat(a.name,"/").concat(ae.name,"/").concat(oe.name)]=new Jt(-1/0,[[[]]]))}),Z["idb://".concat(a.name,"/").concat(ae.name,"/")]=Z["idb://".concat(a.name,"/").concat(ae.name,"/:dels")]=new Jt(-1/0,[[[]]])}),An(hi).fire(Z),Us(Z,!0)),a})}function Ks(a){function c(N){return a.next(N)}var p=_(c),y=_(function(N){return a.throw(N)});function _(N){return function(O){var O=N(O),J=O.value;return O.done?J:J&&typeof J.then=="function"?J.then(p,y):m(J)?Promise.all(J).then(p,y):p(J)}}return _(c)()}function ns(a,c,p){for(var y=m(a)?a.slice():[a],_=0;_<p;++_)y.push(c);return y}var qa={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(a){return s(s({},a),{table:function(y){var p=a.table(y),y=p.schema,_={},N=[];function M(Z,ae,oe){var de=pi(Z),re=_[de]=_[de]||[],se=Z==null?0:typeof Z=="string"?1:Z.length,ge=0<ae,de=s(s({},oe),{name:ge?"".concat(de,"(virtual-from:").concat(oe.name,")"):oe.name,lowLevelIndex:oe,isVirtual:ge,keyTail:ae,keyLength:se,extractKey:lo(Z),unique:!ge&&oe.unique});return re.push(de),de.isPrimaryKey||N.push(de),1<se&&M(se===2?Z[0]:Z.slice(0,se-1),ae+1,oe),re.sort(function(ve,Ne){return ve.keyTail-Ne.keyTail}),de}var O=M(y.primaryKey.keyPath,0,y.primaryKey);_[":id"]=[O];for(var J=0,ue=y.indexes;J<ue.length;J++){var te=ue[J];M(te.keyPath,0,te)}function G(Z){var ae,oe=Z.query.index;return oe.isVirtual?s(s({},Z),{query:{index:oe.lowLevelIndex,range:(ae=Z.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})}}):Z}return s(s({},p),{schema:s(s({},y),{primaryKey:O,indexes:N,getIndexByKeyPath:function(Z){return(Z=_[pi(Z)])&&Z[0]}}),count:function(Z){return p.count(G(Z))},query:function(Z){return p.query(G(Z))},openCursor:function(Z){var ae=Z.query.index,oe=ae.keyTail,re=ae.keyLength;return ae.isVirtual?p.openCursor(G(Z)).then(function(ge){return ge&&se(ge)}):p.openCursor(Z);function se(ge){return Object.create(ge,{continue:{value:function(de){de!=null?ge.continue(ns(de,Z.reverse?a.MAX_KEY:a.MIN_KEY,oe)):Z.unique?ge.continue(ge.key.slice(0,re).concat(Z.reverse?a.MIN_KEY:a.MAX_KEY,oe)):ge.continue()}},continuePrimaryKey:{value:function(de,ve){ge.continuePrimaryKey(ns(de,a.MAX_KEY,oe),ve)}},primaryKey:{get:function(){return ge.primaryKey}},key:{get:function(){var de=ge.key;return re===1?de[0]:de.slice(0,re)}},value:{get:function(){return ge.value}}})}}})}})}};function qs(a,c,p,y){return p=p||{},y=y||"",d(a).forEach(function(_){var N,M,O;x(c,_)?(N=a[_],M=c[_],typeof N=="object"&&typeof M=="object"&&N&&M?(O=le(N))!==le(M)?p[y+_]=c[_]:O==="Object"?qs(N,M,p,y+_+"."):N!==M&&(p[y+_]=c[_]):N!==M&&(p[y+_]=c[_])):p[y+_]=void 0}),d(c).forEach(function(_){x(a,_)||(p[y+_]=c[_])}),p}function Ws(a,c){return c.type==="delete"?c.keys:c.keys||c.values.map(a.extractKey)}var Du={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(a){return s(s({},a),{table:function(c){var p=a.table(c),y=p.schema.primaryKey;return s(s({},p),{mutate:function(_){var N=Ye.trans,M=N.table(c).hook,O=M.deleting,J=M.creating,ue=M.updating;switch(_.type){case"add":if(J.fire===Oe)break;return N._promise("readwrite",function(){return te(_)},!0);case"put":if(J.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 G(Z,ae,oe){return p.query({trans:Z,values:!1,query:{index:y,range:ae},limit:oe}).then(function(re){var se=re.result;return te({type:"delete",keys:se,trans:Z}).then(function(ge){return 0<ge.numFailures?Promise.reject(ge.failures[0]):se.length<oe?{failures:[],numFailures:0,lastResult:void 0}:G(Z,s(s({},ae),{lower:se[se.length-1],lowerOpen:!0}),oe)})})})(_.trans,_.range,1e4)},!0)}return p.mutate(_);function te(G){var Z,ae,oe,re=Ye.trans,se=G.keys||Ws(y,G);if(se)return(G=G.type==="add"||G.type==="put"?s(s({},G),{keys:se}):s({},G)).type!=="delete"&&(G.values=u([],G.values)),G.keys&&(G.keys=u([],G.keys)),Z=p,oe=se,((ae=G).type==="add"?Promise.resolve([]):Z.getMany({trans:ae.trans,keys:oe,cache:"immutable"})).then(function(ge){var de=se.map(function(ve,Ne){var Ce,De,Te,Ue=ge[Ne],Re={onerror:null,onsuccess:null};return G.type==="delete"?O.fire.call(Re,ve,Ue,re):G.type==="add"||Ue===void 0?(Ce=J.fire.call(Re,ve,G.values[Ne],re),ve==null&&Ce!=null&&(G.keys[Ne]=ve=Ce,y.outbound||X(G.values[Ne],y.keyPath,ve))):(Ce=qs(Ue,G.values[Ne]),(De=ue.fire.call(Re,Ce,ve,Ue,re))&&(Te=G.values[Ne],Object.keys(De).forEach(function(We){x(Te,We)?Te[We]=De[We]:X(Te,We,De[We])}))),Re});return p.mutate(G).then(function(ve){for(var Ne=ve.failures,Ce=ve.results,De=ve.numFailures,ve=ve.lastResult,Te=0;Te<se.length;++Te){var Ue=(Ce||se)[Te],Re=de[Te];Ue==null?Re.onerror&&Re.onerror(Ne[Te]):Re.onsuccess&&Re.onsuccess(G.type==="put"&&ge[Te]?G.values[Te]:Ue)}return{failures:Ne,results:Ce,numFailures:De,lastResult:ve}}).catch(function(ve){return de.forEach(function(Ne){return Ne.onerror&&Ne.onerror(ve)}),Promise.reject(ve)})});throw new Error("Keys missing")}}})}})}};function Wa(a,c,p){try{if(!c||c.keys.length<a.length)return null;for(var y=[],_=0,N=0;_<c.keys.length&&N<a.length;++_)ft(c.keys[_],a[N])===0&&(y.push(p?xe(c.values[_]):c.values[_]),++N);return y.length===a.length?y:null}catch{return null}}var Lu={stack:"dbcore",level:-1,create:function(a){return{table:function(c){var p=a.table(c);return s(s({},p),{getMany:function(y){var _;return y.cache?(_=Wa(y.keys,y.trans._cache,y.cache==="clone"))?Ve.resolve(_):p.getMany(y).then(function(N){return y.trans._cache={keys:y.keys,values:y.cache==="clone"?xe(N):N},N}):p.getMany(y)},mutate:function(y){return y.type!=="add"&&(y.trans._cache=null),p.mutate(y)}})}}}};function Ya(a,c){return a.trans.mode==="readonly"&&!!a.subscr&&!a.trans.explicit&&a.trans.db._options.cache!=="disabled"&&!c.schema.primaryKey.outbound}function Xa(a,c){switch(a){case"query":return c.values&&!c.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Ys={stack:"dbcore",level:0,name:"Observability",create:function(a){var c=a.schema.name,p=new Jt(a.MIN_KEY,a.MAX_KEY);return s(s({},a),{transaction:function(y,_,N){if(Ye.subscr&&_!=="readonly")throw new ke.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Ye.querier));return a.transaction(y,_,N)},table:function(y){function _(se){var re,se=se.query;return[re=se.index,new Jt((re=(se=se.range).lower)!=null?re:a.MIN_KEY,(re=se.upper)!=null?re:a.MAX_KEY)]}var N=a.table(y),M=N.schema,O=M.primaryKey,J=M.indexes,ue=O.extractKey,te=O.outbound,G=O.autoIncrement&&J.filter(function(oe){return oe.compound&&oe.keyPath.includes(O.keyPath)}),Z=s(s({},N),{mutate:function(oe){function re(Ee){return Ee="idb://".concat(c,"/").concat(y,"/").concat(Ee),Ne[Ee]||(Ne[Ee]=new Jt)}var se,ge,de,ve=oe.trans,Ne=oe.mutatedParts||(oe.mutatedParts={}),Ce=re(""),De=re(":dels"),Te=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 m(Ue)?(Ce.addKeys(Ue),(Te=Te==="delete"||Ue.length===Re.length?Wa(Ue,We):null)||De.addKeys(Ue),(Te||Re)&&(se=re,ge=Te,de=Re,M.indexes.forEach(function(Ee){var rt=se(Ee.name||"");function ot(dt){return dt!=null?Ee.extractKey(dt):null}function lt(dt){Ee.multiEntry&&m(dt)?dt.forEach(function(mn){return rt.addKey(mn)}):rt.addKey(dt)}(ge||de).forEach(function(dt,Ct){var at=ge&&ot(ge[Ct]),Ct=de&&ot(de[Ct]);ft(at,Ct)!==0&&(at!=null&&lt(at),Ct!=null)&&lt(Ct)})}))):Ue?(Re={from:(We=Ue.lower)!=null?We:a.MIN_KEY,to:(Te=Ue.upper)!=null?Te:a.MAX_KEY},De.add(Re),Ce.add(Re)):(Ce.add(p),De.add(p),M.indexes.forEach(function(Ee){return re(Ee.name).add(p)})),N.mutate(oe).then(function(Ee){return!Ue||oe.type!=="add"&&oe.type!=="put"||(Ce.addKeys(Ee.results),G&&G.forEach(function(rt){for(var ot=oe.values.map(function(at){return rt.extractKey(at)}),lt=rt.keyPath.findIndex(function(at){return at===O.keyPath}),dt=0,mn=Ee.results.length;dt<mn;++dt)ot[dt][lt]=Ee.results[dt];re(rt.name).addKeys(ot)})),ve.mutatedParts=Zi(ve.mutatedParts||{},Ne),Ee})}}),ae={get:function(oe){return[O,new Jt(oe.key)]},getMany:function(oe){return[O,new Jt().addKeys(oe.keys)]},count:_,query:_,openCursor:_};return d(ae).forEach(function(oe){Z[oe]=function(re){var se=Ye.subscr,ge=!!se,de=Ya(Ye,N)&&Xa(oe,re)?re.obsSet={}:se;if(ge){var ve,se=function(Re){return Re="idb://".concat(c,"/").concat(y,"/").concat(Re),de[Re]||(de[Re]=new Jt)},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(ot){return ot=ot.result,Ne.addKeys(ot),Re});var We=re.values?Re.result.map(ue):Re.result;(re.values?Ne:Ce).addKeys(We)}else{var Ee,rt;if(oe==="openCursor")return rt=re.values,(Ee=Re)&&Object.create(Ee,{key:{get:function(){return Ce.addKey(Ee.primaryKey),Ee.key}},primaryKey:{get:function(){var ot=Ee.primaryKey;return Ce.addKey(ot),ot}},value:{get:function(){return rt&&Ne.addKey(Ee.primaryKey),Ee.value}}})}return Re});Ce.add(p)}}return N[oe].apply(this,arguments)}}),Z}})}};function Ho(a,c,p){var y;return p.numFailures===0?c:c.type==="deleteRange"||(y=c.keys?c.keys.length:"values"in c&&c.values?c.values.length:1,p.numFailures===y)?null:(y=s({},c),m(y.keys)&&(y.keys=y.keys.filter(function(_,N){return!(N in p.failures)})),"values"in y&&m(y.values)&&(y.values=y.values.filter(function(_,N){return!(N in p.failures)})),y)}function Xs(a,c){return p=a,((y=c).lower===void 0||(y.lowerOpen?0<ft(p,y.lower):0<=ft(p,y.lower)))&&(p=a,(y=c).upper===void 0||(y.upperOpen?ft(p,y.upper)<0:ft(p,y.upper)<=0));var p,y}function Qs(a,c,p,y,_,N){var M,O,J,ue,te,G,Z;return!p||p.length===0||(M=c.query.index,O=M.multiEntry,J=c.query.range,ue=y.schema.primaryKey.extractKey,te=M.extractKey,G=(M.lowLevelIndex||M).extractKey,(y=p.reduce(function(ae,oe){var re=ae,se=[];if(oe.type==="add"||oe.type==="put")for(var ge=new Jt,de=oe.values.length-1;0<=de;--de){var ve,Ne=oe.values[de],Ce=ue(Ne);!ge.hasKey(Ce)&&(ve=te(Ne),O&&m(ve)?ve.some(function(We){return Xs(We,J)}):Xs(ve,J))&&(ge.addKey(Ce),se.push(Ne))}switch(oe.type){case"add":var De=new Jt().addKeys(c.values?ae.map(function(Ee){return ue(Ee)}):ae),re=ae.concat(c.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 Te=new Jt().addKeys(oe.values.map(function(Ee){return ue(Ee)}));re=ae.filter(function(Ee){return!Te.hasKey(c.values?ue(Ee):Ee)}).concat(c.values?se:se.map(function(Ee){return ue(Ee)}));break;case"delete":var Ue=new Jt().addKeys(oe.keys);re=ae.filter(function(Ee){return!Ue.hasKey(c.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:(Z=function(ae,oe){return ft(G(ae),G(oe))||ft(ue(ae),ue(oe))},y.sort(c.direction==="prev"||c.direction==="prevunique"?function(ae,oe){return Z(oe,ae)}:Z),c.limit&&c.limit<1/0&&(y.length>c.limit?y.length=c.limit:a.length===c.limit&&y.length<c.limit&&(_.dirty=!0)),N?Object.freeze(y):y)}function Gs(a,c){return ft(a.lower,c.lower)===0&&ft(a.upper,c.upper)===0&&!!a.lowerOpen==!!c.lowerOpen&&!!a.upperOpen==!!c.upperOpen}function Qa(a,c){return((p,y,_,N)=>{if(p===void 0)return y!==void 0?-1:0;if(y===void 0)return 1;if((p=ft(p,y))===0){if(_&&N)return 0;if(_)return 1;if(N)return-1}return p})(a.lower,c.lower,a.lowerOpen,c.lowerOpen)<=0&&0<=((p,y,_,N)=>{if(p===void 0)return y!==void 0?1:0;if(y===void 0)return-1;if((p=ft(p,y))===0){if(_&&N)return 0;if(_)return-1;if(N)return 1}return p})(a.upper,c.upper,a.upperOpen,c.upperOpen)}function Ga(a,c,p,y){a.subscribers.add(p),y.addEventListener("abort",function(){var _,N;a.subscribers.delete(p),a.subscribers.size===0&&(_=a,N=c,setTimeout(function(){_.subscribers.size===0&&z(N,_)},3e3))})}var Ja={stack:"dbcore",level:0,name:"Cache",create:function(a){var c=a.schema.name;return s(s({},a),{transaction:function(p,y,_){var N,M,O=a.transaction(p,y,_);return y==="readwrite"&&(_=(N=new AbortController).signal,O.addEventListener("abort",(M=function(J){return function(){if(N.abort(),y==="readwrite"){for(var ue=new Set,te=0,G=p;te<G.length;te++){var Z=G[te],ae=Vr["idb://".concat(c,"/").concat(Z)];if(ae){var oe=a.table(Z),re=ae.optimisticOps.filter(function(Ee){return Ee.trans===O});if(O._explicit&&J&&O.mutatedParts)for(var se=0,ge=Object.values(ae.queries.query);se<ge.length;se++)for(var de=0,ve=(De=ge[se]).slice();de<ve.length;de++)Bs((Te=ve[de]).obsSet,O.mutatedParts)&&(z(De,Te),Te.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,Te,Ue,Re=0,We=(De=Ce[Ne]).slice();Re<We.length;Re++)(Te=We[Re]).res!=null&&O.mutatedParts&&(J&&!Te.dirty?(Ue=Object.isFrozen(Te.res),Ue=Qs(Te.res,Te.req,re,oe,Te,Ue),Te.dirty?(z(De,Te),Te.subscribers.forEach(function(Ee){return ue.add(Ee)})):Ue!==Te.res&&(Te.res=Ue,Te.promise=Ve.resolve({result:Ue}))):(Te.dirty&&z(De,Te),Te.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(p){var y=a.table(p),_=y.schema.primaryKey;return s(s({},y),{mutate:function(N){var M,O=Ye.trans;return!_.outbound&&O.db._options.cache!=="disabled"&&!O.explicit&&O.idbtrans.mode==="readwrite"&&(M=Vr["idb://".concat(c,"/").concat(p)])?(O=y.mutate(N),N.type!=="add"&&N.type!=="put"||!(50<=N.values.length||Ws(_,N).some(function(J){return J==null}))?(M.optimisticOps.push(N),N.mutatedParts&&es(N.mutatedParts),O.then(function(J){0<J.numFailures&&(z(M.optimisticOps,N),(J=Ho(0,N,J))&&M.optimisticOps.push(J),N.mutatedParts)&&es(N.mutatedParts)}),O.catch(function(){z(M.optimisticOps,N),N.mutatedParts&&es(N.mutatedParts)})):O.then(function(J){var ue=Ho(0,s(s({},N),{values:N.values.map(function(te,G){var Z;return J.failures[G]?te:(X(Z=(Z=_.keyPath)!=null&&Z.includes(".")?xe(te):s({},te),_.keyPath,J.results[G]),Z)})}),J);M.optimisticOps.push(ue),queueMicrotask(function(){return N.mutatedParts&&es(N.mutatedParts)})}),O):y.mutate(N)},query:function(N){var M,O,J,ue,te,G,Z;return Ya(Ye,y)&&Xa("query",N)?(M=((J=Ye.trans)==null?void 0:J.db._options.cache)==="immutable",O=(J=Ye).requery,J=J.signal,G=((ae,oe,re,se)=>{var ge=Vr["idb://".concat(ae,"/").concat(oe)];if(!ge)return[];if(!(ae=ge.queries[re]))return[null,!1,ge,null];var de=ae[(se.query?se.query.index.name:null)||""];if(!de)return[null,!1,ge,null];switch(re){case"query":var ve=(Ne=se.direction)!=null?Ne:"next",Ne=de.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,de]:[de.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,de];case"count":return Ne=de.find(function(Ce){return Gs(Ce.req.query.range,se.query.range)}),[Ne,!!Ne,ge,de]}})(c,p,"query",N),Z=G[0],ue=G[2],te=G[3],Z&&G[1]?Z.obsSet=N.obsSet:(G=y.query(N).then(function(ae){var oe=ae.result;if(Z&&(Z.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&&Z&&z(te,Z),Promise.reject(ae)}),Z={obsSet:N.obsSet,promise:G,subscribers:new Set,type:"query",req:N,dirty:!1},te?te.push(Z):(te=[Z],(ue=ue||(Vr["idb://".concat(c,"/").concat(p)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[N.query.index.name||""]=te)),Ga(Z,te,O,J),Z.promise.then(function(ae){return{result:Qs(ae.result,N,ue==null?void 0:ue.optimisticOps,y,Z,M)}})):y.query(N)}})}})}};function kr(a,c){return new Proxy(a,{get:function(p,y,_){return y==="db"?c:Reflect.get(p,y,_)}})}Rt.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 c=this._versions,p=c.filter(function(y){return y._cfg.version===a})[0];return p||(p=new this.Version(a),c.push(p),c.sort(Hr),p.stores({}),this._state.autoSchema=!1),p},Rt.prototype._whenReady=function(a){var c=this;return this.idbdb&&(this._state.openComplete||Ye.letThrough||this._vip)?a():new Ve(function(p,y){if(c._state.openComplete)return y(new ke.DatabaseClosed(c._state.dbOpenError));if(!c._state.isBeingOpened){if(!c._state.autoOpen)return void y(new ke.DatabaseClosed);c.open().catch(Oe)}c._state.dbReadyPromise.then(p,y)}).then(a)},Rt.prototype.use=function(_){var c=_.stack,p=_.create,y=_.level,_=_.name,N=(_&&this.unuse({stack:c,name:_}),this._middlewares[c]||(this._middlewares[c]=[]));return N.push({stack:c,create:p,level:y??10,name:_}),N.sort(function(M,O){return M.level-O.level}),this},Rt.prototype.unuse=function(a){var c=a.stack,p=a.name,y=a.create;return c&&this._middlewares[c]&&(this._middlewares[c]=this._middlewares[c].filter(function(_){return y?_.create!==y:!!p&&_.name!==p})),this},Rt.prototype.open=function(){var a=this;return ir(Sn,function(){return Ru(a)})},Rt.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var a=this._state;if(fo.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}a.isBeingOpened||(a.dbReadyPromise=new Ve(function(c){a.dbReadyResolve=c}),a.openCanceller=new Ve(function(c,p){a.cancelOpen=p}))},Rt.prototype.close=function(c){var c=(c===void 0?{disableAutoOpen:!0}:c).disableAutoOpen,p=this._state;c?(p.isBeingOpened&&p.cancelOpen(new ke.DatabaseClosed),this._close(),p.autoOpen=!1,p.dbOpenError=new ke.DatabaseClosed):(this._close(),p.autoOpen=this._options.autoOpen||p.isBeingOpened,p.openComplete=!1,p.dbOpenError=null)},Rt.prototype.delete=function(a){var c=this,p=(a===void 0&&(a={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),y=this._state;return new Ve(function(_,N){function M(){c.close(a);var O=c._deps.indexedDB.deleteDatabase(c.name);O.onsuccess=Le(function(){var J,ue,te;J=c._deps,ue=c.name,ho(te=J.indexedDB)||ue===Dr||vi(te,J.IDBKeyRange).delete(ue).catch(Oe),_()}),O.onerror=an(N),O.onblocked=c._fireOnBlocked}if(p)throw new ke.InvalidArgument("Invalid closeOptions argument to db.delete()");y.isBeingOpened?y.dbReadyPromise.then(M):M()})},Rt.prototype.backendDB=function(){return this.idbdb},Rt.prototype.isOpen=function(){return this.idbdb!==null},Rt.prototype.hasBeenClosed=function(){var a=this._state.dbOpenError;return a&&a.name==="DatabaseClosed"},Rt.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Rt.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Rt.prototype,"tables",{get:function(){var a=this;return d(this._allTables).map(function(c){return a._allTables[c]})},enumerable:!1,configurable:!0}),Rt.prototype.transaction=function(){var a=(function(c,p,y){var _=arguments.length;if(_<2)throw new ke.InvalidArgument("Too few arguments");for(var N=new Array(_-1);--_;)N[_-1]=arguments[_];return y=N.pop(),[c,_e(N),y]}).apply(this,arguments);return this._transaction.apply(this,a)},Rt.prototype._transaction=function(a,c,p){var y,_,N=this,M=Ye.trans,O=(M&&M.db===this&&a.indexOf("!")===-1||(M=null),a.indexOf("?")!==-1);a=a.replace("!","").replace("?","");try{if(_=c.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===Ao)y=Ao;else{if(a!="rw"&&a!=Lr)throw new ke.InvalidArgument("Invalid transaction mode: "+a);y=Lr}if(M){if(M.mode===Ao&&y===Lr){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,G){G(ue)}):Et(ue)}var J=(function ue(te,G,Z,ae,oe){return Ve.resolve().then(function(){var de=Ye.transless||Ye,re=te._createTransaction(G,Z,te._dbSchema,ae),de=(re.explicit=!0,{trans:re,transless:de});if(ae)re.idbtrans=ae.idbtrans;else try{re.create(),re.idbtrans._explicit=!0,te._state.PR1398_maxLoop=3}catch(ve){return ve.name===be.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,G,Z,null,oe)})):Et(ve)}var se,ge=$(oe),de=(ge&&qn(),Ve.follow(function(){var ve;(se=oe.call(re,re))&&(ge?(ve=zt.bind(null,null),se.then(ve,ve)):typeof se.next=="function"&&typeof se.throw=="function"&&(se=Ks(se)))},de));return(se&&typeof se.then=="function"?Ve.resolve(se).then(function(ve){return re.active?ve:Et(new ke.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):de.then(function(){return se})).then(function(ve){return ae&&re._resolve(),re._completion.then(function(){return ve})}).catch(function(ve){return re._reject(ve),Et(ve)})})}).bind(null,this,y,_,M,p);return M?M._promise(y,J,"lock"):Ye.trans?ir(Ye.transless,function(){return N._whenReady(J)}):this._whenReady(J)},Rt.prototype.table=function(a){if(x(this._allTables,a))return this._allTables[a];throw new ke.InvalidTable("Table ".concat(a," does not exist"))};var Nr=Rt;function Rt(a,c){var p,y,_,N,M,O=this,J=(this._middlewares={},this.verno=0,Rt.dependencies),J=(this._options=c=s({addons:Rt.addons,autoOpen:!0,indexedDB:J.indexedDB,IDBKeyRange:J.IDBKeyRange,cache:"cloned",maxConnections:1e3},c),this._deps={indexedDB:c.indexedDB,IDBKeyRange:c.IDBKeyRange},c.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:c.autoOpen}),te=(ue.dbReadyPromise=new Ve(function(G){ue.dbReadyResolve=G}),ue.openCanceller=new Ve(function(G,Z){ue.cancelOpen=Z}),this._state=ue,this.name=a,this.on=zr(this,"populate","blocked","versionchange","close",{ready:[Ot,Oe]}),this.once=function(G,Z){var ae=function(){for(var oe=[],re=0;re<arguments.length;re++)oe[re]=arguments[re];O.on(G).unsubscribe(ae),Z.apply(O,oe)};return O.on(G,ae)},this.on.ready.subscribe=P(this.on.ready.subscribe,function(G){return function(Z,ae){Rt.vip(function(){var oe,re=O._state;re.openComplete?(re.dbOpenError||Ve.resolve().then(Z),ae&&G(Z)):re.onReadyBeingFired?(re.onReadyBeingFired.push(Z),ae&&G(Z)):(G(Z),oe=O,ae||G(function se(){oe.on.ready.unsubscribe(Z),oe.on.ready.unsubscribe(se)}))})}}),this.Collection=(p=this,io(Ba.prototype,function(se,re){this.db=p;var ae=fi,oe=null;if(re)try{ae=re()}catch(de){oe=de}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!==qe?ge:null}})),this.Table=(y=this,io(Yn.prototype,function(G,Z,ae){this.db=y,this._tx=ae,this.name=G,this.schema=Z,this.hook=y._allTables[G]?y._allTables[G].hook:zr(null,{creating:[it,Oe],reading:[ut,qe],updating:[_t,Oe],deleting:[Tt,Oe]})})),this.Transaction=(_=this,io(Au.prototype,function(G,Z,ae,oe,re){var se=this;G!=="readonly"&&Z.forEach(function(ge){ge=(ge=ae[ge])==null?void 0:ge.yProps,ge&&(Z=Z.concat(ge.map(function(de){return de.updatesTable})))}),this.db=_,this.mode=G,this.storeNames=Z,this.schema=ae,this.chromeTransactionDurability=oe,this.idbtrans=null,this.on=zr(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 Ve(function(ge,de){se._resolve=ge,se._reject=de}),this._completion.then(function(){se.active=!1,se.on.complete.fire()},function(ge){var de=se.active;return se.active=!1,se.on.error.fire(ge),se.parent?se.parent._reject(ge):de&&se.idbtrans&&se.idbtrans.abort(),Et(ge)})})),this.Version=(N=this,io(yi.prototype,function(G){this.db=N,this._cfg={version:G,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(M=this,io(br.prototype,function(G,Z,ae){if(this.db=M,this._ctx={table:G,index:Z===":id"?null:Z,or:ae},this._cmp=this._ascending=ft,this._descending=function(oe,re){return ft(re,oe)},this._max=function(oe,re){return 0<ft(oe,re)?oe:re},this._min=function(oe,re){return ft(oe,re)<0?oe:re},this._IDBKeyRange=M._deps.IDBKeyRange,!this._IDBKeyRange)throw new ke.MissingAPI})),this.on("versionchange",function(G){0<G.newVersion?console.warn("Another connection wants to upgrade database '".concat(O.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(O.name,"'. Closing db now to resume the delete request.")),O.close({disableAutoOpen:!1})}),this.on("blocked",function(G){!G.newVersion||G.newVersion<G.oldVersion?console.warn("Dexie.delete('".concat(O.name,"') was blocked")):console.warn("Upgrade '".concat(O.name,"' blocked by other connection holding version ").concat(G.oldVersion/10))}),this._maxKey=_r(c.IDBKeyRange),this._createTransaction=function(G,Z,ae,oe){return new O.Transaction(G,Z,ae,O._options.chromeTransactionDurability,oe)},this._fireOnBlocked=function(G){O.on("blocked").fire(G),fo.toArray().filter(function(Z){return Z.name===O.name&&Z!==O&&!Z._state.vcFired}).map(function(Z){return Z.on("versionchange").fire(G)})},this.use(Lu),this.use(Ja),this.use(Ys),this.use(qa),this.use(Du),new Proxy(this,{get:function(G,Z,ae){var oe;return Z==="_vip"||(Z==="table"?function(re){return kr(O.table(re),te)}:(oe=Reflect.get(G,Z,ae))instanceof Yn?kr(oe,te):Z==="tables"?oe.map(function(re){return kr(re,te)}):Z==="_createTransaction"?function(){return kr(oe.apply(this,arguments),te)}:oe)}}));this.vip=te,J.forEach(function(G){return G(O)})}var rs,po=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Za=(mo.prototype.subscribe=function(a,c,p){return this._subscribe(a&&typeof a!="function"?a:{next:a,error:c,complete:p})},mo.prototype[po]=function(){return this},mo);function mo(a){this._subscribe=a}try{rs={indexedDB:f.indexedDB||f.mozIndexedDB||f.webkitIndexedDB||f.msIndexedDB,IDBKeyRange:f.IDBKeyRange||f.webkitIDBKeyRange}}catch{rs={indexedDB:null,IDBKeyRange:null}}function Vo(a){var c,p=!1,y=new Za(function(_){var N=$(a),M,O=!1,J={},ue={},te={get closed(){return O},unsubscribe:function(){O||(O=!0,M&&M.abort(),G&&An.storagemutated.unsubscribe(oe))}},G=(_.start&&_.start(te),!1),Z=function(){return $o(re)};function ae(){return Bs(ue,J)}var oe=function(se){Zi(J,se),ae()&&Z()},re=function(){var se,ge,de;!O&&rs.indexedDB&&(J={},se={},M&&M.abort(),M=new AbortController,de=(ve=>{var Ne=Nn();try{N&&qn();var Ce=on(a,ve);return Ce=N?Ce.finally(zt):Ce}finally{Ne&&Tn()}})(ge={subscr:se,signal:M.signal,requery:Z,querier:a,trans:null}),G||(An(hi,oe),G=!0),Promise.resolve(de).then(function(ve){p=!0,c=ve,O||ge.signal.aborted||(ae()||(ue=se,ae())?Z():(J={},$o(function(){return!O&&_.next&&_.next(ve)})))},function(ve){p=!1,["DatabaseClosedError","AbortError"].includes(ve==null?void 0:ve.name)||O||$o(function(){O||_.error&&_.error(ve)})}))};return setTimeout(Z,0),te});return y.hasValue=function(){return p},y.getValue=function(){return c},y}var go=Nr;function Uo(a){var c=Er;try{Er=!0,An.storagemutated.fire(a),Us(a,!0)}finally{Er=c}}S(go,s(s({},H),{delete:function(a){return new go(a,{addons:[]}).delete()},exists:function(a){return new go(a,{addons:[]}).open().then(function(c){return c.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(a){try{return c=go.dependencies,p=c.indexedDB,c=c.IDBKeyRange,(ho(p)?Promise.resolve(p.databases()).then(function(y){return y.map(function(_){return _.name}).filter(function(_){return _!==Dr})}):vi(p,c).toCollection().primaryKeys()).then(a)}catch{return Et(new ke.MissingAPI)}var c,p},defineClass:function(){return function(a){v(this,a)}},ignoreTransaction:function(a){return Ye.trans?ir(Ye.transless||Sn,a):a()},vip:Bo,async:function(a){return function(){try{var c=Ks(a.apply(this,arguments));return c&&typeof c.then=="function"?c:Ve.resolve(c)}catch(p){return Et(p)}}},spawn:function(a,c,p){try{var y=Ks(a.apply(p,c||[]));return y&&typeof y.then=="function"?y:Ve.resolve(y)}catch(_){return Et(_)}},currentTransaction:{get:function(){return Ye.trans||null}},waitFor:function(a,c){return a=Ve.resolve(typeof a=="function"?go.ignoreTransaction(a):a).timeout(c||6e4),Ye.trans?Ye.trans.waitFor(a):a},Promise:Ve,debug:{get:function(){return St},set:function(a){wn(a)}},derive:T,extend:v,props:S,override:P,Events:zr,on:An,liveQuery:Vo,extendObservabilitySet:Zi,getByKeyPath:B,setByKeyPath:X,delByKeyPath:function(a,c){typeof c=="string"?X(a,c,void 0):"length"in c&&[].map.call(c,function(p){X(a,p,void 0)})},shallowClone:fe,deepClone:xe,getObjectDiff:qs,cmp:ft,asap:W,minKey:-1/0,addons:[],connections:{get:fo.toArray},errnames:be,dependencies:rs,cache:Vr,semVer:"4.4.2",version:"4.4.2".split(".").map(function(a){return parseInt(a)}).reduce(function(a,c,p){return a+c/Math.pow(10,2*p)})})),go.maxKey=_r(go.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(An(hi,function(a){Er||(a=new CustomEvent(Ui,{detail:a}),Er=!0,dispatchEvent(a),Er=!1)}),addEventListener(Ui,function(a){a=a.detail,Er||Uo(a)}));var Ko,Er=!1,os=function(){};return typeof BroadcastChannel<"u"&&((os=function(){(Ko=new BroadcastChannel(Ui)).onmessage=function(a){return a.data&&Uo(a.data)}})(),typeof Ko.unref=="function"&&Ko.unref(),An(hi,function(a){Er||Ko.postMessage(a)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(a){if(!Nr.disableBfCache&&a.persisted){St&&console.debug("Dexie: handling persisted pagehide"),Ko!=null&&Ko.close();for(var c=0,p=fo.toArray();c<p.length;c++)p[c].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(a){!Nr.disableBfCache&&a.persisted&&(St&&console.debug("Dexie: handling persisted pageshow"),os(),Uo({all:new Jt(-1/0,[[]])}))})),Ve.rejectionMapper=function(a,c){return!a||a instanceof Se||a instanceof TypeError||a instanceof SyntaxError||!a.name||!He[a.name]?a:(c=new He[a.name](c||a.message,a),"stack"in a&&j(c,"stack",{get:function(){return this.inner.stack}}),c)},wn(St),s(Nr,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:Nr,Entity:En,PropModification:no,RangeSet:Jt,add:function(a){return new no({add:a})},cmp:ft,default:Nr,liveQuery:Vo,mergeRanges:wi,rangesOverlap:Gi,remove:function(a){return new no({remove:a})},replacePrefix:function(a,c){return new no({replacePrefix:[a,c]})}}),{default:Nr}),Nr})})(Zl)),Zl.exports}var Ry=Oy();const xf=xu(Ry),tp=Symbol.for("Dexie"),au=globalThis[tp]||(globalThis[tp]=xf);if(xf.semVer!==au.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${xf.semVer} and ${au.semVer}`);const{liveQuery:Rk,mergeRanges:Dk,rangesOverlap:Lk,RangeSet:zk,cmp:Fk,Entity:Bk,PropModification:Hk,replacePrefix:Vk,add:Uk,remove:Kk,DexieYProvider:qk}=au;class Dy extends au{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 bt=new Dy;async function Ly(){const[t,r,i]=await Promise.all([bt.flows.toArray(),bt.testSuites.toArray(),bt.environments.toArray()]),s=await bt.kv.get("authTokens");let u;try{u=s!=null&&s.value?JSON.parse(s.value):void 0}catch{u=void 0}return{formatVersion:1,exportedAt:new Date().toISOString(),flows:t,testSuites:r,environments:i,authTokens:u}}async function bm(t){await bt.transaction("rw",bt.flows,bt.testSuites,bt.environments,bt.kv,async()=>{await bt.flows.clear(),await bt.testSuites.clear(),await bt.environments.clear();for(const r of t.flows)await bt.flows.add({name:r.name,steps:r.steps,graph:r.graph});for(const r of t.testSuites)await bt.testSuites.add({name:r.name,cases:r.cases});for(const r of t.environments)await bt.environments.add({name:r.name,baseUrl:r.baseUrl,vars:r.vars??{}});t.authTokens&&await bt.kv.put({key:"authTokens",value:JSON.stringify(t.authTokens)})})}async function zy(t){if(t.formatVersion!==1)return!1;const[r,i]=await Promise.all([bt.flows.count(),bt.testSuites.count()]);return r>0||i>0?!1:(await bm(t),!0)}function Fy(t,r,i){var d,m;const s=[],u=r===t.expectStatus;if(s.push(`HTTP ${r} ${u?"✓":`✗ (esperado ${t.expectStatus})`}`),!u)return{pass:!1,lines:s};if((d=t.contains)!=null&&d.trim()){const v=i.includes(t.contains);if(s.push(`Contiene texto "${t.contains}": ${v?"✓":"✗"}`),!v)return{pass:!1,lines:s}}const f=(m=t.jsonPath)==null?void 0:m.trim();if(f){let v;try{v=JSON.parse(i)}catch{return s.push("Body no es JSON válido: ✗"),{pass:!1,lines:s}}const w=Of(v,f),k=t.expectJsonValue;if(k!==void 0&&k!==""){const x=w==null?String(w):typeof w=="object"?JSON.stringify(w):String(w),S=k.trim(),C=x===S||String(w)===S;if(s.push(`JSON path ${f} → ${x} vs "${S}": ${C?"✓":"✗"}`),!C)return{pass:!1,lines:s}}else{const x=w!=null;if(s.push(`JSON path ${f} existe: ${x?"✓":"✗"}`),!x)return{pass:!1,lines:s}}}return{pass:!0,lines:s}}function Wt(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=Wt(t[i]))!==""&&(r+=(r&&" ")+s);else for(let i in t)t[i]&&(r+=(r&&" ")+i);return r}var By={value:()=>{}};function Su(){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 eu(i)}function eu(t){this._=t}function Hy(t,r){return t.trim().split(/^|\s+/).map(function(i){var s="",u=i.indexOf(".");if(u>=0&&(s=i.slice(u+1),i=i.slice(0,u)),i&&!r.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:s}})}eu.prototype=Su.prototype={constructor:eu,on:function(t,r){var i=this._,s=Hy(t+"",i),u,f=-1,d=s.length;if(arguments.length<2){for(;++f<d;)if((u=(t=s[f]).type)&&(u=Vy(i[u],t.name)))return u;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++f<d;)if(u=(t=s[f]).type)i[u]=np(i[u],t.name,r);else if(r==null)for(u in i)i[u]=np(i[u],t.name,null);return this},copy:function(){var t={},r=this._;for(var i in r)t[i]=r[i].slice();return new eu(t)},call:function(t,r){if((u=arguments.length-2)>0)for(var i=new Array(u),s=0,u,f;s<u;++s)i[s]=arguments[s+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(f=this._[t],s=0,u=f.length;s<u;++s)f[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],u=0,f=s.length;u<f;++u)s[u].value.apply(r,i)}};function Vy(t,r){for(var i=0,s=t.length,u;i<s;++i)if((u=t[i]).name===r)return u.value}function np(t,r,i){for(var s=0,u=t.length;s<u;++s)if(t[s].name===r){t[s]=By,t=t.slice(0,s).concat(t.slice(s+1));break}return i!=null&&t.push({name:r,value:i}),t}var wf="http://www.w3.org/1999/xhtml";const rp={svg:"http://www.w3.org/2000/svg",xhtml:wf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ku(t){var r=t+="",i=r.indexOf(":");return i>=0&&(r=t.slice(0,i))!=="xmlns"&&(t=t.slice(i+1)),rp.hasOwnProperty(r)?{space:rp[r],local:t}:t}function Uy(t){return function(){var r=this.ownerDocument,i=this.namespaceURI;return i===wf&&r.documentElement.namespaceURI===wf?r.createElement(t):r.createElementNS(i,t)}}function Ky(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function _m(t){var r=ku(t);return(r.local?Ky:Uy)(r)}function qy(){}function Rf(t){return t==null?qy:function(){return this.querySelector(t)}}function Wy(t){typeof t!="function"&&(t=Rf(t));for(var r=this._groups,i=r.length,s=new Array(i),u=0;u<i;++u)for(var f=r[u],d=f.length,m=s[u]=new Array(d),v,w,k=0;k<d;++k)(v=f[k])&&(w=t.call(v,v.__data__,k,f))&&("__data__"in v&&(w.__data__=v.__data__),m[k]=w);return new er(s,this._parents)}function Yy(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Xy(){return[]}function Sm(t){return t==null?Xy:function(){return this.querySelectorAll(t)}}function Qy(t){return function(){return Yy(t.apply(this,arguments))}}function Gy(t){typeof t=="function"?t=Qy(t):t=Sm(t);for(var r=this._groups,i=r.length,s=[],u=[],f=0;f<i;++f)for(var d=r[f],m=d.length,v,w=0;w<m;++w)(v=d[w])&&(s.push(t.call(v,v.__data__,w,d)),u.push(v));return new er(s,u)}function km(t){return function(){return this.matches(t)}}function Nm(t){return function(r){return r.matches(t)}}var Jy=Array.prototype.find;function Zy(t){return function(){return Jy.call(this.children,t)}}function ev(){return this.firstElementChild}function tv(t){return this.select(t==null?ev:Zy(typeof t=="function"?t:Nm(t)))}var nv=Array.prototype.filter;function rv(){return Array.from(this.children)}function ov(t){return function(){return nv.call(this.children,t)}}function iv(t){return this.selectAll(t==null?rv:ov(typeof t=="function"?t:Nm(t)))}function sv(t){typeof t!="function"&&(t=km(t));for(var r=this._groups,i=r.length,s=new Array(i),u=0;u<i;++u)for(var f=r[u],d=f.length,m=s[u]=[],v,w=0;w<d;++w)(v=f[w])&&t.call(v,v.__data__,w,f)&&m.push(v);return new er(s,this._parents)}function Em(t){return new Array(t.length)}function av(){return new er(this._enter||this._groups.map(Em),this._parents)}function lu(t,r){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=r}lu.prototype={constructor:lu,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 lv(t){return function(){return t}}function uv(t,r,i,s,u,f){for(var d=0,m,v=r.length,w=f.length;d<w;++d)(m=r[d])?(m.__data__=f[d],s[d]=m):i[d]=new lu(t,f[d]);for(;d<v;++d)(m=r[d])&&(u[d]=m)}function cv(t,r,i,s,u,f,d){var m,v,w=new Map,k=r.length,x=f.length,S=new Array(k),C;for(m=0;m<k;++m)(v=r[m])&&(S[m]=C=d.call(v,v.__data__,m,r)+"",w.has(C)?u[m]=v:w.set(C,v));for(m=0;m<x;++m)C=d.call(t,f[m],m,f)+"",(v=w.get(C))?(s[m]=v,v.__data__=f[m],w.delete(C)):i[m]=new lu(t,f[m]);for(m=0;m<k;++m)(v=r[m])&&w.get(S[m])===v&&(u[m]=v)}function fv(t){return t.__data__}function dv(t,r){if(!arguments.length)return Array.from(this,fv);var i=r?cv:uv,s=this._parents,u=this._groups;typeof t!="function"&&(t=lv(t));for(var f=u.length,d=new Array(f),m=new Array(f),v=new Array(f),w=0;w<f;++w){var k=s[w],x=u[w],S=x.length,C=hv(t.call(k,k&&k.__data__,w,s)),j=C.length,T=m[w]=new Array(j),I=d[w]=new Array(j),A=v[w]=new Array(S);i(k,x,T,I,A,C,r);for(var V=0,P=0,R,W;V<j;++V)if(R=T[V]){for(V>=P&&(P=V+1);!(W=I[P])&&++P<j;);R._next=W||null}}return d=new er(d,s),d._enter=m,d._exit=v,d}function hv(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function pv(){return new er(this._exit||this._groups.map(Em),this._parents)}function mv(t,r,i){var s=this.enter(),u=this,f=this.exit();return typeof t=="function"?(s=t(s),s&&(s=s.selection())):s=s.append(t+""),r!=null&&(u=r(u),u&&(u=u.selection())),i==null?f.remove():i(f),s&&u?s.merge(u).order():u}function gv(t){for(var r=t.selection?t.selection():t,i=this._groups,s=r._groups,u=i.length,f=s.length,d=Math.min(u,f),m=new Array(u),v=0;v<d;++v)for(var w=i[v],k=s[v],x=w.length,S=m[v]=new Array(x),C,j=0;j<x;++j)(C=w[j]||k[j])&&(S[j]=C);for(;v<u;++v)m[v]=i[v];return new er(m,this._parents)}function yv(){for(var t=this._groups,r=-1,i=t.length;++r<i;)for(var s=t[r],u=s.length-1,f=s[u],d;--u>=0;)(d=s[u])&&(f&&d.compareDocumentPosition(f)^4&&f.parentNode.insertBefore(d,f),f=d);return this}function vv(t){t||(t=xv);function r(x,S){return x&&S?t(x.__data__,S.__data__):!x-!S}for(var i=this._groups,s=i.length,u=new Array(s),f=0;f<s;++f){for(var d=i[f],m=d.length,v=u[f]=new Array(m),w,k=0;k<m;++k)(w=d[k])&&(v[k]=w);v.sort(r)}return new er(u,this._parents).order()}function xv(t,r){return t<r?-1:t>r?1:t>=r?0:NaN}function wv(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function bv(){return Array.from(this)}function _v(){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var s=t[r],u=0,f=s.length;u<f;++u){var d=s[u];if(d)return d}return null}function Sv(){let t=0;for(const r of this)++t;return t}function kv(){return!this.node()}function Nv(t){for(var r=this._groups,i=0,s=r.length;i<s;++i)for(var u=r[i],f=0,d=u.length,m;f<d;++f)(m=u[f])&&t.call(m,m.__data__,f,u);return this}function Ev(t){return function(){this.removeAttribute(t)}}function Cv(t){return function(){this.removeAttributeNS(t.space,t.local)}}function jv(t,r){return function(){this.setAttribute(t,r)}}function Pv(t,r){return function(){this.setAttributeNS(t.space,t.local,r)}}function Mv(t,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttribute(t):this.setAttribute(t,i)}}function Tv(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 Iv(t,r){var i=ku(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?Cv:Ev:typeof r=="function"?i.local?Tv:Mv:i.local?Pv:jv)(i,r))}function Cm(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function $v(t){return function(){this.style.removeProperty(t)}}function Av(t,r,i){return function(){this.style.setProperty(t,r,i)}}function Ov(t,r,i){return function(){var s=r.apply(this,arguments);s==null?this.style.removeProperty(t):this.style.setProperty(t,s,i)}}function Rv(t,r,i){return arguments.length>1?this.each((r==null?$v:typeof r=="function"?Ov:Av)(t,r,i??"")):Ps(this.node(),t)}function Ps(t,r){return t.style.getPropertyValue(r)||Cm(t).getComputedStyle(t,null).getPropertyValue(r)}function Dv(t){return function(){delete this[t]}}function Lv(t,r){return function(){this[t]=r}}function zv(t,r){return function(){var i=r.apply(this,arguments);i==null?delete this[t]:this[t]=i}}function Fv(t,r){return arguments.length>1?this.each((r==null?Dv:typeof r=="function"?zv:Lv)(t,r)):this.node()[t]}function jm(t){return t.trim().split(/^|\s+/)}function Df(t){return t.classList||new Pm(t)}function Pm(t){this._node=t,this._names=jm(t.getAttribute("class")||"")}Pm.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 Mm(t,r){for(var i=Df(t),s=-1,u=r.length;++s<u;)i.add(r[s])}function Tm(t,r){for(var i=Df(t),s=-1,u=r.length;++s<u;)i.remove(r[s])}function Bv(t){return function(){Mm(this,t)}}function Hv(t){return function(){Tm(this,t)}}function Vv(t,r){return function(){(r.apply(this,arguments)?Mm:Tm)(this,t)}}function Uv(t,r){var i=jm(t+"");if(arguments.length<2){for(var s=Df(this.node()),u=-1,f=i.length;++u<f;)if(!s.contains(i[u]))return!1;return!0}return this.each((typeof r=="function"?Vv:r?Bv:Hv)(i,r))}function Kv(){this.textContent=""}function qv(t){return function(){this.textContent=t}}function Wv(t){return function(){var r=t.apply(this,arguments);this.textContent=r??""}}function Yv(t){return arguments.length?this.each(t==null?Kv:(typeof t=="function"?Wv:qv)(t)):this.node().textContent}function Xv(){this.innerHTML=""}function Qv(t){return function(){this.innerHTML=t}}function Gv(t){return function(){var r=t.apply(this,arguments);this.innerHTML=r??""}}function Jv(t){return arguments.length?this.each(t==null?Xv:(typeof t=="function"?Gv:Qv)(t)):this.node().innerHTML}function Zv(){this.nextSibling&&this.parentNode.appendChild(this)}function ex(){return this.each(Zv)}function tx(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function nx(){return this.each(tx)}function rx(t){var r=typeof t=="function"?t:_m(t);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function ox(){return null}function ix(t,r){var i=typeof t=="function"?t:_m(t),s=r==null?ox:typeof r=="function"?r:Rf(r);return this.select(function(){return this.insertBefore(i.apply(this,arguments),s.apply(this,arguments)||null)})}function sx(){var t=this.parentNode;t&&t.removeChild(this)}function ax(){return this.each(sx)}function lx(){var t=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function ux(){var t=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function cx(t){return this.select(t?ux:lx)}function fx(t){return arguments.length?this.property("__data__",t):this.node().__data__}function dx(t){return function(r){t.call(this,r,this.__data__)}}function hx(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 px(t){return function(){var r=this.__on;if(r){for(var i=0,s=-1,u=r.length,f;i<u;++i)f=r[i],(!t.type||f.type===t.type)&&f.name===t.name?this.removeEventListener(f.type,f.listener,f.options):r[++s]=f;++s?r.length=s:delete this.__on}}}function mx(t,r,i){return function(){var s=this.__on,u,f=dx(r);if(s){for(var d=0,m=s.length;d<m;++d)if((u=s[d]).type===t.type&&u.name===t.name){this.removeEventListener(u.type,u.listener,u.options),this.addEventListener(u.type,u.listener=f,u.options=i),u.value=r;return}}this.addEventListener(t.type,f,i),u={type:t.type,name:t.name,value:r,listener:f,options:i},s?s.push(u):this.__on=[u]}}function gx(t,r,i){var s=hx(t+""),u,f=s.length,d;if(arguments.length<2){var m=this.node().__on;if(m){for(var v=0,w=m.length,k;v<w;++v)for(u=0,k=m[v];u<f;++u)if((d=s[u]).type===k.type&&d.name===k.name)return k.value}return}for(m=r?mx:px,u=0;u<f;++u)this.each(m(s[u],r,i));return this}function Im(t,r,i){var s=Cm(t),u=s.CustomEvent;typeof u=="function"?u=new u(r,i):(u=s.document.createEvent("Event"),i?(u.initEvent(r,i.bubbles,i.cancelable),u.detail=i.detail):u.initEvent(r,!1,!1)),t.dispatchEvent(u)}function yx(t,r){return function(){return Im(this,t,r)}}function vx(t,r){return function(){return Im(this,t,r.apply(this,arguments))}}function xx(t,r){return this.each((typeof r=="function"?vx:yx)(t,r))}function*wx(){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var s=t[r],u=0,f=s.length,d;u<f;++u)(d=s[u])&&(yield d)}var $m=[null];function er(t,r){this._groups=t,this._parents=r}function Aa(){return new er([[document.documentElement]],$m)}function bx(){return this}er.prototype=Aa.prototype={constructor:er,select:Wy,selectAll:Gy,selectChild:tv,selectChildren:iv,filter:sv,data:dv,enter:av,exit:pv,join:mv,merge:gv,selection:bx,order:yv,sort:vv,call:wv,nodes:bv,node:_v,size:Sv,empty:kv,each:Nv,attr:Iv,style:Rv,property:Fv,classed:Uv,text:Yv,html:Jv,raise:ex,lower:nx,append:rx,insert:ix,remove:ax,clone:cx,datum:fx,on:gx,dispatch:xx,[Symbol.iterator]:wx};function Zn(t){return typeof t=="string"?new er([[document.querySelector(t)]],[document.documentElement]):new er([[t]],$m)}function _x(t){let r;for(;r=t.sourceEvent;)t=r;return t}function Ir(t,r){if(t=_x(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 u=r.getBoundingClientRect();return[t.clientX-u.left-r.clientLeft,t.clientY-u.top-r.clientTop]}}return[t.pageX,t.pageY]}const Sx={passive:!1},ka={capture:!0,passive:!1};function tf(t){t.stopImmediatePropagation()}function Cs(t){t.preventDefault(),t.stopImmediatePropagation()}function Am(t){var r=t.document.documentElement,i=Zn(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 Om(t,r){var i=t.document.documentElement,s=Zn(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 bf(t,{sourceEvent:r,subject:i,target:s,identifier:u,active:f,x:d,y:m,dx:v,dy:w,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:u,enumerable:!0,configurable:!0},active:{value:f,enumerable:!0,configurable:!0},x:{value:d,enumerable:!0,configurable:!0},y:{value:m,enumerable:!0,configurable:!0},dx:{value:v,enumerable:!0,configurable:!0},dy:{value:w,enumerable:!0,configurable:!0},_:{value:k}})}bf.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function kx(t){return!t.ctrlKey&&!t.button}function Nx(){return this.parentNode}function Ex(t,r){return r??{x:t.x,y:t.y}}function Cx(){return navigator.maxTouchPoints||"ontouchstart"in this}function Rm(){var t=kx,r=Nx,i=Ex,s=Cx,u={},f=Su("start","drag","end"),d=0,m,v,w,k,x=0;function S(R){R.on("mousedown.drag",C).filter(s).on("touchstart.drag",I).on("touchmove.drag",A,Sx).on("touchend.drag touchcancel.drag",V).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function C(R,W){if(!(k||!t.call(this,R,W))){var B=P(this,r.call(this,R,W),R,W,"mouse");B&&(Zn(R.view).on("mousemove.drag",j,ka).on("mouseup.drag",T,ka),Am(R.view),tf(R),w=!1,m=R.clientX,v=R.clientY,B("start",R))}}function j(R){if(Cs(R),!w){var W=R.clientX-m,B=R.clientY-v;w=W*W+B*B>x}u.mouse("drag",R)}function T(R){Zn(R.view).on("mousemove.drag mouseup.drag",null),Om(R.view,w),Cs(R),u.mouse("end",R)}function I(R,W){if(t.call(this,R,W)){var B=R.changedTouches,X=r.call(this,R,W),fe=B.length,pe,_e;for(pe=0;pe<fe;++pe)(_e=P(this,X,R,W,B[pe].identifier,B[pe]))&&(tf(R),_e("start",R,B[pe]))}}function A(R){var W=R.changedTouches,B=W.length,X,fe;for(X=0;X<B;++X)(fe=u[W[X].identifier])&&(Cs(R),fe("drag",R,W[X]))}function V(R){var W=R.changedTouches,B=W.length,X,fe;for(k&&clearTimeout(k),k=setTimeout(function(){k=null},500),X=0;X<B;++X)(fe=u[W[X].identifier])&&(tf(R),fe("end",R,W[X]))}function P(R,W,B,X,fe,pe){var _e=f.copy(),U=Ir(pe||B,W),ce,xe,D;if((D=i.call(R,new bf("beforestart",{sourceEvent:B,target:S,identifier:fe,active:d,x:U[0],y:U[1],dx:0,dy:0,dispatch:_e}),X))!=null)return ce=D.x-U[0]||0,xe=D.y-U[1]||0,function le(Q,ie,z){var K=U,F;switch(Q){case"start":u[fe]=le,F=d++;break;case"end":delete u[fe],--d;case"drag":U=Ir(z||ie,W),F=d;break}_e.call(Q,R,new bf(Q,{sourceEvent:ie,subject:D,target:S,identifier:fe,active:F,x:U[0]+ce,y:U[1]+xe,dx:U[0]-K[0],dy:U[1]-K[1],dispatch:_e}),X)}}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=f.on.apply(f,arguments);return R===f?S:R},S.clickDistance=function(R){return arguments.length?(x=(R=+R)*R,S):Math.sqrt(x)},S}function Lf(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,uu=1/Na,js="\\s*([+-]?\\d+)\\s*",Ea="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",jx=/^#([0-9a-f]{3,8})$/,Px=new RegExp(`^rgb\\(${js},${js},${js}\\)$`),Mx=new RegExp(`^rgb\\(${Xr},${Xr},${Xr}\\)$`),Tx=new RegExp(`^rgba\\(${js},${js},${js},${Ea}\\)$`),Ix=new RegExp(`^rgba\\(${Xr},${Xr},${Xr},${Ea}\\)$`),$x=new RegExp(`^hsl\\(${Ea},${Xr},${Xr}\\)$`),Ax=new RegExp(`^hsla\\(${Ea},${Xr},${Xr},${Ea}\\)$`),op={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};Lf(Oa,Di,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:ip,formatHex:ip,formatHex8:Ox,formatHsl:Rx,formatRgb:sp,toString:sp});function ip(){return this.rgb().formatHex()}function Ox(){return this.rgb().formatHex8()}function Rx(){return Lm(this).formatHsl()}function sp(){return this.rgb().formatRgb()}function Di(t){var r,i;return t=(t+"").trim().toLowerCase(),(r=jx.exec(t))?(i=r[1].length,r=parseInt(r[1],16),i===6?ap(r):i===3?new Bn(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=Px.exec(t))?new Bn(r[1],r[2],r[3],1):(r=Mx.exec(t))?new Bn(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=Tx.exec(t))?Kl(r[1],r[2],r[3],r[4]):(r=Ix.exec(t))?Kl(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=$x.exec(t))?cp(r[1],r[2]/100,r[3]/100,1):(r=Ax.exec(t))?cp(r[1],r[2]/100,r[3]/100,r[4]):op.hasOwnProperty(t)?ap(op[t]):t==="transparent"?new Bn(NaN,NaN,NaN,0):null}function ap(t){return new Bn(t>>16&255,t>>8&255,t&255,1)}function Kl(t,r,i,s){return s<=0&&(t=r=i=NaN),new Bn(t,r,i,s)}function Dx(t){return t instanceof Oa||(t=Di(t)),t?(t=t.rgb(),new Bn(t.r,t.g,t.b,t.opacity)):new Bn}function _f(t,r,i,s){return arguments.length===1?Dx(t):new Bn(t,r,i,s??1)}function Bn(t,r,i,s){this.r=+t,this.g=+r,this.b=+i,this.opacity=+s}Lf(Bn,_f,Dm(Oa,{brighter(t){return t=t==null?uu:Math.pow(uu,t),new Bn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Na:Math.pow(Na,t),new Bn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Bn(Oi(this.r),Oi(this.g),Oi(this.b),cu(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:lp,formatHex:lp,formatHex8:Lx,formatRgb:up,toString:up}));function lp(){return`#${Ai(this.r)}${Ai(this.g)}${Ai(this.b)}`}function Lx(){return`#${Ai(this.r)}${Ai(this.g)}${Ai(this.b)}${Ai((isNaN(this.opacity)?1:this.opacity)*255)}`}function up(){const t=cu(this.opacity);return`${t===1?"rgb(":"rgba("}${Oi(this.r)}, ${Oi(this.g)}, ${Oi(this.b)}${t===1?")":`, ${t})`}`}function cu(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Oi(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ai(t){return t=Oi(t),(t<16?"0":"")+t.toString(16)}function cp(t,r,i,s){return s<=0?t=r=i=NaN:i<=0||i>=1?t=r=NaN:r<=0&&(t=NaN),new $r(t,r,i,s)}function Lm(t){if(t instanceof $r)return new $r(t.h,t.s,t.l,t.opacity);if(t instanceof Oa||(t=Di(t)),!t)return new $r;if(t instanceof $r)return t;t=t.rgb();var r=t.r/255,i=t.g/255,s=t.b/255,u=Math.min(r,i,s),f=Math.max(r,i,s),d=NaN,m=f-u,v=(f+u)/2;return m?(r===f?d=(i-s)/m+(i<s)*6:i===f?d=(s-r)/m+2:d=(r-i)/m+4,m/=v<.5?f+u:2-f-u,d*=60):m=v>0&&v<1?0:d,new $r(d,m,v,t.opacity)}function zx(t,r,i,s){return arguments.length===1?Lm(t):new $r(t,r,i,s??1)}function $r(t,r,i,s){this.h=+t,this.s=+r,this.l=+i,this.opacity=+s}Lf($r,zx,Dm(Oa,{brighter(t){return t=t==null?uu:Math.pow(uu,t),new $r(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Na:Math.pow(Na,t),new $r(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,u=2*i-s;return new Bn(nf(t>=240?t-240:t+120,u,s),nf(t,u,s),nf(t<120?t+240:t-120,u,s),this.opacity)},clamp(){return new $r(fp(this.h),ql(this.s),ql(this.l),cu(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=cu(this.opacity);return`${t===1?"hsl(":"hsla("}${fp(this.h)}, ${ql(this.s)*100}%, ${ql(this.l)*100}%${t===1?")":`, ${t})`}`}}));function fp(t){return t=(t||0)%360,t<0?t+360:t}function ql(t){return Math.max(0,Math.min(1,t||0))}function nf(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 zf=t=>()=>t;function Fx(t,r){return function(i){return t+i*r}}function Bx(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 Hx(t){return(t=+t)==1?zm:function(r,i){return i-r?Bx(r,i,t):zf(isNaN(r)?i:r)}}function zm(t,r){var i=r-t;return i?Fx(t,i):zf(isNaN(t)?r:t)}const fu=(function t(r){var i=Hx(r);function s(u,f){var d=i((u=_f(u)).r,(f=_f(f)).r),m=i(u.g,f.g),v=i(u.b,f.b),w=zm(u.opacity,f.opacity);return function(k){return u.r=d(k),u.g=m(k),u.b=v(k),u.opacity=w(k),u+""}}return s.gamma=t,s})(1);function Vx(t,r){r||(r=[]);var i=t?Math.min(r.length,t.length):0,s=r.slice(),u;return function(f){for(u=0;u<i;++u)s[u]=t[u]*(1-f)+r[u]*f;return s}}function Ux(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Kx(t,r){var i=r?r.length:0,s=t?Math.min(i,t.length):0,u=new Array(s),f=new Array(i),d;for(d=0;d<s;++d)u[d]=_a(t[d],r[d]);for(;d<i;++d)f[d]=r[d];return function(m){for(d=0;d<s;++d)f[d]=u[d](m);return f}}function qx(t,r){var i=new Date;return t=+t,r=+r,function(s){return i.setTime(t*(1-s)+r*s),i}}function Yr(t,r){return t=+t,r=+r,function(i){return t*(1-i)+r*i}}function Wx(t,r){var i={},s={},u;(t===null||typeof t!="object")&&(t={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in t?i[u]=_a(t[u],r[u]):s[u]=r[u];return function(f){for(u in i)s[u]=i[u](f);return s}}var Sf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,rf=new RegExp(Sf.source,"g");function Yx(t){return function(){return t}}function Xx(t){return function(r){return t(r)+""}}function Fm(t,r){var i=Sf.lastIndex=rf.lastIndex=0,s,u,f,d=-1,m=[],v=[];for(t=t+"",r=r+"";(s=Sf.exec(t))&&(u=rf.exec(r));)(f=u.index)>i&&(f=r.slice(i,f),m[d]?m[d]+=f:m[++d]=f),(s=s[0])===(u=u[0])?m[d]?m[d]+=u:m[++d]=u:(m[++d]=null,v.push({i:d,x:Yr(s,u)})),i=rf.lastIndex;return i<r.length&&(f=r.slice(i),m[d]?m[d]+=f:m[++d]=f),m.length<2?v[0]?Xx(v[0].x):Yx(r):(r=v.length,function(w){for(var k=0,x;k<r;++k)m[(x=v[k]).i]=x.x(w);return m.join("")})}function _a(t,r){var i=typeof r,s;return r==null||i==="boolean"?zf(r):(i==="number"?Yr:i==="string"?(s=Di(r))?(r=s,fu):Fm:r instanceof Di?fu:r instanceof Date?qx:Ux(r)?Vx:Array.isArray(r)?Kx:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Wx:Yr)(t,r)}var dp=180/Math.PI,kf={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Bm(t,r,i,s,u,f){var d,m,v;return(d=Math.sqrt(t*t+r*r))&&(t/=d,r/=d),(v=t*i+r*s)&&(i-=t*v,s-=r*v),(m=Math.sqrt(i*i+s*s))&&(i/=m,s/=m,v/=m),t*s<r*i&&(t=-t,r=-r,v=-v,d=-d),{translateX:u,translateY:f,rotate:Math.atan2(r,t)*dp,skewX:Math.atan(v)*dp,scaleX:d,scaleY:m}}var Wl;function Qx(t){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return r.isIdentity?kf:Bm(r.a,r.b,r.c,r.d,r.e,r.f)}function Gx(t){return t==null||(Wl||(Wl=document.createElementNS("http://www.w3.org/2000/svg","g")),Wl.setAttribute("transform",t),!(t=Wl.transform.baseVal.consolidate()))?kf:(t=t.matrix,Bm(t.a,t.b,t.c,t.d,t.e,t.f))}function Hm(t,r,i,s){function u(w){return w.length?w.pop()+" ":""}function f(w,k,x,S,C,j){if(w!==x||k!==S){var T=C.push("translate(",null,r,null,i);j.push({i:T-4,x:Yr(w,x)},{i:T-2,x:Yr(k,S)})}else(x||S)&&C.push("translate("+x+r+S+i)}function d(w,k,x,S){w!==k?(w-k>180?k+=360:k-w>180&&(w+=360),S.push({i:x.push(u(x)+"rotate(",null,s)-2,x:Yr(w,k)})):k&&x.push(u(x)+"rotate("+k+s)}function m(w,k,x,S){w!==k?S.push({i:x.push(u(x)+"skewX(",null,s)-2,x:Yr(w,k)}):k&&x.push(u(x)+"skewX("+k+s)}function v(w,k,x,S,C,j){if(w!==x||k!==S){var T=C.push(u(C)+"scale(",null,",",null,")");j.push({i:T-4,x:Yr(w,x)},{i:T-2,x:Yr(k,S)})}else(x!==1||S!==1)&&C.push(u(C)+"scale("+x+","+S+")")}return function(w,k){var x=[],S=[];return w=t(w),k=t(k),f(w.translateX,w.translateY,k.translateX,k.translateY,x,S),d(w.rotate,k.rotate,x,S),m(w.skewX,k.skewX,x,S),v(w.scaleX,w.scaleY,k.scaleX,k.scaleY,x,S),w=k=null,function(C){for(var j=-1,T=S.length,I;++j<T;)x[(I=S[j]).i]=I.x(C);return x.join("")}}}var Jx=Hm(Qx,"px, ","px)","deg)"),Zx=Hm(Gx,", ",")",")"),ew=1e-12;function hp(t){return((t=Math.exp(t))+1/t)/2}function tw(t){return((t=Math.exp(t))-1/t)/2}function nw(t){return((t=Math.exp(2*t))-1)/(t+1)}const tu=(function t(r,i,s){function u(f,d){var m=f[0],v=f[1],w=f[2],k=d[0],x=d[1],S=d[2],C=k-m,j=x-v,T=C*C+j*j,I,A;if(T<ew)A=Math.log(S/w)/r,I=function(X){return[m+X*C,v+X*j,w*Math.exp(r*X*A)]};else{var V=Math.sqrt(T),P=(S*S-w*w+s*T)/(2*w*i*V),R=(S*S-w*w-s*T)/(2*S*i*V),W=Math.log(Math.sqrt(P*P+1)-P),B=Math.log(Math.sqrt(R*R+1)-R);A=(B-W)/r,I=function(X){var fe=X*A,pe=hp(W),_e=w/(i*V)*(pe*nw(r*fe+W)-tw(W));return[m+_e*C,v+_e*j,w*pe/hp(r*fe+W)]}}return I.duration=A*1e3*r/Math.SQRT2,I}return u.rho=function(f){var d=Math.max(.001,+f),m=d*d,v=m*m;return t(d,m,v)},u})(Math.SQRT2,2,4);var Ms=0,wa=0,va=0,Vm=1e3,du,ba,hu=0,Li=0,Nu=0,Ca=typeof performance=="object"&&performance.now?performance:Date,Um=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ff(){return Li||(Um(rw),Li=Ca.now()+Nu)}function rw(){Li=0}function pu(){this._call=this._time=this._next=null}pu.prototype=Km.prototype={constructor:pu,restart:function(t,r,i){if(typeof t!="function")throw new TypeError("callback is not a function");i=(i==null?Ff():+i)+(r==null?0:+r),!this._next&&ba!==this&&(ba?ba._next=this:du=this,ba=this),this._call=t,this._time=i,Nf()},stop:function(){this._call&&(this._call=null,this._time=1/0,Nf())}};function Km(t,r,i){var s=new pu;return s.restart(t,r,i),s}function ow(){Ff(),++Ms;for(var t=du,r;t;)(r=Li-t._time)>=0&&t._call.call(void 0,r),t=t._next;--Ms}function pp(){Li=(hu=Ca.now())+Nu,Ms=wa=0;try{ow()}finally{Ms=0,sw(),Li=0}}function iw(){var t=Ca.now(),r=t-hu;r>Vm&&(Nu-=r,hu=t)}function sw(){for(var t,r=du,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:du=i);ba=t,Nf(s)}function Nf(t){if(!Ms){wa&&(wa=clearTimeout(wa));var r=t-Li;r>24?(t<1/0&&(wa=setTimeout(pp,t-Ca.now()-Nu)),va&&(va=clearInterval(va))):(va||(hu=Ca.now(),va=setInterval(iw,Vm)),Ms=1,Um(pp))}}function mp(t,r,i){var s=new pu;return r=r==null?0:+r,s.restart(u=>{s.stop(),t(u+r)},r,i),s}var aw=Su("start","end","cancel","interrupt"),lw=[],qm=0,gp=1,Ef=2,nu=3,yp=4,Cf=5,ru=6;function Eu(t,r,i,s,u,f){var d=t.__transition;if(!d)t.__transition={};else if(i in d)return;uw(t,i,{name:r,index:s,group:u,on:aw,tween:lw,time:f.time,delay:f.delay,duration:f.duration,ease:f.ease,timer:null,state:qm})}function Bf(t,r){var i=Rr(t,r);if(i.state>qm)throw new Error("too late; already scheduled");return i}function Jr(t,r){var i=Rr(t,r);if(i.state>nu)throw new Error("too late; already running");return i}function Rr(t,r){var i=t.__transition;if(!i||!(i=i[r]))throw new Error("transition not found");return i}function uw(t,r,i){var s=t.__transition,u;s[r]=i,i.timer=Km(f,0,i.time);function f(w){i.state=gp,i.timer.restart(d,i.delay,i.time),i.delay<=w&&d(w-i.delay)}function d(w){var k,x,S,C;if(i.state!==gp)return v();for(k in s)if(C=s[k],C.name===i.name){if(C.state===nu)return mp(d);C.state===yp?(C.state=ru,C.timer.stop(),C.on.call("interrupt",t,t.__data__,C.index,C.group),delete s[k]):+k<r&&(C.state=ru,C.timer.stop(),C.on.call("cancel",t,t.__data__,C.index,C.group),delete s[k])}if(mp(function(){i.state===nu&&(i.state=yp,i.timer.restart(m,i.delay,i.time),m(w))}),i.state=Ef,i.on.call("start",t,t.__data__,i.index,i.group),i.state===Ef){for(i.state=nu,u=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))&&(u[++x]=C);u.length=x+1}}function m(w){for(var k=w<i.duration?i.ease.call(null,w/i.duration):(i.timer.restart(v),i.state=Cf,1),x=-1,S=u.length;++x<S;)u[x].call(t,k);i.state===Cf&&(i.on.call("end",t,t.__data__,i.index,i.group),v())}function v(){i.state=ru,i.timer.stop(),delete s[r];for(var w in s)return;delete t.__transition}}function ou(t,r){var i=t.__transition,s,u,f=!0,d;if(i){r=r==null?null:r+"";for(d in i){if((s=i[d]).name!==r){f=!1;continue}u=s.state>Ef&&s.state<Cf,s.state=ru,s.timer.stop(),s.on.call(u?"interrupt":"cancel",t,t.__data__,s.index,s.group),delete i[d]}f&&delete t.__transition}}function cw(t){return this.each(function(){ou(this,t)})}function fw(t,r){var i,s;return function(){var u=Jr(this,t),f=u.tween;if(f!==i){s=i=f;for(var d=0,m=s.length;d<m;++d)if(s[d].name===r){s=s.slice(),s.splice(d,1);break}}u.tween=s}}function dw(t,r,i){var s,u;if(typeof i!="function")throw new Error;return function(){var f=Jr(this,t),d=f.tween;if(d!==s){u=(s=d).slice();for(var m={name:r,value:i},v=0,w=u.length;v<w;++v)if(u[v].name===r){u[v]=m;break}v===w&&u.push(m)}f.tween=u}}function hw(t,r){var i=this._id;if(t+="",arguments.length<2){for(var s=Rr(this.node(),i).tween,u=0,f=s.length,d;u<f;++u)if((d=s[u]).name===t)return d.value;return null}return this.each((r==null?fw:dw)(i,t,r))}function Hf(t,r,i){var s=t._id;return t.each(function(){var u=Jr(this,s);(u.value||(u.value={}))[r]=i.apply(this,arguments)}),function(u){return Rr(u,s).value[r]}}function Wm(t,r){var i;return(typeof r=="number"?Yr:r instanceof Di?fu:(i=Di(r))?(r=i,fu):Fm)(t,r)}function pw(t){return function(){this.removeAttribute(t)}}function mw(t){return function(){this.removeAttributeNS(t.space,t.local)}}function gw(t,r,i){var s,u=i+"",f;return function(){var d=this.getAttribute(t);return d===u?null:d===s?f:f=r(s=d,i)}}function yw(t,r,i){var s,u=i+"",f;return function(){var d=this.getAttributeNS(t.space,t.local);return d===u?null:d===s?f:f=r(s=d,i)}}function vw(t,r,i){var s,u,f;return function(){var d,m=i(this),v;return m==null?void this.removeAttribute(t):(d=this.getAttribute(t),v=m+"",d===v?null:d===s&&v===u?f:(u=v,f=r(s=d,m)))}}function xw(t,r,i){var s,u,f;return function(){var d,m=i(this),v;return m==null?void this.removeAttributeNS(t.space,t.local):(d=this.getAttributeNS(t.space,t.local),v=m+"",d===v?null:d===s&&v===u?f:(u=v,f=r(s=d,m)))}}function ww(t,r){var i=ku(t),s=i==="transform"?Zx:Wm;return this.attrTween(t,typeof r=="function"?(i.local?xw:vw)(i,s,Hf(this,"attr."+t,r)):r==null?(i.local?mw:pw)(i):(i.local?yw:gw)(i,s,r))}function bw(t,r){return function(i){this.setAttribute(t,r.call(this,i))}}function _w(t,r){return function(i){this.setAttributeNS(t.space,t.local,r.call(this,i))}}function Sw(t,r){var i,s;function u(){var f=r.apply(this,arguments);return f!==s&&(i=(s=f)&&_w(t,f)),i}return u._value=r,u}function kw(t,r){var i,s;function u(){var f=r.apply(this,arguments);return f!==s&&(i=(s=f)&&bw(t,f)),i}return u._value=r,u}function Nw(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=ku(t);return this.tween(i,(s.local?Sw:kw)(s,r))}function Ew(t,r){return function(){Bf(this,t).delay=+r.apply(this,arguments)}}function Cw(t,r){return r=+r,function(){Bf(this,t).delay=r}}function jw(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?Ew:Cw)(r,t)):Rr(this.node(),r).delay}function Pw(t,r){return function(){Jr(this,t).duration=+r.apply(this,arguments)}}function Mw(t,r){return r=+r,function(){Jr(this,t).duration=r}}function Tw(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?Pw:Mw)(r,t)):Rr(this.node(),r).duration}function Iw(t,r){if(typeof r!="function")throw new Error;return function(){Jr(this,t).ease=r}}function $w(t){var r=this._id;return arguments.length?this.each(Iw(r,t)):Rr(this.node(),r).ease}function Aw(t,r){return function(){var i=r.apply(this,arguments);if(typeof i!="function")throw new Error;Jr(this,t).ease=i}}function Ow(t){if(typeof t!="function")throw new Error;return this.each(Aw(this._id,t))}function Rw(t){typeof t!="function"&&(t=km(t));for(var r=this._groups,i=r.length,s=new Array(i),u=0;u<i;++u)for(var f=r[u],d=f.length,m=s[u]=[],v,w=0;w<d;++w)(v=f[w])&&t.call(v,v.__data__,w,f)&&m.push(v);return new Mo(s,this._parents,this._name,this._id)}function Dw(t){if(t._id!==this._id)throw new Error;for(var r=this._groups,i=t._groups,s=r.length,u=i.length,f=Math.min(s,u),d=new Array(s),m=0;m<f;++m)for(var v=r[m],w=i[m],k=v.length,x=d[m]=new Array(k),S,C=0;C<k;++C)(S=v[C]||w[C])&&(x[C]=S);for(;m<s;++m)d[m]=r[m];return new Mo(d,this._parents,this._name,this._id)}function Lw(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 zw(t,r,i){var s,u,f=Lw(r)?Bf:Jr;return function(){var d=f(this,t),m=d.on;m!==s&&(u=(s=m).copy()).on(r,i),d.on=u}}function Fw(t,r){var i=this._id;return arguments.length<2?Rr(this.node(),i).on.on(t):this.each(zw(i,t,r))}function Bw(t){return function(){var r=this.parentNode;for(var i in this.__transition)if(+i!==t)return;r&&r.removeChild(this)}}function Hw(){return this.on("end.remove",Bw(this._id))}function Vw(t){var r=this._name,i=this._id;typeof t!="function"&&(t=Rf(t));for(var s=this._groups,u=s.length,f=new Array(u),d=0;d<u;++d)for(var m=s[d],v=m.length,w=f[d]=new Array(v),k,x,S=0;S<v;++S)(k=m[S])&&(x=t.call(k,k.__data__,S,m))&&("__data__"in k&&(x.__data__=k.__data__),w[S]=x,Eu(w[S],r,i,S,w,Rr(k,i)));return new Mo(f,this._parents,r,i)}function Uw(t){var r=this._name,i=this._id;typeof t!="function"&&(t=Sm(t));for(var s=this._groups,u=s.length,f=[],d=[],m=0;m<u;++m)for(var v=s[m],w=v.length,k,x=0;x<w;++x)if(k=v[x]){for(var S=t.call(k,k.__data__,x,v),C,j=Rr(k,i),T=0,I=S.length;T<I;++T)(C=S[T])&&Eu(C,r,i,T,S,j);f.push(S),d.push(k)}return new Mo(f,d,r,i)}var Kw=Aa.prototype.constructor;function qw(){return new Kw(this._groups,this._parents)}function Ww(t,r){var i,s,u;return function(){var f=Ps(this,t),d=(this.style.removeProperty(t),Ps(this,t));return f===d?null:f===i&&d===s?u:u=r(i=f,s=d)}}function Ym(t){return function(){this.style.removeProperty(t)}}function Yw(t,r,i){var s,u=i+"",f;return function(){var d=Ps(this,t);return d===u?null:d===s?f:f=r(s=d,i)}}function Xw(t,r,i){var s,u,f;return function(){var d=Ps(this,t),m=i(this),v=m+"";return m==null&&(v=m=(this.style.removeProperty(t),Ps(this,t))),d===v?null:d===s&&v===u?f:(u=v,f=r(s=d,m))}}function Qw(t,r){var i,s,u,f="style."+r,d="end."+f,m;return function(){var v=Jr(this,t),w=v.on,k=v.value[f]==null?m||(m=Ym(r)):void 0;(w!==i||u!==k)&&(s=(i=w).copy()).on(d,u=k),v.on=s}}function Gw(t,r,i){var s=(t+="")=="transform"?Jx:Wm;return r==null?this.styleTween(t,Ww(t,s)).on("end.style."+t,Ym(t)):typeof r=="function"?this.styleTween(t,Xw(t,s,Hf(this,"style."+t,r))).each(Qw(this._id,t)):this.styleTween(t,Yw(t,s,r),i).on("end.style."+t,null)}function Jw(t,r,i){return function(s){this.style.setProperty(t,r.call(this,s),i)}}function Zw(t,r,i){var s,u;function f(){var d=r.apply(this,arguments);return d!==u&&(s=(u=d)&&Jw(t,d,i)),s}return f._value=r,f}function e1(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,Zw(t,r,i??""))}function t1(t){return function(){this.textContent=t}}function n1(t){return function(){var r=t(this);this.textContent=r??""}}function r1(t){return this.tween("text",typeof t=="function"?n1(Hf(this,"text",t)):t1(t==null?"":t+""))}function o1(t){return function(r){this.textContent=t.call(this,r)}}function i1(t){var r,i;function s(){var u=t.apply(this,arguments);return u!==i&&(r=(i=u)&&o1(u)),r}return s._value=t,s}function s1(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,i1(t))}function a1(){for(var t=this._name,r=this._id,i=Xm(),s=this._groups,u=s.length,f=0;f<u;++f)for(var d=s[f],m=d.length,v,w=0;w<m;++w)if(v=d[w]){var k=Rr(v,r);Eu(v,t,i,w,d,{time:k.time+k.delay+k.duration,delay:0,duration:k.duration,ease:k.ease})}return new Mo(s,this._parents,t,i)}function l1(){var t,r,i=this,s=i._id,u=i.size();return new Promise(function(f,d){var m={value:d},v={value:function(){--u===0&&f()}};i.each(function(){var w=Jr(this,s),k=w.on;k!==t&&(r=(t=k).copy(),r._.cancel.push(m),r._.interrupt.push(m),r._.end.push(v)),w.on=r}),u===0&&f()})}var u1=0;function Mo(t,r,i,s){this._groups=t,this._parents=r,this._name=i,this._id=s}function Xm(){return++u1}var Co=Aa.prototype;Mo.prototype={constructor:Mo,select:Vw,selectAll:Uw,selectChild:Co.selectChild,selectChildren:Co.selectChildren,filter:Rw,merge:Dw,selection:qw,transition:a1,call:Co.call,nodes:Co.nodes,node:Co.node,size:Co.size,empty:Co.empty,each:Co.each,on:Fw,attr:ww,attrTween:Nw,style:Gw,styleTween:e1,text:r1,textTween:s1,remove:Hw,tween:hw,delay:jw,duration:Tw,ease:$w,easeVarying:Ow,end:l1,[Symbol.iterator]:Co[Symbol.iterator]};function c1(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var f1={time:null,delay:0,duration:250,ease:c1};function d1(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 h1(t){var r,i;t instanceof Mo?(r=t._id,t=t._name):(r=Xm(),(i=f1).time=Ff(),t=t==null?null:t+"");for(var s=this._groups,u=s.length,f=0;f<u;++f)for(var d=s[f],m=d.length,v,w=0;w<m;++w)(v=d[w])&&Eu(v,t,r,w,d,i||d1(v,r));return new Mo(s,this._parents,t,r)}Aa.prototype.interrupt=cw;Aa.prototype.transition=h1;const Yl=t=>()=>t;function p1(t,{sourceEvent:r,target:i,transform:s,dispatch:u}){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:u}})}function jo(t,r,i){this.k=t,this.x=r,this.y=i}jo.prototype={constructor:jo,scale:function(t){return t===1?this:new jo(this.k*t,this.x,this.y)},translate:function(t,r){return t===0&r===0?this:new jo(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 Cu=new jo(1,0,0);Qm.prototype=jo.prototype;function Qm(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Cu;return t.__zoom}function of(t){t.stopImmediatePropagation()}function xa(t){t.preventDefault(),t.stopImmediatePropagation()}function m1(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function g1(){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 vp(){return this.__zoom||Cu}function y1(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function v1(){return navigator.maxTouchPoints||"ontouchstart"in this}function x1(t,r,i){var s=t.invertX(r[0][0])-i[0][0],u=t.invertX(r[1][0])-i[1][0],f=t.invertY(r[0][1])-i[0][1],d=t.invertY(r[1][1])-i[1][1];return t.translate(u>s?(s+u)/2:Math.min(0,s)||Math.max(0,u),d>f?(f+d)/2:Math.min(0,f)||Math.max(0,d))}function Gm(){var t=m1,r=g1,i=x1,s=y1,u=v1,f=[0,1/0],d=[[-1/0,-1/0],[1/0,1/0]],m=250,v=tu,w=Su("start","zoom","end"),k,x,S,C=500,j=150,T=0,I=10;function A(D){D.property("__zoom",vp).on("wheel.zoom",fe,{passive:!1}).on("mousedown.zoom",pe).on("dblclick.zoom",_e).filter(u).on("touchstart.zoom",U).on("touchmove.zoom",ce).on("touchend.zoom touchcancel.zoom",xe).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}A.transform=function(D,le,Q,ie){var z=D.selection?D.selection():D;z.property("__zoom",vp),D!==z?W(D,le,Q,ie):z.interrupt().each(function(){B(this,arguments).event(ie).start().zoom(null,typeof le=="function"?le.apply(this,arguments):le).end()})},A.scaleBy=function(D,le,Q,ie){A.scaleTo(D,function(){var z=this.__zoom.k,K=typeof le=="function"?le.apply(this,arguments):le;return z*K},Q,ie)},A.scaleTo=function(D,le,Q,ie){A.transform(D,function(){var z=r.apply(this,arguments),K=this.__zoom,F=Q==null?R(z):typeof Q=="function"?Q.apply(this,arguments):Q,$=K.invert(F),H=typeof le=="function"?le.apply(this,arguments):le;return i(P(V(K,H),F,$),z,d)},Q,ie)},A.translateBy=function(D,le,Q,ie){A.transform(D,function(){return i(this.__zoom.translate(typeof le=="function"?le.apply(this,arguments):le,typeof Q=="function"?Q.apply(this,arguments):Q),r.apply(this,arguments),d)},null,ie)},A.translateTo=function(D,le,Q,ie,z){A.transform(D,function(){var K=r.apply(this,arguments),F=this.__zoom,$=ie==null?R(K):typeof ie=="function"?ie.apply(this,arguments):ie;return i(Cu.translate($[0],$[1]).scale(F.k).translate(typeof le=="function"?-le.apply(this,arguments):-le,typeof Q=="function"?-Q.apply(this,arguments):-Q),K,d)},ie,z)};function V(D,le){return le=Math.max(f[0],Math.min(f[1],le)),le===D.k?D:new jo(le,D.x,D.y)}function P(D,le,Q){var ie=le[0]-Q[0]*D.k,z=le[1]-Q[1]*D.k;return ie===D.x&&z===D.y?D:new jo(D.k,ie,z)}function R(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function W(D,le,Q,ie){D.on("start.zoom",function(){B(this,arguments).event(ie).start()}).on("interrupt.zoom end.zoom",function(){B(this,arguments).event(ie).end()}).tween("zoom",function(){var z=this,K=arguments,F=B(z,K).event(ie),$=r.apply(z,K),H=Q==null?R($):typeof Q=="function"?Q.apply(z,K):Q,we=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),Se=z.__zoom,Me=typeof le=="function"?le.apply(z,K):le,$e=v(Se.invert(H).concat(we/Se.k),Me.invert(H).concat(we/Me.k));return function(Ae){if(Ae===1)Ae=Me;else{var be=$e(Ae),Be=we/be[2];Ae=new jo(Be,H[0]-be[0]*Be,H[1]-be[1]*Be)}F.zoom(null,Ae)}})}function B(D,le,Q){return!Q&&D.__zooming||new X(D,le)}function X(D,le){this.that=D,this.args=le,this.active=0,this.sourceEvent=null,this.extent=r.apply(D,le),this.taps=0}X.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,le){return this.mouse&&D!=="mouse"&&(this.mouse[1]=le.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=le.invert(this.touch0[0])),this.touch1&&D!=="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(D){var le=Zn(this.that).datum();w.call(D,this.that,new p1(D,{sourceEvent:this.sourceEvent,target:A,transform:this.that.__zoom,dispatch:w}),le)}};function fe(D,...le){if(!t.apply(this,arguments))return;var Q=B(this,le).event(D),ie=this.__zoom,z=Math.max(f[0],Math.min(f[1],ie.k*Math.pow(2,s.apply(this,arguments)))),K=Ir(D);if(Q.wheel)(Q.mouse[0][0]!==K[0]||Q.mouse[0][1]!==K[1])&&(Q.mouse[1]=ie.invert(Q.mouse[0]=K)),clearTimeout(Q.wheel);else{if(ie.k===z)return;Q.mouse=[K,ie.invert(K)],ou(this),Q.start()}xa(D),Q.wheel=setTimeout(F,j),Q.zoom("mouse",i(P(V(ie,z),Q.mouse[0],Q.mouse[1]),Q.extent,d));function F(){Q.wheel=null,Q.end()}}function pe(D,...le){if(S||!t.apply(this,arguments))return;var Q=D.currentTarget,ie=B(this,le,!0).event(D),z=Zn(D.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",we,!0),K=Ir(D,Q),F=D.clientX,$=D.clientY;Am(D.view),of(D),ie.mouse=[K,this.__zoom.invert(K)],ou(this),ie.start();function H(Se){if(xa(Se),!ie.moved){var Me=Se.clientX-F,$e=Se.clientY-$;ie.moved=Me*Me+$e*$e>T}ie.event(Se).zoom("mouse",i(P(ie.that.__zoom,ie.mouse[0]=Ir(Se,Q),ie.mouse[1]),ie.extent,d))}function we(Se){z.on("mousemove.zoom mouseup.zoom",null),Om(Se.view,ie.moved),xa(Se),ie.event(Se).end()}}function _e(D,...le){if(t.apply(this,arguments)){var Q=this.__zoom,ie=Ir(D.changedTouches?D.changedTouches[0]:D,this),z=Q.invert(ie),K=Q.k*(D.shiftKey?.5:2),F=i(P(V(Q,K),ie,z),r.apply(this,le),d);xa(D),m>0?Zn(this).transition().duration(m).call(W,F,ie,D):Zn(this).call(A.transform,F,ie,D)}}function U(D,...le){if(t.apply(this,arguments)){var Q=D.touches,ie=Q.length,z=B(this,le,D.changedTouches.length===ie).event(D),K,F,$,H;for(of(D),F=0;F<ie;++F)$=Q[F],H=Ir($,this),H=[H,this.__zoom.invert(H),$.identifier],z.touch0?!z.touch1&&z.touch0[2]!==H[2]&&(z.touch1=H,z.taps=0):(z.touch0=H,K=!0,z.taps=1+!!k);k&&(k=clearTimeout(k)),K&&(z.taps<2&&(x=H[0],k=setTimeout(function(){k=null},C)),ou(this),z.start())}}function ce(D,...le){if(this.__zooming){var Q=B(this,le).event(D),ie=D.changedTouches,z=ie.length,K,F,$,H;for(xa(D),K=0;K<z;++K)F=ie[K],$=Ir(F,this),Q.touch0&&Q.touch0[2]===F.identifier?Q.touch0[0]=$:Q.touch1&&Q.touch1[2]===F.identifier&&(Q.touch1[0]=$);if(F=Q.that.__zoom,Q.touch1){var we=Q.touch0[0],Se=Q.touch0[1],Me=Q.touch1[0],$e=Q.touch1[1],Ae=(Ae=Me[0]-we[0])*Ae+(Ae=Me[1]-we[1])*Ae,be=(be=$e[0]-Se[0])*be+(be=$e[1]-Se[1])*be;F=V(F,Math.sqrt(Ae/be)),$=[(we[0]+Me[0])/2,(we[1]+Me[1])/2],H=[(Se[0]+$e[0])/2,(Se[1]+$e[1])/2]}else if(Q.touch0)$=Q.touch0[0],H=Q.touch0[1];else return;Q.zoom("touch",i(P(F,$,H),Q.extent,d))}}function xe(D,...le){if(this.__zooming){var Q=B(this,le).event(D),ie=D.changedTouches,z=ie.length,K,F;for(of(D),S&&clearTimeout(S),S=setTimeout(function(){S=null},C),K=0;K<z;++K)F=ie[K],Q.touch0&&Q.touch0[2]===F.identifier?delete Q.touch0:Q.touch1&&Q.touch1[2]===F.identifier&&delete Q.touch1;if(Q.touch1&&!Q.touch0&&(Q.touch0=Q.touch1,delete Q.touch1),Q.touch0)Q.touch0[1]=this.__zoom.invert(Q.touch0[0]);else if(Q.end(),Q.taps===2&&(F=Ir(F,this),Math.hypot(x[0]-F[0],x[1]-F[1])<I)){var $=Zn(this).on("dblclick.zoom");$&&$.apply(this,arguments)}}}return A.wheelDelta=function(D){return arguments.length?(s=typeof D=="function"?D:Yl(+D),A):s},A.filter=function(D){return arguments.length?(t=typeof D=="function"?D:Yl(!!D),A):t},A.touchable=function(D){return arguments.length?(u=typeof D=="function"?D:Yl(!!D),A):u},A.extent=function(D){return arguments.length?(r=typeof D=="function"?D:Yl([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),A):r},A.scaleExtent=function(D){return arguments.length?(f[0]=+D[0],f[1]=+D[1],A):[f[0],f[1]]},A.translateExtent=function(D){return arguments.length?(d[0][0]=+D[0][0],d[1][0]=+D[1][0],d[0][1]=+D[0][1],d[1][1]=+D[1][1],A):[[d[0][0],d[0][1]],[d[1][0],d[1][1]]]},A.constrain=function(D){return arguments.length?(i=D,A):i},A.duration=function(D){return arguments.length?(m=+D,A):m},A.interpolate=function(D){return arguments.length?(v=D,A):v},A.on=function(){var D=w.on.apply(w,arguments);return D===w?A:D},A.clickDistance=function(D){return arguments.length?(T=(D=+D)*D,A):Math.sqrt(T)},A.tapDistance=function(D){return arguments.length?(I=+D,A):I},A}const Qr={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]],Jm=["Enter"," ","Escape"],Zm={"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 Ts;(function(t){t.Strict="strict",t.Loose="loose"})(Ts||(Ts={}));var Ri;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(Ri||(Ri={}));var Pa;(function(t){t.Partial="partial",t.Full="full"})(Pa||(Pa={}));const eg={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var li;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(li||(li={}));var mu;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(mu||(mu={}));var Ze;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(Ze||(Ze={}));const xp={[Ze.Left]:Ze.Right,[Ze.Right]:Ze.Left,[Ze.Top]:Ze.Bottom,[Ze.Bottom]:Ze.Top};function tg(t){return t===null?null:t?"valid":"invalid"}const ng=t=>"id"in t&&"source"in t&&"target"in t,w1=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Vf=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),Ra=(t,r=[0,0])=>{const{width:i,height:s}=To(t),u=t.origin??r,f=i*u[0],d=s*u[1];return{x:t.position.x-f,y:t.position.y-d}},b1=(t,r={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const i=t.reduce((s,u)=>{const f=typeof u=="string";let d=!r.nodeLookup&&!f?u:void 0;r.nodeLookup&&(d=f?r.nodeLookup.get(u):Vf(u)?u:r.nodeLookup.get(u.id));const m=d?gu(d,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ju(s,m)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Pu(i)},Da=(t,r={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return t.forEach(u=>{(r.filter===void 0||r.filter(u))&&(i=ju(i,gu(u)),s=!0)}),s?Pu(i):{x:0,y:0,width:0,height:0}},Uf=(t,r,[i,s,u]=[0,0,1],f=!1,d=!1)=>{const m={...za(r,[i,s,u]),width:r.width/u,height:r.height/u},v=[];for(const w of t.values()){const{measured:k,selectable:x=!0,hidden:S=!1}=w;if(d&&!x||S)continue;const C=k.width??w.width??w.initialWidth??null,j=k.height??w.height??w.initialHeight??null,T=Ma(m,$s(w)),I=(C??0)*(j??0),A=f&&T>0;(!w.internals.handleBounds||A||T>=I||w.dragging)&&v.push(w)}return v},_1=(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 S1(t,r){const i=new Map,s=r!=null&&r.nodes?new Set(r.nodes.map(u=>u.id)):null;return t.forEach(u=>{u.measured.width&&u.measured.height&&((r==null?void 0:r.includeHiddenNodes)||!u.hidden)&&(!s||s.has(u.id))&&i.set(u.id,u)}),i}async function k1({nodes:t,width:r,height:i,panZoom:s,minZoom:u,maxZoom:f},d){if(t.size===0)return Promise.resolve(!0);const m=S1(t,d),v=Da(m),w=Kf(v,r,i,(d==null?void 0:d.minZoom)??u,(d==null?void 0:d.maxZoom)??f,(d==null?void 0:d.padding)??.1);return await s.setViewport(w,{duration:d==null?void 0:d.duration,ease:d==null?void 0:d.ease,interpolate:d==null?void 0:d.interpolate}),Promise.resolve(!0)}function rg({nodeId:t,nextPosition:r,nodeLookup:i,nodeOrigin:s=[0,0],nodeExtent:u,onError:f}){const d=i.get(t),m=d.parentId?i.get(d.parentId):void 0,{x:v,y:w}=m?m.internals.positionAbsolute:{x:0,y:0},k=d.origin??s;let x=d.extent||u;if(d.extent==="parent"&&!d.expandParent)if(!m)f==null||f("005",Qr.error005());else{const C=m.measured.width,j=m.measured.height;C&&j&&(x=[[v,w],[v+C,w+j]])}else m&&As(d.extent)&&(x=[[d.extent[0][0]+v,d.extent[0][1]+w],[d.extent[1][0]+v,d.extent[1][1]+w]]);const S=As(x)?zi(r,x,d.measured):r;return(d.measured.width===void 0||d.measured.height===void 0)&&(f==null||f("015",Qr.error015())),{position:{x:S.x-v+(d.measured.width??0)*k[0],y:S.y-w+(d.measured.height??0)*k[1]},positionAbsolute:S}}async function N1({nodesToRemove:t=[],edgesToRemove:r=[],nodes:i,edges:s,onBeforeDelete:u}){const f=new Set(t.map(S=>S.id)),d=[];for(const S of i){if(S.deletable===!1)continue;const C=f.has(S.id),j=!C&&S.parentId&&d.find(T=>T.id===S.parentId);(C||j)&&d.push(S)}const m=new Set(r.map(S=>S.id)),v=s.filter(S=>S.deletable!==!1),k=_1(d,v);for(const S of v)m.has(S.id)&&!k.find(j=>j.id===S.id)&&k.push(S);if(!u)return{edges:k,nodes:d};const x=await u({nodes:d,edges:k});return typeof x=="boolean"?x?{edges:k,nodes:d}:{edges:[],nodes:[]}:x}const Is=(t,r=0,i=1)=>Math.min(Math.max(t,r),i),zi=(t={x:0,y:0},r,i)=>({x:Is(t.x,r[0][0],r[1][0]-((i==null?void 0:i.width)??0)),y:Is(t.y,r[0][1],r[1][1]-((i==null?void 0:i.height)??0))});function og(t,r,i){const{width:s,height:u}=To(i),{x:f,y:d}=i.internals.positionAbsolute;return zi(t,[[f,d],[f+s,d+u]],r)}const wp=(t,r,i)=>t<r?Is(Math.abs(t-r),1,r)/r:t>i?-Is(Math.abs(t-i),1,r)/r:0,ig=(t,r,i=15,s=40)=>{const u=wp(t.x,s,r.width-s)*i,f=wp(t.y,s,r.height-s)*i;return[u,f]},ju=(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)}),jf=({x:t,y:r,width:i,height:s})=>({x:t,y:r,x2:t+i,y2:r+s}),Pu=({x:t,y:r,x2:i,y2:s})=>({x:t,y:r,width:i-t,height:s-r}),$s=(t,r=[0,0])=>{var u,f;const{x:i,y:s}=Vf(t)?t.internals.positionAbsolute:Ra(t,r);return{x:i,y:s,width:((u=t.measured)==null?void 0:u.width)??t.width??t.initialWidth??0,height:((f=t.measured)==null?void 0:f.height)??t.height??t.initialHeight??0}},gu=(t,r=[0,0])=>{var u,f;const{x:i,y:s}=Vf(t)?t.internals.positionAbsolute:Ra(t,r);return{x:i,y:s,x2:i+(((u=t.measured)==null?void 0:u.width)??t.width??t.initialWidth??0),y2:s+(((f=t.measured)==null?void 0:f.height)??t.height??t.initialHeight??0)}},sg=(t,r)=>Pu(ju(jf(t),jf(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)},bp=t=>Ar(t.width)&&Ar(t.height)&&Ar(t.x)&&Ar(t.y),Ar=t=>!isNaN(t)&&isFinite(t),E1=(t,r)=>{},La=(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,u],f=!1,d=[1,1])=>{const m={x:(t-i)/u,y:(r-s)/u};return f?La(m,d):m},yu=({x:t,y:r},[i,s,u])=>({x:t*u+i,y:r*u+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 C1(t,r,i){if(typeof t=="string"||typeof t=="number"){const s=_s(t,i),u=_s(t,r);return{top:s,right:u,bottom:s,left:u,x:u*2,y:s*2}}if(typeof t=="object"){const s=_s(t.top??t.y??0,i),u=_s(t.bottom??t.y??0,i),f=_s(t.left??t.x??0,r),d=_s(t.right??t.x??0,r);return{top:s,right:d,bottom:u,left:f,x:f+d,y:s+u}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function j1(t,r,i,s,u,f){const{x:d,y:m}=yu(t,[r,i,s]),{x:v,y:w}=yu({x:t.x+t.width,y:t.y+t.height},[r,i,s]),k=u-v,x=f-w;return{left:Math.floor(d),top:Math.floor(m),right:Math.floor(k),bottom:Math.floor(x)}}const Kf=(t,r,i,s,u,f)=>{const d=C1(f,r,i),m=(r-d.x)/t.width,v=(i-d.y)/t.height,w=Math.min(m,v),k=Is(w,s,u),x=t.x+t.width/2,S=t.y+t.height/2,C=r/2-x*k,j=i/2-S*k,T=j1(t,C,j,k,r,i),I={left:Math.min(T.left-d.left,0),top:Math.min(T.top-d.top,0),right:Math.min(T.right-d.right,0),bottom:Math.min(T.bottom-d.bottom,0)};return{x:C-I.left+I.right,y:j-I.top+I.bottom,zoom:k}},Ta=()=>{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 To(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 ag(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 lg(t,r={width:0,height:0},i,s,u){const f={...t},d=s.get(i);if(d){const m=d.origin||u;f.x+=d.internals.positionAbsolute.x-(r.width??0)*m[0],f.y+=d.internals.positionAbsolute.y-(r.height??0)*m[1]}return f}function _p(t,r){if(t.size!==r.size)return!1;for(const i of t)if(!r.has(i))return!1;return!0}function P1(){let t,r;return{promise:new Promise((s,u)=>{t=s,r=u}),resolve:t,reject:r}}function M1(t){return{...Zm,...t||{}}}function Sa(t,{snapGrid:r=[0,0],snapToGrid:i=!1,transform:s,containerBounds:u}){const{x:f,y:d}=Or(t),m=za({x:f-((u==null?void 0:u.left)??0),y:d-((u==null?void 0:u.top)??0)},s),{x:v,y:w}=i?La(m,r):m;return{xSnapped:v,ySnapped:w,...m}}const qf=t=>({width:t.offsetWidth,height:t.offsetHeight}),ug=t=>{var r;return((r=t==null?void 0:t.getRootNode)==null?void 0:r.call(t))||(window==null?void 0:window.document)},T1=["INPUT","SELECT","TEXTAREA"];function cg(t){var s,u;const r=((u=(s=t.composedPath)==null?void 0:s.call(t))==null?void 0:u[0])||t.target;return(r==null?void 0:r.nodeType)!==1?!1:T1.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const fg=t=>"clientX"in t,Or=(t,r)=>{var f,d;const i=fg(t),s=i?t.clientX:(f=t.touches)==null?void 0:f[0].clientX,u=i?t.clientY:(d=t.touches)==null?void 0:d[0].clientY;return{x:s-((r==null?void 0:r.left)??0),y:u-((r==null?void 0:r.top)??0)}},Sp=(t,r,i,s,u)=>{const f=r.querySelectorAll(`.${t}`);return!f||!f.length?null:Array.from(f).map(d=>{const m=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),type:t,nodeId:u,position:d.getAttribute("data-handlepos"),x:(m.left-i.left)/s,y:(m.top-i.top)/s,...qf(d)}})};function dg({sourceX:t,sourceY:r,targetX:i,targetY:s,sourceControlX:u,sourceControlY:f,targetControlX:d,targetControlY:m}){const v=t*.125+u*.375+d*.375+i*.125,w=r*.125+f*.375+m*.375+s*.125,k=Math.abs(v-t),x=Math.abs(w-r);return[v,w,k,x]}function Xl(t,r){return t>=0?.5*t:r*25*Math.sqrt(-t)}function kp({pos:t,x1:r,y1:i,x2:s,y2:u,c:f}){switch(t){case Ze.Left:return[r-Xl(r-s,f),i];case Ze.Right:return[r+Xl(s-r,f),i];case Ze.Top:return[r,i-Xl(i-u,f)];case Ze.Bottom:return[r,i+Xl(u-i,f)]}}function hg({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:s,targetY:u,targetPosition:f=Ze.Top,curvature:d=.25}){const[m,v]=kp({pos:i,x1:t,y1:r,x2:s,y2:u,c:d}),[w,k]=kp({pos:f,x1:s,y1:u,x2:t,y2:r,c:d}),[x,S,C,j]=dg({sourceX:t,sourceY:r,targetX:s,targetY:u,sourceControlX:m,sourceControlY:v,targetControlX:w,targetControlY:k});return[`M${t},${r} C${m},${v} ${w},${k} ${s},${u}`,x,S,C,j]}function pg({sourceX:t,sourceY:r,targetX:i,targetY:s}){const u=Math.abs(i-t)/2,f=i<t?i+u:i-u,d=Math.abs(s-r)/2,m=s<r?s+d:s-d;return[f,m,u,d]}function I1({sourceNode:t,targetNode:r,selected:i=!1,zIndex:s=0,elevateOnSelect:u=!1,zIndexMode:f="basic"}){if(f==="manual")return s;const d=u&&i?s+1e3:s,m=Math.max(t.parentId||u&&t.selected?t.internals.z:0,r.parentId||u&&r.selected?r.internals.z:0);return d+m}function $1({sourceNode:t,targetNode:r,width:i,height:s,transform:u}){const f=ju(gu(t),gu(r));f.x===f.x2&&(f.x2+=1),f.y===f.y2&&(f.y2+=1);const d={x:-u[0]/u[2],y:-u[1]/u[2],width:i/u[2],height:s/u[2]};return Ma(d,Pu(f))>0}const A1=({source:t,sourceHandle:r,target:i,targetHandle:s})=>`xy-edge__${t}${r||""}-${i}${s||""}`,O1=(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)),mg=(t,r,i={})=>{if(!t.source||!t.target)return r;const s=i.getEdgeId||A1;let u;return ng(t)?u={...t}:u={...t,id:s(t)},O1(u,r)?r:(u.sourceHandle===null&&delete u.sourceHandle,u.targetHandle===null&&delete u.targetHandle,r.concat(u))};function gg({sourceX:t,sourceY:r,targetX:i,targetY:s}){const[u,f,d,m]=pg({sourceX:t,sourceY:r,targetX:i,targetY:s});return[`M ${t},${r}L ${i},${s}`,u,f,d,m]}const Np={[Ze.Left]:{x:-1,y:0},[Ze.Right]:{x:1,y:0},[Ze.Top]:{x:0,y:-1},[Ze.Bottom]:{x:0,y:1}},R1=({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},Ep=(t,r)=>Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2));function D1({source:t,sourcePosition:r=Ze.Bottom,target:i,targetPosition:s=Ze.Top,center:u,offset:f,stepPosition:d}){const m=Np[r],v=Np[s],w={x:t.x+m.x*f,y:t.y+m.y*f},k={x:i.x+v.x*f,y:i.y+v.y*f},x=R1({source:w,sourcePosition:r,target:k}),S=x.x!==0?"x":"y",C=x[S];let j=[],T,I;const A={x:0,y:0},V={x:0,y:0},[,,P,R]=pg({sourceX:t.x,sourceY:t.y,targetX:i.x,targetY:i.y});if(m[S]*v[S]===-1){S==="x"?(T=u.x??w.x+(k.x-w.x)*d,I=u.y??(w.y+k.y)/2):(T=u.x??(w.x+k.x)/2,I=u.y??w.y+(k.y-w.y)*d);const fe=[{x:T,y:w.y},{x:T,y:k.y}],pe=[{x:w.x,y:I},{x:k.x,y:I}];m[S]===C?j=S==="x"?fe:pe:j=S==="x"?pe:fe}else{const fe=[{x:w.x,y:k.y}],pe=[{x:k.x,y:w.y}];if(S==="x"?j=m.x===C?pe:fe:j=m.y===C?fe:pe,r===s){const D=Math.abs(t[S]-i[S]);if(D<=f){const le=Math.min(f-1,f-D);m[S]===C?A[S]=(w[S]>t[S]?-1:1)*le:V[S]=(k[S]>i[S]?-1:1)*le}}if(r!==s){const D=S==="x"?"y":"x",le=m[S]===v[D],Q=w[D]>k[D],ie=w[D]<k[D];(m[S]===1&&(!le&&Q||le&&ie)||m[S]!==1&&(!le&&ie||le&&Q))&&(j=S==="x"?fe:pe)}const _e={x:w.x+A.x,y:w.y+A.y},U={x:k.x+V.x,y:k.y+V.y},ce=Math.max(Math.abs(_e.x-j[0].x),Math.abs(U.x-j[0].x)),xe=Math.max(Math.abs(_e.y-j[0].y),Math.abs(U.y-j[0].y));ce>=xe?(T=(_e.x+U.x)/2,I=j[0].y):(T=j[0].x,I=(_e.y+U.y)/2)}const W={x:w.x+A.x,y:w.y+A.y},B={x:k.x+V.x,y:k.y+V.y};return[[t,...W.x!==j[0].x||W.y!==j[0].y?[W]:[],...j,...B.x!==j[j.length-1].x||B.y!==j[j.length-1].y?[B]:[],i],T,I,P,R]}function L1(t,r,i,s){const u=Math.min(Ep(t,r)/2,Ep(r,i)/2,s),{x:f,y:d}=r;if(t.x===f&&f===i.x||t.y===d&&d===i.y)return`L${f} ${d}`;if(t.y===d){const w=t.x<i.x?-1:1,k=t.y<i.y?1:-1;return`L ${f+u*w},${d}Q ${f},${d} ${f},${d+u*k}`}const m=t.x<i.x?1:-1,v=t.y<i.y?-1:1;return`L ${f},${d+u*v}Q ${f},${d} ${f+u*m},${d}`}function Pf({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:s,targetY:u,targetPosition:f=Ze.Top,borderRadius:d=5,centerX:m,centerY:v,offset:w=20,stepPosition:k=.5}){const[x,S,C,j,T]=D1({source:{x:t,y:r},sourcePosition:i,target:{x:s,y:u},targetPosition:f,center:{x:m,y:v},offset:w,stepPosition:k});let I=`M${x[0].x} ${x[0].y}`;for(let A=1;A<x.length-1;A++)I+=L1(x[A-1],x[A],x[A+1],d);return I+=`L${x[x.length-1].x} ${x[x.length-1].y}`,[I,S,C,j,T]}function Cp(t){var r;return t&&!!(t.internals.handleBounds||(r=t.handles)!=null&&r.length)&&!!(t.measured.width||t.width||t.initialWidth)}function z1(t){var x;const{sourceNode:r,targetNode:i}=t;if(!Cp(r)||!Cp(i))return null;const s=r.internals.handleBounds||jp(r.handles),u=i.internals.handleBounds||jp(i.handles),f=Pp((s==null?void 0:s.source)??[],t.sourceHandle),d=Pp(t.connectionMode===Ts.Strict?(u==null?void 0:u.target)??[]:((u==null?void 0:u.target)??[]).concat((u==null?void 0:u.source)??[]),t.targetHandle);if(!f||!d)return(x=t.onError)==null||x.call(t,"008",Qr.error008(f?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const m=(f==null?void 0:f.position)||Ze.Bottom,v=(d==null?void 0:d.position)||Ze.Top,w=Fi(r,f,m),k=Fi(i,d,v);return{sourceX:w.x,sourceY:w.y,targetX:k.x,targetY:k.y,sourcePosition:m,targetPosition:v}}function jp(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 Fi(t,r,i=Ze.Left,s=!1){const u=((r==null?void 0:r.x)??0)+t.internals.positionAbsolute.x,f=((r==null?void 0:r.y)??0)+t.internals.positionAbsolute.y,{width:d,height:m}=r??To(t);if(s)return{x:u+d/2,y:f+m/2};switch((r==null?void 0:r.position)??i){case Ze.Top:return{x:u+d/2,y:f};case Ze.Right:return{x:u+d,y:f+m/2};case Ze.Bottom:return{x:u+d/2,y:f+m};case Ze.Left:return{x:u,y:f+m/2}}}function Pp(t,r){return t&&(r?t.find(i=>i.id===r):t[0])||null}function Mf(t,r){return t?typeof t=="string"?t:`${r?`${r}__`:""}${Object.keys(t).sort().map(s=>`${s}=${t[s]}`).join("&")}`:""}function F1(t,{id:r,defaultColor:i,defaultMarkerStart:s,defaultMarkerEnd:u}){const f=new Set;return t.reduce((d,m)=>([m.markerStart||s,m.markerEnd||u].forEach(v=>{if(v&&typeof v=="object"){const w=Mf(v,r);f.has(w)||(d.push({id:w,color:v.color||i,...v}),f.add(w))}}),d),[]).sort((d,m)=>d.id.localeCompare(m.id))}const yg=1e3,B1=10,Wf={nodeOrigin:[0,0],nodeExtent:ja,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},H1={...Wf,checkEquality:!0};function Yf(t,r){const i={...t};for(const s in r)r[s]!==void 0&&(i[s]=r[s]);return i}function V1(t,r,i){const s=Yf(Wf,i);for(const u of t.values())if(u.parentId)Qf(u,t,r,s);else{const f=Ra(u,s.nodeOrigin),d=As(u.extent)?u.extent:s.nodeExtent,m=zi(f,d,To(u));u.internals.positionAbsolute=m}}function U1(t,r){if(!t.handles)return t.measured?r==null?void 0:r.internals.handleBounds:void 0;const i=[],s=[];for(const u of t.handles){const f={id:u.id,width:u.width??1,height:u.height??1,nodeId:t.id,x:u.x,y:u.y,position:u.position,type:u.type};u.type==="source"?i.push(f):u.type==="target"&&s.push(f)}return{source:i,target:s}}function Xf(t){return t==="manual"}function Tf(t,r,i,s={}){var k,x;const u=Yf(H1,s),f={i:0},d=new Map(r),m=u!=null&&u.elevateNodesOnSelect&&!Xf(u.zIndexMode)?yg:0;let v=t.length>0,w=!1;r.clear(),i.clear();for(const S of t){let C=d.get(S.id);if(u.checkEquality&&S===(C==null?void 0:C.internals.userNode))r.set(S.id,C);else{const j=Ra(S,u.nodeOrigin),T=As(S.extent)?S.extent:u.nodeExtent,I=zi(j,T,To(S));C={...u.defaults,...S,measured:{width:(k=S.measured)==null?void 0:k.width,height:(x=S.measured)==null?void 0:x.height},internals:{positionAbsolute:I,handleBounds:U1(S,C),z:vg(S,m,u.zIndexMode),userNode:S}},r.set(S.id,C)}(C.measured===void 0||C.measured.width===void 0||C.measured.height===void 0)&&!C.hidden&&(v=!1),S.parentId&&Qf(C,r,i,s,f),w||(w=S.selected??!1)}return{nodesInitialized:v,hasSelectedNodes:w}}function K1(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 Qf(t,r,i,s,u){const{elevateNodesOnSelect:f,nodeOrigin:d,nodeExtent:m,zIndexMode:v}=Yf(Wf,s),w=t.parentId,k=r.get(w);if(!k){console.warn(`Parent node ${w} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}K1(t,i),u&&!k.parentId&&k.internals.rootParentIndex===void 0&&v==="auto"&&(k.internals.rootParentIndex=++u.i,k.internals.z=k.internals.z+u.i*B1),u&&k.internals.rootParentIndex!==void 0&&(u.i=k.internals.rootParentIndex);const x=f&&!Xf(v)?yg:0,{x:S,y:C,z:j}=q1(t,k,d,m,x,v),{positionAbsolute:T}=t.internals,I=S!==T.x||C!==T.y;(I||j!==t.internals.z)&&r.set(t.id,{...t,internals:{...t.internals,positionAbsolute:I?{x:S,y:C}:T,z:j}})}function vg(t,r,i){const s=Ar(t.zIndex)?t.zIndex:0;return Xf(i)?s:s+(t.selected?r:0)}function q1(t,r,i,s,u,f){const{x:d,y:m}=r.internals.positionAbsolute,v=To(t),w=Ra(t,i),k=As(t.extent)?zi(w,t.extent,v):w;let x=zi({x:d+k.x,y:m+k.y},s,v);t.extent==="parent"&&(x=og(x,v,r));const S=vg(t,u,f),C=r.internals.z??0;return{x:x.x,y:x.y,z:C>=S?C+1:S}}function Gf(t,r,i,s=[0,0]){var d;const u=[],f=new Map;for(const m of t){const v=r.get(m.parentId);if(!v)continue;const w=((d=f.get(m.parentId))==null?void 0:d.expandedRect)??$s(v),k=sg(w,m.rect);f.set(m.parentId,{expandedRect:k,parent:v})}return f.size>0&&f.forEach(({expandedRect:m,parent:v},w)=>{var P;const k=v.internals.positionAbsolute,x=To(v),S=v.origin??s,C=m.x<k.x?Math.round(Math.abs(k.x-m.x)):0,j=m.y<k.y?Math.round(Math.abs(k.y-m.y)):0,T=Math.max(x.width,Math.round(m.width)),I=Math.max(x.height,Math.round(m.height)),A=(T-x.width)*S[0],V=(I-x.height)*S[1];(C>0||j>0||A||V)&&(u.push({id:w,type:"position",position:{x:v.position.x-C+A,y:v.position.y-j+V}}),(P=i.get(w))==null||P.forEach(R=>{t.some(W=>W.id===R.id)||u.push({id:R.id,type:"position",position:{x:R.position.x+C,y:R.position.y+j}})})),(x.width<m.width||x.height<m.height||C||j)&&u.push({id:w,type:"dimensions",setAttributes:!0,dimensions:{width:T+(C?S[0]*C-A:0),height:I+(j?S[1]*j-V:0)}})}),u}function W1(t,r,i,s,u,f,d){const m=s==null?void 0:s.querySelector(".xyflow__viewport");let v=!1;if(!m)return{changes:[],updatedInternals:v};const w=[],k=window.getComputedStyle(m),{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}}),v=!0;continue}const T=qf(C.nodeElement),I=j.measured.width!==T.width||j.measured.height!==T.height;if(!!(T.width&&T.height&&(I||!j.internals.handleBounds||C.force))){const V=C.nodeElement.getBoundingClientRect(),P=As(j.extent)?j.extent:f;let{positionAbsolute:R}=j.internals;j.parentId&&j.extent==="parent"?R=og(R,T,r.get(j.parentId)):P&&(R=zi(R,P,T));const W={...j,measured:T,internals:{...j.internals,positionAbsolute:R,handleBounds:{source:Sp("source",C.nodeElement,V,x,j.id),target:Sp("target",C.nodeElement,V,x,j.id)}}};r.set(j.id,W),j.parentId&&Qf(W,r,i,{nodeOrigin:u,zIndexMode:d}),v=!0,I&&(w.push({id:j.id,type:"dimensions",dimensions:T}),j.expandParent&&j.parentId&&S.push({id:j.id,parentId:j.parentId,rect:$s(W,u)}))}}if(S.length>0){const C=Gf(S,r,i,u);w.push(...C)}return{changes:w,updatedInternals:v}}async function Y1({delta:t,panZoom:r,transform:i,translateExtent:s,width:u,height:f}){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],[u,f]],s),m=!!d&&(d.x!==i[0]||d.y!==i[1]||d.k!==i[2]);return Promise.resolve(m)}function Mp(t,r,i,s,u,f){let d=u;const m=s.get(d)||new Map;s.set(d,m.set(i,r)),d=`${u}-${t}`;const v=s.get(d)||new Map;if(s.set(d,v.set(i,r)),f){d=`${u}-${t}-${f}`;const w=s.get(d)||new Map;s.set(d,w.set(i,r))}}function xg(t,r,i){t.clear(),r.clear();for(const s of i){const{source:u,target:f,sourceHandle:d=null,targetHandle:m=null}=s,v={edgeId:s.id,source:u,target:f,sourceHandle:d,targetHandle:m},w=`${u}-${d}--${f}-${m}`,k=`${f}-${m}--${u}-${d}`;Mp("source",v,k,t,u,d),Mp("target",v,w,t,f,m),r.set(s.id,s)}}function wg(t,r){if(!t.parentId)return!1;const i=r.get(t.parentId);return i?i.selected?!0:wg(i,r):!1}function Tp(t,r,i){var u;let s=t;do{if((u=s==null?void 0:s.matches)!=null&&u.call(s,r))return!0;if(s===i)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function X1(t,r,i,s){const u=new Map;for(const[f,d]of t)if((d.selected||d.id===s)&&(!d.parentId||!wg(d,t))&&(d.draggable||r&&typeof d.draggable>"u")){const m=t.get(f);m&&u.set(f,{id:f,position:m.position||{x:0,y:0},distance:{x:i.x-m.internals.positionAbsolute.x,y:i.y-m.internals.positionAbsolute.y},extent:m.extent,parentId:m.parentId,origin:m.origin,expandParent:m.expandParent,internals:{positionAbsolute:m.internals.positionAbsolute||{x:0,y:0}},measured:{width:m.measured.width??0,height:m.measured.height??0}})}return u}function sf({nodeId:t,dragItems:r,nodeLookup:i,dragging:s=!0}){var d,m,v;const u=[];for(const[w,k]of r){const x=(d=i.get(w))==null?void 0:d.internals.userNode;x&&u.push({...x,position:k.position,dragging:s})}if(!t)return[u[0],u];const f=(m=i.get(t))==null?void 0:m.internals.userNode;return[f?{...f,position:((v=r.get(t))==null?void 0:v.position)||f.position,dragging:s}:u[0],u]}function Q1({dragItems:t,snapGrid:r,x:i,y:s}){const u=t.values().next().value;if(!u)return null;const f={x:i-u.distance.x,y:s-u.distance.y},d=La(f,r);return{x:d.x-f.x,y:d.y-f.y}}function G1({onNodeMouseDown:t,getStoreItems:r,onDragStart:i,onDrag:s,onDragStop:u}){let f={x:null,y:null},d=0,m=new Map,v=!1,w={x:0,y:0},k=null,x=!1,S=null,C=!1,j=!1,T=null;function I({noDragClassName:V,handleSelector:P,domNode:R,isSelectable:W,nodeId:B,nodeClickDistance:X=0}){S=Zn(R);function fe({x:ce,y:xe}){const{nodeLookup:D,nodeExtent:le,snapGrid:Q,snapToGrid:ie,nodeOrigin:z,onNodeDrag:K,onSelectionDrag:F,onError:$,updateNodePositions:H}=r();f={x:ce,y:xe};let we=!1;const Se=m.size>1,Me=Se&&le?jf(Da(m)):null,$e=Se&&ie?Q1({dragItems:m,snapGrid:Q,x:ce,y:xe}):null;for(const[Ae,be]of m){if(!D.has(Ae))continue;let Be={x:ce-be.distance.x,y:xe-be.distance.y};ie&&(Be=$e?{x:Math.round(Be.x+$e.x),y:Math.round(Be.y+$e.y)}:La(Be,Q));let ke=null;if(Se&&le&&!be.extent&&Me){const{positionAbsolute:qe}=be.internals,ut=qe.x-Me.x+le[0][0],ct=qe.x+be.measured.width-Me.x2+le[1][0],it=qe.y-Me.y+le[0][1],Tt=qe.y+be.measured.height-Me.y2+le[1][1];ke=[[ut,it],[ct,Tt]]}const{position:He,positionAbsolute:Oe}=rg({nodeId:Ae,nextPosition:Be,nodeLookup:D,nodeExtent:ke||le,nodeOrigin:z,onError:$});we=we||be.position.x!==He.x||be.position.y!==He.y,be.position=He,be.internals.positionAbsolute=Oe}if(j=j||we,!!we&&(H(m,!0),T&&(s||K||!B&&F))){const[Ae,be]=sf({nodeId:B,dragItems:m,nodeLookup:D});s==null||s(T,m,Ae,be),K==null||K(T,Ae,be),B||F==null||F(T,be)}}async function pe(){if(!k)return;const{transform:ce,panBy:xe,autoPanSpeed:D,autoPanOnNodeDrag:le}=r();if(!le){v=!1,cancelAnimationFrame(d);return}const[Q,ie]=ig(w,k,D);(Q!==0||ie!==0)&&(f.x=(f.x??0)-Q/ce[2],f.y=(f.y??0)-ie/ce[2],await xe({x:Q,y:ie})&&fe(f)),d=requestAnimationFrame(pe)}function _e(ce){var Se;const{nodeLookup:xe,multiSelectionActive:D,nodesDraggable:le,transform:Q,snapGrid:ie,snapToGrid:z,selectNodesOnDrag:K,onNodeDragStart:F,onSelectionDragStart:$,unselectNodesAndEdges:H}=r();x=!0,(!K||!W)&&!D&&B&&((Se=xe.get(B))!=null&&Se.selected||H()),W&&K&&B&&(t==null||t(B));const we=Sa(ce.sourceEvent,{transform:Q,snapGrid:ie,snapToGrid:z,containerBounds:k});if(f=we,m=X1(xe,le,we,B),m.size>0&&(i||F||!B&&$)){const[Me,$e]=sf({nodeId:B,dragItems:m,nodeLookup:xe});i==null||i(ce.sourceEvent,m,Me,$e),F==null||F(ce.sourceEvent,Me,$e),B||$==null||$(ce.sourceEvent,$e)}}const U=Rm().clickDistance(X).on("start",ce=>{const{domNode:xe,nodeDragThreshold:D,transform:le,snapGrid:Q,snapToGrid:ie}=r();k=(xe==null?void 0:xe.getBoundingClientRect())||null,C=!1,j=!1,T=ce.sourceEvent,D===0&&_e(ce),f=Sa(ce.sourceEvent,{transform:le,snapGrid:Q,snapToGrid:ie,containerBounds:k}),w=Or(ce.sourceEvent,k)}).on("drag",ce=>{const{autoPanOnNodeDrag:xe,transform:D,snapGrid:le,snapToGrid:Q,nodeDragThreshold:ie,nodeLookup:z}=r(),K=Sa(ce.sourceEvent,{transform:D,snapGrid:le,snapToGrid:Q,containerBounds:k});if(T=ce.sourceEvent,(ce.sourceEvent.type==="touchmove"&&ce.sourceEvent.touches.length>1||B&&!z.has(B))&&(C=!0),!C){if(!v&&xe&&x&&(v=!0,pe()),!x){const F=Or(ce.sourceEvent,k),$=F.x-w.x,H=F.y-w.y;Math.sqrt($*$+H*H)>ie&&_e(ce)}(f.x!==K.xSnapped||f.y!==K.ySnapped)&&m&&x&&(w=Or(ce.sourceEvent,k),fe(K))}}).on("end",ce=>{if(!(!x||C)&&(v=!1,x=!1,cancelAnimationFrame(d),m.size>0)){const{nodeLookup:xe,updateNodePositions:D,onNodeDragStop:le,onSelectionDragStop:Q}=r();if(j&&(D(m,!1),j=!1),u||le||!B&&Q){const[ie,z]=sf({nodeId:B,dragItems:m,nodeLookup:xe,dragging:!1});u==null||u(ce.sourceEvent,m,ie,z),le==null||le(ce.sourceEvent,ie,z),B||Q==null||Q(ce.sourceEvent,z)}}}).filter(ce=>{const xe=ce.target;return!ce.button&&(!V||!Tp(xe,`.${V}`,R))&&(!P||Tp(xe,P,R))});S.call(U)}function A(){S==null||S.on(".drag",null)}return{update:I,destroy:A}}function J1(t,r,i){const s=[],u={x:t.x-i,y:t.y-i,width:i*2,height:i*2};for(const f of r.values())Ma(u,$s(f))>0&&s.push(f);return s}const Z1=250;function eb(t,r,i,s){var m,v;let u=[],f=1/0;const d=J1(t,i,r+Z1);for(const w of d){const k=[...((m=w.internals.handleBounds)==null?void 0:m.source)??[],...((v=w.internals.handleBounds)==null?void 0:v.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}=Fi(w,x,x.position,!0),j=Math.sqrt(Math.pow(S-t.x,2)+Math.pow(C-t.y,2));j>r||(j<f?(u=[{...x,x:S,y:C}],f=j):j===f&&u.push({...x,x:S,y:C}))}}if(!u.length)return null;if(u.length>1){const w=s.type==="source"?"target":"source";return u.find(k=>k.type===w)??u[0]}return u[0]}function bg(t,r,i,s,u,f=!1){var w,k,x;const d=s.get(t);if(!d)return null;const m=u==="strict"?(w=d.internals.handleBounds)==null?void 0:w[r]:[...((k=d.internals.handleBounds)==null?void 0:k.source)??[],...((x=d.internals.handleBounds)==null?void 0:x.target)??[]],v=(i?m==null?void 0:m.find(S=>S.id===i):m==null?void 0:m[0])??null;return v&&f?{...v,...Fi(d,v,v.position,!0)}:v}function _g(t,r){return t||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function tb(t,r){let i=null;return r?i=!0:t&&!r&&(i=!1),i}const Sg=()=>!0;function nb(t,{connectionMode:r,connectionRadius:i,handleId:s,nodeId:u,edgeUpdaterType:f,isTarget:d,domNode:m,nodeLookup:v,lib:w,autoPanOnConnect:k,flowId:x,panBy:S,cancelConnection:C,onConnectStart:j,onConnect:T,onConnectEnd:I,isValidConnection:A=Sg,onReconnectEnd:V,updateConnection:P,getTransform:R,getFromHandle:W,autoPanSpeed:B,dragThreshold:X=1,handleDomNode:fe}){const pe=ug(t.target);let _e=0,U;const{x:ce,y:xe}=Or(t),D=_g(f,fe),le=m==null?void 0:m.getBoundingClientRect();let Q=!1;if(!le||!D)return;const ie=bg(u,D,s,v,r);if(!ie)return;let z=Or(t,le),K=!1,F=null,$=!1,H=null;function we(){if(!k||!le)return;const[He,Oe]=ig(z,le,B);S({x:He,y:Oe}),_e=requestAnimationFrame(we)}const Se={...ie,nodeId:u,type:D,position:ie.position},Me=v.get(u);let Ae={inProgress:!0,isValid:null,from:Fi(Me,Se,Ze.Left,!0),fromHandle:Se,fromPosition:Se.position,fromNode:Me,to:z,toHandle:null,toPosition:xp[Se.position],toNode:null,pointer:z};function be(){Q=!0,P(Ae),j==null||j(t,{nodeId:u,handleId:s,handleType:D})}X===0&&be();function Be(He){if(!Q){const{x:Tt,y:_t}=Or(He),Ht=Tt-ce,Ot=_t-xe;if(!(Ht*Ht+Ot*Ot>X*X))return;be()}if(!W()||!Se){ke(He);return}const Oe=R();z=Or(He,le),U=eb(za(z,Oe,!1,[1,1]),i,v,Se),K||(we(),K=!0);const qe=kg(He,{handle:U,connectionMode:r,fromNodeId:u,fromHandleId:s,fromType:d?"target":"source",isValidConnection:A,doc:pe,lib:w,flowId:x,nodeLookup:v});H=qe.handleDomNode,F=qe.connection,$=tb(!!U,qe.isValid);const ut=v.get(u),ct=ut?Fi(ut,Se,Ze.Left,!0):Ae.from,it={...Ae,from:ct,isValid:$,to:qe.toHandle&&$?yu({x:qe.toHandle.x,y:qe.toHandle.y},Oe):z,toHandle:qe.toHandle,toPosition:$&&qe.toHandle?qe.toHandle.position:xp[Se.position],toNode:qe.toHandle?v.get(qe.toHandle.nodeId):null,pointer:z};P(it),Ae=it}function ke(He){if(!("touches"in He&&He.touches.length>0)){if(Q){(U||H)&&F&&$&&(T==null||T(F));const{inProgress:Oe,...qe}=Ae,ut={...qe,toPosition:Ae.toHandle?Ae.toPosition:null};I==null||I(He,ut),f&&(V==null||V(He,ut))}C(),cancelAnimationFrame(_e),K=!1,$=!1,F=null,H=null,pe.removeEventListener("mousemove",Be),pe.removeEventListener("mouseup",ke),pe.removeEventListener("touchmove",Be),pe.removeEventListener("touchend",ke)}}pe.addEventListener("mousemove",Be),pe.addEventListener("mouseup",ke),pe.addEventListener("touchmove",Be),pe.addEventListener("touchend",ke)}function kg(t,{handle:r,connectionMode:i,fromNodeId:s,fromHandleId:u,fromType:f,doc:d,lib:m,flowId:v,isValidConnection:w=Sg,nodeLookup:k}){const x=f==="target",S=r?d.querySelector(`.${m}-flow__handle[data-id="${v}-${r==null?void 0:r.nodeId}-${r==null?void 0:r.id}-${r==null?void 0:r.type}"]`):null,{x:C,y:j}=Or(t),T=d.elementFromPoint(C,j),I=T!=null&&T.classList.contains(`${m}-flow__handle`)?T:S,A={handleDomNode:I,isValid:!1,connection:null,toHandle:null};if(I){const V=_g(void 0,I),P=I.getAttribute("data-nodeid"),R=I.getAttribute("data-handleid"),W=I.classList.contains("connectable"),B=I.classList.contains("connectableend");if(!P||!V)return A;const X={source:x?P:s,sourceHandle:x?R:u,target:x?s:P,targetHandle:x?u:R};A.connection=X;const pe=W&&B&&(i===Ts.Strict?x&&V==="source"||!x&&V==="target":P!==s||R!==u);A.isValid=pe&&w(X),A.toHandle=bg(P,V,R,k,i,!0)}return A}const If={onPointerDown:nb,isValid:kg};function rb({domNode:t,panZoom:r,getTransform:i,getViewScale:s}){const u=Zn(t);function f({translateExtent:m,width:v,height:w,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(),W=P.sourceEvent.ctrlKey&&Ta()?10:1,B=-P.sourceEvent.deltaY*(P.sourceEvent.deltaMode===1?.05:P.sourceEvent.deltaMode?1:.002)*k,X=R[2]*Math.pow(2,B*W);r.scaleTo(X)};let T=[0,0];const I=P=>{(P.sourceEvent.type==="mousedown"||P.sourceEvent.type==="touchstart")&&(T=[P.sourceEvent.clientX??P.sourceEvent.touches[0].clientX,P.sourceEvent.clientY??P.sourceEvent.touches[0].clientY])},A=P=>{const R=i();if(P.sourceEvent.type!=="mousemove"&&P.sourceEvent.type!=="touchmove"||!r)return;const W=[P.sourceEvent.clientX??P.sourceEvent.touches[0].clientX,P.sourceEvent.clientY??P.sourceEvent.touches[0].clientY],B=[W[0]-T[0],W[1]-T[1]];T=W;const X=s()*Math.max(R[2],Math.log(R[2]))*(C?-1:1),fe={x:R[0]-B[0]*X,y:R[1]-B[1]*X},pe=[[0,0],[v,w]];r.setViewportConstrained({x:fe.x,y:fe.y,zoom:R[2]},pe,m)},V=Gm().on("start",I).on("zoom",x?A:null).on("zoom.wheel",S?j:null);u.call(V,{})}function d(){u.on("zoom",null)}return{update:f,destroy:d,pointer:Ir}}const Mu=t=>({x:t.x,y:t.y,zoom:t.k}),af=({x:t,y:r,zoom:i})=>Cu.translate(t,r).scale(i),Ns=(t,r)=>t.target.closest(`.${r}`),Ng=(t,r)=>r===2&&Array.isArray(t)&&t.includes(2),ob=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,lf=(t,r=0,i=ob,s=()=>{})=>{const u=typeof r=="number"&&r>0;return u||s(),u?t.transition().duration(r).ease(i).on("end",s):t},Eg=t=>{const r=t.ctrlKey&&Ta()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*r};function ib({zoomPanValues:t,noWheelClassName:r,d3Selection:i,d3Zoom:s,panOnScrollMode:u,panOnScrollSpeed:f,zoomOnPinch:d,onPanZoomStart:m,onPanZoom:v,onPanZoomEnd:w}){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 I=Ir(k),A=Eg(k),V=x*Math.pow(2,A);s.scaleTo(i,V,I,k);return}const S=k.deltaMode===1?20:1;let C=u===Ri.Vertical?0:k.deltaX*S,j=u===Ri.Horizontal?0:k.deltaY*S;!Ta()&&k.shiftKey&&u!==Ri.Vertical&&(C=k.deltaY*S,j=0),s.translateBy(i,-(C/x)*f,-(j/x)*f,{internal:!0});const T=Mu(i.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(v==null||v(k,T),t.panScrollTimeout=setTimeout(()=>{w==null||w(k,T),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,m==null||m(k,T))}}function sb({noWheelClassName:t,preventScrolling:r,d3ZoomHandler:i}){return function(s,u){const f=s.type==="wheel",d=!r&&f&&!s.ctrlKey,m=Ns(s,t);if(s.ctrlKey&&f&&m&&s.preventDefault(),d||m)return null;s.preventDefault(),i.call(this,s,u)}}function ab({zoomPanValues:t,onDraggingChange:r,onPanZoomStart:i}){return s=>{var f,d,m;if((f=s.sourceEvent)!=null&&f.internal)return;const u=Mu(s.transform);t.mouseButton=((d=s.sourceEvent)==null?void 0:d.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=u,((m=s.sourceEvent)==null?void 0:m.type)==="mousedown"&&r(!0),i&&(i==null||i(s.sourceEvent,u))}}function lb({zoomPanValues:t,panOnDrag:r,onPaneContextMenu:i,onTransformChange:s,onPanZoom:u}){return f=>{var d,m;t.usedRightMouseButton=!!(i&&Ng(r,t.mouseButton??0)),(d=f.sourceEvent)!=null&&d.sync||s([f.transform.x,f.transform.y,f.transform.k]),u&&!((m=f.sourceEvent)!=null&&m.internal)&&(u==null||u(f.sourceEvent,Mu(f.transform)))}}function ub({zoomPanValues:t,panOnDrag:r,panOnScroll:i,onDraggingChange:s,onPanZoomEnd:u,onPaneContextMenu:f}){return d=>{var m;if(!((m=d.sourceEvent)!=null&&m.internal)&&(t.isZoomingOrPanning=!1,f&&Ng(r,t.mouseButton??0)&&!t.usedRightMouseButton&&d.sourceEvent&&f(d.sourceEvent),t.usedRightMouseButton=!1,s(!1),u)){const v=Mu(d.transform);t.prevViewport=v,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{u==null||u(d.sourceEvent,v)},i?150:0)}}}function cb({zoomActivationKeyPressed:t,zoomOnScroll:r,zoomOnPinch:i,panOnDrag:s,panOnScroll:u,zoomOnDoubleClick:f,userSelectionActive:d,noWheelClassName:m,noPanClassName:v,lib:w,connectionInProgress:k}){return x=>{var I;const S=t||r,C=i&&x.ctrlKey,j=x.type==="wheel";if(x.button===1&&x.type==="mousedown"&&(Ns(x,`${w}-flow__node`)||Ns(x,`${w}-flow__edge`)))return!0;if(!s&&!S&&!u&&!f&&!i||d||k&&!j||Ns(x,m)&&j||Ns(x,v)&&(!j||u&&j&&!t)||!i&&x.ctrlKey&&j)return!1;if(!i&&x.type==="touchstart"&&((I=x.touches)==null?void 0:I.length)>1)return x.preventDefault(),!1;if(!S&&!u&&!C&&j||!s&&(x.type==="mousedown"||x.type==="touchstart")||Array.isArray(s)&&!s.includes(x.button)&&x.type==="mousedown")return!1;const T=Array.isArray(s)&&s.includes(x.button)||!x.button||x.button<=1;return(!x.ctrlKey||j)&&T}}function fb({domNode:t,minZoom:r,maxZoom:i,translateExtent:s,viewport:u,onPanZoom:f,onPanZoomStart:d,onPanZoomEnd:m,onDraggingChange:v}){const w={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},k=t.getBoundingClientRect(),x=Gm().scaleExtent([r,i]).translateExtent(s),S=Zn(t).call(x);V({x:u.x,y:u.y,zoom:Is(u.zoom,r,i)},[[0,0],[k.width,k.height]],s);const C=S.on("wheel.zoom"),j=S.on("dblclick.zoom");x.wheelDelta(Eg);function T(U,ce){return S?new Promise(xe=>{x==null||x.interpolate((ce==null?void 0:ce.interpolate)==="linear"?_a:tu).transform(lf(S,ce==null?void 0:ce.duration,ce==null?void 0:ce.ease,()=>xe(!0)),U)}):Promise.resolve(!1)}function I({noWheelClassName:U,noPanClassName:ce,onPaneContextMenu:xe,userSelectionActive:D,panOnScroll:le,panOnDrag:Q,panOnScrollMode:ie,panOnScrollSpeed:z,preventScrolling:K,zoomOnPinch:F,zoomOnScroll:$,zoomOnDoubleClick:H,zoomActivationKeyPressed:we,lib:Se,onTransformChange:Me,connectionInProgress:$e,paneClickDistance:Ae,selectionOnDrag:be}){D&&!w.isZoomingOrPanning&&A();const Be=le&&!we&&!D;x.clickDistance(be?1/0:!Ar(Ae)||Ae<0?0:Ae);const ke=Be?ib({zoomPanValues:w,noWheelClassName:U,d3Selection:S,d3Zoom:x,panOnScrollMode:ie,panOnScrollSpeed:z,zoomOnPinch:F,onPanZoomStart:d,onPanZoom:f,onPanZoomEnd:m}):sb({noWheelClassName:U,preventScrolling:K,d3ZoomHandler:C});if(S.on("wheel.zoom",ke,{passive:!1}),!D){const Oe=ab({zoomPanValues:w,onDraggingChange:v,onPanZoomStart:d});x.on("start",Oe);const qe=lb({zoomPanValues:w,panOnDrag:Q,onPaneContextMenu:!!xe,onPanZoom:f,onTransformChange:Me});x.on("zoom",qe);const ut=ub({zoomPanValues:w,panOnDrag:Q,panOnScroll:le,onPaneContextMenu:xe,onPanZoomEnd:m,onDraggingChange:v});x.on("end",ut)}const He=cb({zoomActivationKeyPressed:we,panOnDrag:Q,zoomOnScroll:$,panOnScroll:le,zoomOnDoubleClick:H,zoomOnPinch:F,userSelectionActive:D,noPanClassName:ce,noWheelClassName:U,lib:Se,connectionInProgress:$e});x.filter(He),H?S.on("dblclick.zoom",j):S.on("dblclick.zoom",null)}function A(){x.on("zoom",null)}async function V(U,ce,xe){const D=af(U),le=x==null?void 0:x.constrain()(D,ce,xe);return le&&await T(le),new Promise(Q=>Q(le))}async function P(U,ce){const xe=af(U);return await T(xe,ce),new Promise(D=>D(xe))}function R(U){if(S){const ce=af(U),xe=S.property("__zoom");(xe.k!==U.zoom||xe.x!==U.x||xe.y!==U.y)&&(x==null||x.transform(S,ce,null,{sync:!0}))}}function W(){const U=S?Qm(S.node()):{x:0,y:0,k:1};return{x:U.x,y:U.y,zoom:U.k}}function B(U,ce){return S?new Promise(xe=>{x==null||x.interpolate((ce==null?void 0:ce.interpolate)==="linear"?_a:tu).scaleTo(lf(S,ce==null?void 0:ce.duration,ce==null?void 0:ce.ease,()=>xe(!0)),U)}):Promise.resolve(!1)}function X(U,ce){return S?new Promise(xe=>{x==null||x.interpolate((ce==null?void 0:ce.interpolate)==="linear"?_a:tu).scaleBy(lf(S,ce==null?void 0:ce.duration,ce==null?void 0:ce.ease,()=>xe(!0)),U)}):Promise.resolve(!1)}function fe(U){x==null||x.scaleExtent(U)}function pe(U){x==null||x.translateExtent(U)}function _e(U){const ce=!Ar(U)||U<0?0:U;x==null||x.clickDistance(ce)}return{update:I,destroy:A,setViewport:P,setViewportConstrained:V,getViewport:W,scaleTo:B,scaleBy:X,setScaleExtent:fe,setTranslateExtent:pe,syncViewport:R,setClickDistance:_e}}var Os;(function(t){t.Line="line",t.Handle="handle"})(Os||(Os={}));function db({width:t,prevWidth:r,height:i,prevHeight:s,affectsX:u,affectsY:f}){const d=t-r,m=i-s,v=[d>0?1:d<0?-1:0,m>0?1:m<0?-1:0];return d&&u&&(v[0]=v[0]*-1),m&&f&&(v[1]=v[1]*-1),v}function Ip(t){const r=t.includes("right")||t.includes("left"),i=t.includes("bottom")||t.includes("top"),s=t.includes("left"),u=t.includes("top");return{isHorizontal:r,isVertical:i,affectsX:s,affectsY:u}}function si(t,r){return Math.max(0,r-t)}function ai(t,r){return Math.max(0,t-r)}function Ql(t,r,i){return Math.max(0,r-t,t-i)}function $p(t,r){return t?!r:r}function hb(t,r,i,s,u,f,d,m){let{affectsX:v,affectsY:w}=r;const{isHorizontal:k,isVertical:x}=r,S=k&&x,{xSnapped:C,ySnapped:j}=i,{minWidth:T,maxWidth:I,minHeight:A,maxHeight:V}=s,{x:P,y:R,width:W,height:B,aspectRatio:X}=t;let fe=Math.floor(k?C-t.pointerX:0),pe=Math.floor(x?j-t.pointerY:0);const _e=W+(v?-fe:fe),U=B+(w?-pe:pe),ce=-f[0]*W,xe=-f[1]*B;let D=Ql(_e,T,I),le=Ql(U,A,V);if(d){let z=0,K=0;v&&fe<0?z=si(P+fe+ce,d[0][0]):!v&&fe>0&&(z=ai(P+_e+ce,d[1][0])),w&&pe<0?K=si(R+pe+xe,d[0][1]):!w&&pe>0&&(K=ai(R+U+xe,d[1][1])),D=Math.max(D,z),le=Math.max(le,K)}if(m){let z=0,K=0;v&&fe>0?z=ai(P+fe,m[0][0]):!v&&fe<0&&(z=si(P+_e,m[1][0])),w&&pe>0?K=ai(R+pe,m[0][1]):!w&&pe<0&&(K=si(R+U,m[1][1])),D=Math.max(D,z),le=Math.max(le,K)}if(u){if(k){const z=Ql(_e/X,A,V)*X;if(D=Math.max(D,z),d){let K=0;!v&&!w||v&&!w&&S?K=ai(R+xe+_e/X,d[1][1])*X:K=si(R+xe+(v?fe:-fe)/X,d[0][1])*X,D=Math.max(D,K)}if(m){let K=0;!v&&!w||v&&!w&&S?K=si(R+_e/X,m[1][1])*X:K=ai(R+(v?fe:-fe)/X,m[0][1])*X,D=Math.max(D,K)}}if(x){const z=Ql(U*X,T,I)/X;if(le=Math.max(le,z),d){let K=0;!v&&!w||w&&!v&&S?K=ai(P+U*X+ce,d[1][0])/X:K=si(P+(w?pe:-pe)*X+ce,d[0][0])/X,le=Math.max(le,K)}if(m){let K=0;!v&&!w||w&&!v&&S?K=si(P+U*X,m[1][0])/X:K=ai(P+(w?pe:-pe)*X,m[0][0])/X,le=Math.max(le,K)}}}pe=pe+(pe<0?le:-le),fe=fe+(fe<0?D:-D),u&&(S?_e>U*X?pe=($p(v,w)?-fe:fe)/X:fe=($p(v,w)?-pe:pe)*X:k?(pe=fe/X,w=v):(fe=pe*X,v=w));const Q=v?P+fe:P,ie=w?R+pe:R;return{width:W+(v?-fe:fe),height:B+(w?-pe:pe),x:f[0]*fe*(v?-1:1)+Q,y:f[1]*pe*(w?-1:1)+ie}}const Cg={width:0,height:0,x:0,y:0},pb={...Cg,pointerX:0,pointerY:0,aspectRatio:1};function mb(t){return[[0,0],[t.measured.width,t.measured.height]]}function gb(t,r,i){const s=r.position.x+t.position.x,u=r.position.y+t.position.y,f=t.measured.width??0,d=t.measured.height??0,m=i[0]*f,v=i[1]*d;return[[s-m,u-v],[s+f-m,u+d-v]]}function yb({domNode:t,nodeId:r,getStoreItems:i,onChange:s,onEnd:u}){const f=Zn(t);let d={controlDirection:Ip("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function m({controlPosition:w,boundaries:k,keepAspectRatio:x,resizeDirection:S,onResizeStart:C,onResize:j,onResizeEnd:T,shouldResize:I}){let A={...Cg},V={...pb};d={boundaries:k,resizeDirection:S,keepAspectRatio:x,controlDirection:Ip(w)};let P,R=null,W=[],B,X,fe,pe=!1;const _e=Rm().on("start",U=>{const{nodeLookup:ce,transform:xe,snapGrid:D,snapToGrid:le,nodeOrigin:Q,paneDomNode:ie}=i();if(P=ce.get(r),!P)return;R=(ie==null?void 0:ie.getBoundingClientRect())??null;const{xSnapped:z,ySnapped:K}=Sa(U.sourceEvent,{transform:xe,snapGrid:D,snapToGrid:le,containerBounds:R});A={width:P.measured.width??0,height:P.measured.height??0,x:P.position.x??0,y:P.position.y??0},V={...A,pointerX:z,pointerY:K,aspectRatio:A.width/A.height},B=void 0,P.parentId&&(P.extent==="parent"||P.expandParent)&&(B=ce.get(P.parentId),X=B&&P.extent==="parent"?mb(B):void 0),W=[],fe=void 0;for(const[F,$]of ce)if($.parentId===r&&(W.push({id:F,position:{...$.position},extent:$.extent}),$.extent==="parent"||$.expandParent)){const H=gb($,P,$.origin??Q);fe?fe=[[Math.min(H[0][0],fe[0][0]),Math.min(H[0][1],fe[0][1])],[Math.max(H[1][0],fe[1][0]),Math.max(H[1][1],fe[1][1])]]:fe=H}C==null||C(U,{...A})}).on("drag",U=>{const{transform:ce,snapGrid:xe,snapToGrid:D,nodeOrigin:le}=i(),Q=Sa(U.sourceEvent,{transform:ce,snapGrid:xe,snapToGrid:D,containerBounds:R}),ie=[];if(!P)return;const{x:z,y:K,width:F,height:$}=A,H={},we=P.origin??le,{width:Se,height:Me,x:$e,y:Ae}=hb(V,d.controlDirection,Q,d.boundaries,d.keepAspectRatio,we,X,fe),be=Se!==F,Be=Me!==$,ke=$e!==z&&be,He=Ae!==K&&Be;if(!ke&&!He&&!be&&!Be)return;if((ke||He||we[0]===1||we[1]===1)&&(H.x=ke?$e:A.x,H.y=He?Ae:A.y,A.x=H.x,A.y=H.y,W.length>0)){const ct=$e-z,it=Ae-K;for(const Tt of W)Tt.position={x:Tt.position.x-ct+we[0]*(Se-F),y:Tt.position.y-it+we[1]*(Me-$)},ie.push(Tt)}if((be||Be)&&(H.width=be&&(!d.resizeDirection||d.resizeDirection==="horizontal")?Se:A.width,H.height=Be&&(!d.resizeDirection||d.resizeDirection==="vertical")?Me:A.height,A.width=H.width,A.height=H.height),B&&P.expandParent){const ct=we[0]*(H.width??0);H.x&&H.x<ct&&(A.x=ct,V.x=V.x-(H.x-ct));const it=we[1]*(H.height??0);H.y&&H.y<it&&(A.y=it,V.y=V.y-(H.y-it))}const Oe=db({width:A.width,prevWidth:F,height:A.height,prevHeight:$,affectsX:d.controlDirection.affectsX,affectsY:d.controlDirection.affectsY}),qe={...A,direction:Oe};(I==null?void 0:I(U,qe))!==!1&&(pe=!0,j==null||j(U,qe),s(H,ie))}).on("end",U=>{pe&&(T==null||T(U,{...A}),u==null||u({...A}),pe=!1)});f.call(_e)}function v(){f.on(".drag",null)}return{update:m,destroy:v}}var uf={exports:{}},cf={},ff={exports:{}},df={};/**
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 Ap;function vb(){if(Ap)return df;Ap=1;var t=$a();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,u=t.useEffect,f=t.useLayoutEffect,d=t.useDebugValue;function m(x,S){var C=S(),j=s({inst:{value:C,getSnapshot:S}}),T=j[0].inst,I=j[1];return f(function(){T.value=C,T.getSnapshot=S,v(T)&&I({inst:T})},[x,C,S]),u(function(){return v(T)&&I({inst:T}),x(function(){v(T)&&I({inst:T})})},[x]),d(C),C}function v(x){var S=x.getSnapshot;x=x.value;try{var C=S();return!i(x,C)}catch{return!0}}function w(x,S){return S()}var k=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?w:m;return df.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:k,df}var Op;function xb(){return Op||(Op=1,ff.exports=vb()),ff.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 Rp;function wb(){if(Rp)return cf;Rp=1;var t=$a(),r=xb();function i(w,k){return w===k&&(w!==0||1/w===1/k)||w!==w&&k!==k}var s=typeof Object.is=="function"?Object.is:i,u=r.useSyncExternalStore,f=t.useRef,d=t.useEffect,m=t.useMemo,v=t.useDebugValue;return cf.useSyncExternalStoreWithSelector=function(w,k,x,S,C){var j=f(null);if(j.current===null){var T={hasValue:!1,value:null};j.current=T}else T=j.current;j=m(function(){function A(B){if(!V){if(V=!0,P=B,B=S(B),C!==void 0&&T.hasValue){var X=T.value;if(C(X,B))return R=X}return R=B}if(X=R,s(P,B))return X;var fe=S(B);return C!==void 0&&C(X,fe)?(P=B,X):(P=B,R=fe)}var V=!1,P,R,W=x===void 0?null:x;return[function(){return A(k())},W===null?void 0:function(){return A(W())}]},[k,x,S,C]);var I=u(w,j[0],j[1]);return d(function(){T.hasValue=!0,T.value=I},[I]),v(I),I},cf}var Dp;function bb(){return Dp||(Dp=1,uf.exports=wb()),uf.exports}var _b=bb();const Sb=xu(_b),kb={},Lp=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))}},u=()=>r,v={setState:s,getState:u,getInitialState:()=>w,subscribe:k=>(i.add(k),()=>i.delete(k)),destroy:()=>{(kb?"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()}},w=r=t(s,u,v);return v},Nb=t=>t?Lp(t):Lp,{useDebugValue:Eb}=mm,{useSyncExternalStoreWithSelector:Cb}=Sb,jb=t=>t;function jg(t,r=jb,i){const s=Cb(t.subscribe,t.getState,t.getServerState||t.getInitialState,r,i);return Eb(s),s}const zp=(t,r)=>{const i=Nb(t),s=(u,f=r)=>jg(i,u,f);return Object.assign(s,i),s},Pb=(t,r)=>t?zp(t,r):zp;function At(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,u]of t)if(!Object.is(u,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}gm();const Tu=ee.createContext(null),Mb=Tu.Provider,Pg=Qr.error001();function mt(t,r){const i=ee.useContext(Tu);if(i===null)throw new Error(Pg);return jg(i,t,r)}function Mt(){const t=ee.useContext(Tu);if(t===null)throw new Error(Pg);return ee.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const Fp={display:"none"},Tb={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Mg="react-flow__node-desc",Tg="react-flow__edge-desc",Ib="react-flow__aria-live",$b=t=>t.ariaLiveMessage,Ab=t=>t.ariaLabelConfig;function Ob({rfId:t}){const r=mt($b);return b.jsx("div",{id:`${Ib}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:Tb,children:r})}function Rb({rfId:t,disableKeyboardA11y:r}){const i=mt(Ab);return b.jsxs(b.Fragment,{children:[b.jsx("div",{id:`${Mg}-${t}`,style:Fp,children:r?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),b.jsx("div",{id:`${Tg}-${t}`,style:Fp,children:i["edge.a11yDescription.default"]}),!r&&b.jsx(Ob,{rfId:t})]})}const Fa=ee.forwardRef(({position:t="top-left",children:r,className:i,style:s,...u},f)=>{const d=`${t}`.split("-");return b.jsx("div",{className:Wt(["react-flow__panel",i,...d]),style:s,ref:f,...u,children:r})});Fa.displayName="Panel";function Db({proOptions:t,position:r="bottom-right"}){return t!=null&&t.hideAttribution?null:b.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:b.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Lb=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 zb(t,r){return At(t.selectedNodes.map(Gl),r.selectedNodes.map(Gl))&&At(t.selectedEdges.map(Gl),r.selectedEdges.map(Gl))}function Fb({onSelectionChange:t}){const r=Mt(),{selectedNodes:i,selectedEdges:s}=mt(Lb,zb);return ee.useEffect(()=>{const u={nodes:i,edges:s};t==null||t(u),r.getState().onSelectionChangeHandlers.forEach(f=>f(u))},[i,s,t]),null}const Bb=t=>!!t.onSelectionChangeHandlers;function Hb({onSelectionChange:t}){const r=mt(Bb);return t||r?b.jsx(Fb,{onSelectionChange:t}):null}const $f=typeof window<"u"?ee.useLayoutEffect:ee.useEffect,Ig=[0,0],Vb={x:0,y:0,zoom:1},Ub=["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"],Bp=[...Ub,"rfId"],Kb=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}),Hp={translateExtent:ja,nodeOrigin:Ig,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function qb(t){const{setNodes:r,setEdges:i,setMinZoom:s,setMaxZoom:u,setTranslateExtent:f,setNodeExtent:d,reset:m,setDefaultNodesAndEdges:v}=mt(Kb,At),w=Mt();$f(()=>(v(t.defaultNodes,t.defaultEdges),()=>{k.current=Hp,m()}),[]);const k=ee.useRef(Hp);return $f(()=>{for(const x of Bp){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"?u(S):x==="translateExtent"?f(S):x==="nodeExtent"?d(S):x==="ariaLabelConfig"?w.setState({ariaLabelConfig:M1(S)}):x==="fitView"?w.setState({fitViewQueued:S}):x==="fitViewOptions"?w.setState({fitViewOptions:S}):w.setState({[x]:S})))}k.current=t},Bp.map(x=>t[x])),null}function Vp(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Wb(t){var s;const[r,i]=ee.useState(t==="system"?null:t);return ee.useEffect(()=>{if(t!=="system"){i(t);return}const u=Vp(),f=()=>i(u!=null&&u.matches?"dark":"light");return f(),u==null||u.addEventListener("change",f),()=>{u==null||u.removeEventListener("change",f)}},[t]),r!==null?r:(s=Vp())!=null&&s.matches?"dark":"light"}const Up=typeof document<"u"?document:null;function Ia(t=null,r={target:Up,actInsideInputWithModifier:!0}){const[i,s]=ee.useState(!1),u=ee.useRef(!1),f=ee.useRef(new Set([])),[d,m]=ee.useMemo(()=>{if(t!==null){const w=(Array.isArray(t)?t:[t]).filter(x=>typeof x=="string").map(x=>x.replace("+",`
197
+ `).replace(`
198
+
199
+ `,`
200
+ +`).split(`
201
+ `)),k=w.reduce((x,S)=>x.concat(...S),[]);return[w,k]}return[[],[]]},[t]);return ee.useEffect(()=>{const v=(r==null?void 0:r.target)??Up,w=(r==null?void 0:r.actInsideInputWithModifier)??!0;if(t!==null){const k=C=>{var I,A;if(u.current=C.ctrlKey||C.metaKey||C.shiftKey||C.altKey,(!u.current||u.current&&!w)&&cg(C))return!1;const T=qp(C.code,m);if(f.current.add(C[T]),Kp(d,f.current,!1)){const V=((A=(I=C.composedPath)==null?void 0:I.call(C))==null?void 0:A[0])||C.target,P=(V==null?void 0:V.nodeName)==="BUTTON"||(V==null?void 0:V.nodeName)==="A";r.preventDefault!==!1&&(u.current||!P)&&C.preventDefault(),s(!0)}},x=C=>{const j=qp(C.code,m);Kp(d,f.current,!0)?(s(!1),f.current.clear()):f.current.delete(C[j]),C.key==="Meta"&&f.current.clear(),u.current=!1},S=()=>{f.current.clear(),s(!1)};return v==null||v.addEventListener("keydown",k),v==null||v.addEventListener("keyup",x),window.addEventListener("blur",S),window.addEventListener("contextmenu",S),()=>{v==null||v.removeEventListener("keydown",k),v==null||v.removeEventListener("keyup",x),window.removeEventListener("blur",S),window.removeEventListener("contextmenu",S)}}},[t,s]),i}function Kp(t,r,i){return t.filter(s=>i||s.length===r.size).some(s=>s.every(u=>r.has(u)))}function qp(t,r){return r.includes(t)?"code":"key"}const Yb=()=>{const t=Mt();return ee.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,u,f],panZoom:d}=t.getState();return d?(await d.setViewport({x:r.x??s,y:r.y??u,zoom:r.zoom??f},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:u,minZoom:f,maxZoom:d,panZoom:m}=t.getState(),v=Kf(r,s,u,f,d,(i==null?void 0:i.padding)??.1);return m?(await m.setViewport(v,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(r,i={})=>{const{transform:s,snapGrid:u,snapToGrid:f,domNode:d}=t.getState();if(!d)return r;const{x:m,y:v}=d.getBoundingClientRect(),w={x:r.x-m,y:r.y-v},k=i.snapGrid??u,x=i.snapToGrid??f;return za(w,s,x,k)},flowToScreenPosition:r=>{const{transform:i,domNode:s}=t.getState();if(!s)return r;const{x:u,y:f}=s.getBoundingClientRect(),d=yu(r,i);return{x:d.x+u,y:d.y+f}}}),[])};function $g(t,r){const i=[],s=new Map,u=[];for(const f of t)if(f.type==="add"){u.push(f);continue}else if(f.type==="remove"||f.type==="replace")s.set(f.id,[f]);else{const d=s.get(f.id);d?d.push(f):s.set(f.id,[f])}for(const f of r){const d=s.get(f.id);if(!d){i.push(f);continue}if(d[0].type==="remove")continue;if(d[0].type==="replace"){i.push({...d[0].item});continue}const m={...f};for(const v of d)Xb(v,m);i.push(m)}return u.length&&u.forEach(f=>{f.index!==void 0?i.splice(f.index,0,{...f.item}):i.push({...f.item})}),i}function Xb(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 Ag(t,r){return $g(t,r)}function Og(t,r){return $g(t,r)}function $i(t,r){return{id:t,type:"select",selected:r}}function Es(t,r=new Set,i=!1){const s=[];for(const[u,f]of t){const d=r.has(u);!(f.selected===void 0&&!d)&&f.selected!==d&&(i&&(f.selected=d),s.push($i(f.id,d)))}return s}function Wp({items:t=[],lookup:r}){var u;const i=[],s=new Map(t.map(f=>[f.id,f]));for(const[f,d]of t.entries()){const m=r.get(d.id),v=((u=m==null?void 0:m.internals)==null?void 0:u.userNode)??m;v!==void 0&&v!==d&&i.push({id:d.id,item:d,type:"replace"}),v===void 0&&i.push({item:d,type:"add",index:f})}for(const[f]of r)s.get(f)===void 0&&i.push({id:f,type:"remove"});return i}function Yp(t){return{id:t.id,type:"remove"}}const Xp=t=>w1(t),Qb=t=>ng(t);function Rg(t){return ee.forwardRef(t)}function Qp(t){const[r,i]=ee.useState(BigInt(0)),[s]=ee.useState(()=>Gb(()=>i(u=>u+BigInt(1))));return $f(()=>{const u=s.get();u.length&&(t(u),s.reset())},[r]),s}function Gb(t){let r=[];return{get:()=>r,reset:()=>{r=[]},push:i=>{r.push(i),t()}}}const Dg=ee.createContext(null);function Jb({children:t}){const r=Mt(),i=ee.useCallback(m=>{const{nodes:v=[],setNodes:w,hasDefaultNodes:k,onNodesChange:x,nodeLookup:S,fitViewQueued:C,onNodesChangeMiddlewareMap:j}=r.getState();let T=v;for(const A of m)T=typeof A=="function"?A(T):A;let I=Wp({items:T,lookup:S});for(const A of j.values())I=A(I);k&&w(T),I.length>0?x==null||x(I):C&&window.requestAnimationFrame(()=>{const{fitViewQueued:A,nodes:V,setNodes:P}=r.getState();A&&P(V)})},[]),s=Qp(i),u=ee.useCallback(m=>{const{edges:v=[],setEdges:w,hasDefaultEdges:k,onEdgesChange:x,edgeLookup:S}=r.getState();let C=v;for(const j of m)C=typeof j=="function"?j(C):j;k?w(C):x&&x(Wp({items:C,lookup:S}))},[]),f=Qp(u),d=ee.useMemo(()=>({nodeQueue:s,edgeQueue:f}),[]);return b.jsx(Dg.Provider,{value:d,children:t})}function Zb(){const t=ee.useContext(Dg);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const e_=t=>!!t.panZoom;function Jf(){const t=Yb(),r=Mt(),i=Zb(),s=mt(e_),u=ee.useMemo(()=>{const f=x=>r.getState().nodeLookup.get(x),d=x=>{i.nodeQueue.push(x)},m=x=>{i.edgeQueue.push(x)},v=x=>{var A,V;const{nodeLookup:S,nodeOrigin:C}=r.getState(),j=Xp(x)?x:S.get(x.id),T=j.parentId?lg(j.position,j.measured,j.parentId,S,C):j.position,I={...j,position:T,width:((A=j.measured)==null?void 0:A.width)??j.width,height:((V=j.measured)==null?void 0:V.height)??j.height};return $s(I)},w=(x,S,C={replace:!1})=>{d(j=>j.map(T=>{if(T.id===x){const I=typeof S=="function"?S(T):S;return C.replace&&Xp(I)?I:{...T,...I}}return T}))},k=(x,S,C={replace:!1})=>{m(j=>j.map(T=>{if(T.id===x){const I=typeof S=="function"?S(T):S;return C.replace&&Qb(I)?I:{...T,...I}}return T}))};return{getNodes:()=>r.getState().nodes.map(x=>({...x})),getNode:x=>{var S;return(S=f(x))==null?void 0:S.internals.userNode},getInternalNode:f,getEdges:()=>{const{edges:x=[]}=r.getState();return x.map(S=>({...S}))},getEdge:x=>r.getState().edgeLookup.get(x),setNodes:d,setEdges:m,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,I]=C;return{nodes:x.map(A=>({...A})),edges:S.map(A=>({...A})),viewport:{x:j,y:T,zoom:I}}},deleteElements:async({nodes:x=[],edges:S=[]})=>{const{nodes:C,edges:j,onNodesDelete:T,onEdgesDelete:I,triggerNodeChanges:A,triggerEdgeChanges:V,onDelete:P,onBeforeDelete:R}=r.getState(),{nodes:W,edges:B}=await N1({nodesToRemove:x,edgesToRemove:S,nodes:C,edges:j,onBeforeDelete:R}),X=B.length>0,fe=W.length>0;if(X){const pe=B.map(Yp);I==null||I(B),V(pe)}if(fe){const pe=W.map(Yp);T==null||T(W),A(pe)}return(fe||X)&&(P==null||P({nodes:W,edges:B})),{deletedNodes:W,deletedEdges:B}},getIntersectingNodes:(x,S=!0,C)=>{const j=bp(x),T=j?x:v(x),I=C!==void 0;return T?(C||r.getState().nodes).filter(A=>{const V=r.getState().nodeLookup.get(A.id);if(V&&!j&&(A.id===x.id||!V.internals.positionAbsolute))return!1;const P=$s(I?A:V),R=Ma(P,T);return S&&R>0||R>=P.width*P.height||R>=T.width*T.height}):[]},isNodeIntersecting:(x,S,C=!0)=>{const T=bp(x)?x:v(x);if(!T)return!1;const I=Ma(T,S);return C&&I>0||I>=S.width*S.height||I>=T.width*T.height},updateNode:w,updateNodeData:(x,S,C={replace:!1})=>{w(x,j=>{const T=typeof S=="function"?S(j):S;return C.replace?{...j,data:T}:{...j,data:{...j.data,...T}}},C)},updateEdge:k,updateEdgeData:(x,S,C={replace:!1})=>{k(x,j=>{const T=typeof S=="function"?S(j):S;return C.replace?{...j,data:T}:{...j,data:{...j.data,...T}}},C)},getNodesBounds:x=>{const{nodeLookup:S,nodeOrigin:C}=r.getState();return b1(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??P1();return r.setState({fitViewQueued:!0,fitViewOptions:x,fitViewResolver:S}),i.nodeQueue.push(C=>[...C]),S.promise}}},[]);return ee.useMemo(()=>({...u,...t,viewportInitialized:s}),[s])}const Gp=t=>t.selected,t_=typeof window<"u"?window:void 0;function n_({deleteKeyCode:t,multiSelectionKeyCode:r}){const i=Mt(),{deleteElements:s}=Jf(),u=Ia(t,{actInsideInputWithModifier:!1}),f=Ia(r,{target:t_});ee.useEffect(()=>{if(u){const{edges:d,nodes:m}=i.getState();s({nodes:m.filter(Gp),edges:d.filter(Gp)}),i.setState({nodesSelectionActive:!1})}},[u]),ee.useEffect(()=>{i.setState({multiSelectionActive:f})},[f])}function r_(t){const r=Mt();ee.useEffect(()=>{const i=()=>{var u,f,d,m;if(!t.current||!(((f=(u=t.current).checkVisibility)==null?void 0:f.call(u))??!0))return!1;const s=qf(t.current);(s.height===0||s.width===0)&&((m=(d=r.getState()).onError)==null||m.call(d,"004",Qr.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},o_=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function i_({onPaneContextMenu:t,zoomOnScroll:r=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:u=.5,panOnScrollMode:f=Ri.Free,zoomOnDoubleClick:d=!0,panOnDrag:m=!0,defaultViewport:v,translateExtent:w,minZoom:k,maxZoom:x,zoomActivationKeyCode:S,preventScrolling:C=!0,children:j,noWheelClassName:T,noPanClassName:I,onViewportChange:A,isControlledViewport:V,paneClickDistance:P,selectionOnDrag:R}){const W=Mt(),B=ee.useRef(null),{userSelectionActive:X,lib:fe,connectionInProgress:pe}=mt(o_,At),_e=Ia(S),U=ee.useRef();r_(B);const ce=ee.useCallback(xe=>{A==null||A({x:xe[0],y:xe[1],zoom:xe[2]}),V||W.setState({transform:xe})},[A,V]);return ee.useEffect(()=>{if(B.current){U.current=fb({domNode:B.current,minZoom:k,maxZoom:x,translateExtent:w,viewport:v,onDraggingChange:Q=>W.setState(ie=>ie.paneDragging===Q?ie:{paneDragging:Q}),onPanZoomStart:(Q,ie)=>{const{onViewportChangeStart:z,onMoveStart:K}=W.getState();K==null||K(Q,ie),z==null||z(ie)},onPanZoom:(Q,ie)=>{const{onViewportChange:z,onMove:K}=W.getState();K==null||K(Q,ie),z==null||z(ie)},onPanZoomEnd:(Q,ie)=>{const{onViewportChangeEnd:z,onMoveEnd:K}=W.getState();K==null||K(Q,ie),z==null||z(ie)}});const{x:xe,y:D,zoom:le}=U.current.getViewport();return W.setState({panZoom:U.current,transform:[xe,D,le],domNode:B.current.closest(".react-flow")}),()=>{var Q;(Q=U.current)==null||Q.destroy()}}},[]),ee.useEffect(()=>{var xe;(xe=U.current)==null||xe.update({onPaneContextMenu:t,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:s,panOnScrollSpeed:u,panOnScrollMode:f,zoomOnDoubleClick:d,panOnDrag:m,zoomActivationKeyPressed:_e,preventScrolling:C,noPanClassName:I,userSelectionActive:X,noWheelClassName:T,lib:fe,onTransformChange:ce,connectionInProgress:pe,selectionOnDrag:R,paneClickDistance:P})},[t,r,i,s,u,f,d,m,_e,C,I,X,T,fe,ce,pe,R,P]),b.jsx("div",{className:"react-flow__renderer",ref:B,style:Iu,children:j})}const s_=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function a_(){const{userSelectionActive:t,userSelectionRect:r}=mt(s_,At);return t&&r?b.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))},l_=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function u_({isSelecting:t,selectionKeyPressed:r,selectionMode:i=Pa.Full,panOnDrag:s,paneClickDistance:u,selectionOnDrag:f,onSelectionStart:d,onSelectionEnd:m,onPaneClick:v,onPaneContextMenu:w,onPaneScroll:k,onPaneMouseEnter:x,onPaneMouseMove:S,onPaneMouseLeave:C,children:j}){const T=Mt(),{userSelectionActive:I,elementsSelectable:A,dragging:V,connectionInProgress:P}=mt(l_,At),R=A&&(t||I),W=ee.useRef(null),B=ee.useRef(),X=ee.useRef(new Set),fe=ee.useRef(new Set),pe=ee.useRef(!1),_e=z=>{if(pe.current||P){pe.current=!1;return}v==null||v(z),T.getState().resetSelectedElements(),T.setState({nodesSelectionActive:!1})},U=z=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){z.preventDefault();return}w==null||w(z)},ce=k?z=>k(z):void 0,xe=z=>{pe.current&&(z.stopPropagation(),pe.current=!1)},D=z=>{var Me,$e;const{domNode:K}=T.getState();if(B.current=K==null?void 0:K.getBoundingClientRect(),!B.current)return;const F=z.target===W.current;if(!F&&!!z.target.closest(".nokey")||!t||!(f&&F||r)||z.button!==0||!z.isPrimary)return;($e=(Me=z.target)==null?void 0:Me.setPointerCapture)==null||$e.call(Me,z.pointerId),pe.current=!1;const{x:we,y:Se}=Or(z.nativeEvent,B.current);T.setState({userSelectionRect:{width:0,height:0,startX:we,startY:Se,x:we,y:Se}}),F||(z.stopPropagation(),z.preventDefault())},le=z=>{const{userSelectionRect:K,transform:F,nodeLookup:$,edgeLookup:H,connectionLookup:we,triggerNodeChanges:Se,triggerEdgeChanges:Me,defaultEdgeOptions:$e,resetSelectedElements:Ae}=T.getState();if(!B.current||!K)return;const{x:be,y:Be}=Or(z.nativeEvent,B.current),{startX:ke,startY:He}=K;if(!pe.current){const it=r?0:u;if(Math.hypot(be-ke,Be-He)<=it)return;Ae(),d==null||d(z)}pe.current=!0;const Oe={startX:ke,startY:He,x:be<ke?be:ke,y:Be<He?Be:He,width:Math.abs(be-ke),height:Math.abs(Be-He)},qe=X.current,ut=fe.current;X.current=new Set(Uf($,Oe,F,i===Pa.Partial,!0).map(it=>it.id)),fe.current=new Set;const ct=($e==null?void 0:$e.selectable)??!0;for(const it of X.current){const Tt=we.get(it);if(Tt)for(const{edgeId:_t}of Tt.values()){const Ht=H.get(_t);Ht&&(Ht.selectable??ct)&&fe.current.add(_t)}}if(!_p(qe,X.current)){const it=Es($,X.current,!0);Se(it)}if(!_p(ut,fe.current)){const it=Es(H,fe.current);Me(it)}T.setState({userSelectionRect:Oe,userSelectionActive:!0,nodesSelectionActive:!1})},Q=z=>{var K,F;z.button===0&&((F=(K=z.target)==null?void 0:K.releasePointerCapture)==null||F.call(K,z.pointerId),!I&&z.target===W.current&&T.getState().userSelectionRect&&(_e==null||_e(z)),T.setState({userSelectionActive:!1,userSelectionRect:null}),pe.current&&(m==null||m(z),T.setState({nodesSelectionActive:X.current.size>0})))},ie=s===!0||Array.isArray(s)&&s.includes(0);return b.jsxs("div",{className:Wt(["react-flow__pane",{draggable:ie,dragging:V,selection:t}]),onClick:R?void 0:hf(_e,W),onContextMenu:hf(U,W),onWheel:hf(ce,W),onPointerEnter:R?void 0:x,onPointerMove:R?le:S,onPointerUp:R?Q:void 0,onPointerDownCapture:R?D:void 0,onClickCapture:R?xe:void 0,onPointerLeave:C,ref:W,style:Iu,children:[j,b.jsx(a_,{})]})}function Af({id:t,store:r,unselect:i=!1,nodeRef:s}){const{addSelectedNodes:u,unselectNodesAndEdges:f,multiSelectionActive:d,nodeLookup:m,onError:v}=r.getState(),w=m.get(t);if(!w){v==null||v("012",Qr.error012(t));return}r.setState({nodesSelectionActive:!1}),w.selected?(i||w.selected&&d)&&(f({nodes:[w],edges:[]}),requestAnimationFrame(()=>{var k;return(k=s==null?void 0:s.current)==null?void 0:k.blur()})):u([t])}function Lg({nodeRef:t,disabled:r=!1,noDragClassName:i,handleSelector:s,nodeId:u,isSelectable:f,nodeClickDistance:d}){const m=Mt(),[v,w]=ee.useState(!1),k=ee.useRef();return ee.useEffect(()=>{k.current=G1({getStoreItems:()=>m.getState(),onNodeMouseDown:x=>{Af({id:x,store:m,nodeRef:t})},onDragStart:()=>{w(!0)},onDragStop:()=>{w(!1)}})},[]),ee.useEffect(()=>{if(!(r||!t.current||!k.current))return k.current.update({noDragClassName:i,handleSelector:s,domNode:t.current,isSelectable:f,nodeId:u,nodeClickDistance:d}),()=>{var x;(x=k.current)==null||x.destroy()}},[i,s,r,f,t,u,d]),v}const c_=t=>r=>r.selected&&(r.draggable||t&&typeof r.draggable>"u");function zg(){const t=Mt();return ee.useCallback(i=>{const{nodeExtent:s,snapToGrid:u,snapGrid:f,nodesDraggable:d,onError:m,updateNodePositions:v,nodeLookup:w,nodeOrigin:k}=t.getState(),x=new Map,S=c_(d),C=u?f[0]:5,j=u?f[1]:5,T=i.direction.x*C*i.factor,I=i.direction.y*j*i.factor;for(const[,A]of w){if(!S(A))continue;let V={x:A.internals.positionAbsolute.x+T,y:A.internals.positionAbsolute.y+I};u&&(V=La(V,f));const{position:P,positionAbsolute:R}=rg({nodeId:A.id,nextPosition:V,nodeLookup:w,nodeExtent:s,nodeOrigin:k,onError:m});A.position=P,A.internals.positionAbsolute=R,x.set(A.id,A)}v(x)},[])}const Zf=ee.createContext(null),f_=Zf.Provider;Zf.Consumer;const Fg=()=>ee.useContext(Zf),d_=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),h_=(t,r,i)=>s=>{const{connectionClickStartHandle:u,connectionMode:f,connection:d}=s,{fromHandle:m,toHandle:v,isValid:w}=d,k=(v==null?void 0:v.nodeId)===t&&(v==null?void 0:v.id)===r&&(v==null?void 0:v.type)===i;return{connectingFrom:(m==null?void 0:m.nodeId)===t&&(m==null?void 0:m.id)===r&&(m==null?void 0:m.type)===i,connectingTo:k,clickConnecting:(u==null?void 0:u.nodeId)===t&&(u==null?void 0:u.id)===r&&(u==null?void 0:u.type)===i,isPossibleEndHandle:f===Ts.Strict?(m==null?void 0:m.type)!==i:t!==(m==null?void 0:m.nodeId)||r!==(m==null?void 0:m.id),connectionInProcess:!!m,clickConnectionInProcess:!!u,valid:k&&w}};function p_({type:t="source",position:r=Ze.Top,isValidConnection:i,isConnectable:s=!0,isConnectableStart:u=!0,isConnectableEnd:f=!0,id:d,onConnect:m,children:v,className:w,onMouseDown:k,onTouchStart:x,...S},C){var le,Q;const j=d||null,T=t==="target",I=Mt(),A=Fg(),{connectOnClick:V,noPanClassName:P,rfId:R}=mt(d_,At),{connectingFrom:W,connectingTo:B,clickConnecting:X,isPossibleEndHandle:fe,connectionInProcess:pe,clickConnectionInProcess:_e,valid:U}=mt(h_(A,j,t),At);A||(Q=(le=I.getState()).onError)==null||Q.call(le,"010",Qr.error010());const ce=ie=>{const{defaultEdgeOptions:z,onConnect:K,hasDefaultEdges:F}=I.getState(),$={...z,...ie};if(F){const{edges:H,setEdges:we}=I.getState();we(mg($,H))}K==null||K($),m==null||m($)},xe=ie=>{if(!A)return;const z=fg(ie.nativeEvent);if(u&&(z&&ie.button===0||!z)){const K=I.getState();If.onPointerDown(ie.nativeEvent,{handleDomNode:ie.currentTarget,autoPanOnConnect:K.autoPanOnConnect,connectionMode:K.connectionMode,connectionRadius:K.connectionRadius,domNode:K.domNode,nodeLookup:K.nodeLookup,lib:K.lib,isTarget:T,handleId:j,nodeId:A,flowId:K.rfId,panBy:K.panBy,cancelConnection:K.cancelConnection,onConnectStart:K.onConnectStart,onConnectEnd:(...F)=>{var $,H;return(H=($=I.getState()).onConnectEnd)==null?void 0:H.call($,...F)},updateConnection:K.updateConnection,onConnect:ce,isValidConnection:i||((...F)=>{var $,H;return((H=($=I.getState()).isValidConnection)==null?void 0:H.call($,...F))??!0}),getTransform:()=>I.getState().transform,getFromHandle:()=>I.getState().connection.fromHandle,autoPanSpeed:K.autoPanSpeed,dragThreshold:K.connectionDragThreshold})}z?k==null||k(ie):x==null||x(ie)},D=ie=>{const{onClickConnectStart:z,onClickConnectEnd:K,connectionClickStartHandle:F,connectionMode:$,isValidConnection:H,lib:we,rfId:Se,nodeLookup:Me,connection:$e}=I.getState();if(!A||!F&&!u)return;if(!F){z==null||z(ie.nativeEvent,{nodeId:A,handleId:j,handleType:t}),I.setState({connectionClickStartHandle:{nodeId:A,type:t,id:j}});return}const Ae=ug(ie.target),be=i||H,{connection:Be,isValid:ke}=If.isValid(ie.nativeEvent,{handle:{nodeId:A,id:j,type:t},connectionMode:$,fromNodeId:F.nodeId,fromHandleId:F.id||null,fromType:F.type,isValidConnection:be,flowId:Se,doc:Ae,lib:we,nodeLookup:Me});ke&&Be&&ce(Be);const He=structuredClone($e);delete He.inProgress,He.toPosition=He.toHandle?He.toHandle.position:null,K==null||K(ie,He),I.setState({connectionClickStartHandle:null})};return b.jsx("div",{"data-handleid":j,"data-nodeid":A,"data-handlepos":r,"data-id":`${R}-${A}-${j}-${t}`,className:Wt(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",P,w,{source:!T,target:T,connectable:s,connectablestart:u,connectableend:f,clickconnecting:X,connectingfrom:W,connectingto:B,valid:U,connectionindicator:s&&(!pe||fe)&&(pe||_e?f:u)}]),onMouseDown:xe,onTouchStart:xe,onClick:V?D:void 0,ref:C,...S,children:v})}const Rs=ee.memo(Rg(p_));function m_({data:t,isConnectable:r,sourcePosition:i=Ze.Bottom}){return b.jsxs(b.Fragment,{children:[t==null?void 0:t.label,b.jsx(Rs,{type:"source",position:i,isConnectable:r})]})}function g_({data:t,isConnectable:r,targetPosition:i=Ze.Top,sourcePosition:s=Ze.Bottom}){return b.jsxs(b.Fragment,{children:[b.jsx(Rs,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label,b.jsx(Rs,{type:"source",position:s,isConnectable:r})]})}function y_(){return null}function v_({data:t,isConnectable:r,targetPosition:i=Ze.Top}){return b.jsxs(b.Fragment,{children:[b.jsx(Rs,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label]})}const vu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Jp={input:m_,default:g_,output:v_,group:y_};function x_(t){var r,i,s,u;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??((u=t.style)==null?void 0:u.height)}}const w_=t=>{const{width:r,height:i,x:s,y:u}=Da(t.nodeLookup,{filter:f=>!!f.selected});return{width:Ar(r)?r:null,height:Ar(i)?i:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${s}px,${u}px)`}};function b_({onSelectionContextMenu:t,noPanClassName:r,disableKeyboardA11y:i}){const s=Mt(),{width:u,height:f,transformString:d,userSelectionActive:m}=mt(w_,At),v=zg(),w=ee.useRef(null);ee.useEffect(()=>{var C;i||(C=w.current)==null||C.focus({preventScroll:!0})},[i]);const k=!m&&u!==null&&f!==null;if(Lg({nodeRef:w,disabled:!k}),!k)return null;const x=t?C=>{const j=s.getState().nodes.filter(T=>T.selected);t(C,j)}:void 0,S=C=>{Object.prototype.hasOwnProperty.call(vu,C.key)&&(C.preventDefault(),v({direction:vu[C.key],factor:C.shiftKey?4:1}))};return b.jsx("div",{className:Wt(["react-flow__nodesselection","react-flow__container",r]),style:{transform:d},children:b.jsx("div",{ref:w,className:"react-flow__nodesselection-rect",onContextMenu:x,tabIndex:i?void 0:-1,onKeyDown:i?void 0:S,style:{width:u,height:f}})})}const Zp=typeof window<"u"?window:void 0,__=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function Bg({children:t,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:u,onPaneContextMenu:f,onPaneScroll:d,paneClickDistance:m,deleteKeyCode:v,selectionKeyCode:w,selectionOnDrag:k,selectionMode:x,onSelectionStart:S,onSelectionEnd:C,multiSelectionKeyCode:j,panActivationKeyCode:T,zoomActivationKeyCode:I,elementsSelectable:A,zoomOnScroll:V,zoomOnPinch:P,panOnScroll:R,panOnScrollSpeed:W,panOnScrollMode:B,zoomOnDoubleClick:X,panOnDrag:fe,defaultViewport:pe,translateExtent:_e,minZoom:U,maxZoom:ce,preventScrolling:xe,onSelectionContextMenu:D,noWheelClassName:le,noPanClassName:Q,disableKeyboardA11y:ie,onViewportChange:z,isControlledViewport:K}){const{nodesSelectionActive:F,userSelectionActive:$}=mt(__,At),H=Ia(w,{target:Zp}),we=Ia(T,{target:Zp}),Se=we||fe,Me=we||R,$e=k&&Se!==!0,Ae=H||$||$e;return n_({deleteKeyCode:v,multiSelectionKeyCode:j}),b.jsx(i_,{onPaneContextMenu:f,elementsSelectable:A,zoomOnScroll:V,zoomOnPinch:P,panOnScroll:Me,panOnScrollSpeed:W,panOnScrollMode:B,zoomOnDoubleClick:X,panOnDrag:!H&&Se,defaultViewport:pe,translateExtent:_e,minZoom:U,maxZoom:ce,zoomActivationKeyCode:I,preventScrolling:xe,noWheelClassName:le,noPanClassName:Q,onViewportChange:z,isControlledViewport:K,paneClickDistance:m,selectionOnDrag:$e,children:b.jsxs(u_,{onSelectionStart:S,onSelectionEnd:C,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:u,onPaneContextMenu:f,onPaneScroll:d,panOnDrag:Se,isSelecting:!!Ae,selectionMode:x,selectionKeyPressed:H,paneClickDistance:m,selectionOnDrag:$e,children:[t,F&&b.jsx(b_,{onSelectionContextMenu:D,noPanClassName:Q,disableKeyboardA11y:ie})]})})}Bg.displayName="FlowRenderer";const S_=ee.memo(Bg),k_=t=>r=>t?Uf(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 N_(t){return mt(ee.useCallback(k_(t),[t]),At)}const E_=t=>t.updateNodeInternals;function C_(){const t=mt(E_),[r]=ee.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const s=new Map;i.forEach(u=>{const f=u.target.getAttribute("data-id");s.set(f,{id:f,nodeElement:u.target,force:!0})}),t(s)}));return ee.useEffect(()=>()=>{r==null||r.disconnect()},[r]),r}function j_({node:t,nodeType:r,hasDimensions:i,resizeObserver:s}){const u=Mt(),f=ee.useRef(null),d=ee.useRef(null),m=ee.useRef(t.sourcePosition),v=ee.useRef(t.targetPosition),w=ee.useRef(r),k=i&&!!t.internals.handleBounds;return ee.useEffect(()=>{f.current&&!t.hidden&&(!k||d.current!==f.current)&&(d.current&&(s==null||s.unobserve(d.current)),s==null||s.observe(f.current),d.current=f.current)},[k,t.hidden]),ee.useEffect(()=>()=>{d.current&&(s==null||s.unobserve(d.current),d.current=null)},[]),ee.useEffect(()=>{if(f.current){const x=w.current!==r,S=m.current!==t.sourcePosition,C=v.current!==t.targetPosition;(x||S||C)&&(w.current=r,m.current=t.sourcePosition,v.current=t.targetPosition,u.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:f.current,force:!0}]])))}},[t.id,r,t.sourcePosition,t.targetPosition]),f}function P_({id:t,onClick:r,onMouseEnter:i,onMouseMove:s,onMouseLeave:u,onContextMenu:f,onDoubleClick:d,nodesDraggable:m,elementsSelectable:v,nodesConnectable:w,nodesFocusable:k,resizeObserver:x,noDragClassName:S,noPanClassName:C,disableKeyboardA11y:j,rfId:T,nodeTypes:I,nodeClickDistance:A,onError:V}){const{node:P,internals:R,isParent:W}=mt(be=>{const Be=be.nodeLookup.get(t),ke=be.parentLookup.has(t);return{node:Be,internals:Be.internals,isParent:ke}},At);let B=P.type||"default",X=(I==null?void 0:I[B])||Jp[B];X===void 0&&(V==null||V("003",Qr.error003(B)),B="default",X=(I==null?void 0:I.default)||Jp.default);const fe=!!(P.draggable||m&&typeof P.draggable>"u"),pe=!!(P.selectable||v&&typeof P.selectable>"u"),_e=!!(P.connectable||w&&typeof P.connectable>"u"),U=!!(P.focusable||k&&typeof P.focusable>"u"),ce=Mt(),xe=ag(P),D=j_({node:P,nodeType:B,hasDimensions:xe,resizeObserver:x}),le=Lg({nodeRef:D,disabled:P.hidden||!fe,noDragClassName:S,handleSelector:P.dragHandle,nodeId:t,isSelectable:pe,nodeClickDistance:A}),Q=zg();if(P.hidden)return null;const ie=To(P),z=x_(P),K=pe||fe||r||i||s||u,F=i?be=>i(be,{...R.userNode}):void 0,$=s?be=>s(be,{...R.userNode}):void 0,H=u?be=>u(be,{...R.userNode}):void 0,we=f?be=>f(be,{...R.userNode}):void 0,Se=d?be=>d(be,{...R.userNode}):void 0,Me=be=>{const{selectNodesOnDrag:Be,nodeDragThreshold:ke}=ce.getState();pe&&(!Be||!fe||ke>0)&&Af({id:t,store:ce,nodeRef:D}),r&&r(be,{...R.userNode})},$e=be=>{if(!(cg(be.nativeEvent)||j)){if(Jm.includes(be.key)&&pe){const Be=be.key==="Escape";Af({id:t,store:ce,unselect:Be,nodeRef:D})}else if(fe&&P.selected&&Object.prototype.hasOwnProperty.call(vu,be.key)){be.preventDefault();const{ariaLabelConfig:Be}=ce.getState();ce.setState({ariaLiveMessage:Be["node.a11yDescription.ariaLiveMessage"]({direction:be.key.replace("Arrow","").toLowerCase(),x:~~R.positionAbsolute.x,y:~~R.positionAbsolute.y})}),Q({direction:vu[be.key],factor:be.shiftKey?4:1})}}},Ae=()=>{var ut;if(j||!((ut=D.current)!=null&&ut.matches(":focus-visible")))return;const{transform:be,width:Be,height:ke,autoPanOnNodeFocus:He,setCenter:Oe}=ce.getState();if(!He)return;Uf(new Map([[t,P]]),{x:0,y:0,width:Be,height:ke},be,!0).length>0||Oe(P.position.x+ie.width/2,P.position.y+ie.height/2,{zoom:be[2]})};return b.jsx("div",{className:Wt(["react-flow__node",`react-flow__node-${B}`,{[C]:fe},P.className,{selected:P.selected,selectable:pe,parent:W,draggable:fe,dragging:le}]),ref:D,style:{zIndex:R.z,transform:`translate(${R.positionAbsolute.x}px,${R.positionAbsolute.y}px)`,pointerEvents:K?"all":"none",visibility:xe?"visible":"hidden",...P.style,...z},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:F,onMouseMove:$,onMouseLeave:H,onContextMenu:we,onClick:Me,onDoubleClick:Se,onKeyDown:U?$e:void 0,tabIndex:U?0:void 0,onFocus:U?Ae:void 0,role:P.ariaRole??(U?"group":void 0),"aria-roledescription":"node","aria-describedby":j?void 0:`${Mg}-${T}`,"aria-label":P.ariaLabel,...P.domAttributes,children:b.jsx(f_,{value:t,children:b.jsx(X,{id:t,data:P.data,type:B,positionAbsoluteX:R.positionAbsolute.x,positionAbsoluteY:R.positionAbsolute.y,selected:P.selected??!1,selectable:pe,draggable:fe,deletable:P.deletable??!0,isConnectable:_e,sourcePosition:P.sourcePosition,targetPosition:P.targetPosition,dragging:le,dragHandle:P.dragHandle,zIndex:R.z,parentId:P.parentId,...ie})})})}var M_=ee.memo(P_);const T_=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function Hg(t){const{nodesDraggable:r,nodesConnectable:i,nodesFocusable:s,elementsSelectable:u,onError:f}=mt(T_,At),d=N_(t.onlyRenderVisibleElements),m=C_();return b.jsx("div",{className:"react-flow__nodes",style:Iu,children:d.map(v=>b.jsx(M_,{id:v,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:m,nodesDraggable:r,nodesConnectable:i,nodesFocusable:s,elementsSelectable:u,nodeClickDistance:t.nodeClickDistance,onError:f},v))})}Hg.displayName="NodeRenderer";const I_=ee.memo(Hg);function $_(t){return mt(ee.useCallback(i=>{if(!t)return i.edges.map(u=>u.id);const s=[];if(i.width&&i.height)for(const u of i.edges){const f=i.nodeLookup.get(u.source),d=i.nodeLookup.get(u.target);f&&d&&$1({sourceNode:f,targetNode:d,width:i.width,height:i.height,transform:i.transform})&&s.push(u.id)}return s},[t]),At)}const A_=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t}};return b.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},O_=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t,fill:t}};return b.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},em={[mu.Arrow]:A_,[mu.ArrowClosed]:O_};function R_(t){const r=Mt();return ee.useMemo(()=>{var u,f;return Object.prototype.hasOwnProperty.call(em,t)?em[t]:((f=(u=r.getState()).onError)==null||f.call(u,"009",Qr.error009(t)),null)},[t])}const D_=({id:t,type:r,color:i,width:s=12.5,height:u=12.5,markerUnits:f="strokeWidth",strokeWidth:d,orient:m="auto-start-reverse"})=>{const v=R_(r);return v?b.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${s}`,markerHeight:`${u}`,viewBox:"-10 -10 20 20",markerUnits:f,orient:m,refX:"0",refY:"0",children:b.jsx(v,{color:i,strokeWidth:d})}):null},Vg=({defaultColor:t,rfId:r})=>{const i=mt(f=>f.edges),s=mt(f=>f.defaultEdgeOptions),u=ee.useMemo(()=>F1(i,{id:r,defaultColor:t,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[i,s,r,t]);return u.length?b.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:b.jsx("defs",{children:u.map(f=>b.jsx(D_,{id:f.id,type:f.type,color:f.color,width:f.width,height:f.height,markerUnits:f.markerUnits,strokeWidth:f.strokeWidth,orient:f.orient},f.id))})}):null};Vg.displayName="MarkerDefinitions";var L_=ee.memo(Vg);function Ug({x:t,y:r,label:i,labelStyle:s,labelShowBg:u=!0,labelBgStyle:f,labelBgPadding:d=[2,4],labelBgBorderRadius:m=2,children:v,className:w,...k}){const[x,S]=ee.useState({x:1,y:0,width:0,height:0}),C=Wt(["react-flow__edge-textwrapper",w]),j=ee.useRef(null);return ee.useEffect(()=>{if(j.current){const T=j.current.getBBox();S({x:T.x,y:T.y,width:T.width,height:T.height})}},[i]),i?b.jsxs("g",{transform:`translate(${t-x.width/2} ${r-x.height/2})`,className:C,visibility:x.width?"visible":"hidden",...k,children:[u&&b.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:f,rx:m,ry:m}),b.jsx("text",{className:"react-flow__edge-text",y:x.height/2,dy:"0.3em",ref:j,style:s,children:i}),v]}):null}Ug.displayName="EdgeText";const z_=ee.memo(Ug);function $u({path:t,labelX:r,labelY:i,label:s,labelStyle:u,labelShowBg:f,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:v,interactionWidth:w=20,...k}){return b.jsxs(b.Fragment,{children:[b.jsx("path",{...k,d:t,fill:"none",className:Wt(["react-flow__edge-path",k.className])}),w?b.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:w,className:"react-flow__edge-interaction"}):null,s&&Ar(r)&&Ar(i)?b.jsx(z_,{x:r,y:i,label:s,labelStyle:u,labelShowBg:f,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:v}):null]})}function tm({pos:t,x1:r,y1:i,x2:s,y2:u}){return t===Ze.Left||t===Ze.Right?[.5*(r+s),i]:[r,.5*(i+u)]}function Kg({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:s,targetY:u,targetPosition:f=Ze.Top}){const[d,m]=tm({pos:i,x1:t,y1:r,x2:s,y2:u}),[v,w]=tm({pos:f,x1:s,y1:u,x2:t,y2:r}),[k,x,S,C]=dg({sourceX:t,sourceY:r,targetX:s,targetY:u,sourceControlX:d,sourceControlY:m,targetControlX:v,targetControlY:w});return[`M${t},${r} C${d},${m} ${v},${w} ${s},${u}`,k,x,S,C]}function qg(t){return ee.memo(({id:r,sourceX:i,sourceY:s,targetX:u,targetY:f,sourcePosition:d,targetPosition:m,label:v,labelStyle:w,labelShowBg:k,labelBgStyle:x,labelBgPadding:S,labelBgBorderRadius:C,style:j,markerEnd:T,markerStart:I,interactionWidth:A})=>{const[V,P,R]=Kg({sourceX:i,sourceY:s,sourcePosition:d,targetX:u,targetY:f,targetPosition:m}),W=t.isInternal?void 0:r;return b.jsx($u,{id:W,path:V,labelX:P,labelY:R,label:v,labelStyle:w,labelShowBg:k,labelBgStyle:x,labelBgPadding:S,labelBgBorderRadius:C,style:j,markerEnd:T,markerStart:I,interactionWidth:A})})}const F_=qg({isInternal:!1}),Wg=qg({isInternal:!0});F_.displayName="SimpleBezierEdge";Wg.displayName="SimpleBezierEdgeInternal";function Yg(t){return ee.memo(({id:r,sourceX:i,sourceY:s,targetX:u,targetY:f,label:d,labelStyle:m,labelShowBg:v,labelBgStyle:w,labelBgPadding:k,labelBgBorderRadius:x,style:S,sourcePosition:C=Ze.Bottom,targetPosition:j=Ze.Top,markerEnd:T,markerStart:I,pathOptions:A,interactionWidth:V})=>{const[P,R,W]=Pf({sourceX:i,sourceY:s,sourcePosition:C,targetX:u,targetY:f,targetPosition:j,borderRadius:A==null?void 0:A.borderRadius,offset:A==null?void 0:A.offset,stepPosition:A==null?void 0:A.stepPosition}),B=t.isInternal?void 0:r;return b.jsx($u,{id:B,path:P,labelX:R,labelY:W,label:d,labelStyle:m,labelShowBg:v,labelBgStyle:w,labelBgPadding:k,labelBgBorderRadius:x,style:S,markerEnd:T,markerStart:I,interactionWidth:V})})}const Xg=Yg({isInternal:!1}),Qg=Yg({isInternal:!0});Xg.displayName="SmoothStepEdge";Qg.displayName="SmoothStepEdgeInternal";function Gg(t){return ee.memo(({id:r,...i})=>{var u;const s=t.isInternal?void 0:r;return b.jsx(Xg,{...i,id:s,pathOptions:ee.useMemo(()=>{var f;return{borderRadius:0,offset:(f=i.pathOptions)==null?void 0:f.offset}},[(u=i.pathOptions)==null?void 0:u.offset])})})}const B_=Gg({isInternal:!1}),Jg=Gg({isInternal:!0});B_.displayName="StepEdge";Jg.displayName="StepEdgeInternal";function Zg(t){return ee.memo(({id:r,sourceX:i,sourceY:s,targetX:u,targetY:f,label:d,labelStyle:m,labelShowBg:v,labelBgStyle:w,labelBgPadding:k,labelBgBorderRadius:x,style:S,markerEnd:C,markerStart:j,interactionWidth:T})=>{const[I,A,V]=gg({sourceX:i,sourceY:s,targetX:u,targetY:f}),P=t.isInternal?void 0:r;return b.jsx($u,{id:P,path:I,labelX:A,labelY:V,label:d,labelStyle:m,labelShowBg:v,labelBgStyle:w,labelBgPadding:k,labelBgBorderRadius:x,style:S,markerEnd:C,markerStart:j,interactionWidth:T})})}const H_=Zg({isInternal:!1}),e0=Zg({isInternal:!0});H_.displayName="StraightEdge";e0.displayName="StraightEdgeInternal";function t0(t){return ee.memo(({id:r,sourceX:i,sourceY:s,targetX:u,targetY:f,sourcePosition:d=Ze.Bottom,targetPosition:m=Ze.Top,label:v,labelStyle:w,labelShowBg:k,labelBgStyle:x,labelBgPadding:S,labelBgBorderRadius:C,style:j,markerEnd:T,markerStart:I,pathOptions:A,interactionWidth:V})=>{const[P,R,W]=hg({sourceX:i,sourceY:s,sourcePosition:d,targetX:u,targetY:f,targetPosition:m,curvature:A==null?void 0:A.curvature}),B=t.isInternal?void 0:r;return b.jsx($u,{id:B,path:P,labelX:R,labelY:W,label:v,labelStyle:w,labelShowBg:k,labelBgStyle:x,labelBgPadding:S,labelBgBorderRadius:C,style:j,markerEnd:T,markerStart:I,interactionWidth:V})})}const V_=t0({isInternal:!1}),n0=t0({isInternal:!0});V_.displayName="BezierEdge";n0.displayName="BezierEdgeInternal";const nm={default:n0,straight:e0,step:Jg,smoothstep:Qg,simplebezier:Wg},rm={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},U_=(t,r,i)=>i===Ze.Left?t-r:i===Ze.Right?t+r:t,K_=(t,r,i)=>i===Ze.Top?t-r:i===Ze.Bottom?t+r:t,om="react-flow__edgeupdater";function im({position:t,centerX:r,centerY:i,radius:s=10,onMouseDown:u,onMouseEnter:f,onMouseOut:d,type:m}){return b.jsx("circle",{onMouseDown:u,onMouseEnter:f,onMouseOut:d,className:Wt([om,`${om}-${m}`]),cx:U_(r,s,t),cy:K_(i,s,t),r:s,stroke:"transparent",fill:"transparent"})}function q_({isReconnectable:t,reconnectRadius:r,edge:i,sourceX:s,sourceY:u,targetX:f,targetY:d,sourcePosition:m,targetPosition:v,onReconnect:w,onReconnectStart:k,onReconnectEnd:x,setReconnecting:S,setUpdateHover:C}){const j=Mt(),T=(R,W)=>{if(R.button!==0)return;const{autoPanOnConnect:B,domNode:X,connectionMode:fe,connectionRadius:pe,lib:_e,onConnectStart:U,cancelConnection:ce,nodeLookup:xe,rfId:D,panBy:le,updateConnection:Q}=j.getState(),ie=W.type==="target",z=($,H)=>{S(!1),x==null||x($,i,W.type,H)},K=$=>w==null?void 0:w(i,$),F=($,H)=>{S(!0),k==null||k(R,i,W.type),U==null||U($,H)};If.onPointerDown(R.nativeEvent,{autoPanOnConnect:B,connectionMode:fe,connectionRadius:pe,domNode:X,handleId:W.id,nodeId:W.nodeId,nodeLookup:xe,isTarget:ie,edgeUpdaterType:W.type,lib:_e,flowId:D,cancelConnection:ce,panBy:le,isValidConnection:(...$)=>{var H,we;return((we=(H=j.getState()).isValidConnection)==null?void 0:we.call(H,...$))??!0},onConnect:K,onConnectStart:F,onConnectEnd:(...$)=>{var H,we;return(we=(H=j.getState()).onConnectEnd)==null?void 0:we.call(H,...$)},onReconnectEnd:z,updateConnection:Q,getTransform:()=>j.getState().transform,getFromHandle:()=>j.getState().connection.fromHandle,dragThreshold:j.getState().connectionDragThreshold,handleDomNode:R.currentTarget})},I=R=>T(R,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),A=R=>T(R,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),V=()=>C(!0),P=()=>C(!1);return b.jsxs(b.Fragment,{children:[(t===!0||t==="source")&&b.jsx(im,{position:m,centerX:s,centerY:u,radius:r,onMouseDown:I,onMouseEnter:V,onMouseOut:P,type:"source"}),(t===!0||t==="target")&&b.jsx(im,{position:v,centerX:f,centerY:d,radius:r,onMouseDown:A,onMouseEnter:V,onMouseOut:P,type:"target"})]})}function W_({id:t,edgesFocusable:r,edgesReconnectable:i,elementsSelectable:s,onClick:u,onDoubleClick:f,onContextMenu:d,onMouseEnter:m,onMouseMove:v,onMouseLeave:w,reconnectRadius:k,onReconnect:x,onReconnectStart:S,onReconnectEnd:C,rfId:j,edgeTypes:T,noPanClassName:I,onError:A,disableKeyboardA11y:V}){let P=mt(Oe=>Oe.edgeLookup.get(t));const R=mt(Oe=>Oe.defaultEdgeOptions);P=R?{...R,...P}:P;let W=P.type||"default",B=(T==null?void 0:T[W])||nm[W];B===void 0&&(A==null||A("011",Qr.error011(W)),W="default",B=(T==null?void 0:T.default)||nm.default);const X=!!(P.focusable||r&&typeof P.focusable>"u"),fe=typeof x<"u"&&(P.reconnectable||i&&typeof P.reconnectable>"u"),pe=!!(P.selectable||s&&typeof P.selectable>"u"),_e=ee.useRef(null),[U,ce]=ee.useState(!1),[xe,D]=ee.useState(!1),le=Mt(),{zIndex:Q,sourceX:ie,sourceY:z,targetX:K,targetY:F,sourcePosition:$,targetPosition:H}=mt(ee.useCallback(Oe=>{const qe=Oe.nodeLookup.get(P.source),ut=Oe.nodeLookup.get(P.target);if(!qe||!ut)return{zIndex:P.zIndex,...rm};const ct=z1({id:t,sourceNode:qe,targetNode:ut,sourceHandle:P.sourceHandle||null,targetHandle:P.targetHandle||null,connectionMode:Oe.connectionMode,onError:A});return{zIndex:I1({selected:P.selected,zIndex:P.zIndex,sourceNode:qe,targetNode:ut,elevateOnSelect:Oe.elevateEdgesOnSelect,zIndexMode:Oe.zIndexMode}),...ct||rm}},[P.source,P.target,P.sourceHandle,P.targetHandle,P.selected,P.zIndex]),At),we=ee.useMemo(()=>P.markerStart?`url('#${Mf(P.markerStart,j)}')`:void 0,[P.markerStart,j]),Se=ee.useMemo(()=>P.markerEnd?`url('#${Mf(P.markerEnd,j)}')`:void 0,[P.markerEnd,j]);if(P.hidden||ie===null||z===null||K===null||F===null)return null;const Me=Oe=>{var it;const{addSelectedEdges:qe,unselectNodesAndEdges:ut,multiSelectionActive:ct}=le.getState();pe&&(le.setState({nodesSelectionActive:!1}),P.selected&&ct?(ut({nodes:[],edges:[P]}),(it=_e.current)==null||it.blur()):qe([t])),u&&u(Oe,P)},$e=f?Oe=>{f(Oe,{...P})}:void 0,Ae=d?Oe=>{d(Oe,{...P})}:void 0,be=m?Oe=>{m(Oe,{...P})}:void 0,Be=v?Oe=>{v(Oe,{...P})}:void 0,ke=w?Oe=>{w(Oe,{...P})}:void 0,He=Oe=>{var qe;if(!V&&Jm.includes(Oe.key)&&pe){const{unselectNodesAndEdges:ut,addSelectedEdges:ct}=le.getState();Oe.key==="Escape"?((qe=_e.current)==null||qe.blur(),ut({edges:[P]})):ct([t])}};return b.jsx("svg",{style:{zIndex:Q},children:b.jsxs("g",{className:Wt(["react-flow__edge",`react-flow__edge-${W}`,P.className,I,{selected:P.selected,animated:P.animated,inactive:!pe&&!u,updating:U,selectable:pe}]),onClick:Me,onDoubleClick:$e,onContextMenu:Ae,onMouseEnter:be,onMouseMove:Be,onMouseLeave:ke,onKeyDown:X?He:void 0,tabIndex:X?0:void 0,role:P.ariaRole??(X?"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":X?`${Tg}-${j}`:void 0,ref:_e,...P.domAttributes,children:[!xe&&b.jsx(B,{id:t,source:P.source,target:P.target,type:P.type,selected:P.selected,animated:P.animated,selectable:pe,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:K,targetY:F,sourcePosition:$,targetPosition:H,data:P.data,style:P.style,sourceHandleId:P.sourceHandle,targetHandleId:P.targetHandle,markerStart:we,markerEnd:Se,pathOptions:"pathOptions"in P?P.pathOptions:void 0,interactionWidth:P.interactionWidth}),fe&&b.jsx(q_,{edge:P,isReconnectable:fe,reconnectRadius:k,onReconnect:x,onReconnectStart:S,onReconnectEnd:C,sourceX:ie,sourceY:z,targetX:K,targetY:F,sourcePosition:$,targetPosition:H,setUpdateHover:ce,setReconnecting:D})]})})}var Y_=ee.memo(W_);const X_=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function r0({defaultMarkerColor:t,onlyRenderVisibleElements:r,rfId:i,edgeTypes:s,noPanClassName:u,onReconnect:f,onEdgeContextMenu:d,onEdgeMouseEnter:m,onEdgeMouseMove:v,onEdgeMouseLeave:w,onEdgeClick:k,reconnectRadius:x,onEdgeDoubleClick:S,onReconnectStart:C,onReconnectEnd:j,disableKeyboardA11y:T}){const{edgesFocusable:I,edgesReconnectable:A,elementsSelectable:V,onError:P}=mt(X_,At),R=$_(r);return b.jsxs("div",{className:"react-flow__edges",children:[b.jsx(L_,{defaultColor:t,rfId:i}),R.map(W=>b.jsx(Y_,{id:W,edgesFocusable:I,edgesReconnectable:A,elementsSelectable:V,noPanClassName:u,onReconnect:f,onContextMenu:d,onMouseEnter:m,onMouseMove:v,onMouseLeave:w,onClick:k,reconnectRadius:x,onDoubleClick:S,onReconnectStart:C,onReconnectEnd:j,rfId:i,onError:P,edgeTypes:s,disableKeyboardA11y:T},W))]})}r0.displayName="EdgeRenderer";const Q_=ee.memo(r0),G_=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function J_({children:t}){const r=mt(G_);return b.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:t})}function Z_(t){const r=Jf(),i=ee.useRef(!1);ee.useEffect(()=>{!i.current&&r.viewportInitialized&&t&&(setTimeout(()=>t(r),1),i.current=!0)},[t,r.viewportInitialized])}const eS=t=>{var r;return(r=t.panZoom)==null?void 0:r.syncViewport};function tS(t){const r=mt(eS),i=Mt();return ee.useEffect(()=>{t&&(r==null||r(t),i.setState({transform:[t.x,t.y,t.zoom]}))},[t,r]),null}function nS(t){return t.connection.inProgress?{...t.connection,to:za(t.connection.to,t.transform)}:{...t.connection}}function rS(t){return nS}function oS(t){const r=rS();return mt(r,At)}const iS=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function sS({containerStyle:t,style:r,type:i,component:s}){const{nodesConnectable:u,width:f,height:d,isValid:m,inProgress:v}=mt(iS,At);return!(f&&u&&v)?null:b.jsx("svg",{style:t,width:f,height:d,className:"react-flow__connectionline react-flow__container",children:b.jsx("g",{className:Wt(["react-flow__connection",tg(m)]),children:b.jsx(o0,{style:r,type:i,CustomComponent:s,isValid:m})})})}const o0=({style:t,type:r=li.Bezier,CustomComponent:i,isValid:s})=>{const{inProgress:u,from:f,fromNode:d,fromHandle:m,fromPosition:v,to:w,toNode:k,toHandle:x,toPosition:S,pointer:C}=oS();if(!u)return;if(i)return b.jsx(i,{connectionLineType:r,connectionLineStyle:t,fromNode:d,fromHandle:m,fromX:f.x,fromY:f.y,toX:w.x,toY:w.y,fromPosition:v,toPosition:S,connectionStatus:tg(s),toNode:k,toHandle:x,pointer:C});let j="";const T={sourceX:f.x,sourceY:f.y,sourcePosition:v,targetX:w.x,targetY:w.y,targetPosition:S};switch(r){case li.Bezier:[j]=hg(T);break;case li.SimpleBezier:[j]=Kg(T);break;case li.Step:[j]=Pf({...T,borderRadius:0});break;case li.SmoothStep:[j]=Pf(T);break;default:[j]=gg(T)}return b.jsx("path",{d:j,fill:"none",className:"react-flow__connection-path",style:t})};o0.displayName="ConnectionLine";const aS={};function sm(t=aS){ee.useRef(t),Mt(),ee.useEffect(()=>{},[t])}function lS(){Mt(),ee.useRef(!1),ee.useEffect(()=>{},[])}function i0({nodeTypes:t,edgeTypes:r,onInit:i,onNodeClick:s,onEdgeClick:u,onNodeDoubleClick:f,onEdgeDoubleClick:d,onNodeMouseEnter:m,onNodeMouseMove:v,onNodeMouseLeave:w,onNodeContextMenu:k,onSelectionContextMenu:x,onSelectionStart:S,onSelectionEnd:C,connectionLineType:j,connectionLineStyle:T,connectionLineComponent:I,connectionLineContainerStyle:A,selectionKeyCode:V,selectionOnDrag:P,selectionMode:R,multiSelectionKeyCode:W,panActivationKeyCode:B,zoomActivationKeyCode:X,deleteKeyCode:fe,onlyRenderVisibleElements:pe,elementsSelectable:_e,defaultViewport:U,translateExtent:ce,minZoom:xe,maxZoom:D,preventScrolling:le,defaultMarkerColor:Q,zoomOnScroll:ie,zoomOnPinch:z,panOnScroll:K,panOnScrollSpeed:F,panOnScrollMode:$,zoomOnDoubleClick:H,panOnDrag:we,onPaneClick:Se,onPaneMouseEnter:Me,onPaneMouseMove:$e,onPaneMouseLeave:Ae,onPaneScroll:be,onPaneContextMenu:Be,paneClickDistance:ke,nodeClickDistance:He,onEdgeContextMenu:Oe,onEdgeMouseEnter:qe,onEdgeMouseMove:ut,onEdgeMouseLeave:ct,reconnectRadius:it,onReconnect:Tt,onReconnectStart:_t,onReconnectEnd:Ht,noDragClassName:Ot,noWheelClassName:St,noPanClassName:wn,disableKeyboardA11y:fn,nodeExtent:gr,rfId:bn,viewport:Nt,onViewportChange:Vt}){return sm(t),sm(r),lS(),Z_(i),tS(Nt),b.jsx(S_,{onPaneClick:Se,onPaneMouseEnter:Me,onPaneMouseMove:$e,onPaneMouseLeave:Ae,onPaneContextMenu:Be,onPaneScroll:be,paneClickDistance:ke,deleteKeyCode:fe,selectionKeyCode:V,selectionOnDrag:P,selectionMode:R,onSelectionStart:S,onSelectionEnd:C,multiSelectionKeyCode:W,panActivationKeyCode:B,zoomActivationKeyCode:X,elementsSelectable:_e,zoomOnScroll:ie,zoomOnPinch:z,zoomOnDoubleClick:H,panOnScroll:K,panOnScrollSpeed:F,panOnScrollMode:$,panOnDrag:we,defaultViewport:U,translateExtent:ce,minZoom:xe,maxZoom:D,onSelectionContextMenu:x,preventScrolling:le,noDragClassName:Ot,noWheelClassName:St,noPanClassName:wn,disableKeyboardA11y:fn,onViewportChange:Vt,isControlledViewport:!!Nt,children:b.jsxs(J_,{children:[b.jsx(Q_,{edgeTypes:r,onEdgeClick:u,onEdgeDoubleClick:d,onReconnect:Tt,onReconnectStart:_t,onReconnectEnd:Ht,onlyRenderVisibleElements:pe,onEdgeContextMenu:Oe,onEdgeMouseEnter:qe,onEdgeMouseMove:ut,onEdgeMouseLeave:ct,reconnectRadius:it,defaultMarkerColor:Q,noPanClassName:wn,disableKeyboardA11y:fn,rfId:bn}),b.jsx(sS,{style:T,type:j,component:I,containerStyle:A}),b.jsx("div",{className:"react-flow__edgelabel-renderer"}),b.jsx(I_,{nodeTypes:t,onNodeClick:s,onNodeDoubleClick:f,onNodeMouseEnter:m,onNodeMouseMove:v,onNodeMouseLeave:w,onNodeContextMenu:k,nodeClickDistance:He,onlyRenderVisibleElements:pe,noPanClassName:wn,noDragClassName:Ot,disableKeyboardA11y:fn,nodeExtent:gr,rfId:bn}),b.jsx("div",{className:"react-flow__viewport-portal"})]})})}i0.displayName="GraphView";const uS=ee.memo(i0),am=({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:u,height:f,fitView:d,fitViewOptions:m,minZoom:v=.5,maxZoom:w=2,nodeOrigin:k,nodeExtent:x,zIndexMode:S="basic"}={})=>{const C=new Map,j=new Map,T=new Map,I=new Map,A=s??r??[],V=i??t??[],P=k??[0,0],R=x??ja;xg(T,I,A);const{nodesInitialized:W}=Tf(V,C,j,{nodeOrigin:P,nodeExtent:R,zIndexMode:S});let B=[0,0,1];if(d&&u&&f){const X=Da(C,{filter:U=>!!((U.width||U.initialWidth)&&(U.height||U.initialHeight))}),{x:fe,y:pe,zoom:_e}=Kf(X,u,f,v,w,(m==null?void 0:m.padding)??.1);B=[fe,pe,_e]}return{rfId:"1",width:u??0,height:f??0,transform:B,nodes:V,nodesInitialized:W,nodeLookup:C,parentLookup:j,edges:A,edgeLookup:I,connectionLookup:T,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:v,maxZoom:w,translateExtent:ja,nodeExtent:R,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ts.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:P,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:d??!1,fitViewOptions:m,fitViewResolver:null,connection:{...eg},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:E1,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Zm,zIndexMode:S,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},cS=({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:u,height:f,fitView:d,fitViewOptions:m,minZoom:v,maxZoom:w,nodeOrigin:k,nodeExtent:x,zIndexMode:S})=>Pb((C,j)=>{async function T(){const{nodeLookup:I,panZoom:A,fitViewOptions:V,fitViewResolver:P,width:R,height:W,minZoom:B,maxZoom:X}=j();A&&(await k1({nodes:I,width:R,height:W,panZoom:A,minZoom:B,maxZoom:X},V),P==null||P.resolve(!0),C({fitViewResolver:null}))}return{...am({nodes:t,edges:r,width:u,height:f,fitView:d,fitViewOptions:m,minZoom:v,maxZoom:w,nodeOrigin:k,nodeExtent:x,defaultNodes:i,defaultEdges:s,zIndexMode:S}),setNodes:I=>{const{nodeLookup:A,parentLookup:V,nodeOrigin:P,elevateNodesOnSelect:R,fitViewQueued:W,zIndexMode:B,nodesSelectionActive:X}=j(),{nodesInitialized:fe,hasSelectedNodes:pe}=Tf(I,A,V,{nodeOrigin:P,nodeExtent:x,elevateNodesOnSelect:R,checkEquality:!0,zIndexMode:B}),_e=X&&pe;W&&fe?(T(),C({nodes:I,nodesInitialized:fe,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:_e})):C({nodes:I,nodesInitialized:fe,nodesSelectionActive:_e})},setEdges:I=>{const{connectionLookup:A,edgeLookup:V}=j();xg(A,V,I),C({edges:I})},setDefaultNodesAndEdges:(I,A)=>{if(I){const{setNodes:V}=j();V(I),C({hasDefaultNodes:!0})}if(A){const{setEdges:V}=j();V(A),C({hasDefaultEdges:!0})}},updateNodeInternals:I=>{const{triggerNodeChanges:A,nodeLookup:V,parentLookup:P,domNode:R,nodeOrigin:W,nodeExtent:B,debug:X,fitViewQueued:fe,zIndexMode:pe}=j(),{changes:_e,updatedInternals:U}=W1(I,V,P,R,W,B,pe);U&&(V1(V,P,{nodeOrigin:W,nodeExtent:B,zIndexMode:pe}),fe?(T(),C({fitViewQueued:!1,fitViewOptions:void 0})):C({}),(_e==null?void 0:_e.length)>0&&(X&&console.log("React Flow: trigger node changes",_e),A==null||A(_e)))},updateNodePositions:(I,A=!1)=>{const V=[];let P=[];const{nodeLookup:R,triggerNodeChanges:W,connection:B,updateConnection:X,onNodesChangeMiddlewareMap:fe}=j();for(const[pe,_e]of I){const U=R.get(pe),ce=!!(U!=null&&U.expandParent&&(U!=null&&U.parentId)&&(_e!=null&&_e.position)),xe={id:pe,type:"position",position:ce?{x:Math.max(0,_e.position.x),y:Math.max(0,_e.position.y)}:_e.position,dragging:A};if(U&&B.inProgress&&B.fromNode.id===U.id){const D=Fi(U,B.fromHandle,Ze.Left,!0);X({...B,from:D})}ce&&U.parentId&&V.push({id:pe,parentId:U.parentId,rect:{..._e.internals.positionAbsolute,width:_e.measured.width??0,height:_e.measured.height??0}}),P.push(xe)}if(V.length>0){const{parentLookup:pe,nodeOrigin:_e}=j(),U=Gf(V,R,pe,_e);P.push(...U)}for(const pe of fe.values())P=pe(P);W(P)},triggerNodeChanges:I=>{const{onNodesChange:A,setNodes:V,nodes:P,hasDefaultNodes:R,debug:W}=j();if(I!=null&&I.length){if(R){const B=Ag(I,P);V(B)}W&&console.log("React Flow: trigger node changes",I),A==null||A(I)}},triggerEdgeChanges:I=>{const{onEdgesChange:A,setEdges:V,edges:P,hasDefaultEdges:R,debug:W}=j();if(I!=null&&I.length){if(R){const B=Og(I,P);V(B)}W&&console.log("React Flow: trigger edge changes",I),A==null||A(I)}},addSelectedNodes:I=>{const{multiSelectionActive:A,edgeLookup:V,nodeLookup:P,triggerNodeChanges:R,triggerEdgeChanges:W}=j();if(A){const B=I.map(X=>$i(X,!0));R(B);return}R(Es(P,new Set([...I]),!0)),W(Es(V))},addSelectedEdges:I=>{const{multiSelectionActive:A,edgeLookup:V,nodeLookup:P,triggerNodeChanges:R,triggerEdgeChanges:W}=j();if(A){const B=I.map(X=>$i(X,!0));W(B);return}W(Es(V,new Set([...I]))),R(Es(P,new Set,!0))},unselectNodesAndEdges:({nodes:I,edges:A}={})=>{const{edges:V,nodes:P,nodeLookup:R,triggerNodeChanges:W,triggerEdgeChanges:B}=j(),X=I||P,fe=A||V,pe=[];for(const U of X){if(!U.selected)continue;const ce=R.get(U.id);ce&&(ce.selected=!1),pe.push($i(U.id,!1))}const _e=[];for(const U of fe)U.selected&&_e.push($i(U.id,!1));W(pe),B(_e)},setMinZoom:I=>{const{panZoom:A,maxZoom:V}=j();A==null||A.setScaleExtent([I,V]),C({minZoom:I})},setMaxZoom:I=>{const{panZoom:A,minZoom:V}=j();A==null||A.setScaleExtent([V,I]),C({maxZoom:I})},setTranslateExtent:I=>{var A;(A=j().panZoom)==null||A.setTranslateExtent(I),C({translateExtent:I})},resetSelectedElements:()=>{const{edges:I,nodes:A,triggerNodeChanges:V,triggerEdgeChanges:P,elementsSelectable:R}=j();if(!R)return;const W=A.reduce((X,fe)=>fe.selected?[...X,$i(fe.id,!1)]:X,[]),B=I.reduce((X,fe)=>fe.selected?[...X,$i(fe.id,!1)]:X,[]);V(W),P(B)},setNodeExtent:I=>{const{nodes:A,nodeLookup:V,parentLookup:P,nodeOrigin:R,elevateNodesOnSelect:W,nodeExtent:B,zIndexMode:X}=j();I[0][0]===B[0][0]&&I[0][1]===B[0][1]&&I[1][0]===B[1][0]&&I[1][1]===B[1][1]||(Tf(A,V,P,{nodeOrigin:R,nodeExtent:I,elevateNodesOnSelect:W,checkEquality:!1,zIndexMode:X}),C({nodeExtent:I}))},panBy:I=>{const{transform:A,width:V,height:P,panZoom:R,translateExtent:W}=j();return Y1({delta:I,panZoom:R,transform:A,translateExtent:W,width:V,height:P})},setCenter:async(I,A,V)=>{const{width:P,height:R,maxZoom:W,panZoom:B}=j();if(!B)return Promise.resolve(!1);const X=typeof(V==null?void 0:V.zoom)<"u"?V.zoom:W;return await B.setViewport({x:P/2-I*X,y:R/2-A*X,zoom:X},{duration:V==null?void 0:V.duration,ease:V==null?void 0:V.ease,interpolate:V==null?void 0:V.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{C({connection:{...eg}})},updateConnection:I=>{C({connection:I})},reset:()=>C({...am()})}},Object.is);function fS({initialNodes:t,initialEdges:r,defaultNodes:i,defaultEdges:s,initialWidth:u,initialHeight:f,initialMinZoom:d,initialMaxZoom:m,initialFitViewOptions:v,fitView:w,nodeOrigin:k,nodeExtent:x,zIndexMode:S,children:C}){const[j]=ee.useState(()=>cS({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:u,height:f,fitView:w,minZoom:d,maxZoom:m,fitViewOptions:v,nodeOrigin:k,nodeExtent:x,zIndexMode:S}));return b.jsx(Mb,{value:j,children:b.jsx(Jb,{children:C})})}function dS({children:t,nodes:r,edges:i,defaultNodes:s,defaultEdges:u,width:f,height:d,fitView:m,fitViewOptions:v,minZoom:w,maxZoom:k,nodeOrigin:x,nodeExtent:S,zIndexMode:C}){return ee.useContext(Tu)?b.jsx(b.Fragment,{children:t}):b.jsx(fS,{initialNodes:r,initialEdges:i,defaultNodes:s,defaultEdges:u,initialWidth:f,initialHeight:d,fitView:m,initialFitViewOptions:v,initialMinZoom:w,initialMaxZoom:k,nodeOrigin:x,nodeExtent:S,zIndexMode:C,children:t})}const hS={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function pS({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,className:u,nodeTypes:f,edgeTypes:d,onNodeClick:m,onEdgeClick:v,onInit:w,onMove:k,onMoveStart:x,onMoveEnd:S,onConnect:C,onConnectStart:j,onConnectEnd:T,onClickConnectStart:I,onClickConnectEnd:A,onNodeMouseEnter:V,onNodeMouseMove:P,onNodeMouseLeave:R,onNodeContextMenu:W,onNodeDoubleClick:B,onNodeDragStart:X,onNodeDrag:fe,onNodeDragStop:pe,onNodesDelete:_e,onEdgesDelete:U,onDelete:ce,onSelectionChange:xe,onSelectionDragStart:D,onSelectionDrag:le,onSelectionDragStop:Q,onSelectionContextMenu:ie,onSelectionStart:z,onSelectionEnd:K,onBeforeDelete:F,connectionMode:$,connectionLineType:H=li.Bezier,connectionLineStyle:we,connectionLineComponent:Se,connectionLineContainerStyle:Me,deleteKeyCode:$e="Backspace",selectionKeyCode:Ae="Shift",selectionOnDrag:be=!1,selectionMode:Be=Pa.Full,panActivationKeyCode:ke="Space",multiSelectionKeyCode:He=Ta()?"Meta":"Control",zoomActivationKeyCode:Oe=Ta()?"Meta":"Control",snapToGrid:qe,snapGrid:ut,onlyRenderVisibleElements:ct=!1,selectNodesOnDrag:it,nodesDraggable:Tt,autoPanOnNodeFocus:_t,nodesConnectable:Ht,nodesFocusable:Ot,nodeOrigin:St=Ig,edgesFocusable:wn,edgesReconnectable:fn,elementsSelectable:gr=!0,defaultViewport:bn=Vb,minZoom:Nt=.5,maxZoom:Vt=2,translateExtent:Hn=ja,preventScrolling:tr=!0,nodeExtent:_n,defaultMarkerColor:Pn="#b1b1b7",zoomOnScroll:Vn=!0,zoomOnPinch:dn=!0,panOnScroll:nr=!1,panOnScrollSpeed:Sn=.5,panOnScrollMode:Ye=Ri.Free,zoomOnDoubleClick:Un=!0,panOnDrag:kn=!0,onPaneClick:rr,onPaneMouseEnter:Ve,onPaneMouseMove:Mn,onPaneMouseLeave:Kn,onPaneScroll:yr,onPaneContextMenu:Zr,paneClickDistance:vr=1,nodeClickDistance:Io=0,children:eo,onReconnect:Nn,onReconnectStart:Tn,onReconnectEnd:q,onEdgeContextMenu:Fe,onEdgeDoubleClick:Le,onEdgeMouseEnter:nt,onEdgeMouseMove:nn,onEdgeMouseLeave:Yt,reconnectRadius:Ut=10,onNodesChange:rn,onEdgesChange:to,noDragClassName:on="nodrag",noWheelClassName:qn="nowheel",noPanClassName:zt="nopan",fitView:Wn,fitViewOptions:or,connectOnClick:In,attributionPosition:ui,proOptions:ir,defaultEdgeOptions:ci,elevateNodesOnSelect:$o=!0,elevateEdgesOnSelect:Et=!1,disableKeyboardA11y:sr=!1,autoPanOnConnect:gt,autoPanOnNodeDrag:Bi,autoPanSpeed:Dr,connectionRadius:Ao,isValidConnection:Lr,onError:xr,style:fi,id:ar,nodeDragThreshold:En,connectionDragThreshold:ft,viewport:hn,onViewportChange:Hi,width:Oo,height:no,colorMode:ro="light",debug:oo,onScroll:Yn,ariaLabelConfig:yt,zIndexMode:zr="basic",...io},lr){const Fr=ar||"1",so=Wb(ro),ur=ee.useCallback(di=>{di.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Yn==null||Yn(di)},[Yn]);return b.jsx("div",{"data-testid":"rf__wrapper",...io,onScroll:ur,style:{...fi,...hS},ref:lr,className:Wt(["react-flow",u,so]),id:ar,role:"application",children:b.jsxs(dS,{nodes:t,edges:r,width:Oo,height:no,fitView:Wn,fitViewOptions:or,minZoom:Nt,maxZoom:Vt,nodeOrigin:St,nodeExtent:_n,zIndexMode:zr,children:[b.jsx(qb,{nodes:t,edges:r,defaultNodes:i,defaultEdges:s,onConnect:C,onConnectStart:j,onConnectEnd:T,onClickConnectStart:I,onClickConnectEnd:A,nodesDraggable:Tt,autoPanOnNodeFocus:_t,nodesConnectable:Ht,nodesFocusable:Ot,edgesFocusable:wn,edgesReconnectable:fn,elementsSelectable:gr,elevateNodesOnSelect:$o,elevateEdgesOnSelect:Et,minZoom:Nt,maxZoom:Vt,nodeExtent:_n,onNodesChange:rn,onEdgesChange:to,snapToGrid:qe,snapGrid:ut,connectionMode:$,translateExtent:Hn,connectOnClick:In,defaultEdgeOptions:ci,fitView:Wn,fitViewOptions:or,onNodesDelete:_e,onEdgesDelete:U,onDelete:ce,onNodeDragStart:X,onNodeDrag:fe,onNodeDragStop:pe,onSelectionDrag:le,onSelectionDragStart:D,onSelectionDragStop:Q,onMove:k,onMoveStart:x,onMoveEnd:S,noPanClassName:zt,nodeOrigin:St,rfId:Fr,autoPanOnConnect:gt,autoPanOnNodeDrag:Bi,autoPanSpeed:Dr,onError:xr,connectionRadius:Ao,isValidConnection:Lr,selectNodesOnDrag:it,nodeDragThreshold:En,connectionDragThreshold:ft,onBeforeDelete:F,debug:oo,ariaLabelConfig:yt,zIndexMode:zr}),b.jsx(uS,{onInit:w,onNodeClick:m,onEdgeClick:v,onNodeMouseEnter:V,onNodeMouseMove:P,onNodeMouseLeave:R,onNodeContextMenu:W,onNodeDoubleClick:B,nodeTypes:f,edgeTypes:d,connectionLineType:H,connectionLineStyle:we,connectionLineComponent:Se,connectionLineContainerStyle:Me,selectionKeyCode:Ae,selectionOnDrag:be,selectionMode:Be,deleteKeyCode:$e,multiSelectionKeyCode:He,panActivationKeyCode:ke,zoomActivationKeyCode:Oe,onlyRenderVisibleElements:ct,defaultViewport:bn,translateExtent:Hn,minZoom:Nt,maxZoom:Vt,preventScrolling:tr,zoomOnScroll:Vn,zoomOnPinch:dn,zoomOnDoubleClick:Un,panOnScroll:nr,panOnScrollSpeed:Sn,panOnScrollMode:Ye,panOnDrag:kn,onPaneClick:rr,onPaneMouseEnter:Ve,onPaneMouseMove:Mn,onPaneMouseLeave:Kn,onPaneScroll:yr,onPaneContextMenu:Zr,paneClickDistance:vr,nodeClickDistance:Io,onSelectionContextMenu:ie,onSelectionStart:z,onSelectionEnd:K,onReconnect:Nn,onReconnectStart:Tn,onReconnectEnd:q,onEdgeContextMenu:Fe,onEdgeDoubleClick:Le,onEdgeMouseEnter:nt,onEdgeMouseMove:nn,onEdgeMouseLeave:Yt,reconnectRadius:Ut,defaultMarkerColor:Pn,noDragClassName:on,noWheelClassName:qn,noPanClassName:zt,rfId:Fr,disableKeyboardA11y:sr,nodeExtent:_n,viewport:hn,onViewportChange:Hi}),b.jsx(Hb,{onSelectionChange:xe}),eo,b.jsx(Db,{proOptions:ir,position:ui}),b.jsx(Rb,{rfId:Fr,disableKeyboardA11y:sr})]})})}var mS=Rg(pS);function gS(){const t=Mt();return ee.useCallback(r=>{const{domNode:i,updateNodeInternals:s}=t.getState(),u=Array.isArray(r)?r:[r],f=new Map;u.forEach(d=>{const m=i==null?void 0:i.querySelector(`.react-flow__node[data-id="${d}"]`);m&&f.set(d,{id:d,nodeElement:m,force:!0})}),requestAnimationFrame(()=>s(f,{triggerFitView:!1}))},[])}function yS(t){const[r,i]=ee.useState(t),s=ee.useCallback(u=>i(f=>Ag(u,f)),[]);return[r,i,s]}function vS(t){const[r,i]=ee.useState(t),s=ee.useCallback(u=>i(f=>Og(u,f)),[]);return[r,i,s]}function xS({dimensions:t,lineWidth:r,variant:i,className:s}){return b.jsx("path",{strokeWidth:r,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:Wt(["react-flow__background-pattern",i,s])})}function wS({radius:t,className:r}){return b.jsx("circle",{cx:t,cy:t,r:t,className:Wt(["react-flow__background-pattern","dots",r])})}var Po;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Po||(Po={}));const bS={[Po.Dots]:1,[Po.Lines]:1,[Po.Cross]:6},_S=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function s0({id:t,variant:r=Po.Dots,gap:i=20,size:s,lineWidth:u=1,offset:f=0,color:d,bgColor:m,style:v,className:w,patternClassName:k}){const x=ee.useRef(null),{transform:S,patternId:C}=mt(_S,At),j=s||bS[r],T=r===Po.Dots,I=r===Po.Cross,A=Array.isArray(i)?i:[i,i],V=[A[0]*S[2]||1,A[1]*S[2]||1],P=j*S[2],R=Array.isArray(f)?f:[f,f],W=I?[P,P]:V,B=[R[0]*S[2]||1+W[0]/2,R[1]*S[2]||1+W[1]/2],X=`${C}${t||""}`;return b.jsxs("svg",{className:Wt(["react-flow__background",w]),style:{...v,...Iu,"--xy-background-color-props":m,"--xy-background-pattern-color-props":d},ref:x,"data-testid":"rf__background",children:[b.jsx("pattern",{id:X,x:S[0]%V[0],y:S[1]%V[1],width:V[0],height:V[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${B[0]},-${B[1]})`,children:T?b.jsx(wS,{radius:P/2,className:k}):b.jsx(xS,{dimensions:W,lineWidth:u,variant:r,className:k})}),b.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${X})`})]})}s0.displayName="Background";const SS=ee.memo(s0);function kS(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:b.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function NS(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:b.jsx("path",{d:"M0 0h32v4.2H0z"})})}function ES(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:b.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 CS(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:b.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 jS(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:b.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 b.jsx("button",{type:"button",className:Wt(["react-flow__controls-button",r]),...i,children:t})}const PS=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function a0({style:t,showZoom:r=!0,showFitView:i=!0,showInteractive:s=!0,fitViewOptions:u,onZoomIn:f,onZoomOut:d,onFitView:m,onInteractiveChange:v,className:w,children:k,position:x="bottom-left",orientation:S="vertical","aria-label":C}){const j=Mt(),{isInteractive:T,minZoomReached:I,maxZoomReached:A,ariaLabelConfig:V}=mt(PS,At),{zoomIn:P,zoomOut:R,fitView:W}=Jf(),B=()=>{P(),f==null||f()},X=()=>{R(),d==null||d()},fe=()=>{W(u),m==null||m()},pe=()=>{j.setState({nodesDraggable:!T,nodesConnectable:!T,elementsSelectable:!T}),v==null||v(!T)},_e=S==="horizontal"?"horizontal":"vertical";return b.jsxs(Fa,{className:Wt(["react-flow__controls",_e,w]),position:x,style:t,"data-testid":"rf__controls","aria-label":C??V["controls.ariaLabel"],children:[r&&b.jsxs(b.Fragment,{children:[b.jsx(Jl,{onClick:B,className:"react-flow__controls-zoomin",title:V["controls.zoomIn.ariaLabel"],"aria-label":V["controls.zoomIn.ariaLabel"],disabled:A,children:b.jsx(kS,{})}),b.jsx(Jl,{onClick:X,className:"react-flow__controls-zoomout",title:V["controls.zoomOut.ariaLabel"],"aria-label":V["controls.zoomOut.ariaLabel"],disabled:I,children:b.jsx(NS,{})})]}),i&&b.jsx(Jl,{className:"react-flow__controls-fitview",onClick:fe,title:V["controls.fitView.ariaLabel"],"aria-label":V["controls.fitView.ariaLabel"],children:b.jsx(ES,{})}),s&&b.jsx(Jl,{className:"react-flow__controls-interactive",onClick:pe,title:V["controls.interactive.ariaLabel"],"aria-label":V["controls.interactive.ariaLabel"],children:T?b.jsx(jS,{}):b.jsx(CS,{})}),k]})}a0.displayName="Controls";const MS=ee.memo(a0);function TS({id:t,x:r,y:i,width:s,height:u,style:f,color:d,strokeColor:m,strokeWidth:v,className:w,borderRadius:k,shapeRendering:x,selected:S,onClick:C}){const{background:j,backgroundColor:T}=f||{},I=d||j||T;return b.jsx("rect",{className:Wt(["react-flow__minimap-node",{selected:S},w]),x:r,y:i,rx:k,ry:k,width:s,height:u,style:{fill:I,stroke:m,strokeWidth:v},shapeRendering:x,onClick:C?A=>C(A,t):void 0})}const IS=ee.memo(TS),$S=t=>t.nodes.map(r=>r.id),pf=t=>t instanceof Function?t:()=>t;function AS({nodeStrokeColor:t,nodeColor:r,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:u,nodeComponent:f=IS,onClick:d}){const m=mt($S,At),v=pf(r),w=pf(t),k=pf(i),x=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return b.jsx(b.Fragment,{children:m.map(S=>b.jsx(RS,{id:S,nodeColorFunc:v,nodeStrokeColorFunc:w,nodeClassNameFunc:k,nodeBorderRadius:s,nodeStrokeWidth:u,NodeComponent:f,onClick:d,shapeRendering:x},S))})}function OS({id:t,nodeColorFunc:r,nodeStrokeColorFunc:i,nodeClassNameFunc:s,nodeBorderRadius:u,nodeStrokeWidth:f,shapeRendering:d,NodeComponent:m,onClick:v}){const{node:w,x:k,y:x,width:S,height:C}=mt(j=>{const T=j.nodeLookup.get(t);if(!T)return{node:void 0,x:0,y:0,width:0,height:0};const I=T.internals.userNode,{x:A,y:V}=T.internals.positionAbsolute,{width:P,height:R}=To(I);return{node:I,x:A,y:V,width:P,height:R}},At);return!w||w.hidden||!ag(w)?null:b.jsx(m,{x:k,y:x,width:S,height:C,style:w.style,selected:!!w.selected,className:s(w),color:r(w),borderRadius:u,strokeColor:i(w),strokeWidth:f,shapeRendering:d,onClick:v,id:w.id})}const RS=ee.memo(OS);var DS=ee.memo(AS);const LS=200,zS=150,FS=t=>!t.hidden,BS=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?sg(Da(t.nodeLookup,{filter:FS}),r):r,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},HS="react-flow__minimap-desc";function l0({style:t,className:r,nodeStrokeColor:i,nodeColor:s,nodeClassName:u="",nodeBorderRadius:f=5,nodeStrokeWidth:d,nodeComponent:m,bgColor:v,maskColor:w,maskStrokeColor:k,maskStrokeWidth:x,position:S="bottom-right",onClick:C,onNodeClick:j,pannable:T=!1,zoomable:I=!1,ariaLabel:A,inversePan:V,zoomStep:P=1,offsetScale:R=5}){const W=Mt(),B=ee.useRef(null),{boundingRect:X,viewBB:fe,rfId:pe,panZoom:_e,translateExtent:U,flowWidth:ce,flowHeight:xe,ariaLabelConfig:D}=mt(BS,At),le=(t==null?void 0:t.width)??LS,Q=(t==null?void 0:t.height)??zS,ie=X.width/le,z=X.height/Q,K=Math.max(ie,z),F=K*le,$=K*Q,H=R*K,we=X.x-(F-X.width)/2-H,Se=X.y-($-X.height)/2-H,Me=F+H*2,$e=$+H*2,Ae=`${HS}-${pe}`,be=ee.useRef(0),Be=ee.useRef();be.current=K,ee.useEffect(()=>{if(B.current&&_e)return Be.current=rb({domNode:B.current,panZoom:_e,getTransform:()=>W.getState().transform,getViewScale:()=>be.current}),()=>{var qe;(qe=Be.current)==null||qe.destroy()}},[_e]),ee.useEffect(()=>{var qe;(qe=Be.current)==null||qe.update({translateExtent:U,width:ce,height:xe,inversePan:V,pannable:T,zoomStep:P,zoomable:I})},[T,I,V,P,U,ce,xe]);const ke=C?qe=>{var it;const[ut,ct]=((it=Be.current)==null?void 0:it.pointer(qe))||[0,0];C(qe,{x:ut,y:ct})}:void 0,He=j?ee.useCallback((qe,ut)=>{const ct=W.getState().nodeLookup.get(ut).internals.userNode;j(qe,ct)},[]):void 0,Oe=A??D["minimap.ariaLabel"];return b.jsx(Fa,{position:S,style:{...t,"--xy-minimap-background-color-props":typeof v=="string"?v:void 0,"--xy-minimap-mask-background-color-props":typeof w=="string"?w:void 0,"--xy-minimap-mask-stroke-color-props":typeof k=="string"?k:void 0,"--xy-minimap-mask-stroke-width-props":typeof x=="number"?x*K: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:Wt(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:b.jsxs("svg",{width:le,height:Q,viewBox:`${we} ${Se} ${Me} ${$e}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Ae,ref:B,onClick:ke,children:[Oe&&b.jsx("title",{id:Ae,children:Oe}),b.jsx(DS,{onClick:He,nodeColor:s,nodeStrokeColor:i,nodeBorderRadius:f,nodeClassName:u,nodeStrokeWidth:d,nodeComponent:m}),b.jsx("path",{className:"react-flow__minimap-mask",d:`M${we-H},${Se-H}h${Me+H*2}v${$e+H*2}h${-Me-H*2}z
202
+ M${fe.x},${fe.y}h${fe.width}v${fe.height}h${-fe.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}l0.displayName="MiniMap";const VS=ee.memo(l0),US=t=>r=>t?`${Math.max(1/r.transform[2],1)}`:void 0,KS={[Os.Line]:"right",[Os.Handle]:"bottom-right"};function qS({nodeId:t,position:r,variant:i=Os.Handle,className:s,style:u=void 0,children:f,color:d,minWidth:m=10,minHeight:v=10,maxWidth:w=Number.MAX_VALUE,maxHeight:k=Number.MAX_VALUE,keepAspectRatio:x=!1,resizeDirection:S,autoScale:C=!0,shouldResize:j,onResizeStart:T,onResize:I,onResizeEnd:A}){const V=Fg(),P=typeof t=="string"?t:V,R=Mt(),W=ee.useRef(null),B=i===Os.Handle,X=mt(ee.useCallback(US(B&&C),[B,C]),At),fe=ee.useRef(null),pe=r??KS[i];ee.useEffect(()=>{if(!(!W.current||!P))return fe.current||(fe.current=yb({domNode:W.current,nodeId:P,getStoreItems:()=>{const{nodeLookup:U,transform:ce,snapGrid:xe,snapToGrid:D,nodeOrigin:le,domNode:Q}=R.getState();return{nodeLookup:U,transform:ce,snapGrid:xe,snapToGrid:D,nodeOrigin:le,paneDomNode:Q}},onChange:(U,ce)=>{const{triggerNodeChanges:xe,nodeLookup:D,parentLookup:le,nodeOrigin:Q}=R.getState(),ie=[],z={x:U.x,y:U.y},K=D.get(P);if(K&&K.expandParent&&K.parentId){const F=K.origin??Q,$=U.width??K.measured.width??0,H=U.height??K.measured.height??0,we={id:K.id,parentId:K.parentId,rect:{width:$,height:H,...lg({x:U.x??K.position.x,y:U.y??K.position.y},{width:$,height:H},K.parentId,D,F)}},Se=Gf([we],D,le,Q);ie.push(...Se),z.x=U.x?Math.max(F[0]*$,U.x):void 0,z.y=U.y?Math.max(F[1]*H,U.y):void 0}if(z.x!==void 0&&z.y!==void 0){const F={id:P,type:"position",position:{...z}};ie.push(F)}if(U.width!==void 0&&U.height!==void 0){const $={id:P,type:"dimensions",resizing:!0,setAttributes:S?S==="horizontal"?"width":"height":!0,dimensions:{width:U.width,height:U.height}};ie.push($)}for(const F of ce){const $={...F,type:"position"};ie.push($)}xe(ie)},onEnd:({width:U,height:ce})=>{const xe={id:P,type:"dimensions",resizing:!1,dimensions:{width:U,height:ce}};R.getState().triggerNodeChanges([xe])}})),fe.current.update({controlPosition:pe,boundaries:{minWidth:m,minHeight:v,maxWidth:w,maxHeight:k},keepAspectRatio:x,resizeDirection:S,onResizeStart:T,onResize:I,onResizeEnd:A,shouldResize:j}),()=>{var U;(U=fe.current)==null||U.destroy()}},[pe,m,v,w,k,x,T,I,A,j]);const _e=pe.split("-");return b.jsx("div",{className:Wt(["react-flow__resize-control","nodrag",..._e,i,s]),ref:W,style:{...u,scale:X,...d&&{[B?"backgroundColor":"borderColor"]:d}},children:f})}ee.memo(qS);const WS={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 iu({method:t,className:r="",size:i="sm"}){const s=t.toLowerCase().trim(),u=WS[s]??"bg-accent/15 text-accent border-accent/40",f=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 b.jsx("span",{className:`inline-flex items-center rounded-md font-semibold uppercase tracking-wide border shrink-0 ${u} ${f} ${r}`,children:t.toUpperCase()})}function ed(t,r,i){var f,d;const s=r.toLowerCase(),u=(d=(f=t.paths)==null?void 0:f[i])==null?void 0:d[s];return(u==null?void 0:u.summary)??(u==null?void 0:u.operationId)??`${r.toUpperCase()} ${i}`}function td(t,r,i){var m,v,w,k;const s=r.toLowerCase(),u=(v=(m=t.paths)==null?void 0:m[i])==null?void 0:v[s];if(!(u!=null&&u.requestBody))return"— sin body";const d=(k=(w=u.requestBody.content)==null?void 0:w["application/json"])==null?void 0:k.schema;return d&&"$ref"in d?`body: ${d.$ref}`:"body: JSON"}function nd(t,r,i){var m,v,w,k,x,S;const s=r.toLowerCase(),u=(v=(m=t.paths)==null?void 0:m[i])==null?void 0:v[s],f=((w=u==null?void 0:u.responses)==null?void 0:w["200"])??((k=u==null?void 0:u.responses)==null?void 0:k["201"]);if(!f)return"—";const d=typeof f=="object"&&f&&"content"in f?(S=(x=f.content)==null?void 0:x["application/json"])==null?void 0:S.schema:void 0;return d&&"$ref"in d?String(d.$ref):"JSON"}const su=()=>({sourceJsonPath:"$",variableName:"v",useInTarget:"vars_only",targetKey:""});function mf(t,r){return`${t.toLowerCase()} ${r}`}function YS(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}const u0=ee.createContext(null);function XS(t){const{id:r,selected:i}=t,s=t.data,u=ee.useContext(u0),f=gS();return ee.useEffect(()=>{f(r)},[s.path,s.method,r,f]),b.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:[b.jsx(Rs,{type:"target",position:Ze.Left,id:"in",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-teal-500"}),b.jsxs("div",{className:"flex items-center gap-2 mb-1 min-w-0",children:[b.jsx(iu,{method:s.method}),b.jsx("span",{className:"text-[10px] text-slate-500 truncate",title:s.summary,children:s.summary})]}),u?b.jsxs("label",{className:"block text-[10px] text-slate-500 mb-1",children:["Endpoint",b.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:mf(s.method,s.path),onChange:d=>{const{method:m,path:v}=YS(d.target.value);u.updateNodeData(r,{method:m,path:v,summary:ed(u.doc,m,v),reqHint:td(u.doc,m,v),resHint:nd(u.doc,m,v)})},children:u.ops.map(d=>b.jsxs("option",{value:mf(d.method,d.path),children:[d.method.toUpperCase()," ",d.path]},mf(d.method,d.path)))})]}):b.jsx("p",{className:"font-mono text-[11px] text-slate-300 truncate",children:s.path}),b.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-1 text-[9px] text-slate-500 leading-tight",children:[b.jsxs("div",{children:[b.jsx("span",{className:"text-slate-600",children:"req"})," ",s.reqHint]}),b.jsxs("div",{children:[b.jsx("span",{className:"text-slate-600",children:"res"})," ",s.resHint]})]}),b.jsx(Rs,{type:"source",position:Ze.Right,id:"out",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-amber-500"})]})}const QS={apiOp:XS};function GS(t,r){const i=r.nodes.map(u=>({id:u.id,type:"apiOp",position:{x:u.x,y:u.y},data:{method:u.method.toLowerCase(),path:u.path,summary:ed(t,u.method,u.path),reqHint:td(t,u.method,u.path),resHint:nd(t,u.method,u.path)}})),s=r.edges.map(u=>({id:u.id,source:u.source,target:u.target,sourceHandle:"out",targetHandle:"in",data:{mapping:{...u.mapping}},label:u.mapping.variableName,style:{stroke:"rgb(148 163 184 / 0.9)",strokeWidth:2}}));return{nodes:i,edges:s}}function JS(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)??su()}})}}const ZS=[{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 ek({doc:t,ops:r,graph:i,onGraphChange:s}){var P,R,W,B,X,fe,pe,_e;const u=ee.useMemo(()=>GS(t,i),[t,i]),[f,d,m]=yS(u.nodes),[v,w,k]=vS(u.edges),[x,S]=ee.useState(null);ee.useEffect(()=>{s(JS(f,v))},[f,v,s]);const C=ee.useCallback((U,ce)=>{d(xe=>xe.map(D=>D.id===U?{...D,data:{...D.data,...ce}}:D))},[d]),j=ee.useMemo(()=>({doc:t,ops:r,updateNodeData:C}),[t,r,C]),T=ee.useCallback(U=>{U.sourceHandle!=="out"||U.targetHandle!=="in"||w(ce=>mg({...U,id:`e-${U.source}-${U.target}-${crypto.randomUUID().slice(0,8)}`,sourceHandle:"out",targetHandle:"in",data:{mapping:su()},label:su().variableName,style:{stroke:"rgb(148 163 184 / 0.9)",strokeWidth:2}},ce))},[w]),I=v.find(U=>U.id===x),A=U=>{x&&w(ce=>ce.map(xe=>{var le;if(xe.id!==x)return xe;const D={...((le=xe.data)==null?void 0:le.mapping)??su(),...U};return{...xe,data:{mapping:D},label:D.variableName}}))},V=()=>{const U=f.reduce((ie,z)=>z.position.x>ie?z.position.x:ie,0),ce=r[0];if(!ce)return;const xe=crypto.randomUUID(),D=U>0?U+40:80,Q={id:xe,type:"apiOp",position:{x:D,y:120},data:{method:ce.method.toLowerCase(),path:ce.path,summary:ed(t,ce.method,ce.path),reqHint:td(t,ce.method,ce.path),resHint:nd(t,ce.method,ce.path)}};d(ie=>[...ie,Q])};return b.jsx(u0.Provider,{value:j,children:b.jsxs("div",{className:"space-y-3",children:[b.jsx("div",{className:"h-[min(520px,70vh)] w-full rounded-xl border border-surface-700 bg-surface-950",children:b.jsxs(mS,{nodes:f,edges:v,onNodesChange:m,onEdgesChange:k,onConnect:T,nodeTypes:QS,onEdgeClick:(U,ce)=>S(ce.id),onPaneClick:()=>S(null),fitView:!0,minZoom:.4,maxZoom:1.5,proOptions:{hideAttribution:!0},isValidConnection:U=>U.sourceHandle==="out"&&U.targetHandle==="in",children:[b.jsx(SS,{variant:Po.Dots,gap:16,size:1,color:"rgb(51 65 85 / 0.5)"}),b.jsx(MS,{className:"!bg-surface-900 !border-surface-600 !shadow-lg"}),b.jsx(VS,{className:"!bg-surface-900/95 !border-surface-600",nodeColor:()=>"rgb(45 212 191 / 0.5)"}),b.jsx(Fa,{position:"top-left",children:b.jsx("button",{type:"button",onClick:V,className:"text-xs px-3 py-2 rounded-lg bg-accent/90 text-surface-950 font-medium shadow",children:"+ Nodo (endpoint)"})})]})}),b.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[b.jsx("h4",{className:"text-xs font-semibold text-slate-300",children:"Cable seleccionado (respuesta → request)"}),I?b.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs",children:[b.jsxs("label",{className:"text-slate-500",children:["JSON path en la respuesta",b.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:((P=I.data)==null?void 0:P.mapping.sourceJsonPath)??"$",onChange:U=>A({sourceJsonPath:U.target.value}),placeholder:"$.access_token"})]}),b.jsxs("label",{className:"text-slate-500",children:["Nombre de variable",b.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5",value:((R=I.data)==null?void 0:R.mapping.variableName)??"",onChange:U=>A({variableName:U.target.value}),placeholder:"token"})]}),b.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Cómo se usa en el request del nodo destino",b.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5",value:((W=I.data)==null?void 0:W.mapping.useInTarget)??"vars_only",onChange:U=>A({useInTarget:U.target.value}),children:ZS.map(U=>b.jsx("option",{value:U.value,children:U.label},U.value))})]}),(((B=I.data)==null?void 0:B.mapping.useInTarget)==="path_param"||((X=I.data)==null?void 0:X.mapping.useInTarget)==="header"||((fe=I.data)==null?void 0:fe.mapping.useInTarget)==="query")&&b.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Clave (nombre del param / header / query)",b.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:((pe=I.data)==null?void 0:pe.mapping.targetKey)??"",onChange:U=>A({targetKey:U.target.value}),placeholder:"id / Authorization / q"})]}),b.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"," ",b.jsx("code",{className:"text-accent",children:"{clave}"}),", en un header, o en query. Con «solo variable», usa"," ",b.jsx("code",{className:"text-accent",children:"{"+(((_e=I.data)==null?void 0:_e.mapping.variableName)||"var")+"}"})," ","en la ruta del endpoint destino."]})]}):b.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 c0(t,r){const i=new Map(t.map(v=>[v.id,v])),s=new Set(t.map(v=>v.id)),u=new Map,f=new Map;for(const v of s)u.set(v,0),f.set(v,[]);for(const v of r)!s.has(v.source)||!s.has(v.target)||(u.set(v.target,(u.get(v.target)??0)+1),f.get(v.source).push(v.target));const d=[];for(const[v,w]of u)w===0&&d.push(v);d.sort((v,w)=>i.get(v).x-i.get(w).x||i.get(v).y-i.get(w).y);const m=[];for(;d.length;){const v=d.shift();m.push(v);for(const w of f.get(v)??[]){const k=(u.get(w)??0)-1;u.set(w,k),k===0&&(d.push(w),d.sort((x,S)=>i.get(x).x-i.get(S).x||i.get(x).y-i.get(S).y))}}if(m.length<t.length){const v=t.filter(w=>!m.includes(w.id)).sort((w,k)=>w.x-k.x||w.y-k.y);return[...m.map(w=>i.get(w)),...v]}return m.map(v=>i.get(v))}async function lm(t,r,i){var v;const{nodes:s,edges:u}=t;if(s.length===0)return"Sin nodos en el flujo.";const f=c0(s,u),d={};let m="";for(let w=0;w<f.length;w++){const k=f[w];let x=k.path;const S={...i()},C=u.filter(W=>W.target===k.id);for(const W of C){const{mapping:B}=W,X=d[B.variableName];if(X!==void 0)switch(B.useInTarget){case"path_param":B.targetKey&&(x=x.split(`{${B.targetKey}}`).join(X));break;case"header":if(B.targetKey){const fe=B.targetKey;S[fe]=fe.toLowerCase()==="authorization"&&!X.startsWith("Bearer ")?`Bearer ${X}`:X}break;case"query":{const fe=x.includes("?")?"&":"?";x=`${x}${fe}${encodeURIComponent(B.targetKey)}=${encodeURIComponent(X)}`;break}case"vars_only":default:x=x.split(`{${B.variableName}}`).join(X);break}}for(const[W,B]of Object.entries(d))x=x.split(`{${W}}`).join(B);const j=`${r.replace(/\/$/,"")}${x}`,T={method:k.method.toUpperCase(),headers:S},I=k.method.toLowerCase();I!=="get"&&I!=="head"&&(T.body="{}");const A=await fetch(j,{...T,credentials:"include"});let V={};const P=await A.text();try{V=P?JSON.parse(P):{}}catch{V={_raw:P}}m+=`▸ ${k.method.toUpperCase()} ${k.path} → ${A.status}
203
+ ${JSON.stringify(V,null,2)}
204
+
205
+ `;const R=u.filter(W=>W.source===k.id);for(const W of R){const B=((v=W.mapping.sourceJsonPath)==null?void 0:v.trim())||"$",X=Of(V,B);X!=null&&(d[W.mapping.variableName]=typeof X=="object"?JSON.stringify(X):String(X))}}return m+=`
206
+ Variables finales: ${JSON.stringify(d,null,2)}`,m}function tk(t){const r=c0(t.nodes,t.edges);return r.map((i,s)=>{const u=r[s+1];if(!u)return{method:i.method,path:i.path};const f=t.edges.find(d=>d.source===i.id&&d.target===u.id);return f?{method:i.method,path:i.path,extract:{varName:f.mapping.variableName,jsonPath:f.mapping.sourceJsonPath||"$"}}:{method:i.method,path:i.path}})}function nk(t){var s;const r=t.map((u,f)=>({id:`n-${f}`,method:u.method,path:u.path,x:40+f*300,y:120})),i=[];for(let u=0;u<t.length-1;u++){const f=(s=t[u])==null?void 0:s.extract;f!=null&&f.jsonPath&&i.push({id:`e-${u}`,source:`n-${u}`,target:`n-${u+1}`,mapping:{sourceJsonPath:f.jsonPath,variableName:f.varName,useInTarget:"vars_only",targetKey:""}})}return{nodes:r,edges:i}}const f0=ee.createContext({productName:null,logoDataUrl:null});function rk({value:t,children:r}){return b.jsx(f0.Provider,{value:t,children:r})}function ok(){return ee.useContext(f0)}function ik({data:t,defaultOpenDepth:r=3}){return b.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:b.jsx(rd,{value:t,depth:0,defaultOpenDepth:r})})}function rd({value:t,depth:r,defaultOpenDepth:i,name:s}){return t===null||typeof t!="object"?b.jsx(sk,{name:s,value:t}):Array.isArray(t)?b.jsx(ak,{name:s,value:t,depth:r,defaultOpenDepth:i}):b.jsx(lk,{name:s,value:t,depth:r,defaultOpenDepth:i})}function sk({name:t,value:r}){return b.jsxs("div",{className:"pl-1 break-all",children:[t!=null&&b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),b.jsx("span",{className:"text-slate-500",children:": "})]}),b.jsx("span",{className:"text-emerald-200/95",children:JSON.stringify(r)})]})}function ak({name:t,value:r,depth:i,defaultOpenDepth:s}){const u=i<s,[f,d]=ee.useState(u);return r.length===0?b.jsxs("div",{className:"pl-1",children:[t!=null&&b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),b.jsx("span",{className:"text-slate-500",children:": "})]}),b.jsx("span",{className:"text-slate-500",children:"[]"})]}):b.jsxs("div",{className:"pl-1",children:[t!=null&&b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),b.jsx("span",{className:"text-slate-500",children:": "})]}),b.jsx("button",{type:"button","aria-expanded":f,onClick:()=>d(!f),className:"inline align-middle text-slate-400 hover:text-slate-200 mr-1 select-none w-4",children:f?"▼":"▶"}),b.jsx("span",{className:"text-slate-500",children:"["}),b.jsx("span",{className:"text-slate-600 text-[10px] ml-1",children:r.length}),f&&b.jsx("ul",{className:"list-none my-0.5 ml-4 border-l border-surface-600 pl-2 space-y-0.5",children:r.map((m,v)=>b.jsxs("li",{children:[b.jsx("span",{className:"text-violet-400/90 mr-1",children:v}),b.jsx(rd,{value:m,depth:i+1,defaultOpenDepth:s})]},v))}),!f&&b.jsx("span",{className:"text-slate-600",children:" … "}),b.jsx("span",{className:"text-slate-500",children:"]"})]})}function lk({name:t,value:r,depth:i,defaultOpenDepth:s}){const u=Object.keys(r),f=i<s,[d,m]=ee.useState(f);return u.length===0?b.jsxs("div",{className:"pl-1",children:[t!=null&&b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),b.jsx("span",{className:"text-slate-500",children:": "})]}),b.jsx("span",{className:"text-slate-500",children:"{}"})]}):b.jsxs("div",{className:"pl-1",children:[t!=null&&b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),b.jsx("span",{className:"text-slate-500",children:": "})]}),b.jsx("button",{type:"button","aria-expanded":d,onClick:()=>m(!d),className:"inline align-middle text-slate-400 hover:text-slate-200 mr-1 select-none w-4",children:d?"▼":"▶"}),b.jsx("span",{className:"text-slate-500",children:"{"}),b.jsx("span",{className:"text-slate-600 text-[10px] ml-1",children:u.length}),d&&b.jsx("ul",{className:"list-none my-0.5 ml-4 border-l border-surface-600 pl-2 space-y-0.5",children:u.map(v=>b.jsx("li",{children:b.jsx(rd,{name:v,value:r[v],depth:i+1,defaultOpenDepth:s})},v))}),!d&&b.jsx("span",{className:"text-slate-600",children:" … "}),b.jsx("span",{className:"text-slate-500",children:"}"})]})}function od(t,r){if(!r.startsWith("#/"))return;const i=r.slice(2).split("/");let s=t;for(const u of i)if(s&&typeof s=="object"&&u in s)s=s[u];else return;return s}function uk(t,r){return"$ref"in r?od(t,r.$ref):r}function um(t,r){return"$ref"in r?od(t,r.$ref):r}function ck(t,r,i){var w;const s=(w=t.paths)==null?void 0:w[i],u=s==null?void 0:s[r.toLowerCase()];if(!u)return[];const f=(s==null?void 0:s.parameters)??[],d=u.parameters??[],m=new Set,v=[];for(const k of[...f,...d]){const x=uk(t,k);if(!x||!["query","path","header","cookie"].includes(x.in))continue;const S=`${x.in}:${x.name}`;m.has(S)||(m.add(S),v.push({name:x.name,in:x.in,required:!!x.required,description:typeof x.description=="string"?x.description:void 0}))}return v}function cm(t,r,i){var v,w,k,x;const s=(w=(v=t.paths)==null?void 0:v[i])==null?void 0:w[r.toLowerCase()];if(!(s!=null&&s.requestBody))return null;const u=s.requestBody,f="$ref"in u?od(t,u.$ref):u;if(!((x=(k=f==null?void 0:f.content)==null?void 0:k["application/json"])!=null&&x.schema))return null;const d=f.content["application/json"].schema,m=um(t,d);if(!m)return null;if(m.type==="object"&&m.properties&&Object.keys(m.properties).length>0){const S=new Set(m.required??[]);return Object.keys(m.properties).map(C=>{const j=m.properties[C],T=j&&"$ref"in j?um(t,j):j;return{key:C,required:S.has(C),description:T==null?void 0:T.description,format:T==null?void 0:T.format,type:T==null?void 0:T.type}})}return null}function fk(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function dk(t,r){let i=t;for(const[s,u]of Object.entries(r))i=i.replace(new RegExp(`\\{${fk(s)}\\}`,"g"),encodeURIComponent(u));return i}function hk(t,r){const i=new URLSearchParams;for(const u of r){if(u.in!=="query")continue;const f=t[u.name];f!==void 0&&f!==""&&i.set(u.name,f)}const s=i.toString();return s?`?${s}`:""}function d0(t,r){var s;if(!(t!=null&&t.length))return{};const i={};for(const u of t){const f=((s=r[u.key])==null?void 0:s.trim())??"";if(f==="")continue;const d=u.type;if(d==="integer"||d==="number"){const m=Number(f);i[u.key]=Number.isFinite(m)?m:f}else if(d==="boolean")i[u.key]=f==="true"||f==="1";else try{i[u.key]=JSON.parse(f)}catch{i[u.key]=f}}return i}function fm(t,r){const i=d0(t,r);return JSON.stringify(i,null,2)}function pk(t,r){if(!(t!=null&&t.length))return{};try{const i=JSON.parse(r||"{}"),s={};for(const u of t)if(u.key in i&&i[u.key]!==void 0){const f=i[u.key];s[u.key]=typeof f=="string"?f:JSON.stringify(f)}else s[u.key]="";return s}catch{return Object.fromEntries(t.map(i=>[i.key,""]))}}function mk(t){return/\{[^/}]+\}/.test(t)}function gk(t,r,i,s,u){var m,v;const f={...t};for(const w of r){const k=(m=i[w.name])==null?void 0:m.trim();k&&(f[w.name]=k)}const d=[];for(const w of s){const k=(v=u[w.name])==null?void 0:v.trim();k&&d.push(`${w.name}=${k}`)}return d.length&&(f.Cookie=f.Cookie?`${f.Cookie}; ${d.join("; ")}`:d.join("; ")),f}function yk({doc:t,selectedOp:r,baseUrl:i,buildHeaders:s}){const[u,f]=ee.useState({}),[d,m]=ee.useState({}),[v,w]=ee.useState({}),[k,x]=ee.useState({}),[S,C]=ee.useState({}),[j,T]=ee.useState("{}"),[I,A]=ee.useState("raw"),[V,P]=ee.useState(null),[R,W]=ee.useState(null),B=ee.useMemo(()=>ck(t,r.method,r.path),[t,r.method,r.path]),X=ee.useMemo(()=>B.filter(F=>F.in==="path"),[B]),fe=ee.useMemo(()=>B.filter(F=>F.in==="query"),[B]),pe=ee.useMemo(()=>B.filter(F=>F.in==="header"),[B]),_e=ee.useMemo(()=>B.filter(F=>F.in==="cookie"),[B]),U=ee.useMemo(()=>cm(t,r.method,r.path),[t,r.method,r.path]),ce=r.method.toLowerCase(),xe=ce!=="get"&&ce!=="head";ee.useEffect(()=>{f({}),m({}),w({}),x({}),W(null),P(null);const F=cm(t,r.method,r.path);F!=null&&F.length?(C(Object.fromEntries(F.map($=>[$.key,""]))),A("fields"),T(fm(F,{}))):(C({}),A("raw"),T("{}"))},[t,r.method,r.path]);const D=ee.useCallback((F,$)=>{C(H=>({...H,[F]:$}))},[]),le=ee.useCallback(()=>{U!=null&&U.length&&T(fm(U,S)),A("raw")},[U,S]),Q=ee.useCallback(()=>{U!=null&&U.length&&C(pk(U,j)),A("fields")},[U,j]),ie=async()=>{var $e,Ae,be,Be,ke;W(null);const F=ks(t,i);for(const He of X)if(He.required&&!(($e=u[He.name])!=null&&$e.trim())){W(`Parámetro de ruta obligatorio: ${He.name}`);return}for(const He of fe)if(He.required&&!((Ae=d[He.name])!=null&&Ae.trim())){W(`Query obligatorio: ${He.name}`);return}for(const He of pe)if(He.required&&!((be=v[He.name])!=null&&be.trim())){W(`Header obligatorio: ${He.name}`);return}for(const He of _e)if(He.required&&!((Be=k[He.name])!=null&&Be.trim())){W(`Cookie obligatorio: ${He.name}`);return}let $=dk(r.path,u);if(mk($)){W("Quedan placeholders `{…}` en la ruta sin valor.");return}const H=hk(d,B),we=`${F}${$}${H}`,Se=gk(s(),pe,v,_e,k),Me={method:r.method.toUpperCase(),headers:Se,credentials:"include"};if(xe)if(I==="fields"&&(U!=null&&U.length)){for(const Oe of U)if(Oe.required&&!((ke=S[Oe.key])!=null&&ke.trim())){W(`Campo de body obligatorio: ${Oe.key}`);return}const He=d0(U,S);Me.body=JSON.stringify(He)}else{const He=j.trim()||"{}";Me.body=He}try{const He=await fetch(we,Me),Oe=await He.text();let qe=null;try{qe=Oe?JSON.parse(Oe):null}catch{qe=null}P({status:He.status,statusText:He.statusText,bodyText:Oe,json:qe})}catch(He){P(null),W(He instanceof Error?He.message:String(He))}},z=(F,$,H)=>b.jsxs("label",{className:"block text-xs",children:[b.jsxs("span",{className:"text-slate-400",children:[F.name,F.required?b.jsx("span",{className:"text-rose-400/90",children:" *"}):null,F.in!=="path"?b.jsxs("span",{className:"text-slate-600 ml-1",children:["(",F.in,")"]}):null]}),b.jsx("input",{type:"text",className:"mt-0.5 w-full bg-surface-900 border border-surface-600 rounded-lg px-2 py-1.5 font-mono text-[11px] text-slate-200",value:$[F.name]??"",onChange:we=>H(Se=>({...Se,[F.name]:we.target.value})),placeholder:F.description||(F.in==="path"?`{${F.name}}`:""),autoComplete:"off"})]},`${F.in}:${F.name}`),K=F=>b.jsxs("label",{className:"block text-xs",children:[b.jsxs("span",{className:"text-slate-400",children:[F.key,F.required?b.jsx("span",{className:"text-rose-400/90",children:" *"}):null,F.type?b.jsxs("span",{className:"text-slate-600 ml-1",children:["(",F.type,")"]}):null]}),b.jsx("input",{type:"text",className:"mt-0.5 w-full bg-surface-900 border border-surface-600 rounded-lg px-2 py-1.5 font-mono text-[11px] text-slate-200",value:S[F.key]??"",onChange:$=>D(F.key,$.target.value),placeholder:F.description||"valor o JSON para objetos anidados",autoComplete:"off"})]},F.key);return b.jsxs("section",{className:"space-y-3",children:[b.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Probar"}),(X.length>0||fe.length>0||pe.length>0||_e.length>0)&&b.jsxs("div",{className:"space-y-2 rounded-lg border border-surface-700 bg-surface-900/40 p-3",children:[b.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:"Parámetros"}),b.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[X.map(F=>z(F,u,f)),fe.map(F=>z(F,d,m)),pe.map(F=>z(F,v,w)),_e.map(F=>z(F,k,x))]})]}),xe&&b.jsxs("div",{className:"space-y-2",children:[b.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[b.jsx("span",{className:"text-xs text-slate-400",children:"Body"}),U!=null&&U.length?b.jsxs("div",{className:"flex rounded-lg border border-surface-600 overflow-hidden text-xs",children:[b.jsx("button",{type:"button",className:`px-3 py-1 ${I==="fields"?"bg-accent/25 text-accent":"bg-surface-800 text-slate-400"}`,onClick:Q,children:"Campos"}),b.jsx("button",{type:"button",className:`px-3 py-1 ${I==="raw"?"bg-accent/25 text-accent":"bg-surface-800 text-slate-400"}`,onClick:le,children:"JSON raw"})]}):b.jsx("span",{className:"text-[10px] text-slate-500",children:"(solo JSON — sin propiedades `object` en el spec)"})]}),I==="fields"&&(U!=null&&U.length)?b.jsx("div",{className:"grid gap-2 sm:grid-cols-2 rounded-lg border border-surface-700 bg-surface-900/40 p-3",children:U.map(F=>K(F))}):b.jsx("textarea",{className:"w-full h-28 bg-surface-900 border border-surface-600 rounded-lg p-3 font-mono text-xs",value:j,onChange:F=>T(F.target.value),placeholder:'{"key": "value"}',spellCheck:!1})]}),R&&b.jsx("p",{className:"text-xs text-rose-400/95 bg-rose-950/30 border border-rose-800/50 rounded-lg px-2 py-1.5",children:R}),b.jsx("button",{type:"button",onClick:()=>void ie(),className:"px-4 py-2 rounded-lg bg-accent text-surface-950 font-medium text-sm",children:"Ejecutar"}),b.jsxs("div",{className:"space-y-2",children:[b.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:"Respuesta"}),V?b.jsxs(b.Fragment,{children:[b.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:[b.jsx("span",{className:V.status>=200&&V.status<300?"text-emerald-400":V.status>=400?"text-rose-400":"text-amber-300",children:V.status})," ",V.statusText]}),V.json!==null?b.jsx(ik,{data:V.json,defaultOpenDepth:3}):b.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:V.bodyText||"—"})]}):b.jsx("p",{className:"text-xs text-slate-500",children:"—"})]})]})}function vk(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 xk(t){return b.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:[b.jsx("circle",{cx:"11",cy:"11",r:"8"}),b.jsx("path",{d:"m21 21-4.3-4.3"})]})}function wk(t){return b.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:[b.jsx("circle",{cx:"18",cy:"5",r:"3"}),b.jsx("circle",{cx:"6",cy:"12",r:"3"}),b.jsx("circle",{cx:"18",cy:"19",r:"3"}),b.jsx("path",{d:"m8.59 13.51 6.83 3.98"}),b.jsx("path",{d:"m15.41 6.51-6.82 3.98"})]})}function bk(t){return b.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:[b.jsx("path",{d:"M9 11l3 3L22 4"}),b.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})}function _k(t){return b.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:[b.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),b.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}function Sk(t){return b.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:[b.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),b.jsx("polyline",{points:"7 10 12 15 17 10"}),b.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function kk(t){return b.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:[b.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),b.jsx("polyline",{points:"17 8 12 3 7 8"}),b.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]})}function Nk(t){return b.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:[b.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),b.jsx("polyline",{points:"16 17 21 12 16 7"}),b.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]})}function dm(t){return b.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:[b.jsx("path",{d:"M15 3h6v6"}),b.jsx("path",{d:"M9 21H3v-6"}),b.jsx("path",{d:"M21 3l-7 7"}),b.jsx("path",{d:"M3 21l7-7"})]})}const h0=[{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 h0.some(r=>r.value===t)}const gf=[{id:"typescript",label:"TypeScript"},{id:"javascript",label:"JavaScript"},{id:"python",label:"Python"},{id:"php",label:"PHP"}];function yf(t,r){return`${t.toLowerCase()} ${r}`}function Ek(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}async function pm(t){await navigator.clipboard.writeText(t)}function Ck(){var Tn;const t=ok(),[r,i]=ee.useState(null),[s,u]=ee.useState(null),[f,d]=ee.useState("explore"),[m,v]=ee.useState(""),[w,k]=ee.useState(null),[x,S]=ee.useState(null),[C,j]=ee.useState("typescript"),[T,I]=ee.useState(""),[A,V]=ee.useState(""),[P,R]=ee.useState("X-Api-Key"),[W,B]=ee.useState({nodes:[],edges:[]}),[X,fe]=ee.useState(0),[pe,_e]=ee.useState("Mi flujo"),[U,ce]=ee.useState([]),[xe,D]=ee.useState(""),[le,Q]=ee.useState({name:"Suite 1",cases:[]}),[ie,z]=ee.useState([]),[K,F]=ee.useState(""),[$,H]=ee.useState(""),[we,Se]=ee.useState(null),[Me,$e]=ee.useState(null),[Ae,be]=ee.useState(null),Be=(q,Fe)=>{try{const Le=sessionStorage.getItem(q);if(Le==="1")return!0;if(Le==="0")return!1}catch{}return Fe},[ke,He]=ee.useState(()=>Be("adt-collapse-main",!1)),[Oe,qe]=ee.useState(()=>Be("adt-collapse-explore",!1)),ut="/docs/openapi.json",ct="/docs/preset.json",it=ee.useCallback(async()=>{const[q,Fe]=await Promise.all([bt.flows.toArray(),bt.testSuites.toArray()]);ce(q.sort((Le,nt)=>(Le.name??"").localeCompare(nt.name??""))),z(Fe.sort((Le,nt)=>(Le.name??"").localeCompare(nt.name??"")))},[]);ee.useEffect(()=>{var Fe,Le;if(!r)return;const q=((Fe=t.productName)==null?void 0:Fe.trim())||((Le=r.info.title)==null?void 0:Le.trim())||"API";document.title=q},[r,t.productName]),ee.useEffect(()=>{fetch(ut,{credentials:"include"}).then(async q=>{if(q.status===401){let Fe="/docs/__auth/login";try{const Le=await q.json();Le.loginPath&&(Fe=Le.loginPath)}catch{}return window.location.href=Fe,null}if(!q.ok)throw new Error(`${q.status} ${q.statusText}`);return q.json()}).then(q=>{q&&(i(q),v(ks(q)),u(null))}).catch(q=>u(q.message))},[ut]),ee.useEffect(()=>{try{sessionStorage.setItem("adt-collapse-main",ke?"1":"0")}catch{}},[ke]),ee.useEffect(()=>{try{sessionStorage.setItem("adt-collapse-explore",Oe?"1":"0")}catch{}},[Oe]),ee.useEffect(()=>{(async()=>{try{const q=await fetch("/docs/__auth/session",{credentials:"include"});if(q.ok){const Fe=await q.json();be({username:Fe.username})}else be(null)}catch{be(null)}})()},[]),ee.useEffect(()=>{if(!r)return;let q=!1;return(async()=>{try{const Fe=await fetch(ct,{credentials:"include"});if(!Fe.ok||q)return;const Le=await Fe.json(),nt=await zy(Le);!q&&nt&&await it()}catch{}})(),()=>{q=!0}},[r,ct,it]),ee.useEffect(()=>{it(),bt.kv.get("bearer").then(q=>q&&I(q.value)),bt.kv.get("apiKey").then(q=>q&&V(q.value))},[it]);const Tt=ee.useMemo(()=>r?Iy(r):[],[r]),_t=ee.useMemo(()=>r?Gr(r):[],[r]),Ht=ee.useMemo(()=>w?_t.filter(q=>(q.tags??["default"]).includes(w)):_t,[_t,w]);ee.useEffect(()=>{if(_t.length&&!$){const q=_t[0];H(yf(q.method,q.path))}},[_t,$]),ee.useEffect(()=>{if(_t.length===0||W.nodes.length>0||f!=="flows"||we!=null)return;const q=_t[0];B({nodes:[{id:crypto.randomUUID(),method:q.method.toLowerCase(),path:q.path,x:80,y:120}],edges:[]}),fe(Fe=>Fe+1)},[_t,W.nodes.length,f,we]);const Ot=ee.useCallback(()=>{const q={"Content-Type":"application/json"};return T.trim()&&(q.Authorization=`Bearer ${T.trim()}`),A.trim()&&(q[P]=A.trim()),q},[T,A,P]),St=ee.useMemo(()=>{if(!r||!x)return null;const q={};for(const{id:Fe}of gf)q[Fe]=Py(r,Fe,x.method,x.path);return q},[r,x]),wn=ee.useMemo(()=>r?Ty(r,C,w):"",[r,C,w]),fn=async q=>{var nn;if(!r)return"";const Fe={};let Le="";const nt=ks(r,m);for(let Yt=0;Yt<q.length;Yt++){const Ut=q[Yt];let rn=Ut.path;for(const[or,In]of Object.entries(Fe))rn=rn.replace(`{${or}}`,In);const to=`${nt}${rn}`,on={method:Ut.method.toUpperCase(),headers:Ot()},qn=Ut.method.toLowerCase();qn!=="get"&&qn!=="head"&&(on.body="{}");const zt=await fetch(to,{...on,credentials:"include"}),Wn=await zt.json().catch(()=>({}));if(Le+=`Paso ${Yt+1}: ${zt.status}
207
+ ${JSON.stringify(Wn,null,2)}
208
+
209
+ `,(nn=Ut.extract)!=null&&nn.jsonPath){const or=Of(Wn,Ut.extract.jsonPath);or!==void 0&&(Fe[Ut.extract.varName]=String(or))}}return Le},gr=async()=>{if(!r)return;const q=ks(r,m);if(W.nodes.length===0){D("Añade al menos un nodo al flujo.");return}const Fe=await lm(W,q,Ot);D(Fe)},bn=async q=>{if(!r)return;const Fe=ks(r,m),Le=q.graph&&q.graph.nodes.length>0?await lm(q.graph,Fe,Ot):await fn(q.steps);D(Le),d("flows")},Nt=q=>{_e(q.name),B(q.graph&&q.graph.nodes.length>0?q.graph:nk(q.steps.length?q.steps:[{method:"get",path:"/"}])),fe(Fe=>Fe+1),Se(q.id??null),d("flows")},Vt=()=>{Se(null),_e("Nuevo flujo"),_t[0]?B({nodes:[{id:crypto.randomUUID(),method:_t[0].method.toLowerCase(),path:_t[0].path,x:80,y:120}],edges:[]}):B({nodes:[],edges:[]}),fe(q=>q+1)},Hn=ee.useCallback(q=>{B(q)},[]),tr=async()=>{const q=tk(W);if(we!=null)await bt.flows.update(we,{name:pe,steps:q,graph:W});else{const Fe=await bt.flows.add({name:pe,steps:q,graph:W});Se(Fe)}await it()},_n=async q=>{q!==void 0&&(q===we&&(Se(null),Vt()),await bt.flows.delete(q),await it())},Pn=()=>{if(!$)return;const{method:q,path:Fe}=Ek($),Le={id:crypto.randomUUID(),method:q,path:Fe,expectStatus:200,contains:void 0,jsonPath:void 0,expectJsonValue:void 0};Q(nt=>({...nt,cases:[...nt.cases,Le]}))},Vn=q=>{Q(Fe=>({...Fe,cases:Fe.cases.filter(Le=>Le.id!==q)}))},dn=(q,Fe)=>{Q(Le=>({...Le,cases:Le.cases.map(nt=>nt.id===q?{...nt,...Fe}:nt)}))},nr=async q=>{if(!r)return"";const Fe=ks(r,m);let Le="";for(const nt of q){const nn=`${Fe}${nt.path}`,Yt=await fetch(nn,{method:nt.method.toUpperCase(),headers:Ot(),credentials:"include"}),Ut=await Yt.text(),rn=Fy(nt,Yt.status,Ut),to=`${rn.pass?"PASS":"FAIL"} ${nt.method.toUpperCase()} ${nt.path}`;Le+=`${to}
210
+ ${rn.lines.map(on=>` ${on}`).join(`
211
+ `)}
212
+
213
+ `}return Le},Sn=async()=>{const q=await nr(le.cases);F(q)},Ye=async()=>{if(!r||ie.length===0)return;let q="";for(const Fe of ie)q+=`━━━ ${Fe.name} (${Fe.cases.length} casos) ━━━
214
+ `,q+=await nr(Fe.cases);F(q),d("tests")},Un=async q=>{const Fe=await nr(q.cases);F(Fe),d("tests")},kn=q=>{Q({name:q.name,cases:q.cases.map(Fe=>({...Fe,id:Fe.id&&Fe.id.length>0?Fe.id:crypto.randomUUID()}))}),$e(q.id??null),d("tests")},rr=()=>{$e(null),Q({name:"Nueva suite",cases:[]})},Ve=async()=>{if(Me!=null)await bt.testSuites.update(Me,{name:le.name,cases:le.cases});else{const q=await bt.testSuites.add({name:le.name,cases:le.cases});$e(q)}await it()},Mn=async q=>{q!==void 0&&(q===Me&&($e(null),Q({name:"Nueva suite",cases:[]})),await bt.testSuites.delete(q),await it())},Kn=async()=>{await bt.kv.put({key:"bearer",value:T}),await bt.kv.put({key:"apiKey",value:A})},yr=async()=>{const q=await Ly(),Fe=new Blob([JSON.stringify(q,null,2)],{type:"application/json"}),Le=document.createElement("a");Le.href=URL.createObjectURL(Fe),Le.download="api-doc-tor-export.json",Le.click()},Zr=async q=>{var nn;const Fe=(nn=q.target.files)==null?void 0:nn[0];if(!Fe)return;const Le=await Fe.text(),nt=JSON.parse(Le);await bm(nt),await it()},vr=async()=>{await fetch("/docs/__auth/logout",{method:"POST",credentials:"include"}),window.location.href="/docs/__auth/login"},Io=()=>{x&&(B(q=>{const Fe=q.nodes[q.nodes.length-1],Le=Fe?Fe.x+280:80,nt=(Fe==null?void 0:Fe.y)??120;return{nodes:[...q.nodes,{id:crypto.randomUUID(),method:x.method.toLowerCase(),path:x.path,x:Le,y:nt}],edges:q.edges}}),fe(q=>q+1),d("flows"))};if(s)return b.jsx("div",{className:"min-h-screen flex items-center justify-center p-8",children:b.jsxs("div",{className:"max-w-lg rounded-2xl border border-red-500/30 bg-surface-900 p-6 text-red-200",children:[b.jsx("h1",{className:"font-display text-xl font-bold mb-2",children:"No se pudo cargar OpenAPI"}),b.jsx("p",{className:"text-sm opacity-90",children:s}),b.jsxs("p",{className:"text-xs mt-4 text-slate-500",children:["URL intentada: ",ut]})]})});if(!r)return b.jsx("div",{className:"min-h-screen flex items-center justify-center",children:b.jsx("p",{className:"text-slate-400 animate-pulse",children:"Cargando especificación…"})});const eo=w===null?"Todos los endpoints (cliente único con todas las operaciones)":`Tag «${w}» (solo operaciones de este grupo)`,Nn=((Tn=t.productName)==null?void 0:Tn.trim())||r.info.title;return b.jsxs("div",{className:"min-h-screen flex flex-col bg-surface-950",children:[b.jsxs("div",{className:"flex flex-1 flex-col md:flex-row min-h-0",children:[b.jsxs("aside",{className:`w-full border-b md:border-b-0 md:border-r border-surface-700 bg-surface-900/80 shrink-0 transition-[width] duration-200 ease-out flex flex-col ${ke?"md:w-12 md:min-w-[3rem]":"md:w-64"}`,children:[b.jsx("input",{id:"adt-state-import",type:"file",accept:"application/json",className:"hidden",onChange:Zr}),b.jsxs("div",{className:ke?"max-md:block md:hidden":"block",children:[b.jsxs("div",{className:"p-4 border-b border-surface-700 flex justify-between items-start gap-2",children:[b.jsxs("div",{className:"min-w-0",children:[t.logoDataUrl?b.jsx("img",{src:t.logoDataUrl,alt:"",className:"h-9 max-w-[200px] object-contain object-left mb-2"}):null,b.jsx("h1",{className:"font-display text-lg font-bold text-white tracking-tight",children:Nn}),b.jsx("p",{className:"text-xs text-slate-500 mt-1",children:Nn===r.info.title?`v${r.info.version}`:`${r.info.title} · v${r.info.version}`})]}),b.jsx("button",{type:"button",className:"hidden md:flex shrink-0 w-8 h-8 rounded-lg border border-surface-600 bg-surface-800 text-slate-300 hover:bg-surface-700 items-center justify-center text-lg leading-none",onClick:()=>He(!0),"aria-label":"Ocultar menú lateral",title:"Ocultar menú",children:"‹"})]}),b.jsx("nav",{className:"p-2 flex flex-row md:flex-col gap-1 overflow-x-auto",children:[["explore","Explorar"],["flows",`Flujos (${U.length})`],["tests",`Tests (${ie.length})`],["auth","Auth"]].map(([q,Fe])=>b.jsx("button",{type:"button",onClick:()=>d(q),className:`text-left px-3 py-2 rounded-lg text-sm transition ${f===q?"bg-accent/20 text-accent":"text-slate-400 hover:bg-surface-800"}`,children:Fe},q))}),Ae?b.jsxs("div",{className:"px-3 py-2 border-t border-surface-700 flex items-center justify-between gap-2 text-xs",children:[b.jsx("span",{className:"text-slate-400 truncate",title:Ae.username,children:Ae.username}),b.jsx("button",{type:"button",className:"shrink-0 text-accent hover:underline",onClick:()=>void vr(),children:"Salir"})]}):null,b.jsxs("div",{className:"p-3 border-t border-surface-700 space-y-2",children:[b.jsx("button",{type:"button",onClick:yr,className:"w-full text-xs py-2 rounded-lg bg-surface-800 hover:bg-surface-700",children:"Exportar estado"}),b.jsx("label",{htmlFor:"adt-state-import",className:"block w-full text-xs py-2 rounded-lg bg-surface-800 hover:bg-surface-700 text-center cursor-pointer",children:"Importar JSON"})]})]}),ke?b.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:[b.jsx("button",{type:"button",className:"w-9 h-9 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",onClick:()=>He(!1),"aria-label":"Mostrar menú lateral completo",title:"Expandir panel completo",children:b.jsx(dm,{className:"text-slate-300"})}),b.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:[b.jsx("button",{type:"button",onClick:()=>d("explore"),title:"Explorar","aria-current":f==="explore"?"page":void 0,className:`relative w-9 h-9 rounded-lg border flex items-center justify-center shrink-0 ${f==="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:b.jsx(xk,{})}),b.jsxs("button",{type:"button",onClick:()=>d("flows"),title:`Flujos (${U.length})`,"aria-current":f==="flows"?"page":void 0,className:`relative w-9 h-9 rounded-lg border flex items-center justify-center shrink-0 ${f==="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:[b.jsx(wk,{}),U.length>0?b.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 min-w-[14px] h-3.5 px-0.5 rounded-full bg-accent text-[8px] font-bold text-surface-950 flex items-center justify-center leading-none",children:U.length>99?"99+":U.length}):null]}),b.jsxs("button",{type:"button",onClick:()=>d("tests"),title:`Tests (${ie.length})`,"aria-current":f==="tests"?"page":void 0,className:`relative w-9 h-9 rounded-lg border flex items-center justify-center shrink-0 ${f==="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:[b.jsx(bk,{}),ie.length>0?b.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]}),b.jsxs("button",{type:"button",onClick:()=>d("auth"),title:"Auth","aria-current":f==="auth"?"page":void 0,className:`relative w-9 h-9 rounded-lg border flex items-center justify-center shrink-0 ${f==="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:[b.jsx(_k,{}),Ae?b.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]})]}),b.jsxs("div",{className:"flex flex-col gap-0.5 items-center w-full py-1 mt-auto border-t border-surface-700/80",children:[b.jsx("button",{type:"button",onClick:yr,title:"Exportar estado",className:"w-9 h-9 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",children:b.jsx(Sk,{})}),b.jsx("button",{type:"button",onClick:()=>{var q;return(q=document.getElementById("adt-state-import"))==null?void 0:q.click()},title:"Importar JSON",className:"w-9 h-9 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",children:b.jsx(kk,{})}),Ae?b.jsx("button",{type:"button",onClick:()=>void vr(),title:`Salir (${Ae.username})`,className:"w-9 h-9 rounded-lg border border-transparent bg-surface-800/80 text-rose-400/90 hover:bg-rose-950/50 flex items-center justify-center",children:b.jsx(Nk,{})}):null]})]}):null]}),b.jsxs("main",{className:"flex-1 flex flex-col min-h-0",children:[b.jsx("header",{className:"border-b border-surface-700 px-4 py-3 flex flex-wrap gap-3 items-center bg-surface-900/50",children:b.jsxs("label",{className:"text-xs text-slate-500",children:["Base URL",b.jsx("input",{className:"ml-2 bg-surface-800 border border-surface-600 rounded px-2 py-1 text-sm w-64",value:m,onChange:q=>v(q.target.value)})]})}),f==="explore"&&b.jsxs("div",{className:"flex-1 flex flex-col lg:flex-row min-h-0",children:[b.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 ${Oe?"lg:w-12 lg:min-w-[3rem] max-h-16 lg:max-h-none":"lg:w-72 max-h-64 lg:max-h-none"}`,children:[b.jsxs("div",{className:Oe?"max-lg:block lg:hidden":"block",children:[b.jsxs("div",{className:"p-2 flex items-start justify-between gap-2 border-b border-surface-700 lg:border-b-0",children:[b.jsx("p",{className:"text-xs uppercase tracking-wider text-slate-500 shrink-0",children:"Tags"}),b.jsx("button",{type:"button",className:"hidden lg:flex shrink-0 w-7 h-7 rounded-md border border-surface-600 bg-surface-800 text-slate-300 hover:bg-surface-700 items-center justify-center text-sm leading-none",onClick:()=>qe(!0),"aria-label":"Ocultar lista de endpoints",title:"Ocultar endpoints",children:"‹"})]}),b.jsx("div",{className:"p-2 pt-1",children:b.jsxs("div",{className:"flex flex-wrap gap-1",children:[b.jsx("button",{type:"button",onClick:()=>k(null),className:`text-xs px-2 py-1 rounded ${w===null?"bg-accent/30":"bg-surface-800"}`,children:"Todos"}),Tt.map(q=>b.jsx("button",{type:"button",onClick:()=>k(q),className:`text-xs px-2 py-1 rounded ${w===q?"bg-accent/30":"bg-surface-800"}`,children:q},q))]})}),b.jsx("ul",{className:"text-sm",children:Ht.map(q=>b.jsx("li",{children:b.jsxs("button",{type:"button",onClick:()=>S({method:q.method,path:q.path}),className:`w-full text-left px-3 py-2 hover:bg-surface-800 flex gap-2 ${(x==null?void 0:x.method)===q.method&&x.path===q.path?"bg-surface-800 border-l-2 border-accent":""}`,children:[b.jsx(iu,{method:q.method}),b.jsx("span",{className:"truncate text-slate-300",children:q.path})]})},`${q.method}:${q.path}`))})]}),Oe?b.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:[b.jsx("button",{type:"button",className:"w-9 h-9 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",onClick:()=>qe(!1),"aria-label":"Mostrar lista de endpoints completa",title:"Expandir lista de endpoints",children:b.jsx(dm,{className:"text-slate-300"})}),b.jsxs("div",{className:"text-center text-[9px] font-mono text-slate-500 leading-none px-0.5",title:`${Ht.length} operación(es) (filtro actual)`,children:[b.jsx("span",{className:"block text-slate-400 font-semibold text-[11px]",children:Ht.length}),b.jsx("span",{className:"text-[8px] uppercase tracking-tighter",children:"ops"})]}),b.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:Ht.map((q,Fe)=>{const Le=(x==null?void 0:x.method)===q.method&&x.path===q.path;return b.jsx("button",{type:"button",role:"listitem",title:`${q.method.toUpperCase()} ${q.path}`,onClick:()=>S({method:q.method,path:q.path}),className:`w-9 h-8 shrink-0 rounded border border-surface-700 bg-surface-900 text-[11px] font-mono font-semibold text-slate-200 hover:bg-surface-800 ${vk(q.method)} ${Le?"ring-1 ring-accent shadow-[inset_0_0_0_1px_rgba(56,189,248,0.25)]":""}`,children:Fe+1},`${q.method}:${q.path}`)})})]}):null]}),b.jsx("div",{className:"flex-1 p-4 overflow-auto space-y-6",children:x?b.jsxs(b.Fragment,{children:[b.jsxs("div",{children:[b.jsxs("h2",{className:"font-display font-semibold text-white text-lg flex flex-wrap items-center gap-2",children:[b.jsx(iu,{method:x.method,size:"md"}),b.jsx("span",{className:"font-mono text-slate-200 break-all",children:x.path})]}),b.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:["Filtro de exportación de servicio: ",eo]})]}),r?b.jsx(yk,{doc:r,selectedOp:x,baseUrl:m,buildHeaders:Ot}):null,b.jsxs("section",{className:"space-y-3",children:[b.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Snippets por lenguaje"}),b.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:St&&gf.map(({id:q,label:Fe})=>b.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/60 overflow-hidden",children:[b.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-surface-700 bg-surface-800/50",children:[b.jsx("span",{className:"text-xs font-medium text-accent",children:Fe}),b.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-surface-600",onClick:()=>void pm(St[q]),children:"Copiar"})]}),b.jsx("pre",{className:"text-[11px] p-3 overflow-auto max-h-56 text-slate-300 font-mono whitespace-pre-wrap",children:St[q]})]},q))})]}),b.jsxs("section",{className:"space-y-3 rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[b.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Cliente / servicio generado"}),b.jsx("p",{className:"text-xs text-slate-500",children:eo}),b.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[b.jsxs("label",{className:"text-xs text-slate-400",children:["Lenguaje del archivo",b.jsx("select",{className:"ml-2 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:C,onChange:q=>j(q.target.value),children:gf.map(({id:q,label:Fe})=>b.jsx("option",{value:q,children:Fe},q))})]}),b.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg bg-surface-700 hover:bg-surface-600",onClick:()=>void pm(wn),children:"Copiar servicio"})]}),b.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:wn})]}),b.jsx("div",{className:"flex flex-wrap gap-2 pt-2 border-t border-surface-800",children:b.jsx("button",{type:"button",className:"text-xs px-3 py-2 rounded-lg bg-surface-800 hover:bg-surface-700",onClick:Io,children:"Añadir operación actual a un flujo (ve a Flujos)"})})]}):b.jsx("p",{className:"text-slate-500",children:"Selecciona una operación en la lista."})})]}),f==="flows"&&b.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[b.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4",children:[b.jsx("h3",{className:"text-sm font-semibold text-white mb-3",children:"Flujos guardados"}),U.length===0?b.jsx("p",{className:"text-sm text-slate-500",children:"Aún no hay flujos. Crea uno en el editor y guarda."}):b.jsx("ul",{className:"space-y-2",children:U.map(q=>{var Fe,Le;return b.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:[b.jsxs("div",{children:[b.jsx("span",{className:"text-sm text-slate-200 font-medium",children:q.name}),b.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[(((Le=(Fe=q.graph)==null?void 0:Fe.nodes)==null?void 0:Le.length)??q.steps.length)||0," nodo(s)"]})]}),b.jsxs("div",{className:"flex flex-wrap gap-2",children:[b.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 bn(q),children:"Play"}),b.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent hover:bg-accent/30",onClick:()=>Nt(q),children:"Editar"}),b.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 _n(q.id),children:"Eliminar"})]})]},q.id!=null?`flow-${q.id}`:`flow-${q.name}`)})})]}),b.jsxs("section",{className:"space-y-4 max-w-6xl",children:[b.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[b.jsx("h3",{className:"text-sm font-semibold text-white",children:"Editor de flujo (nodos y cables)"}),b.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:Vt,children:"Nuevo flujo"})]}),we!=null&&b.jsxs("p",{className:"text-xs text-accent",children:["Editando flujo guardado (#",we,")"]}),b.jsxs("p",{className:"text-sm text-slate-400",children:["Cada nodo es un endpoint del spec. Conecta ",b.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 ",b.jsx("code",{className:"text-accent",children:"{variable}"})," en la ruta)."]}),b.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm w-full max-w-md",value:pe,onChange:q=>_e(q.target.value),placeholder:"Nombre del flujo"}),b.jsx(ek,{doc:r,ops:_t,graph:W,onGraphChange:Hn},X),b.jsxs("div",{className:"flex flex-wrap gap-2",children:[b.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 gr(),children:"Play (grafo)"}),b.jsx("button",{type:"button",className:"px-3 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void tr(),children:we!=null?"Guardar cambios":"Guardar flujo"})]}),b.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í."})]})]}),f==="tests"&&b.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[b.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[b.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[b.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suites guardadas"}),ie.length>0&&b.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 Ye(),children:"Ejecutar todas las suites"})]}),ie.length===0?b.jsx("p",{className:"text-sm text-slate-500",children:"Ninguna suite guardada."}):b.jsx("ul",{className:"space-y-2",children:ie.map(q=>b.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:[b.jsxs("div",{children:[b.jsx("span",{className:"text-sm text-slate-200 font-medium",children:q.name}),b.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[q.cases.length," caso(s)"]})]}),b.jsxs("div",{className:"flex flex-wrap gap-2",children:[b.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 Un(q),children:"Play"}),b.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent",onClick:()=>kn(q),children:"Editar"}),b.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-red-900/40",onClick:()=>void Mn(q.id),children:"Eliminar"})]})]},q.id!=null?`suite-${q.id}`:`suite-${q.name}`))})]}),b.jsxs("section",{className:"space-y-4",children:[b.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[b.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suite en edición"}),b.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:rr,children:"Nueva suite"})]}),Me!=null&&b.jsxs("p",{className:"text-xs text-accent",children:["Editando suite guardada (#",Me,")"]}),b.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm max-w-md",value:le.name,onChange:q=>Q(Fe=>({...Fe,name:q.target.value})),placeholder:"Nombre de la suite"}),b.jsxs("div",{className:"flex flex-wrap gap-2 items-end rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[b.jsxs("label",{className:"text-xs text-slate-400 flex-1 min-w-[200px]",children:["Añadir endpoint del spec",b.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm font-mono",value:$,onChange:q=>H(q.target.value),children:_t.map(q=>b.jsxs("option",{value:yf(q.method,q.path),children:[q.method.toUpperCase()," ",q.path]},yf(q.method,q.path)))})]}),b.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-800 text-sm hover:bg-surface-700",onClick:Pn,children:"Añadir a la suite"})]}),b.jsx("ul",{className:"space-y-4",children:le.cases.map(q=>{const Fe=hm(q.expectStatus)?String(q.expectStatus):"custom";return b.jsxs("li",{className:"rounded-xl border border-surface-700 bg-surface-950/40 p-4 space-y-3 text-sm",children:[b.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[b.jsxs("span",{className:"flex flex-wrap items-center gap-2 min-w-0",children:[b.jsx(iu,{method:q.method}),b.jsx("span",{className:"font-mono text-xs text-slate-300 break-all",children:q.path})]}),b.jsx("button",{type:"button",className:"text-xs text-red-400 hover:underline shrink-0",onClick:()=>Vn(q.id),children:"Quitar"})]}),b.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[b.jsxs("label",{className:"text-xs text-slate-400 block",children:["Código HTTP esperado",b.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[b.jsxs("select",{className:"bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm max-w-[200px]",value:Fe,onChange:Le=>{const nt=Le.target.value;if(nt==="custom"){dn(q.id,{expectStatus:hm(q.expectStatus)?1e3:q.expectStatus});return}dn(q.id,{expectStatus:Number(nt)})},children:[h0.map(Le=>b.jsx("option",{value:String(Le.value),children:Le.label},Le.value)),b.jsx("option",{value:"custom",children:"Otro…"})]}),Fe==="custom"&&b.jsx("input",{type:"number",className:"w-20 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:q.expectStatus,onChange:Le=>dn(q.id,{expectStatus:Number(Le.target.value)||0})})]})]}),b.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["El body contiene (opcional)",b.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:q.contains??"",onChange:Le=>dn(q.id,{contains:Le.target.value||void 0})})]}),b.jsxs("label",{className:"text-xs text-slate-400 block",children:["JSON path (opcional)",b.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:q.jsonPath??"",onChange:Le=>dn(q.id,{jsonPath:Le.target.value||void 0})})]}),b.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["Valor esperado en JSON path (opcional)",b.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:q.expectJsonValue??"",onChange:Le=>dn(q.id,{expectJsonValue:Le.target.value||void 0})})]})]})]},q.id)})}),b.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[b.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 Sn(),children:"Correr todos los casos (suite actual)"}),b.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void Ve(),children:Me!=null?"Guardar cambios":"Guardar suite"})]}),b.jsx("pre",{className:"text-xs bg-surface-950 border border-surface-700 rounded-lg p-3 whitespace-pre-wrap min-h-[4rem]",children:K||"—"})]})]}),f==="auth"&&b.jsxs("div",{className:"p-4 space-y-4 max-w-lg",children:[b.jsxs("p",{className:"text-sm text-slate-400",children:["Esquemas en el spec: ",$y(r).join(", ")||"ninguno"]}),b.jsxs("label",{className:"block text-sm",children:["Bearer token",b.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:T,onChange:q=>I(q.target.value),placeholder:"eyJ..."})]}),b.jsxs("label",{className:"block text-sm",children:["API key header",b.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:P,onChange:q=>R(q.target.value)})]}),b.jsxs("label",{className:"block text-sm",children:["API key",b.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:A,onChange:q=>V(q.target.value),type:"password",autoComplete:"off"})]}),b.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void Kn(),children:"Recordar en este navegador"})]})]})]}),b.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 jk={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 Pk(t){return{...jk,...t}}function Mk(t){var s,u;const r=(s=t.logoBase64)==null?void 0:s.trim();return r?r.startsWith("data:")?r:`data:${((u=t.logoMimeType)==null?void 0:u.trim())||"image/png"};base64,${r}`:null}function Tk(t){var i;const r=Pk(t==null?void 0:t.colors);return{productName:((i=t==null?void 0:t.productName)==null?void 0:i.trim())||null,logoDataUrl:t?Mk(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 Ik={credentials:"include"};function $k(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 Ak(){const t=Tk(void 0);try{const r=await fetch("/docs/ui-config.json",Ik);return r.status===401?{...t,docsAuthRequired:!0}:r.ok?await r.json():t}catch{return t}}(async()=>{const t=await Ak();$k(t.colorsRgb),py.createRoot(document.getElementById("root")).render(b.jsx(mm.StrictMode,{children:b.jsx(rk,{value:{productName:t.productName,logoDataUrl:t.logoDataUrl},children:b.jsx(Ck,{})})}))})();