loom-spec 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,225 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function qa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ug={exports:{}},Wa={},cg={exports:{}},le={};/**
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 Vi=Symbol.for("react.element"),h_=Symbol.for("react.portal"),p_=Symbol.for("react.fragment"),m_=Symbol.for("react.strict_mode"),g_=Symbol.for("react.profiler"),y_=Symbol.for("react.provider"),v_=Symbol.for("react.context"),w_=Symbol.for("react.forward_ref"),__=Symbol.for("react.suspense"),$_=Symbol.for("react.memo"),x_=Symbol.for("react.lazy"),sh=Symbol.iterator;function S_(e){return e===null||typeof e!="object"?null:(e=sh&&e[sh]||e["@@iterator"],typeof e=="function"?e:null)}var dg={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},fg=Object.assign,hg={};function $o(e,t,n){this.props=e,this.context=t,this.refs=hg,this.updater=n||dg}$o.prototype.isReactComponent={};$o.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};$o.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function pg(){}pg.prototype=$o.prototype;function Fc(e,t,n){this.props=e,this.context=t,this.refs=hg,this.updater=n||dg}var Hc=Fc.prototype=new pg;Hc.constructor=Fc;fg(Hc,$o.prototype);Hc.isPureReactComponent=!0;var ah=Array.isArray,mg=Object.prototype.hasOwnProperty,Bc={current:null},gg={key:!0,ref:!0,__self:!0,__source:!0};function yg(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)mg.call(t,r)&&!gg.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];o.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:Vi,type:e,key:i,ref:s,props:o,_owner:Bc.current}}function E_(e,t){return{$$typeof:Vi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Uc(e){return typeof e=="object"&&e!==null&&e.$$typeof===Vi}function k_(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var lh=/\/+/g;function Il(e,t){return typeof e=="object"&&e!==null&&e.key!=null?k_(""+e.key):t.toString(36)}function Os(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Vi:case h_:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Il(s,0):r,ah(o)?(n="",e!=null&&(n=e.replace(lh,"$&/")+"/"),Os(o,t,n,"",function(u){return u})):o!=null&&(Uc(o)&&(o=E_(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(lh,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",ah(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Il(i,a);s+=Os(i,t,n,l,o)}else if(l=S_(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Il(i,a++),s+=Os(i,t,n,l,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function ns(e,t,n){if(e==null)return e;var r=[],o=0;return Os(e,r,"","",function(i){return t.call(n,i,o++)}),r}function N_(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Je={current:null},Ds={transition:null},P_={ReactCurrentDispatcher:Je,ReactCurrentBatchConfig:Ds,ReactCurrentOwner:Bc};function vg(){throw Error("act(...) is not supported in production builds of React.")}le.Children={map:ns,forEach:function(e,t,n){ns(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ns(e,function(){t++}),t},toArray:function(e){return ns(e,function(t){return t})||[]},only:function(e){if(!Uc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};le.Component=$o;le.Fragment=p_;le.Profiler=g_;le.PureComponent=Fc;le.StrictMode=m_;le.Suspense=__;le.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=P_;le.act=vg;le.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=fg({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Bc.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)mg.call(t,l)&&!gg.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:Vi,type:e.type,key:o,ref:i,props:r,_owner:s}};le.createContext=function(e){return e={$$typeof:v_,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:y_,_context:e},e.Consumer=e};le.createElement=yg;le.createFactory=function(e){var t=yg.bind(null,e);return t.type=e,t};le.createRef=function(){return{current:null}};le.forwardRef=function(e){return{$$typeof:w_,render:e}};le.isValidElement=Uc;le.lazy=function(e){return{$$typeof:x_,_payload:{_status:-1,_result:e},_init:N_}};le.memo=function(e,t){return{$$typeof:$_,type:e,compare:t===void 0?null:t}};le.startTransition=function(e){var t=Ds.transition;Ds.transition={};try{e()}finally{Ds.transition=t}};le.unstable_act=vg;le.useCallback=function(e,t){return Je.current.useCallback(e,t)};le.useContext=function(e){return Je.current.useContext(e)};le.useDebugValue=function(){};le.useDeferredValue=function(e){return Je.current.useDeferredValue(e)};le.useEffect=function(e,t){return Je.current.useEffect(e,t)};le.useId=function(){return Je.current.useId()};le.useImperativeHandle=function(e,t,n){return Je.current.useImperativeHandle(e,t,n)};le.useInsertionEffect=function(e,t){return Je.current.useInsertionEffect(e,t)};le.useLayoutEffect=function(e,t){return Je.current.useLayoutEffect(e,t)};le.useMemo=function(e,t){return Je.current.useMemo(e,t)};le.useReducer=function(e,t,n){return Je.current.useReducer(e,t,n)};le.useRef=function(e){return Je.current.useRef(e)};le.useState=function(e){return Je.current.useState(e)};le.useSyncExternalStore=function(e,t,n){return Je.current.useSyncExternalStore(e,t,n)};le.useTransition=function(){return Je.current.useTransition()};le.version="18.3.1";cg.exports=le;var O=cg.exports;const C_=qa(O);/**
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 b_=O,j_=Symbol.for("react.element"),M_=Symbol.for("react.fragment"),T_=Object.prototype.hasOwnProperty,I_=b_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,R_={key:!0,ref:!0,__self:!0,__source:!0};function wg(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)T_.call(t,r)&&!R_.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:j_,type:e,key:i,ref:s,props:o,_owner:I_.current}}Wa.Fragment=M_;Wa.jsx=wg;Wa.jsxs=wg;ug.exports=Wa;var $=ug.exports,_g={exports:{}},pt={},$g={exports:{}},xg={};/**
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
+ */(function(e){function t(M,A){var T=M.length;M.push(A);e:for(;0<T;){var k=T-1>>>1,I=M[k];if(0<o(I,A))M[k]=A,M[T]=I,T=k;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var A=M[0],T=M.pop();if(T!==A){M[0]=T;e:for(var k=0,I=M.length,R=I>>>1;k<R;){var S=2*(k+1)-1,P=M[S],U=S+1,Y=M[U];if(0>o(P,T))U<I&&0>o(Y,P)?(M[k]=Y,M[U]=T,k=U):(M[k]=P,M[S]=T,k=S);else if(U<I&&0>o(Y,T))M[k]=Y,M[U]=T,k=U;else break e}}return A}function o(M,A){var T=M.sortIndex-A.sortIndex;return T!==0?T:M.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],d=1,c=null,f=3,p=!1,g=!1,v=!1,w=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(M){for(var A=n(u);A!==null;){if(A.callback===null)r(u);else if(A.startTime<=M)r(u),A.sortIndex=A.expirationTime,t(l,A);else break;A=n(u)}}function _(M){if(v=!1,y(M),!g)if(n(l)!==null)g=!0,V(x);else{var A=n(u);A!==null&&W(_,A.startTime-M)}}function x(M,A){g=!1,v&&(v=!1,h(z),z=-1),p=!0;var T=f;try{for(y(A),c=n(l);c!==null&&(!(c.expirationTime>A)||M&&!b());){var k=c.callback;if(typeof k=="function"){c.callback=null,f=c.priorityLevel;var I=k(c.expirationTime<=A);A=e.unstable_now(),typeof I=="function"?c.callback=I:c===n(l)&&r(l),y(A)}else r(l);c=n(l)}if(c!==null)var R=!0;else{var S=n(u);S!==null&&W(_,S.startTime-A),R=!1}return R}finally{c=null,f=T,p=!1}}var N=!1,C=null,z=-1,L=5,q=-1;function b(){return!(e.unstable_now()-q<L)}function j(){if(C!==null){var M=e.unstable_now();q=M;var A=!0;try{A=C(!0,M)}finally{A?B():(N=!1,C=null)}}else N=!1}var B;if(typeof m=="function")B=function(){m(j)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,H=E.port2;E.port1.onmessage=j,B=function(){H.postMessage(null)}}else B=function(){w(j,0)};function V(M){C=M,N||(N=!0,B())}function W(M,A){z=w(function(){M(e.unstable_now())},A)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_continueExecution=function(){g||p||(g=!0,V(x))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(M){switch(f){case 1:case 2:case 3:var A=3;break;default:A=f}var T=f;f=A;try{return M()}finally{f=T}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,A){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var T=f;f=M;try{return A()}finally{f=T}},e.unstable_scheduleCallback=function(M,A,T){var k=e.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0<T?k+T:k):T=k,M){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=T+I,M={id:d++,callback:A,priorityLevel:M,startTime:T,expirationTime:I,sortIndex:-1},T>k?(M.sortIndex=T,t(u,M),n(l)===null&&M===n(u)&&(v?(h(z),z=-1):v=!0,W(_,T-k))):(M.sortIndex=I,t(l,M),g||p||(g=!0,V(x))),M},e.unstable_shouldYield=b,e.unstable_wrapCallback=function(M){var A=f;return function(){var T=f;f=A;try{return M.apply(this,arguments)}finally{f=T}}}})(xg);$g.exports=xg;var z_=$g.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 A_=O,ft=z_;function Q(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Sg=new Set,fi={};function Nr(e,t){oo(e,t),oo(e+"Capture",t)}function oo(e,t){for(fi[e]=t,e=0;e<t.length;e++)Sg.add(t[e])}var fn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Su=Object.prototype.hasOwnProperty,O_=/^[: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]*$/,uh={},ch={};function D_(e){return Su.call(ch,e)?!0:Su.call(uh,e)?!1:O_.test(e)?ch[e]=!0:(uh[e]=!0,!1)}function L_(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function V_(e,t,n,r){if(t===null||typeof t>"u"||L_(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function et(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Ue={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ue[e]=new et(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ue[t]=new et(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ue[e]=new et(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ue[e]=new et(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){Ue[e]=new et(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ue[e]=new et(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ue[e]=new et(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ue[e]=new et(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ue[e]=new et(e,5,!1,e.toLowerCase(),null,!1,!1)});var qc=/[\-:]([a-z])/g;function Wc(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 t=e.replace(qc,Wc);Ue[t]=new et(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(qc,Wc);Ue[t]=new et(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(qc,Wc);Ue[t]=new et(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ue[e]=new et(e,1,!1,e.toLowerCase(),null,!1,!1)});Ue.xlinkHref=new et("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ue[e]=new et(e,1,!1,e.toLowerCase(),null,!0,!0)});function Kc(e,t,n,r){var o=Ue.hasOwnProperty(t)?Ue[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(V_(t,n,o,r)&&(n=null),r||o===null?D_(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var vn=A_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,rs=Symbol.for("react.element"),Ir=Symbol.for("react.portal"),Rr=Symbol.for("react.fragment"),Xc=Symbol.for("react.strict_mode"),Eu=Symbol.for("react.profiler"),Eg=Symbol.for("react.provider"),kg=Symbol.for("react.context"),Yc=Symbol.for("react.forward_ref"),ku=Symbol.for("react.suspense"),Nu=Symbol.for("react.suspense_list"),Gc=Symbol.for("react.memo"),Pn=Symbol.for("react.lazy"),Ng=Symbol.for("react.offscreen"),dh=Symbol.iterator;function Mo(e){return e===null||typeof e!="object"?null:(e=dh&&e[dh]||e["@@iterator"],typeof e=="function"?e:null)}var Ne=Object.assign,Rl;function Bo(e){if(Rl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Rl=t&&t[1]||""}return`
34
+ `+Rl+e}var zl=!1;function Al(e,t){if(!e||zl)return"";zl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
35
+ `),i=r.stack.split(`
36
+ `),s=o.length-1,a=i.length-1;1<=s&&0<=a&&o[s]!==i[a];)a--;for(;1<=s&&0<=a;s--,a--)if(o[s]!==i[a]){if(s!==1||a!==1)do if(s--,a--,0>a||o[s]!==i[a]){var l=`
37
+ `+o[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{zl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Bo(e):""}function F_(e){switch(e.tag){case 5:return Bo(e.type);case 16:return Bo("Lazy");case 13:return Bo("Suspense");case 19:return Bo("SuspenseList");case 0:case 2:case 15:return e=Al(e.type,!1),e;case 11:return e=Al(e.type.render,!1),e;case 1:return e=Al(e.type,!0),e;default:return""}}function Pu(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 Rr:return"Fragment";case Ir:return"Portal";case Eu:return"Profiler";case Xc:return"StrictMode";case ku:return"Suspense";case Nu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case kg:return(e.displayName||"Context")+".Consumer";case Eg:return(e._context.displayName||"Context")+".Provider";case Yc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Gc:return t=e.displayName||null,t!==null?t:Pu(e.type)||"Memo";case Pn:t=e._payload,e=e._init;try{return Pu(e(t))}catch{}}return null}function H_(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Pu(t);case 8:return t===Xc?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function qn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Pg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function B_(e){var t=Pg(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function os(e){e._valueTracker||(e._valueTracker=B_(e))}function Cg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Pg(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ia(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 Cu(e,t){var n=t.checked;return Ne({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function fh(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=qn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function bg(e,t){t=t.checked,t!=null&&Kc(e,"checked",t,!1)}function bu(e,t){bg(e,t);var n=qn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ju(e,t.type,n):t.hasOwnProperty("defaultValue")&&ju(e,t.type,qn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function hh(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ju(e,t,n){(t!=="number"||ia(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Uo=Array.isArray;function Xr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+qn(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Mu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Q(91));return Ne({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ph(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(Q(92));if(Uo(n)){if(1<n.length)throw Error(Q(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:qn(n)}}function jg(e,t){var n=qn(t.value),r=qn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function mh(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Mg(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 Tu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Mg(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var is,Tg=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(is=is||document.createElement("div"),is.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=is.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function hi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Qo={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},U_=["Webkit","ms","Moz","O"];Object.keys(Qo).forEach(function(e){U_.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Qo[t]=Qo[e]})});function Ig(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Qo.hasOwnProperty(e)&&Qo[e]?(""+t).trim():t+"px"}function Rg(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Ig(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var q_=Ne({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 Iu(e,t){if(t){if(q_[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Q(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Q(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Q(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Q(62))}}function Ru(e,t){if(e.indexOf("-")===-1)return typeof t.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 zu=null;function Qc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Au=null,Yr=null,Gr=null;function gh(e){if(e=Bi(e)){if(typeof Au!="function")throw Error(Q(280));var t=e.stateNode;t&&(t=Qa(t),Au(e.stateNode,e.type,t))}}function zg(e){Yr?Gr?Gr.push(e):Gr=[e]:Yr=e}function Ag(){if(Yr){var e=Yr,t=Gr;if(Gr=Yr=null,gh(e),t)for(e=0;e<t.length;e++)gh(t[e])}}function Og(e,t){return e(t)}function Dg(){}var Ol=!1;function Lg(e,t,n){if(Ol)return e(t,n);Ol=!0;try{return Og(e,t,n)}finally{Ol=!1,(Yr!==null||Gr!==null)&&(Dg(),Ag())}}function pi(e,t){var n=e.stateNode;if(n===null)return null;var r=Qa(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(Q(231,t,typeof n));return n}var Ou=!1;if(fn)try{var To={};Object.defineProperty(To,"passive",{get:function(){Ou=!0}}),window.addEventListener("test",To,To),window.removeEventListener("test",To,To)}catch{Ou=!1}function W_(e,t,n,r,o,i,s,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var Zo=!1,sa=null,aa=!1,Du=null,K_={onError:function(e){Zo=!0,sa=e}};function X_(e,t,n,r,o,i,s,a,l){Zo=!1,sa=null,W_.apply(K_,arguments)}function Y_(e,t,n,r,o,i,s,a,l){if(X_.apply(this,arguments),Zo){if(Zo){var u=sa;Zo=!1,sa=null}else throw Error(Q(198));aa||(aa=!0,Du=u)}}function Pr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Vg(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function yh(e){if(Pr(e)!==e)throw Error(Q(188))}function G_(e){var t=e.alternate;if(!t){if(t=Pr(e),t===null)throw Error(Q(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return yh(o),e;if(i===r)return yh(o),t;i=i.sibling}throw Error(Q(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s){for(a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s)throw Error(Q(189))}}if(n.alternate!==r)throw Error(Q(190))}if(n.tag!==3)throw Error(Q(188));return n.stateNode.current===n?e:t}function Fg(e){return e=G_(e),e!==null?Hg(e):null}function Hg(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Hg(e);if(t!==null)return t;e=e.sibling}return null}var Bg=ft.unstable_scheduleCallback,vh=ft.unstable_cancelCallback,Q_=ft.unstable_shouldYield,Z_=ft.unstable_requestPaint,je=ft.unstable_now,J_=ft.unstable_getCurrentPriorityLevel,Zc=ft.unstable_ImmediatePriority,Ug=ft.unstable_UserBlockingPriority,la=ft.unstable_NormalPriority,e$=ft.unstable_LowPriority,qg=ft.unstable_IdlePriority,Ka=null,Xt=null;function t$(e){if(Xt&&typeof Xt.onCommitFiberRoot=="function")try{Xt.onCommitFiberRoot(Ka,e,void 0,(e.current.flags&128)===128)}catch{}}var Vt=Math.clz32?Math.clz32:o$,n$=Math.log,r$=Math.LN2;function o$(e){return e>>>=0,e===0?32:31-(n$(e)/r$|0)|0}var ss=64,as=4194304;function qo(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 ua(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=qo(a):(i&=s,i!==0&&(r=qo(i)))}else s=n&~o,s!==0?r=qo(s):i!==0&&(r=qo(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Vt(t),o=1<<n,r|=e[n],t&=~o;return r}function i$(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 s$(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-Vt(i),a=1<<s,l=o[s];l===-1?(!(a&n)||a&r)&&(o[s]=i$(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Lu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Wg(){var e=ss;return ss<<=1,!(ss&4194240)&&(ss=64),e}function Dl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Fi(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Vt(t),e[t]=n}function a$(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-Vt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function Jc(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Vt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var fe=0;function Kg(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Xg,ed,Yg,Gg,Qg,Vu=!1,ls=[],An=null,On=null,Dn=null,mi=new Map,gi=new Map,bn=[],l$="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 wh(e,t){switch(e){case"focusin":case"focusout":An=null;break;case"dragenter":case"dragleave":On=null;break;case"mouseover":case"mouseout":Dn=null;break;case"pointerover":case"pointerout":mi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":gi.delete(t.pointerId)}}function Io(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=Bi(t),t!==null&&ed(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function u$(e,t,n,r,o){switch(t){case"focusin":return An=Io(An,e,t,n,r,o),!0;case"dragenter":return On=Io(On,e,t,n,r,o),!0;case"mouseover":return Dn=Io(Dn,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return mi.set(i,Io(mi.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,gi.set(i,Io(gi.get(i)||null,e,t,n,r,o)),!0}return!1}function Zg(e){var t=ir(e.target);if(t!==null){var n=Pr(t);if(n!==null){if(t=n.tag,t===13){if(t=Vg(n),t!==null){e.blockedOn=t,Qg(e.priority,function(){Yg(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ls(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Fu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);zu=r,n.target.dispatchEvent(r),zu=null}else return t=Bi(n),t!==null&&ed(t),e.blockedOn=n,!1;t.shift()}return!0}function _h(e,t,n){Ls(e)&&n.delete(t)}function c$(){Vu=!1,An!==null&&Ls(An)&&(An=null),On!==null&&Ls(On)&&(On=null),Dn!==null&&Ls(Dn)&&(Dn=null),mi.forEach(_h),gi.forEach(_h)}function Ro(e,t){e.blockedOn===t&&(e.blockedOn=null,Vu||(Vu=!0,ft.unstable_scheduleCallback(ft.unstable_NormalPriority,c$)))}function yi(e){function t(o){return Ro(o,e)}if(0<ls.length){Ro(ls[0],e);for(var n=1;n<ls.length;n++){var r=ls[n];r.blockedOn===e&&(r.blockedOn=null)}}for(An!==null&&Ro(An,e),On!==null&&Ro(On,e),Dn!==null&&Ro(Dn,e),mi.forEach(t),gi.forEach(t),n=0;n<bn.length;n++)r=bn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<bn.length&&(n=bn[0],n.blockedOn===null);)Zg(n),n.blockedOn===null&&bn.shift()}var Qr=vn.ReactCurrentBatchConfig,ca=!0;function d$(e,t,n,r){var o=fe,i=Qr.transition;Qr.transition=null;try{fe=1,td(e,t,n,r)}finally{fe=o,Qr.transition=i}}function f$(e,t,n,r){var o=fe,i=Qr.transition;Qr.transition=null;try{fe=4,td(e,t,n,r)}finally{fe=o,Qr.transition=i}}function td(e,t,n,r){if(ca){var o=Fu(e,t,n,r);if(o===null)Xl(e,t,r,da,n),wh(e,r);else if(u$(o,e,t,n,r))r.stopPropagation();else if(wh(e,r),t&4&&-1<l$.indexOf(e)){for(;o!==null;){var i=Bi(o);if(i!==null&&Xg(i),i=Fu(e,t,n,r),i===null&&Xl(e,t,r,da,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Xl(e,t,r,null,n)}}var da=null;function Fu(e,t,n,r){if(da=null,e=Qc(r),e=ir(e),e!==null)if(t=Pr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Vg(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return da=e,null}function Jg(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(J_()){case Zc:return 1;case Ug:return 4;case la:case e$:return 16;case qg:return 536870912;default:return 16}default:return 16}}var Tn=null,nd=null,Vs=null;function e0(){if(Vs)return Vs;var e,t=nd,n=t.length,r,o="value"in Tn?Tn.value:Tn.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return Vs=o.slice(e,1<r?1-r:void 0)}function Fs(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function us(){return!0}function $h(){return!1}function mt(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?us:$h,this.isPropagationStopped=$h,this}return Ne(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=us)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=us)},persist:function(){},isPersistent:us}),t}var xo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rd=mt(xo),Hi=Ne({},xo,{view:0,detail:0}),h$=mt(Hi),Ll,Vl,zo,Xa=Ne({},Hi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:od,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!==zo&&(zo&&e.type==="mousemove"?(Ll=e.screenX-zo.screenX,Vl=e.screenY-zo.screenY):Vl=Ll=0,zo=e),Ll)},movementY:function(e){return"movementY"in e?e.movementY:Vl}}),xh=mt(Xa),p$=Ne({},Xa,{dataTransfer:0}),m$=mt(p$),g$=Ne({},Hi,{relatedTarget:0}),Fl=mt(g$),y$=Ne({},xo,{animationName:0,elapsedTime:0,pseudoElement:0}),v$=mt(y$),w$=Ne({},xo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),_$=mt(w$),$$=Ne({},xo,{data:0}),Sh=mt($$),x$={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},S$={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"},E$={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function k$(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=E$[e])?!!t[e]:!1}function od(){return k$}var N$=Ne({},Hi,{key:function(e){if(e.key){var t=x$[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?S$[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:od,charCode:function(e){return e.type==="keypress"?Fs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),P$=mt(N$),C$=Ne({},Xa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Eh=mt(C$),b$=Ne({},Hi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:od}),j$=mt(b$),M$=Ne({},xo,{propertyName:0,elapsedTime:0,pseudoElement:0}),T$=mt(M$),I$=Ne({},Xa,{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}),R$=mt(I$),z$=[9,13,27,32],id=fn&&"CompositionEvent"in window,Jo=null;fn&&"documentMode"in document&&(Jo=document.documentMode);var A$=fn&&"TextEvent"in window&&!Jo,t0=fn&&(!id||Jo&&8<Jo&&11>=Jo),kh=" ",Nh=!1;function n0(e,t){switch(e){case"keyup":return z$.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function r0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zr=!1;function O$(e,t){switch(e){case"compositionend":return r0(t);case"keypress":return t.which!==32?null:(Nh=!0,kh);case"textInput":return e=t.data,e===kh&&Nh?null:e;default:return null}}function D$(e,t){if(zr)return e==="compositionend"||!id&&n0(e,t)?(e=e0(),Vs=nd=Tn=null,zr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return t0&&t.locale!=="ko"?null:t.data;default:return null}}var L$={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 Ph(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!L$[e.type]:t==="textarea"}function o0(e,t,n,r){zg(r),t=fa(t,"onChange"),0<t.length&&(n=new rd("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ei=null,vi=null;function V$(e){m0(e,0)}function Ya(e){var t=Dr(e);if(Cg(t))return e}function F$(e,t){if(e==="change")return t}var i0=!1;if(fn){var Hl;if(fn){var Bl="oninput"in document;if(!Bl){var Ch=document.createElement("div");Ch.setAttribute("oninput","return;"),Bl=typeof Ch.oninput=="function"}Hl=Bl}else Hl=!1;i0=Hl&&(!document.documentMode||9<document.documentMode)}function bh(){ei&&(ei.detachEvent("onpropertychange",s0),vi=ei=null)}function s0(e){if(e.propertyName==="value"&&Ya(vi)){var t=[];o0(t,vi,e,Qc(e)),Lg(V$,t)}}function H$(e,t,n){e==="focusin"?(bh(),ei=t,vi=n,ei.attachEvent("onpropertychange",s0)):e==="focusout"&&bh()}function B$(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ya(vi)}function U$(e,t){if(e==="click")return Ya(t)}function q$(e,t){if(e==="input"||e==="change")return Ya(t)}function W$(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ht=typeof Object.is=="function"?Object.is:W$;function wi(e,t){if(Ht(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!Su.call(t,o)||!Ht(e[o],t[o]))return!1}return!0}function jh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Mh(e,t){var n=jh(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=jh(n)}}function a0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?a0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function l0(){for(var e=window,t=ia();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ia(e.document)}return t}function sd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function K$(e){var t=l0(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&a0(n.ownerDocument.documentElement,n)){if(r!==null&&sd(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Mh(n,i);var s=Mh(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var X$=fn&&"documentMode"in document&&11>=document.documentMode,Ar=null,Hu=null,ti=null,Bu=!1;function Th(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Bu||Ar==null||Ar!==ia(r)||(r=Ar,"selectionStart"in r&&sd(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ti&&wi(ti,r)||(ti=r,r=fa(Hu,"onSelect"),0<r.length&&(t=new rd("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ar)))}function cs(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Or={animationend:cs("Animation","AnimationEnd"),animationiteration:cs("Animation","AnimationIteration"),animationstart:cs("Animation","AnimationStart"),transitionend:cs("Transition","TransitionEnd")},Ul={},u0={};fn&&(u0=document.createElement("div").style,"AnimationEvent"in window||(delete Or.animationend.animation,delete Or.animationiteration.animation,delete Or.animationstart.animation),"TransitionEvent"in window||delete Or.transitionend.transition);function Ga(e){if(Ul[e])return Ul[e];if(!Or[e])return e;var t=Or[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in u0)return Ul[e]=t[n];return e}var c0=Ga("animationend"),d0=Ga("animationiteration"),f0=Ga("animationstart"),h0=Ga("transitionend"),p0=new Map,Ih="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 Kn(e,t){p0.set(e,t),Nr(t,[e])}for(var ql=0;ql<Ih.length;ql++){var Wl=Ih[ql],Y$=Wl.toLowerCase(),G$=Wl[0].toUpperCase()+Wl.slice(1);Kn(Y$,"on"+G$)}Kn(c0,"onAnimationEnd");Kn(d0,"onAnimationIteration");Kn(f0,"onAnimationStart");Kn("dblclick","onDoubleClick");Kn("focusin","onFocus");Kn("focusout","onBlur");Kn(h0,"onTransitionEnd");oo("onMouseEnter",["mouseout","mouseover"]);oo("onMouseLeave",["mouseout","mouseover"]);oo("onPointerEnter",["pointerout","pointerover"]);oo("onPointerLeave",["pointerout","pointerover"]);Nr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Nr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Nr("onBeforeInput",["compositionend","keypress","textInput","paste"]);Nr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Nr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Nr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Q$=new Set("cancel close invalid load scroll toggle".split(" ").concat(Wo));function Rh(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Y_(r,t,void 0,e),e.currentTarget=null}function m0(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==i&&o.isPropagationStopped())break e;Rh(o,a,u),i=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,u=a.currentTarget,a=a.listener,l!==i&&o.isPropagationStopped())break e;Rh(o,a,u),i=l}}}if(aa)throw e=Du,aa=!1,Du=null,e}function ge(e,t){var n=t[Xu];n===void 0&&(n=t[Xu]=new Set);var r=e+"__bubble";n.has(r)||(g0(t,e,2,!1),n.add(r))}function Kl(e,t,n){var r=0;t&&(r|=4),g0(n,e,r,t)}var ds="_reactListening"+Math.random().toString(36).slice(2);function _i(e){if(!e[ds]){e[ds]=!0,Sg.forEach(function(n){n!=="selectionchange"&&(Q$.has(n)||Kl(n,!1,e),Kl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ds]||(t[ds]=!0,Kl("selectionchange",!1,t))}}function g0(e,t,n,r){switch(Jg(t)){case 1:var o=d$;break;case 4:o=f$;break;default:o=td}n=o.bind(null,t,n,e),o=void 0,!Ou||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Xl(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;a!==null;){if(s=ir(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}Lg(function(){var u=i,d=Qc(n),c=[];e:{var f=p0.get(e);if(f!==void 0){var p=rd,g=e;switch(e){case"keypress":if(Fs(n)===0)break e;case"keydown":case"keyup":p=P$;break;case"focusin":g="focus",p=Fl;break;case"focusout":g="blur",p=Fl;break;case"beforeblur":case"afterblur":p=Fl;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=xh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=m$;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=j$;break;case c0:case d0:case f0:p=v$;break;case h0:p=T$;break;case"scroll":p=h$;break;case"wheel":p=R$;break;case"copy":case"cut":case"paste":p=_$;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Eh}var v=(t&4)!==0,w=!v&&e==="scroll",h=v?f!==null?f+"Capture":null:f;v=[];for(var m=u,y;m!==null;){y=m;var _=y.stateNode;if(y.tag===5&&_!==null&&(y=_,h!==null&&(_=pi(m,h),_!=null&&v.push($i(m,_,y)))),w)break;m=m.return}0<v.length&&(f=new p(f,g,null,n,d),c.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==zu&&(g=n.relatedTarget||n.fromElement)&&(ir(g)||g[hn]))break e;if((p||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,p?(g=n.relatedTarget||n.toElement,p=u,g=g?ir(g):null,g!==null&&(w=Pr(g),g!==w||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=u),p!==g)){if(v=xh,_="onMouseLeave",h="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(v=Eh,_="onPointerLeave",h="onPointerEnter",m="pointer"),w=p==null?f:Dr(p),y=g==null?f:Dr(g),f=new v(_,m+"leave",p,n,d),f.target=w,f.relatedTarget=y,_=null,ir(d)===u&&(v=new v(h,m+"enter",g,n,d),v.target=y,v.relatedTarget=w,_=v),w=_,p&&g)t:{for(v=p,h=g,m=0,y=v;y;y=br(y))m++;for(y=0,_=h;_;_=br(_))y++;for(;0<m-y;)v=br(v),m--;for(;0<y-m;)h=br(h),y--;for(;m--;){if(v===h||h!==null&&v===h.alternate)break t;v=br(v),h=br(h)}v=null}else v=null;p!==null&&zh(c,f,p,v,!1),g!==null&&w!==null&&zh(c,w,g,v,!0)}}e:{if(f=u?Dr(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var x=F$;else if(Ph(f))if(i0)x=q$;else{x=B$;var N=H$}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(x=U$);if(x&&(x=x(e,u))){o0(c,x,n,d);break e}N&&N(e,f,u),e==="focusout"&&(N=f._wrapperState)&&N.controlled&&f.type==="number"&&ju(f,"number",f.value)}switch(N=u?Dr(u):window,e){case"focusin":(Ph(N)||N.contentEditable==="true")&&(Ar=N,Hu=u,ti=null);break;case"focusout":ti=Hu=Ar=null;break;case"mousedown":Bu=!0;break;case"contextmenu":case"mouseup":case"dragend":Bu=!1,Th(c,n,d);break;case"selectionchange":if(X$)break;case"keydown":case"keyup":Th(c,n,d)}var C;if(id)e:{switch(e){case"compositionstart":var z="onCompositionStart";break e;case"compositionend":z="onCompositionEnd";break e;case"compositionupdate":z="onCompositionUpdate";break e}z=void 0}else zr?n0(e,n)&&(z="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(z="onCompositionStart");z&&(t0&&n.locale!=="ko"&&(zr||z!=="onCompositionStart"?z==="onCompositionEnd"&&zr&&(C=e0()):(Tn=d,nd="value"in Tn?Tn.value:Tn.textContent,zr=!0)),N=fa(u,z),0<N.length&&(z=new Sh(z,e,null,n,d),c.push({event:z,listeners:N}),C?z.data=C:(C=r0(n),C!==null&&(z.data=C)))),(C=A$?O$(e,n):D$(e,n))&&(u=fa(u,"onBeforeInput"),0<u.length&&(d=new Sh("onBeforeInput","beforeinput",null,n,d),c.push({event:d,listeners:u}),d.data=C))}m0(c,t)})}function $i(e,t,n){return{instance:e,listener:t,currentTarget:n}}function fa(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=pi(e,n),i!=null&&r.unshift($i(e,i,o)),i=pi(e,t),i!=null&&r.push($i(e,i,o))),e=e.return}return r}function br(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function zh(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,o?(l=pi(n,i),l!=null&&s.unshift($i(n,l,a))):o||(l=pi(n,i),l!=null&&s.push($i(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var Z$=/\r\n?/g,J$=/\u0000|\uFFFD/g;function Ah(e){return(typeof e=="string"?e:""+e).replace(Z$,`
38
+ `).replace(J$,"")}function fs(e,t,n){if(t=Ah(t),Ah(e)!==t&&n)throw Error(Q(425))}function ha(){}var Uu=null,qu=null;function Wu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ku=typeof setTimeout=="function"?setTimeout:void 0,ex=typeof clearTimeout=="function"?clearTimeout:void 0,Oh=typeof Promise=="function"?Promise:void 0,tx=typeof queueMicrotask=="function"?queueMicrotask:typeof Oh<"u"?function(e){return Oh.resolve(null).then(e).catch(nx)}:Ku;function nx(e){setTimeout(function(){throw e})}function Yl(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),yi(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);yi(t)}function Ln(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Dh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var So=Math.random().toString(36).slice(2),Kt="__reactFiber$"+So,xi="__reactProps$"+So,hn="__reactContainer$"+So,Xu="__reactEvents$"+So,rx="__reactListeners$"+So,ox="__reactHandles$"+So;function ir(e){var t=e[Kt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[hn]||n[Kt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Dh(e);e!==null;){if(n=e[Kt])return n;e=Dh(e)}return t}e=n,n=e.parentNode}return null}function Bi(e){return e=e[Kt]||e[hn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Dr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Q(33))}function Qa(e){return e[xi]||null}var Yu=[],Lr=-1;function Xn(e){return{current:e}}function ve(e){0>Lr||(e.current=Yu[Lr],Yu[Lr]=null,Lr--)}function me(e,t){Lr++,Yu[Lr]=e.current,e.current=t}var Wn={},Ye=Xn(Wn),it=Xn(!1),pr=Wn;function io(e,t){var n=e.type.contextTypes;if(!n)return Wn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function st(e){return e=e.childContextTypes,e!=null}function pa(){ve(it),ve(Ye)}function Lh(e,t,n){if(Ye.current!==Wn)throw Error(Q(168));me(Ye,t),me(it,n)}function y0(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(Q(108,H_(e)||"Unknown",o));return Ne({},n,r)}function ma(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wn,pr=Ye.current,me(Ye,e),me(it,it.current),!0}function Vh(e,t,n){var r=e.stateNode;if(!r)throw Error(Q(169));n?(e=y0(e,t,pr),r.__reactInternalMemoizedMergedChildContext=e,ve(it),ve(Ye),me(Ye,e)):ve(it),me(it,n)}var an=null,Za=!1,Gl=!1;function v0(e){an===null?an=[e]:an.push(e)}function ix(e){Za=!0,v0(e)}function Yn(){if(!Gl&&an!==null){Gl=!0;var e=0,t=fe;try{var n=an;for(fe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}an=null,Za=!1}catch(o){throw an!==null&&(an=an.slice(e+1)),Bg(Zc,Yn),o}finally{fe=t,Gl=!1}}return null}var Vr=[],Fr=0,ga=null,ya=0,$t=[],xt=0,mr=null,ln=1,un="";function Jn(e,t){Vr[Fr++]=ya,Vr[Fr++]=ga,ga=e,ya=t}function w0(e,t,n){$t[xt++]=ln,$t[xt++]=un,$t[xt++]=mr,mr=e;var r=ln;e=un;var o=32-Vt(r)-1;r&=~(1<<o),n+=1;var i=32-Vt(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,ln=1<<32-Vt(t)+o|n<<o|r,un=i+e}else ln=1<<i|n<<o|r,un=e}function ad(e){e.return!==null&&(Jn(e,1),w0(e,1,0))}function ld(e){for(;e===ga;)ga=Vr[--Fr],Vr[Fr]=null,ya=Vr[--Fr],Vr[Fr]=null;for(;e===mr;)mr=$t[--xt],$t[xt]=null,un=$t[--xt],$t[xt]=null,ln=$t[--xt],$t[xt]=null}var dt=null,ct=null,_e=!1,zt=null;function _0(e,t){var n=St(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Fh(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,dt=e,ct=Ln(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,dt=e,ct=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=mr!==null?{id:ln,overflow:un}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=St(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,dt=e,ct=null,!0):!1;default:return!1}}function Gu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Qu(e){if(_e){var t=ct;if(t){var n=t;if(!Fh(e,t)){if(Gu(e))throw Error(Q(418));t=Ln(n.nextSibling);var r=dt;t&&Fh(e,t)?_0(r,n):(e.flags=e.flags&-4097|2,_e=!1,dt=e)}}else{if(Gu(e))throw Error(Q(418));e.flags=e.flags&-4097|2,_e=!1,dt=e}}}function Hh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;dt=e}function hs(e){if(e!==dt)return!1;if(!_e)return Hh(e),_e=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Wu(e.type,e.memoizedProps)),t&&(t=ct)){if(Gu(e))throw $0(),Error(Q(418));for(;t;)_0(e,t),t=Ln(t.nextSibling)}if(Hh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Q(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ct=Ln(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ct=null}}else ct=dt?Ln(e.stateNode.nextSibling):null;return!0}function $0(){for(var e=ct;e;)e=Ln(e.nextSibling)}function so(){ct=dt=null,_e=!1}function ud(e){zt===null?zt=[e]:zt.push(e)}var sx=vn.ReactCurrentBatchConfig;function Ao(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(Q(309));var r=n.stateNode}if(!r)throw Error(Q(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var a=o.refs;s===null?delete a[i]:a[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(Q(284));if(!n._owner)throw Error(Q(290,e))}return e}function ps(e,t){throw e=Object.prototype.toString.call(t),Error(Q(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Bh(e){var t=e._init;return t(e._payload)}function x0(e){function t(h,m){if(e){var y=h.deletions;y===null?(h.deletions=[m],h.flags|=16):y.push(m)}}function n(h,m){if(!e)return null;for(;m!==null;)t(h,m),m=m.sibling;return null}function r(h,m){for(h=new Map;m!==null;)m.key!==null?h.set(m.key,m):h.set(m.index,m),m=m.sibling;return h}function o(h,m){return h=Bn(h,m),h.index=0,h.sibling=null,h}function i(h,m,y){return h.index=y,e?(y=h.alternate,y!==null?(y=y.index,y<m?(h.flags|=2,m):y):(h.flags|=2,m)):(h.flags|=1048576,m)}function s(h){return e&&h.alternate===null&&(h.flags|=2),h}function a(h,m,y,_){return m===null||m.tag!==6?(m=ru(y,h.mode,_),m.return=h,m):(m=o(m,y),m.return=h,m)}function l(h,m,y,_){var x=y.type;return x===Rr?d(h,m,y.props.children,_,y.key):m!==null&&(m.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Pn&&Bh(x)===m.type)?(_=o(m,y.props),_.ref=Ao(h,m,y),_.return=h,_):(_=Xs(y.type,y.key,y.props,null,h.mode,_),_.ref=Ao(h,m,y),_.return=h,_)}function u(h,m,y,_){return m===null||m.tag!==4||m.stateNode.containerInfo!==y.containerInfo||m.stateNode.implementation!==y.implementation?(m=ou(y,h.mode,_),m.return=h,m):(m=o(m,y.children||[]),m.return=h,m)}function d(h,m,y,_,x){return m===null||m.tag!==7?(m=dr(y,h.mode,_,x),m.return=h,m):(m=o(m,y),m.return=h,m)}function c(h,m,y){if(typeof m=="string"&&m!==""||typeof m=="number")return m=ru(""+m,h.mode,y),m.return=h,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case rs:return y=Xs(m.type,m.key,m.props,null,h.mode,y),y.ref=Ao(h,null,m),y.return=h,y;case Ir:return m=ou(m,h.mode,y),m.return=h,m;case Pn:var _=m._init;return c(h,_(m._payload),y)}if(Uo(m)||Mo(m))return m=dr(m,h.mode,y,null),m.return=h,m;ps(h,m)}return null}function f(h,m,y,_){var x=m!==null?m.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return x!==null?null:a(h,m,""+y,_);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case rs:return y.key===x?l(h,m,y,_):null;case Ir:return y.key===x?u(h,m,y,_):null;case Pn:return x=y._init,f(h,m,x(y._payload),_)}if(Uo(y)||Mo(y))return x!==null?null:d(h,m,y,_,null);ps(h,y)}return null}function p(h,m,y,_,x){if(typeof _=="string"&&_!==""||typeof _=="number")return h=h.get(y)||null,a(m,h,""+_,x);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case rs:return h=h.get(_.key===null?y:_.key)||null,l(m,h,_,x);case Ir:return h=h.get(_.key===null?y:_.key)||null,u(m,h,_,x);case Pn:var N=_._init;return p(h,m,y,N(_._payload),x)}if(Uo(_)||Mo(_))return h=h.get(y)||null,d(m,h,_,x,null);ps(m,_)}return null}function g(h,m,y,_){for(var x=null,N=null,C=m,z=m=0,L=null;C!==null&&z<y.length;z++){C.index>z?(L=C,C=null):L=C.sibling;var q=f(h,C,y[z],_);if(q===null){C===null&&(C=L);break}e&&C&&q.alternate===null&&t(h,C),m=i(q,m,z),N===null?x=q:N.sibling=q,N=q,C=L}if(z===y.length)return n(h,C),_e&&Jn(h,z),x;if(C===null){for(;z<y.length;z++)C=c(h,y[z],_),C!==null&&(m=i(C,m,z),N===null?x=C:N.sibling=C,N=C);return _e&&Jn(h,z),x}for(C=r(h,C);z<y.length;z++)L=p(C,h,z,y[z],_),L!==null&&(e&&L.alternate!==null&&C.delete(L.key===null?z:L.key),m=i(L,m,z),N===null?x=L:N.sibling=L,N=L);return e&&C.forEach(function(b){return t(h,b)}),_e&&Jn(h,z),x}function v(h,m,y,_){var x=Mo(y);if(typeof x!="function")throw Error(Q(150));if(y=x.call(y),y==null)throw Error(Q(151));for(var N=x=null,C=m,z=m=0,L=null,q=y.next();C!==null&&!q.done;z++,q=y.next()){C.index>z?(L=C,C=null):L=C.sibling;var b=f(h,C,q.value,_);if(b===null){C===null&&(C=L);break}e&&C&&b.alternate===null&&t(h,C),m=i(b,m,z),N===null?x=b:N.sibling=b,N=b,C=L}if(q.done)return n(h,C),_e&&Jn(h,z),x;if(C===null){for(;!q.done;z++,q=y.next())q=c(h,q.value,_),q!==null&&(m=i(q,m,z),N===null?x=q:N.sibling=q,N=q);return _e&&Jn(h,z),x}for(C=r(h,C);!q.done;z++,q=y.next())q=p(C,h,z,q.value,_),q!==null&&(e&&q.alternate!==null&&C.delete(q.key===null?z:q.key),m=i(q,m,z),N===null?x=q:N.sibling=q,N=q);return e&&C.forEach(function(j){return t(h,j)}),_e&&Jn(h,z),x}function w(h,m,y,_){if(typeof y=="object"&&y!==null&&y.type===Rr&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case rs:e:{for(var x=y.key,N=m;N!==null;){if(N.key===x){if(x=y.type,x===Rr){if(N.tag===7){n(h,N.sibling),m=o(N,y.props.children),m.return=h,h=m;break e}}else if(N.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Pn&&Bh(x)===N.type){n(h,N.sibling),m=o(N,y.props),m.ref=Ao(h,N,y),m.return=h,h=m;break e}n(h,N);break}else t(h,N);N=N.sibling}y.type===Rr?(m=dr(y.props.children,h.mode,_,y.key),m.return=h,h=m):(_=Xs(y.type,y.key,y.props,null,h.mode,_),_.ref=Ao(h,m,y),_.return=h,h=_)}return s(h);case Ir:e:{for(N=y.key;m!==null;){if(m.key===N)if(m.tag===4&&m.stateNode.containerInfo===y.containerInfo&&m.stateNode.implementation===y.implementation){n(h,m.sibling),m=o(m,y.children||[]),m.return=h,h=m;break e}else{n(h,m);break}else t(h,m);m=m.sibling}m=ou(y,h.mode,_),m.return=h,h=m}return s(h);case Pn:return N=y._init,w(h,m,N(y._payload),_)}if(Uo(y))return g(h,m,y,_);if(Mo(y))return v(h,m,y,_);ps(h,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,m!==null&&m.tag===6?(n(h,m.sibling),m=o(m,y),m.return=h,h=m):(n(h,m),m=ru(y,h.mode,_),m.return=h,h=m),s(h)):n(h,m)}return w}var ao=x0(!0),S0=x0(!1),va=Xn(null),wa=null,Hr=null,cd=null;function dd(){cd=Hr=wa=null}function fd(e){var t=va.current;ve(va),e._currentValue=t}function Zu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Zr(e,t){wa=e,cd=Hr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(rt=!0),e.firstContext=null)}function kt(e){var t=e._currentValue;if(cd!==e)if(e={context:e,memoizedValue:t,next:null},Hr===null){if(wa===null)throw Error(Q(308));Hr=e,wa.dependencies={lanes:0,firstContext:e}}else Hr=Hr.next=e;return t}var sr=null;function hd(e){sr===null?sr=[e]:sr.push(e)}function E0(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,hd(t)):(n.next=o.next,o.next=n),t.interleaved=n,pn(e,r)}function pn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Cn=!1;function pd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function k0(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function dn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Vn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,de&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,pn(e,n)}return o=r.interleaved,o===null?(t.next=t,hd(r)):(t.next=o.next,o.next=t),r.interleaved=t,pn(e,n)}function Hs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Jc(e,n)}}function Uh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function _a(e,t,n,r){var o=e.updateQueue;Cn=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?i=u:s.next=u,s=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==s&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(i!==null){var c=o.baseState;s=0,d=u=l=null,a=i;do{var f=a.lane,p=a.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=e,v=a;switch(f=t,p=n,v.tag){case 1:if(g=v.payload,typeof g=="function"){c=g.call(p,c,f);break e}c=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=v.payload,f=typeof g=="function"?g.call(p,c,f):g,f==null)break e;c=Ne({},c,f);break e;case 2:Cn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[a]:f.push(a))}else p={eventTime:p,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=p,l=c):d=d.next=p,s|=f;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;f=a,a=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(d===null&&(l=c),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);yr|=s,e.lanes=s,e.memoizedState=c}}function qh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(Q(191,o));o.call(r)}}}var Ui={},Yt=Xn(Ui),Si=Xn(Ui),Ei=Xn(Ui);function ar(e){if(e===Ui)throw Error(Q(174));return e}function md(e,t){switch(me(Ei,t),me(Si,e),me(Yt,Ui),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Tu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Tu(t,e)}ve(Yt),me(Yt,t)}function lo(){ve(Yt),ve(Si),ve(Ei)}function N0(e){ar(Ei.current);var t=ar(Yt.current),n=Tu(t,e.type);t!==n&&(me(Si,e),me(Yt,n))}function gd(e){Si.current===e&&(ve(Yt),ve(Si))}var Ee=Xn(0);function $a(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ql=[];function yd(){for(var e=0;e<Ql.length;e++)Ql[e]._workInProgressVersionPrimary=null;Ql.length=0}var Bs=vn.ReactCurrentDispatcher,Zl=vn.ReactCurrentBatchConfig,gr=0,ke=null,Re=null,De=null,xa=!1,ni=!1,ki=0,ax=0;function qe(){throw Error(Q(321))}function vd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ht(e[n],t[n]))return!1;return!0}function wd(e,t,n,r,o,i){if(gr=i,ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Bs.current=e===null||e.memoizedState===null?dx:fx,e=n(r,o),ni){i=0;do{if(ni=!1,ki=0,25<=i)throw Error(Q(301));i+=1,De=Re=null,t.updateQueue=null,Bs.current=hx,e=n(r,o)}while(ni)}if(Bs.current=Sa,t=Re!==null&&Re.next!==null,gr=0,De=Re=ke=null,xa=!1,t)throw Error(Q(300));return e}function _d(){var e=ki!==0;return ki=0,e}function qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return De===null?ke.memoizedState=De=e:De=De.next=e,De}function Nt(){if(Re===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=Re.next;var t=De===null?ke.memoizedState:De.next;if(t!==null)De=t,Re=e;else{if(e===null)throw Error(Q(310));Re=e,e={memoizedState:Re.memoizedState,baseState:Re.baseState,baseQueue:Re.baseQueue,queue:Re.queue,next:null},De===null?ke.memoizedState=De=e:De=De.next=e}return De}function Ni(e,t){return typeof t=="function"?t(e):t}function Jl(e){var t=Nt(),n=t.queue;if(n===null)throw Error(Q(311));n.lastRenderedReducer=e;var r=Re,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var a=s=null,l=null,u=i;do{var d=u.lane;if((gr&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var c={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=c,s=r):l=l.next=c,ke.lanes|=d,yr|=d}u=u.next}while(u!==null&&u!==i);l===null?s=r:l.next=a,Ht(r,t.memoizedState)||(rt=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,ke.lanes|=i,yr|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function eu(e){var t=Nt(),n=t.queue;if(n===null)throw Error(Q(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);Ht(i,t.memoizedState)||(rt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function P0(){}function C0(e,t){var n=ke,r=Nt(),o=t(),i=!Ht(r.memoizedState,o);if(i&&(r.memoizedState=o,rt=!0),r=r.queue,$d(M0.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||De!==null&&De.memoizedState.tag&1){if(n.flags|=2048,Pi(9,j0.bind(null,n,r,o,t),void 0,null),Le===null)throw Error(Q(349));gr&30||b0(n,t,o)}return o}function b0(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ke.updateQueue,t===null?(t={lastEffect:null,stores:null},ke.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function j0(e,t,n,r){t.value=n,t.getSnapshot=r,T0(t)&&I0(e)}function M0(e,t,n){return n(function(){T0(t)&&I0(e)})}function T0(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ht(e,n)}catch{return!0}}function I0(e){var t=pn(e,1);t!==null&&Ft(t,e,1,-1)}function Wh(e){var t=qt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ni,lastRenderedState:e},t.queue=e,e=e.dispatch=cx.bind(null,ke,e),[t.memoizedState,e]}function Pi(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ke.updateQueue,t===null?(t={lastEffect:null,stores:null},ke.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function R0(){return Nt().memoizedState}function Us(e,t,n,r){var o=qt();ke.flags|=e,o.memoizedState=Pi(1|t,n,void 0,r===void 0?null:r)}function Ja(e,t,n,r){var o=Nt();r=r===void 0?null:r;var i=void 0;if(Re!==null){var s=Re.memoizedState;if(i=s.destroy,r!==null&&vd(r,s.deps)){o.memoizedState=Pi(t,n,i,r);return}}ke.flags|=e,o.memoizedState=Pi(1|t,n,i,r)}function Kh(e,t){return Us(8390656,8,e,t)}function $d(e,t){return Ja(2048,8,e,t)}function z0(e,t){return Ja(4,2,e,t)}function A0(e,t){return Ja(4,4,e,t)}function O0(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function D0(e,t,n){return n=n!=null?n.concat([e]):null,Ja(4,4,O0.bind(null,t,e),n)}function xd(){}function L0(e,t){var n=Nt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&vd(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function V0(e,t){var n=Nt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&vd(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function F0(e,t,n){return gr&21?(Ht(n,t)||(n=Wg(),ke.lanes|=n,yr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,rt=!0),e.memoizedState=n)}function lx(e,t){var n=fe;fe=n!==0&&4>n?n:4,e(!0);var r=Zl.transition;Zl.transition={};try{e(!1),t()}finally{fe=n,Zl.transition=r}}function H0(){return Nt().memoizedState}function ux(e,t,n){var r=Hn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},B0(e))U0(t,n);else if(n=E0(e,t,n,r),n!==null){var o=Ze();Ft(n,e,r,o),q0(n,t,r)}}function cx(e,t,n){var r=Hn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(B0(e))U0(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,Ht(a,s)){var l=t.interleaved;l===null?(o.next=o,hd(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=E0(e,t,o,r),n!==null&&(o=Ze(),Ft(n,e,r,o),q0(n,t,r))}}function B0(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function U0(e,t){ni=xa=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function q0(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Jc(e,n)}}var Sa={readContext:kt,useCallback:qe,useContext:qe,useEffect:qe,useImperativeHandle:qe,useInsertionEffect:qe,useLayoutEffect:qe,useMemo:qe,useReducer:qe,useRef:qe,useState:qe,useDebugValue:qe,useDeferredValue:qe,useTransition:qe,useMutableSource:qe,useSyncExternalStore:qe,useId:qe,unstable_isNewReconciler:!1},dx={readContext:kt,useCallback:function(e,t){return qt().memoizedState=[e,t===void 0?null:t],e},useContext:kt,useEffect:Kh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Us(4194308,4,O0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Us(4194308,4,e,t)},useInsertionEffect:function(e,t){return Us(4,2,e,t)},useMemo:function(e,t){var n=qt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=qt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ux.bind(null,ke,e),[r.memoizedState,e]},useRef:function(e){var t=qt();return e={current:e},t.memoizedState=e},useState:Wh,useDebugValue:xd,useDeferredValue:function(e){return qt().memoizedState=e},useTransition:function(){var e=Wh(!1),t=e[0];return e=lx.bind(null,e[1]),qt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ke,o=qt();if(_e){if(n===void 0)throw Error(Q(407));n=n()}else{if(n=t(),Le===null)throw Error(Q(349));gr&30||b0(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Kh(M0.bind(null,r,i,e),[e]),r.flags|=2048,Pi(9,j0.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=qt(),t=Le.identifierPrefix;if(_e){var n=un,r=ln;n=(r&~(1<<32-Vt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ki++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=ax++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},fx={readContext:kt,useCallback:L0,useContext:kt,useEffect:$d,useImperativeHandle:D0,useInsertionEffect:z0,useLayoutEffect:A0,useMemo:V0,useReducer:Jl,useRef:R0,useState:function(){return Jl(Ni)},useDebugValue:xd,useDeferredValue:function(e){var t=Nt();return F0(t,Re.memoizedState,e)},useTransition:function(){var e=Jl(Ni)[0],t=Nt().memoizedState;return[e,t]},useMutableSource:P0,useSyncExternalStore:C0,useId:H0,unstable_isNewReconciler:!1},hx={readContext:kt,useCallback:L0,useContext:kt,useEffect:$d,useImperativeHandle:D0,useInsertionEffect:z0,useLayoutEffect:A0,useMemo:V0,useReducer:eu,useRef:R0,useState:function(){return eu(Ni)},useDebugValue:xd,useDeferredValue:function(e){var t=Nt();return Re===null?t.memoizedState=e:F0(t,Re.memoizedState,e)},useTransition:function(){var e=eu(Ni)[0],t=Nt().memoizedState;return[e,t]},useMutableSource:P0,useSyncExternalStore:C0,useId:H0,unstable_isNewReconciler:!1};function Tt(e,t){if(e&&e.defaultProps){t=Ne({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ju(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ne({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var el={isMounted:function(e){return(e=e._reactInternals)?Pr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ze(),o=Hn(e),i=dn(r,o);i.payload=t,n!=null&&(i.callback=n),t=Vn(e,i,o),t!==null&&(Ft(t,e,o,r),Hs(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ze(),o=Hn(e),i=dn(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Vn(e,i,o),t!==null&&(Ft(t,e,o,r),Hs(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ze(),r=Hn(e),o=dn(n,r);o.tag=2,t!=null&&(o.callback=t),t=Vn(e,o,r),t!==null&&(Ft(t,e,r,n),Hs(t,e,r))}};function Xh(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!wi(n,r)||!wi(o,i):!0}function W0(e,t,n){var r=!1,o=Wn,i=t.contextType;return typeof i=="object"&&i!==null?i=kt(i):(o=st(t)?pr:Ye.current,r=t.contextTypes,i=(r=r!=null)?io(e,o):Wn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=el,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Yh(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&el.enqueueReplaceState(t,t.state,null)}function ec(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},pd(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=kt(i):(i=st(t)?pr:Ye.current,o.context=io(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Ju(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&el.enqueueReplaceState(o,o.state,null),_a(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function uo(e,t){try{var n="",r=t;do n+=F_(r),r=r.return;while(r);var o=n}catch(i){o=`
39
+ Error generating stack: `+i.message+`
40
+ `+i.stack}return{value:e,source:t,stack:o,digest:null}}function tu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function tc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var px=typeof WeakMap=="function"?WeakMap:Map;function K0(e,t,n){n=dn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ka||(ka=!0,dc=r),tc(e,t)},n}function X0(e,t,n){n=dn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){tc(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){tc(e,t),typeof r!="function"&&(Fn===null?Fn=new Set([this]):Fn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Gh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new px;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Cx.bind(null,e,t,n),t.then(e,e))}function Qh(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Zh(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=dn(-1,1),t.tag=2,Vn(n,t,1))),n.lanes|=1),e)}var mx=vn.ReactCurrentOwner,rt=!1;function Ge(e,t,n,r){t.child=e===null?S0(t,null,n,r):ao(t,e.child,n,r)}function Jh(e,t,n,r,o){n=n.render;var i=t.ref;return Zr(t,o),r=wd(e,t,n,r,i,o),n=_d(),e!==null&&!rt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,mn(e,t,o)):(_e&&n&&ad(t),t.flags|=1,Ge(e,t,r,o),t.child)}function ep(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!jd(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Y0(e,t,i,r,o)):(e=Xs(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:wi,n(s,r)&&e.ref===t.ref)return mn(e,t,o)}return t.flags|=1,e=Bn(i,r),e.ref=t.ref,e.return=t,t.child=e}function Y0(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(wi(i,r)&&e.ref===t.ref)if(rt=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(rt=!0);else return t.lanes=e.lanes,mn(e,t,o)}return nc(e,t,n,r,o)}function G0(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},me(Ur,lt),lt|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,me(Ur,lt),lt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,me(Ur,lt),lt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,me(Ur,lt),lt|=r;return Ge(e,t,o,n),t.child}function Q0(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function nc(e,t,n,r,o){var i=st(n)?pr:Ye.current;return i=io(t,i),Zr(t,o),n=wd(e,t,n,r,i,o),r=_d(),e!==null&&!rt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,mn(e,t,o)):(_e&&r&&ad(t),t.flags|=1,Ge(e,t,n,o),t.child)}function tp(e,t,n,r,o){if(st(n)){var i=!0;ma(t)}else i=!1;if(Zr(t,o),t.stateNode===null)qs(e,t),W0(t,n,r),ec(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=kt(u):(u=st(n)?pr:Ye.current,u=io(t,u));var d=n.getDerivedStateFromProps,c=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";c||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==u)&&Yh(t,s,r,u),Cn=!1;var f=t.memoizedState;s.state=f,_a(t,r,s,o),l=t.memoizedState,a!==r||f!==l||it.current||Cn?(typeof d=="function"&&(Ju(t,n,d,r),l=t.memoizedState),(a=Cn||Xh(t,n,a,r,f,l,u))?(c||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=u,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,k0(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:Tt(t.type,a),s.props=u,c=t.pendingProps,f=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=kt(l):(l=st(n)?pr:Ye.current,l=io(t,l));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==c||f!==l)&&Yh(t,s,r,l),Cn=!1,f=t.memoizedState,s.state=f,_a(t,r,s,o);var g=t.memoizedState;a!==c||f!==g||it.current||Cn?(typeof p=="function"&&(Ju(t,n,p,r),g=t.memoizedState),(u=Cn||Xh(t,n,u,r,f,g,l)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,g,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,g,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),s.props=r,s.state=g,s.context=l,r=u):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return rc(e,t,n,r,i,o)}function rc(e,t,n,r,o,i){Q0(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&Vh(t,n,!1),mn(e,t,i);r=t.stateNode,mx.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=ao(t,e.child,null,i),t.child=ao(t,null,a,i)):Ge(e,t,a,i),t.memoizedState=r.state,o&&Vh(t,n,!0),t.child}function Z0(e){var t=e.stateNode;t.pendingContext?Lh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Lh(e,t.context,!1),md(e,t.containerInfo)}function np(e,t,n,r,o){return so(),ud(o),t.flags|=256,Ge(e,t,n,r),t.child}var oc={dehydrated:null,treeContext:null,retryLane:0};function ic(e){return{baseLanes:e,cachePool:null,transitions:null}}function J0(e,t,n){var r=t.pendingProps,o=Ee.current,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),me(Ee,o&1),e===null)return Qu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=rl(s,r,0,null),e=dr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=ic(n),t.memoizedState=oc,e):Sd(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return gx(e,t,s,r,a,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,a=o.sibling;var l={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Bn(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=Bn(a,i):(i=dr(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?ic(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=oc,r}return i=e.child,e=i.sibling,r=Bn(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Sd(e,t){return t=rl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ms(e,t,n,r){return r!==null&&ud(r),ao(t,e.child,null,n),e=Sd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function gx(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=tu(Error(Q(422))),ms(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=rl({mode:"visible",children:r.children},o,0,null),i=dr(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&ao(t,e.child,null,s),t.child.memoizedState=ic(s),t.memoizedState=oc,i);if(!(t.mode&1))return ms(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(Q(419)),r=tu(i,r,void 0),ms(e,t,s,r)}if(a=(s&e.childLanes)!==0,rt||a){if(r=Le,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,pn(e,o),Ft(r,e,o,-1))}return bd(),r=tu(Error(Q(421))),ms(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=bx.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,ct=Ln(o.nextSibling),dt=t,_e=!0,zt=null,e!==null&&($t[xt++]=ln,$t[xt++]=un,$t[xt++]=mr,ln=e.id,un=e.overflow,mr=t),t=Sd(t,r.children),t.flags|=4096,t)}function rp(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Zu(e.return,t,n)}function nu(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function ey(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Ge(e,t,r.children,n),r=Ee.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rp(e,n,t);else if(e.tag===19)rp(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(me(Ee,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&$a(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),nu(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&$a(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}nu(t,!0,n,null,i);break;case"together":nu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function qs(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function mn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),yr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Q(153));if(t.child!==null){for(e=t.child,n=Bn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Bn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function yx(e,t,n){switch(t.tag){case 3:Z0(t),so();break;case 5:N0(t);break;case 1:st(t.type)&&ma(t);break;case 4:md(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;me(va,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(me(Ee,Ee.current&1),t.flags|=128,null):n&t.child.childLanes?J0(e,t,n):(me(Ee,Ee.current&1),e=mn(e,t,n),e!==null?e.sibling:null);me(Ee,Ee.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return ey(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),me(Ee,Ee.current),r)break;return null;case 22:case 23:return t.lanes=0,G0(e,t,n)}return mn(e,t,n)}var ty,sc,ny,ry;ty=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};sc=function(){};ny=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,ar(Yt.current);var i=null;switch(n){case"input":o=Cu(e,o),r=Cu(e,r),i=[];break;case"select":o=Ne({},o,{value:void 0}),r=Ne({},r,{value:void 0}),i=[];break;case"textarea":o=Mu(e,o),r=Mu(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ha)}Iu(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var a=o[u];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(fi.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var l=r[u];if(a=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(i||(i=[]),i.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(fi.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&ge("scroll",e),i||a===l||(i=[])):(i=i||[]).push(u,l))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};ry=function(e,t,n,r){n!==r&&(t.flags|=4)};function Oo(e,t){if(!_e)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function We(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function vx(e,t,n){var r=t.pendingProps;switch(ld(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(t),null;case 1:return st(t.type)&&pa(),We(t),null;case 3:return r=t.stateNode,lo(),ve(it),ve(Ye),yd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(hs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,zt!==null&&(pc(zt),zt=null))),sc(e,t),We(t),null;case 5:gd(t);var o=ar(Ei.current);if(n=t.type,e!==null&&t.stateNode!=null)ny(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Q(166));return We(t),null}if(e=ar(Yt.current),hs(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Kt]=t,r[xi]=i,e=(t.mode&1)!==0,n){case"dialog":ge("cancel",r),ge("close",r);break;case"iframe":case"object":case"embed":ge("load",r);break;case"video":case"audio":for(o=0;o<Wo.length;o++)ge(Wo[o],r);break;case"source":ge("error",r);break;case"img":case"image":case"link":ge("error",r),ge("load",r);break;case"details":ge("toggle",r);break;case"input":fh(r,i),ge("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ge("invalid",r);break;case"textarea":ph(r,i),ge("invalid",r)}Iu(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];s==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&fs(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&fs(r.textContent,a,e),o=["children",""+a]):fi.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&ge("scroll",r)}switch(n){case"input":os(r),hh(r,i,!0);break;case"textarea":os(r),mh(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=ha)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Mg(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Kt]=t,e[xi]=r,ty(e,t,!1,!1),t.stateNode=e;e:{switch(s=Ru(n,r),n){case"dialog":ge("cancel",e),ge("close",e),o=r;break;case"iframe":case"object":case"embed":ge("load",e),o=r;break;case"video":case"audio":for(o=0;o<Wo.length;o++)ge(Wo[o],e);o=r;break;case"source":ge("error",e),o=r;break;case"img":case"image":case"link":ge("error",e),ge("load",e),o=r;break;case"details":ge("toggle",e),o=r;break;case"input":fh(e,r),o=Cu(e,r),ge("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Ne({},r,{value:void 0}),ge("invalid",e);break;case"textarea":ph(e,r),o=Mu(e,r),ge("invalid",e);break;default:o=r}Iu(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?Rg(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Tg(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&hi(e,l):typeof l=="number"&&hi(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(fi.hasOwnProperty(i)?l!=null&&i==="onScroll"&&ge("scroll",e):l!=null&&Kc(e,i,l,s))}switch(n){case"input":os(e),hh(e,r,!1);break;case"textarea":os(e),mh(e);break;case"option":r.value!=null&&e.setAttribute("value",""+qn(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Xr(e,!!r.multiple,i,!1):r.defaultValue!=null&&Xr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=ha)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return We(t),null;case 6:if(e&&t.stateNode!=null)ry(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Q(166));if(n=ar(Ei.current),ar(Yt.current),hs(t)){if(r=t.stateNode,n=t.memoizedProps,r[Kt]=t,(i=r.nodeValue!==n)&&(e=dt,e!==null))switch(e.tag){case 3:fs(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&fs(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Kt]=t,t.stateNode=r}return We(t),null;case 13:if(ve(Ee),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(_e&&ct!==null&&t.mode&1&&!(t.flags&128))$0(),so(),t.flags|=98560,i=!1;else if(i=hs(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(Q(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(Q(317));i[Kt]=t}else so(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;We(t),i=!1}else zt!==null&&(pc(zt),zt=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ee.current&1?Ae===0&&(Ae=3):bd())),t.updateQueue!==null&&(t.flags|=4),We(t),null);case 4:return lo(),sc(e,t),e===null&&_i(t.stateNode.containerInfo),We(t),null;case 10:return fd(t.type._context),We(t),null;case 17:return st(t.type)&&pa(),We(t),null;case 19:if(ve(Ee),i=t.memoizedState,i===null)return We(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)Oo(i,!1);else{if(Ae!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=$a(e),s!==null){for(t.flags|=128,Oo(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return me(Ee,Ee.current&1|2),t.child}e=e.sibling}i.tail!==null&&je()>co&&(t.flags|=128,r=!0,Oo(i,!1),t.lanes=4194304)}else{if(!r)if(e=$a(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Oo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!_e)return We(t),null}else 2*je()-i.renderingStartTime>co&&n!==1073741824&&(t.flags|=128,r=!0,Oo(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=je(),t.sibling=null,n=Ee.current,me(Ee,r?n&1|2:n&1),t):(We(t),null);case 22:case 23:return Cd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?lt&1073741824&&(We(t),t.subtreeFlags&6&&(t.flags|=8192)):We(t),null;case 24:return null;case 25:return null}throw Error(Q(156,t.tag))}function wx(e,t){switch(ld(t),t.tag){case 1:return st(t.type)&&pa(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return lo(),ve(it),ve(Ye),yd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return gd(t),null;case 13:if(ve(Ee),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Q(340));so()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ve(Ee),null;case 4:return lo(),null;case 10:return fd(t.type._context),null;case 22:case 23:return Cd(),null;case 24:return null;default:return null}}var gs=!1,Xe=!1,_x=typeof WeakSet=="function"?WeakSet:Set,re=null;function Br(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ce(e,t,r)}else n.current=null}function ac(e,t,n){try{n()}catch(r){Ce(e,t,r)}}var op=!1;function $x(e,t){if(Uu=ca,e=l0(),sd(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,d=0,c=e,f=null;t:for(;;){for(var p;c!==n||o!==0&&c.nodeType!==3||(a=s+o),c!==i||r!==0&&c.nodeType!==3||(l=s+r),c.nodeType===3&&(s+=c.nodeValue.length),(p=c.firstChild)!==null;)f=c,c=p;for(;;){if(c===e)break t;if(f===n&&++u===o&&(a=s),f===i&&++d===r&&(l=s),(p=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(qu={focusedElem:e,selectionRange:n},ca=!1,re=t;re!==null;)if(t=re,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,re=e;else for(;re!==null;){t=re;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var v=g.memoizedProps,w=g.memoizedState,h=t.stateNode,m=h.getSnapshotBeforeUpdate(t.elementType===t.type?v:Tt(t.type,v),w);h.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Q(163))}}catch(_){Ce(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,re=e;break}re=t.return}return g=op,op=!1,g}function ri(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&ac(t,n,i)}o=o.next}while(o!==r)}}function tl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function lc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function oy(e){var t=e.alternate;t!==null&&(e.alternate=null,oy(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Kt],delete t[xi],delete t[Xu],delete t[rx],delete t[ox])),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 iy(e){return e.tag===5||e.tag===3||e.tag===4}function ip(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||iy(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 uc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ha));else if(r!==4&&(e=e.child,e!==null))for(uc(e,t,n),e=e.sibling;e!==null;)uc(e,t,n),e=e.sibling}function cc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(cc(e,t,n),e=e.sibling;e!==null;)cc(e,t,n),e=e.sibling}var Fe=null,It=!1;function $n(e,t,n){for(n=n.child;n!==null;)sy(e,t,n),n=n.sibling}function sy(e,t,n){if(Xt&&typeof Xt.onCommitFiberUnmount=="function")try{Xt.onCommitFiberUnmount(Ka,n)}catch{}switch(n.tag){case 5:Xe||Br(n,t);case 6:var r=Fe,o=It;Fe=null,$n(e,t,n),Fe=r,It=o,Fe!==null&&(It?(e=Fe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Fe.removeChild(n.stateNode));break;case 18:Fe!==null&&(It?(e=Fe,n=n.stateNode,e.nodeType===8?Yl(e.parentNode,n):e.nodeType===1&&Yl(e,n),yi(e)):Yl(Fe,n.stateNode));break;case 4:r=Fe,o=It,Fe=n.stateNode.containerInfo,It=!0,$n(e,t,n),Fe=r,It=o;break;case 0:case 11:case 14:case 15:if(!Xe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&ac(n,t,s),o=o.next}while(o!==r)}$n(e,t,n);break;case 1:if(!Xe&&(Br(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ce(n,t,a)}$n(e,t,n);break;case 21:$n(e,t,n);break;case 22:n.mode&1?(Xe=(r=Xe)||n.memoizedState!==null,$n(e,t,n),Xe=r):$n(e,t,n);break;default:$n(e,t,n)}}function sp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new _x),t.forEach(function(r){var o=jx.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Pt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:Fe=a.stateNode,It=!1;break e;case 3:Fe=a.stateNode.containerInfo,It=!0;break e;case 4:Fe=a.stateNode.containerInfo,It=!0;break e}a=a.return}if(Fe===null)throw Error(Q(160));sy(i,s,o),Fe=null,It=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){Ce(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ay(t,e),t=t.sibling}function ay(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Pt(t,e),Ut(e),r&4){try{ri(3,e,e.return),tl(3,e)}catch(v){Ce(e,e.return,v)}try{ri(5,e,e.return)}catch(v){Ce(e,e.return,v)}}break;case 1:Pt(t,e),Ut(e),r&512&&n!==null&&Br(n,n.return);break;case 5:if(Pt(t,e),Ut(e),r&512&&n!==null&&Br(n,n.return),e.flags&32){var o=e.stateNode;try{hi(o,"")}catch(v){Ce(e,e.return,v)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&bg(o,i),Ru(a,s);var u=Ru(a,i);for(s=0;s<l.length;s+=2){var d=l[s],c=l[s+1];d==="style"?Rg(o,c):d==="dangerouslySetInnerHTML"?Tg(o,c):d==="children"?hi(o,c):Kc(o,d,c,u)}switch(a){case"input":bu(o,i);break;case"textarea":jg(o,i);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?Xr(o,!!i.multiple,p,!1):f!==!!i.multiple&&(i.defaultValue!=null?Xr(o,!!i.multiple,i.defaultValue,!0):Xr(o,!!i.multiple,i.multiple?[]:"",!1))}o[xi]=i}catch(v){Ce(e,e.return,v)}}break;case 6:if(Pt(t,e),Ut(e),r&4){if(e.stateNode===null)throw Error(Q(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){Ce(e,e.return,v)}}break;case 3:if(Pt(t,e),Ut(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{yi(t.containerInfo)}catch(v){Ce(e,e.return,v)}break;case 4:Pt(t,e),Ut(e);break;case 13:Pt(t,e),Ut(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Nd=je())),r&4&&sp(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Xe=(u=Xe)||d,Pt(t,e),Xe=u):Pt(t,e),Ut(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(re=e,d=e.child;d!==null;){for(c=re=d;re!==null;){switch(f=re,p=f.child,f.tag){case 0:case 11:case 14:case 15:ri(4,f,f.return);break;case 1:Br(f,f.return);var g=f.stateNode;if(typeof g.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(v){Ce(r,n,v)}}break;case 5:Br(f,f.return);break;case 22:if(f.memoizedState!==null){lp(c);continue}}p!==null?(p.return=f,re=p):lp(c)}d=d.sibling}e:for(d=null,c=e;;){if(c.tag===5){if(d===null){d=c;try{o=c.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=c.stateNode,l=c.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Ig("display",s))}catch(v){Ce(e,e.return,v)}}}else if(c.tag===6){if(d===null)try{c.stateNode.nodeValue=u?"":c.memoizedProps}catch(v){Ce(e,e.return,v)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===e)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===e)break e;for(;c.sibling===null;){if(c.return===null||c.return===e)break e;d===c&&(d=null),c=c.return}d===c&&(d=null),c.sibling.return=c.return,c=c.sibling}}break;case 19:Pt(t,e),Ut(e),r&4&&sp(e);break;case 21:break;default:Pt(t,e),Ut(e)}}function Ut(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(iy(n)){var r=n;break e}n=n.return}throw Error(Q(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(hi(o,""),r.flags&=-33);var i=ip(e);cc(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=ip(e);uc(e,a,s);break;default:throw Error(Q(161))}}catch(l){Ce(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function xx(e,t,n){re=e,ly(e)}function ly(e,t,n){for(var r=(e.mode&1)!==0;re!==null;){var o=re,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||gs;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||Xe;a=gs;var u=Xe;if(gs=s,(Xe=l)&&!u)for(re=o;re!==null;)s=re,l=s.child,s.tag===22&&s.memoizedState!==null?up(o):l!==null?(l.return=s,re=l):up(o);for(;i!==null;)re=i,ly(i),i=i.sibling;re=o,gs=a,Xe=u}ap(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,re=i):ap(e)}}function ap(e){for(;re!==null;){var t=re;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Xe||tl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Xe)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Tt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&qh(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}qh(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var c=d.dehydrated;c!==null&&yi(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Q(163))}Xe||t.flags&512&&lc(t)}catch(f){Ce(t,t.return,f)}}if(t===e){re=null;break}if(n=t.sibling,n!==null){n.return=t.return,re=n;break}re=t.return}}function lp(e){for(;re!==null;){var t=re;if(t===e){re=null;break}var n=t.sibling;if(n!==null){n.return=t.return,re=n;break}re=t.return}}function up(e){for(;re!==null;){var t=re;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{tl(4,t)}catch(l){Ce(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){Ce(t,o,l)}}var i=t.return;try{lc(t)}catch(l){Ce(t,i,l)}break;case 5:var s=t.return;try{lc(t)}catch(l){Ce(t,s,l)}}}catch(l){Ce(t,t.return,l)}if(t===e){re=null;break}var a=t.sibling;if(a!==null){a.return=t.return,re=a;break}re=t.return}}var Sx=Math.ceil,Ea=vn.ReactCurrentDispatcher,Ed=vn.ReactCurrentOwner,Et=vn.ReactCurrentBatchConfig,de=0,Le=null,Te=null,Be=0,lt=0,Ur=Xn(0),Ae=0,Ci=null,yr=0,nl=0,kd=0,oi=null,nt=null,Nd=0,co=1/0,sn=null,ka=!1,dc=null,Fn=null,ys=!1,In=null,Na=0,ii=0,fc=null,Ws=-1,Ks=0;function Ze(){return de&6?je():Ws!==-1?Ws:Ws=je()}function Hn(e){return e.mode&1?de&2&&Be!==0?Be&-Be:sx.transition!==null?(Ks===0&&(Ks=Wg()),Ks):(e=fe,e!==0||(e=window.event,e=e===void 0?16:Jg(e.type)),e):1}function Ft(e,t,n,r){if(50<ii)throw ii=0,fc=null,Error(Q(185));Fi(e,n,r),(!(de&2)||e!==Le)&&(e===Le&&(!(de&2)&&(nl|=n),Ae===4&&jn(e,Be)),at(e,r),n===1&&de===0&&!(t.mode&1)&&(co=je()+500,Za&&Yn()))}function at(e,t){var n=e.callbackNode;s$(e,t);var r=ua(e,e===Le?Be:0);if(r===0)n!==null&&vh(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&vh(n),t===1)e.tag===0?ix(cp.bind(null,e)):v0(cp.bind(null,e)),tx(function(){!(de&6)&&Yn()}),n=null;else{switch(Kg(r)){case 1:n=Zc;break;case 4:n=Ug;break;case 16:n=la;break;case 536870912:n=qg;break;default:n=la}n=gy(n,uy.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function uy(e,t){if(Ws=-1,Ks=0,de&6)throw Error(Q(327));var n=e.callbackNode;if(Jr()&&e.callbackNode!==n)return null;var r=ua(e,e===Le?Be:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Pa(e,r);else{t=r;var o=de;de|=2;var i=dy();(Le!==e||Be!==t)&&(sn=null,co=je()+500,cr(e,t));do try{Nx();break}catch(a){cy(e,a)}while(!0);dd(),Ea.current=i,de=o,Te!==null?t=0:(Le=null,Be=0,t=Ae)}if(t!==0){if(t===2&&(o=Lu(e),o!==0&&(r=o,t=hc(e,o))),t===1)throw n=Ci,cr(e,0),jn(e,r),at(e,je()),n;if(t===6)jn(e,r);else{if(o=e.current.alternate,!(r&30)&&!Ex(o)&&(t=Pa(e,r),t===2&&(i=Lu(e),i!==0&&(r=i,t=hc(e,i))),t===1))throw n=Ci,cr(e,0),jn(e,r),at(e,je()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(Q(345));case 2:er(e,nt,sn);break;case 3:if(jn(e,r),(r&130023424)===r&&(t=Nd+500-je(),10<t)){if(ua(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Ze(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Ku(er.bind(null,e,nt,sn),t);break}er(e,nt,sn);break;case 4:if(jn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Vt(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=je()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Sx(r/1960))-r,10<r){e.timeoutHandle=Ku(er.bind(null,e,nt,sn),r);break}er(e,nt,sn);break;case 5:er(e,nt,sn);break;default:throw Error(Q(329))}}}return at(e,je()),e.callbackNode===n?uy.bind(null,e):null}function hc(e,t){var n=oi;return e.current.memoizedState.isDehydrated&&(cr(e,t).flags|=256),e=Pa(e,t),e!==2&&(t=nt,nt=n,t!==null&&pc(t)),e}function pc(e){nt===null?nt=e:nt.push.apply(nt,e)}function Ex(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!Ht(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function jn(e,t){for(t&=~kd,t&=~nl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Vt(t),r=1<<n;e[n]=-1,t&=~r}}function cp(e){if(de&6)throw Error(Q(327));Jr();var t=ua(e,0);if(!(t&1))return at(e,je()),null;var n=Pa(e,t);if(e.tag!==0&&n===2){var r=Lu(e);r!==0&&(t=r,n=hc(e,r))}if(n===1)throw n=Ci,cr(e,0),jn(e,t),at(e,je()),n;if(n===6)throw Error(Q(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,er(e,nt,sn),at(e,je()),null}function Pd(e,t){var n=de;de|=1;try{return e(t)}finally{de=n,de===0&&(co=je()+500,Za&&Yn())}}function vr(e){In!==null&&In.tag===0&&!(de&6)&&Jr();var t=de;de|=1;var n=Et.transition,r=fe;try{if(Et.transition=null,fe=1,e)return e()}finally{fe=r,Et.transition=n,de=t,!(de&6)&&Yn()}}function Cd(){lt=Ur.current,ve(Ur)}function cr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,ex(n)),Te!==null)for(n=Te.return;n!==null;){var r=n;switch(ld(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&pa();break;case 3:lo(),ve(it),ve(Ye),yd();break;case 5:gd(r);break;case 4:lo();break;case 13:ve(Ee);break;case 19:ve(Ee);break;case 10:fd(r.type._context);break;case 22:case 23:Cd()}n=n.return}if(Le=e,Te=e=Bn(e.current,null),Be=lt=t,Ae=0,Ci=null,kd=nl=yr=0,nt=oi=null,sr!==null){for(t=0;t<sr.length;t++)if(n=sr[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}sr=null}return e}function cy(e,t){do{var n=Te;try{if(dd(),Bs.current=Sa,xa){for(var r=ke.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}xa=!1}if(gr=0,De=Re=ke=null,ni=!1,ki=0,Ed.current=null,n===null||n.return===null){Ae=1,Ci=t,Te=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=Be,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=a,c=d.tag;if(!(d.mode&1)&&(c===0||c===11||c===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=Qh(s);if(p!==null){p.flags&=-257,Zh(p,s,a,i,t),p.mode&1&&Gh(i,u,t),t=p,l=u;var g=t.updateQueue;if(g===null){var v=new Set;v.add(l),t.updateQueue=v}else g.add(l);break e}else{if(!(t&1)){Gh(i,u,t),bd();break e}l=Error(Q(426))}}else if(_e&&a.mode&1){var w=Qh(s);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Zh(w,s,a,i,t),ud(uo(l,a));break e}}i=l=uo(l,a),Ae!==4&&(Ae=2),oi===null?oi=[i]:oi.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var h=K0(i,l,t);Uh(i,h);break e;case 1:a=l;var m=i.type,y=i.stateNode;if(!(i.flags&128)&&(typeof m.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Fn===null||!Fn.has(y)))){i.flags|=65536,t&=-t,i.lanes|=t;var _=X0(i,a,t);Uh(i,_);break e}}i=i.return}while(i!==null)}hy(n)}catch(x){t=x,Te===n&&n!==null&&(Te=n=n.return);continue}break}while(!0)}function dy(){var e=Ea.current;return Ea.current=Sa,e===null?Sa:e}function bd(){(Ae===0||Ae===3||Ae===2)&&(Ae=4),Le===null||!(yr&268435455)&&!(nl&268435455)||jn(Le,Be)}function Pa(e,t){var n=de;de|=2;var r=dy();(Le!==e||Be!==t)&&(sn=null,cr(e,t));do try{kx();break}catch(o){cy(e,o)}while(!0);if(dd(),de=n,Ea.current=r,Te!==null)throw Error(Q(261));return Le=null,Be=0,Ae}function kx(){for(;Te!==null;)fy(Te)}function Nx(){for(;Te!==null&&!Q_();)fy(Te)}function fy(e){var t=my(e.alternate,e,lt);e.memoizedProps=e.pendingProps,t===null?hy(e):Te=t,Ed.current=null}function hy(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=wx(n,t),n!==null){n.flags&=32767,Te=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ae=6,Te=null;return}}else if(n=vx(n,t,lt),n!==null){Te=n;return}if(t=t.sibling,t!==null){Te=t;return}Te=t=e}while(t!==null);Ae===0&&(Ae=5)}function er(e,t,n){var r=fe,o=Et.transition;try{Et.transition=null,fe=1,Px(e,t,n,r)}finally{Et.transition=o,fe=r}return null}function Px(e,t,n,r){do Jr();while(In!==null);if(de&6)throw Error(Q(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(Q(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(a$(e,i),e===Le&&(Te=Le=null,Be=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ys||(ys=!0,gy(la,function(){return Jr(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Et.transition,Et.transition=null;var s=fe;fe=1;var a=de;de|=4,Ed.current=null,$x(e,n),ay(n,e),K$(qu),ca=!!Uu,qu=Uu=null,e.current=n,xx(n),Z_(),de=a,fe=s,Et.transition=i}else e.current=n;if(ys&&(ys=!1,In=e,Na=o),i=e.pendingLanes,i===0&&(Fn=null),t$(n.stateNode),at(e,je()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(ka)throw ka=!1,e=dc,dc=null,e;return Na&1&&e.tag!==0&&Jr(),i=e.pendingLanes,i&1?e===fc?ii++:(ii=0,fc=e):ii=0,Yn(),null}function Jr(){if(In!==null){var e=Kg(Na),t=Et.transition,n=fe;try{if(Et.transition=null,fe=16>e?16:e,In===null)var r=!1;else{if(e=In,In=null,Na=0,de&6)throw Error(Q(331));var o=de;for(de|=4,re=e.current;re!==null;){var i=re,s=i.child;if(re.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(re=u;re!==null;){var d=re;switch(d.tag){case 0:case 11:case 15:ri(8,d,i)}var c=d.child;if(c!==null)c.return=d,re=c;else for(;re!==null;){d=re;var f=d.sibling,p=d.return;if(oy(d),d===u){re=null;break}if(f!==null){f.return=p,re=f;break}re=p}}}var g=i.alternate;if(g!==null){var v=g.child;if(v!==null){g.child=null;do{var w=v.sibling;v.sibling=null,v=w}while(v!==null)}}re=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,re=s;else e:for(;re!==null;){if(i=re,i.flags&2048)switch(i.tag){case 0:case 11:case 15:ri(9,i,i.return)}var h=i.sibling;if(h!==null){h.return=i.return,re=h;break e}re=i.return}}var m=e.current;for(re=m;re!==null;){s=re;var y=s.child;if(s.subtreeFlags&2064&&y!==null)y.return=s,re=y;else e:for(s=m;re!==null;){if(a=re,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:tl(9,a)}}catch(x){Ce(a,a.return,x)}if(a===s){re=null;break e}var _=a.sibling;if(_!==null){_.return=a.return,re=_;break e}re=a.return}}if(de=o,Yn(),Xt&&typeof Xt.onPostCommitFiberRoot=="function")try{Xt.onPostCommitFiberRoot(Ka,e)}catch{}r=!0}return r}finally{fe=n,Et.transition=t}}return!1}function dp(e,t,n){t=uo(n,t),t=K0(e,t,1),e=Vn(e,t,1),t=Ze(),e!==null&&(Fi(e,1,t),at(e,t))}function Ce(e,t,n){if(e.tag===3)dp(e,e,n);else for(;t!==null;){if(t.tag===3){dp(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Fn===null||!Fn.has(r))){e=uo(n,e),e=X0(t,e,1),t=Vn(t,e,1),e=Ze(),t!==null&&(Fi(t,1,e),at(t,e));break}}t=t.return}}function Cx(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ze(),e.pingedLanes|=e.suspendedLanes&n,Le===e&&(Be&n)===n&&(Ae===4||Ae===3&&(Be&130023424)===Be&&500>je()-Nd?cr(e,0):kd|=n),at(e,t)}function py(e,t){t===0&&(e.mode&1?(t=as,as<<=1,!(as&130023424)&&(as=4194304)):t=1);var n=Ze();e=pn(e,t),e!==null&&(Fi(e,t,n),at(e,n))}function bx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),py(e,n)}function jx(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Q(314))}r!==null&&r.delete(t),py(e,n)}var my;my=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||it.current)rt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return rt=!1,yx(e,t,n);rt=!!(e.flags&131072)}else rt=!1,_e&&t.flags&1048576&&w0(t,ya,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;qs(e,t),e=t.pendingProps;var o=io(t,Ye.current);Zr(t,n),o=wd(null,t,r,e,o,n);var i=_d();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,st(r)?(i=!0,ma(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,pd(t),o.updater=el,t.stateNode=o,o._reactInternals=t,ec(t,r,e,n),t=rc(null,t,r,!0,i,n)):(t.tag=0,_e&&i&&ad(t),Ge(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(qs(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Tx(r),e=Tt(r,e),o){case 0:t=nc(null,t,r,e,n);break e;case 1:t=tp(null,t,r,e,n);break e;case 11:t=Jh(null,t,r,e,n);break e;case 14:t=ep(null,t,r,Tt(r.type,e),n);break e}throw Error(Q(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Tt(r,o),nc(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Tt(r,o),tp(e,t,r,o,n);case 3:e:{if(Z0(t),e===null)throw Error(Q(387));r=t.pendingProps,i=t.memoizedState,o=i.element,k0(e,t),_a(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=uo(Error(Q(423)),t),t=np(e,t,r,n,o);break e}else if(r!==o){o=uo(Error(Q(424)),t),t=np(e,t,r,n,o);break e}else for(ct=Ln(t.stateNode.containerInfo.firstChild),dt=t,_e=!0,zt=null,n=S0(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(so(),r===o){t=mn(e,t,n);break e}Ge(e,t,r,n)}t=t.child}return t;case 5:return N0(t),e===null&&Qu(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Wu(r,o)?s=null:i!==null&&Wu(r,i)&&(t.flags|=32),Q0(e,t),Ge(e,t,s,n),t.child;case 6:return e===null&&Qu(t),null;case 13:return J0(e,t,n);case 4:return md(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ao(t,null,r,n):Ge(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Tt(r,o),Jh(e,t,r,o,n);case 7:return Ge(e,t,t.pendingProps,n),t.child;case 8:return Ge(e,t,t.pendingProps.children,n),t.child;case 12:return Ge(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,me(va,r._currentValue),r._currentValue=s,i!==null)if(Ht(i.value,s)){if(i.children===o.children&&!it.current){t=mn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=dn(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Zu(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(Q(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Zu(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}Ge(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Zr(t,n),o=kt(o),r=r(o),t.flags|=1,Ge(e,t,r,n),t.child;case 14:return r=t.type,o=Tt(r,t.pendingProps),o=Tt(r.type,o),ep(e,t,r,o,n);case 15:return Y0(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Tt(r,o),qs(e,t),t.tag=1,st(r)?(e=!0,ma(t)):e=!1,Zr(t,n),W0(t,r,o),ec(t,r,o,n),rc(null,t,r,!0,e,n);case 19:return ey(e,t,n);case 22:return G0(e,t,n)}throw Error(Q(156,t.tag))};function gy(e,t){return Bg(e,t)}function Mx(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function St(e,t,n,r){return new Mx(e,t,n,r)}function jd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Tx(e){if(typeof e=="function")return jd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Yc)return 11;if(e===Gc)return 14}return 2}function Bn(e,t){var n=e.alternate;return n===null?(n=St(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Xs(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")jd(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Rr:return dr(n.children,o,i,t);case Xc:s=8,o|=8;break;case Eu:return e=St(12,n,t,o|2),e.elementType=Eu,e.lanes=i,e;case ku:return e=St(13,n,t,o),e.elementType=ku,e.lanes=i,e;case Nu:return e=St(19,n,t,o),e.elementType=Nu,e.lanes=i,e;case Ng:return rl(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Eg:s=10;break e;case kg:s=9;break e;case Yc:s=11;break e;case Gc:s=14;break e;case Pn:s=16,r=null;break e}throw Error(Q(130,e==null?e:typeof e,""))}return t=St(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function dr(e,t,n,r){return e=St(7,e,r,t),e.lanes=n,e}function rl(e,t,n,r){return e=St(22,e,r,t),e.elementType=Ng,e.lanes=n,e.stateNode={isHidden:!1},e}function ru(e,t,n){return e=St(6,e,null,t),e.lanes=n,e}function ou(e,t,n){return t=St(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ix(e,t,n,r,o){this.tag=t,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=Dl(0),this.expirationTimes=Dl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dl(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Md(e,t,n,r,o,i,s,a,l){return e=new Ix(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=St(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},pd(i),e}function Rx(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ir,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function yy(e){if(!e)return Wn;e=e._reactInternals;e:{if(Pr(e)!==e||e.tag!==1)throw Error(Q(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(st(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Q(171))}if(e.tag===1){var n=e.type;if(st(n))return y0(e,n,t)}return t}function vy(e,t,n,r,o,i,s,a,l){return e=Md(n,r,!0,e,o,i,s,a,l),e.context=yy(null),n=e.current,r=Ze(),o=Hn(n),i=dn(r,o),i.callback=t??null,Vn(n,i,o),e.current.lanes=o,Fi(e,o,r),at(e,r),e}function ol(e,t,n,r){var o=t.current,i=Ze(),s=Hn(o);return n=yy(n),t.context===null?t.context=n:t.pendingContext=n,t=dn(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Vn(o,t,s),e!==null&&(Ft(e,o,s,i),Hs(e,o,s)),s}function Ca(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 fp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Td(e,t){fp(e,t),(e=e.alternate)&&fp(e,t)}function zx(){return null}var wy=typeof reportError=="function"?reportError:function(e){console.error(e)};function Id(e){this._internalRoot=e}il.prototype.render=Id.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Q(409));ol(e,t,null,null)};il.prototype.unmount=Id.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vr(function(){ol(null,e,null,null)}),t[hn]=null}};function il(e){this._internalRoot=e}il.prototype.unstable_scheduleHydration=function(e){if(e){var t=Gg();e={blockedOn:null,target:e,priority:t};for(var n=0;n<bn.length&&t!==0&&t<bn[n].priority;n++);bn.splice(n,0,e),n===0&&Zg(e)}};function Rd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function sl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function hp(){}function Ax(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=Ca(s);i.call(u)}}var s=vy(t,r,e,0,null,!1,!1,"",hp);return e._reactRootContainer=s,e[hn]=s.current,_i(e.nodeType===8?e.parentNode:e),vr(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var u=Ca(l);a.call(u)}}var l=Md(e,0,!1,null,null,!1,!1,"",hp);return e._reactRootContainer=l,e[hn]=l.current,_i(e.nodeType===8?e.parentNode:e),vr(function(){ol(t,l,n,r)}),l}function al(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var a=o;o=function(){var l=Ca(s);a.call(l)}}ol(t,s,e,o)}else s=Ax(n,t,e,o,r);return Ca(s)}Xg=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=qo(t.pendingLanes);n!==0&&(Jc(t,n|1),at(t,je()),!(de&6)&&(co=je()+500,Yn()))}break;case 13:vr(function(){var r=pn(e,1);if(r!==null){var o=Ze();Ft(r,e,1,o)}}),Td(e,1)}};ed=function(e){if(e.tag===13){var t=pn(e,134217728);if(t!==null){var n=Ze();Ft(t,e,134217728,n)}Td(e,134217728)}};Yg=function(e){if(e.tag===13){var t=Hn(e),n=pn(e,t);if(n!==null){var r=Ze();Ft(n,e,t,r)}Td(e,t)}};Gg=function(){return fe};Qg=function(e,t){var n=fe;try{return fe=e,t()}finally{fe=n}};Au=function(e,t,n){switch(t){case"input":if(bu(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Qa(r);if(!o)throw Error(Q(90));Cg(r),bu(r,o)}}}break;case"textarea":jg(e,n);break;case"select":t=n.value,t!=null&&Xr(e,!!n.multiple,t,!1)}};Og=Pd;Dg=vr;var Ox={usingClientEntryPoint:!1,Events:[Bi,Dr,Qa,zg,Ag,Pd]},Do={findFiberByHostInstance:ir,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Dx={bundleType:Do.bundleType,version:Do.version,rendererPackageName:Do.rendererPackageName,rendererConfig:Do.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:vn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Fg(e),e===null?null:e.stateNode},findFiberByHostInstance:Do.findFiberByHostInstance||zx,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 vs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vs.isDisabled&&vs.supportsFiber)try{Ka=vs.inject(Dx),Xt=vs}catch{}}pt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ox;pt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Rd(t))throw Error(Q(200));return Rx(e,t,null,n)};pt.createRoot=function(e,t){if(!Rd(e))throw Error(Q(299));var n=!1,r="",o=wy;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Md(e,1,!1,null,null,n,!1,r,o),e[hn]=t.current,_i(e.nodeType===8?e.parentNode:e),new Id(t)};pt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Q(188)):(e=Object.keys(e).join(","),Error(Q(268,e)));return e=Fg(t),e=e===null?null:e.stateNode,e};pt.flushSync=function(e){return vr(e)};pt.hydrate=function(e,t,n){if(!sl(t))throw Error(Q(200));return al(null,e,t,!0,n)};pt.hydrateRoot=function(e,t,n){if(!Rd(e))throw Error(Q(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=wy;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=vy(t,null,e,1,n??null,o,!1,i,s),e[hn]=t.current,_i(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new il(t)};pt.render=function(e,t,n){if(!sl(t))throw Error(Q(200));return al(null,e,t,!1,n)};pt.unmountComponentAtNode=function(e){if(!sl(e))throw Error(Q(40));return e._reactRootContainer?(vr(function(){al(null,null,e,!1,function(){e._reactRootContainer=null,e[hn]=null})}),!0):!1};pt.unstable_batchedUpdates=Pd;pt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!sl(n))throw Error(Q(200));if(e==null||e._reactInternals===void 0)throw Error(Q(38));return al(e,t,n,!1,r)};pt.version="18.3.1-next-f1338f8080-20240426";function _y(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_y)}catch(e){console.error(e)}}_y(),_g.exports=pt;var $y=_g.exports,xy,pp=$y;xy=pp.createRoot,pp.hydrateRoot;/**
41
+ * @license lucide-react v0.460.0 - ISC
42
+ *
43
+ * This source code is licensed under the ISC license.
44
+ * See the LICENSE file in the root directory of this source tree.
45
+ */const Lx=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Sy=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
46
+ * @license lucide-react v0.460.0 - ISC
47
+ *
48
+ * This source code is licensed under the ISC license.
49
+ * See the LICENSE file in the root directory of this source tree.
50
+ */var Vx={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
51
+ * @license lucide-react v0.460.0 - ISC
52
+ *
53
+ * This source code is licensed under the ISC license.
54
+ * See the LICENSE file in the root directory of this source tree.
55
+ */const Fx=O.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>O.createElement("svg",{ref:l,...Vx,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Sy("lucide",o),...a},[...s.map(([u,d])=>O.createElement(u,d)),...Array.isArray(i)?i:[i]]));/**
56
+ * @license lucide-react v0.460.0 - ISC
57
+ *
58
+ * This source code is licensed under the ISC license.
59
+ * See the LICENSE file in the root directory of this source tree.
60
+ */const pe=(e,t)=>{const n=O.forwardRef(({className:r,...o},i)=>O.createElement(Fx,{ref:i,iconNode:t,className:Sy(`lucide-${Lx(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
61
+ * @license lucide-react v0.460.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const mp=pe("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
66
+ * @license lucide-react v0.460.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */const Hx=pe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
71
+ * @license lucide-react v0.460.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const Bx=pe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
76
+ * @license lucide-react v0.460.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const Ux=pe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
81
+ * @license lucide-react v0.460.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */const qx=pe("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
86
+ * @license lucide-react v0.460.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const Wx=pe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
91
+ * @license lucide-react v0.460.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const Ey=pe("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]);/**
96
+ * @license lucide-react v0.460.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const Kx=pe("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
101
+ * @license lucide-react v0.460.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const Xx=pe("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
106
+ * @license lucide-react v0.460.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const Yx=pe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
111
+ * @license lucide-react v0.460.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const ky=pe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
116
+ * @license lucide-react v0.460.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const Gx=pe("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
121
+ * @license lucide-react v0.460.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const Qx=pe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
126
+ * @license lucide-react v0.460.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const Zx=pe("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/**
131
+ * @license lucide-react v0.460.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const Jx=pe("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/**
136
+ * @license lucide-react v0.460.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const eS=pe("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
141
+ * @license lucide-react v0.460.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const tS=pe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
146
+ * @license lucide-react v0.460.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const zd=pe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
151
+ * @license lucide-react v0.460.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const nS=pe("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
156
+ * @license lucide-react v0.460.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const rS=pe("SkipBack",[["polygon",{points:"19 20 9 12 19 4 19 20",key:"o2sva"}],["line",{x1:"5",x2:"5",y1:"19",y2:"5",key:"1ocqjk"}]]);/**
161
+ * @license lucide-react v0.460.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const oS=pe("SlidersVertical",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/**
166
+ * @license lucide-react v0.460.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const iS=pe("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
171
+ * @license lucide-react v0.460.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const sS=pe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
176
+ * @license lucide-react v0.460.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const aS=pe("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
181
+ * @license lucide-react v0.460.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const lS=pe("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
186
+ * @license lucide-react v0.460.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const Ny=pe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
191
+ * @license lucide-react v0.460.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const uS=pe("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),cS="loom-theme";function dS(){return typeof document>"u"?"light":document.documentElement.getAttribute("data-theme")==="dark"?"dark":"light"}function fS(){const[e,t]=O.useState(dS);O.useEffect(()=>{document.documentElement.setAttribute("data-theme",e);try{localStorage.setItem(cS,e)}catch{}},[e]);const n=O.useCallback(()=>{t(r=>r==="light"?"dark":"light")},[]);return{theme:e,setTheme:t,toggleTheme:n}}function hS({currentKind:e,currentId:t,currentTitle:n,diagrams:r,timelines:o,onNavigate:i,onCreate:s}){const[a,l]=O.useState(!1),u=O.useRef(null);O.useEffect(()=>{if(!a)return;function c(f){u.current&&!u.current.contains(f.target)&&l(!1)}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[a]);const d=(c,f)=>c===e&&f===t;return $.jsxs("div",{className:"diagram-switcher",ref:u,children:[$.jsxs("button",{className:"switcher-trigger",onClick:()=>l(c=>!c),"aria-expanded":a,"aria-haspopup":"listbox",children:[$.jsx("span",{className:"switcher-title",children:n}),$.jsx(Bx,{size:14,className:a?"flip":""})]}),a&&$.jsxs("div",{className:"switcher-menu",role:"listbox",children:[r.length===0&&o.length===0&&$.jsx("div",{className:"switcher-empty",children:"Nothing here yet."}),r.length>0&&$.jsx("div",{className:"switcher-section-label",children:"Diagrams"}),r.map(c=>$.jsxs("button",{className:`switcher-item ${d("diagram",c.id)?"active":""}`,onClick:()=>{i({kind:"diagram",id:c.id}),l(!1)},children:[$.jsx(Xx,{size:13,className:"switcher-item-icon"}),$.jsxs("div",{className:"switcher-item-text",children:[$.jsx("div",{className:"switcher-item-title",children:c.title}),$.jsxs("div",{className:"switcher-item-meta",children:[$.jsx("code",{children:c.id})," · ",c.nodeCount," nodes · ",c.edgeCount," edges"]})]})]},`d-${c.id}`)),o.length>0&&$.jsxs($.Fragment,{children:[$.jsx("div",{className:"switcher-divider"}),$.jsx("div",{className:"switcher-section-label",children:"Timelines"}),o.map(c=>$.jsxs("button",{className:`switcher-item ${d("timeline",c.id)?"active":""}`,onClick:()=>{i({kind:"timeline",id:c.id}),l(!1)},children:[$.jsx(Wx,{size:13,className:"switcher-item-icon"}),$.jsxs("div",{className:"switcher-item-text",children:[$.jsx("div",{className:"switcher-item-title",children:c.title}),$.jsxs("div",{className:"switcher-item-meta",children:[$.jsx("code",{children:c.id})," · ",c.eventCount," events · ",pS(c.totalDurationMs)]})]})]},`t-${c.id}`))]}),$.jsx("div",{className:"switcher-divider"}),$.jsxs("button",{className:"switcher-item new",onClick:()=>{s(),l(!1)},children:[$.jsx(zd,{size:13,className:"switcher-item-icon"}),$.jsx("span",{children:"New diagram…"})]})]})]})}function pS(e){return e===0?"0ms":e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}function mS({status:e}){return e==="connected"?$.jsx("span",{className:"conn-dot connected",title:"Live sync connected","aria-label":"Live sync connected",children:$.jsx(lS,{size:12})}):e==="connecting"?$.jsx("span",{className:"conn-dot connecting",title:"Connecting to live sync…","aria-label":"Connecting",children:$.jsx(ky,{size:12,className:"spin"})}):$.jsx("span",{className:"conn-dot disconnected",title:"Live sync disconnected — reconnecting in the background","aria-label":"Disconnected",children:$.jsx(aS,{size:12})})}function gS({status:e,error:t}){return e==="idle"?null:e==="dirty"?$.jsx("span",{className:"save-indicator dirty",children:"unsaved"}):e==="saving"?$.jsxs("span",{className:"save-indicator saving",children:[$.jsx(ky,{size:12,className:"spin"})," saving…"]}):e==="saved"?$.jsxs("span",{className:"save-indicator saved",children:[$.jsx(Hx,{size:12})," saved"]}):e==="error"?$.jsxs("span",{className:"save-indicator error",title:t??"unknown",children:[$.jsx(qx,{size:12})," save failed"]}):null}function Py({viewKind:e,viewId:t,title:n,subtitle:r,diagrams:o,timelines:i,saveStatus:s,saveError:a,connectionStatus:l,validationErrorCount:u=0,onClickAdd:d,addMenuOpen:c,isDefault:f,onClickHome:p,onNavigate:g,onCreateDiagram:v,addButtonRef:w,hideAddButton:h=!1}){const{theme:m,toggleTheme:y}=fS();return $.jsxs("div",{className:"topbar",children:[!f&&$.jsxs("button",{className:"breadcrumb-back",onClick:p,title:"Back to overview","aria-label":"Back to overview",children:[$.jsx(Ux,{size:14})," Overview"]}),$.jsx(hS,{currentKind:e,currentId:t,currentTitle:n,diagrams:o,timelines:i,onNavigate:g,onCreate:v}),r&&$.jsx("div",{className:"subtitle",children:r}),u>0&&$.jsxs("span",{className:"validation-chip",title:`${u} validation issue${u===1?"":"s"} — check the inspector`,children:[$.jsx(sS,{size:12})," ",u]}),$.jsx(mS,{status:l}),$.jsx(gS,{status:s,error:a}),!h&&w&&$.jsxs("button",{ref:w,onClick:d,title:"Add node","aria-label":"Add node","aria-expanded":c,children:[$.jsx(zd,{size:16})," Add"]}),$.jsx("button",{onClick:y,title:`Switch to ${m==="light"?"dark":"light"} theme`,"aria-label":"Toggle theme",children:m==="light"?$.jsx(Qx,{size:16}):$.jsx(iS,{size:16})})]})}function Ie(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Ie(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var yS={value:()=>{}};function ll(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ys(n)}function Ys(e){this._=e}function vS(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ys.prototype=ll.prototype={constructor:Ys,on:function(e,t){var n=this._,r=vS(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=wS(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=gp(n[o],e.name,t);else if(t==null)for(o in n)n[o]=gp(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ys(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};function wS(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function gp(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=yS,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var mc="http://www.w3.org/1999/xhtml";const yp={svg:"http://www.w3.org/2000/svg",xhtml:mc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ul(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),yp.hasOwnProperty(t)?{space:yp[t],local:e}:e}function _S(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===mc&&t.documentElement.namespaceURI===mc?t.createElement(e):t.createElementNS(n,e)}}function $S(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Cy(e){var t=ul(e);return(t.local?$S:_S)(t)}function xS(){}function Ad(e){return e==null?xS:function(){return this.querySelector(e)}}function SS(e){typeof e!="function"&&(e=Ad(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=new Array(s),l,u,d=0;d<s;++d)(l=i[d])&&(u=e.call(l,l.__data__,d,i))&&("__data__"in l&&(u.__data__=l.__data__),a[d]=u);return new ht(r,this._parents)}function ES(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function kS(){return[]}function by(e){return e==null?kS:function(){return this.querySelectorAll(e)}}function NS(e){return function(){return ES(e.apply(this,arguments))}}function PS(e){typeof e=="function"?e=NS(e):e=by(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(r.push(e.call(l,l.__data__,u,s)),o.push(l));return new ht(r,o)}function jy(e){return function(){return this.matches(e)}}function My(e){return function(t){return t.matches(e)}}var CS=Array.prototype.find;function bS(e){return function(){return CS.call(this.children,e)}}function jS(){return this.firstElementChild}function MS(e){return this.select(e==null?jS:bS(typeof e=="function"?e:My(e)))}var TS=Array.prototype.filter;function IS(){return Array.from(this.children)}function RS(e){return function(){return TS.call(this.children,e)}}function zS(e){return this.selectAll(e==null?IS:RS(typeof e=="function"?e:My(e)))}function AS(e){typeof e!="function"&&(e=jy(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],l,u=0;u<s;++u)(l=i[u])&&e.call(l,l.__data__,u,i)&&a.push(l);return new ht(r,this._parents)}function Ty(e){return new Array(e.length)}function OS(){return new ht(this._enter||this._groups.map(Ty),this._parents)}function ba(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ba.prototype={constructor:ba,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function DS(e){return function(){return e}}function LS(e,t,n,r,o,i){for(var s=0,a,l=t.length,u=i.length;s<u;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):n[s]=new ba(e,i[s]);for(;s<l;++s)(a=t[s])&&(o[s]=a)}function VS(e,t,n,r,o,i,s){var a,l,u=new Map,d=t.length,c=i.length,f=new Array(d),p;for(a=0;a<d;++a)(l=t[a])&&(f[a]=p=s.call(l,l.__data__,a,t)+"",u.has(p)?o[a]=l:u.set(p,l));for(a=0;a<c;++a)p=s.call(e,i[a],a,i)+"",(l=u.get(p))?(r[a]=l,l.__data__=i[a],u.delete(p)):n[a]=new ba(e,i[a]);for(a=0;a<d;++a)(l=t[a])&&u.get(f[a])===l&&(o[a]=l)}function FS(e){return e.__data__}function HS(e,t){if(!arguments.length)return Array.from(this,FS);var n=t?VS:LS,r=this._parents,o=this._groups;typeof e!="function"&&(e=DS(e));for(var i=o.length,s=new Array(i),a=new Array(i),l=new Array(i),u=0;u<i;++u){var d=r[u],c=o[u],f=c.length,p=BS(e.call(d,d&&d.__data__,u,r)),g=p.length,v=a[u]=new Array(g),w=s[u]=new Array(g),h=l[u]=new Array(f);n(d,c,v,w,h,p,t);for(var m=0,y=0,_,x;m<g;++m)if(_=v[m]){for(m>=y&&(y=m+1);!(x=w[y])&&++y<g;);_._next=x||null}}return s=new ht(s,r),s._enter=a,s._exit=l,s}function BS(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function US(){return new ht(this._exit||this._groups.map(Ty),this._parents)}function qS(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function WS(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),a=new Array(o),l=0;l<s;++l)for(var u=n[l],d=r[l],c=u.length,f=a[l]=new Array(c),p,g=0;g<c;++g)(p=u[g]||d[g])&&(f[g]=p);for(;l<o;++l)a[l]=n[l];return new ht(a,this._parents)}function KS(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function XS(e){e||(e=YS);function t(c,f){return c&&f?e(c.__data__,f.__data__):!c-!f}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],a=s.length,l=o[i]=new Array(a),u,d=0;d<a;++d)(u=s[d])&&(l[d]=u);l.sort(t)}return new ht(o,this._parents).order()}function YS(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function GS(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function QS(){return Array.from(this)}function ZS(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function JS(){let e=0;for(const t of this)++e;return e}function eE(){return!this.node()}function tE(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,a;i<s;++i)(a=o[i])&&e.call(a,a.__data__,i,o);return this}function nE(e){return function(){this.removeAttribute(e)}}function rE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function oE(e,t){return function(){this.setAttribute(e,t)}}function iE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function sE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function aE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function lE(e,t){var n=ul(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?rE:nE:typeof t=="function"?n.local?aE:sE:n.local?iE:oE)(n,t))}function Iy(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function uE(e){return function(){this.style.removeProperty(e)}}function cE(e,t,n){return function(){this.style.setProperty(e,t,n)}}function dE(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function fE(e,t,n){return arguments.length>1?this.each((t==null?uE:typeof t=="function"?dE:cE)(e,t,n??"")):fo(this.node(),e)}function fo(e,t){return e.style.getPropertyValue(t)||Iy(e).getComputedStyle(e,null).getPropertyValue(t)}function hE(e){return function(){delete this[e]}}function pE(e,t){return function(){this[e]=t}}function mE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function gE(e,t){return arguments.length>1?this.each((t==null?hE:typeof t=="function"?mE:pE)(e,t)):this.node()[e]}function Ry(e){return e.trim().split(/^|\s+/)}function Od(e){return e.classList||new zy(e)}function zy(e){this._node=e,this._names=Ry(e.getAttribute("class")||"")}zy.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Ay(e,t){for(var n=Od(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Oy(e,t){for(var n=Od(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function yE(e){return function(){Ay(this,e)}}function vE(e){return function(){Oy(this,e)}}function wE(e,t){return function(){(t.apply(this,arguments)?Ay:Oy)(this,e)}}function _E(e,t){var n=Ry(e+"");if(arguments.length<2){for(var r=Od(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?wE:t?yE:vE)(n,t))}function $E(){this.textContent=""}function xE(e){return function(){this.textContent=e}}function SE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function EE(e){return arguments.length?this.each(e==null?$E:(typeof e=="function"?SE:xE)(e)):this.node().textContent}function kE(){this.innerHTML=""}function NE(e){return function(){this.innerHTML=e}}function PE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function CE(e){return arguments.length?this.each(e==null?kE:(typeof e=="function"?PE:NE)(e)):this.node().innerHTML}function bE(){this.nextSibling&&this.parentNode.appendChild(this)}function jE(){return this.each(bE)}function ME(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function TE(){return this.each(ME)}function IE(e){var t=typeof e=="function"?e:Cy(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function RE(){return null}function zE(e,t){var n=typeof e=="function"?e:Cy(e),r=t==null?RE:typeof t=="function"?t:Ad(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function AE(){var e=this.parentNode;e&&e.removeChild(this)}function OE(){return this.each(AE)}function DE(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function LE(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function VE(e){return this.select(e?LE:DE)}function FE(e){return arguments.length?this.property("__data__",e):this.node().__data__}function HE(e){return function(t){e.call(this,t,this.__data__)}}function BE(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function UE(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function qE(e,t,n){return function(){var r=this.__on,o,i=HE(t);if(r){for(var s=0,a=r.length;s<a;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function WE(e,t,n){var r=BE(e+""),o,i=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,d;l<u;++l)for(o=0,d=a[l];o<i;++o)if((s=r[o]).type===d.type&&s.name===d.name)return d.value}return}for(a=t?qE:UE,o=0;o<i;++o)this.each(a(r[o],t,n));return this}function Dy(e,t,n){var r=Iy(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function KE(e,t){return function(){return Dy(this,e,t)}}function XE(e,t){return function(){return Dy(this,e,t.apply(this,arguments))}}function YE(e,t){return this.each((typeof t=="function"?XE:KE)(e,t))}function*GE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var Ly=[null];function ht(e,t){this._groups=e,this._parents=t}function qi(){return new ht([[document.documentElement]],Ly)}function QE(){return this}ht.prototype=qi.prototype={constructor:ht,select:SS,selectAll:PS,selectChild:MS,selectChildren:zS,filter:AS,data:HS,enter:OS,exit:US,join:qS,merge:WS,selection:QE,order:KS,sort:XS,call:GS,nodes:QS,node:ZS,size:JS,empty:eE,each:tE,attr:lE,style:fE,property:gE,classed:_E,text:EE,html:CE,raise:jE,lower:TE,append:IE,insert:zE,remove:OE,clone:VE,datum:FE,on:WE,dispatch:YE,[Symbol.iterator]:GE};function ut(e){return typeof e=="string"?new ht([[document.querySelector(e)]],[document.documentElement]):new ht([[e]],Ly)}function ZE(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Rt(e,t){if(e=ZE(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const JE={passive:!1},bi={capture:!0,passive:!1};function iu(e){e.stopImmediatePropagation()}function eo(e){e.preventDefault(),e.stopImmediatePropagation()}function Vy(e){var t=e.document.documentElement,n=ut(e).on("dragstart.drag",eo,bi);"onselectstart"in t?n.on("selectstart.drag",eo,bi):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Fy(e,t){var n=e.document.documentElement,r=ut(e).on("dragstart.drag",null);t&&(r.on("click.drag",eo,bi),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const ws=e=>()=>e;function gc(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:a,dx:l,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}gc.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function e2(e){return!e.ctrlKey&&!e.button}function t2(){return this.parentNode}function n2(e,t){return t??{x:e.x,y:e.y}}function r2(){return navigator.maxTouchPoints||"ontouchstart"in this}function Hy(){var e=e2,t=t2,n=n2,r=r2,o={},i=ll("start","drag","end"),s=0,a,l,u,d,c=0;function f(_){_.on("mousedown.drag",p).filter(r).on("touchstart.drag",w).on("touchmove.drag",h,JE).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(_,x){if(!(d||!e.call(this,_,x))){var N=y(this,t.call(this,_,x),_,x,"mouse");N&&(ut(_.view).on("mousemove.drag",g,bi).on("mouseup.drag",v,bi),Vy(_.view),iu(_),u=!1,a=_.clientX,l=_.clientY,N("start",_))}}function g(_){if(eo(_),!u){var x=_.clientX-a,N=_.clientY-l;u=x*x+N*N>c}o.mouse("drag",_)}function v(_){ut(_.view).on("mousemove.drag mouseup.drag",null),Fy(_.view,u),eo(_),o.mouse("end",_)}function w(_,x){if(e.call(this,_,x)){var N=_.changedTouches,C=t.call(this,_,x),z=N.length,L,q;for(L=0;L<z;++L)(q=y(this,C,_,x,N[L].identifier,N[L]))&&(iu(_),q("start",_,N[L]))}}function h(_){var x=_.changedTouches,N=x.length,C,z;for(C=0;C<N;++C)(z=o[x[C].identifier])&&(eo(_),z("drag",_,x[C]))}function m(_){var x=_.changedTouches,N=x.length,C,z;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),C=0;C<N;++C)(z=o[x[C].identifier])&&(iu(_),z("end",_,x[C]))}function y(_,x,N,C,z,L){var q=i.copy(),b=Rt(L||N,x),j,B,E;if((E=n.call(_,new gc("beforestart",{sourceEvent:N,target:f,identifier:z,active:s,x:b[0],y:b[1],dx:0,dy:0,dispatch:q}),C))!=null)return j=E.x-b[0]||0,B=E.y-b[1]||0,function H(V,W,M){var A=b,T;switch(V){case"start":o[z]=H,T=s++;break;case"end":delete o[z],--s;case"drag":b=Rt(M||W,x),T=s;break}q.call(V,_,new gc(V,{sourceEvent:W,subject:E,target:f,identifier:z,active:T,x:b[0]+j,y:b[1]+B,dx:b[0]-A[0],dy:b[1]-A[1],dispatch:q}),C)}}return f.filter=function(_){return arguments.length?(e=typeof _=="function"?_:ws(!!_),f):e},f.container=function(_){return arguments.length?(t=typeof _=="function"?_:ws(_),f):t},f.subject=function(_){return arguments.length?(n=typeof _=="function"?_:ws(_),f):n},f.touchable=function(_){return arguments.length?(r=typeof _=="function"?_:ws(!!_),f):r},f.on=function(){var _=i.on.apply(i,arguments);return _===i?f:_},f.clickDistance=function(_){return arguments.length?(c=(_=+_)*_,f):Math.sqrt(c)},f}function Dd(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function By(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Wi(){}var ji=.7,ja=1/ji,to="\\s*([+-]?\\d+)\\s*",Mi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Gt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",o2=/^#([0-9a-f]{3,8})$/,i2=new RegExp(`^rgb\\(${to},${to},${to}\\)$`),s2=new RegExp(`^rgb\\(${Gt},${Gt},${Gt}\\)$`),a2=new RegExp(`^rgba\\(${to},${to},${to},${Mi}\\)$`),l2=new RegExp(`^rgba\\(${Gt},${Gt},${Gt},${Mi}\\)$`),u2=new RegExp(`^hsl\\(${Mi},${Gt},${Gt}\\)$`),c2=new RegExp(`^hsla\\(${Mi},${Gt},${Gt},${Mi}\\)$`),vp={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};Dd(Wi,wr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:wp,formatHex:wp,formatHex8:d2,formatHsl:f2,formatRgb:_p,toString:_p});function wp(){return this.rgb().formatHex()}function d2(){return this.rgb().formatHex8()}function f2(){return Uy(this).formatHsl()}function _p(){return this.rgb().formatRgb()}function wr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=o2.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?$p(t):n===3?new ot(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?_s(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?_s(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=i2.exec(e))?new ot(t[1],t[2],t[3],1):(t=s2.exec(e))?new ot(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=a2.exec(e))?_s(t[1],t[2],t[3],t[4]):(t=l2.exec(e))?_s(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=u2.exec(e))?Ep(t[1],t[2]/100,t[3]/100,1):(t=c2.exec(e))?Ep(t[1],t[2]/100,t[3]/100,t[4]):vp.hasOwnProperty(e)?$p(vp[e]):e==="transparent"?new ot(NaN,NaN,NaN,0):null}function $p(e){return new ot(e>>16&255,e>>8&255,e&255,1)}function _s(e,t,n,r){return r<=0&&(e=t=n=NaN),new ot(e,t,n,r)}function h2(e){return e instanceof Wi||(e=wr(e)),e?(e=e.rgb(),new ot(e.r,e.g,e.b,e.opacity)):new ot}function yc(e,t,n,r){return arguments.length===1?h2(e):new ot(e,t,n,r??1)}function ot(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Dd(ot,yc,By(Wi,{brighter(e){return e=e==null?ja:Math.pow(ja,e),new ot(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ji:Math.pow(ji,e),new ot(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ot(fr(this.r),fr(this.g),fr(this.b),Ma(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:xp,formatHex:xp,formatHex8:p2,formatRgb:Sp,toString:Sp}));function xp(){return`#${lr(this.r)}${lr(this.g)}${lr(this.b)}`}function p2(){return`#${lr(this.r)}${lr(this.g)}${lr(this.b)}${lr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Sp(){const e=Ma(this.opacity);return`${e===1?"rgb(":"rgba("}${fr(this.r)}, ${fr(this.g)}, ${fr(this.b)}${e===1?")":`, ${e})`}`}function Ma(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function fr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function lr(e){return e=fr(e),(e<16?"0":"")+e.toString(16)}function Ep(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new At(e,t,n,r)}function Uy(e){if(e instanceof At)return new At(e.h,e.s,e.l,e.opacity);if(e instanceof Wi||(e=wr(e)),!e)return new At;if(e instanceof At)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,a=i-o,l=(i+o)/2;return a?(t===i?s=(n-r)/a+(n<r)*6:n===i?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?i+o:2-i-o,s*=60):a=l>0&&l<1?0:s,new At(s,a,l,e.opacity)}function m2(e,t,n,r){return arguments.length===1?Uy(e):new At(e,t,n,r??1)}function At(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Dd(At,m2,By(Wi,{brighter(e){return e=e==null?ja:Math.pow(ja,e),new At(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ji:Math.pow(ji,e),new At(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new ot(su(e>=240?e-240:e+120,o,r),su(e,o,r),su(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new At(kp(this.h),$s(this.s),$s(this.l),Ma(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ma(this.opacity);return`${e===1?"hsl(":"hsla("}${kp(this.h)}, ${$s(this.s)*100}%, ${$s(this.l)*100}%${e===1?")":`, ${e})`}`}}));function kp(e){return e=(e||0)%360,e<0?e+360:e}function $s(e){return Math.max(0,Math.min(1,e||0))}function su(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Ld=e=>()=>e;function g2(e,t){return function(n){return e+n*t}}function y2(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function v2(e){return(e=+e)==1?qy:function(t,n){return n-t?y2(t,n,e):Ld(isNaN(t)?n:t)}}function qy(e,t){var n=t-e;return n?g2(e,n):Ld(isNaN(e)?t:e)}const Ta=function e(t){var n=v2(t);function r(o,i){var s=n((o=yc(o)).r,(i=yc(i)).r),a=n(o.g,i.g),l=n(o.b,i.b),u=qy(o.opacity,i.opacity);return function(d){return o.r=s(d),o.g=a(d),o.b=l(d),o.opacity=u(d),o+""}}return r.gamma=e,r}(1);function w2(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(i){for(o=0;o<n;++o)r[o]=e[o]*(1-i)+t[o]*i;return r}}function _2(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function $2(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,o=new Array(r),i=new Array(n),s;for(s=0;s<r;++s)o[s]=si(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(a){for(s=0;s<r;++s)i[s]=o[s](a);return i}}function x2(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Wt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function S2(e,t){var n={},r={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?n[o]=si(e[o],t[o]):r[o]=t[o];return function(i){for(o in n)r[o]=n[o](i);return r}}var vc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,au=new RegExp(vc.source,"g");function E2(e){return function(){return e}}function k2(e){return function(t){return e(t)+""}}function Wy(e,t){var n=vc.lastIndex=au.lastIndex=0,r,o,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=vc.exec(e))&&(o=au.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(r=r[0])===(o=o[0])?a[s]?a[s]+=o:a[++s]=o:(a[++s]=null,l.push({i:s,x:Wt(r,o)})),n=au.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?k2(l[0].x):E2(t):(t=l.length,function(u){for(var d=0,c;d<t;++d)a[(c=l[d]).i]=c.x(u);return a.join("")})}function si(e,t){var n=typeof t,r;return t==null||n==="boolean"?Ld(t):(n==="number"?Wt:n==="string"?(r=wr(t))?(t=r,Ta):Wy:t instanceof wr?Ta:t instanceof Date?x2:_2(t)?w2:Array.isArray(t)?$2:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?S2:Wt)(e,t)}var Np=180/Math.PI,wc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ky(e,t,n,r,o,i){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,l/=a),e*r<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*Np,skewX:Math.atan(l)*Np,scaleX:s,scaleY:a}}var xs;function N2(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?wc:Ky(t.a,t.b,t.c,t.d,t.e,t.f)}function P2(e){return e==null||(xs||(xs=document.createElementNS("http://www.w3.org/2000/svg","g")),xs.setAttribute("transform",e),!(e=xs.transform.baseVal.consolidate()))?wc:(e=e.matrix,Ky(e.a,e.b,e.c,e.d,e.e,e.f))}function Xy(e,t,n,r){function o(u){return u.length?u.pop()+" ":""}function i(u,d,c,f,p,g){if(u!==c||d!==f){var v=p.push("translate(",null,t,null,n);g.push({i:v-4,x:Wt(u,c)},{i:v-2,x:Wt(d,f)})}else(c||f)&&p.push("translate("+c+t+f+n)}function s(u,d,c,f){u!==d?(u-d>180?d+=360:d-u>180&&(u+=360),f.push({i:c.push(o(c)+"rotate(",null,r)-2,x:Wt(u,d)})):d&&c.push(o(c)+"rotate("+d+r)}function a(u,d,c,f){u!==d?f.push({i:c.push(o(c)+"skewX(",null,r)-2,x:Wt(u,d)}):d&&c.push(o(c)+"skewX("+d+r)}function l(u,d,c,f,p,g){if(u!==c||d!==f){var v=p.push(o(p)+"scale(",null,",",null,")");g.push({i:v-4,x:Wt(u,c)},{i:v-2,x:Wt(d,f)})}else(c!==1||f!==1)&&p.push(o(p)+"scale("+c+","+f+")")}return function(u,d){var c=[],f=[];return u=e(u),d=e(d),i(u.translateX,u.translateY,d.translateX,d.translateY,c,f),s(u.rotate,d.rotate,c,f),a(u.skewX,d.skewX,c,f),l(u.scaleX,u.scaleY,d.scaleX,d.scaleY,c,f),u=d=null,function(p){for(var g=-1,v=f.length,w;++g<v;)c[(w=f[g]).i]=w.x(p);return c.join("")}}}var C2=Xy(N2,"px, ","px)","deg)"),b2=Xy(P2,", ",")",")"),j2=1e-12;function Pp(e){return((e=Math.exp(e))+1/e)/2}function M2(e){return((e=Math.exp(e))-1/e)/2}function T2(e){return((e=Math.exp(2*e))-1)/(e+1)}const Gs=function e(t,n,r){function o(i,s){var a=i[0],l=i[1],u=i[2],d=s[0],c=s[1],f=s[2],p=d-a,g=c-l,v=p*p+g*g,w,h;if(v<j2)h=Math.log(f/u)/t,w=function(C){return[a+C*p,l+C*g,u*Math.exp(t*C*h)]};else{var m=Math.sqrt(v),y=(f*f-u*u+r*v)/(2*u*n*m),_=(f*f-u*u-r*v)/(2*f*n*m),x=Math.log(Math.sqrt(y*y+1)-y),N=Math.log(Math.sqrt(_*_+1)-_);h=(N-x)/t,w=function(C){var z=C*h,L=Pp(x),q=u/(n*m)*(L*T2(t*z+x)-M2(x));return[a+q*p,l+q*g,u*L/Pp(t*z+x)]}}return w.duration=h*1e3*t/Math.SQRT2,w}return o.rho=function(i){var s=Math.max(.001,+i),a=s*s,l=a*a;return e(s,a,l)},o}(Math.SQRT2,2,4);var ho=0,Ko=0,Lo=0,Yy=1e3,Ia,Xo,Ra=0,_r=0,cl=0,Ti=typeof performance=="object"&&performance.now?performance:Date,Gy=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Vd(){return _r||(Gy(I2),_r=Ti.now()+cl)}function I2(){_r=0}function za(){this._call=this._time=this._next=null}za.prototype=Qy.prototype={constructor:za,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Vd():+n)+(t==null?0:+t),!this._next&&Xo!==this&&(Xo?Xo._next=this:Ia=this,Xo=this),this._call=e,this._time=n,_c()},stop:function(){this._call&&(this._call=null,this._time=1/0,_c())}};function Qy(e,t,n){var r=new za;return r.restart(e,t,n),r}function R2(){Vd(),++ho;for(var e=Ia,t;e;)(t=_r-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ho}function Cp(){_r=(Ra=Ti.now())+cl,ho=Ko=0;try{R2()}finally{ho=0,A2(),_r=0}}function z2(){var e=Ti.now(),t=e-Ra;t>Yy&&(cl-=t,Ra=e)}function A2(){for(var e,t=Ia,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ia=n);Xo=e,_c(r)}function _c(e){if(!ho){Ko&&(Ko=clearTimeout(Ko));var t=e-_r;t>24?(e<1/0&&(Ko=setTimeout(Cp,e-Ti.now()-cl)),Lo&&(Lo=clearInterval(Lo))):(Lo||(Ra=Ti.now(),Lo=setInterval(z2,Yy)),ho=1,Gy(Cp))}}function bp(e,t,n){var r=new za;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var O2=ll("start","end","cancel","interrupt"),D2=[],Zy=0,jp=1,$c=2,Qs=3,Mp=4,xc=5,Zs=6;function dl(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;L2(e,n,{name:t,index:r,group:o,on:O2,tween:D2,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Zy})}function Fd(e,t){var n=Bt(e,t);if(n.state>Zy)throw new Error("too late; already scheduled");return n}function Zt(e,t){var n=Bt(e,t);if(n.state>Qs)throw new Error("too late; already running");return n}function Bt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function L2(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=Qy(i,0,n.time);function i(u){n.state=jp,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var d,c,f,p;if(n.state!==jp)return l();for(d in r)if(p=r[d],p.name===n.name){if(p.state===Qs)return bp(s);p.state===Mp?(p.state=Zs,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[d]):+d<t&&(p.state=Zs,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[d])}if(bp(function(){n.state===Qs&&(n.state=Mp,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=$c,n.on.call("start",e,e.__data__,n.index,n.group),n.state===$c){for(n.state=Qs,o=new Array(f=n.tween.length),d=0,c=-1;d<f;++d)(p=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(o[++c]=p);o.length=c+1}}function a(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=xc,1),c=-1,f=o.length;++c<f;)o[c].call(e,d);n.state===xc&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Zs,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Js(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>$c&&r.state<xc,r.state=Zs,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function V2(e){return this.each(function(){Js(this,e)})}function F2(e,t){var n,r;return function(){var o=Zt(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function H2(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=Zt(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var a={name:t,value:n},l=0,u=o.length;l<u;++l)if(o[l].name===t){o[l]=a;break}l===u&&o.push(a)}i.tween=o}}function B2(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Bt(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?F2:H2)(n,e,t))}function Hd(e,t,n){var r=e._id;return e.each(function(){var o=Zt(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Bt(o,r).value[t]}}function Jy(e,t){var n;return(typeof t=="number"?Wt:t instanceof wr?Ta:(n=wr(t))?(t=n,Ta):Wy)(e,t)}function U2(e){return function(){this.removeAttribute(e)}}function q2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function W2(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function K2(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function X2(e,t,n){var r,o,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a)))}}function Y2(e,t,n){var r,o,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a)))}}function G2(e,t){var n=ul(e),r=n==="transform"?b2:Jy;return this.attrTween(e,typeof t=="function"?(n.local?Y2:X2)(n,r,Hd(this,"attr."+e,t)):t==null?(n.local?q2:U2)(n):(n.local?K2:W2)(n,r,t))}function Q2(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Z2(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function J2(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Z2(e,i)),n}return o._value=t,o}function ek(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Q2(e,i)),n}return o._value=t,o}function tk(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=ul(e);return this.tween(n,(r.local?J2:ek)(r,t))}function nk(e,t){return function(){Fd(this,e).delay=+t.apply(this,arguments)}}function rk(e,t){return t=+t,function(){Fd(this,e).delay=t}}function ok(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?nk:rk)(t,e)):Bt(this.node(),t).delay}function ik(e,t){return function(){Zt(this,e).duration=+t.apply(this,arguments)}}function sk(e,t){return t=+t,function(){Zt(this,e).duration=t}}function ak(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?ik:sk)(t,e)):Bt(this.node(),t).duration}function lk(e,t){if(typeof t!="function")throw new Error;return function(){Zt(this,e).ease=t}}function uk(e){var t=this._id;return arguments.length?this.each(lk(t,e)):Bt(this.node(),t).ease}function ck(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Zt(this,e).ease=n}}function dk(e){if(typeof e!="function")throw new Error;return this.each(ck(this._id,e))}function fk(e){typeof e!="function"&&(e=jy(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],l,u=0;u<s;++u)(l=i[u])&&e.call(l,l.__data__,u,i)&&a.push(l);return new gn(r,this._parents,this._name,this._id)}function hk(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),s=new Array(r),a=0;a<i;++a)for(var l=t[a],u=n[a],d=l.length,c=s[a]=new Array(d),f,p=0;p<d;++p)(f=l[p]||u[p])&&(c[p]=f);for(;a<r;++a)s[a]=t[a];return new gn(s,this._parents,this._name,this._id)}function pk(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function mk(e,t,n){var r,o,i=pk(t)?Fd:Zt;return function(){var s=i(this,e),a=s.on;a!==r&&(o=(r=a).copy()).on(t,n),s.on=o}}function gk(e,t){var n=this._id;return arguments.length<2?Bt(this.node(),n).on.on(e):this.each(mk(n,e,t))}function yk(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function vk(){return this.on("end.remove",yk(this._id))}function wk(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ad(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var a=r[s],l=a.length,u=i[s]=new Array(l),d,c,f=0;f<l;++f)(d=a[f])&&(c=e.call(d,d.__data__,f,a))&&("__data__"in d&&(c.__data__=d.__data__),u[f]=c,dl(u[f],t,n,f,u,Bt(d,n)));return new gn(i,this._parents,t,n)}function _k(e){var t=this._name,n=this._id;typeof e!="function"&&(e=by(e));for(var r=this._groups,o=r.length,i=[],s=[],a=0;a<o;++a)for(var l=r[a],u=l.length,d,c=0;c<u;++c)if(d=l[c]){for(var f=e.call(d,d.__data__,c,l),p,g=Bt(d,n),v=0,w=f.length;v<w;++v)(p=f[v])&&dl(p,t,n,v,f,g);i.push(f),s.push(d)}return new gn(i,s,t,n)}var $k=qi.prototype.constructor;function xk(){return new $k(this._groups,this._parents)}function Sk(e,t){var n,r,o;return function(){var i=fo(this,e),s=(this.style.removeProperty(e),fo(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function ev(e){return function(){this.style.removeProperty(e)}}function Ek(e,t,n){var r,o=n+"",i;return function(){var s=fo(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function kk(e,t,n){var r,o,i;return function(){var s=fo(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),fo(this,e))),s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a))}}function Nk(e,t){var n,r,o,i="style."+t,s="end."+i,a;return function(){var l=Zt(this,e),u=l.on,d=l.value[i]==null?a||(a=ev(t)):void 0;(u!==n||o!==d)&&(r=(n=u).copy()).on(s,o=d),l.on=r}}function Pk(e,t,n){var r=(e+="")=="transform"?C2:Jy;return t==null?this.styleTween(e,Sk(e,r)).on("end.style."+e,ev(e)):typeof t=="function"?this.styleTween(e,kk(e,r,Hd(this,"style."+e,t))).each(Nk(this._id,e)):this.styleTween(e,Ek(e,r,t),n).on("end.style."+e,null)}function Ck(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function bk(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&Ck(e,s,n)),r}return i._value=t,i}function jk(e,t,n){var r="style."+(e+="");if(arguments.length<2)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,bk(e,t,n??""))}function Mk(e){return function(){this.textContent=e}}function Tk(e){return function(){var t=e(this);this.textContent=t??""}}function Ik(e){return this.tween("text",typeof e=="function"?Tk(Hd(this,"text",e)):Mk(e==null?"":e+""))}function Rk(e){return function(t){this.textContent=e.call(this,t)}}function zk(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&Rk(o)),t}return r._value=e,r}function Ak(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,zk(e))}function Ok(){for(var e=this._name,t=this._id,n=tv(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,l,u=0;u<a;++u)if(l=s[u]){var d=Bt(l,t);dl(l,e,n,u,s,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new gn(r,this._parents,e,n)}function Dk(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var a={value:s},l={value:function(){--o===0&&i()}};n.each(function(){var u=Zt(this,r),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),o===0&&i()})}var Lk=0;function gn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function tv(){return++Lk}var en=qi.prototype;gn.prototype={constructor:gn,select:wk,selectAll:_k,selectChild:en.selectChild,selectChildren:en.selectChildren,filter:fk,merge:hk,selection:xk,transition:Ok,call:en.call,nodes:en.nodes,node:en.node,size:en.size,empty:en.empty,each:en.each,on:gk,attr:G2,attrTween:tk,style:Pk,styleTween:jk,text:Ik,textTween:Ak,remove:vk,tween:B2,delay:ok,duration:ak,ease:uk,easeVarying:dk,end:Dk,[Symbol.iterator]:en[Symbol.iterator]};function Vk(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Fk={time:null,delay:0,duration:250,ease:Vk};function Hk(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Bk(e){var t,n;e instanceof gn?(t=e._id,e=e._name):(t=tv(),(n=Fk).time=Vd(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,l,u=0;u<a;++u)(l=s[u])&&dl(l,e,t,u,s,n||Hk(l,t));return new gn(r,this._parents,e,t)}qi.prototype.interrupt=V2;qi.prototype.transition=Bk;const Ss=e=>()=>e;function Uk(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function cn(e,t,n){this.k=e,this.x=t,this.y=n}cn.prototype={constructor:cn,scale:function(e){return e===1?this:new cn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new cn(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var fl=new cn(1,0,0);nv.prototype=cn.prototype;function nv(e){for(;!e.__zoom;)if(!(e=e.parentNode))return fl;return e.__zoom}function lu(e){e.stopImmediatePropagation()}function Vo(e){e.preventDefault(),e.stopImmediatePropagation()}function qk(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Wk(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Tp(){return this.__zoom||fl}function Kk(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Xk(){return navigator.maxTouchPoints||"ontouchstart"in this}function Yk(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function rv(){var e=qk,t=Wk,n=Yk,r=Kk,o=Xk,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Gs,u=ll("start","zoom","end"),d,c,f,p=500,g=150,v=0,w=10;function h(E){E.property("__zoom",Tp).on("wheel.zoom",z,{passive:!1}).on("mousedown.zoom",L).on("dblclick.zoom",q).filter(o).on("touchstart.zoom",b).on("touchmove.zoom",j).on("touchend.zoom touchcancel.zoom",B).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}h.transform=function(E,H,V,W){var M=E.selection?E.selection():E;M.property("__zoom",Tp),E!==M?x(E,H,V,W):M.interrupt().each(function(){N(this,arguments).event(W).start().zoom(null,typeof H=="function"?H.apply(this,arguments):H).end()})},h.scaleBy=function(E,H,V,W){h.scaleTo(E,function(){var M=this.__zoom.k,A=typeof H=="function"?H.apply(this,arguments):H;return M*A},V,W)},h.scaleTo=function(E,H,V,W){h.transform(E,function(){var M=t.apply(this,arguments),A=this.__zoom,T=V==null?_(M):typeof V=="function"?V.apply(this,arguments):V,k=A.invert(T),I=typeof H=="function"?H.apply(this,arguments):H;return n(y(m(A,I),T,k),M,s)},V,W)},h.translateBy=function(E,H,V,W){h.transform(E,function(){return n(this.__zoom.translate(typeof H=="function"?H.apply(this,arguments):H,typeof V=="function"?V.apply(this,arguments):V),t.apply(this,arguments),s)},null,W)},h.translateTo=function(E,H,V,W,M){h.transform(E,function(){var A=t.apply(this,arguments),T=this.__zoom,k=W==null?_(A):typeof W=="function"?W.apply(this,arguments):W;return n(fl.translate(k[0],k[1]).scale(T.k).translate(typeof H=="function"?-H.apply(this,arguments):-H,typeof V=="function"?-V.apply(this,arguments):-V),A,s)},W,M)};function m(E,H){return H=Math.max(i[0],Math.min(i[1],H)),H===E.k?E:new cn(H,E.x,E.y)}function y(E,H,V){var W=H[0]-V[0]*E.k,M=H[1]-V[1]*E.k;return W===E.x&&M===E.y?E:new cn(E.k,W,M)}function _(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function x(E,H,V,W){E.on("start.zoom",function(){N(this,arguments).event(W).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(W).end()}).tween("zoom",function(){var M=this,A=arguments,T=N(M,A).event(W),k=t.apply(M,A),I=V==null?_(k):typeof V=="function"?V.apply(M,A):V,R=Math.max(k[1][0]-k[0][0],k[1][1]-k[0][1]),S=M.__zoom,P=typeof H=="function"?H.apply(M,A):H,U=l(S.invert(I).concat(R/S.k),P.invert(I).concat(R/P.k));return function(Y){if(Y===1)Y=P;else{var X=U(Y),Z=R/X[2];Y=new cn(Z,I[0]-X[0]*Z,I[1]-X[1]*Z)}T.zoom(null,Y)}})}function N(E,H,V){return!V&&E.__zooming||new C(E,H)}function C(E,H){this.that=E,this.args=H,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,H),this.taps=0}C.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,H){return this.mouse&&E!=="mouse"&&(this.mouse[1]=H.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=H.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=H.invert(this.touch1[0])),this.that.__zoom=H,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var H=ut(this.that).datum();u.call(E,this.that,new Uk(E,{sourceEvent:this.sourceEvent,target:h,transform:this.that.__zoom,dispatch:u}),H)}};function z(E,...H){if(!e.apply(this,arguments))return;var V=N(this,H).event(E),W=this.__zoom,M=Math.max(i[0],Math.min(i[1],W.k*Math.pow(2,r.apply(this,arguments)))),A=Rt(E);if(V.wheel)(V.mouse[0][0]!==A[0]||V.mouse[0][1]!==A[1])&&(V.mouse[1]=W.invert(V.mouse[0]=A)),clearTimeout(V.wheel);else{if(W.k===M)return;V.mouse=[A,W.invert(A)],Js(this),V.start()}Vo(E),V.wheel=setTimeout(T,g),V.zoom("mouse",n(y(m(W,M),V.mouse[0],V.mouse[1]),V.extent,s));function T(){V.wheel=null,V.end()}}function L(E,...H){if(f||!e.apply(this,arguments))return;var V=E.currentTarget,W=N(this,H,!0).event(E),M=ut(E.view).on("mousemove.zoom",I,!0).on("mouseup.zoom",R,!0),A=Rt(E,V),T=E.clientX,k=E.clientY;Vy(E.view),lu(E),W.mouse=[A,this.__zoom.invert(A)],Js(this),W.start();function I(S){if(Vo(S),!W.moved){var P=S.clientX-T,U=S.clientY-k;W.moved=P*P+U*U>v}W.event(S).zoom("mouse",n(y(W.that.__zoom,W.mouse[0]=Rt(S,V),W.mouse[1]),W.extent,s))}function R(S){M.on("mousemove.zoom mouseup.zoom",null),Fy(S.view,W.moved),Vo(S),W.event(S).end()}}function q(E,...H){if(e.apply(this,arguments)){var V=this.__zoom,W=Rt(E.changedTouches?E.changedTouches[0]:E,this),M=V.invert(W),A=V.k*(E.shiftKey?.5:2),T=n(y(m(V,A),W,M),t.apply(this,H),s);Vo(E),a>0?ut(this).transition().duration(a).call(x,T,W,E):ut(this).call(h.transform,T,W,E)}}function b(E,...H){if(e.apply(this,arguments)){var V=E.touches,W=V.length,M=N(this,H,E.changedTouches.length===W).event(E),A,T,k,I;for(lu(E),T=0;T<W;++T)k=V[T],I=Rt(k,this),I=[I,this.__zoom.invert(I),k.identifier],M.touch0?!M.touch1&&M.touch0[2]!==I[2]&&(M.touch1=I,M.taps=0):(M.touch0=I,A=!0,M.taps=1+!!d);d&&(d=clearTimeout(d)),A&&(M.taps<2&&(c=I[0],d=setTimeout(function(){d=null},p)),Js(this),M.start())}}function j(E,...H){if(this.__zooming){var V=N(this,H).event(E),W=E.changedTouches,M=W.length,A,T,k,I;for(Vo(E),A=0;A<M;++A)T=W[A],k=Rt(T,this),V.touch0&&V.touch0[2]===T.identifier?V.touch0[0]=k:V.touch1&&V.touch1[2]===T.identifier&&(V.touch1[0]=k);if(T=V.that.__zoom,V.touch1){var R=V.touch0[0],S=V.touch0[1],P=V.touch1[0],U=V.touch1[1],Y=(Y=P[0]-R[0])*Y+(Y=P[1]-R[1])*Y,X=(X=U[0]-S[0])*X+(X=U[1]-S[1])*X;T=m(T,Math.sqrt(Y/X)),k=[(R[0]+P[0])/2,(R[1]+P[1])/2],I=[(S[0]+U[0])/2,(S[1]+U[1])/2]}else if(V.touch0)k=V.touch0[0],I=V.touch0[1];else return;V.zoom("touch",n(y(T,k,I),V.extent,s))}}function B(E,...H){if(this.__zooming){var V=N(this,H).event(E),W=E.changedTouches,M=W.length,A,T;for(lu(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),A=0;A<M;++A)T=W[A],V.touch0&&V.touch0[2]===T.identifier?delete V.touch0:V.touch1&&V.touch1[2]===T.identifier&&delete V.touch1;if(V.touch1&&!V.touch0&&(V.touch0=V.touch1,delete V.touch1),V.touch0)V.touch0[1]=this.__zoom.invert(V.touch0[0]);else if(V.end(),V.taps===2&&(T=Rt(T,this),Math.hypot(c[0]-T[0],c[1]-T[1])<w)){var k=ut(this).on("dblclick.zoom");k&&k.apply(this,arguments)}}}return h.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:Ss(+E),h):r},h.filter=function(E){return arguments.length?(e=typeof E=="function"?E:Ss(!!E),h):e},h.touchable=function(E){return arguments.length?(o=typeof E=="function"?E:Ss(!!E),h):o},h.extent=function(E){return arguments.length?(t=typeof E=="function"?E:Ss([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),h):t},h.scaleExtent=function(E){return arguments.length?(i[0]=+E[0],i[1]=+E[1],h):[i[0],i[1]]},h.translateExtent=function(E){return arguments.length?(s[0][0]=+E[0][0],s[1][0]=+E[1][0],s[0][1]=+E[0][1],s[1][1]=+E[1][1],h):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},h.constrain=function(E){return arguments.length?(n=E,h):n},h.duration=function(E){return arguments.length?(a=+E,h):a},h.interpolate=function(E){return arguments.length?(l=E,h):l},h.on=function(){var E=u.on.apply(u,arguments);return E===u?h:E},h.clickDistance=function(E){return arguments.length?(v=(E=+E)*E,h):Math.sqrt(v)},h.tapDistance=function(E){return arguments.length?(w=+E,h):w},h}const Qt={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Ii=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],ov=["Enter"," ","Escape"],iv={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"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 po;(function(e){e.Strict="strict",e.Loose="loose"})(po||(po={}));var hr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(hr||(hr={}));var Ri;(function(e){e.Partial="partial",e.Full="full"})(Ri||(Ri={}));const sv={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Mn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Mn||(Mn={}));var Aa;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Aa||(Aa={}));var oe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(oe||(oe={}));const Ip={[oe.Left]:oe.Right,[oe.Right]:oe.Left,[oe.Top]:oe.Bottom,[oe.Bottom]:oe.Top};function av(e){return e===null?null:e?"valid":"invalid"}const lv=e=>"id"in e&&"source"in e&&"target"in e,Gk=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Bd=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ki=(e,t=[0,0])=>{const{width:n,height:r}=wn(e),o=e.origin??t,i=n*o[0],s=r*o[1];return{x:e.position.x-i,y:e.position.y-s}},Qk=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const i=typeof o=="string";let s=!t.nodeLookup&&!i?o:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(o):Bd(o)?o:t.nodeLookup.get(o.id));const a=s?Oa(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return hl(r,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return pl(n)},Xi=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(n=hl(n,Oa(o)),r=!0)}),r?pl(n):{x:0,y:0,width:0,height:0}},Ud=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1)=>{const a={...Gi(t,[n,r,o]),width:t.width/o,height:t.height/o},l=[];for(const u of e.values()){const{measured:d,selectable:c=!0,hidden:f=!1}=u;if(s&&!c||f)continue;const p=d.width??u.width??u.initialWidth??null,g=d.height??u.height??u.initialHeight??null,v=zi(a,go(u)),w=(p??0)*(g??0),h=i&&v>0;(!u.internals.handleBounds||h||v>=w||u.dragging)&&l.push(u)}return l},Zk=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function Jk(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!o.hidden)&&(!r||r.has(o.id))&&n.set(o.id,o)}),n}async function eN({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const a=Jk(e,s),l=Xi(a),u=qd(l,t,n,(s==null?void 0:s.minZoom)??o,(s==null?void 0:s.maxZoom)??i,(s==null?void 0:s.padding)??.1);return await r.setViewport(u,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),Promise.resolve(!0)}function uv({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:i}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:l,y:u}=a?a.internals.positionAbsolute:{x:0,y:0},d=s.origin??r;let c=s.extent||o;if(s.extent==="parent"&&!s.expandParent)if(!a)i==null||i("005",Qt.error005());else{const p=a.measured.width,g=a.measured.height;p&&g&&(c=[[l,u],[l+p,u+g]])}else a&&yo(s.extent)&&(c=[[s.extent[0][0]+l,s.extent[0][1]+u],[s.extent[1][0]+l,s.extent[1][1]+u]]);const f=yo(c)?$r(t,c,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",Qt.error015())),{position:{x:f.x-l+(s.measured.width??0)*d[0],y:f.y-u+(s.measured.height??0)*d[1]},positionAbsolute:f}}async function tN({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const i=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const p=i.has(f.id),g=!p&&f.parentId&&s.find(v=>v.id===f.parentId);(p||g)&&s.push(f)}const a=new Set(t.map(f=>f.id)),l=r.filter(f=>f.deletable!==!1),d=Zk(s,l);for(const f of l)a.has(f.id)&&!d.find(g=>g.id===f.id)&&d.push(f);if(!o)return{edges:d,nodes:s};const c=await o({nodes:s,edges:d});return typeof c=="boolean"?c?{edges:d,nodes:s}:{edges:[],nodes:[]}:c}const mo=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),$r=(e={x:0,y:0},t,n)=>({x:mo(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:mo(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function cv(e,t,n){const{width:r,height:o}=wn(n),{x:i,y:s}=n.internals.positionAbsolute;return $r(e,[[i,s],[i+r,s+o]],t)}const Rp=(e,t,n)=>e<t?mo(Math.abs(e-t),1,t)/t:e>n?-mo(Math.abs(e-n),1,t)/t:0,dv=(e,t,n=15,r=40)=>{const o=Rp(e.x,r,t.width-r)*n,i=Rp(e.y,r,t.height-r)*n;return[o,i]},hl=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Sc=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),pl=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),go=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Bd(e)?e.internals.positionAbsolute:Ki(e,t);return{x:n,y:r,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Oa=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Bd(e)?e.internals.positionAbsolute:Ki(e,t);return{x:n,y:r,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},fv=(e,t)=>pl(hl(Sc(e),Sc(t))),zi=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},zp=e=>Dt(e.width)&&Dt(e.height)&&Dt(e.x)&&Dt(e.y),Dt=e=>!isNaN(e)&&isFinite(e),nN=(e,t)=>{},Yi=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Gi=({x:e,y:t},[n,r,o],i=!1,s=[1,1])=>{const a={x:(e-n)/o,y:(t-r)/o};return i?Yi(a,s):a},Da=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function jr(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function rN(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=jr(e,n),o=jr(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=jr(e.top??e.y??0,n),o=jr(e.bottom??e.y??0,n),i=jr(e.left??e.x??0,t),s=jr(e.right??e.x??0,t);return{top:r,right:s,bottom:o,left:i,x:i+s,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function oN(e,t,n,r,o,i){const{x:s,y:a}=Da(e,[t,n,r]),{x:l,y:u}=Da({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=o-l,c=i-u;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(d),bottom:Math.floor(c)}}const qd=(e,t,n,r,o,i)=>{const s=rN(i,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,u=Math.min(a,l),d=mo(u,r,o),c=e.x+e.width/2,f=e.y+e.height/2,p=t/2-c*d,g=n/2-f*d,v=oN(e,p,g,d,t,n),w={left:Math.min(v.left-s.left,0),top:Math.min(v.top-s.top,0),right:Math.min(v.right-s.right,0),bottom:Math.min(v.bottom-s.bottom,0)};return{x:p-w.left+w.right,y:g-w.top+w.bottom,zoom:d}},Ai=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function yo(e){return e!=null&&e!=="parent"}function wn(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function hv(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function pv(e,t={width:0,height:0},n,r,o){const i={...e},s=r.get(n);if(s){const a=s.origin||o;i.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function Ap(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function iN(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function sN(e){return{...iv,...e||{}}}function ai(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:i,y:s}=Lt(e),a=Gi({x:i-((o==null?void 0:o.left)??0),y:s-((o==null?void 0:o.top)??0)},r),{x:l,y:u}=n?Yi(a,t):a;return{xSnapped:l,ySnapped:u,...a}}const Wd=e=>({width:e.offsetWidth,height:e.offsetHeight}),mv=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},aN=["INPUT","SELECT","TEXTAREA"];function gv(e){var r,o;const t=((o=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:o[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:aN.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const yv=e=>"clientX"in e,Lt=(e,t)=>{var i,s;const n=yv(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},Op=(e,t,n,r,o)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:o,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...Wd(s)}})};function vv({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:a}){const l=e*.125+o*.375+s*.375+n*.125,u=t*.125+i*.375+a*.375+r*.125,d=Math.abs(l-e),c=Math.abs(u-t);return[l,u,d,c]}function Es(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Dp({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case oe.Left:return[t-Es(t-r,i),n];case oe.Right:return[t+Es(r-t,i),n];case oe.Top:return[t,n-Es(n-o,i)];case oe.Bottom:return[t,n+Es(o-n,i)]}}function wv({sourceX:e,sourceY:t,sourcePosition:n=oe.Bottom,targetX:r,targetY:o,targetPosition:i=oe.Top,curvature:s=.25}){const[a,l]=Dp({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[u,d]=Dp({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[c,f,p,g]=vv({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:d});return[`M${e},${t} C${a},${l} ${u},${d} ${r},${o}`,c,f,p,g]}function _v({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,a=r<t?r+s:r-s;return[i,a,o,s]}function lN({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:i="basic"}){if(i==="manual")return r;const s=o&&n?r+1e3:r,a=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return s+a}function uN({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const i=hl(Oa(e),Oa(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]};return zi(s,pl(i))>0}const cN=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,dN=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),fN=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||cN;let o;return lv(e)?o={...e}:o={...e,id:r(e)},dN(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function $v({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,a]=_v({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,a]}const Lp={[oe.Left]:{x:-1,y:0},[oe.Right]:{x:1,y:0},[oe.Top]:{x:0,y:-1},[oe.Bottom]:{x:0,y:1}},hN=({source:e,sourcePosition:t=oe.Bottom,target:n})=>t===oe.Left||t===oe.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Vp=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function pN({source:e,sourcePosition:t=oe.Bottom,target:n,targetPosition:r=oe.Top,center:o,offset:i,stepPosition:s}){const a=Lp[t],l=Lp[r],u={x:e.x+a.x*i,y:e.y+a.y*i},d={x:n.x+l.x*i,y:n.y+l.y*i},c=hN({source:u,sourcePosition:t,target:d}),f=c.x!==0?"x":"y",p=c[f];let g=[],v,w;const h={x:0,y:0},m={x:0,y:0},[,,y,_]=_v({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[f]*l[f]===-1){f==="x"?(v=o.x??u.x+(d.x-u.x)*s,w=o.y??(u.y+d.y)/2):(v=o.x??(u.x+d.x)/2,w=o.y??u.y+(d.y-u.y)*s);const z=[{x:v,y:u.y},{x:v,y:d.y}],L=[{x:u.x,y:w},{x:d.x,y:w}];a[f]===p?g=f==="x"?z:L:g=f==="x"?L:z}else{const z=[{x:u.x,y:d.y}],L=[{x:d.x,y:u.y}];if(f==="x"?g=a.x===p?L:z:g=a.y===p?z:L,t===r){const E=Math.abs(e[f]-n[f]);if(E<=i){const H=Math.min(i-1,i-E);a[f]===p?h[f]=(u[f]>e[f]?-1:1)*H:m[f]=(d[f]>n[f]?-1:1)*H}}if(t!==r){const E=f==="x"?"y":"x",H=a[f]===l[E],V=u[E]>d[E],W=u[E]<d[E];(a[f]===1&&(!H&&V||H&&W)||a[f]!==1&&(!H&&W||H&&V))&&(g=f==="x"?z:L)}const q={x:u.x+h.x,y:u.y+h.y},b={x:d.x+m.x,y:d.y+m.y},j=Math.max(Math.abs(q.x-g[0].x),Math.abs(b.x-g[0].x)),B=Math.max(Math.abs(q.y-g[0].y),Math.abs(b.y-g[0].y));j>=B?(v=(q.x+b.x)/2,w=g[0].y):(v=g[0].x,w=(q.y+b.y)/2)}const x={x:u.x+h.x,y:u.y+h.y},N={x:d.x+m.x,y:d.y+m.y};return[[e,...x.x!==g[0].x||x.y!==g[0].y?[x]:[],...g,...N.x!==g[g.length-1].x||N.y!==g[g.length-1].y?[N]:[],n],v,w,y,_]}function mN(e,t,n,r){const o=Math.min(Vp(e,t)/2,Vp(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${i+o*u},${s}Q ${i},${s} ${i},${s+o*d}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${i},${s+o*l}Q ${i},${s} ${i+o*a},${s}`}function Ec({sourceX:e,sourceY:t,sourcePosition:n=oe.Bottom,targetX:r,targetY:o,targetPosition:i=oe.Top,borderRadius:s=5,centerX:a,centerY:l,offset:u=20,stepPosition:d=.5}){const[c,f,p,g,v]=pN({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:a,y:l},offset:u,stepPosition:d});let w=`M${c[0].x} ${c[0].y}`;for(let h=1;h<c.length-1;h++)w+=mN(c[h-1],c[h],c[h+1],s);return w+=`L${c[c.length-1].x} ${c[c.length-1].y}`,[w,f,p,g,v]}function Fp(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function gN(e){var c;const{sourceNode:t,targetNode:n}=e;if(!Fp(t)||!Fp(n))return null;const r=t.internals.handleBounds||Hp(t.handles),o=n.internals.handleBounds||Hp(n.handles),i=Bp((r==null?void 0:r.source)??[],e.sourceHandle),s=Bp(e.connectionMode===po.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!i||!s)return(c=e.onError)==null||c.call(e,"008",Qt.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=(i==null?void 0:i.position)||oe.Bottom,l=(s==null?void 0:s.position)||oe.Top,u=xr(t,i,a),d=xr(n,s,l);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:a,targetPosition:l}}function Hp(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function xr(e,t,n=oe.Left,r=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??wn(e);if(r)return{x:o+s/2,y:i+a/2};switch((t==null?void 0:t.position)??n){case oe.Top:return{x:o+s/2,y:i};case oe.Right:return{x:o+s,y:i+a/2};case oe.Bottom:return{x:o+s/2,y:i+a};case oe.Left:return{x:o,y:i+a/2}}}function Bp(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function kc(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function yN(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){const i=new Set;return e.reduce((s,a)=>([a.markerStart||r,a.markerEnd||o].forEach(l=>{if(l&&typeof l=="object"){const u=kc(l,t);i.has(u)||(s.push({id:u,color:l.color||n,...l}),i.add(u))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const xv=1e3,vN=10,Kd={nodeOrigin:[0,0],nodeExtent:Ii,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},wN={...Kd,checkEquality:!0};function Xd(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function _N(e,t,n){const r=Xd(Kd,n);for(const o of e.values())if(o.parentId)Gd(o,e,t,r);else{const i=Ki(o,r.nodeOrigin),s=yo(o.extent)?o.extent:r.nodeExtent,a=$r(i,s,wn(o));o.internals.positionAbsolute=a}}function $N(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const o of e.handles){const i={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?n.push(i):o.type==="target"&&r.push(i)}return{source:n,target:r}}function Yd(e){return e==="manual"}function Nc(e,t,n,r={}){var d,c;const o=Xd(wN,r),i={i:0},s=new Map(t),a=o!=null&&o.elevateNodesOnSelect&&!Yd(o.zIndexMode)?xv:0;let l=e.length>0,u=!1;t.clear(),n.clear();for(const f of e){let p=s.get(f.id);if(o.checkEquality&&f===(p==null?void 0:p.internals.userNode))t.set(f.id,p);else{const g=Ki(f,o.nodeOrigin),v=yo(f.extent)?f.extent:o.nodeExtent,w=$r(g,v,wn(f));p={...o.defaults,...f,measured:{width:(d=f.measured)==null?void 0:d.width,height:(c=f.measured)==null?void 0:c.height},internals:{positionAbsolute:w,handleBounds:$N(f,p),z:Sv(f,a,o.zIndexMode),userNode:f}},t.set(f.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(l=!1),f.parentId&&Gd(p,t,n,r,i),u||(u=f.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:u}}function xN(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Gd(e,t,n,r,o){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:a,zIndexMode:l}=Xd(Kd,r),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}xN(e,n),o&&!d.parentId&&d.internals.rootParentIndex===void 0&&l==="auto"&&(d.internals.rootParentIndex=++o.i,d.internals.z=d.internals.z+o.i*vN),o&&d.internals.rootParentIndex!==void 0&&(o.i=d.internals.rootParentIndex);const c=i&&!Yd(l)?xv:0,{x:f,y:p,z:g}=SN(e,d,s,a,c,l),{positionAbsolute:v}=e.internals,w=f!==v.x||p!==v.y;(w||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:f,y:p}:v,z:g}})}function Sv(e,t,n){const r=Dt(e.zIndex)?e.zIndex:0;return Yd(n)?r:r+(e.selected?t:0)}function SN(e,t,n,r,o,i){const{x:s,y:a}=t.internals.positionAbsolute,l=wn(e),u=Ki(e,n),d=yo(e.extent)?$r(u,e.extent,l):u;let c=$r({x:s+d.x,y:a+d.y},r,l);e.extent==="parent"&&(c=cv(c,l,t));const f=Sv(e,o,i),p=t.internals.z??0;return{x:c.x,y:c.y,z:p>=f?p+1:f}}function Qd(e,t,n,r=[0,0]){var s;const o=[],i=new Map;for(const a of e){const l=t.get(a.parentId);if(!l)continue;const u=((s=i.get(a.parentId))==null?void 0:s.expandedRect)??go(l),d=fv(u,a.rect);i.set(a.parentId,{expandedRect:d,parent:l})}return i.size>0&&i.forEach(({expandedRect:a,parent:l},u)=>{var y;const d=l.internals.positionAbsolute,c=wn(l),f=l.origin??r,p=a.x<d.x?Math.round(Math.abs(d.x-a.x)):0,g=a.y<d.y?Math.round(Math.abs(d.y-a.y)):0,v=Math.max(c.width,Math.round(a.width)),w=Math.max(c.height,Math.round(a.height)),h=(v-c.width)*f[0],m=(w-c.height)*f[1];(p>0||g>0||h||m)&&(o.push({id:u,type:"position",position:{x:l.position.x-p+h,y:l.position.y-g+m}}),(y=n.get(u))==null||y.forEach(_=>{e.some(x=>x.id===_.id)||o.push({id:_.id,type:"position",position:{x:_.position.x+p,y:_.position.y+g}})})),(c.width<a.width||c.height<a.height||p||g)&&o.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:v+(p?f[0]*p-h:0),height:w+(g?f[1]*g-m:0)}})}),o}function EN(e,t,n,r,o,i,s){const a=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!a)return{changes:[],updatedInternals:l};const u=[],d=window.getComputedStyle(a),{m22:c}=new window.DOMMatrixReadOnly(d.transform),f=[];for(const p of e.values()){const g=t.get(p.id);if(!g)continue;if(g.hidden){t.set(g.id,{...g,internals:{...g.internals,handleBounds:void 0}}),l=!0;continue}const v=Wd(p.nodeElement),w=g.measured.width!==v.width||g.measured.height!==v.height;if(!!(v.width&&v.height&&(w||!g.internals.handleBounds||p.force))){const m=p.nodeElement.getBoundingClientRect(),y=yo(g.extent)?g.extent:i;let{positionAbsolute:_}=g.internals;g.parentId&&g.extent==="parent"?_=cv(_,v,t.get(g.parentId)):y&&(_=$r(_,y,v));const x={...g,measured:v,internals:{...g.internals,positionAbsolute:_,handleBounds:{source:Op("source",p.nodeElement,m,c,g.id),target:Op("target",p.nodeElement,m,c,g.id)}}};t.set(g.id,x),g.parentId&&Gd(x,t,n,{nodeOrigin:o,zIndexMode:s}),l=!0,w&&(u.push({id:g.id,type:"dimensions",dimensions:v}),g.expandParent&&g.parentId&&f.push({id:g.id,parentId:g.parentId,rect:go(x,o)}))}}if(f.length>0){const p=Qd(f,t,n,o);u.push(...p)}return{changes:u,updatedInternals:l}}async function kN({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,i]],r),a=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(a)}function Up(e,t,n,r,o,i){let s=o;const a=r.get(s)||new Map;r.set(s,a.set(n,t)),s=`${o}-${e}`;const l=r.get(s)||new Map;if(r.set(s,l.set(n,t)),i){s=`${o}-${e}-${i}`;const u=r.get(s)||new Map;r.set(s,u.set(n,t))}}function Ev(e,t,n){e.clear(),t.clear();for(const r of n){const{source:o,target:i,sourceHandle:s=null,targetHandle:a=null}=r,l={edgeId:r.id,source:o,target:i,sourceHandle:s,targetHandle:a},u=`${o}-${s}--${i}-${a}`,d=`${i}-${a}--${o}-${s}`;Up("source",l,d,e,o,s),Up("target",l,u,e,i,a),t.set(r.id,r)}}function kv(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:kv(n,t):!1}function qp(e,t,n){var o;let r=e;do{if((o=r==null?void 0:r.matches)!=null&&o.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function NN(e,t,n,r){const o=new Map;for(const[i,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!kv(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(i);a&&o.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return o}function uu({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,a,l;const o=[];for(const[u,d]of t){const c=(s=n.get(u))==null?void 0:s.internals.userNode;c&&o.push({...c,position:d.position,dragging:r})}if(!e)return[o[0],o];const i=(a=n.get(e))==null?void 0:a.internals.userNode;return[i?{...i,position:((l=t.get(e))==null?void 0:l.position)||i.position,dragging:r}:o[0],o]}function PN({dragItems:e,snapGrid:t,x:n,y:r}){const o=e.values().next().value;if(!o)return null;const i={x:n-o.distance.x,y:r-o.distance.y},s=Yi(i,t);return{x:s.x-i.x,y:s.y-i.y}}function CN({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},s=0,a=new Map,l=!1,u={x:0,y:0},d=null,c=!1,f=null,p=!1,g=!1,v=null;function w({noDragClassName:m,handleSelector:y,domNode:_,isSelectable:x,nodeId:N,nodeClickDistance:C=0}){f=ut(_);function z({x:j,y:B}){const{nodeLookup:E,nodeExtent:H,snapGrid:V,snapToGrid:W,nodeOrigin:M,onNodeDrag:A,onSelectionDrag:T,onError:k,updateNodePositions:I}=t();i={x:j,y:B};let R=!1;const S=a.size>1,P=S&&H?Sc(Xi(a)):null,U=S&&W?PN({dragItems:a,snapGrid:V,x:j,y:B}):null;for(const[Y,X]of a){if(!E.has(Y))continue;let Z={x:j-X.distance.x,y:B-X.distance.y};W&&(Z=U?{x:Math.round(Z.x+U.x),y:Math.round(Z.y+U.y)}:Yi(Z,V));let te=null;if(S&&H&&!X.extent&&P){const{positionAbsolute:K}=X.internals,G=K.x-P.x+H[0][0],J=K.x+X.measured.width-P.x2+H[1][0],ne=K.y-P.y+H[0][1],ce=K.y+X.measured.height-P.y2+H[1][1];te=[[G,ne],[J,ce]]}const{position:D,positionAbsolute:F}=uv({nodeId:Y,nextPosition:Z,nodeLookup:E,nodeExtent:te||H,nodeOrigin:M,onError:k});R=R||X.position.x!==D.x||X.position.y!==D.y,X.position=D,X.internals.positionAbsolute=F}if(g=g||R,!!R&&(I(a,!0),v&&(r||A||!N&&T))){const[Y,X]=uu({nodeId:N,dragItems:a,nodeLookup:E});r==null||r(v,a,Y,X),A==null||A(v,Y,X),N||T==null||T(v,X)}}async function L(){if(!d)return;const{transform:j,panBy:B,autoPanSpeed:E,autoPanOnNodeDrag:H}=t();if(!H){l=!1,cancelAnimationFrame(s);return}const[V,W]=dv(u,d,E);(V!==0||W!==0)&&(i.x=(i.x??0)-V/j[2],i.y=(i.y??0)-W/j[2],await B({x:V,y:W})&&z(i)),s=requestAnimationFrame(L)}function q(j){var S;const{nodeLookup:B,multiSelectionActive:E,nodesDraggable:H,transform:V,snapGrid:W,snapToGrid:M,selectNodesOnDrag:A,onNodeDragStart:T,onSelectionDragStart:k,unselectNodesAndEdges:I}=t();c=!0,(!A||!x)&&!E&&N&&((S=B.get(N))!=null&&S.selected||I()),x&&A&&N&&(e==null||e(N));const R=ai(j.sourceEvent,{transform:V,snapGrid:W,snapToGrid:M,containerBounds:d});if(i=R,a=NN(B,H,R,N),a.size>0&&(n||T||!N&&k)){const[P,U]=uu({nodeId:N,dragItems:a,nodeLookup:B});n==null||n(j.sourceEvent,a,P,U),T==null||T(j.sourceEvent,P,U),N||k==null||k(j.sourceEvent,U)}}const b=Hy().clickDistance(C).on("start",j=>{const{domNode:B,nodeDragThreshold:E,transform:H,snapGrid:V,snapToGrid:W}=t();d=(B==null?void 0:B.getBoundingClientRect())||null,p=!1,g=!1,v=j.sourceEvent,E===0&&q(j),i=ai(j.sourceEvent,{transform:H,snapGrid:V,snapToGrid:W,containerBounds:d}),u=Lt(j.sourceEvent,d)}).on("drag",j=>{const{autoPanOnNodeDrag:B,transform:E,snapGrid:H,snapToGrid:V,nodeDragThreshold:W,nodeLookup:M}=t(),A=ai(j.sourceEvent,{transform:E,snapGrid:H,snapToGrid:V,containerBounds:d});if(v=j.sourceEvent,(j.sourceEvent.type==="touchmove"&&j.sourceEvent.touches.length>1||N&&!M.has(N))&&(p=!0),!p){if(!l&&B&&c&&(l=!0,L()),!c){const T=Lt(j.sourceEvent,d),k=T.x-u.x,I=T.y-u.y;Math.sqrt(k*k+I*I)>W&&q(j)}(i.x!==A.xSnapped||i.y!==A.ySnapped)&&a&&c&&(u=Lt(j.sourceEvent,d),z(A))}}).on("end",j=>{if(!(!c||p)&&(l=!1,c=!1,cancelAnimationFrame(s),a.size>0)){const{nodeLookup:B,updateNodePositions:E,onNodeDragStop:H,onSelectionDragStop:V}=t();if(g&&(E(a,!1),g=!1),o||H||!N&&V){const[W,M]=uu({nodeId:N,dragItems:a,nodeLookup:B,dragging:!1});o==null||o(j.sourceEvent,a,W,M),H==null||H(j.sourceEvent,W,M),N||V==null||V(j.sourceEvent,M)}}}).filter(j=>{const B=j.target;return!j.button&&(!m||!qp(B,`.${m}`,_))&&(!y||qp(B,y,_))});f.call(b)}function h(){f==null||f.on(".drag",null)}return{update:w,destroy:h}}function bN(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())zi(o,go(i))>0&&r.push(i);return r}const jN=250;function MN(e,t,n,r){var a,l;let o=[],i=1/0;const s=bN(e,n,t+jN);for(const u of s){const d=[...((a=u.internals.handleBounds)==null?void 0:a.source)??[],...((l=u.internals.handleBounds)==null?void 0:l.target)??[]];for(const c of d){if(r.nodeId===c.nodeId&&r.type===c.type&&r.id===c.id)continue;const{x:f,y:p}=xr(u,c,c.position,!0),g=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(p-e.y,2));g>t||(g<i?(o=[{...c,x:f,y:p}],i=g):g===i&&o.push({...c,x:f,y:p}))}}if(!o.length)return null;if(o.length>1){const u=r.type==="source"?"target":"source";return o.find(d=>d.type===u)??o[0]}return o[0]}function Nv(e,t,n,r,o,i=!1){var u,d,c;const s=r.get(e);if(!s)return null;const a=o==="strict"?(u=s.internals.handleBounds)==null?void 0:u[t]:[...((d=s.internals.handleBounds)==null?void 0:d.source)??[],...((c=s.internals.handleBounds)==null?void 0:c.target)??[]],l=(n?a==null?void 0:a.find(f=>f.id===n):a==null?void 0:a[0])??null;return l&&i?{...l,...xr(s,l,l.position,!0)}:l}function Pv(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function TN(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Cv=()=>!0;function IN(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:s,domNode:a,nodeLookup:l,lib:u,autoPanOnConnect:d,flowId:c,panBy:f,cancelConnection:p,onConnectStart:g,onConnect:v,onConnectEnd:w,isValidConnection:h=Cv,onReconnectEnd:m,updateConnection:y,getTransform:_,getFromHandle:x,autoPanSpeed:N,dragThreshold:C=1,handleDomNode:z}){const L=mv(e.target);let q=0,b;const{x:j,y:B}=Lt(e),E=Pv(i,z),H=a==null?void 0:a.getBoundingClientRect();let V=!1;if(!H||!E)return;const W=Nv(o,E,r,l,t);if(!W)return;let M=Lt(e,H),A=!1,T=null,k=!1,I=null;function R(){if(!d||!H)return;const[D,F]=dv(M,H,N);f({x:D,y:F}),q=requestAnimationFrame(R)}const S={...W,nodeId:o,type:E,position:W.position},P=l.get(o);let Y={inProgress:!0,isValid:null,from:xr(P,S,oe.Left,!0),fromHandle:S,fromPosition:S.position,fromNode:P,to:M,toHandle:null,toPosition:Ip[S.position],toNode:null,pointer:M};function X(){V=!0,y(Y),g==null||g(e,{nodeId:o,handleId:r,handleType:E})}C===0&&X();function Z(D){if(!V){const{x:ce,y:Me}=Lt(D),we=ce-j,Pe=Me-B;if(!(we*we+Pe*Pe>C*C))return;X()}if(!x()||!S){te(D);return}const F=_();M=Lt(D,H),b=MN(Gi(M,F,!1,[1,1]),n,l,S),A||(R(),A=!0);const K=bv(D,{handle:b,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:s?"target":"source",isValidConnection:h,doc:L,lib:u,flowId:c,nodeLookup:l});I=K.handleDomNode,T=K.connection,k=TN(!!b,K.isValid);const G=l.get(o),J=G?xr(G,S,oe.Left,!0):Y.from,ne={...Y,from:J,isValid:k,to:K.toHandle&&k?Da({x:K.toHandle.x,y:K.toHandle.y},F):M,toHandle:K.toHandle,toPosition:k&&K.toHandle?K.toHandle.position:Ip[S.position],toNode:K.toHandle?l.get(K.toHandle.nodeId):null,pointer:M};y(ne),Y=ne}function te(D){if(!("touches"in D&&D.touches.length>0)){if(V){(b||I)&&T&&k&&(v==null||v(T));const{inProgress:F,...K}=Y,G={...K,toPosition:Y.toHandle?Y.toPosition:null};w==null||w(D,G),i&&(m==null||m(D,G))}p(),cancelAnimationFrame(q),A=!1,k=!1,T=null,I=null,L.removeEventListener("mousemove",Z),L.removeEventListener("mouseup",te),L.removeEventListener("touchmove",Z),L.removeEventListener("touchend",te)}}L.addEventListener("mousemove",Z),L.addEventListener("mouseup",te),L.addEventListener("touchmove",Z),L.addEventListener("touchend",te)}function bv(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:s,lib:a,flowId:l,isValidConnection:u=Cv,nodeLookup:d}){const c=i==="target",f=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:p,y:g}=Lt(e),v=s.elementFromPoint(p,g),w=v!=null&&v.classList.contains(`${a}-flow__handle`)?v:f,h={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const m=Pv(void 0,w),y=w.getAttribute("data-nodeid"),_=w.getAttribute("data-handleid"),x=w.classList.contains("connectable"),N=w.classList.contains("connectableend");if(!y||!m)return h;const C={source:c?y:r,sourceHandle:c?_:o,target:c?r:y,targetHandle:c?o:_};h.connection=C;const L=x&&N&&(n===po.Strict?c&&m==="source"||!c&&m==="target":y!==r||_!==o);h.isValid=L&&u(C),h.toHandle=Nv(y,m,_,d,n,!0)}return h}const Pc={onPointerDown:IN,isValid:bv};function RN({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=ut(e);function i({translateExtent:a,width:l,height:u,zoomStep:d=1,pannable:c=!0,zoomable:f=!0,inversePan:p=!1}){const g=y=>{if(y.sourceEvent.type!=="wheel"||!t)return;const _=n(),x=y.sourceEvent.ctrlKey&&Ai()?10:1,N=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*d,C=_[2]*Math.pow(2,N*x);t.scaleTo(C)};let v=[0,0];const w=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(v=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},h=y=>{const _=n();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!t)return;const x=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],N=[x[0]-v[0],x[1]-v[1]];v=x;const C=r()*Math.max(_[2],Math.log(_[2]))*(p?-1:1),z={x:_[0]-N[0]*C,y:_[1]-N[1]*C},L=[[0,0],[l,u]];t.setViewportConstrained({x:z.x,y:z.y,zoom:_[2]},L,a)},m=rv().on("start",w).on("zoom",c?h:null).on("zoom.wheel",f?g:null);o.call(m,{})}function s(){o.on("zoom",null)}return{update:i,destroy:s,pointer:Rt}}const ml=e=>({x:e.x,y:e.y,zoom:e.k}),cu=({x:e,y:t,zoom:n})=>fl.translate(e,t).scale(n),qr=(e,t)=>e.target.closest(`.${t}`),jv=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),zN=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,du=(e,t=0,n=zN,r=()=>{})=>{const o=typeof t=="number"&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},Mv=e=>{const t=e.ctrlKey&&Ai()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function AN({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:u}){return d=>{if(qr(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const c=n.property("__zoom").k||1;if(d.ctrlKey&&s){const w=Rt(d),h=Mv(d),m=c*Math.pow(2,h);r.scaleTo(n,m,w,d);return}const f=d.deltaMode===1?20:1;let p=o===hr.Vertical?0:d.deltaX*f,g=o===hr.Horizontal?0:d.deltaY*f;!Ai()&&d.shiftKey&&o!==hr.Vertical&&(p=d.deltaY*f,g=0),r.translateBy(n,-(p/c)*i,-(g/c)*i,{internal:!0});const v=ml(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(d,v),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,v),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a==null||a(d,v))}}function ON({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const i=r.type==="wheel",s=!t&&i&&!r.ctrlKey,a=qr(r,e);if(r.ctrlKey&&i&&a&&r.preventDefault(),s||a)return null;r.preventDefault(),n.call(this,r,o)}}function DN({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,s,a;if((i=r.sourceEvent)!=null&&i.internal)return;const o=ml(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((a=r.sourceEvent)==null?void 0:a.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,o))}}function LN({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{var s,a;e.usedRightMouseButton=!!(n&&jv(t,e.mouseButton??0)),(s=i.sourceEvent)!=null&&s.sync||r([i.transform.x,i.transform.y,i.transform.k]),o&&!((a=i.sourceEvent)!=null&&a.internal)&&(o==null||o(i.sourceEvent,ml(i.transform)))}}function VN({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:i}){return s=>{var a;if(!((a=s.sourceEvent)!=null&&a.internal)&&(e.isZoomingOrPanning=!1,i&&jv(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const l=ml(s.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(s.sourceEvent,l)},n?150:0)}}}function FN({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:a,noPanClassName:l,lib:u,connectionInProgress:d}){return c=>{var w;const f=e||t,p=n&&c.ctrlKey,g=c.type==="wheel";if(c.button===1&&c.type==="mousedown"&&(qr(c,`${u}-flow__node`)||qr(c,`${u}-flow__edge`)))return!0;if(!r&&!f&&!o&&!i&&!n||s||d&&!g||qr(c,a)&&g||qr(c,l)&&(!g||o&&g&&!e)||!n&&c.ctrlKey&&g)return!1;if(!n&&c.type==="touchstart"&&((w=c.touches)==null?void 0:w.length)>1)return c.preventDefault(),!1;if(!f&&!o&&!p&&g||!r&&(c.type==="mousedown"||c.type==="touchstart")||Array.isArray(r)&&!r.includes(c.button)&&c.type==="mousedown")return!1;const v=Array.isArray(r)&&r.includes(c.button)||!c.button||c.button<=1;return(!c.ctrlKey||g)&&v}}function HN({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:a,onDraggingChange:l}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),c=rv().scaleExtent([t,n]).translateExtent(r),f=ut(e).call(c);m({x:o.x,y:o.y,zoom:mo(o.zoom,t,n)},[[0,0],[d.width,d.height]],r);const p=f.on("wheel.zoom"),g=f.on("dblclick.zoom");c.wheelDelta(Mv);function v(b,j){return f?new Promise(B=>{c==null||c.interpolate((j==null?void 0:j.interpolate)==="linear"?si:Gs).transform(du(f,j==null?void 0:j.duration,j==null?void 0:j.ease,()=>B(!0)),b)}):Promise.resolve(!1)}function w({noWheelClassName:b,noPanClassName:j,onPaneContextMenu:B,userSelectionActive:E,panOnScroll:H,panOnDrag:V,panOnScrollMode:W,panOnScrollSpeed:M,preventScrolling:A,zoomOnPinch:T,zoomOnScroll:k,zoomOnDoubleClick:I,zoomActivationKeyPressed:R,lib:S,onTransformChange:P,connectionInProgress:U,paneClickDistance:Y,selectionOnDrag:X}){E&&!u.isZoomingOrPanning&&h();const Z=H&&!R&&!E;c.clickDistance(X?1/0:!Dt(Y)||Y<0?0:Y);const te=Z?AN({zoomPanValues:u,noWheelClassName:b,d3Selection:f,d3Zoom:c,panOnScrollMode:W,panOnScrollSpeed:M,zoomOnPinch:T,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:a}):ON({noWheelClassName:b,preventScrolling:A,d3ZoomHandler:p});if(f.on("wheel.zoom",te,{passive:!1}),!E){const F=DN({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:s});c.on("start",F);const K=LN({zoomPanValues:u,panOnDrag:V,onPaneContextMenu:!!B,onPanZoom:i,onTransformChange:P});c.on("zoom",K);const G=VN({zoomPanValues:u,panOnDrag:V,panOnScroll:H,onPaneContextMenu:B,onPanZoomEnd:a,onDraggingChange:l});c.on("end",G)}const D=FN({zoomActivationKeyPressed:R,panOnDrag:V,zoomOnScroll:k,panOnScroll:H,zoomOnDoubleClick:I,zoomOnPinch:T,userSelectionActive:E,noPanClassName:j,noWheelClassName:b,lib:S,connectionInProgress:U});c.filter(D),I?f.on("dblclick.zoom",g):f.on("dblclick.zoom",null)}function h(){c.on("zoom",null)}async function m(b,j,B){const E=cu(b),H=c==null?void 0:c.constrain()(E,j,B);return H&&await v(H),new Promise(V=>V(H))}async function y(b,j){const B=cu(b);return await v(B,j),new Promise(E=>E(B))}function _(b){if(f){const j=cu(b),B=f.property("__zoom");(B.k!==b.zoom||B.x!==b.x||B.y!==b.y)&&(c==null||c.transform(f,j,null,{sync:!0}))}}function x(){const b=f?nv(f.node()):{x:0,y:0,k:1};return{x:b.x,y:b.y,zoom:b.k}}function N(b,j){return f?new Promise(B=>{c==null||c.interpolate((j==null?void 0:j.interpolate)==="linear"?si:Gs).scaleTo(du(f,j==null?void 0:j.duration,j==null?void 0:j.ease,()=>B(!0)),b)}):Promise.resolve(!1)}function C(b,j){return f?new Promise(B=>{c==null||c.interpolate((j==null?void 0:j.interpolate)==="linear"?si:Gs).scaleBy(du(f,j==null?void 0:j.duration,j==null?void 0:j.ease,()=>B(!0)),b)}):Promise.resolve(!1)}function z(b){c==null||c.scaleExtent(b)}function L(b){c==null||c.translateExtent(b)}function q(b){const j=!Dt(b)||b<0?0:b;c==null||c.clickDistance(j)}return{update:w,destroy:h,setViewport:y,setViewportConstrained:m,getViewport:x,scaleTo:N,scaleBy:C,setScaleExtent:z,setTranslateExtent:L,syncViewport:_,setClickDistance:q}}var vo;(function(e){e.Line="line",e.Handle="handle"})(vo||(vo={}));function BN({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:i}){const s=e-t,a=n-r,l=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&o&&(l[0]=l[0]*-1),a&&i&&(l[1]=l[1]*-1),l}function Wp(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:o}}function xn(e,t){return Math.max(0,t-e)}function Sn(e,t){return Math.max(0,e-t)}function ks(e,t,n){return Math.max(0,t-e,e-n)}function Kp(e,t){return e?!t:t}function UN(e,t,n,r,o,i,s,a){let{affectsX:l,affectsY:u}=t;const{isHorizontal:d,isVertical:c}=t,f=d&&c,{xSnapped:p,ySnapped:g}=n,{minWidth:v,maxWidth:w,minHeight:h,maxHeight:m}=r,{x:y,y:_,width:x,height:N,aspectRatio:C}=e;let z=Math.floor(d?p-e.pointerX:0),L=Math.floor(c?g-e.pointerY:0);const q=x+(l?-z:z),b=N+(u?-L:L),j=-i[0]*x,B=-i[1]*N;let E=ks(q,v,w),H=ks(b,h,m);if(s){let M=0,A=0;l&&z<0?M=xn(y+z+j,s[0][0]):!l&&z>0&&(M=Sn(y+q+j,s[1][0])),u&&L<0?A=xn(_+L+B,s[0][1]):!u&&L>0&&(A=Sn(_+b+B,s[1][1])),E=Math.max(E,M),H=Math.max(H,A)}if(a){let M=0,A=0;l&&z>0?M=Sn(y+z,a[0][0]):!l&&z<0&&(M=xn(y+q,a[1][0])),u&&L>0?A=Sn(_+L,a[0][1]):!u&&L<0&&(A=xn(_+b,a[1][1])),E=Math.max(E,M),H=Math.max(H,A)}if(o){if(d){const M=ks(q/C,h,m)*C;if(E=Math.max(E,M),s){let A=0;!l&&!u||l&&!u&&f?A=Sn(_+B+q/C,s[1][1])*C:A=xn(_+B+(l?z:-z)/C,s[0][1])*C,E=Math.max(E,A)}if(a){let A=0;!l&&!u||l&&!u&&f?A=xn(_+q/C,a[1][1])*C:A=Sn(_+(l?z:-z)/C,a[0][1])*C,E=Math.max(E,A)}}if(c){const M=ks(b*C,v,w)/C;if(H=Math.max(H,M),s){let A=0;!l&&!u||u&&!l&&f?A=Sn(y+b*C+j,s[1][0])/C:A=xn(y+(u?L:-L)*C+j,s[0][0])/C,H=Math.max(H,A)}if(a){let A=0;!l&&!u||u&&!l&&f?A=xn(y+b*C,a[1][0])/C:A=Sn(y+(u?L:-L)*C,a[0][0])/C,H=Math.max(H,A)}}}L=L+(L<0?H:-H),z=z+(z<0?E:-E),o&&(f?q>b*C?L=(Kp(l,u)?-z:z)/C:z=(Kp(l,u)?-L:L)*C:d?(L=z/C,u=l):(z=L*C,l=u));const V=l?y+z:y,W=u?_+L:_;return{width:x+(l?-z:z),height:N+(u?-L:L),x:i[0]*z*(l?-1:1)+V,y:i[1]*L*(u?-1:1)+W}}const Tv={width:0,height:0,x:0,y:0},qN={...Tv,pointerX:0,pointerY:0,aspectRatio:1};function WN(e){return[[0,0],[e.measured.width,e.measured.height]]}function KN(e,t,n){const r=t.position.x+e.position.x,o=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,a=n[0]*i,l=n[1]*s;return[[r-a,o-l],[r+i-a,o+s-l]]}function XN({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){const i=ut(e);let s={controlDirection:Wp("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:u,boundaries:d,keepAspectRatio:c,resizeDirection:f,onResizeStart:p,onResize:g,onResizeEnd:v,shouldResize:w}){let h={...Tv},m={...qN};s={boundaries:d,resizeDirection:f,keepAspectRatio:c,controlDirection:Wp(u)};let y,_=null,x=[],N,C,z,L=!1;const q=Hy().on("start",b=>{const{nodeLookup:j,transform:B,snapGrid:E,snapToGrid:H,nodeOrigin:V,paneDomNode:W}=n();if(y=j.get(t),!y)return;_=(W==null?void 0:W.getBoundingClientRect())??null;const{xSnapped:M,ySnapped:A}=ai(b.sourceEvent,{transform:B,snapGrid:E,snapToGrid:H,containerBounds:_});h={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},m={...h,pointerX:M,pointerY:A,aspectRatio:h.width/h.height},N=void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(N=j.get(y.parentId),C=N&&y.extent==="parent"?WN(N):void 0),x=[],z=void 0;for(const[T,k]of j)if(k.parentId===t&&(x.push({id:T,position:{...k.position},extent:k.extent}),k.extent==="parent"||k.expandParent)){const I=KN(k,y,k.origin??V);z?z=[[Math.min(I[0][0],z[0][0]),Math.min(I[0][1],z[0][1])],[Math.max(I[1][0],z[1][0]),Math.max(I[1][1],z[1][1])]]:z=I}p==null||p(b,{...h})}).on("drag",b=>{const{transform:j,snapGrid:B,snapToGrid:E,nodeOrigin:H}=n(),V=ai(b.sourceEvent,{transform:j,snapGrid:B,snapToGrid:E,containerBounds:_}),W=[];if(!y)return;const{x:M,y:A,width:T,height:k}=h,I={},R=y.origin??H,{width:S,height:P,x:U,y:Y}=UN(m,s.controlDirection,V,s.boundaries,s.keepAspectRatio,R,C,z),X=S!==T,Z=P!==k,te=U!==M&&X,D=Y!==A&&Z;if(!te&&!D&&!X&&!Z)return;if((te||D||R[0]===1||R[1]===1)&&(I.x=te?U:h.x,I.y=D?Y:h.y,h.x=I.x,h.y=I.y,x.length>0)){const J=U-M,ne=Y-A;for(const ce of x)ce.position={x:ce.position.x-J+R[0]*(S-T),y:ce.position.y-ne+R[1]*(P-k)},W.push(ce)}if((X||Z)&&(I.width=X&&(!s.resizeDirection||s.resizeDirection==="horizontal")?S:h.width,I.height=Z&&(!s.resizeDirection||s.resizeDirection==="vertical")?P:h.height,h.width=I.width,h.height=I.height),N&&y.expandParent){const J=R[0]*(I.width??0);I.x&&I.x<J&&(h.x=J,m.x=m.x-(I.x-J));const ne=R[1]*(I.height??0);I.y&&I.y<ne&&(h.y=ne,m.y=m.y-(I.y-ne))}const F=BN({width:h.width,prevWidth:T,height:h.height,prevHeight:k,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),K={...h,direction:F};(w==null?void 0:w(b,K))!==!1&&(L=!0,g==null||g(b,K),r(I,W))}).on("end",b=>{L&&(v==null||v(b,{...h}),o==null||o({...h}),L=!1)});i.call(q)}function l(){i.on(".drag",null)}return{update:a,destroy:l}}var Iv={exports:{}},Rv={},zv={exports:{}},Av={};/**
196
+ * @license React
197
+ * use-sync-external-store-shim.production.js
198
+ *
199
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
200
+ *
201
+ * This source code is licensed under the MIT license found in the
202
+ * LICENSE file in the root directory of this source tree.
203
+ */var wo=O;function YN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var GN=typeof Object.is=="function"?Object.is:YN,QN=wo.useState,ZN=wo.useEffect,JN=wo.useLayoutEffect,eP=wo.useDebugValue;function tP(e,t){var n=t(),r=QN({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return JN(function(){o.value=n,o.getSnapshot=t,fu(o)&&i({inst:o})},[e,n,t]),ZN(function(){return fu(o)&&i({inst:o}),e(function(){fu(o)&&i({inst:o})})},[e]),eP(n),n}function fu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!GN(e,n)}catch{return!0}}function nP(e,t){return t()}var rP=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?nP:tP;Av.useSyncExternalStore=wo.useSyncExternalStore!==void 0?wo.useSyncExternalStore:rP;zv.exports=Av;var oP=zv.exports;/**
204
+ * @license React
205
+ * use-sync-external-store-shim/with-selector.production.js
206
+ *
207
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
208
+ *
209
+ * This source code is licensed under the MIT license found in the
210
+ * LICENSE file in the root directory of this source tree.
211
+ */var gl=O,iP=oP;function sP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var aP=typeof Object.is=="function"?Object.is:sP,lP=iP.useSyncExternalStore,uP=gl.useRef,cP=gl.useEffect,dP=gl.useMemo,fP=gl.useDebugValue;Rv.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=uP(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=dP(function(){function l(p){if(!u){if(u=!0,d=p,p=r(p),o!==void 0&&s.hasValue){var g=s.value;if(o(g,p))return c=g}return c=p}if(g=c,aP(d,p))return g;var v=r(p);return o!==void 0&&o(g,v)?(d=p,g):(d=p,c=v)}var u=!1,d,c,f=n===void 0?null:n;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,n,r,o]);var a=lP(e,i[0],i[1]);return cP(function(){s.hasValue=!0,s.value=a},[a]),fP(a),a};Iv.exports=Rv;var hP=Iv.exports;const pP=qa(hP),mP={},Xp=e=>{let t;const n=new Set,r=(d,c)=>{const f=typeof d=="function"?d(t):d;if(!Object.is(f,t)){const p=t;t=c??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(g=>g(t,p))}},o=()=>t,l={setState:r,getState:o,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(mP?"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."),n.clear()}},u=t=e(r,o,l);return l},gP=e=>e?Xp(e):Xp,{useDebugValue:yP}=C_,{useSyncExternalStoreWithSelector:vP}=pP,wP=e=>e;function Ov(e,t=wP,n){const r=vP(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return yP(r),r}const Yp=(e,t)=>{const n=gP(e),r=(o,i=t)=>Ov(n,o,i);return Object.assign(r,n),r},_P=(e,t)=>e?Yp(e,t):Yp;function $e(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const yl=O.createContext(null),$P=yl.Provider,Dv=Qt.error001();function ue(e,t){const n=O.useContext(yl);if(n===null)throw new Error(Dv);return Ov(n,e,t)}function xe(){const e=O.useContext(yl);if(e===null)throw new Error(Dv);return O.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Gp={display:"none"},xP={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Lv="react-flow__node-desc",Vv="react-flow__edge-desc",SP="react-flow__aria-live",EP=e=>e.ariaLiveMessage,kP=e=>e.ariaLabelConfig;function NP({rfId:e}){const t=ue(EP);return $.jsx("div",{id:`${SP}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:xP,children:t})}function PP({rfId:e,disableKeyboardA11y:t}){const n=ue(kP);return $.jsxs($.Fragment,{children:[$.jsx("div",{id:`${Lv}-${e}`,style:Gp,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),$.jsx("div",{id:`${Vv}-${e}`,style:Gp,children:n["edge.a11yDescription.default"]}),!t&&$.jsx(NP,{rfId:e})]})}const vl=O.forwardRef(({position:e="top-left",children:t,className:n,style:r,...o},i)=>{const s=`${e}`.split("-");return $.jsx("div",{className:Ie(["react-flow__panel",n,...s]),style:r,ref:i,...o,children:t})});vl.displayName="Panel";function CP({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:$.jsx(vl,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:$.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const bP=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Ns=e=>e.id;function jP(e,t){return $e(e.selectedNodes.map(Ns),t.selectedNodes.map(Ns))&&$e(e.selectedEdges.map(Ns),t.selectedEdges.map(Ns))}function MP({onSelectionChange:e}){const t=xe(),{selectedNodes:n,selectedEdges:r}=ue(bP,jP);return O.useEffect(()=>{const o={nodes:n,edges:r};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(i=>i(o))},[n,r,e]),null}const TP=e=>!!e.onSelectionChangeHandlers;function IP({onSelectionChange:e}){const t=ue(TP);return e||t?$.jsx(MP,{onSelectionChange:e}):null}const Cc=typeof window<"u"?O.useLayoutEffect:O.useEffect,Fv=[0,0],RP={x:0,y:0,zoom:1},zP=["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"],Qp=[...zP,"rfId"],AP=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Zp={translateExtent:Ii,nodeOrigin:Fv,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function OP(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:o,setTranslateExtent:i,setNodeExtent:s,reset:a,setDefaultNodesAndEdges:l}=ue(AP,$e),u=xe();Cc(()=>(l(e.defaultNodes,e.defaultEdges),()=>{d.current=Zp,a()}),[]);const d=O.useRef(Zp);return Cc(()=>{for(const c of Qp){const f=e[c],p=d.current[c];f!==p&&(typeof e[c]>"u"||(c==="nodes"?t(f):c==="edges"?n(f):c==="minZoom"?r(f):c==="maxZoom"?o(f):c==="translateExtent"?i(f):c==="nodeExtent"?s(f):c==="ariaLabelConfig"?u.setState({ariaLabelConfig:sN(f)}):c==="fitView"?u.setState({fitViewQueued:f}):c==="fitViewOptions"?u.setState({fitViewOptions:f}):u.setState({[c]:f})))}d.current=e},Qp.map(c=>e[c])),null}function Jp(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function DP(e){var r;const[t,n]=O.useState(e==="system"?null:e);return O.useEffect(()=>{if(e!=="system"){n(e);return}const o=Jp(),i=()=>n(o!=null&&o.matches?"dark":"light");return i(),o==null||o.addEventListener("change",i),()=>{o==null||o.removeEventListener("change",i)}},[e]),t!==null?t:(r=Jp())!=null&&r.matches?"dark":"light"}const em=typeof document<"u"?document:null;function Oi(e=null,t={target:em,actInsideInputWithModifier:!0}){const[n,r]=O.useState(!1),o=O.useRef(!1),i=O.useRef(new Set([])),[s,a]=O.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(c=>typeof c=="string").map(c=>c.replace("+",`
212
+ `).replace(`
213
+
214
+ `,`
215
+ +`).split(`
216
+ `)),d=u.reduce((c,f)=>c.concat(...f),[]);return[u,d]}return[[],[]]},[e]);return O.useEffect(()=>{const l=(t==null?void 0:t.target)??em,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=p=>{var w,h;if(o.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!o.current||o.current&&!u)&&gv(p))return!1;const v=nm(p.code,a);if(i.current.add(p[v]),tm(s,i.current,!1)){const m=((h=(w=p.composedPath)==null?void 0:w.call(p))==null?void 0:h[0])||p.target,y=(m==null?void 0:m.nodeName)==="BUTTON"||(m==null?void 0:m.nodeName)==="A";t.preventDefault!==!1&&(o.current||!y)&&p.preventDefault(),r(!0)}},c=p=>{const g=nm(p.code,a);tm(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(p[g]),p.key==="Meta"&&i.current.clear(),o.current=!1},f=()=>{i.current.clear(),r(!1)};return l==null||l.addEventListener("keydown",d),l==null||l.addEventListener("keyup",c),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{l==null||l.removeEventListener("keydown",d),l==null||l.removeEventListener("keyup",c),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,r]),n}function tm(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function nm(e,t){return t.includes(e)?"code":"key"}const LP=()=>{const e=xe();return O.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,o,i],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??r,y:t.y??o,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:o,minZoom:i,maxZoom:s,panZoom:a}=e.getState(),l=qd(t,r,o,i,s,(n==null?void 0:n.padding)??.1);return a?(await a.setViewport(l,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:o,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:a,y:l}=s.getBoundingClientRect(),u={x:t.x-a,y:t.y-l},d=n.snapGrid??o,c=n.snapToGrid??i;return Gi(u,r,c,d)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:i}=r.getBoundingClientRect(),s=Da(t,n);return{x:s.x+o,y:s.y+i}}}),[])};function Hv(e,t){const n=[],r=new Map,o=[];for(const i of e)if(i.type==="add"){o.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const s=r.get(i.id);s?s.push(i):r.set(i.id,[i])}for(const i of t){const s=r.get(i.id);if(!s){n.push(i);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const a={...i};for(const l of s)VP(l,a);n.push(a)}return o.length&&o.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function VP(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function FP(e,t){return Hv(e,t)}function HP(e,t){return Hv(e,t)}function tr(e,t){return{id:e,type:"select",selected:t}}function Wr(e,t=new Set,n=!1){const r=[];for(const[o,i]of e){const s=t.has(o);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),r.push(tr(i.id,s)))}return r}function rm({items:e=[],lookup:t}){var o;const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,s]of e.entries()){const a=t.get(s.id),l=((o=a==null?void 0:a.internals)==null?void 0:o.userNode)??a;l!==void 0&&l!==s&&n.push({id:s.id,item:s,type:"replace"}),l===void 0&&n.push({item:s,type:"add",index:i})}for(const[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function om(e){return{id:e.id,type:"remove"}}const im=e=>Gk(e),BP=e=>lv(e);function Bv(e){return O.forwardRef(e)}function sm(e){const[t,n]=O.useState(BigInt(0)),[r]=O.useState(()=>UP(()=>n(o=>o+BigInt(1))));return Cc(()=>{const o=r.get();o.length&&(e(o),r.reset())},[t]),r}function UP(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Uv=O.createContext(null);function qP({children:e}){const t=xe(),n=O.useCallback(a=>{const{nodes:l=[],setNodes:u,hasDefaultNodes:d,onNodesChange:c,nodeLookup:f,fitViewQueued:p,onNodesChangeMiddlewareMap:g}=t.getState();let v=l;for(const h of a)v=typeof h=="function"?h(v):h;let w=rm({items:v,lookup:f});for(const h of g.values())w=h(w);d&&u(v),w.length>0?c==null||c(w):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:h,nodes:m,setNodes:y}=t.getState();h&&y(m)})},[]),r=sm(n),o=O.useCallback(a=>{const{edges:l=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:c,edgeLookup:f}=t.getState();let p=l;for(const g of a)p=typeof g=="function"?g(p):g;d?u(p):c&&c(rm({items:p,lookup:f}))},[]),i=sm(o),s=O.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return $.jsx(Uv.Provider,{value:s,children:e})}function WP(){const e=O.useContext(Uv);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const KP=e=>!!e.panZoom;function Zd(){const e=LP(),t=xe(),n=WP(),r=ue(KP),o=O.useMemo(()=>{const i=c=>t.getState().nodeLookup.get(c),s=c=>{n.nodeQueue.push(c)},a=c=>{n.edgeQueue.push(c)},l=c=>{var h,m;const{nodeLookup:f,nodeOrigin:p}=t.getState(),g=im(c)?c:f.get(c.id),v=g.parentId?pv(g.position,g.measured,g.parentId,f,p):g.position,w={...g,position:v,width:((h=g.measured)==null?void 0:h.width)??g.width,height:((m=g.measured)==null?void 0:m.height)??g.height};return go(w)},u=(c,f,p={replace:!1})=>{s(g=>g.map(v=>{if(v.id===c){const w=typeof f=="function"?f(v):f;return p.replace&&im(w)?w:{...v,...w}}return v}))},d=(c,f,p={replace:!1})=>{a(g=>g.map(v=>{if(v.id===c){const w=typeof f=="function"?f(v):f;return p.replace&&BP(w)?w:{...v,...w}}return v}))};return{getNodes:()=>t.getState().nodes.map(c=>({...c})),getNode:c=>{var f;return(f=i(c))==null?void 0:f.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:c=[]}=t.getState();return c.map(f=>({...f}))},getEdge:c=>t.getState().edgeLookup.get(c),setNodes:s,setEdges:a,addNodes:c=>{const f=Array.isArray(c)?c:[c];n.nodeQueue.push(p=>[...p,...f])},addEdges:c=>{const f=Array.isArray(c)?c:[c];n.edgeQueue.push(p=>[...p,...f])},toObject:()=>{const{nodes:c=[],edges:f=[],transform:p}=t.getState(),[g,v,w]=p;return{nodes:c.map(h=>({...h})),edges:f.map(h=>({...h})),viewport:{x:g,y:v,zoom:w}}},deleteElements:async({nodes:c=[],edges:f=[]})=>{const{nodes:p,edges:g,onNodesDelete:v,onEdgesDelete:w,triggerNodeChanges:h,triggerEdgeChanges:m,onDelete:y,onBeforeDelete:_}=t.getState(),{nodes:x,edges:N}=await tN({nodesToRemove:c,edgesToRemove:f,nodes:p,edges:g,onBeforeDelete:_}),C=N.length>0,z=x.length>0;if(C){const L=N.map(om);w==null||w(N),m(L)}if(z){const L=x.map(om);v==null||v(x),h(L)}return(z||C)&&(y==null||y({nodes:x,edges:N})),{deletedNodes:x,deletedEdges:N}},getIntersectingNodes:(c,f=!0,p)=>{const g=zp(c),v=g?c:l(c),w=p!==void 0;return v?(p||t.getState().nodes).filter(h=>{const m=t.getState().nodeLookup.get(h.id);if(m&&!g&&(h.id===c.id||!m.internals.positionAbsolute))return!1;const y=go(w?h:m),_=zi(y,v);return f&&_>0||_>=y.width*y.height||_>=v.width*v.height}):[]},isNodeIntersecting:(c,f,p=!0)=>{const v=zp(c)?c:l(c);if(!v)return!1;const w=zi(v,f);return p&&w>0||w>=f.width*f.height||w>=v.width*v.height},updateNode:u,updateNodeData:(c,f,p={replace:!1})=>{u(c,g=>{const v=typeof f=="function"?f(g):f;return p.replace?{...g,data:v}:{...g,data:{...g.data,...v}}},p)},updateEdge:d,updateEdgeData:(c,f,p={replace:!1})=>{d(c,g=>{const v=typeof f=="function"?f(g):f;return p.replace?{...g,data:v}:{...g,data:{...g.data,...v}}},p)},getNodesBounds:c=>{const{nodeLookup:f,nodeOrigin:p}=t.getState();return Qk(c,{nodeLookup:f,nodeOrigin:p})},getHandleConnections:({type:c,id:f,nodeId:p})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${p}-${c}${f?`-${f}`:""}`))==null?void 0:g.values())??[])},getNodeConnections:({type:c,handleId:f,nodeId:p})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${p}${c?f?`-${c}-${f}`:`-${c}`:""}`))==null?void 0:g.values())??[])},fitView:async c=>{const f=t.getState().fitViewResolver??iN();return t.setState({fitViewQueued:!0,fitViewOptions:c,fitViewResolver:f}),n.nodeQueue.push(p=>[...p]),f.promise}}},[]);return O.useMemo(()=>({...o,...e,viewportInitialized:r}),[r])}const am=e=>e.selected,XP=typeof window<"u"?window:void 0;function YP({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=xe(),{deleteElements:r}=Zd(),o=Oi(e,{actInsideInputWithModifier:!1}),i=Oi(t,{target:XP});O.useEffect(()=>{if(o){const{edges:s,nodes:a}=n.getState();r({nodes:a.filter(am),edges:s.filter(am)}),n.setState({nodesSelectionActive:!1})}},[o]),O.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function GP(e){const t=xe();O.useEffect(()=>{const n=()=>{var o,i,s,a;if(!e.current||!(((i=(o=e.current).checkVisibility)==null?void 0:i.call(o))??!0))return!1;const r=Wd(e.current);(r.height===0||r.width===0)&&((a=(s=t.getState()).onError)==null||a.call(s,"004",Qt.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const wl={position:"absolute",width:"100%",height:"100%",top:0,left:0},QP=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function ZP({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:o=.5,panOnScrollMode:i=hr.Free,zoomOnDoubleClick:s=!0,panOnDrag:a=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:c,zoomActivationKeyCode:f,preventScrolling:p=!0,children:g,noWheelClassName:v,noPanClassName:w,onViewportChange:h,isControlledViewport:m,paneClickDistance:y,selectionOnDrag:_}){const x=xe(),N=O.useRef(null),{userSelectionActive:C,lib:z,connectionInProgress:L}=ue(QP,$e),q=Oi(f),b=O.useRef();GP(N);const j=O.useCallback(B=>{h==null||h({x:B[0],y:B[1],zoom:B[2]}),m||x.setState({transform:B})},[h,m]);return O.useEffect(()=>{if(N.current){b.current=HN({domNode:N.current,minZoom:d,maxZoom:c,translateExtent:u,viewport:l,onDraggingChange:V=>x.setState(W=>W.paneDragging===V?W:{paneDragging:V}),onPanZoomStart:(V,W)=>{const{onViewportChangeStart:M,onMoveStart:A}=x.getState();A==null||A(V,W),M==null||M(W)},onPanZoom:(V,W)=>{const{onViewportChange:M,onMove:A}=x.getState();A==null||A(V,W),M==null||M(W)},onPanZoomEnd:(V,W)=>{const{onViewportChangeEnd:M,onMoveEnd:A}=x.getState();A==null||A(V,W),M==null||M(W)}});const{x:B,y:E,zoom:H}=b.current.getViewport();return x.setState({panZoom:b.current,transform:[B,E,H],domNode:N.current.closest(".react-flow")}),()=>{var V;(V=b.current)==null||V.destroy()}}},[]),O.useEffect(()=>{var B;(B=b.current)==null||B.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:o,panOnScrollMode:i,zoomOnDoubleClick:s,panOnDrag:a,zoomActivationKeyPressed:q,preventScrolling:p,noPanClassName:w,userSelectionActive:C,noWheelClassName:v,lib:z,onTransformChange:j,connectionInProgress:L,selectionOnDrag:_,paneClickDistance:y})},[e,t,n,r,o,i,s,a,q,p,w,C,v,z,j,L,_,y]),$.jsx("div",{className:"react-flow__renderer",ref:N,style:wl,children:g})}const JP=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function eC(){const{userSelectionActive:e,userSelectionRect:t}=ue(JP,$e);return e&&t?$.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const hu=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},tC=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function nC({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Ri.Full,panOnDrag:r,paneClickDistance:o,selectionOnDrag:i,onSelectionStart:s,onSelectionEnd:a,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:c,onPaneMouseMove:f,onPaneMouseLeave:p,children:g}){const v=xe(),{userSelectionActive:w,elementsSelectable:h,dragging:m,connectionInProgress:y}=ue(tC,$e),_=h&&(e||w),x=O.useRef(null),N=O.useRef(),C=O.useRef(new Set),z=O.useRef(new Set),L=O.useRef(!1),q=M=>{if(L.current||y){L.current=!1;return}l==null||l(M),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},b=M=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){M.preventDefault();return}u==null||u(M)},j=d?M=>d(M):void 0,B=M=>{L.current&&(M.stopPropagation(),L.current=!1)},E=M=>{var P,U;const{domNode:A}=v.getState();if(N.current=A==null?void 0:A.getBoundingClientRect(),!N.current)return;const T=M.target===x.current;if(!T&&!!M.target.closest(".nokey")||!e||!(i&&T||t)||M.button!==0||!M.isPrimary)return;(U=(P=M.target)==null?void 0:P.setPointerCapture)==null||U.call(P,M.pointerId),L.current=!1;const{x:R,y:S}=Lt(M.nativeEvent,N.current);v.setState({userSelectionRect:{width:0,height:0,startX:R,startY:S,x:R,y:S}}),T||(M.stopPropagation(),M.preventDefault())},H=M=>{const{userSelectionRect:A,transform:T,nodeLookup:k,edgeLookup:I,connectionLookup:R,triggerNodeChanges:S,triggerEdgeChanges:P,defaultEdgeOptions:U,resetSelectedElements:Y}=v.getState();if(!N.current||!A)return;const{x:X,y:Z}=Lt(M.nativeEvent,N.current),{startX:te,startY:D}=A;if(!L.current){const ne=t?0:o;if(Math.hypot(X-te,Z-D)<=ne)return;Y(),s==null||s(M)}L.current=!0;const F={startX:te,startY:D,x:X<te?X:te,y:Z<D?Z:D,width:Math.abs(X-te),height:Math.abs(Z-D)},K=C.current,G=z.current;C.current=new Set(Ud(k,F,T,n===Ri.Partial,!0).map(ne=>ne.id)),z.current=new Set;const J=(U==null?void 0:U.selectable)??!0;for(const ne of C.current){const ce=R.get(ne);if(ce)for(const{edgeId:Me}of ce.values()){const we=I.get(Me);we&&(we.selectable??J)&&z.current.add(Me)}}if(!Ap(K,C.current)){const ne=Wr(k,C.current,!0);S(ne)}if(!Ap(G,z.current)){const ne=Wr(I,z.current);P(ne)}v.setState({userSelectionRect:F,userSelectionActive:!0,nodesSelectionActive:!1})},V=M=>{var A,T;M.button===0&&((T=(A=M.target)==null?void 0:A.releasePointerCapture)==null||T.call(A,M.pointerId),!w&&M.target===x.current&&v.getState().userSelectionRect&&(q==null||q(M)),v.setState({userSelectionActive:!1,userSelectionRect:null}),L.current&&(a==null||a(M),v.setState({nodesSelectionActive:C.current.size>0})))},W=r===!0||Array.isArray(r)&&r.includes(0);return $.jsxs("div",{className:Ie(["react-flow__pane",{draggable:W,dragging:m,selection:e}]),onClick:_?void 0:hu(q,x),onContextMenu:hu(b,x),onWheel:hu(j,x),onPointerEnter:_?void 0:c,onPointerMove:_?H:f,onPointerUp:_?V:void 0,onPointerDownCapture:_?E:void 0,onClickCapture:_?B:void 0,onPointerLeave:p,ref:x,style:wl,children:[g,$.jsx(eC,{})]})}function bc({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:a,onError:l}=t.getState(),u=a.get(e);if(!u){l==null||l("012",Qt.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&s)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=r==null?void 0:r.current)==null?void 0:d.blur()})):o([e])}function qv({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,nodeClickDistance:s}){const a=xe(),[l,u]=O.useState(!1),d=O.useRef();return O.useEffect(()=>{d.current=CN({getStoreItems:()=>a.getState(),onNodeMouseDown:c=>{bc({id:c,store:a,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),O.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:o,nodeClickDistance:s}),()=>{var c;(c=d.current)==null||c.destroy()}},[n,r,t,i,e,o,s]),l}const rC=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Wv(){const e=xe();return O.useCallback(n=>{const{nodeExtent:r,snapToGrid:o,snapGrid:i,nodesDraggable:s,onError:a,updateNodePositions:l,nodeLookup:u,nodeOrigin:d}=e.getState(),c=new Map,f=rC(s),p=o?i[0]:5,g=o?i[1]:5,v=n.direction.x*p*n.factor,w=n.direction.y*g*n.factor;for(const[,h]of u){if(!f(h))continue;let m={x:h.internals.positionAbsolute.x+v,y:h.internals.positionAbsolute.y+w};o&&(m=Yi(m,i));const{position:y,positionAbsolute:_}=uv({nodeId:h.id,nextPosition:m,nodeLookup:u,nodeExtent:r,nodeOrigin:d,onError:a});h.position=y,h.internals.positionAbsolute=_,c.set(h.id,h)}l(c)},[])}const Jd=O.createContext(null),oC=Jd.Provider;Jd.Consumer;const Kv=()=>O.useContext(Jd),iC=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),sC=(e,t,n)=>r=>{const{connectionClickStartHandle:o,connectionMode:i,connection:s}=r,{fromHandle:a,toHandle:l,isValid:u}=s,d=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n;return{connectingFrom:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,connectingTo:d,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,isPossibleEndHandle:i===po.Strict?(a==null?void 0:a.type)!==n:e!==(a==null?void 0:a.nodeId)||t!==(a==null?void 0:a.id),connectionInProcess:!!a,clickConnectionInProcess:!!o,valid:d&&u}};function aC({type:e="source",position:t=oe.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:l,className:u,onMouseDown:d,onTouchStart:c,...f},p){var H,V;const g=s||null,v=e==="target",w=xe(),h=Kv(),{connectOnClick:m,noPanClassName:y,rfId:_}=ue(iC,$e),{connectingFrom:x,connectingTo:N,clickConnecting:C,isPossibleEndHandle:z,connectionInProcess:L,clickConnectionInProcess:q,valid:b}=ue(sC(h,g,e),$e);h||(V=(H=w.getState()).onError)==null||V.call(H,"010",Qt.error010());const j=W=>{const{defaultEdgeOptions:M,onConnect:A,hasDefaultEdges:T}=w.getState(),k={...M,...W};if(T){const{edges:I,setEdges:R}=w.getState();R(fN(k,I))}A==null||A(k),a==null||a(k)},B=W=>{if(!h)return;const M=yv(W.nativeEvent);if(o&&(M&&W.button===0||!M)){const A=w.getState();Pc.onPointerDown(W.nativeEvent,{handleDomNode:W.currentTarget,autoPanOnConnect:A.autoPanOnConnect,connectionMode:A.connectionMode,connectionRadius:A.connectionRadius,domNode:A.domNode,nodeLookup:A.nodeLookup,lib:A.lib,isTarget:v,handleId:g,nodeId:h,flowId:A.rfId,panBy:A.panBy,cancelConnection:A.cancelConnection,onConnectStart:A.onConnectStart,onConnectEnd:(...T)=>{var k,I;return(I=(k=w.getState()).onConnectEnd)==null?void 0:I.call(k,...T)},updateConnection:A.updateConnection,onConnect:j,isValidConnection:n||((...T)=>{var k,I;return((I=(k=w.getState()).isValidConnection)==null?void 0:I.call(k,...T))??!0}),getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:A.autoPanSpeed,dragThreshold:A.connectionDragThreshold})}M?d==null||d(W):c==null||c(W)},E=W=>{const{onClickConnectStart:M,onClickConnectEnd:A,connectionClickStartHandle:T,connectionMode:k,isValidConnection:I,lib:R,rfId:S,nodeLookup:P,connection:U}=w.getState();if(!h||!T&&!o)return;if(!T){M==null||M(W.nativeEvent,{nodeId:h,handleId:g,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:h,type:e,id:g}});return}const Y=mv(W.target),X=n||I,{connection:Z,isValid:te}=Pc.isValid(W.nativeEvent,{handle:{nodeId:h,id:g,type:e},connectionMode:k,fromNodeId:T.nodeId,fromHandleId:T.id||null,fromType:T.type,isValidConnection:X,flowId:S,doc:Y,lib:R,nodeLookup:P});te&&Z&&j(Z);const D=structuredClone(U);delete D.inProgress,D.toPosition=D.toHandle?D.toHandle.position:null,A==null||A(W,D),w.setState({connectionClickStartHandle:null})};return $.jsx("div",{"data-handleid":g,"data-nodeid":h,"data-handlepos":t,"data-id":`${_}-${h}-${g}-${e}`,className:Ie(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,u,{source:!v,target:v,connectable:r,connectablestart:o,connectableend:i,clickconnecting:C,connectingfrom:x,connectingto:N,valid:b,connectionindicator:r&&(!L||z)&&(L||q?i:o)}]),onMouseDown:B,onTouchStart:B,onClick:m?E:void 0,ref:p,...f,children:l})}const Rn=O.memo(Bv(aC));function lC({data:e,isConnectable:t,sourcePosition:n=oe.Bottom}){return $.jsxs($.Fragment,{children:[e==null?void 0:e.label,$.jsx(Rn,{type:"source",position:n,isConnectable:t})]})}function uC({data:e,isConnectable:t,targetPosition:n=oe.Top,sourcePosition:r=oe.Bottom}){return $.jsxs($.Fragment,{children:[$.jsx(Rn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,$.jsx(Rn,{type:"source",position:r,isConnectable:t})]})}function cC(){return null}function dC({data:e,isConnectable:t,targetPosition:n=oe.Top}){return $.jsxs($.Fragment,{children:[$.jsx(Rn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const La={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},lm={input:lC,default:uC,output:dC,group:cC};function fC(e){var t,n,r,o;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((o=e.style)==null?void 0:o.height)}}const hC=e=>{const{width:t,height:n,x:r,y:o}=Xi(e.nodeLookup,{filter:i=>!!i.selected});return{width:Dt(t)?t:null,height:Dt(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${o}px)`}};function pC({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=xe(),{width:o,height:i,transformString:s,userSelectionActive:a}=ue(hC,$e),l=Wv(),u=O.useRef(null);O.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const d=!a&&o!==null&&i!==null;if(qv({nodeRef:u,disabled:!d}),!d)return null;const c=e?p=>{const g=r.getState().nodes.filter(v=>v.selected);e(p,g)}:void 0,f=p=>{Object.prototype.hasOwnProperty.call(La,p.key)&&(p.preventDefault(),l({direction:La[p.key],factor:p.shiftKey?4:1}))};return $.jsx("div",{className:Ie(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:$.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:c,tabIndex:n?void 0:-1,onKeyDown:n?void 0:f,style:{width:o,height:i}})})}const um=typeof window<"u"?window:void 0,mC=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Xv({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:a,deleteKeyCode:l,selectionKeyCode:u,selectionOnDrag:d,selectionMode:c,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:g,panActivationKeyCode:v,zoomActivationKeyCode:w,elementsSelectable:h,zoomOnScroll:m,zoomOnPinch:y,panOnScroll:_,panOnScrollSpeed:x,panOnScrollMode:N,zoomOnDoubleClick:C,panOnDrag:z,defaultViewport:L,translateExtent:q,minZoom:b,maxZoom:j,preventScrolling:B,onSelectionContextMenu:E,noWheelClassName:H,noPanClassName:V,disableKeyboardA11y:W,onViewportChange:M,isControlledViewport:A}){const{nodesSelectionActive:T,userSelectionActive:k}=ue(mC,$e),I=Oi(u,{target:um}),R=Oi(v,{target:um}),S=R||z,P=R||_,U=d&&S!==!0,Y=I||k||U;return YP({deleteKeyCode:l,multiSelectionKeyCode:g}),$.jsx(ZP,{onPaneContextMenu:i,elementsSelectable:h,zoomOnScroll:m,zoomOnPinch:y,panOnScroll:P,panOnScrollSpeed:x,panOnScrollMode:N,zoomOnDoubleClick:C,panOnDrag:!I&&S,defaultViewport:L,translateExtent:q,minZoom:b,maxZoom:j,zoomActivationKeyCode:w,preventScrolling:B,noWheelClassName:H,noPanClassName:V,onViewportChange:M,isControlledViewport:A,paneClickDistance:a,selectionOnDrag:U,children:$.jsxs(nC,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:S,isSelecting:!!Y,selectionMode:c,selectionKeyPressed:I,paneClickDistance:a,selectionOnDrag:U,children:[e,T&&$.jsx(pC,{onSelectionContextMenu:E,noPanClassName:V,disableKeyboardA11y:W})]})})}Xv.displayName="FlowRenderer";const gC=O.memo(Xv),yC=e=>t=>e?Ud(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function vC(e){return ue(O.useCallback(yC(e),[e]),$e)}const wC=e=>e.updateNodeInternals;function _C(){const e=ue(wC),[t]=O.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(o=>{const i=o.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:o.target,force:!0})}),e(r)}));return O.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function $C({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const o=xe(),i=O.useRef(null),s=O.useRef(null),a=O.useRef(e.sourcePosition),l=O.useRef(e.targetPosition),u=O.useRef(t),d=n&&!!e.internals.handleBounds;return O.useEffect(()=>{i.current&&!e.hidden&&(!d||s.current!==i.current)&&(s.current&&(r==null||r.unobserve(s.current)),r==null||r.observe(i.current),s.current=i.current)},[d,e.hidden]),O.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),O.useEffect(()=>{if(i.current){const c=u.current!==t,f=a.current!==e.sourcePosition,p=l.current!==e.targetPosition;(c||f||p)&&(u.current=t,a.current=e.sourcePosition,l.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function xC({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:i,onDoubleClick:s,nodesDraggable:a,elementsSelectable:l,nodesConnectable:u,nodesFocusable:d,resizeObserver:c,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:g,rfId:v,nodeTypes:w,nodeClickDistance:h,onError:m}){const{node:y,internals:_,isParent:x}=ue(X=>{const Z=X.nodeLookup.get(e),te=X.parentLookup.has(e);return{node:Z,internals:Z.internals,isParent:te}},$e);let N=y.type||"default",C=(w==null?void 0:w[N])||lm[N];C===void 0&&(m==null||m("003",Qt.error003(N)),N="default",C=(w==null?void 0:w.default)||lm.default);const z=!!(y.draggable||a&&typeof y.draggable>"u"),L=!!(y.selectable||l&&typeof y.selectable>"u"),q=!!(y.connectable||u&&typeof y.connectable>"u"),b=!!(y.focusable||d&&typeof y.focusable>"u"),j=xe(),B=hv(y),E=$C({node:y,nodeType:N,hasDimensions:B,resizeObserver:c}),H=qv({nodeRef:E,disabled:y.hidden||!z,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:L,nodeClickDistance:h}),V=Wv();if(y.hidden)return null;const W=wn(y),M=fC(y),A=L||z||t||n||r||o,T=n?X=>n(X,{..._.userNode}):void 0,k=r?X=>r(X,{..._.userNode}):void 0,I=o?X=>o(X,{..._.userNode}):void 0,R=i?X=>i(X,{..._.userNode}):void 0,S=s?X=>s(X,{..._.userNode}):void 0,P=X=>{const{selectNodesOnDrag:Z,nodeDragThreshold:te}=j.getState();L&&(!Z||!z||te>0)&&bc({id:e,store:j,nodeRef:E}),t&&t(X,{..._.userNode})},U=X=>{if(!(gv(X.nativeEvent)||g)){if(ov.includes(X.key)&&L){const Z=X.key==="Escape";bc({id:e,store:j,unselect:Z,nodeRef:E})}else if(z&&y.selected&&Object.prototype.hasOwnProperty.call(La,X.key)){X.preventDefault();const{ariaLabelConfig:Z}=j.getState();j.setState({ariaLiveMessage:Z["node.a11yDescription.ariaLiveMessage"]({direction:X.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),V({direction:La[X.key],factor:X.shiftKey?4:1})}}},Y=()=>{var G;if(g||!((G=E.current)!=null&&G.matches(":focus-visible")))return;const{transform:X,width:Z,height:te,autoPanOnNodeFocus:D,setCenter:F}=j.getState();if(!D)return;Ud(new Map([[e,y]]),{x:0,y:0,width:Z,height:te},X,!0).length>0||F(y.position.x+W.width/2,y.position.y+W.height/2,{zoom:X[2]})};return $.jsx("div",{className:Ie(["react-flow__node",`react-flow__node-${N}`,{[p]:z},y.className,{selected:y.selected,selectable:L,parent:x,draggable:z,dragging:H}]),ref:E,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:A?"all":"none",visibility:B?"visible":"hidden",...y.style,...M},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:T,onMouseMove:k,onMouseLeave:I,onContextMenu:R,onClick:P,onDoubleClick:S,onKeyDown:b?U:void 0,tabIndex:b?0:void 0,onFocus:b?Y:void 0,role:y.ariaRole??(b?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${Lv}-${v}`,"aria-label":y.ariaLabel,...y.domAttributes,children:$.jsx(oC,{value:e,children:$.jsx(C,{id:e,data:y.data,type:N,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:y.selected??!1,selectable:L,draggable:z,deletable:y.deletable??!0,isConnectable:q,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:H,dragHandle:y.dragHandle,zIndex:_.z,parentId:y.parentId,...W})})})}var SC=O.memo(xC);const EC=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Yv(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,onError:i}=ue(EC,$e),s=vC(e.onlyRenderVisibleElements),a=_C();return $.jsx("div",{className:"react-flow__nodes",style:wl,children:s.map(l=>$.jsx(SC,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:a,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:i},l))})}Yv.displayName="NodeRenderer";const kC=O.memo(Yv);function NC(e){return ue(O.useCallback(n=>{if(!e)return n.edges.map(o=>o.id);const r=[];if(n.width&&n.height)for(const o of n.edges){const i=n.nodeLookup.get(o.source),s=n.nodeLookup.get(o.target);i&&s&&uN({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(o.id)}return r},[e]),$e)}const PC=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return $.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},CC=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return $.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},cm={[Aa.Arrow]:PC,[Aa.ArrowClosed]:CC};function bC(e){const t=xe();return O.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(cm,e)?cm[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",Qt.error009(e)),null)},[e])}const jC=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const l=bC(t);return l?$.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0",children:$.jsx(l,{color:n,strokeWidth:s})}):null},Gv=({defaultColor:e,rfId:t})=>{const n=ue(i=>i.edges),r=ue(i=>i.defaultEdgeOptions),o=O.useMemo(()=>yN(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return o.length?$.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:$.jsx("defs",{children:o.map(i=>$.jsx(jC,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};Gv.displayName="MarkerDefinitions";var MC=O.memo(Gv);function Qv({x:e,y:t,label:n,labelStyle:r,labelShowBg:o=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:u,...d}){const[c,f]=O.useState({x:1,y:0,width:0,height:0}),p=Ie(["react-flow__edge-textwrapper",u]),g=O.useRef(null);return O.useEffect(()=>{if(g.current){const v=g.current.getBBox();f({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?$.jsxs("g",{transform:`translate(${e-c.width/2} ${t-c.height/2})`,className:p,visibility:c.width?"visible":"hidden",...d,children:[o&&$.jsx("rect",{width:c.width+2*s[0],x:-s[0],y:-s[1],height:c.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),$.jsx("text",{className:"react-flow__edge-text",y:c.height/2,dy:"0.3em",ref:g,style:r,children:n}),l]}):null}Qv.displayName="EdgeText";const TC=O.memo(Qv);function Eo({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l,interactionWidth:u=20,...d}){return $.jsxs($.Fragment,{children:[$.jsx("path",{...d,d:e,fill:"none",className:Ie(["react-flow__edge-path",d.className])}),u?$.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Dt(t)&&Dt(n)?$.jsx(TC,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l}):null]})}function dm({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===oe.Left||e===oe.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function Zv({sourceX:e,sourceY:t,sourcePosition:n=oe.Bottom,targetX:r,targetY:o,targetPosition:i=oe.Top}){const[s,a]=dm({pos:n,x1:e,y1:t,x2:r,y2:o}),[l,u]=dm({pos:i,x1:r,y1:o,x2:e,y2:t}),[d,c,f,p]=vv({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:a,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${a} ${l},${u} ${r},${o}`,d,c,f,p]}function Jv(e){return O.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s,targetPosition:a,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:p,style:g,markerEnd:v,markerStart:w,interactionWidth:h})=>{const[m,y,_]=Zv({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:a}),x=e.isInternal?void 0:t;return $.jsx(Eo,{id:x,path:m,labelX:y,labelY:_,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:p,style:g,markerEnd:v,markerStart:w,interactionWidth:h})})}const IC=Jv({isInternal:!1}),e1=Jv({isInternal:!0});IC.displayName="SimpleBezierEdge";e1.displayName="SimpleBezierEdgeInternal";function t1(e){return O.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:f,sourcePosition:p=oe.Bottom,targetPosition:g=oe.Top,markerEnd:v,markerStart:w,pathOptions:h,interactionWidth:m})=>{const[y,_,x]=Ec({sourceX:n,sourceY:r,sourcePosition:p,targetX:o,targetY:i,targetPosition:g,borderRadius:h==null?void 0:h.borderRadius,offset:h==null?void 0:h.offset,stepPosition:h==null?void 0:h.stepPosition}),N=e.isInternal?void 0:t;return $.jsx(Eo,{id:N,path:y,labelX:_,labelY:x,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:f,markerEnd:v,markerStart:w,interactionWidth:m})})}const n1=t1({isInternal:!1}),r1=t1({isInternal:!0});n1.displayName="SmoothStepEdge";r1.displayName="SmoothStepEdgeInternal";function o1(e){return O.memo(({id:t,...n})=>{var o;const r=e.isInternal?void 0:t;return $.jsx(n1,{...n,id:r,pathOptions:O.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const RC=o1({isInternal:!1}),i1=o1({isInternal:!0});RC.displayName="StepEdge";i1.displayName="StepEdgeInternal";function s1(e){return O.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:f,markerEnd:p,markerStart:g,interactionWidth:v})=>{const[w,h,m]=$v({sourceX:n,sourceY:r,targetX:o,targetY:i}),y=e.isInternal?void 0:t;return $.jsx(Eo,{id:y,path:w,labelX:h,labelY:m,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:c,style:f,markerEnd:p,markerStart:g,interactionWidth:v})})}const zC=s1({isInternal:!1}),a1=s1({isInternal:!0});zC.displayName="StraightEdge";a1.displayName="StraightEdgeInternal";function l1(e){return O.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s=oe.Bottom,targetPosition:a=oe.Top,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:p,style:g,markerEnd:v,markerStart:w,pathOptions:h,interactionWidth:m})=>{const[y,_,x]=wv({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:a,curvature:h==null?void 0:h.curvature}),N=e.isInternal?void 0:t;return $.jsx(Eo,{id:N,path:y,labelX:_,labelY:x,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:p,style:g,markerEnd:v,markerStart:w,interactionWidth:m})})}const AC=l1({isInternal:!1}),u1=l1({isInternal:!0});AC.displayName="BezierEdge";u1.displayName="BezierEdgeInternal";const fm={default:u1,straight:a1,step:i1,smoothstep:r1,simplebezier:e1},hm={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},OC=(e,t,n)=>n===oe.Left?e-t:n===oe.Right?e+t:e,DC=(e,t,n)=>n===oe.Top?e-t:n===oe.Bottom?e+t:e,pm="react-flow__edgeupdater";function mm({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:a}){return $.jsx("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:Ie([pm,`${pm}-${a}`]),cx:OC(t,r,e),cy:DC(n,r,e),r,stroke:"transparent",fill:"transparent"})}function LC({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:i,targetY:s,sourcePosition:a,targetPosition:l,onReconnect:u,onReconnectStart:d,onReconnectEnd:c,setReconnecting:f,setUpdateHover:p}){const g=xe(),v=(_,x)=>{if(_.button!==0)return;const{autoPanOnConnect:N,domNode:C,connectionMode:z,connectionRadius:L,lib:q,onConnectStart:b,cancelConnection:j,nodeLookup:B,rfId:E,panBy:H,updateConnection:V}=g.getState(),W=x.type==="target",M=(k,I)=>{f(!1),c==null||c(k,n,x.type,I)},A=k=>u==null?void 0:u(n,k),T=(k,I)=>{f(!0),d==null||d(_,n,x.type),b==null||b(k,I)};Pc.onPointerDown(_.nativeEvent,{autoPanOnConnect:N,connectionMode:z,connectionRadius:L,domNode:C,handleId:x.id,nodeId:x.nodeId,nodeLookup:B,isTarget:W,edgeUpdaterType:x.type,lib:q,flowId:E,cancelConnection:j,panBy:H,isValidConnection:(...k)=>{var I,R;return((R=(I=g.getState()).isValidConnection)==null?void 0:R.call(I,...k))??!0},onConnect:A,onConnectStart:T,onConnectEnd:(...k)=>{var I,R;return(R=(I=g.getState()).onConnectEnd)==null?void 0:R.call(I,...k)},onReconnectEnd:M,updateConnection:V,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:_.currentTarget})},w=_=>v(_,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),h=_=>v(_,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),m=()=>p(!0),y=()=>p(!1);return $.jsxs($.Fragment,{children:[(e===!0||e==="source")&&$.jsx(mm,{position:a,centerX:r,centerY:o,radius:t,onMouseDown:w,onMouseEnter:m,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&$.jsx(mm,{position:l,centerX:i,centerY:s,radius:t,onMouseDown:h,onMouseEnter:m,onMouseOut:y,type:"target"})]})}function VC({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:i,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:u,reconnectRadius:d,onReconnect:c,onReconnectStart:f,onReconnectEnd:p,rfId:g,edgeTypes:v,noPanClassName:w,onError:h,disableKeyboardA11y:m}){let y=ue(F=>F.edgeLookup.get(e));const _=ue(F=>F.defaultEdgeOptions);y=_?{..._,...y}:y;let x=y.type||"default",N=(v==null?void 0:v[x])||fm[x];N===void 0&&(h==null||h("011",Qt.error011(x)),x="default",N=(v==null?void 0:v.default)||fm.default);const C=!!(y.focusable||t&&typeof y.focusable>"u"),z=typeof c<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),L=!!(y.selectable||r&&typeof y.selectable>"u"),q=O.useRef(null),[b,j]=O.useState(!1),[B,E]=O.useState(!1),H=xe(),{zIndex:V,sourceX:W,sourceY:M,targetX:A,targetY:T,sourcePosition:k,targetPosition:I}=ue(O.useCallback(F=>{const K=F.nodeLookup.get(y.source),G=F.nodeLookup.get(y.target);if(!K||!G)return{zIndex:y.zIndex,...hm};const J=gN({id:e,sourceNode:K,targetNode:G,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:F.connectionMode,onError:h});return{zIndex:lN({selected:y.selected,zIndex:y.zIndex,sourceNode:K,targetNode:G,elevateOnSelect:F.elevateEdgesOnSelect,zIndexMode:F.zIndexMode}),...J||hm}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),$e),R=O.useMemo(()=>y.markerStart?`url('#${kc(y.markerStart,g)}')`:void 0,[y.markerStart,g]),S=O.useMemo(()=>y.markerEnd?`url('#${kc(y.markerEnd,g)}')`:void 0,[y.markerEnd,g]);if(y.hidden||W===null||M===null||A===null||T===null)return null;const P=F=>{var ne;const{addSelectedEdges:K,unselectNodesAndEdges:G,multiSelectionActive:J}=H.getState();L&&(H.setState({nodesSelectionActive:!1}),y.selected&&J?(G({nodes:[],edges:[y]}),(ne=q.current)==null||ne.blur()):K([e])),o&&o(F,y)},U=i?F=>{i(F,{...y})}:void 0,Y=s?F=>{s(F,{...y})}:void 0,X=a?F=>{a(F,{...y})}:void 0,Z=l?F=>{l(F,{...y})}:void 0,te=u?F=>{u(F,{...y})}:void 0,D=F=>{var K;if(!m&&ov.includes(F.key)&&L){const{unselectNodesAndEdges:G,addSelectedEdges:J}=H.getState();F.key==="Escape"?((K=q.current)==null||K.blur(),G({edges:[y]})):J([e])}};return $.jsx("svg",{style:{zIndex:V},children:$.jsxs("g",{className:Ie(["react-flow__edge",`react-flow__edge-${x}`,y.className,w,{selected:y.selected,animated:y.animated,inactive:!L&&!o,updating:b,selectable:L}]),onClick:P,onDoubleClick:U,onContextMenu:Y,onMouseEnter:X,onMouseMove:Z,onMouseLeave:te,onKeyDown:C?D:void 0,tabIndex:C?0:void 0,role:y.ariaRole??(C?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":C?`${Vv}-${g}`:void 0,ref:q,...y.domAttributes,children:[!B&&$.jsx(N,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:L,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:W,sourceY:M,targetX:A,targetY:T,sourcePosition:k,targetPosition:I,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:R,markerEnd:S,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),z&&$.jsx(LC,{edge:y,isReconnectable:z,reconnectRadius:d,onReconnect:c,onReconnectStart:f,onReconnectEnd:p,sourceX:W,sourceY:M,targetX:A,targetY:T,sourcePosition:k,targetPosition:I,setUpdateHover:j,setReconnecting:E})]})})}var FC=O.memo(VC);const HC=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function c1({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:c,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:g,disableKeyboardA11y:v}){const{edgesFocusable:w,edgesReconnectable:h,elementsSelectable:m,onError:y}=ue(HC,$e),_=NC(t);return $.jsxs("div",{className:"react-flow__edges",children:[$.jsx(MC,{defaultColor:e,rfId:n}),_.map(x=>$.jsx(FC,{id:x,edgesFocusable:w,edgesReconnectable:h,elementsSelectable:m,noPanClassName:o,onReconnect:i,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:u,onClick:d,reconnectRadius:c,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:g,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:v},x))]})}c1.displayName="EdgeRenderer";const BC=O.memo(c1),UC=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function qC({children:e}){const t=ue(UC);return $.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function WC(e){const t=Zd(),n=O.useRef(!1);O.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const KC=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function XC(e){const t=ue(KC),n=xe();return O.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function YC(e){return e.connection.inProgress?{...e.connection,to:Gi(e.connection.to,e.transform)}:{...e.connection}}function GC(e){return YC}function QC(e){const t=GC();return ue(t,$e)}const ZC=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function JC({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:o,width:i,height:s,isValid:a,inProgress:l}=ue(ZC,$e);return!(i&&o&&l)?null:$.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:$.jsx("g",{className:Ie(["react-flow__connection",av(a)]),children:$.jsx(d1,{style:t,type:n,CustomComponent:r,isValid:a})})})}const d1=({style:e,type:t=Mn.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:o,from:i,fromNode:s,fromHandle:a,fromPosition:l,to:u,toNode:d,toHandle:c,toPosition:f,pointer:p}=QC();if(!o)return;if(n)return $.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:a,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:l,toPosition:f,connectionStatus:av(r),toNode:d,toHandle:c,pointer:p});let g="";const v={sourceX:i.x,sourceY:i.y,sourcePosition:l,targetX:u.x,targetY:u.y,targetPosition:f};switch(t){case Mn.Bezier:[g]=wv(v);break;case Mn.SimpleBezier:[g]=Zv(v);break;case Mn.Step:[g]=Ec({...v,borderRadius:0});break;case Mn.SmoothStep:[g]=Ec(v);break;default:[g]=$v(v)}return $.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};d1.displayName="ConnectionLine";const eb={};function gm(e=eb){O.useRef(e),xe(),O.useEffect(()=>{},[e])}function tb(){xe(),O.useRef(!1),O.useEffect(()=>{},[])}function f1({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:c,onSelectionStart:f,onSelectionEnd:p,connectionLineType:g,connectionLineStyle:v,connectionLineComponent:w,connectionLineContainerStyle:h,selectionKeyCode:m,selectionOnDrag:y,selectionMode:_,multiSelectionKeyCode:x,panActivationKeyCode:N,zoomActivationKeyCode:C,deleteKeyCode:z,onlyRenderVisibleElements:L,elementsSelectable:q,defaultViewport:b,translateExtent:j,minZoom:B,maxZoom:E,preventScrolling:H,defaultMarkerColor:V,zoomOnScroll:W,zoomOnPinch:M,panOnScroll:A,panOnScrollSpeed:T,panOnScrollMode:k,zoomOnDoubleClick:I,panOnDrag:R,onPaneClick:S,onPaneMouseEnter:P,onPaneMouseMove:U,onPaneMouseLeave:Y,onPaneScroll:X,onPaneContextMenu:Z,paneClickDistance:te,nodeClickDistance:D,onEdgeContextMenu:F,onEdgeMouseEnter:K,onEdgeMouseMove:G,onEdgeMouseLeave:J,reconnectRadius:ne,onReconnect:ce,onReconnectStart:Me,onReconnectEnd:we,noDragClassName:Pe,noWheelClassName:Se,noPanClassName:yt,disableKeyboardA11y:Oe,nodeExtent:Gn,rfId:_n,viewport:vt,onViewportChange:Jt}){return gm(e),gm(t),tb(),WC(n),XC(vt),$.jsx(gC,{onPaneClick:S,onPaneMouseEnter:P,onPaneMouseMove:U,onPaneMouseLeave:Y,onPaneContextMenu:Z,onPaneScroll:X,paneClickDistance:te,deleteKeyCode:z,selectionKeyCode:m,selectionOnDrag:y,selectionMode:_,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:N,zoomActivationKeyCode:C,elementsSelectable:q,zoomOnScroll:W,zoomOnPinch:M,zoomOnDoubleClick:I,panOnScroll:A,panOnScrollSpeed:T,panOnScrollMode:k,panOnDrag:R,defaultViewport:b,translateExtent:j,minZoom:B,maxZoom:E,onSelectionContextMenu:c,preventScrolling:H,noDragClassName:Pe,noWheelClassName:Se,noPanClassName:yt,disableKeyboardA11y:Oe,onViewportChange:Jt,isControlledViewport:!!vt,children:$.jsxs(qC,{children:[$.jsx(BC,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:s,onReconnect:ce,onReconnectStart:Me,onReconnectEnd:we,onlyRenderVisibleElements:L,onEdgeContextMenu:F,onEdgeMouseEnter:K,onEdgeMouseMove:G,onEdgeMouseLeave:J,reconnectRadius:ne,defaultMarkerColor:V,noPanClassName:yt,disableKeyboardA11y:Oe,rfId:_n}),$.jsx(JC,{style:v,type:g,component:w,containerStyle:h}),$.jsx("div",{className:"react-flow__edgelabel-renderer"}),$.jsx(kC,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:D,onlyRenderVisibleElements:L,noPanClassName:yt,noDragClassName:Pe,disableKeyboardA11y:Oe,nodeExtent:Gn,rfId:_n}),$.jsx("div",{className:"react-flow__viewport-portal"})]})})}f1.displayName="GraphView";const nb=O.memo(f1),ym=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:a,minZoom:l=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:c,zIndexMode:f="basic"}={})=>{const p=new Map,g=new Map,v=new Map,w=new Map,h=r??t??[],m=n??e??[],y=d??[0,0],_=c??Ii;Ev(v,w,h);const{nodesInitialized:x}=Nc(m,p,g,{nodeOrigin:y,nodeExtent:_,zIndexMode:f});let N=[0,0,1];if(s&&o&&i){const C=Xi(p,{filter:b=>!!((b.width||b.initialWidth)&&(b.height||b.initialHeight))}),{x:z,y:L,zoom:q}=qd(C,o,i,l,u,(a==null?void 0:a.padding)??.1);N=[z,L,q]}return{rfId:"1",width:o??0,height:i??0,transform:N,nodes:m,nodesInitialized:x,nodeLookup:p,parentLookup:g,edges:h,edgeLookup:w,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:l,maxZoom:u,translateExtent:Ii,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:po.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,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:s??!1,fitViewOptions:a,fitViewResolver:null,connection:{...sv},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:nN,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:iv,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},rb=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:a,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:c,zIndexMode:f})=>_P((p,g)=>{async function v(){const{nodeLookup:w,panZoom:h,fitViewOptions:m,fitViewResolver:y,width:_,height:x,minZoom:N,maxZoom:C}=g();h&&(await eN({nodes:w,width:_,height:x,panZoom:h,minZoom:N,maxZoom:C},m),y==null||y.resolve(!0),p({fitViewResolver:null}))}return{...ym({nodes:e,edges:t,width:o,height:i,fitView:s,fitViewOptions:a,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:c,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:w=>{const{nodeLookup:h,parentLookup:m,nodeOrigin:y,elevateNodesOnSelect:_,fitViewQueued:x,zIndexMode:N,nodesSelectionActive:C}=g(),{nodesInitialized:z,hasSelectedNodes:L}=Nc(w,h,m,{nodeOrigin:y,nodeExtent:c,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:N}),q=C&&L;x&&z?(v(),p({nodes:w,nodesInitialized:z,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:q})):p({nodes:w,nodesInitialized:z,nodesSelectionActive:q})},setEdges:w=>{const{connectionLookup:h,edgeLookup:m}=g();Ev(h,m,w),p({edges:w})},setDefaultNodesAndEdges:(w,h)=>{if(w){const{setNodes:m}=g();m(w),p({hasDefaultNodes:!0})}if(h){const{setEdges:m}=g();m(h),p({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:h,nodeLookup:m,parentLookup:y,domNode:_,nodeOrigin:x,nodeExtent:N,debug:C,fitViewQueued:z,zIndexMode:L}=g(),{changes:q,updatedInternals:b}=EN(w,m,y,_,x,N,L);b&&(_N(m,y,{nodeOrigin:x,nodeExtent:N,zIndexMode:L}),z?(v(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(q==null?void 0:q.length)>0&&(C&&console.log("React Flow: trigger node changes",q),h==null||h(q)))},updateNodePositions:(w,h=!1)=>{const m=[];let y=[];const{nodeLookup:_,triggerNodeChanges:x,connection:N,updateConnection:C,onNodesChangeMiddlewareMap:z}=g();for(const[L,q]of w){const b=_.get(L),j=!!(b!=null&&b.expandParent&&(b!=null&&b.parentId)&&(q!=null&&q.position)),B={id:L,type:"position",position:j?{x:Math.max(0,q.position.x),y:Math.max(0,q.position.y)}:q.position,dragging:h};if(b&&N.inProgress&&N.fromNode.id===b.id){const E=xr(b,N.fromHandle,oe.Left,!0);C({...N,from:E})}j&&b.parentId&&m.push({id:L,parentId:b.parentId,rect:{...q.internals.positionAbsolute,width:q.measured.width??0,height:q.measured.height??0}}),y.push(B)}if(m.length>0){const{parentLookup:L,nodeOrigin:q}=g(),b=Qd(m,_,L,q);y.push(...b)}for(const L of z.values())y=L(y);x(y)},triggerNodeChanges:w=>{const{onNodesChange:h,setNodes:m,nodes:y,hasDefaultNodes:_,debug:x}=g();if(w!=null&&w.length){if(_){const N=FP(w,y);m(N)}x&&console.log("React Flow: trigger node changes",w),h==null||h(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:h,setEdges:m,edges:y,hasDefaultEdges:_,debug:x}=g();if(w!=null&&w.length){if(_){const N=HP(w,y);m(N)}x&&console.log("React Flow: trigger edge changes",w),h==null||h(w)}},addSelectedNodes:w=>{const{multiSelectionActive:h,edgeLookup:m,nodeLookup:y,triggerNodeChanges:_,triggerEdgeChanges:x}=g();if(h){const N=w.map(C=>tr(C,!0));_(N);return}_(Wr(y,new Set([...w]),!0)),x(Wr(m))},addSelectedEdges:w=>{const{multiSelectionActive:h,edgeLookup:m,nodeLookup:y,triggerNodeChanges:_,triggerEdgeChanges:x}=g();if(h){const N=w.map(C=>tr(C,!0));x(N);return}x(Wr(m,new Set([...w]))),_(Wr(y,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:h}={})=>{const{edges:m,nodes:y,nodeLookup:_,triggerNodeChanges:x,triggerEdgeChanges:N}=g(),C=w||y,z=h||m,L=[];for(const b of C){if(!b.selected)continue;const j=_.get(b.id);j&&(j.selected=!1),L.push(tr(b.id,!1))}const q=[];for(const b of z)b.selected&&q.push(tr(b.id,!1));x(L),N(q)},setMinZoom:w=>{const{panZoom:h,maxZoom:m}=g();h==null||h.setScaleExtent([w,m]),p({minZoom:w})},setMaxZoom:w=>{const{panZoom:h,minZoom:m}=g();h==null||h.setScaleExtent([m,w]),p({maxZoom:w})},setTranslateExtent:w=>{var h;(h=g().panZoom)==null||h.setTranslateExtent(w),p({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:h,triggerNodeChanges:m,triggerEdgeChanges:y,elementsSelectable:_}=g();if(!_)return;const x=h.reduce((C,z)=>z.selected?[...C,tr(z.id,!1)]:C,[]),N=w.reduce((C,z)=>z.selected?[...C,tr(z.id,!1)]:C,[]);m(x),y(N)},setNodeExtent:w=>{const{nodes:h,nodeLookup:m,parentLookup:y,nodeOrigin:_,elevateNodesOnSelect:x,nodeExtent:N,zIndexMode:C}=g();w[0][0]===N[0][0]&&w[0][1]===N[0][1]&&w[1][0]===N[1][0]&&w[1][1]===N[1][1]||(Nc(h,m,y,{nodeOrigin:_,nodeExtent:w,elevateNodesOnSelect:x,checkEquality:!1,zIndexMode:C}),p({nodeExtent:w}))},panBy:w=>{const{transform:h,width:m,height:y,panZoom:_,translateExtent:x}=g();return kN({delta:w,panZoom:_,transform:h,translateExtent:x,width:m,height:y})},setCenter:async(w,h,m)=>{const{width:y,height:_,maxZoom:x,panZoom:N}=g();if(!N)return Promise.resolve(!1);const C=typeof(m==null?void 0:m.zoom)<"u"?m.zoom:x;return await N.setViewport({x:y/2-w*C,y:_/2-h*C,zoom:C},{duration:m==null?void 0:m.duration,ease:m==null?void 0:m.ease,interpolate:m==null?void 0:m.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{p({connection:{...sv}})},updateConnection:w=>{p({connection:w})},reset:()=>p({...ym()})}},Object.is);function ob({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:i,initialMinZoom:s,initialMaxZoom:a,initialFitViewOptions:l,fitView:u,nodeOrigin:d,nodeExtent:c,zIndexMode:f,children:p}){const[g]=O.useState(()=>rb({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:u,minZoom:s,maxZoom:a,fitViewOptions:l,nodeOrigin:d,nodeExtent:c,zIndexMode:f}));return $.jsx($P,{value:g,children:$.jsx(qP,{children:p})})}function ib({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:i,height:s,fitView:a,fitViewOptions:l,minZoom:u,maxZoom:d,nodeOrigin:c,nodeExtent:f,zIndexMode:p}){return O.useContext(yl)?$.jsx($.Fragment,{children:e}):$.jsx(ob,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:i,initialHeight:s,fitView:a,initialFitViewOptions:l,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:c,nodeExtent:f,zIndexMode:p,children:e})}const sb={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function ab({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i,edgeTypes:s,onNodeClick:a,onEdgeClick:l,onInit:u,onMove:d,onMoveStart:c,onMoveEnd:f,onConnect:p,onConnectStart:g,onConnectEnd:v,onClickConnectStart:w,onClickConnectEnd:h,onNodeMouseEnter:m,onNodeMouseMove:y,onNodeMouseLeave:_,onNodeContextMenu:x,onNodeDoubleClick:N,onNodeDragStart:C,onNodeDrag:z,onNodeDragStop:L,onNodesDelete:q,onEdgesDelete:b,onDelete:j,onSelectionChange:B,onSelectionDragStart:E,onSelectionDrag:H,onSelectionDragStop:V,onSelectionContextMenu:W,onSelectionStart:M,onSelectionEnd:A,onBeforeDelete:T,connectionMode:k,connectionLineType:I=Mn.Bezier,connectionLineStyle:R,connectionLineComponent:S,connectionLineContainerStyle:P,deleteKeyCode:U="Backspace",selectionKeyCode:Y="Shift",selectionOnDrag:X=!1,selectionMode:Z=Ri.Full,panActivationKeyCode:te="Space",multiSelectionKeyCode:D=Ai()?"Meta":"Control",zoomActivationKeyCode:F=Ai()?"Meta":"Control",snapToGrid:K,snapGrid:G,onlyRenderVisibleElements:J=!1,selectNodesOnDrag:ne,nodesDraggable:ce,autoPanOnNodeFocus:Me,nodesConnectable:we,nodesFocusable:Pe,nodeOrigin:Se=Fv,edgesFocusable:yt,edgesReconnectable:Oe,elementsSelectable:Gn=!0,defaultViewport:_n=RP,minZoom:vt=.5,maxZoom:Jt=2,translateExtent:bo=Ii,preventScrolling:es=!0,nodeExtent:jo,defaultMarkerColor:dw="#b1b1b7",zoomOnScroll:fw=!0,zoomOnPinch:hw=!0,panOnScroll:pw=!1,panOnScrollSpeed:mw=.5,panOnScrollMode:gw=hr.Free,zoomOnDoubleClick:yw=!0,panOnDrag:vw=!0,onPaneClick:ww,onPaneMouseEnter:_w,onPaneMouseMove:$w,onPaneMouseLeave:xw,onPaneScroll:Sw,onPaneContextMenu:Ew,paneClickDistance:kw=1,nodeClickDistance:Nw=0,children:Pw,onReconnect:Cw,onReconnectStart:bw,onReconnectEnd:jw,onEdgeContextMenu:Mw,onEdgeDoubleClick:Tw,onEdgeMouseEnter:Iw,onEdgeMouseMove:Rw,onEdgeMouseLeave:zw,reconnectRadius:Aw=10,onNodesChange:Ow,onEdgesChange:Dw,noDragClassName:Lw="nodrag",noWheelClassName:Vw="nowheel",noPanClassName:Jf="nopan",fitView:eh,fitViewOptions:th,connectOnClick:Fw,attributionPosition:Hw,proOptions:Bw,defaultEdgeOptions:Uw,elevateNodesOnSelect:qw=!0,elevateEdgesOnSelect:Ww=!1,disableKeyboardA11y:nh=!1,autoPanOnConnect:Kw,autoPanOnNodeDrag:Xw,autoPanSpeed:Yw,connectionRadius:Gw,isValidConnection:Qw,onError:Zw,style:Jw,id:rh,nodeDragThreshold:e_,connectionDragThreshold:t_,viewport:n_,onViewportChange:r_,width:o_,height:i_,colorMode:s_="light",debug:a_,onScroll:ts,ariaLabelConfig:l_,zIndexMode:oh="basic",...u_},c_){const Tl=rh||"1",d_=DP(s_),f_=O.useCallback(ih=>{ih.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ts==null||ts(ih)},[ts]);return $.jsx("div",{"data-testid":"rf__wrapper",...u_,onScroll:f_,style:{...Jw,...sb},ref:c_,className:Ie(["react-flow",o,d_]),id:rh,role:"application",children:$.jsxs(ib,{nodes:e,edges:t,width:o_,height:i_,fitView:eh,fitViewOptions:th,minZoom:vt,maxZoom:Jt,nodeOrigin:Se,nodeExtent:jo,zIndexMode:oh,children:[$.jsx(OP,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:g,onConnectEnd:v,onClickConnectStart:w,onClickConnectEnd:h,nodesDraggable:ce,autoPanOnNodeFocus:Me,nodesConnectable:we,nodesFocusable:Pe,edgesFocusable:yt,edgesReconnectable:Oe,elementsSelectable:Gn,elevateNodesOnSelect:qw,elevateEdgesOnSelect:Ww,minZoom:vt,maxZoom:Jt,nodeExtent:jo,onNodesChange:Ow,onEdgesChange:Dw,snapToGrid:K,snapGrid:G,connectionMode:k,translateExtent:bo,connectOnClick:Fw,defaultEdgeOptions:Uw,fitView:eh,fitViewOptions:th,onNodesDelete:q,onEdgesDelete:b,onDelete:j,onNodeDragStart:C,onNodeDrag:z,onNodeDragStop:L,onSelectionDrag:H,onSelectionDragStart:E,onSelectionDragStop:V,onMove:d,onMoveStart:c,onMoveEnd:f,noPanClassName:Jf,nodeOrigin:Se,rfId:Tl,autoPanOnConnect:Kw,autoPanOnNodeDrag:Xw,autoPanSpeed:Yw,onError:Zw,connectionRadius:Gw,isValidConnection:Qw,selectNodesOnDrag:ne,nodeDragThreshold:e_,connectionDragThreshold:t_,onBeforeDelete:T,debug:a_,ariaLabelConfig:l_,zIndexMode:oh}),$.jsx(nb,{onInit:u,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:m,onNodeMouseMove:y,onNodeMouseLeave:_,onNodeContextMenu:x,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:s,connectionLineType:I,connectionLineStyle:R,connectionLineComponent:S,connectionLineContainerStyle:P,selectionKeyCode:Y,selectionOnDrag:X,selectionMode:Z,deleteKeyCode:U,multiSelectionKeyCode:D,panActivationKeyCode:te,zoomActivationKeyCode:F,onlyRenderVisibleElements:J,defaultViewport:_n,translateExtent:bo,minZoom:vt,maxZoom:Jt,preventScrolling:es,zoomOnScroll:fw,zoomOnPinch:hw,zoomOnDoubleClick:yw,panOnScroll:pw,panOnScrollSpeed:mw,panOnScrollMode:gw,panOnDrag:vw,onPaneClick:ww,onPaneMouseEnter:_w,onPaneMouseMove:$w,onPaneMouseLeave:xw,onPaneScroll:Sw,onPaneContextMenu:Ew,paneClickDistance:kw,nodeClickDistance:Nw,onSelectionContextMenu:W,onSelectionStart:M,onSelectionEnd:A,onReconnect:Cw,onReconnectStart:bw,onReconnectEnd:jw,onEdgeContextMenu:Mw,onEdgeDoubleClick:Tw,onEdgeMouseEnter:Iw,onEdgeMouseMove:Rw,onEdgeMouseLeave:zw,reconnectRadius:Aw,defaultMarkerColor:dw,noDragClassName:Lw,noWheelClassName:Vw,noPanClassName:Jf,rfId:Tl,disableKeyboardA11y:nh,nodeExtent:jo,viewport:n_,onViewportChange:r_}),$.jsx(IP,{onSelectionChange:B}),Pw,$.jsx(CP,{proOptions:Bw,position:Hw}),$.jsx(PP,{rfId:Tl,disableKeyboardA11y:nh})]})})}var lb=Bv(ab);const ub=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function h1({children:e}){const t=ue(ub);return t?$y.createPortal(e,t):null}function cb({dimensions:e,lineWidth:t,variant:n,className:r}){return $.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ie(["react-flow__background-pattern",n,r])})}function db({radius:e,className:t}){return $.jsx("circle",{cx:e,cy:e,r:e,className:Ie(["react-flow__background-pattern","dots",t])})}var Un;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Un||(Un={}));const fb={[Un.Dots]:1,[Un.Lines]:1,[Un.Cross]:6},hb=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function p1({id:e,variant:t=Un.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=0,color:s,bgColor:a,style:l,className:u,patternClassName:d}){const c=O.useRef(null),{transform:f,patternId:p}=ue(hb,$e),g=r||fb[t],v=t===Un.Dots,w=t===Un.Cross,h=Array.isArray(n)?n:[n,n],m=[h[0]*f[2]||1,h[1]*f[2]||1],y=g*f[2],_=Array.isArray(i)?i:[i,i],x=w?[y,y]:m,N=[_[0]*f[2]||1+x[0]/2,_[1]*f[2]||1+x[1]/2],C=`${p}${e||""}`;return $.jsxs("svg",{className:Ie(["react-flow__background",u]),style:{...l,...wl,"--xy-background-color-props":a,"--xy-background-pattern-color-props":s},ref:c,"data-testid":"rf__background",children:[$.jsx("pattern",{id:C,x:f[0]%m[0],y:f[1]%m[1],width:m[0],height:m[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:v?$.jsx(db,{radius:y/2,className:d}):$.jsx(cb,{dimensions:x,lineWidth:o,variant:t,className:d})}),$.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}p1.displayName="Background";const pb=O.memo(p1);function mb(){return $.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:$.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function gb(){return $.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:$.jsx("path",{d:"M0 0h32v4.2H0z"})})}function yb(){return $.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:$.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 vb(){return $.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:$.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 wb(){return $.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:$.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 Ps({children:e,className:t,...n}){return $.jsx("button",{type:"button",className:Ie(["react-flow__controls-button",t]),...n,children:e})}const _b=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function m1({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:a,onInteractiveChange:l,className:u,children:d,position:c="bottom-left",orientation:f="vertical","aria-label":p}){const g=xe(),{isInteractive:v,minZoomReached:w,maxZoomReached:h,ariaLabelConfig:m}=ue(_b,$e),{zoomIn:y,zoomOut:_,fitView:x}=Zd(),N=()=>{y(),i==null||i()},C=()=>{_(),s==null||s()},z=()=>{x(o),a==null||a()},L=()=>{g.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),l==null||l(!v)},q=f==="horizontal"?"horizontal":"vertical";return $.jsxs(vl,{className:Ie(["react-flow__controls",q,u]),position:c,style:e,"data-testid":"rf__controls","aria-label":p??m["controls.ariaLabel"],children:[t&&$.jsxs($.Fragment,{children:[$.jsx(Ps,{onClick:N,className:"react-flow__controls-zoomin",title:m["controls.zoomIn.ariaLabel"],"aria-label":m["controls.zoomIn.ariaLabel"],disabled:h,children:$.jsx(mb,{})}),$.jsx(Ps,{onClick:C,className:"react-flow__controls-zoomout",title:m["controls.zoomOut.ariaLabel"],"aria-label":m["controls.zoomOut.ariaLabel"],disabled:w,children:$.jsx(gb,{})})]}),n&&$.jsx(Ps,{className:"react-flow__controls-fitview",onClick:z,title:m["controls.fitView.ariaLabel"],"aria-label":m["controls.fitView.ariaLabel"],children:$.jsx(yb,{})}),r&&$.jsx(Ps,{className:"react-flow__controls-interactive",onClick:L,title:m["controls.interactive.ariaLabel"],"aria-label":m["controls.interactive.ariaLabel"],children:v?$.jsx(wb,{}):$.jsx(vb,{})}),d]})}m1.displayName="Controls";const $b=O.memo(m1);function xb({id:e,x:t,y:n,width:r,height:o,style:i,color:s,strokeColor:a,strokeWidth:l,className:u,borderRadius:d,shapeRendering:c,selected:f,onClick:p}){const{background:g,backgroundColor:v}=i||{},w=s||g||v;return $.jsx("rect",{className:Ie(["react-flow__minimap-node",{selected:f},u]),x:t,y:n,rx:d,ry:d,width:r,height:o,style:{fill:w,stroke:a,strokeWidth:l},shapeRendering:c,onClick:p?h=>p(h,e):void 0})}const Sb=O.memo(xb),Eb=e=>e.nodes.map(t=>t.id),pu=e=>e instanceof Function?e:()=>e;function kb({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:i=Sb,onClick:s}){const a=ue(Eb,$e),l=pu(t),u=pu(e),d=pu(n),c=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return $.jsx($.Fragment,{children:a.map(f=>$.jsx(Pb,{id:f,nodeColorFunc:l,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:i,onClick:s,shapeRendering:c},f))})}function Nb({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:a,onClick:l}){const{node:u,x:d,y:c,width:f,height:p}=ue(g=>{const v=g.nodeLookup.get(e);if(!v)return{node:void 0,x:0,y:0,width:0,height:0};const w=v.internals.userNode,{x:h,y:m}=v.internals.positionAbsolute,{width:y,height:_}=wn(w);return{node:w,x:h,y:m,width:y,height:_}},$e);return!u||u.hidden||!hv(u)?null:$.jsx(a,{x:d,y:c,width:f,height:p,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:o,strokeColor:n(u),strokeWidth:i,shapeRendering:s,onClick:l,id:u.id})}const Pb=O.memo(Nb);var Cb=O.memo(kb);const bb=200,jb=150,Mb=e=>!e.hidden,Tb=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?fv(Xi(e.nodeLookup,{filter:Mb}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Ib="react-flow__minimap-desc";function g1({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:a,bgColor:l,maskColor:u,maskStrokeColor:d,maskStrokeWidth:c,position:f="bottom-right",onClick:p,onNodeClick:g,pannable:v=!1,zoomable:w=!1,ariaLabel:h,inversePan:m,zoomStep:y=1,offsetScale:_=5}){const x=xe(),N=O.useRef(null),{boundingRect:C,viewBB:z,rfId:L,panZoom:q,translateExtent:b,flowWidth:j,flowHeight:B,ariaLabelConfig:E}=ue(Tb,$e),H=(e==null?void 0:e.width)??bb,V=(e==null?void 0:e.height)??jb,W=C.width/H,M=C.height/V,A=Math.max(W,M),T=A*H,k=A*V,I=_*A,R=C.x-(T-C.width)/2-I,S=C.y-(k-C.height)/2-I,P=T+I*2,U=k+I*2,Y=`${Ib}-${L}`,X=O.useRef(0),Z=O.useRef();X.current=A,O.useEffect(()=>{if(N.current&&q)return Z.current=RN({domNode:N.current,panZoom:q,getTransform:()=>x.getState().transform,getViewScale:()=>X.current}),()=>{var K;(K=Z.current)==null||K.destroy()}},[q]),O.useEffect(()=>{var K;(K=Z.current)==null||K.update({translateExtent:b,width:j,height:B,inversePan:m,pannable:v,zoomStep:y,zoomable:w})},[v,w,m,y,b,j,B]);const te=p?K=>{var ne;const[G,J]=((ne=Z.current)==null?void 0:ne.pointer(K))||[0,0];p(K,{x:G,y:J})}:void 0,D=g?O.useCallback((K,G)=>{const J=x.getState().nodeLookup.get(G).internals.userNode;g(K,J)},[]):void 0,F=h??E["minimap.ariaLabel"];return $.jsx(vl,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof c=="number"?c*A:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:Ie(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:$.jsxs("svg",{width:H,height:V,viewBox:`${R} ${S} ${P} ${U}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Y,ref:N,onClick:te,children:[F&&$.jsx("title",{id:Y,children:F}),$.jsx(Cb,{onClick:D,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:s,nodeComponent:a}),$.jsx("path",{className:"react-flow__minimap-mask",d:`M${R-I},${S-I}h${P+I*2}v${U+I*2}h${-P-I*2}z
217
+ M${z.x},${z.y}h${z.width}v${z.height}h${-z.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}g1.displayName="MiniMap";O.memo(g1);const Rb=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,zb={[vo.Line]:"right",[vo.Handle]:"bottom-right"};function Ab({nodeId:e,position:t,variant:n=vo.Handle,className:r,style:o=void 0,children:i,color:s,minWidth:a=10,minHeight:l=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:c=!1,resizeDirection:f,autoScale:p=!0,shouldResize:g,onResizeStart:v,onResize:w,onResizeEnd:h}){const m=Kv(),y=typeof e=="string"?e:m,_=xe(),x=O.useRef(null),N=n===vo.Handle,C=ue(O.useCallback(Rb(N&&p),[N,p]),$e),z=O.useRef(null),L=t??zb[n];O.useEffect(()=>{if(!(!x.current||!y))return z.current||(z.current=XN({domNode:x.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:b,transform:j,snapGrid:B,snapToGrid:E,nodeOrigin:H,domNode:V}=_.getState();return{nodeLookup:b,transform:j,snapGrid:B,snapToGrid:E,nodeOrigin:H,paneDomNode:V}},onChange:(b,j)=>{const{triggerNodeChanges:B,nodeLookup:E,parentLookup:H,nodeOrigin:V}=_.getState(),W=[],M={x:b.x,y:b.y},A=E.get(y);if(A&&A.expandParent&&A.parentId){const T=A.origin??V,k=b.width??A.measured.width??0,I=b.height??A.measured.height??0,R={id:A.id,parentId:A.parentId,rect:{width:k,height:I,...pv({x:b.x??A.position.x,y:b.y??A.position.y},{width:k,height:I},A.parentId,E,T)}},S=Qd([R],E,H,V);W.push(...S),M.x=b.x?Math.max(T[0]*k,b.x):void 0,M.y=b.y?Math.max(T[1]*I,b.y):void 0}if(M.x!==void 0&&M.y!==void 0){const T={id:y,type:"position",position:{...M}};W.push(T)}if(b.width!==void 0&&b.height!==void 0){const k={id:y,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:b.width,height:b.height}};W.push(k)}for(const T of j){const k={...T,type:"position"};W.push(k)}B(W)},onEnd:({width:b,height:j})=>{const B={id:y,type:"dimensions",resizing:!1,dimensions:{width:b,height:j}};_.getState().triggerNodeChanges([B])}})),z.current.update({controlPosition:L,boundaries:{minWidth:a,minHeight:l,maxWidth:u,maxHeight:d},keepAspectRatio:c,resizeDirection:f,onResizeStart:v,onResize:w,onResizeEnd:h,shouldResize:g}),()=>{var b;(b=z.current)==null||b.destroy()}},[L,a,l,u,d,c,v,w,h,g]);const q=L.split("-");return $.jsx("div",{className:Ie(["react-flow__resize-control","nodrag",...q,n,r]),ref:x,style:{...o,scale:C,...s&&{[N?"backgroundColor":"borderColor"]:s}},children:i})}O.memo(Ab);const Ob={monitor:Gx,server:nS,database:Kx,zap:uS,globe:Yx,music:Zx,sliders:oS},Db={planned:"var(--status-planned)",implemented:"var(--status-implemented)",stale:"var(--status-stale)",deprecated:"var(--status-deprecated)"},vm={audio:"#f472b6",midi:"#a78bfa",control:"#34d399",http:"#60a5fa",data:"#fbbf24"};function wm(e,t){if(t<=1)return"50%";const n=18,r=100-n*2,o=e/(t-1);return`${n+o*r}%`}function Lb({data:e}){var f,p,g;const{node:t,typeDef:n,onDrillDown:r,active:o}=e,i=(n==null?void 0:n.color)??"#71717a",s=n!=null&&n.icon?Ob[n.icon]??mp:mp,a=(n==null?void 0:n.label)??t.type,l=((f=n==null?void 0:n.ports)==null?void 0:f.in)??[],u=((p=n==null?void 0:n.ports)==null?void 0:p.out)??[],d=l.length>0,c=u.length>0;return $.jsxs("div",{className:`node-card status-${t.status}${d||c?" has-ports":""}${o?" active":""}`,style:{"--node-color":i,"--status-color":Db[t.status]},children:[d?l.map((v,w)=>$.jsxs("div",{className:"port-row port-in",style:{top:wm(w,l.length)},children:[$.jsx(Rn,{type:"target",position:oe.Left,id:v.name,style:{background:v.signal?vm[v.signal]??i:i}}),$.jsx("span",{className:"port-label",children:v.name})]},`in-${v.name}`)):$.jsx(Rn,{type:"target",position:oe.Left}),$.jsxs("div",{className:"node-header",children:[$.jsx(s,{className:"node-icon"}),$.jsx("span",{className:"node-type",children:a})]}),$.jsx("div",{className:"node-label",children:t.label}),$.jsx("span",{className:"status-dot",title:t.status}),(((g=t.code_refs)==null?void 0:g.length)??0)>0&&$.jsxs("span",{className:"refs-badge",title:(t.code_refs??[]).map(v=>v.path+(v.symbol?` · ${v.symbol}`:"")).join(`
218
+ `)||"Code refs",children:[$.jsx(Jx,{size:9})," ",t.code_refs.length]}),t.drill_down&&r&&$.jsx("button",{className:"drill-down-btn",title:`Drill into ${t.drill_down}`,"aria-label":`Drill into ${t.drill_down}`,onPointerDown:v=>v.stopPropagation(),onClick:v=>{v.stopPropagation(),r(t.drill_down)},children:$.jsx(Ey,{size:12})}),c?u.map((v,w)=>$.jsxs("div",{className:"port-row port-out",style:{top:wm(w,u.length)},children:[$.jsx("span",{className:"port-label",children:v.name}),$.jsx(Rn,{type:"source",position:oe.Right,id:v.name,style:{background:v.signal?vm[v.signal]??i:i}})]},`out-${v.name}`)):$.jsx(Rn,{type:"source",position:oe.Right})]})}function Vb({data:e,width:t,height:n}){const{group:r,onDrillDown:o}=e,i=r.color??"#94a3b8";return $.jsx("div",{className:"group-frame",style:{width:t??"100%",height:n??"100%","--group-color":i},children:$.jsxs("div",{className:"group-label",children:[$.jsx("span",{children:r.label}),r.drill_down&&o&&$.jsx("button",{className:"drill-down-btn inline",title:`Drill into ${r.drill_down}`,"aria-label":`Drill into ${r.drill_down}`,onClick:s=>{s.stopPropagation(),o(r.drill_down)},children:$.jsx(Ey,{size:11})})]})})}const Fb=32;function Hb(e){const{id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:a,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:c,markerEnd:f,markerStart:p,data:g}=e,v=(g==null?void 0:g.parallelOffset)??0,w=o-n,h=i-r,m=Math.max(Math.sqrt(w*w+h*h),1),y=-h/m,_=w/m,x=v*Fb,N=(n+o)/2+y*x,C=(r+i)/2+_*x,z=(n+o)/2+y*(x/2),L=(r+i)/2+_*(x/2),q=`M ${n},${r} Q ${N},${C} ${o},${i}`,b=Array.isArray(u)?u[0]:6,j=Array.isArray(u)?u[1]:3;return $.jsxs($.Fragment,{children:[$.jsx(Eo,{id:t,path:q,style:c,markerEnd:f,markerStart:p}),s&&$.jsx(h1,{children:$.jsx("div",{className:"parallel-edge-label nodrag nopan",style:{position:"absolute",transform:`translate(-50%, -50%) translate(${z}px, ${L}px)`,padding:`${j}px ${b}px`,borderRadius:(d??3)+"px",background:(l==null?void 0:l.fill)??"var(--bg-elevated)",color:(a==null?void 0:a.fill)??"var(--text-muted)",fontSize:(a==null?void 0:a.fontSize)??11,fontFamily:"inherit",lineHeight:1.2,pointerEvents:"all",userSelect:"none"},children:s})})]})}const Bb=32,Ub=320;function qb(e){const{id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:a,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:c,markerEnd:f,markerStart:p,data:g}=e,v=g??{},w=v.parallelOffset??0,h=v.pulsing??!1,m=o-n,y=i-r,_=Math.max(Math.sqrt(m*m+y*y),1),x=-y/_,N=m/_,C=w*Bb,z=(n+o)/2+x*C,L=(r+i)/2+N*C,q=`M ${n},${r} Q ${z},${L} ${o},${i}`,b=`pulse-path-${t}`,j=Math.max(.4,_/Ub),B=(n+o)/2+x*(C/2),E=(r+i)/2+N*(C/2),H=Array.isArray(u)?u[0]:6,V=Array.isArray(u)?u[1]:3,W=(c==null?void 0:c.stroke)??"var(--accent)";return $.jsxs($.Fragment,{children:[$.jsx(Eo,{id:t,path:q,style:c,markerEnd:f,markerStart:p}),$.jsx("path",{id:b,d:q,fill:"none",stroke:"none"}),h&&$.jsx("circle",{r:5,className:"pulse-marker",fill:W,stroke:"white",strokeWidth:1,children:$.jsx("animateMotion",{dur:`${j}s`,repeatCount:"indefinite",children:$.jsx("mpath",{href:`#${b}`})})}),s&&$.jsx(h1,{children:$.jsx("div",{className:"parallel-edge-label nodrag nopan",style:{position:"absolute",transform:`translate(-50%, -50%) translate(${B}px, ${E}px)`,padding:`${V}px ${H}px`,borderRadius:(d??3)+"px",background:(l==null?void 0:l.fill)??"var(--bg-elevated)",color:(a==null?void 0:a.fill)??"var(--text-muted)",fontSize:(a==null?void 0:a.fontSize)??11,fontFamily:"inherit",lineHeight:1.2,pointerEvents:"all",userSelect:"none"},children:s})})]})}async function Di(e){const t=await fetch(e);if(!t.ok){let n="";try{n=` — ${(await t.json()).error??""}`}catch{}throw new Error(`${e}: ${t.status} ${t.statusText}${n}`)}return await t.json()}async function Wb(){return Di("/api/diagrams")}async function Va(e="overview"){const[t,n]=await Promise.all([Di(`/api/diagrams/${e}`),Di("/api/node-types")]);return{diagram:t,nodeTypes:n}}async function y1(e){const t=await fetch(`/api/diagrams/${e.id}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Error(`save failed: ${t.status} ${n.error??""}`)}}async function v1(e,t){await y1({version:"1",id:e,title:t,nodes:[],edges:[]})}async function Kb(){return Di("/api/timelines")}async function _m(e){return Di(`/api/timelines/${e}`)}async function Xb(e){const t=await fetch(`/api/timelines/${e.id}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Error(`save failed: ${t.status} ${n.error??""}`)}}var jc={exports:{}},ef={},tn={},Qn={},Qi={},ie={},Li={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(m){if(super(),!e.IDENTIFIER.test(m))throw new Error("CodeGen: name must be a valid identifier");this.str=m}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(m){super(),this._items=typeof m=="string"?[m]:m}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const m=this._items[0];return m===""||m==='""'}get str(){var m;return(m=this._str)!==null&&m!==void 0?m:this._str=this._items.reduce((y,_)=>`${y}${_}`,"")}get names(){var m;return(m=this._names)!==null&&m!==void 0?m:this._names=this._items.reduce((y,_)=>(_ instanceof n&&(y[_.str]=(y[_.str]||0)+1),y),{})}}e._Code=r,e.nil=new r("");function o(h,...m){const y=[h[0]];let _=0;for(;_<m.length;)a(y,m[_]),y.push(h[++_]);return new r(y)}e._=o;const i=new r("+");function s(h,...m){const y=[p(h[0])];let _=0;for(;_<m.length;)y.push(i),a(y,m[_]),y.push(i,p(h[++_]));return l(y),new r(y)}e.str=s;function a(h,m){m instanceof r?h.push(...m._items):m instanceof n?h.push(m):h.push(c(m))}e.addCodeArg=a;function l(h){let m=1;for(;m<h.length-1;){if(h[m]===i){const y=u(h[m-1],h[m+1]);if(y!==void 0){h.splice(m-1,3,y);continue}h[m++]="+"}m++}}function u(h,m){if(m==='""')return h;if(h==='""')return m;if(typeof h=="string")return m instanceof n||h[h.length-1]!=='"'?void 0:typeof m!="string"?`${h.slice(0,-1)}${m}"`:m[0]==='"'?h.slice(0,-1)+m.slice(1):void 0;if(typeof m=="string"&&m[0]==='"'&&!(h instanceof n))return`"${h}${m.slice(1)}`}function d(h,m){return m.emptyStr()?h:h.emptyStr()?m:s`${h}${m}`}e.strConcat=d;function c(h){return typeof h=="number"||typeof h=="boolean"||h===null?h:p(Array.isArray(h)?h.join(","):h)}function f(h){return new r(p(h))}e.stringify=f;function p(h){return JSON.stringify(h).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=p;function g(h){return typeof h=="string"&&e.IDENTIFIER.test(h)?new r(`.${h}`):o`[${h}]`}e.getProperty=g;function v(h){if(typeof h=="string"&&e.IDENTIFIER.test(h))return new r(`${h}`);throw new Error(`CodeGen: invalid export name: ${h}, use explicit $id name mapping`)}e.getEsmExportName=v;function w(h){return new r(h.toString())}e.regexpCode=w})(Li);var Mc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=Li;class n extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var r;(function(l){l[l.Started=0]="Started",l[l.Completed=1]="Completed"})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class o{constructor({prefixes:u,parent:d}={}){this._names={},this._prefixes=u,this._parent=d}toName(u){return u instanceof t.Name?u:this.name(u)}name(u){return new t.Name(this._newName(u))}_newName(u){const d=this._names[u]||this._nameGroup(u);return`${u}${d.index++}`}_nameGroup(u){var d,c;if(!((c=(d=this._parent)===null||d===void 0?void 0:d._prefixes)===null||c===void 0)&&c.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}}e.Scope=o;class i extends t.Name{constructor(u,d){super(d),this.prefix=u}setValue(u,{property:d,itemIndex:c}){this.value=u,this.scopePath=(0,t._)`.${new t.Name(d)}[${c}]`}}e.ValueScopeName=i;const s=(0,t._)`\n`;class a extends o{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?s:t.nil}}get(){return this._scope}name(u){return new i(u,this._newName(u))}value(u,d){var c;if(d.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const f=this.toName(u),{prefix:p}=f,g=(c=d.key)!==null&&c!==void 0?c:d.ref;let v=this._values[p];if(v){const m=v.get(g);if(m)return m}else v=this._values[p]=new Map;v.set(g,f);const w=this._scope[p]||(this._scope[p]=[]),h=w.length;return w[h]=d.ref,f.setValue(d,{property:p,itemIndex:h}),f}getValue(u,d){const c=this._values[u];if(c)return c.get(d)}scopeRefs(u,d=this._values){return this._reduceValues(d,c=>{if(c.scopePath===void 0)throw new Error(`CodeGen: name "${c}" has no value`);return(0,t._)`${u}${c.scopePath}`})}scopeCode(u=this._values,d,c){return this._reduceValues(u,f=>{if(f.value===void 0)throw new Error(`CodeGen: name "${f}" has no value`);return f.value.code},d,c)}_reduceValues(u,d,c={},f){let p=t.nil;for(const g in u){const v=u[g];if(!v)continue;const w=c[g]=c[g]||new Map;v.forEach(h=>{if(w.has(h))return;w.set(h,r.Started);let m=d(h);if(m){const y=this.opts.es5?e.varKinds.var:e.varKinds.const;p=(0,t._)`${p}${y} ${h} = ${m};${this.opts._n}`}else if(m=f==null?void 0:f(h))p=(0,t._)`${p}${m}${this.opts._n}`;else throw new n(h);w.set(h,r.Completed)})}return p}}e.ValueScope=a})(Mc);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Li,n=Mc;var r=Li;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var o=Mc;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames(S,P){return this}}class s extends i{constructor(S,P,U){super(),this.varKind=S,this.name=P,this.rhs=U}render({es5:S,_n:P}){const U=S?n.varKinds.var:this.varKind,Y=this.rhs===void 0?"":` = ${this.rhs}`;return`${U} ${this.name}${Y};`+P}optimizeNames(S,P){if(S[this.name.str])return this.rhs&&(this.rhs=E(this.rhs,S,P)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class a extends i{constructor(S,P,U){super(),this.lhs=S,this.rhs=P,this.sideEffects=U}render({_n:S}){return`${this.lhs} = ${this.rhs};`+S}optimizeNames(S,P){if(!(this.lhs instanceof t.Name&&!S[this.lhs.str]&&!this.sideEffects))return this.rhs=E(this.rhs,S,P),this}get names(){const S=this.lhs instanceof t.Name?{}:{...this.lhs.names};return B(S,this.rhs)}}class l extends a{constructor(S,P,U,Y){super(S,U,Y),this.op=P}render({_n:S}){return`${this.lhs} ${this.op}= ${this.rhs};`+S}}class u extends i{constructor(S){super(),this.label=S,this.names={}}render({_n:S}){return`${this.label}:`+S}}class d extends i{constructor(S){super(),this.label=S,this.names={}}render({_n:S}){return`break${this.label?` ${this.label}`:""};`+S}}class c extends i{constructor(S){super(),this.error=S}render({_n:S}){return`throw ${this.error};`+S}get names(){return this.error.names}}class f extends i{constructor(S){super(),this.code=S}render({_n:S}){return`${this.code};`+S}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(S,P){return this.code=E(this.code,S,P),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class p extends i{constructor(S=[]){super(),this.nodes=S}render(S){return this.nodes.reduce((P,U)=>P+U.render(S),"")}optimizeNodes(){const{nodes:S}=this;let P=S.length;for(;P--;){const U=S[P].optimizeNodes();Array.isArray(U)?S.splice(P,1,...U):U?S[P]=U:S.splice(P,1)}return S.length>0?this:void 0}optimizeNames(S,P){const{nodes:U}=this;let Y=U.length;for(;Y--;){const X=U[Y];X.optimizeNames(S,P)||(H(S,X.names),U.splice(Y,1))}return U.length>0?this:void 0}get names(){return this.nodes.reduce((S,P)=>j(S,P.names),{})}}class g extends p{render(S){return"{"+S._n+super.render(S)+"}"+S._n}}class v extends p{}class w extends g{}w.kind="else";class h extends g{constructor(S,P){super(P),this.condition=S}render(S){let P=`if(${this.condition})`+super.render(S);return this.else&&(P+="else "+this.else.render(S)),P}optimizeNodes(){super.optimizeNodes();const S=this.condition;if(S===!0)return this.nodes;let P=this.else;if(P){const U=P.optimizeNodes();P=this.else=Array.isArray(U)?new w(U):U}if(P)return S===!1?P instanceof h?P:P.nodes:this.nodes.length?this:new h(V(S),P instanceof h?[P]:P.nodes);if(!(S===!1||!this.nodes.length))return this}optimizeNames(S,P){var U;if(this.else=(U=this.else)===null||U===void 0?void 0:U.optimizeNames(S,P),!!(super.optimizeNames(S,P)||this.else))return this.condition=E(this.condition,S,P),this}get names(){const S=super.names;return B(S,this.condition),this.else&&j(S,this.else.names),S}}h.kind="if";class m extends g{}m.kind="for";class y extends m{constructor(S){super(),this.iteration=S}render(S){return`for(${this.iteration})`+super.render(S)}optimizeNames(S,P){if(super.optimizeNames(S,P))return this.iteration=E(this.iteration,S,P),this}get names(){return j(super.names,this.iteration.names)}}class _ extends m{constructor(S,P,U,Y){super(),this.varKind=S,this.name=P,this.from=U,this.to=Y}render(S){const P=S.es5?n.varKinds.var:this.varKind,{name:U,from:Y,to:X}=this;return`for(${P} ${U}=${Y}; ${U}<${X}; ${U}++)`+super.render(S)}get names(){const S=B(super.names,this.from);return B(S,this.to)}}class x extends m{constructor(S,P,U,Y){super(),this.loop=S,this.varKind=P,this.name=U,this.iterable=Y}render(S){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(S)}optimizeNames(S,P){if(super.optimizeNames(S,P))return this.iterable=E(this.iterable,S,P),this}get names(){return j(super.names,this.iterable.names)}}class N extends g{constructor(S,P,U){super(),this.name=S,this.args=P,this.async=U}render(S){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(S)}}N.kind="func";class C extends p{render(S){return"return "+super.render(S)}}C.kind="return";class z extends g{render(S){let P="try"+super.render(S);return this.catch&&(P+=this.catch.render(S)),this.finally&&(P+=this.finally.render(S)),P}optimizeNodes(){var S,P;return super.optimizeNodes(),(S=this.catch)===null||S===void 0||S.optimizeNodes(),(P=this.finally)===null||P===void 0||P.optimizeNodes(),this}optimizeNames(S,P){var U,Y;return super.optimizeNames(S,P),(U=this.catch)===null||U===void 0||U.optimizeNames(S,P),(Y=this.finally)===null||Y===void 0||Y.optimizeNames(S,P),this}get names(){const S=super.names;return this.catch&&j(S,this.catch.names),this.finally&&j(S,this.finally.names),S}}class L extends g{constructor(S){super(),this.error=S}render(S){return`catch(${this.error})`+super.render(S)}}L.kind="catch";class q extends g{render(S){return"finally"+super.render(S)}}q.kind="finally";class b{constructor(S,P={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...P,_n:P.lines?`
219
+ `:""},this._extScope=S,this._scope=new n.Scope({parent:S}),this._nodes=[new v]}toString(){return this._root.render(this.opts)}name(S){return this._scope.name(S)}scopeName(S){return this._extScope.name(S)}scopeValue(S,P){const U=this._extScope.value(S,P);return(this._values[U.prefix]||(this._values[U.prefix]=new Set)).add(U),U}getScopeValue(S,P){return this._extScope.getValue(S,P)}scopeRefs(S){return this._extScope.scopeRefs(S,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(S,P,U,Y){const X=this._scope.toName(P);return U!==void 0&&Y&&(this._constants[X.str]=U),this._leafNode(new s(S,X,U)),X}const(S,P,U){return this._def(n.varKinds.const,S,P,U)}let(S,P,U){return this._def(n.varKinds.let,S,P,U)}var(S,P,U){return this._def(n.varKinds.var,S,P,U)}assign(S,P,U){return this._leafNode(new a(S,P,U))}add(S,P){return this._leafNode(new l(S,e.operators.ADD,P))}code(S){return typeof S=="function"?S():S!==t.nil&&this._leafNode(new f(S)),this}object(...S){const P=["{"];for(const[U,Y]of S)P.length>1&&P.push(","),P.push(U),(U!==Y||this.opts.es5)&&(P.push(":"),(0,t.addCodeArg)(P,Y));return P.push("}"),new t._Code(P)}if(S,P,U){if(this._blockNode(new h(S)),P&&U)this.code(P).else().code(U).endIf();else if(P)this.code(P).endIf();else if(U)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(S){return this._elseNode(new h(S))}else(){return this._elseNode(new w)}endIf(){return this._endBlockNode(h,w)}_for(S,P){return this._blockNode(S),P&&this.code(P).endFor(),this}for(S,P){return this._for(new y(S),P)}forRange(S,P,U,Y,X=this.opts.es5?n.varKinds.var:n.varKinds.let){const Z=this._scope.toName(S);return this._for(new _(X,Z,P,U),()=>Y(Z))}forOf(S,P,U,Y=n.varKinds.const){const X=this._scope.toName(S);if(this.opts.es5){const Z=P instanceof t.Name?P:this.var("_arr",P);return this.forRange("_i",0,(0,t._)`${Z}.length`,te=>{this.var(X,(0,t._)`${Z}[${te}]`),U(X)})}return this._for(new x("of",Y,X,P),()=>U(X))}forIn(S,P,U,Y=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(S,(0,t._)`Object.keys(${P})`,U);const X=this._scope.toName(S);return this._for(new x("in",Y,X,P),()=>U(X))}endFor(){return this._endBlockNode(m)}label(S){return this._leafNode(new u(S))}break(S){return this._leafNode(new d(S))}return(S){const P=new C;if(this._blockNode(P),this.code(S),P.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(C)}try(S,P,U){if(!P&&!U)throw new Error('CodeGen: "try" without "catch" and "finally"');const Y=new z;if(this._blockNode(Y),this.code(S),P){const X=this.name("e");this._currNode=Y.catch=new L(X),P(X)}return U&&(this._currNode=Y.finally=new q,this.code(U)),this._endBlockNode(L,q)}throw(S){return this._leafNode(new c(S))}block(S,P){return this._blockStarts.push(this._nodes.length),S&&this.code(S).endBlock(P),this}endBlock(S){const P=this._blockStarts.pop();if(P===void 0)throw new Error("CodeGen: not in self-balancing block");const U=this._nodes.length-P;if(U<0||S!==void 0&&U!==S)throw new Error(`CodeGen: wrong number of nodes: ${U} vs ${S} expected`);return this._nodes.length=P,this}func(S,P=t.nil,U,Y){return this._blockNode(new N(S,P,U)),Y&&this.code(Y).endFunc(),this}endFunc(){return this._endBlockNode(N)}optimize(S=1){for(;S-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(S){return this._currNode.nodes.push(S),this}_blockNode(S){this._currNode.nodes.push(S),this._nodes.push(S)}_endBlockNode(S,P){const U=this._currNode;if(U instanceof S||P&&U instanceof P)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${P?`${S.kind}/${P.kind}`:S.kind}"`)}_elseNode(S){const P=this._currNode;if(!(P instanceof h))throw new Error('CodeGen: "else" without "if"');return this._currNode=P.else=S,this}get _root(){return this._nodes[0]}get _currNode(){const S=this._nodes;return S[S.length-1]}set _currNode(S){const P=this._nodes;P[P.length-1]=S}}e.CodeGen=b;function j(R,S){for(const P in S)R[P]=(R[P]||0)+(S[P]||0);return R}function B(R,S){return S instanceof t._CodeOrName?j(R,S.names):R}function E(R,S,P){if(R instanceof t.Name)return U(R);if(!Y(R))return R;return new t._Code(R._items.reduce((X,Z)=>(Z instanceof t.Name&&(Z=U(Z)),Z instanceof t._Code?X.push(...Z._items):X.push(Z),X),[]));function U(X){const Z=P[X.str];return Z===void 0||S[X.str]!==1?X:(delete S[X.str],Z)}function Y(X){return X instanceof t._Code&&X._items.some(Z=>Z instanceof t.Name&&S[Z.str]===1&&P[Z.str]!==void 0)}}function H(R,S){for(const P in S)R[P]=(R[P]||0)-(S[P]||0)}function V(R){return typeof R=="boolean"||typeof R=="number"||R===null?!R:(0,t._)`!${I(R)}`}e.not=V;const W=k(e.operators.AND);function M(...R){return R.reduce(W)}e.and=M;const A=k(e.operators.OR);function T(...R){return R.reduce(A)}e.or=T;function k(R){return(S,P)=>S===t.nil?P:P===t.nil?S:(0,t._)`${I(S)} ${R} ${I(P)}`}function I(R){return R instanceof t.Name?R:(0,t._)`(${R})`}})(ie);var ee={};Object.defineProperty(ee,"__esModule",{value:!0});ee.checkStrictMode=ee.getErrorPath=ee.Type=ee.useFunc=ee.setEvaluated=ee.evaluatedPropsToName=ee.mergeEvaluated=ee.eachItem=ee.unescapeJsonPointer=ee.escapeJsonPointer=ee.escapeFragment=ee.unescapeFragment=ee.schemaRefOrVal=ee.schemaHasRulesButRef=ee.schemaHasRules=ee.checkUnknownRules=ee.alwaysValidSchema=ee.toHash=void 0;const he=ie,Yb=Li;function Gb(e){const t={};for(const n of e)t[n]=!0;return t}ee.toHash=Gb;function Qb(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(w1(e,t),!_1(t,e.self.RULES.all))}ee.alwaysValidSchema=Qb;function w1(e,t=e.schema){const{opts:n,self:r}=e;if(!n.strictSchema||typeof t=="boolean")return;const o=r.RULES.keywords;for(const i in t)o[i]||S1(e,`unknown keyword: "${i}"`)}ee.checkUnknownRules=w1;function _1(e,t){if(typeof e=="boolean")return!e;for(const n in e)if(t[n])return!0;return!1}ee.schemaHasRules=_1;function Zb(e,t){if(typeof e=="boolean")return!e;for(const n in e)if(n!=="$ref"&&t.all[n])return!0;return!1}ee.schemaHasRulesButRef=Zb;function Jb({topSchemaRef:e,schemaPath:t},n,r,o){if(!o){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return(0,he._)`${n}`}return(0,he._)`${e}${t}${(0,he.getProperty)(r)}`}ee.schemaRefOrVal=Jb;function ej(e){return $1(decodeURIComponent(e))}ee.unescapeFragment=ej;function tj(e){return encodeURIComponent(tf(e))}ee.escapeFragment=tj;function tf(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}ee.escapeJsonPointer=tf;function $1(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}ee.unescapeJsonPointer=$1;function nj(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)}ee.eachItem=nj;function $m({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:r}){return(o,i,s,a)=>{const l=s===void 0?i:s instanceof he.Name?(i instanceof he.Name?e(o,i,s):t(o,i,s),s):i instanceof he.Name?(t(o,s,i),i):n(i,s);return a===he.Name&&!(l instanceof he.Name)?r(o,l):l}}ee.mergeEvaluated={props:$m({mergeNames:(e,t,n)=>e.if((0,he._)`${n} !== true && ${t} !== undefined`,()=>{e.if((0,he._)`${t} === true`,()=>e.assign(n,!0),()=>e.assign(n,(0,he._)`${n} || {}`).code((0,he._)`Object.assign(${n}, ${t})`))}),mergeToName:(e,t,n)=>e.if((0,he._)`${n} !== true`,()=>{t===!0?e.assign(n,!0):(e.assign(n,(0,he._)`${n} || {}`),nf(e,n,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:x1}),items:$m({mergeNames:(e,t,n)=>e.if((0,he._)`${n} !== true && ${t} !== undefined`,()=>e.assign(n,(0,he._)`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`)),mergeToName:(e,t,n)=>e.if((0,he._)`${n} !== true`,()=>e.assign(n,t===!0?!0:(0,he._)`${n} > ${t} ? ${n} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function x1(e,t){if(t===!0)return e.var("props",!0);const n=e.var("props",(0,he._)`{}`);return t!==void 0&&nf(e,n,t),n}ee.evaluatedPropsToName=x1;function nf(e,t,n){Object.keys(n).forEach(r=>e.assign((0,he._)`${t}${(0,he.getProperty)(r)}`,!0))}ee.setEvaluated=nf;const xm={};function rj(e,t){return e.scopeValue("func",{ref:t,code:xm[t.code]||(xm[t.code]=new Yb._Code(t.code))})}ee.useFunc=rj;var Tc;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Tc||(ee.Type=Tc={}));function oj(e,t,n){if(e instanceof he.Name){const r=t===Tc.Num;return n?r?(0,he._)`"[" + ${e} + "]"`:(0,he._)`"['" + ${e} + "']"`:r?(0,he._)`"/" + ${e}`:(0,he._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,he.getProperty)(e).toString():"/"+tf(e)}ee.getErrorPath=oj;function S1(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw new Error(t);e.self.logger.warn(t)}}ee.checkStrictMode=S1;var gt={};Object.defineProperty(gt,"__esModule",{value:!0});const Ke=ie,ij={data:new Ke.Name("data"),valCxt:new Ke.Name("valCxt"),instancePath:new Ke.Name("instancePath"),parentData:new Ke.Name("parentData"),parentDataProperty:new Ke.Name("parentDataProperty"),rootData:new Ke.Name("rootData"),dynamicAnchors:new Ke.Name("dynamicAnchors"),vErrors:new Ke.Name("vErrors"),errors:new Ke.Name("errors"),this:new Ke.Name("this"),self:new Ke.Name("self"),scope:new Ke.Name("scope"),json:new Ke.Name("json"),jsonPos:new Ke.Name("jsonPos"),jsonLen:new Ke.Name("jsonLen"),jsonPart:new Ke.Name("jsonPart")};gt.default=ij;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=ie,n=ee,r=gt;e.keywordError={message:({keyword:w})=>(0,t.str)`must pass "${w}" keyword validation`},e.keyword$DataError={message:({keyword:w,schemaType:h})=>h?(0,t.str)`"${w}" keyword must be ${h} ($data)`:(0,t.str)`"${w}" keyword is invalid ($data)`};function o(w,h=e.keywordError,m,y){const{it:_}=w,{gen:x,compositeRule:N,allErrors:C}=_,z=c(w,h,m);y??(N||C)?l(x,z):u(_,(0,t._)`[${z}]`)}e.reportError=o;function i(w,h=e.keywordError,m){const{it:y}=w,{gen:_,compositeRule:x,allErrors:N}=y,C=c(w,h,m);l(_,C),x||N||u(y,r.default.vErrors)}e.reportExtraError=i;function s(w,h){w.assign(r.default.errors,h),w.if((0,t._)`${r.default.vErrors} !== null`,()=>w.if(h,()=>w.assign((0,t._)`${r.default.vErrors}.length`,h),()=>w.assign(r.default.vErrors,null)))}e.resetErrorsCount=s;function a({gen:w,keyword:h,schemaValue:m,data:y,errsCount:_,it:x}){if(_===void 0)throw new Error("ajv implementation error");const N=w.name("err");w.forRange("i",_,r.default.errors,C=>{w.const(N,(0,t._)`${r.default.vErrors}[${C}]`),w.if((0,t._)`${N}.instancePath === undefined`,()=>w.assign((0,t._)`${N}.instancePath`,(0,t.strConcat)(r.default.instancePath,x.errorPath))),w.assign((0,t._)`${N}.schemaPath`,(0,t.str)`${x.errSchemaPath}/${h}`),x.opts.verbose&&(w.assign((0,t._)`${N}.schema`,m),w.assign((0,t._)`${N}.data`,y))})}e.extendErrors=a;function l(w,h){const m=w.const("err",h);w.if((0,t._)`${r.default.vErrors} === null`,()=>w.assign(r.default.vErrors,(0,t._)`[${m}]`),(0,t._)`${r.default.vErrors}.push(${m})`),w.code((0,t._)`${r.default.errors}++`)}function u(w,h){const{gen:m,validateName:y,schemaEnv:_}=w;_.$async?m.throw((0,t._)`new ${w.ValidationError}(${h})`):(m.assign((0,t._)`${y}.errors`,h),m.return(!1))}const d={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function c(w,h,m){const{createErrors:y}=w.it;return y===!1?(0,t._)`{}`:f(w,h,m)}function f(w,h,m={}){const{gen:y,it:_}=w,x=[p(_,m),g(w,m)];return v(w,h,x),y.object(...x)}function p({errorPath:w},{instancePath:h}){const m=h?(0,t.str)`${w}${(0,n.getErrorPath)(h,n.Type.Str)}`:w;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,m)]}function g({keyword:w,it:{errSchemaPath:h}},{schemaPath:m,parentSchema:y}){let _=y?h:(0,t.str)`${h}/${w}`;return m&&(_=(0,t.str)`${_}${(0,n.getErrorPath)(m,n.Type.Str)}`),[d.schemaPath,_]}function v(w,{params:h,message:m},y){const{keyword:_,data:x,schemaValue:N,it:C}=w,{opts:z,propertyName:L,topSchemaRef:q,schemaPath:b}=C;y.push([d.keyword,_],[d.params,typeof h=="function"?h(w):h||(0,t._)`{}`]),z.messages&&y.push([d.message,typeof m=="function"?m(w):m]),z.verbose&&y.push([d.schema,N],[d.parentSchema,(0,t._)`${q}${b}`],[r.default.data,x]),L&&y.push([d.propertyName,L])}})(Qi);var Sm;function sj(){if(Sm)return Qn;Sm=1,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.boolOrEmptySchema=Qn.topBoolOrEmptySchema=void 0;const e=Qi,t=ie,n=gt,r={message:"boolean schema is false"};function o(a){const{gen:l,schema:u,validateName:d}=a;u===!1?s(a,!1):typeof u=="object"&&u.$async===!0?l.return(n.default.data):(l.assign((0,t._)`${d}.errors`,null),l.return(!0))}Qn.topBoolOrEmptySchema=o;function i(a,l){const{gen:u,schema:d}=a;d===!1?(u.var(l,!1),s(a)):u.var(l,!0)}Qn.boolOrEmptySchema=i;function s(a,l){const{gen:u,data:d}=a,c={gen:u,keyword:"false schema",data:d,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,e.reportError)(c,r,void 0,l)}return Qn}var ze={},Sr={};Object.defineProperty(Sr,"__esModule",{value:!0});Sr.getRules=Sr.isJSONType=void 0;const aj=["string","number","integer","boolean","null","object","array"],lj=new Set(aj);function uj(e){return typeof e=="string"&&lj.has(e)}Sr.isJSONType=uj;function cj(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Sr.getRules=cj;var nn={},Em;function E1(){if(Em)return nn;Em=1,Object.defineProperty(nn,"__esModule",{value:!0}),nn.shouldUseRule=nn.shouldUseGroup=nn.schemaHasRulesForType=void 0;function e({schema:r,self:o},i){const s=o.RULES.types[i];return s&&s!==!0&&t(r,s)}nn.schemaHasRulesForType=e;function t(r,o){return o.rules.some(i=>n(r,i))}nn.shouldUseGroup=t;function n(r,o){var i;return r[o.keyword]!==void 0||((i=o.definition.implements)===null||i===void 0?void 0:i.some(s=>r[s]!==void 0))}return nn.shouldUseRule=n,nn}Object.defineProperty(ze,"__esModule",{value:!0});ze.reportTypeError=ze.checkDataTypes=ze.checkDataType=ze.coerceAndCheckDataType=ze.getJSONTypes=ze.getSchemaTypes=ze.DataType=void 0;const dj=Sr,fj=E1(),hj=Qi,se=ie,k1=ee;var no;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(no||(ze.DataType=no={}));function pj(e){const t=N1(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}ze.getSchemaTypes=pj;function N1(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(dj.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}ze.getJSONTypes=N1;function mj(e,t){const{gen:n,data:r,opts:o}=e,i=gj(t,o.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,fj.schemaHasRulesForType)(e,t[0]));if(s){const a=rf(t,r,o.strictNumbers,no.Wrong);n.if(a,()=>{i.length?yj(e,t,i):of(e)})}return s}ze.coerceAndCheckDataType=mj;const P1=new Set(["string","number","integer","boolean","null"]);function gj(e,t){return t?e.filter(n=>P1.has(n)||t==="array"&&n==="array"):[]}function yj(e,t,n){const{gen:r,data:o,opts:i}=e,s=r.let("dataType",(0,se._)`typeof ${o}`),a=r.let("coerced",(0,se._)`undefined`);i.coerceTypes==="array"&&r.if((0,se._)`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>r.assign(o,(0,se._)`${o}[0]`).assign(s,(0,se._)`typeof ${o}`).if(rf(t,o,i.strictNumbers),()=>r.assign(a,o))),r.if((0,se._)`${a} !== undefined`);for(const u of n)(P1.has(u)||u==="array"&&i.coerceTypes==="array")&&l(u);r.else(),of(e),r.endIf(),r.if((0,se._)`${a} !== undefined`,()=>{r.assign(o,a),vj(e,a)});function l(u){switch(u){case"string":r.elseIf((0,se._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,se._)`"" + ${o}`).elseIf((0,se._)`${o} === null`).assign(a,(0,se._)`""`);return;case"number":r.elseIf((0,se._)`${s} == "boolean" || ${o} === null
220
+ || (${s} == "string" && ${o} && ${o} == +${o})`).assign(a,(0,se._)`+${o}`);return;case"integer":r.elseIf((0,se._)`${s} === "boolean" || ${o} === null
221
+ || (${s} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,(0,se._)`+${o}`);return;case"boolean":r.elseIf((0,se._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf((0,se._)`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":r.elseIf((0,se._)`${o} === "" || ${o} === 0 || ${o} === false`),r.assign(a,null);return;case"array":r.elseIf((0,se._)`${s} === "string" || ${s} === "number"
222
+ || ${s} === "boolean" || ${o} === null`).assign(a,(0,se._)`[${o}]`)}}}function vj({gen:e,parentData:t,parentDataProperty:n},r){e.if((0,se._)`${t} !== undefined`,()=>e.assign((0,se._)`${t}[${n}]`,r))}function Ic(e,t,n,r=no.Correct){const o=r===no.Correct?se.operators.EQ:se.operators.NEQ;let i;switch(e){case"null":return(0,se._)`${t} ${o} null`;case"array":i=(0,se._)`Array.isArray(${t})`;break;case"object":i=(0,se._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=s((0,se._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=s();break;default:return(0,se._)`typeof ${t} ${o} ${e}`}return r===no.Correct?i:(0,se.not)(i);function s(a=se.nil){return(0,se.and)((0,se._)`typeof ${t} == "number"`,a,n?(0,se._)`isFinite(${t})`:se.nil)}}ze.checkDataType=Ic;function rf(e,t,n,r){if(e.length===1)return Ic(e[0],t,n,r);let o;const i=(0,k1.toHash)(e);if(i.array&&i.object){const s=(0,se._)`typeof ${t} != "object"`;o=i.null?s:(0,se._)`!${t} || ${s}`,delete i.null,delete i.array,delete i.object}else o=se.nil;i.number&&delete i.integer;for(const s in i)o=(0,se.and)(o,Ic(s,t,n,r));return o}ze.checkDataTypes=rf;const wj={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,se._)`{type: ${e}}`:(0,se._)`{type: ${t}}`};function of(e){const t=_j(e);(0,hj.reportError)(t,wj)}ze.reportTypeError=of;function _j(e){const{gen:t,data:n,schema:r}=e,o=(0,k1.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:o,schemaValue:o,parentSchema:r,params:{},it:e}}var Fo={},km;function $j(){if(km)return Fo;km=1,Object.defineProperty(Fo,"__esModule",{value:!0}),Fo.assignDefaults=void 0;const e=ie,t=ee;function n(o,i){const{properties:s,items:a}=o.schema;if(i==="object"&&s)for(const l in s)r(o,l,s[l].default);else i==="array"&&Array.isArray(a)&&a.forEach((l,u)=>r(o,u,l.default))}Fo.assignDefaults=n;function r(o,i,s){const{gen:a,compositeRule:l,data:u,opts:d}=o;if(s===void 0)return;const c=(0,e._)`${u}${(0,e.getProperty)(i)}`;if(l){(0,t.checkStrictMode)(o,`default is ignored for: ${c}`);return}let f=(0,e._)`${c} === undefined`;d.useDefaults==="empty"&&(f=(0,e._)`${f} || ${c} === null || ${c} === ""`),a.if(f,(0,e._)`${c} = ${(0,e.stringify)(s)}`)}return Fo}var Ct={},ae={};Object.defineProperty(ae,"__esModule",{value:!0});ae.validateUnion=ae.validateArray=ae.usePattern=ae.callValidateCode=ae.schemaProperties=ae.allSchemaProperties=ae.noPropertyInData=ae.propertyInData=ae.isOwnProperty=ae.hasPropFunc=ae.reportMissingProp=ae.checkMissingProp=ae.checkReportMissingProp=void 0;const ye=ie,sf=ee,En=gt,xj=ee;function Sj(e,t){const{gen:n,data:r,it:o}=e;n.if(lf(n,r,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,ye._)`${t}`},!0),e.error()})}ae.checkReportMissingProp=Sj;function Ej({gen:e,data:t,it:{opts:n}},r,o){return(0,ye.or)(...r.map(i=>(0,ye.and)(lf(e,t,i,n.ownProperties),(0,ye._)`${o} = ${i}`)))}ae.checkMissingProp=Ej;function kj(e,t){e.setParams({missingProperty:t},!0),e.error()}ae.reportMissingProp=kj;function C1(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ye._)`Object.prototype.hasOwnProperty`})}ae.hasPropFunc=C1;function af(e,t,n){return(0,ye._)`${C1(e)}.call(${t}, ${n})`}ae.isOwnProperty=af;function Nj(e,t,n,r){const o=(0,ye._)`${t}${(0,ye.getProperty)(n)} !== undefined`;return r?(0,ye._)`${o} && ${af(e,t,n)}`:o}ae.propertyInData=Nj;function lf(e,t,n,r){const o=(0,ye._)`${t}${(0,ye.getProperty)(n)} === undefined`;return r?(0,ye.or)(o,(0,ye.not)(af(e,t,n))):o}ae.noPropertyInData=lf;function b1(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ae.allSchemaProperties=b1;function Pj(e,t){return b1(t).filter(n=>!(0,sf.alwaysValidSchema)(e,t[n]))}ae.schemaProperties=Pj;function Cj({schemaCode:e,data:t,it:{gen:n,topSchemaRef:r,schemaPath:o,errorPath:i},it:s},a,l,u){const d=u?(0,ye._)`${e}, ${t}, ${r}${o}`:t,c=[[En.default.instancePath,(0,ye.strConcat)(En.default.instancePath,i)],[En.default.parentData,s.parentData],[En.default.parentDataProperty,s.parentDataProperty],[En.default.rootData,En.default.rootData]];s.opts.dynamicRef&&c.push([En.default.dynamicAnchors,En.default.dynamicAnchors]);const f=(0,ye._)`${d}, ${n.object(...c)}`;return l!==ye.nil?(0,ye._)`${a}.call(${l}, ${f})`:(0,ye._)`${a}(${f})`}ae.callValidateCode=Cj;const bj=(0,ye._)`new RegExp`;function jj({gen:e,it:{opts:t}},n){const r=t.unicodeRegExp?"u":"",{regExp:o}=t.code,i=o(n,r);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,ye._)`${o.code==="new RegExp"?bj:(0,xj.useFunc)(e,o)}(${n}, ${r})`})}ae.usePattern=jj;function Mj(e){const{gen:t,data:n,keyword:r,it:o}=e,i=t.name("valid");if(o.allErrors){const a=t.let("valid",!0);return s(()=>t.assign(a,!1)),a}return t.var(i,!0),s(()=>t.break()),i;function s(a){const l=t.const("len",(0,ye._)`${n}.length`);t.forRange("i",0,l,u=>{e.subschema({keyword:r,dataProp:u,dataPropType:sf.Type.Num},i),t.if((0,ye.not)(i),a)})}}ae.validateArray=Mj;function Tj(e){const{gen:t,schema:n,keyword:r,it:o}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(l=>(0,sf.alwaysValidSchema)(o,l))&&!o.opts.unevaluated)return;const s=t.let("valid",!1),a=t.name("_valid");t.block(()=>n.forEach((l,u)=>{const d=e.subschema({keyword:r,schemaProp:u,compositeRule:!0},a);t.assign(s,(0,ye._)`${s} || ${a}`),e.mergeValidEvaluated(d,a)||t.if((0,ye.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}ae.validateUnion=Tj;var Nm;function Ij(){if(Nm)return Ct;Nm=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.validateKeywordUsage=Ct.validSchemaType=Ct.funcKeywordCode=Ct.macroKeywordCode=void 0;const e=ie,t=gt,n=ae,r=Qi;function o(f,p){const{gen:g,keyword:v,schema:w,parentSchema:h,it:m}=f,y=p.macro.call(m.self,w,h,m),_=u(g,v,y);m.opts.validateSchema!==!1&&m.self.validateSchema(y,!0);const x=g.name("valid");f.subschema({schema:y,schemaPath:e.nil,errSchemaPath:`${m.errSchemaPath}/${v}`,topSchemaRef:_,compositeRule:!0},x),f.pass(x,()=>f.error(!0))}Ct.macroKeywordCode=o;function i(f,p){var g;const{gen:v,keyword:w,schema:h,parentSchema:m,$data:y,it:_}=f;l(_,p);const x=!y&&p.compile?p.compile.call(_.self,h,m,_):p.validate,N=u(v,w,x),C=v.let("valid");f.block$data(C,z),f.ok((g=p.valid)!==null&&g!==void 0?g:C);function z(){if(p.errors===!1)b(),p.modifying&&s(f),j(()=>f.error());else{const B=p.async?L():q();p.modifying&&s(f),j(()=>a(f,B))}}function L(){const B=v.let("ruleErrs",null);return v.try(()=>b((0,e._)`await `),E=>v.assign(C,!1).if((0,e._)`${E} instanceof ${_.ValidationError}`,()=>v.assign(B,(0,e._)`${E}.errors`),()=>v.throw(E))),B}function q(){const B=(0,e._)`${N}.errors`;return v.assign(B,null),b(e.nil),B}function b(B=p.async?(0,e._)`await `:e.nil){const E=_.opts.passContext?t.default.this:t.default.self,H=!("compile"in p&&!y||p.schema===!1);v.assign(C,(0,e._)`${B}${(0,n.callValidateCode)(f,N,E,H)}`,p.modifying)}function j(B){var E;v.if((0,e.not)((E=p.valid)!==null&&E!==void 0?E:C),B)}}Ct.funcKeywordCode=i;function s(f){const{gen:p,data:g,it:v}=f;p.if(v.parentData,()=>p.assign(g,(0,e._)`${v.parentData}[${v.parentDataProperty}]`))}function a(f,p){const{gen:g}=f;g.if((0,e._)`Array.isArray(${p})`,()=>{g.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${p} : ${t.default.vErrors}.concat(${p})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,r.extendErrors)(f)},()=>f.error())}function l({schemaEnv:f},p){if(p.async&&!f.$async)throw new Error("async keyword in sync schema")}function u(f,p,g){if(g===void 0)throw new Error(`keyword "${p}" failed to compile`);return f.scopeValue("keyword",typeof g=="function"?{ref:g}:{ref:g,code:(0,e.stringify)(g)})}function d(f,p,g=!1){return!p.length||p.some(v=>v==="array"?Array.isArray(f):v==="object"?f&&typeof f=="object"&&!Array.isArray(f):typeof f==v||g&&typeof f>"u")}Ct.validSchemaType=d;function c({schema:f,opts:p,self:g,errSchemaPath:v},w,h){if(Array.isArray(w.keyword)?!w.keyword.includes(h):w.keyword!==h)throw new Error("ajv implementation error");const m=w.dependencies;if(m!=null&&m.some(y=>!Object.prototype.hasOwnProperty.call(f,y)))throw new Error(`parent schema must have dependencies of ${h}: ${m.join(",")}`);if(w.validateSchema&&!w.validateSchema(f[h])){const _=`keyword "${h}" value is invalid at path "${v}": `+g.errorsText(w.validateSchema.errors);if(p.validateSchema==="log")g.logger.error(_);else throw new Error(_)}}return Ct.validateKeywordUsage=c,Ct}var rn={},Pm;function Rj(){if(Pm)return rn;Pm=1,Object.defineProperty(rn,"__esModule",{value:!0}),rn.extendSubschemaMode=rn.extendSubschemaData=rn.getSubschema=void 0;const e=ie,t=ee;function n(i,{keyword:s,schemaProp:a,schema:l,schemaPath:u,errSchemaPath:d,topSchemaRef:c}){if(s!==void 0&&l!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(s!==void 0){const f=i.schema[s];return a===void 0?{schema:f,schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(s)}`,errSchemaPath:`${i.errSchemaPath}/${s}`}:{schema:f[a],schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(s)}${(0,e.getProperty)(a)}`,errSchemaPath:`${i.errSchemaPath}/${s}/${(0,t.escapeFragment)(a)}`}}if(l!==void 0){if(u===void 0||d===void 0||c===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:l,schemaPath:u,topSchemaRef:c,errSchemaPath:d}}throw new Error('either "keyword" or "schema" must be passed')}rn.getSubschema=n;function r(i,s,{dataProp:a,dataPropType:l,data:u,dataTypes:d,propertyName:c}){if(u!==void 0&&a!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:f}=s;if(a!==void 0){const{errorPath:g,dataPathArr:v,opts:w}=s,h=f.let("data",(0,e._)`${s.data}${(0,e.getProperty)(a)}`,!0);p(h),i.errorPath=(0,e.str)`${g}${(0,t.getErrorPath)(a,l,w.jsPropertySyntax)}`,i.parentDataProperty=(0,e._)`${a}`,i.dataPathArr=[...v,i.parentDataProperty]}if(u!==void 0){const g=u instanceof e.Name?u:f.let("data",u,!0);p(g),c!==void 0&&(i.propertyName=c)}d&&(i.dataTypes=d);function p(g){i.data=g,i.dataLevel=s.dataLevel+1,i.dataTypes=[],s.definedProperties=new Set,i.parentData=s.data,i.dataNames=[...s.dataNames,g]}}rn.extendSubschemaData=r;function o(i,{jtdDiscriminator:s,jtdMetadata:a,compositeRule:l,createErrors:u,allErrors:d}){l!==void 0&&(i.compositeRule=l),u!==void 0&&(i.createErrors=u),d!==void 0&&(i.allErrors=d),i.jtdDiscriminator=s,i.jtdMetadata=a}return rn.extendSubschemaMode=o,rn}var He={},j1=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;o--!==0;){var s=i[o];if(!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n},M1={exports:{}},zn=M1.exports=function(e,t,n){typeof t=="function"&&(n=t,t={}),n=t.cb||n;var r=typeof n=="function"?n:n.pre||function(){},o=n.post||function(){};ea(t,r,o,e,"",e)};zn.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};zn.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};zn.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};zn.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function ea(e,t,n,r,o,i,s,a,l,u){if(r&&typeof r=="object"&&!Array.isArray(r)){t(r,o,i,s,a,l,u);for(var d in r){var c=r[d];if(Array.isArray(c)){if(d in zn.arrayKeywords)for(var f=0;f<c.length;f++)ea(e,t,n,c[f],o+"/"+d+"/"+f,i,o,d,r,f)}else if(d in zn.propsKeywords){if(c&&typeof c=="object")for(var p in c)ea(e,t,n,c[p],o+"/"+d+"/"+zj(p),i,o,d,r,p)}else(d in zn.keywords||e.allKeys&&!(d in zn.skipKeywords))&&ea(e,t,n,c,o+"/"+d,i,o,d,r)}n(r,o,i,s,a,l,u)}}function zj(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var Aj=M1.exports;Object.defineProperty(He,"__esModule",{value:!0});He.getSchemaRefs=He.resolveUrl=He.normalizeId=He._getFullPath=He.getFullPath=He.inlineRef=void 0;const Oj=ee,Dj=j1,Lj=Aj,Vj=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Fj(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Rc(e):t?T1(e)<=t:!1}He.inlineRef=Fj;const Hj=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Rc(e){for(const t in e){if(Hj.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(Rc)||typeof n=="object"&&Rc(n))return!0}return!1}function T1(e){let t=0;for(const n in e){if(n==="$ref")return 1/0;if(t++,!Vj.has(n)&&(typeof e[n]=="object"&&(0,Oj.eachItem)(e[n],r=>t+=T1(r)),t===1/0))return 1/0}return t}function I1(e,t="",n){n!==!1&&(t=ro(t));const r=e.parse(t);return R1(e,r)}He.getFullPath=I1;function R1(e,t){return e.serialize(t).split("#")[0]+"#"}He._getFullPath=R1;const Bj=/#\/?$/;function ro(e){return e?e.replace(Bj,""):""}He.normalizeId=ro;function Uj(e,t,n){return n=ro(n),e.resolve(t,n)}He.resolveUrl=Uj;const qj=/^[a-z_][-a-z0-9._]*$/i;function Wj(e,t){if(typeof e=="boolean")return{};const{schemaId:n,uriResolver:r}=this.opts,o=ro(e[n]||t),i={"":o},s=I1(r,o,!1),a={},l=new Set;return Lj(e,{allKeys:!0},(c,f,p,g)=>{if(g===void 0)return;const v=s+f;let w=i[g];typeof c[n]=="string"&&(w=h.call(this,c[n])),m.call(this,c.$anchor),m.call(this,c.$dynamicAnchor),i[f]=w;function h(y){const _=this.opts.uriResolver.resolve;if(y=ro(w?_(w,y):y),l.has(y))throw d(y);l.add(y);let x=this.refs[y];return typeof x=="string"&&(x=this.refs[x]),typeof x=="object"?u(c,x.schema,y):y!==ro(v)&&(y[0]==="#"?(u(c,a[y],y),a[y]=c):this.refs[y]=v),y}function m(y){if(typeof y=="string"){if(!qj.test(y))throw new Error(`invalid anchor "${y}"`);h.call(this,`#${y}`)}}}),a;function u(c,f,p){if(f!==void 0&&!Dj(c,f))throw d(p)}function d(c){return new Error(`reference "${c}" resolves to more than one schema`)}}He.getSchemaRefs=Wj;var Cm;function Zi(){if(Cm)return tn;Cm=1,Object.defineProperty(tn,"__esModule",{value:!0}),tn.getData=tn.KeywordCxt=tn.validateFunctionCode=void 0;const e=sj(),t=ze,n=E1(),r=ze,o=$j(),i=Ij(),s=Rj(),a=ie,l=gt,u=He,d=ee,c=Qi;function f(D){if(x(D)&&(C(D),_(D))){w(D);return}p(D,()=>(0,e.topBoolOrEmptySchema)(D))}tn.validateFunctionCode=f;function p({gen:D,validateName:F,schema:K,schemaEnv:G,opts:J},ne){J.code.es5?D.func(F,(0,a._)`${l.default.data}, ${l.default.valCxt}`,G.$async,()=>{D.code((0,a._)`"use strict"; ${m(K,J)}`),v(D,J),D.code(ne)}):D.func(F,(0,a._)`${l.default.data}, ${g(J)}`,G.$async,()=>D.code(m(K,J)).code(ne))}function g(D){return(0,a._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${D.dynamicRef?(0,a._)`, ${l.default.dynamicAnchors}={}`:a.nil}}={}`}function v(D,F){D.if(l.default.valCxt,()=>{D.var(l.default.instancePath,(0,a._)`${l.default.valCxt}.${l.default.instancePath}`),D.var(l.default.parentData,(0,a._)`${l.default.valCxt}.${l.default.parentData}`),D.var(l.default.parentDataProperty,(0,a._)`${l.default.valCxt}.${l.default.parentDataProperty}`),D.var(l.default.rootData,(0,a._)`${l.default.valCxt}.${l.default.rootData}`),F.dynamicRef&&D.var(l.default.dynamicAnchors,(0,a._)`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{D.var(l.default.instancePath,(0,a._)`""`),D.var(l.default.parentData,(0,a._)`undefined`),D.var(l.default.parentDataProperty,(0,a._)`undefined`),D.var(l.default.rootData,l.default.data),F.dynamicRef&&D.var(l.default.dynamicAnchors,(0,a._)`{}`)})}function w(D){const{schema:F,opts:K,gen:G}=D;p(D,()=>{K.$comment&&F.$comment&&B(D),q(D),G.let(l.default.vErrors,null),G.let(l.default.errors,0),K.unevaluated&&h(D),z(D),E(D)})}function h(D){const{gen:F,validateName:K}=D;D.evaluated=F.const("evaluated",(0,a._)`${K}.evaluated`),F.if((0,a._)`${D.evaluated}.dynamicProps`,()=>F.assign((0,a._)`${D.evaluated}.props`,(0,a._)`undefined`)),F.if((0,a._)`${D.evaluated}.dynamicItems`,()=>F.assign((0,a._)`${D.evaluated}.items`,(0,a._)`undefined`))}function m(D,F){const K=typeof D=="object"&&D[F.schemaId];return K&&(F.code.source||F.code.process)?(0,a._)`/*# sourceURL=${K} */`:a.nil}function y(D,F){if(x(D)&&(C(D),_(D))){N(D,F);return}(0,e.boolOrEmptySchema)(D,F)}function _({schema:D,self:F}){if(typeof D=="boolean")return!D;for(const K in D)if(F.RULES.all[K])return!0;return!1}function x(D){return typeof D.schema!="boolean"}function N(D,F){const{schema:K,gen:G,opts:J}=D;J.$comment&&K.$comment&&B(D),b(D),j(D);const ne=G.const("_errs",l.default.errors);z(D,ne),G.var(F,(0,a._)`${ne} === ${l.default.errors}`)}function C(D){(0,d.checkUnknownRules)(D),L(D)}function z(D,F){if(D.opts.jtd)return V(D,[],!1,F);const K=(0,t.getSchemaTypes)(D.schema),G=(0,t.coerceAndCheckDataType)(D,K);V(D,K,!G,F)}function L(D){const{schema:F,errSchemaPath:K,opts:G,self:J}=D;F.$ref&&G.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(F,J.RULES)&&J.logger.warn(`$ref: keywords ignored in schema at path "${K}"`)}function q(D){const{schema:F,opts:K}=D;F.default!==void 0&&K.useDefaults&&K.strictSchema&&(0,d.checkStrictMode)(D,"default is ignored in the schema root")}function b(D){const F=D.schema[D.opts.schemaId];F&&(D.baseId=(0,u.resolveUrl)(D.opts.uriResolver,D.baseId,F))}function j(D){if(D.schema.$async&&!D.schemaEnv.$async)throw new Error("async schema in sync schema")}function B({gen:D,schemaEnv:F,schema:K,errSchemaPath:G,opts:J}){const ne=K.$comment;if(J.$comment===!0)D.code((0,a._)`${l.default.self}.logger.log(${ne})`);else if(typeof J.$comment=="function"){const ce=(0,a.str)`${G}/$comment`,Me=D.scopeValue("root",{ref:F.root});D.code((0,a._)`${l.default.self}.opts.$comment(${ne}, ${ce}, ${Me}.schema)`)}}function E(D){const{gen:F,schemaEnv:K,validateName:G,ValidationError:J,opts:ne}=D;K.$async?F.if((0,a._)`${l.default.errors} === 0`,()=>F.return(l.default.data),()=>F.throw((0,a._)`new ${J}(${l.default.vErrors})`)):(F.assign((0,a._)`${G}.errors`,l.default.vErrors),ne.unevaluated&&H(D),F.return((0,a._)`${l.default.errors} === 0`))}function H({gen:D,evaluated:F,props:K,items:G}){K instanceof a.Name&&D.assign((0,a._)`${F}.props`,K),G instanceof a.Name&&D.assign((0,a._)`${F}.items`,G)}function V(D,F,K,G){const{gen:J,schema:ne,data:ce,allErrors:Me,opts:we,self:Pe}=D,{RULES:Se}=Pe;if(ne.$ref&&(we.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(ne,Se))){J.block(()=>Y(D,"$ref",Se.all.$ref.definition));return}we.jtd||M(D,F),J.block(()=>{for(const Oe of Se.rules)yt(Oe);yt(Se.post)});function yt(Oe){(0,n.shouldUseGroup)(ne,Oe)&&(Oe.type?(J.if((0,r.checkDataType)(Oe.type,ce,we.strictNumbers)),W(D,Oe),F.length===1&&F[0]===Oe.type&&K&&(J.else(),(0,r.reportTypeError)(D)),J.endIf()):W(D,Oe),Me||J.if((0,a._)`${l.default.errors} === ${G||0}`))}}function W(D,F){const{gen:K,schema:G,opts:{useDefaults:J}}=D;J&&(0,o.assignDefaults)(D,F.type),K.block(()=>{for(const ne of F.rules)(0,n.shouldUseRule)(G,ne)&&Y(D,ne.keyword,ne.definition,F.type)})}function M(D,F){D.schemaEnv.meta||!D.opts.strictTypes||(A(D,F),D.opts.allowUnionTypes||T(D,F),k(D,D.dataTypes))}function A(D,F){if(F.length){if(!D.dataTypes.length){D.dataTypes=F;return}F.forEach(K=>{R(D.dataTypes,K)||P(D,`type "${K}" not allowed by context "${D.dataTypes.join(",")}"`)}),S(D,F)}}function T(D,F){F.length>1&&!(F.length===2&&F.includes("null"))&&P(D,"use allowUnionTypes to allow union type keyword")}function k(D,F){const K=D.self.RULES.all;for(const G in K){const J=K[G];if(typeof J=="object"&&(0,n.shouldUseRule)(D.schema,J)){const{type:ne}=J.definition;ne.length&&!ne.some(ce=>I(F,ce))&&P(D,`missing type "${ne.join(",")}" for keyword "${G}"`)}}}function I(D,F){return D.includes(F)||F==="number"&&D.includes("integer")}function R(D,F){return D.includes(F)||F==="integer"&&D.includes("number")}function S(D,F){const K=[];for(const G of D.dataTypes)R(F,G)?K.push(G):F.includes("integer")&&G==="number"&&K.push("integer");D.dataTypes=K}function P(D,F){const K=D.schemaEnv.baseId+D.errSchemaPath;F+=` at "${K}" (strictTypes)`,(0,d.checkStrictMode)(D,F,D.opts.strictTypes)}class U{constructor(F,K,G){if((0,i.validateKeywordUsage)(F,K,G),this.gen=F.gen,this.allErrors=F.allErrors,this.keyword=G,this.data=F.data,this.schema=F.schema[G],this.$data=K.$data&&F.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(F,this.schema,G,this.$data),this.schemaType=K.schemaType,this.parentSchema=F.schema,this.params={},this.it=F,this.def=K,this.$data)this.schemaCode=F.gen.const("vSchema",te(this.$data,F));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,K.schemaType,K.allowUndefined))throw new Error(`${G} value must be ${JSON.stringify(K.schemaType)}`);("code"in K?K.trackErrors:K.errors!==!1)&&(this.errsCount=F.gen.const("_errs",l.default.errors))}result(F,K,G){this.failResult((0,a.not)(F),K,G)}failResult(F,K,G){this.gen.if(F),G?G():this.error(),K?(this.gen.else(),K(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(F,K){this.failResult((0,a.not)(F),void 0,K)}fail(F){if(F===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(F),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(F){if(!this.$data)return this.fail(F);const{schemaCode:K}=this;this.fail((0,a._)`${K} !== undefined && (${(0,a.or)(this.invalid$data(),F)})`)}error(F,K,G){if(K){this.setParams(K),this._error(F,G),this.setParams({});return}this._error(F,G)}_error(F,K){(F?c.reportExtraError:c.reportError)(this,this.def.error,K)}$dataError(){(0,c.reportError)(this,this.def.$dataError||c.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,c.resetErrorsCount)(this.gen,this.errsCount)}ok(F){this.allErrors||this.gen.if(F)}setParams(F,K){K?Object.assign(this.params,F):this.params=F}block$data(F,K,G=a.nil){this.gen.block(()=>{this.check$data(F,G),K()})}check$data(F=a.nil,K=a.nil){if(!this.$data)return;const{gen:G,schemaCode:J,schemaType:ne,def:ce}=this;G.if((0,a.or)((0,a._)`${J} === undefined`,K)),F!==a.nil&&G.assign(F,!0),(ne.length||ce.validateSchema)&&(G.elseIf(this.invalid$data()),this.$dataError(),F!==a.nil&&G.assign(F,!1)),G.else()}invalid$data(){const{gen:F,schemaCode:K,schemaType:G,def:J,it:ne}=this;return(0,a.or)(ce(),Me());function ce(){if(G.length){if(!(K instanceof a.Name))throw new Error("ajv implementation error");const we=Array.isArray(G)?G:[G];return(0,a._)`${(0,r.checkDataTypes)(we,K,ne.opts.strictNumbers,r.DataType.Wrong)}`}return a.nil}function Me(){if(J.validateSchema){const we=F.scopeValue("validate$data",{ref:J.validateSchema});return(0,a._)`!${we}(${K})`}return a.nil}}subschema(F,K){const G=(0,s.getSubschema)(this.it,F);(0,s.extendSubschemaData)(G,this.it,F),(0,s.extendSubschemaMode)(G,F);const J={...this.it,...G,items:void 0,props:void 0};return y(J,K),J}mergeEvaluated(F,K){const{it:G,gen:J}=this;G.opts.unevaluated&&(G.props!==!0&&F.props!==void 0&&(G.props=d.mergeEvaluated.props(J,F.props,G.props,K)),G.items!==!0&&F.items!==void 0&&(G.items=d.mergeEvaluated.items(J,F.items,G.items,K)))}mergeValidEvaluated(F,K){const{it:G,gen:J}=this;if(G.opts.unevaluated&&(G.props!==!0||G.items!==!0))return J.if(K,()=>this.mergeEvaluated(F,a.Name)),!0}}tn.KeywordCxt=U;function Y(D,F,K,G){const J=new U(D,K,F);"code"in K?K.code(J,G):J.$data&&K.validate?(0,i.funcKeywordCode)(J,K):"macro"in K?(0,i.macroKeywordCode)(J,K):(K.compile||K.validate)&&(0,i.funcKeywordCode)(J,K)}const X=/^\/(?:[^~]|~0|~1)*$/,Z=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function te(D,{dataLevel:F,dataNames:K,dataPathArr:G}){let J,ne;if(D==="")return l.default.rootData;if(D[0]==="/"){if(!X.test(D))throw new Error(`Invalid JSON-pointer: ${D}`);J=D,ne=l.default.rootData}else{const Pe=Z.exec(D);if(!Pe)throw new Error(`Invalid JSON-pointer: ${D}`);const Se=+Pe[1];if(J=Pe[2],J==="#"){if(Se>=F)throw new Error(we("property/index",Se));return G[F-Se]}if(Se>F)throw new Error(we("data",Se));if(ne=K[F-Se],!J)return ne}let ce=ne;const Me=J.split("/");for(const Pe of Me)Pe&&(ne=(0,a._)`${ne}${(0,a.getProperty)((0,d.unescapeJsonPointer)(Pe))}`,ce=(0,a._)`${ce} && ${ne}`);return ce;function we(Pe,Se){return`Cannot access ${Pe} ${Se} levels up, current level is ${F}`}}return tn.getData=te,tn}var Cs={},bm;function _l(){if(bm)return Cs;bm=1,Object.defineProperty(Cs,"__esModule",{value:!0});class e extends Error{constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}return Cs.default=e,Cs}var Cr={};Object.defineProperty(Cr,"__esModule",{value:!0});const mu=He;class Kj extends Error{constructor(t,n,r,o){super(o||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,mu.resolveUrl)(t,n,r),this.missingSchema=(0,mu.normalizeId)((0,mu.getFullPath)(t,this.missingRef))}}Cr.default=Kj;var Qe={};Object.defineProperty(Qe,"__esModule",{value:!0});Qe.resolveSchema=Qe.getCompilingSchema=Qe.resolveRef=Qe.compileSchema=Qe.SchemaEnv=void 0;const bt=ie,Xj=_l(),Zn=gt,Ot=He,jm=ee,Yj=Zi();class $l{constructor(t){var n;this.refs={},this.dynamicAnchors={};let r;typeof t.schema=="object"&&(r=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(n=t.baseId)!==null&&n!==void 0?n:(0,Ot.normalizeId)(r==null?void 0:r[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=r==null?void 0:r.$async,this.refs={}}}Qe.SchemaEnv=$l;function uf(e){const t=z1.call(this,e);if(t)return t;const n=(0,Ot.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:r,lines:o}=this.opts.code,{ownProperties:i}=this.opts,s=new bt.CodeGen(this.scope,{es5:r,lines:o,ownProperties:i});let a;e.$async&&(a=s.scopeValue("Error",{ref:Xj.default,code:(0,bt._)`require("ajv/dist/runtime/validation_error").default`}));const l=s.scopeName("validate");e.validateName=l;const u={gen:s,allErrors:this.opts.allErrors,data:Zn.default.data,parentData:Zn.default.parentData,parentDataProperty:Zn.default.parentDataProperty,dataNames:[Zn.default.data],dataPathArr:[bt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,bt.stringify)(e.schema)}:{ref:e.schema}),validateName:l,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:bt.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,bt._)`""`,opts:this.opts,self:this};let d;try{this._compilations.add(e),(0,Yj.validateFunctionCode)(u),s.optimize(this.opts.code.optimize);const c=s.toString();d=`${s.scopeRefs(Zn.default.scope)}return ${c}`,this.opts.code.process&&(d=this.opts.code.process(d,e));const p=new Function(`${Zn.default.self}`,`${Zn.default.scope}`,d)(this,this.scope.get());if(this.scope.value(l,{ref:p}),p.errors=null,p.schema=e.schema,p.schemaEnv=e,e.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:l,validateCode:c,scopeValues:s._values}),this.opts.unevaluated){const{props:g,items:v}=u;p.evaluated={props:g instanceof bt.Name?void 0:g,items:v instanceof bt.Name?void 0:v,dynamicProps:g instanceof bt.Name,dynamicItems:v instanceof bt.Name},p.source&&(p.source.evaluated=(0,bt.stringify)(p.evaluated))}return e.validate=p,e}catch(c){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),c}finally{this._compilations.delete(e)}}Qe.compileSchema=uf;function Gj(e,t,n){var r;n=(0,Ot.resolveUrl)(this.opts.uriResolver,t,n);const o=e.refs[n];if(o)return o;let i=Jj.call(this,e,n);if(i===void 0){const s=(r=e.localRefs)===null||r===void 0?void 0:r[n],{schemaId:a}=this.opts;s&&(i=new $l({schema:s,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[n]=Qj.call(this,i)}Qe.resolveRef=Gj;function Qj(e){return(0,Ot.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:uf.call(this,e)}function z1(e){for(const t of this._compilations)if(Zj(t,e))return t}Qe.getCompilingSchema=z1;function Zj(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Jj(e,t){let n;for(;typeof(n=this.refs[t])=="string";)t=n;return n||this.schemas[t]||xl.call(this,e,t)}function xl(e,t){const n=this.opts.uriResolver.parse(t),r=(0,Ot._getFullPath)(this.opts.uriResolver,n);let o=(0,Ot.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===o)return gu.call(this,n,e);const i=(0,Ot.normalizeId)(r),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){const a=xl.call(this,e,s);return typeof(a==null?void 0:a.schema)!="object"?void 0:gu.call(this,n,a)}if(typeof(s==null?void 0:s.schema)=="object"){if(s.validate||uf.call(this,s),i===(0,Ot.normalizeId)(t)){const{schema:a}=s,{schemaId:l}=this.opts,u=a[l];return u&&(o=(0,Ot.resolveUrl)(this.opts.uriResolver,o,u)),new $l({schema:a,schemaId:l,root:e,baseId:o})}return gu.call(this,n,s)}}Qe.resolveSchema=xl;const eM=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function gu(e,{baseId:t,schema:n,root:r}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(const a of e.fragment.slice(1).split("/")){if(typeof n=="boolean")return;const l=n[(0,jm.unescapeFragment)(a)];if(l===void 0)return;n=l;const u=typeof n=="object"&&n[this.opts.schemaId];!eM.has(a)&&u&&(t=(0,Ot.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof n!="boolean"&&n.$ref&&!(0,jm.schemaHasRulesButRef)(n,this.RULES)){const a=(0,Ot.resolveUrl)(this.opts.uriResolver,t,n.$ref);i=xl.call(this,r,a)}const{schemaId:s}=this.opts;if(i=i||new $l({schema:n,schemaId:s,root:r,baseId:t}),i.schema!==i.root.schema)return i}const tM="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",nM="Meta-schema for $data reference (JSON AnySchema extension proposal)",rM="object",oM=["$data"],iM={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},sM=!1,aM={$id:tM,description:nM,type:rM,required:oM,properties:iM,additionalProperties:sM};var cf={},Sl={exports:{}};const lM=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),A1=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),df=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),O1=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),uM=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function D1(e){let t="",n=0,r=0;for(r=0;r<e.length;r++)if(n=e[r].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[r];break}for(r+=1;r<e.length;r++){if(n=e[r].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[r]}return t}const cM=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Mm(e){return e.length=0,!0}function dM(e,t,n){if(e.length){const r=D1(e);if(r!=="")t.push(r);else return n.error=!0,!1;e.length=0}return!0}function fM(e){let t=0;const n={error:!1,address:"",zone:""},r=[],o=[];let i=!1,s=!1,a=dM;for(let l=0;l<e.length;l++){const u=e[l];if(!(u==="["||u==="]"))if(u===":"){if(i===!0&&(s=!0),!a(o,r,n))break;if(++t>7){n.error=!0;break}l>0&&e[l-1]===":"&&(i=!0),r.push(":");continue}else if(u==="%"){if(!a(o,r,n))break;a=Mm}else{o.push(u);continue}}return o.length&&(a===Mm?n.zone=o.join(""):s?r.push(o.join("")):r.push(D1(o))),n.address=r.join(""),n}function L1(e){if(hM(e,":")<2)return{host:e,isIPV6:!1};const t=fM(e);if(t.error)return{host:e,isIPV6:!1};{let n=t.address,r=t.address;return t.zone&&(n+="%"+t.zone,r+="%25"+t.zone),{host:n,isIPV6:!0,escapedHost:r}}}function hM(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}function pM(e){let t=e;const n=[];let r=-1,o=0;for(;o=t.length;){if(o===1){if(t===".")break;if(t==="/"){n.push("/");break}else{n.push(t);break}}else if(o===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){n.push("/");break}}else if(o===3&&t==="/.."){n.length!==0&&n.pop(),n.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),n.length!==0&&n.pop();continue}}if((r=t.indexOf("/",1))===-1){n.push(t);break}else n.push(t.slice(0,r)),t=t.slice(r)}return n.join("")}const mM={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},gM=/[@/?#:]/g,yM=/[@/?#]/g;function V1(e,t){const n=t?yM:gM;return n.lastIndex=0,e.replace(n,r=>mM[r])}function vM(e,t=!1){if(e.indexOf("%")===-1)return e;let n="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){const o=e.slice(r+1,r+3);if(df(o)){const i=o.toUpperCase(),s=String.fromCharCode(parseInt(i,16));t&&O1(s)?n+=s:n+="%"+i,r+=2;continue}}n+=e[r]}return n}function wM(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){const r=e.slice(n+1,n+3);if(df(r)){const o=r.toUpperCase(),i=String.fromCharCode(parseInt(o,16));i!=="."&&O1(i)?t+=i:t+="%"+o,n+=2;continue}}uM(e[n])?t+=e[n]:t+=escape(e[n])}return t}function _M(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){const r=e.slice(n+1,n+3);if(df(r)){t+="%"+r.toUpperCase(),n+=2;continue}}t+=escape(e[n])}return t}function $M(e){const t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let n=unescape(e.host);if(!A1(n)){const r=L1(n);r.isIPV6===!0?n=`[${r.escapedHost}]`:n=V1(n,!1)}t.push(n)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}var F1={nonSimpleDomain:cM,recomposeAuthority:$M,reescapeHostDelimiters:V1,normalizePercentEncoding:vM,normalizePathEncoding:wM,escapePreservingEscapes:_M,removeDotSegments:pM,isIPv4:A1,isUUID:lM,normalizeIPv6:L1};const{isUUID:xM}=F1,SM=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function H1(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function B1(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function U1(e){const t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function EM(e){return e.secure=H1(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function kM(e){if((e.port===(H1(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,n]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function NM(e,t){if(!e.path)return e.error="URN can not be parsed",e;const n=e.path.match(SM);if(n){const r=t.scheme||e.scheme||"urn";e.nid=n[1].toLowerCase(),e.nss=n[2];const o=`${r}:${t.nid||e.nid}`,i=ff(o);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function PM(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");const n=t.scheme||e.scheme||"urn",r=e.nid.toLowerCase(),o=`${n}:${t.nid||r}`,i=ff(o);i&&(e=i.serialize(e,t));const s=e,a=e.nss;return s.path=`${r||t.nid}:${a}`,t.skipEscape=!0,s}function CM(e,t){const n=e;return n.uuid=n.nss,n.nss=void 0,!t.tolerant&&(!n.uuid||!xM(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function bM(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t}const q1={scheme:"http",domainHost:!0,parse:B1,serialize:U1},jM={scheme:"https",domainHost:q1.domainHost,parse:B1,serialize:U1},ta={scheme:"ws",domainHost:!0,parse:EM,serialize:kM},MM={scheme:"wss",domainHost:ta.domainHost,parse:ta.parse,serialize:ta.serialize},TM={scheme:"urn",parse:NM,serialize:PM,skipNormalize:!0},IM={scheme:"urn:uuid",parse:CM,serialize:bM,skipNormalize:!0},Fa={http:q1,https:jM,ws:ta,wss:MM,urn:TM,"urn:uuid":IM};Object.setPrototypeOf(Fa,null);function ff(e){return e&&(Fa[e]||Fa[e.toLowerCase()])||void 0}var RM={SCHEMES:Fa,getSchemeHandler:ff};const{normalizeIPv6:zM,removeDotSegments:Yo,recomposeAuthority:AM,normalizePercentEncoding:OM,normalizePathEncoding:DM,escapePreservingEscapes:LM,reescapeHostDelimiters:VM,isIPv4:FM,nonSimpleDomain:HM}=F1,{SCHEMES:BM,getSchemeHandler:W1}=RM;function UM(e,t){return typeof e=="string"?e=YM(e,t):typeof e=="object"&&(e=_o(Er(e,t),t)),e}function qM(e,t,n){const r=n?Object.assign({scheme:"null"},n):{scheme:"null"},o=K1(_o(e,r),_o(t,r),r,!0);return r.skipEscape=!0,Er(o,r)}function K1(e,t,n,r){const o={};return r||(e=_o(Er(e,n),n),t=_o(Er(t,n),n)),n=n||{},!n.tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=Yo(t.path||""),o.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=Yo(t.path||""),o.query=t.query):(t.path?(t.path[0]==="/"?o.path=Yo(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?o.path="/"+t.path:e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path,o.path=Yo(o.path)),o.query=t.query):(o.path=e.path,t.query!==void 0?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function WM(e,t,n){const r=Tm(e,n),o=Tm(t,n);return r!==void 0&&o!==void 0&&r.toLowerCase()===o.toLowerCase()}function Er(e,t){const n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},r=Object.assign({},t),o=[],i=W1(r.scheme||n.scheme);i&&i.serialize&&i.serialize(n,r),n.path!==void 0&&(r.skipEscape?n.path=OM(n.path):(n.path=LM(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),r.reference!=="suffix"&&n.scheme&&o.push(n.scheme,":");const s=AM(n);if(s!==void 0&&(r.reference!=="suffix"&&o.push("//"),o.push(s),n.path&&n.path[0]!=="/"&&o.push("/")),n.path!==void 0){let a=n.path;!r.absolutePath&&(!i||!i.absolutePath)&&(a=Yo(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),o.push(a)}return n.query!==void 0&&o.push("?",n.query),n.fragment!==void 0&&o.push("#",n.fragment),o.join("")}const KM=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function XM(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port=="number"&&(e.port<0||e.port>65535))return"URI port is malformed."}function X1(e,t){const n=Object.assign({},t),r={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let o=!1,i=!1;n.reference==="suffix"&&(n.scheme?e=n.scheme+":"+e:e="//"+e);const s=e.match(KM);if(s){r.scheme=s[1],r.userinfo=s[3],r.host=s[4],r.port=parseInt(s[5],10),r.path=s[6]||"",r.query=s[7],r.fragment=s[8],isNaN(r.port)&&(r.port=s[5]);const a=XM(r,s);if(a!==void 0&&(r.error=r.error||a,o=!0),r.host)if(FM(r.host)===!1){const d=zM(r.host);r.host=d.host.toLowerCase(),i=d.isIPV6}else i=!0;r.scheme===void 0&&r.userinfo===void 0&&r.host===void 0&&r.port===void 0&&r.query===void 0&&!r.path?r.reference="same-document":r.scheme===void 0?r.reference="relative":r.fragment===void 0?r.reference="absolute":r.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==r.reference&&(r.error=r.error||"URI is not a "+n.reference+" reference.");const l=W1(n.scheme||r.scheme);if(!n.unicodeSupport&&(!l||!l.unicodeSupport)&&r.host&&(n.domainHost||l&&l.domainHost)&&i===!1&&HM(r.host))try{r.host=URL.domainToASCII(r.host.toLowerCase())}catch(u){r.error=r.error||"Host's domain name can not be converted to ASCII: "+u}if((!l||l&&!l.skipNormalize)&&(e.indexOf("%")!==-1&&(r.scheme!==void 0&&(r.scheme=unescape(r.scheme)),r.host!==void 0&&(r.host=VM(unescape(r.host),i))),r.path&&(r.path=DM(r.path)),r.fragment))try{r.fragment=encodeURI(decodeURIComponent(r.fragment))}catch{r.error=r.error||"URI malformed"}l&&l.parse&&l.parse(r,n)}else r.error=r.error||"URI can not be parsed.";return{parsed:r,malformedAuthorityOrPort:o}}function _o(e,t){return X1(e,t).parsed}function YM(e,t){return Y1(e,t).normalized}function Y1(e,t){const{parsed:n,malformedAuthorityOrPort:r}=X1(e,t);return{normalized:r?e:Er(n,t),malformedAuthorityOrPort:r}}function Tm(e,t){if(typeof e=="string"){const{normalized:n,malformedAuthorityOrPort:r}=Y1(e,t);return r?void 0:n}if(typeof e=="object")return Er(e,t)}const hf={SCHEMES:BM,normalize:UM,resolve:qM,resolveComponent:K1,equal:WM,serialize:Er,parse:_o};Sl.exports=hf;Sl.exports.default=hf;Sl.exports.fastUri=hf;var GM=Sl.exports;Object.defineProperty(cf,"__esModule",{value:!0});const G1=GM;G1.code='require("ajv/dist/runtime/uri").default';cf.default=G1;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Zi();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=ie;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const r=_l(),o=Cr,i=Sr,s=Qe,a=ie,l=He,u=ze,d=ee,c=aM,f=cf,p=(T,k)=>new RegExp(T,k);p.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],v=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),w={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},h={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},m=200;function y(T){var k,I,R,S,P,U,Y,X,Z,te,D,F,K,G,J,ne,ce,Me,we,Pe,Se,yt,Oe,Gn,_n;const vt=T.strict,Jt=(k=T.code)===null||k===void 0?void 0:k.optimize,bo=Jt===!0||Jt===void 0?1:Jt||0,es=(R=(I=T.code)===null||I===void 0?void 0:I.regExp)!==null&&R!==void 0?R:p,jo=(S=T.uriResolver)!==null&&S!==void 0?S:f.default;return{strictSchema:(U=(P=T.strictSchema)!==null&&P!==void 0?P:vt)!==null&&U!==void 0?U:!0,strictNumbers:(X=(Y=T.strictNumbers)!==null&&Y!==void 0?Y:vt)!==null&&X!==void 0?X:!0,strictTypes:(te=(Z=T.strictTypes)!==null&&Z!==void 0?Z:vt)!==null&&te!==void 0?te:"log",strictTuples:(F=(D=T.strictTuples)!==null&&D!==void 0?D:vt)!==null&&F!==void 0?F:"log",strictRequired:(G=(K=T.strictRequired)!==null&&K!==void 0?K:vt)!==null&&G!==void 0?G:!1,code:T.code?{...T.code,optimize:bo,regExp:es}:{optimize:bo,regExp:es},loopRequired:(J=T.loopRequired)!==null&&J!==void 0?J:m,loopEnum:(ne=T.loopEnum)!==null&&ne!==void 0?ne:m,meta:(ce=T.meta)!==null&&ce!==void 0?ce:!0,messages:(Me=T.messages)!==null&&Me!==void 0?Me:!0,inlineRefs:(we=T.inlineRefs)!==null&&we!==void 0?we:!0,schemaId:(Pe=T.schemaId)!==null&&Pe!==void 0?Pe:"$id",addUsedSchema:(Se=T.addUsedSchema)!==null&&Se!==void 0?Se:!0,validateSchema:(yt=T.validateSchema)!==null&&yt!==void 0?yt:!0,validateFormats:(Oe=T.validateFormats)!==null&&Oe!==void 0?Oe:!0,unicodeRegExp:(Gn=T.unicodeRegExp)!==null&&Gn!==void 0?Gn:!0,int32range:(_n=T.int32range)!==null&&_n!==void 0?_n:!0,uriResolver:jo}}class _{constructor(k={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,k=this.opts={...k,...y(k)};const{es5:I,lines:R}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:v,es5:I,lines:R}),this.logger=j(k.logger);const S=k.validateFormats;k.validateFormats=!1,this.RULES=(0,i.getRules)(),x.call(this,w,k,"NOT SUPPORTED"),x.call(this,h,k,"DEPRECATED","warn"),this._metaOpts=q.call(this),k.formats&&z.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),k.keywords&&L.call(this,k.keywords),typeof k.meta=="object"&&this.addMetaSchema(k.meta),C.call(this),k.validateFormats=S}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:k,meta:I,schemaId:R}=this.opts;let S=c;R==="id"&&(S={...c},S.id=S.$id,delete S.$id),I&&k&&this.addMetaSchema(S,S[R],!1)}defaultMeta(){const{meta:k,schemaId:I}=this.opts;return this.opts.defaultMeta=typeof k=="object"?k[I]||k:void 0}validate(k,I){let R;if(typeof k=="string"){if(R=this.getSchema(k),!R)throw new Error(`no schema with key or ref "${k}"`)}else R=this.compile(k);const S=R(I);return"$async"in R||(this.errors=R.errors),S}compile(k,I){const R=this._addSchema(k,I);return R.validate||this._compileSchemaEnv(R)}compileAsync(k,I){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:R}=this.opts;return S.call(this,k,I);async function S(te,D){await P.call(this,te.$schema);const F=this._addSchema(te,D);return F.validate||U.call(this,F)}async function P(te){te&&!this.getSchema(te)&&await S.call(this,{$ref:te},!0)}async function U(te){try{return this._compileSchemaEnv(te)}catch(D){if(!(D instanceof o.default))throw D;return Y.call(this,D),await X.call(this,D.missingSchema),U.call(this,te)}}function Y({missingSchema:te,missingRef:D}){if(this.refs[te])throw new Error(`AnySchema ${te} is loaded but ${D} cannot be resolved`)}async function X(te){const D=await Z.call(this,te);this.refs[te]||await P.call(this,D.$schema),this.refs[te]||this.addSchema(D,te,I)}async function Z(te){const D=this._loading[te];if(D)return D;try{return await(this._loading[te]=R(te))}finally{delete this._loading[te]}}}addSchema(k,I,R,S=this.opts.validateSchema){if(Array.isArray(k)){for(const U of k)this.addSchema(U,void 0,R,S);return this}let P;if(typeof k=="object"){const{schemaId:U}=this.opts;if(P=k[U],P!==void 0&&typeof P!="string")throw new Error(`schema ${U} must be string`)}return I=(0,l.normalizeId)(I||P),this._checkUnique(I),this.schemas[I]=this._addSchema(k,R,I,S,!0),this}addMetaSchema(k,I,R=this.opts.validateSchema){return this.addSchema(k,I,!0,R),this}validateSchema(k,I){if(typeof k=="boolean")return!0;let R;if(R=k.$schema,R!==void 0&&typeof R!="string")throw new Error("$schema must be a string");if(R=R||this.opts.defaultMeta||this.defaultMeta(),!R)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const S=this.validate(R,k);if(!S&&I){const P="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(P);else throw new Error(P)}return S}getSchema(k){let I;for(;typeof(I=N.call(this,k))=="string";)k=I;if(I===void 0){const{schemaId:R}=this.opts,S=new s.SchemaEnv({schema:{},schemaId:R});if(I=s.resolveSchema.call(this,S,k),!I)return;this.refs[k]=I}return I.validate||this._compileSchemaEnv(I)}removeSchema(k){if(k instanceof RegExp)return this._removeAllSchemas(this.schemas,k),this._removeAllSchemas(this.refs,k),this;switch(typeof k){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const I=N.call(this,k);return typeof I=="object"&&this._cache.delete(I.schema),delete this.schemas[k],delete this.refs[k],this}case"object":{const I=k;this._cache.delete(I);let R=k[this.opts.schemaId];return R&&(R=(0,l.normalizeId)(R),delete this.schemas[R],delete this.refs[R]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(k){for(const I of k)this.addKeyword(I);return this}addKeyword(k,I){let R;if(typeof k=="string")R=k,typeof I=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),I.keyword=R);else if(typeof k=="object"&&I===void 0){if(I=k,R=I.keyword,Array.isArray(R)&&!R.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(E.call(this,R,I),!I)return(0,d.eachItem)(R,P=>H.call(this,P)),this;W.call(this,I);const S={...I,type:(0,u.getJSONTypes)(I.type),schemaType:(0,u.getJSONTypes)(I.schemaType)};return(0,d.eachItem)(R,S.type.length===0?P=>H.call(this,P,S):P=>S.type.forEach(U=>H.call(this,P,S,U))),this}getKeyword(k){const I=this.RULES.all[k];return typeof I=="object"?I.definition:!!I}removeKeyword(k){const{RULES:I}=this;delete I.keywords[k],delete I.all[k];for(const R of I.rules){const S=R.rules.findIndex(P=>P.keyword===k);S>=0&&R.rules.splice(S,1)}return this}addFormat(k,I){return typeof I=="string"&&(I=new RegExp(I)),this.formats[k]=I,this}errorsText(k=this.errors,{separator:I=", ",dataVar:R="data"}={}){return!k||k.length===0?"No errors":k.map(S=>`${R}${S.instancePath} ${S.message}`).reduce((S,P)=>S+I+P)}$dataMetaSchema(k,I){const R=this.RULES.all;k=JSON.parse(JSON.stringify(k));for(const S of I){const P=S.split("/").slice(1);let U=k;for(const Y of P)U=U[Y];for(const Y in R){const X=R[Y];if(typeof X!="object")continue;const{$data:Z}=X.definition,te=U[Y];Z&&te&&(U[Y]=A(te))}}return k}_removeAllSchemas(k,I){for(const R in k){const S=k[R];(!I||I.test(R))&&(typeof S=="string"?delete k[R]:S&&!S.meta&&(this._cache.delete(S.schema),delete k[R]))}}_addSchema(k,I,R,S=this.opts.validateSchema,P=this.opts.addUsedSchema){let U;const{schemaId:Y}=this.opts;if(typeof k=="object")U=k[Y];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof k!="boolean")throw new Error("schema must be object or boolean")}let X=this._cache.get(k);if(X!==void 0)return X;R=(0,l.normalizeId)(U||R);const Z=l.getSchemaRefs.call(this,k,R);return X=new s.SchemaEnv({schema:k,schemaId:Y,meta:I,baseId:R,localRefs:Z}),this._cache.set(X.schema,X),P&&!R.startsWith("#")&&(R&&this._checkUnique(R),this.refs[R]=X),S&&this.validateSchema(k,!0),X}_checkUnique(k){if(this.schemas[k]||this.refs[k])throw new Error(`schema with key or id "${k}" already exists`)}_compileSchemaEnv(k){if(k.meta?this._compileMetaSchema(k):s.compileSchema.call(this,k),!k.validate)throw new Error("ajv implementation error");return k.validate}_compileMetaSchema(k){const I=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,k)}finally{this.opts=I}}}_.ValidationError=r.default,_.MissingRefError=o.default,e.default=_;function x(T,k,I,R="error"){for(const S in T){const P=S;P in k&&this.logger[R](`${I}: option ${S}. ${T[P]}`)}}function N(T){return T=(0,l.normalizeId)(T),this.schemas[T]||this.refs[T]}function C(){const T=this.opts.schemas;if(T)if(Array.isArray(T))this.addSchema(T);else for(const k in T)this.addSchema(T[k],k)}function z(){for(const T in this.opts.formats){const k=this.opts.formats[T];k&&this.addFormat(T,k)}}function L(T){if(Array.isArray(T)){this.addVocabulary(T);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const k in T){const I=T[k];I.keyword||(I.keyword=k),this.addKeyword(I)}}function q(){const T={...this.opts};for(const k of g)delete T[k];return T}const b={log(){},warn(){},error(){}};function j(T){if(T===!1)return b;if(T===void 0)return console;if(T.log&&T.warn&&T.error)return T;throw new Error("logger must implement log, warn and error methods")}const B=/^[a-z_$][a-z0-9_$:-]*$/i;function E(T,k){const{RULES:I}=this;if((0,d.eachItem)(T,R=>{if(I.keywords[R])throw new Error(`Keyword ${R} is already defined`);if(!B.test(R))throw new Error(`Keyword ${R} has invalid name`)}),!!k&&k.$data&&!("code"in k||"validate"in k))throw new Error('$data keyword must have "code" or "validate" function')}function H(T,k,I){var R;const S=k==null?void 0:k.post;if(I&&S)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:P}=this;let U=S?P.post:P.rules.find(({type:X})=>X===I);if(U||(U={type:I,rules:[]},P.rules.push(U)),P.keywords[T]=!0,!k)return;const Y={keyword:T,definition:{...k,type:(0,u.getJSONTypes)(k.type),schemaType:(0,u.getJSONTypes)(k.schemaType)}};k.before?V.call(this,U,Y,k.before):U.rules.push(Y),P.all[T]=Y,(R=k.implements)===null||R===void 0||R.forEach(X=>this.addKeyword(X))}function V(T,k,I){const R=T.rules.findIndex(S=>S.keyword===I);R>=0?T.rules.splice(R,0,k):(T.rules.push(k),this.logger.warn(`rule ${I} is not defined`))}function W(T){let{metaSchema:k}=T;k!==void 0&&(T.$data&&this.opts.$data&&(k=A(k)),T.validateSchema=this.compile(k,!0))}const M={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function A(T){return{anyOf:[T,M]}}})(ef);var pf={},El={},mf={};Object.defineProperty(mf,"__esModule",{value:!0});const QM={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};mf.default=QM;var yn={};Object.defineProperty(yn,"__esModule",{value:!0});yn.callRef=yn.getValidate=void 0;const ZM=Cr,Im=ae,tt=ie,Mr=gt,Rm=Qe,bs=ee,JM={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:r}=e,{baseId:o,schemaEnv:i,validateName:s,opts:a,self:l}=r,{root:u}=i;if((n==="#"||n==="#/")&&o===u.baseId)return c();const d=Rm.resolveRef.call(l,u,o,n);if(d===void 0)throw new ZM.default(r.opts.uriResolver,o,n);if(d instanceof Rm.SchemaEnv)return f(d);return p(d);function c(){if(i===u)return na(e,s,i,i.$async);const g=t.scopeValue("root",{ref:u});return na(e,(0,tt._)`${g}.validate`,u,u.$async)}function f(g){const v=Q1(e,g);na(e,v,g,g.$async)}function p(g){const v=t.scopeValue("schema",a.code.source===!0?{ref:g,code:(0,tt.stringify)(g)}:{ref:g}),w=t.name("valid"),h=e.subschema({schema:g,dataTypes:[],schemaPath:tt.nil,topSchemaRef:v,errSchemaPath:n},w);e.mergeEvaluated(h),e.ok(w)}}};function Q1(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):(0,tt._)`${n.scopeValue("wrapper",{ref:t})}.validate`}yn.getValidate=Q1;function na(e,t,n,r){const{gen:o,it:i}=e,{allErrors:s,schemaEnv:a,opts:l}=i,u=l.passContext?Mr.default.this:tt.nil;r?d():c();function d(){if(!a.$async)throw new Error("async schema referenced by sync schema");const g=o.let("valid");o.try(()=>{o.code((0,tt._)`await ${(0,Im.callValidateCode)(e,t,u)}`),p(t),s||o.assign(g,!0)},v=>{o.if((0,tt._)`!(${v} instanceof ${i.ValidationError})`,()=>o.throw(v)),f(v),s||o.assign(g,!1)}),e.ok(g)}function c(){e.result((0,Im.callValidateCode)(e,t,u),()=>p(t),()=>f(t))}function f(g){const v=(0,tt._)`${g}.errors`;o.assign(Mr.default.vErrors,(0,tt._)`${Mr.default.vErrors} === null ? ${v} : ${Mr.default.vErrors}.concat(${v})`),o.assign(Mr.default.errors,(0,tt._)`${Mr.default.vErrors}.length`)}function p(g){var v;if(!i.opts.unevaluated)return;const w=(v=n==null?void 0:n.validate)===null||v===void 0?void 0:v.evaluated;if(i.props!==!0)if(w&&!w.dynamicProps)w.props!==void 0&&(i.props=bs.mergeEvaluated.props(o,w.props,i.props));else{const h=o.var("props",(0,tt._)`${g}.evaluated.props`);i.props=bs.mergeEvaluated.props(o,h,i.props,tt.Name)}if(i.items!==!0)if(w&&!w.dynamicItems)w.items!==void 0&&(i.items=bs.mergeEvaluated.items(o,w.items,i.items));else{const h=o.var("items",(0,tt._)`${g}.evaluated.items`);i.items=bs.mergeEvaluated.items(o,h,i.items,tt.Name)}}}yn.callRef=na;yn.default=JM;Object.defineProperty(El,"__esModule",{value:!0});const eT=mf,tT=yn,nT=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",eT.default,tT.default];El.default=nT;var kl={},gf={};Object.defineProperty(gf,"__esModule",{value:!0});const Ha=ie,kn=Ha.operators,Ba={maximum:{okStr:"<=",ok:kn.LTE,fail:kn.GT},minimum:{okStr:">=",ok:kn.GTE,fail:kn.LT},exclusiveMaximum:{okStr:"<",ok:kn.LT,fail:kn.GTE},exclusiveMinimum:{okStr:">",ok:kn.GT,fail:kn.LTE}},rT={message:({keyword:e,schemaCode:t})=>(0,Ha.str)`must be ${Ba[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Ha._)`{comparison: ${Ba[e].okStr}, limit: ${t}}`},oT={keyword:Object.keys(Ba),type:"number",schemaType:"number",$data:!0,error:rT,code(e){const{keyword:t,data:n,schemaCode:r}=e;e.fail$data((0,Ha._)`${n} ${Ba[t].fail} ${r} || isNaN(${n})`)}};gf.default=oT;var yf={};Object.defineProperty(yf,"__esModule",{value:!0});const li=ie,iT={message:({schemaCode:e})=>(0,li.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,li._)`{multipleOf: ${e}}`},sT={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:iT,code(e){const{gen:t,data:n,schemaCode:r,it:o}=e,i=o.opts.multipleOfPrecision,s=t.let("res"),a=i?(0,li._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:(0,li._)`${s} !== parseInt(${s})`;e.fail$data((0,li._)`(${r} === 0 || (${s} = ${n}/${r}, ${a}))`)}};yf.default=sT;var vf={},wf={};Object.defineProperty(wf,"__esModule",{value:!0});function Z1(e){const t=e.length;let n=0,r=0,o;for(;r<t;)n++,o=e.charCodeAt(r++),o>=55296&&o<=56319&&r<t&&(o=e.charCodeAt(r),(o&64512)===56320&&r++);return n}wf.default=Z1;Z1.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(vf,"__esModule",{value:!0});const nr=ie,aT=ee,lT=wf,uT={message({keyword:e,schemaCode:t}){const n=e==="maxLength"?"more":"fewer";return(0,nr.str)`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>(0,nr._)`{limit: ${e}}`},cT={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:uT,code(e){const{keyword:t,data:n,schemaCode:r,it:o}=e,i=t==="maxLength"?nr.operators.GT:nr.operators.LT,s=o.opts.unicode===!1?(0,nr._)`${n}.length`:(0,nr._)`${(0,aT.useFunc)(e.gen,lT.default)}(${n})`;e.fail$data((0,nr._)`${s} ${i} ${r}`)}};vf.default=cT;var _f={};Object.defineProperty(_f,"__esModule",{value:!0});const dT=ae,fT=ee,Kr=ie,hT={message:({schemaCode:e})=>(0,Kr.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Kr._)`{pattern: ${e}}`},pT={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:hT,code(e){const{gen:t,data:n,$data:r,schema:o,schemaCode:i,it:s}=e,a=s.opts.unicodeRegExp?"u":"";if(r){const{regExp:l}=s.opts.code,u=l.code==="new RegExp"?(0,Kr._)`new RegExp`:(0,fT.useFunc)(t,l),d=t.let("valid");t.try(()=>t.assign(d,(0,Kr._)`${u}(${i}, ${a}).test(${n})`),()=>t.assign(d,!1)),e.fail$data((0,Kr._)`!${d}`)}else{const l=(0,dT.usePattern)(e,o);e.fail$data((0,Kr._)`!${l}.test(${n})`)}}};_f.default=pT;var $f={};Object.defineProperty($f,"__esModule",{value:!0});const ui=ie,mT={message({keyword:e,schemaCode:t}){const n=e==="maxProperties"?"more":"fewer";return(0,ui.str)`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>(0,ui._)`{limit: ${e}}`},gT={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:mT,code(e){const{keyword:t,data:n,schemaCode:r}=e,o=t==="maxProperties"?ui.operators.GT:ui.operators.LT;e.fail$data((0,ui._)`Object.keys(${n}).length ${o} ${r}`)}};$f.default=gT;var xf={};Object.defineProperty(xf,"__esModule",{value:!0});const Ho=ae,ci=ie,yT=ee,vT={message:({params:{missingProperty:e}})=>(0,ci.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,ci._)`{missingProperty: ${e}}`},wT={keyword:"required",type:"object",schemaType:"array",$data:!0,error:vT,code(e){const{gen:t,schema:n,schemaCode:r,data:o,$data:i,it:s}=e,{opts:a}=s;if(!i&&n.length===0)return;const l=n.length>=a.loopRequired;if(s.allErrors?u():d(),a.strictRequired){const p=e.parentSchema.properties,{definedProperties:g}=e.it;for(const v of n)if((p==null?void 0:p[v])===void 0&&!g.has(v)){const w=s.schemaEnv.baseId+s.errSchemaPath,h=`required property "${v}" is not defined at "${w}" (strictRequired)`;(0,yT.checkStrictMode)(s,h,s.opts.strictRequired)}}function u(){if(l||i)e.block$data(ci.nil,c);else for(const p of n)(0,Ho.checkReportMissingProp)(e,p)}function d(){const p=t.let("missing");if(l||i){const g=t.let("valid",!0);e.block$data(g,()=>f(p,g)),e.ok(g)}else t.if((0,Ho.checkMissingProp)(e,n,p)),(0,Ho.reportMissingProp)(e,p),t.else()}function c(){t.forOf("prop",r,p=>{e.setParams({missingProperty:p}),t.if((0,Ho.noPropertyInData)(t,o,p,a.ownProperties),()=>e.error())})}function f(p,g){e.setParams({missingProperty:p}),t.forOf(p,r,()=>{t.assign(g,(0,Ho.propertyInData)(t,o,p,a.ownProperties)),t.if((0,ci.not)(g),()=>{e.error(),t.break()})},ci.nil)}}};xf.default=wT;var Sf={};Object.defineProperty(Sf,"__esModule",{value:!0});const di=ie,_T={message({keyword:e,schemaCode:t}){const n=e==="maxItems"?"more":"fewer";return(0,di.str)`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>(0,di._)`{limit: ${e}}`},$T={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:_T,code(e){const{keyword:t,data:n,schemaCode:r}=e,o=t==="maxItems"?di.operators.GT:di.operators.LT;e.fail$data((0,di._)`${n}.length ${o} ${r}`)}};Sf.default=$T;var Ef={},Ji={};Object.defineProperty(Ji,"__esModule",{value:!0});const J1=j1;J1.code='require("ajv/dist/runtime/equal").default';Ji.default=J1;Object.defineProperty(Ef,"__esModule",{value:!0});const yu=ze,Ve=ie,xT=ee,ST=Ji,ET={message:({params:{i:e,j:t}})=>(0,Ve.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,Ve._)`{i: ${e}, j: ${t}}`},kT={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:ET,code(e){const{gen:t,data:n,$data:r,schema:o,parentSchema:i,schemaCode:s,it:a}=e;if(!r&&!o)return;const l=t.let("valid"),u=i.items?(0,yu.getSchemaTypes)(i.items):[];e.block$data(l,d,(0,Ve._)`${s} === false`),e.ok(l);function d(){const g=t.let("i",(0,Ve._)`${n}.length`),v=t.let("j");e.setParams({i:g,j:v}),t.assign(l,!0),t.if((0,Ve._)`${g} > 1`,()=>(c()?f:p)(g,v))}function c(){return u.length>0&&!u.some(g=>g==="object"||g==="array")}function f(g,v){const w=t.name("item"),h=(0,yu.checkDataTypes)(u,w,a.opts.strictNumbers,yu.DataType.Wrong),m=t.const("indices",(0,Ve._)`{}`);t.for((0,Ve._)`;${g}--;`,()=>{t.let(w,(0,Ve._)`${n}[${g}]`),t.if(h,(0,Ve._)`continue`),u.length>1&&t.if((0,Ve._)`typeof ${w} == "string"`,(0,Ve._)`${w} += "_"`),t.if((0,Ve._)`typeof ${m}[${w}] == "number"`,()=>{t.assign(v,(0,Ve._)`${m}[${w}]`),e.error(),t.assign(l,!1).break()}).code((0,Ve._)`${m}[${w}] = ${g}`)})}function p(g,v){const w=(0,xT.useFunc)(t,ST.default),h=t.name("outer");t.label(h).for((0,Ve._)`;${g}--;`,()=>t.for((0,Ve._)`${v} = ${g}; ${v}--;`,()=>t.if((0,Ve._)`${w}(${n}[${g}], ${n}[${v}])`,()=>{e.error(),t.assign(l,!1).break(h)})))}}};Ef.default=kT;var kf={};Object.defineProperty(kf,"__esModule",{value:!0});const zc=ie,NT=ee,PT=Ji,CT={message:"must be equal to constant",params:({schemaCode:e})=>(0,zc._)`{allowedValue: ${e}}`},bT={keyword:"const",$data:!0,error:CT,code(e){const{gen:t,data:n,$data:r,schemaCode:o,schema:i}=e;r||i&&typeof i=="object"?e.fail$data((0,zc._)`!${(0,NT.useFunc)(t,PT.default)}(${n}, ${o})`):e.fail((0,zc._)`${i} !== ${n}`)}};kf.default=bT;var Nf={};Object.defineProperty(Nf,"__esModule",{value:!0});const Go=ie,jT=ee,MT=Ji,TT={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,Go._)`{allowedValues: ${e}}`},IT={keyword:"enum",schemaType:"array",$data:!0,error:TT,code(e){const{gen:t,data:n,$data:r,schema:o,schemaCode:i,it:s}=e;if(!r&&o.length===0)throw new Error("enum must have non-empty array");const a=o.length>=s.opts.loopEnum;let l;const u=()=>l??(l=(0,jT.useFunc)(t,MT.default));let d;if(a||r)d=t.let("valid"),e.block$data(d,c);else{if(!Array.isArray(o))throw new Error("ajv implementation error");const p=t.const("vSchema",i);d=(0,Go.or)(...o.map((g,v)=>f(p,v)))}e.pass(d);function c(){t.assign(d,!1),t.forOf("v",i,p=>t.if((0,Go._)`${u()}(${n}, ${p})`,()=>t.assign(d,!0).break()))}function f(p,g){const v=o[g];return typeof v=="object"&&v!==null?(0,Go._)`${u()}(${n}, ${p}[${g}])`:(0,Go._)`${n} === ${v}`}}};Nf.default=IT;Object.defineProperty(kl,"__esModule",{value:!0});const RT=gf,zT=yf,AT=vf,OT=_f,DT=$f,LT=xf,VT=Sf,FT=Ef,HT=kf,BT=Nf,UT=[RT.default,zT.default,AT.default,OT.default,DT.default,LT.default,VT.default,FT.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},HT.default,BT.default];kl.default=UT;var Nl={},ko={};Object.defineProperty(ko,"__esModule",{value:!0});ko.validateAdditionalItems=void 0;const rr=ie,Ac=ee,qT={message:({params:{len:e}})=>(0,rr.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,rr._)`{limit: ${e}}`},WT={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:qT,code(e){const{parentSchema:t,it:n}=e,{items:r}=t;if(!Array.isArray(r)){(0,Ac.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}ew(e,r)}};function ew(e,t){const{gen:n,schema:r,data:o,keyword:i,it:s}=e;s.items=!0;const a=n.const("len",(0,rr._)`${o}.length`);if(r===!1)e.setParams({len:t.length}),e.pass((0,rr._)`${a} <= ${t.length}`);else if(typeof r=="object"&&!(0,Ac.alwaysValidSchema)(s,r)){const u=n.var("valid",(0,rr._)`${a} <= ${t.length}`);n.if((0,rr.not)(u),()=>l(u)),e.ok(u)}function l(u){n.forRange("i",t.length,a,d=>{e.subschema({keyword:i,dataProp:d,dataPropType:Ac.Type.Num},u),s.allErrors||n.if((0,rr.not)(u),()=>n.break())})}}ko.validateAdditionalItems=ew;ko.default=WT;var Pf={},No={};Object.defineProperty(No,"__esModule",{value:!0});No.validateTuple=void 0;const zm=ie,ra=ee,KT=ae,XT={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return tw(e,"additionalItems",t);n.items=!0,!(0,ra.alwaysValidSchema)(n,t)&&e.ok((0,KT.validateArray)(e))}};function tw(e,t,n=e.schema){const{gen:r,parentSchema:o,data:i,keyword:s,it:a}=e;d(o),a.opts.unevaluated&&n.length&&a.items!==!0&&(a.items=ra.mergeEvaluated.items(r,n.length,a.items));const l=r.name("valid"),u=r.const("len",(0,zm._)`${i}.length`);n.forEach((c,f)=>{(0,ra.alwaysValidSchema)(a,c)||(r.if((0,zm._)`${u} > ${f}`,()=>e.subschema({keyword:s,schemaProp:f,dataProp:f},l)),e.ok(l))});function d(c){const{opts:f,errSchemaPath:p}=a,g=n.length,v=g===c.minItems&&(g===c.maxItems||c[t]===!1);if(f.strictTuples&&!v){const w=`"${s}" is ${g}-tuple, but minItems or maxItems/${t} are not specified or different at path "${p}"`;(0,ra.checkStrictMode)(a,w,f.strictTuples)}}}No.validateTuple=tw;No.default=XT;Object.defineProperty(Pf,"__esModule",{value:!0});const YT=No,GT={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,YT.validateTuple)(e,"items")};Pf.default=GT;var Cf={};Object.defineProperty(Cf,"__esModule",{value:!0});const Am=ie,QT=ee,ZT=ae,JT=ko,eI={message:({params:{len:e}})=>(0,Am.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Am._)`{limit: ${e}}`},tI={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:eI,code(e){const{schema:t,parentSchema:n,it:r}=e,{prefixItems:o}=n;r.items=!0,!(0,QT.alwaysValidSchema)(r,t)&&(o?(0,JT.validateAdditionalItems)(e,o):e.ok((0,ZT.validateArray)(e)))}};Cf.default=tI;var bf={};Object.defineProperty(bf,"__esModule",{value:!0});const _t=ie,js=ee,nI={message:({params:{min:e,max:t}})=>t===void 0?(0,_t.str)`must contain at least ${e} valid item(s)`:(0,_t.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,_t._)`{minContains: ${e}}`:(0,_t._)`{minContains: ${e}, maxContains: ${t}}`},rI={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:nI,code(e){const{gen:t,schema:n,parentSchema:r,data:o,it:i}=e;let s,a;const{minContains:l,maxContains:u}=r;i.opts.next?(s=l===void 0?1:l,a=u):s=1;const d=t.const("len",(0,_t._)`${o}.length`);if(e.setParams({min:s,max:a}),a===void 0&&s===0){(0,js.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,js.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,js.alwaysValidSchema)(i,n)){let v=(0,_t._)`${d} >= ${s}`;a!==void 0&&(v=(0,_t._)`${v} && ${d} <= ${a}`),e.pass(v);return}i.items=!0;const c=t.name("valid");a===void 0&&s===1?p(c,()=>t.if(c,()=>t.break())):s===0?(t.let(c,!0),a!==void 0&&t.if((0,_t._)`${o}.length > 0`,f)):(t.let(c,!1),f()),e.result(c,()=>e.reset());function f(){const v=t.name("_valid"),w=t.let("count",0);p(v,()=>t.if(v,()=>g(w)))}function p(v,w){t.forRange("i",0,d,h=>{e.subschema({keyword:"contains",dataProp:h,dataPropType:js.Type.Num,compositeRule:!0},v),w()})}function g(v){t.code((0,_t._)`${v}++`),a===void 0?t.if((0,_t._)`${v} >= ${s}`,()=>t.assign(c,!0).break()):(t.if((0,_t._)`${v} > ${a}`,()=>t.assign(c,!1).break()),s===1?t.assign(c,!0):t.if((0,_t._)`${v} >= ${s}`,()=>t.assign(c,!0)))}}};bf.default=rI;var Pl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=ie,n=ee,r=ae;e.error={message:({params:{property:l,depsCount:u,deps:d}})=>{const c=u===1?"property":"properties";return(0,t.str)`must have ${c} ${d} when property ${l} is present`},params:({params:{property:l,depsCount:u,deps:d,missingProperty:c}})=>(0,t._)`{property: ${l},
223
+ missingProperty: ${c},
224
+ depsCount: ${u},
225
+ deps: ${d}}`};const o={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(l){const[u,d]=i(l);s(l,u),a(l,d)}};function i({schema:l}){const u={},d={};for(const c in l){if(c==="__proto__")continue;const f=Array.isArray(l[c])?u:d;f[c]=l[c]}return[u,d]}function s(l,u=l.schema){const{gen:d,data:c,it:f}=l;if(Object.keys(u).length===0)return;const p=d.let("missing");for(const g in u){const v=u[g];if(v.length===0)continue;const w=(0,r.propertyInData)(d,c,g,f.opts.ownProperties);l.setParams({property:g,depsCount:v.length,deps:v.join(", ")}),f.allErrors?d.if(w,()=>{for(const h of v)(0,r.checkReportMissingProp)(l,h)}):(d.if((0,t._)`${w} && (${(0,r.checkMissingProp)(l,v,p)})`),(0,r.reportMissingProp)(l,p),d.else())}}e.validatePropertyDeps=s;function a(l,u=l.schema){const{gen:d,data:c,keyword:f,it:p}=l,g=d.name("valid");for(const v in u)(0,n.alwaysValidSchema)(p,u[v])||(d.if((0,r.propertyInData)(d,c,v,p.opts.ownProperties),()=>{const w=l.subschema({keyword:f,schemaProp:v},g);l.mergeValidEvaluated(w,g)},()=>d.var(g,!0)),l.ok(g))}e.validateSchemaDeps=a,e.default=o})(Pl);var jf={};Object.defineProperty(jf,"__esModule",{value:!0});const nw=ie,oI=ee,iI={message:"property name must be valid",params:({params:e})=>(0,nw._)`{propertyName: ${e.propertyName}}`},sI={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:iI,code(e){const{gen:t,schema:n,data:r,it:o}=e;if((0,oI.alwaysValidSchema)(o,n))return;const i=t.name("valid");t.forIn("key",r,s=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),t.if((0,nw.not)(i),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(i)}};jf.default=sI;var Cl={};Object.defineProperty(Cl,"__esModule",{value:!0});const Ms=ae,Mt=ie,aI=gt,Ts=ee,lI={message:"must NOT have additional properties",params:({params:e})=>(0,Mt._)`{additionalProperty: ${e.additionalProperty}}`},uI={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:lI,code(e){const{gen:t,schema:n,parentSchema:r,data:o,errsCount:i,it:s}=e;if(!i)throw new Error("ajv implementation error");const{allErrors:a,opts:l}=s;if(s.props=!0,l.removeAdditional!=="all"&&(0,Ts.alwaysValidSchema)(s,n))return;const u=(0,Ms.allSchemaProperties)(r.properties),d=(0,Ms.allSchemaProperties)(r.patternProperties);c(),e.ok((0,Mt._)`${i} === ${aI.default.errors}`);function c(){t.forIn("key",o,w=>{!u.length&&!d.length?g(w):t.if(f(w),()=>g(w))})}function f(w){let h;if(u.length>8){const m=(0,Ts.schemaRefOrVal)(s,r.properties,"properties");h=(0,Ms.isOwnProperty)(t,m,w)}else u.length?h=(0,Mt.or)(...u.map(m=>(0,Mt._)`${w} === ${m}`)):h=Mt.nil;return d.length&&(h=(0,Mt.or)(h,...d.map(m=>(0,Mt._)`${(0,Ms.usePattern)(e,m)}.test(${w})`))),(0,Mt.not)(h)}function p(w){t.code((0,Mt._)`delete ${o}[${w}]`)}function g(w){if(l.removeAdditional==="all"||l.removeAdditional&&n===!1){p(w);return}if(n===!1){e.setParams({additionalProperty:w}),e.error(),a||t.break();return}if(typeof n=="object"&&!(0,Ts.alwaysValidSchema)(s,n)){const h=t.name("valid");l.removeAdditional==="failing"?(v(w,h,!1),t.if((0,Mt.not)(h),()=>{e.reset(),p(w)})):(v(w,h),a||t.if((0,Mt.not)(h),()=>t.break()))}}function v(w,h,m){const y={keyword:"additionalProperties",dataProp:w,dataPropType:Ts.Type.Str};m===!1&&Object.assign(y,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(y,h)}}};Cl.default=uI;var Mf={};Object.defineProperty(Mf,"__esModule",{value:!0});const cI=Zi(),Om=ae,vu=ee,Dm=Cl,dI={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,parentSchema:r,data:o,it:i}=e;i.opts.removeAdditional==="all"&&r.additionalProperties===void 0&&Dm.default.code(new cI.KeywordCxt(i,Dm.default,"additionalProperties"));const s=(0,Om.allSchemaProperties)(n);for(const c of s)i.definedProperties.add(c);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=vu.mergeEvaluated.props(t,(0,vu.toHash)(s),i.props));const a=s.filter(c=>!(0,vu.alwaysValidSchema)(i,n[c]));if(a.length===0)return;const l=t.name("valid");for(const c of a)u(c)?d(c):(t.if((0,Om.propertyInData)(t,o,c,i.opts.ownProperties)),d(c),i.allErrors||t.else().var(l,!0),t.endIf()),e.it.definedProperties.add(c),e.ok(l);function u(c){return i.opts.useDefaults&&!i.compositeRule&&n[c].default!==void 0}function d(c){e.subschema({keyword:"properties",schemaProp:c,dataProp:c},l)}}};Mf.default=dI;var Tf={};Object.defineProperty(Tf,"__esModule",{value:!0});const Lm=ae,Is=ie,Vm=ee,Fm=ee,fI={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,data:r,parentSchema:o,it:i}=e,{opts:s}=i,a=(0,Lm.allSchemaProperties)(n),l=a.filter(v=>(0,Vm.alwaysValidSchema)(i,n[v]));if(a.length===0||l.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;const u=s.strictSchema&&!s.allowMatchingProperties&&o.properties,d=t.name("valid");i.props!==!0&&!(i.props instanceof Is.Name)&&(i.props=(0,Fm.evaluatedPropsToName)(t,i.props));const{props:c}=i;f();function f(){for(const v of a)u&&p(v),i.allErrors?g(v):(t.var(d,!0),g(v),t.if(d))}function p(v){for(const w in u)new RegExp(v).test(w)&&(0,Vm.checkStrictMode)(i,`property ${w} matches pattern ${v} (use allowMatchingProperties)`)}function g(v){t.forIn("key",r,w=>{t.if((0,Is._)`${(0,Lm.usePattern)(e,v)}.test(${w})`,()=>{const h=l.includes(v);h||e.subschema({keyword:"patternProperties",schemaProp:v,dataProp:w,dataPropType:Fm.Type.Str},d),i.opts.unevaluated&&c!==!0?t.assign((0,Is._)`${c}[${w}]`,!0):!h&&!i.allErrors&&t.if((0,Is.not)(d),()=>t.break())})})}}};Tf.default=fI;var If={};Object.defineProperty(If,"__esModule",{value:!0});const hI=ee,pI={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:r}=e;if((0,hI.alwaysValidSchema)(r,n)){e.fail();return}const o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};If.default=pI;var Rf={};Object.defineProperty(Rf,"__esModule",{value:!0});const mI=ae,gI={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:mI.validateUnion,error:{message:"must match a schema in anyOf"}};Rf.default=gI;var zf={};Object.defineProperty(zf,"__esModule",{value:!0});const oa=ie,yI=ee,vI={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,oa._)`{passingSchemas: ${e.passing}}`},wI={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:vI,code(e){const{gen:t,schema:n,parentSchema:r,it:o}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(o.opts.discriminator&&r.discriminator)return;const i=n,s=t.let("valid",!1),a=t.let("passing",null),l=t.name("_valid");e.setParams({passing:a}),t.block(u),e.result(s,()=>e.reset(),()=>e.error(!0));function u(){i.forEach((d,c)=>{let f;(0,yI.alwaysValidSchema)(o,d)?t.var(l,!0):f=e.subschema({keyword:"oneOf",schemaProp:c,compositeRule:!0},l),c>0&&t.if((0,oa._)`${l} && ${s}`).assign(s,!1).assign(a,(0,oa._)`[${a}, ${c}]`).else(),t.if(l,()=>{t.assign(s,!0),t.assign(a,c),f&&e.mergeEvaluated(f,oa.Name)})})}}};zf.default=wI;var Af={};Object.defineProperty(Af,"__esModule",{value:!0});const _I=ee,$I={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:r}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const o=t.name("valid");n.forEach((i,s)=>{if((0,_I.alwaysValidSchema)(r,i))return;const a=e.subschema({keyword:"allOf",schemaProp:s},o);e.ok(o),e.mergeEvaluated(a)})}};Af.default=$I;var Of={};Object.defineProperty(Of,"__esModule",{value:!0});const Ua=ie,rw=ee,xI={message:({params:e})=>(0,Ua.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Ua._)`{failingKeyword: ${e.ifClause}}`},SI={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:xI,code(e){const{gen:t,parentSchema:n,it:r}=e;n.then===void 0&&n.else===void 0&&(0,rw.checkStrictMode)(r,'"if" without "then" and "else" is ignored');const o=Hm(r,"then"),i=Hm(r,"else");if(!o&&!i)return;const s=t.let("valid",!0),a=t.name("_valid");if(l(),e.reset(),o&&i){const d=t.let("ifClause");e.setParams({ifClause:d}),t.if(a,u("then",d),u("else",d))}else o?t.if(a,u("then")):t.if((0,Ua.not)(a),u("else"));e.pass(s,()=>e.error(!0));function l(){const d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(d)}function u(d,c){return()=>{const f=e.subschema({keyword:d},a);t.assign(s,a),e.mergeValidEvaluated(f,s),c?t.assign(c,(0,Ua._)`${d}`):e.setParams({ifClause:d})}}}};function Hm(e,t){const n=e.schema[t];return n!==void 0&&!(0,rw.alwaysValidSchema)(e,n)}Of.default=SI;var Df={};Object.defineProperty(Df,"__esModule",{value:!0});const EI=ee,kI={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){t.if===void 0&&(0,EI.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};Df.default=kI;Object.defineProperty(Nl,"__esModule",{value:!0});const NI=ko,PI=Pf,CI=No,bI=Cf,jI=bf,MI=Pl,TI=jf,II=Cl,RI=Mf,zI=Tf,AI=If,OI=Rf,DI=zf,LI=Af,VI=Of,FI=Df;function HI(e=!1){const t=[AI.default,OI.default,DI.default,LI.default,VI.default,FI.default,TI.default,II.default,MI.default,RI.default,zI.default];return e?t.push(PI.default,bI.default):t.push(NI.default,CI.default),t.push(jI.default),t}Nl.default=HI;var Lf={},Po={};Object.defineProperty(Po,"__esModule",{value:!0});Po.dynamicAnchor=void 0;const wu=ie,BI=gt,Bm=Qe,UI=yn,qI={keyword:"$dynamicAnchor",schemaType:"string",code:e=>ow(e,e.schema)};function ow(e,t){const{gen:n,it:r}=e;r.schemaEnv.root.dynamicAnchors[t]=!0;const o=(0,wu._)`${BI.default.dynamicAnchors}${(0,wu.getProperty)(t)}`,i=r.errSchemaPath==="#"?r.validateName:WI(e);n.if((0,wu._)`!${o}`,()=>n.assign(o,i))}Po.dynamicAnchor=ow;function WI(e){const{schemaEnv:t,schema:n,self:r}=e.it,{root:o,baseId:i,localRefs:s,meta:a}=t.root,{schemaId:l}=r.opts,u=new Bm.SchemaEnv({schema:n,schemaId:l,root:o,baseId:i,localRefs:s,meta:a});return Bm.compileSchema.call(r,u),(0,UI.getValidate)(e,u)}Po.default=qI;var Co={};Object.defineProperty(Co,"__esModule",{value:!0});Co.dynamicRef=void 0;const Um=ie,KI=gt,qm=yn,XI={keyword:"$dynamicRef",schemaType:"string",code:e=>iw(e,e.schema)};function iw(e,t){const{gen:n,keyword:r,it:o}=e;if(t[0]!=="#")throw new Error(`"${r}" only supports hash fragment reference`);const i=t.slice(1);if(o.allErrors)s();else{const l=n.let("valid",!1);s(l),e.ok(l)}function s(l){if(o.schemaEnv.root.dynamicAnchors[i]){const u=n.let("_v",(0,Um._)`${KI.default.dynamicAnchors}${(0,Um.getProperty)(i)}`);n.if(u,a(u,l),a(o.validateName,l))}else a(o.validateName,l)()}function a(l,u){return u?()=>n.block(()=>{(0,qm.callRef)(e,l),n.let(u,!0)}):()=>(0,qm.callRef)(e,l)}}Co.dynamicRef=iw;Co.default=XI;var Vf={};Object.defineProperty(Vf,"__esModule",{value:!0});const YI=Po,GI=ee,QI={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,YI.dynamicAnchor)(e,""):(0,GI.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}};Vf.default=QI;var Ff={};Object.defineProperty(Ff,"__esModule",{value:!0});const ZI=Co,JI={keyword:"$recursiveRef",schemaType:"string",code:e=>(0,ZI.dynamicRef)(e,e.schema)};Ff.default=JI;Object.defineProperty(Lf,"__esModule",{value:!0});const e4=Po,t4=Co,n4=Vf,r4=Ff,o4=[e4.default,t4.default,n4.default,r4.default];Lf.default=o4;var Hf={},Bf={};Object.defineProperty(Bf,"__esModule",{value:!0});const Wm=Pl,i4={keyword:"dependentRequired",type:"object",schemaType:"object",error:Wm.error,code:e=>(0,Wm.validatePropertyDeps)(e)};Bf.default=i4;var Uf={};Object.defineProperty(Uf,"__esModule",{value:!0});const s4=Pl,a4={keyword:"dependentSchemas",type:"object",schemaType:"object",code:e=>(0,s4.validateSchemaDeps)(e)};Uf.default=a4;var qf={};Object.defineProperty(qf,"__esModule",{value:!0});const l4=ee,u4={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:n}){t.contains===void 0&&(0,l4.checkStrictMode)(n,`"${e}" without "contains" is ignored`)}};qf.default=u4;Object.defineProperty(Hf,"__esModule",{value:!0});const c4=Bf,d4=Uf,f4=qf,h4=[c4.default,d4.default,f4.default];Hf.default=h4;var Wf={},Kf={};Object.defineProperty(Kf,"__esModule",{value:!0});const Nn=ie,Km=ee,p4=gt,m4={message:"must NOT have unevaluated properties",params:({params:e})=>(0,Nn._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},g4={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:m4,code(e){const{gen:t,schema:n,data:r,errsCount:o,it:i}=e;if(!o)throw new Error("ajv implementation error");const{allErrors:s,props:a}=i;a instanceof Nn.Name?t.if((0,Nn._)`${a} !== true`,()=>t.forIn("key",r,c=>t.if(u(a,c),()=>l(c)))):a!==!0&&t.forIn("key",r,c=>a===void 0?l(c):t.if(d(a,c),()=>l(c))),i.props=!0,e.ok((0,Nn._)`${o} === ${p4.default.errors}`);function l(c){if(n===!1){e.setParams({unevaluatedProperty:c}),e.error(),s||t.break();return}if(!(0,Km.alwaysValidSchema)(i,n)){const f=t.name("valid");e.subschema({keyword:"unevaluatedProperties",dataProp:c,dataPropType:Km.Type.Str},f),s||t.if((0,Nn.not)(f),()=>t.break())}}function u(c,f){return(0,Nn._)`!${c} || !${c}[${f}]`}function d(c,f){const p=[];for(const g in c)c[g]===!0&&p.push((0,Nn._)`${f} !== ${g}`);return(0,Nn.and)(...p)}}};Kf.default=g4;var Xf={};Object.defineProperty(Xf,"__esModule",{value:!0});const or=ie,Xm=ee,y4={message:({params:{len:e}})=>(0,or.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,or._)`{limit: ${e}}`},v4={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:y4,code(e){const{gen:t,schema:n,data:r,it:o}=e,i=o.items||0;if(i===!0)return;const s=t.const("len",(0,or._)`${r}.length`);if(n===!1)e.setParams({len:i}),e.fail((0,or._)`${s} > ${i}`);else if(typeof n=="object"&&!(0,Xm.alwaysValidSchema)(o,n)){const l=t.var("valid",(0,or._)`${s} <= ${i}`);t.if((0,or.not)(l),()=>a(l,i)),e.ok(l)}o.items=!0;function a(l,u){t.forRange("i",u,s,d=>{e.subschema({keyword:"unevaluatedItems",dataProp:d,dataPropType:Xm.Type.Num},l),o.allErrors||t.if((0,or.not)(l),()=>t.break())})}}};Xf.default=v4;Object.defineProperty(Wf,"__esModule",{value:!0});const w4=Kf,_4=Xf,$4=[w4.default,_4.default];Wf.default=$4;var bl={},Yf={};Object.defineProperty(Yf,"__esModule",{value:!0});const be=ie,x4={message:({schemaCode:e})=>(0,be.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,be._)`{format: ${e}}`},S4={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:x4,code(e,t){const{gen:n,data:r,$data:o,schema:i,schemaCode:s,it:a}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:c}=a;if(!l.validateFormats)return;o?f():p();function f(){const g=n.scopeValue("formats",{ref:c.formats,code:l.code.formats}),v=n.const("fDef",(0,be._)`${g}[${s}]`),w=n.let("fType"),h=n.let("format");n.if((0,be._)`typeof ${v} == "object" && !(${v} instanceof RegExp)`,()=>n.assign(w,(0,be._)`${v}.type || "string"`).assign(h,(0,be._)`${v}.validate`),()=>n.assign(w,(0,be._)`"string"`).assign(h,v)),e.fail$data((0,be.or)(m(),y()));function m(){return l.strictSchema===!1?be.nil:(0,be._)`${s} && !${h}`}function y(){const _=d.$async?(0,be._)`(${v}.async ? await ${h}(${r}) : ${h}(${r}))`:(0,be._)`${h}(${r})`,x=(0,be._)`(typeof ${h} == "function" ? ${_} : ${h}.test(${r}))`;return(0,be._)`${h} && ${h} !== true && ${w} === ${t} && !${x}`}}function p(){const g=c.formats[i];if(!g){m();return}if(g===!0)return;const[v,w,h]=y(g);v===t&&e.pass(_());function m(){if(l.strictSchema===!1){c.logger.warn(x());return}throw new Error(x());function x(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function y(x){const N=x instanceof RegExp?(0,be.regexpCode)(x):l.code.formats?(0,be._)`${l.code.formats}${(0,be.getProperty)(i)}`:void 0,C=n.scopeValue("formats",{key:i,ref:x,code:N});return typeof x=="object"&&!(x instanceof RegExp)?[x.type||"string",x.validate,(0,be._)`${C}.validate`]:["string",x,C]}function _(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!d.$async)throw new Error("async format in sync schema");return(0,be._)`await ${h}(${r})`}return typeof w=="function"?(0,be._)`${h}(${r})`:(0,be._)`${h}.test(${r})`}}}};Yf.default=S4;Object.defineProperty(bl,"__esModule",{value:!0});const E4=Yf,k4=[E4.default];bl.default=k4;var kr={};Object.defineProperty(kr,"__esModule",{value:!0});kr.contentVocabulary=kr.metadataVocabulary=void 0;kr.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];kr.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(pf,"__esModule",{value:!0});const N4=El,P4=kl,C4=Nl,b4=Lf,j4=Hf,M4=Wf,T4=bl,Ym=kr,I4=[b4.default,N4.default,P4.default,(0,C4.default)(!0),T4.default,Ym.metadataVocabulary,Ym.contentVocabulary,j4.default,M4.default];pf.default=I4;var jl={},Ml={};Object.defineProperty(Ml,"__esModule",{value:!0});Ml.DiscrError=void 0;var Gm;(function(e){e.Tag="tag",e.Mapping="mapping"})(Gm||(Ml.DiscrError=Gm={}));Object.defineProperty(jl,"__esModule",{value:!0});const Tr=ie,Oc=Ml,Qm=Qe,R4=Cr,z4=ee,A4={message:({params:{discrError:e,tagName:t}})=>e===Oc.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>(0,Tr._)`{error: ${e}, tag: ${n}, tagValue: ${t}}`},O4={keyword:"discriminator",type:"object",schemaType:"object",error:A4,code(e){const{gen:t,data:n,schema:r,parentSchema:o,it:i}=e,{oneOf:s}=o;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");const a=r.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(r.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");const l=t.let("valid",!1),u=t.const("tag",(0,Tr._)`${n}${(0,Tr.getProperty)(a)}`);t.if((0,Tr._)`typeof ${u} == "string"`,()=>d(),()=>e.error(!1,{discrError:Oc.DiscrError.Tag,tag:u,tagName:a})),e.ok(l);function d(){const p=f();t.if(!1);for(const g in p)t.elseIf((0,Tr._)`${u} === ${g}`),t.assign(l,c(p[g]));t.else(),e.error(!1,{discrError:Oc.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function c(p){const g=t.name("valid"),v=e.subschema({keyword:"oneOf",schemaProp:p},g);return e.mergeEvaluated(v,Tr.Name),g}function f(){var p;const g={},v=h(o);let w=!0;for(let _=0;_<s.length;_++){let x=s[_];if(x!=null&&x.$ref&&!(0,z4.schemaHasRulesButRef)(x,i.self.RULES)){const C=x.$ref;if(x=Qm.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,C),x instanceof Qm.SchemaEnv&&(x=x.schema),x===void 0)throw new R4.default(i.opts.uriResolver,i.baseId,C)}const N=(p=x==null?void 0:x.properties)===null||p===void 0?void 0:p[a];if(typeof N!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);w=w&&(v||h(x)),m(N,_)}if(!w)throw new Error(`discriminator: "${a}" must be required`);return g;function h({required:_}){return Array.isArray(_)&&_.includes(a)}function m(_,x){if(_.const)y(_.const,x);else if(_.enum)for(const N of _.enum)y(N,x);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function y(_,x){if(typeof _!="string"||_ in g)throw new Error(`discriminator: "${a}" values must be unique strings`);g[_]=x}}}};jl.default=O4;var Gf={};const D4="https://json-schema.org/draft/2020-12/schema",L4="https://json-schema.org/draft/2020-12/schema",V4={"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},F4="meta",H4="Core and Validation specifications meta-schema",B4=[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],U4=["object","boolean"],q4="This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",W4={definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}},K4={$schema:D4,$id:L4,$vocabulary:V4,$dynamicAnchor:F4,title:H4,allOf:B4,type:U4,$comment:q4,properties:W4},X4="https://json-schema.org/draft/2020-12/schema",Y4="https://json-schema.org/draft/2020-12/meta/applicator",G4={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},Q4="meta",Z4="Applicator vocabulary meta-schema",J4=["object","boolean"],e3={prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},t3={schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}},n3={$schema:X4,$id:Y4,$vocabulary:G4,$dynamicAnchor:Q4,title:Z4,type:J4,properties:e3,$defs:t3},r3="https://json-schema.org/draft/2020-12/schema",o3="https://json-schema.org/draft/2020-12/meta/unevaluated",i3={"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},s3="meta",a3="Unevaluated applicator vocabulary meta-schema",l3=["object","boolean"],u3={unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}},c3={$schema:r3,$id:o3,$vocabulary:i3,$dynamicAnchor:s3,title:a3,type:l3,properties:u3},d3="https://json-schema.org/draft/2020-12/schema",f3="https://json-schema.org/draft/2020-12/meta/content",h3={"https://json-schema.org/draft/2020-12/vocab/content":!0},p3="meta",m3="Content vocabulary meta-schema",g3=["object","boolean"],y3={contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}},v3={$schema:d3,$id:f3,$vocabulary:h3,$dynamicAnchor:p3,title:m3,type:g3,properties:y3},w3="https://json-schema.org/draft/2020-12/schema",_3="https://json-schema.org/draft/2020-12/meta/core",$3={"https://json-schema.org/draft/2020-12/vocab/core":!0},x3="meta",S3="Core vocabulary meta-schema",E3=["object","boolean"],k3={$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},N3={anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}},P3={$schema:w3,$id:_3,$vocabulary:$3,$dynamicAnchor:x3,title:S3,type:E3,properties:k3,$defs:N3},C3="https://json-schema.org/draft/2020-12/schema",b3="https://json-schema.org/draft/2020-12/meta/format-annotation",j3={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},M3="meta",T3="Format vocabulary meta-schema for annotation results",I3=["object","boolean"],R3={format:{type:"string"}},z3={$schema:C3,$id:b3,$vocabulary:j3,$dynamicAnchor:M3,title:T3,type:I3,properties:R3},A3="https://json-schema.org/draft/2020-12/schema",O3="https://json-schema.org/draft/2020-12/meta/meta-data",D3={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},L3="meta",V3="Meta-data vocabulary meta-schema",F3=["object","boolean"],H3={title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}},B3={$schema:A3,$id:O3,$vocabulary:D3,$dynamicAnchor:L3,title:V3,type:F3,properties:H3},U3="https://json-schema.org/draft/2020-12/schema",q3="https://json-schema.org/draft/2020-12/meta/validation",W3={"https://json-schema.org/draft/2020-12/vocab/validation":!0},K3="meta",X3="Validation vocabulary meta-schema",Y3=["object","boolean"],G3={type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},Q3={nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Z3={$schema:U3,$id:q3,$vocabulary:W3,$dynamicAnchor:K3,title:X3,type:Y3,properties:G3,$defs:Q3};Object.defineProperty(Gf,"__esModule",{value:!0});const J3=K4,eR=n3,tR=c3,nR=v3,rR=P3,oR=z3,iR=B3,sR=Z3,aR=["/properties"];function lR(e){return[J3,eR,tR,nR,rR,t(this,oR),iR,t(this,sR)].forEach(n=>this.addMetaSchema(n,void 0,!1)),this;function t(n,r){return e?n.$dataMetaSchema(r,aR):r}}Gf.default=lR;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;const n=ef,r=pf,o=jl,i=Gf,s="https://json-schema.org/draft/2020-12/schema";class a extends n.default{constructor(p={}){super({...p,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),r.default.forEach(p=>this.addVocabulary(p)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:p,meta:g}=this.opts;g&&(i.default.call(this,p),this.refs["http://json-schema.org/schema"]=s)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}t.Ajv2020=a,e.exports=t=a,e.exports.Ajv2020=a,Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var l=Zi();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var u=ie;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=_l();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var c=Cr;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return c.default}})})(jc,jc.exports);var uR=jc.exports;const cR=qa(uR);var Dc={exports:{}},sw={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(b,j){return{validate:b,compare:j}}e.fullFormats={date:t(i,s),time:t(l(!0),u),"date-time":t(f(!0),p),"iso-time":t(l(),d),"iso-date-time":t(f(),g),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:h,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:q,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:y,int32:{type:"number",validate:N},int64:{type:"number",validate:C},float:{type:"number",validate:z},double:{type:"number",validate:z},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,s),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,d),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,g),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(b){return b%4===0&&(b%100!==0||b%400===0)}const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(b){const j=r.exec(b);if(!j)return!1;const B=+j[1],E=+j[2],H=+j[3];return E>=1&&E<=12&&H>=1&&H<=(E===2&&n(B)?29:o[E])}function s(b,j){if(b&&j)return b>j?1:b<j?-1:0}const a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function l(b){return function(B){const E=a.exec(B);if(!E)return!1;const H=+E[1],V=+E[2],W=+E[3],M=E[4],A=E[5]==="-"?-1:1,T=+(E[6]||0),k=+(E[7]||0);if(T>23||k>59||b&&!M)return!1;if(H<=23&&V<=59&&W<60)return!0;const I=V-k*A,R=H-T*A-(I<0?1:0);return(R===23||R===-1)&&(I===59||I===-1)&&W<61}}function u(b,j){if(!(b&&j))return;const B=new Date("2020-01-01T"+b).valueOf(),E=new Date("2020-01-01T"+j).valueOf();if(B&&E)return B-E}function d(b,j){if(!(b&&j))return;const B=a.exec(b),E=a.exec(j);if(B&&E)return b=B[1]+B[2]+B[3],j=E[1]+E[2]+E[3],b>j?1:b<j?-1:0}const c=/t|\s/i;function f(b){const j=l(b);return function(E){const H=E.split(c);return H.length===2&&i(H[0])&&j(H[1])}}function p(b,j){if(!(b&&j))return;const B=new Date(b).valueOf(),E=new Date(j).valueOf();if(B&&E)return B-E}function g(b,j){if(!(b&&j))return;const[B,E]=b.split(c),[H,V]=j.split(c),W=s(B,H);if(W!==void 0)return W||u(E,V)}const v=/\/|:/,w=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function h(b){return v.test(b)&&w.test(b)}const m=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function y(b){return m.lastIndex=0,m.test(b)}const _=-2147483648,x=2**31-1;function N(b){return Number.isInteger(b)&&b<=x&&b>=_}function C(b){return Number.isInteger(b)}function z(){return!0}const L=/[^\\]\\Z/;function q(b){if(L.test(b))return!1;try{return new RegExp(b),!0}catch{return!1}}})(sw);var aw={},Lc={exports:{}},Qf={};Object.defineProperty(Qf,"__esModule",{value:!0});const dR=El,fR=kl,hR=Nl,pR=bl,Zm=kr,mR=[dR.default,fR.default,(0,hR.default)(),pR.default,Zm.metadataVocabulary,Zm.contentVocabulary];Qf.default=mR;const gR="http://json-schema.org/draft-07/schema#",yR="http://json-schema.org/draft-07/schema#",vR="Core schema meta-schema",wR={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},_R=["object","boolean"],$R={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},xR={$schema:gR,$id:yR,title:vR,definitions:wR,type:_R,properties:$R,default:!0};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=ef,r=Qf,o=jl,i=xR,s=["/properties"],a="http://json-schema.org/draft-07/schema";class l extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(g=>this.addVocabulary(g)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const g=this.opts.$data?this.$dataMetaSchema(i,s):i;this.addMetaSchema(g,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}t.Ajv=l,e.exports=t=l,e.exports.Ajv=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var u=Zi();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=ie;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var c=_l();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return c.default}});var f=Cr;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return f.default}})})(Lc,Lc.exports);var SR=Lc.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=SR,n=ie,r=n.operators,o={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},i={message:({keyword:a,schemaCode:l})=>(0,n.str)`should be ${o[a].okStr} ${l}`,params:({keyword:a,schemaCode:l})=>(0,n._)`{comparison: ${o[a].okStr}, limit: ${l}}`};e.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:!0,error:i,code(a){const{gen:l,data:u,schemaCode:d,keyword:c,it:f}=a,{opts:p,self:g}=f;if(!p.validateFormats)return;const v=new t.KeywordCxt(f,g.RULES.all.format.definition,"format");v.$data?w():h();function w(){const y=l.scopeValue("formats",{ref:g.formats,code:p.code.formats}),_=l.const("fmt",(0,n._)`${y}[${v.schemaCode}]`);a.fail$data((0,n.or)((0,n._)`typeof ${_} != "object"`,(0,n._)`${_} instanceof RegExp`,(0,n._)`typeof ${_}.compare != "function"`,m(_)))}function h(){const y=v.schema,_=g.formats[y];if(!_||_===!0)return;if(typeof _!="object"||_ instanceof RegExp||typeof _.compare!="function")throw new Error(`"${c}": format "${y}" does not define "compare" function`);const x=l.scopeValue("formats",{key:y,ref:_,code:p.code.formats?(0,n._)`${p.code.formats}${(0,n.getProperty)(y)}`:void 0});a.fail$data(m(x))}function m(y){return(0,n._)`${y}.compare(${u}, ${d}) ${o[c].fail} 0`}},dependencies:["format"]};const s=a=>(a.addKeyword(e.formatLimitDefinition),a);e.default=s})(aw);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=sw,r=aw,o=ie,i=new o.Name("fullFormats"),s=new o.Name("fastFormats"),a=(u,d={keywords:!0})=>{if(Array.isArray(d))return l(u,d,n.fullFormats,i),u;const[c,f]=d.mode==="fast"?[n.fastFormats,s]:[n.fullFormats,i],p=d.formats||n.formatNames;return l(u,p,c,f),d.keywords&&(0,r.default)(u),u};a.get=(u,d="full")=>{const f=(d==="fast"?n.fastFormats:n.fullFormats)[u];if(!f)throw new Error(`Unknown format "${u}"`);return f};function l(u,d,c,f){var p,g;(p=(g=u.opts.code).formats)!==null&&p!==void 0||(g.formats=(0,o._)`require("ajv-formats/dist/formats").${f}`);for(const v of d)u.addFormat(v,c[v])}e.exports=t=a,Object.defineProperty(t,"__esModule",{value:!0}),t.default=a})(Dc,Dc.exports);var ER=Dc.exports;const kR=qa(ER),NR="https://json-schema.org/draft/2020-12/schema",PR="https://loom-spec.dev/schema/diagram-v1.json",CR="Loom Diagram",bR="A node-based architecture spec file.",jR="object",MR=["version","id","title","nodes","edges"],TR=!1,IR={$schema:{type:"string"},version:{const:"1"},id:{type:"string",pattern:"^[a-z0-9-]+$",description:"Diagram identifier. Should match the filename without extension."},title:{type:"string",minLength:1},description:{type:"string"},nodes:{type:"array",items:{$ref:"#/$defs/Node"}},edges:{type:"array",items:{$ref:"#/$defs/Edge"}},groups:{type:"array",items:{$ref:"#/$defs/Group"},default:[]}},RR={Node:{type:"object",required:["id","type","label","position","status"],additionalProperties:!1,properties:{id:{type:"string",pattern:"^[a-z0-9-]+$",description:"Unique within this diagram."},type:{type:"string",description:"References a key in node-types.json."},label:{type:"string",minLength:1,maxLength:60},description:{type:"string",description:"Markdown allowed."},position:{type:"object",required:["x","y"],additionalProperties:!1,properties:{x:{type:"number"},y:{type:"number"}}},status:{type:"string",enum:["planned","implemented","stale","deprecated"],description:"planned = spec exists, code does not. implemented = both present. stale = code refs are broken, needs review. deprecated = kept for history, no longer active."},code_refs:{type:"array",items:{$ref:"#/$defs/CodeRef"},default:[]},properties:{type:"object",description:"Custom fields defined by the node's type in node-types.json.",default:{}},tags:{type:"array",items:{type:"string"},default:[]},drill_down:{type:"string",pattern:"^[a-z0-9-]+$",description:"ID of another diagram file to navigate into when this node is opened."}}},Edge:{type:"object",required:["id","from","to","kind"],additionalProperties:!1,properties:{id:{type:"string",minLength:1},from:{type:"string",pattern:"^[a-z0-9-]+(:[a-z0-9_-]+)?$",description:"Source node id, optionally with :port-name suffix."},to:{type:"string",pattern:"^[a-z0-9-]+(:[a-z0-9_-]+)?$",description:"Target node id, optionally with :port-name suffix."},kind:{type:"string",enum:["request","event","data-read","data-write","signal","dependency","control"]},label:{type:"string",maxLength:60},description:{type:"string"},direction:{type:"string",enum:["forward","bidirectional"],default:"forward"}}},Group:{type:"object",required:["id","label"],additionalProperties:!1,properties:{id:{type:"string",pattern:"^[a-z0-9-]+$"},label:{type:"string",minLength:1},children:{type:"array",items:{type:"string"},description:"Node ids contained in this group.",default:[]},subgroups:{type:"array",items:{type:"string"},description:"Group ids nested inside this group.",default:[]},color:{type:"string",pattern:"^#[0-9a-fA-F]{6}$"},collapsed:{type:"boolean",default:!1},drill_down:{type:"string",pattern:"^[a-z0-9-]+$"}}},CodeRef:{type:"object",required:["path"],additionalProperties:!1,properties:{path:{type:"string",description:"Repo-relative file path."},symbol:{type:"string",description:"Function, class, or component name. Preferred over lines because it survives refactors."},lines:{type:"string",pattern:"^[0-9]+(-[0-9]+)?(,[0-9]+(-[0-9]+)?)*$",description:"Line range(s) like '1-80' or '12,45-50'. Use only when no symbol applies."}}}},zR={$schema:NR,$id:PR,title:CR,description:bR,type:jR,required:MR,additionalProperties:TR,properties:IR,$defs:RR},lw=new cR({allErrors:!0,strict:!1});kR(lw);const Jm=lw.compile(zR),AR={nodes:"node",edges:"edge",groups:"group"};function _u(e){return Jm(e)?[]:(Jm.errors??[]).map(n=>{var i;const r=n.instancePath??"",o=r.match(/^\/(nodes|edges|groups)\/(\d+)(?:\/(.+))?$/);if(o){const s=o[1],a=AR[s],l=Number(o[2]),u=o[3],d=e[s],c=(i=d==null?void 0:d[l])==null?void 0:i.id;return{path:r,scope:a,itemId:c,field:u,message:n.message??"invalid"}}return{path:r,scope:"root",message:n.message??"invalid"}})}function OR(e,t){const n={};for(const r of e){if(r.scope!=="node"||r.itemId!==t)continue;const o=r.field?r.field.split("/")[0]??"*":"*";n[o]||(n[o]=r.message)}return n}function DR(e,t){const n={};for(const r of e){if(r.scope!=="edge"||r.itemId!==t)continue;const o=r.field?r.field.split("/")[0]??"*":"*";n[o]||(n[o]=r.message)}return n}const LR=500;function VR(e){const[t,n]=O.useState({diagram:null,nodeTypes:null,loadError:null,saveStatus:"idle",saveError:null,connectionStatus:"connecting",validationErrors:[]}),r=O.useRef(null),o=O.useRef(null),i=O.useRef(!1),s=O.useRef(t);s.current=t,O.useEffect(()=>{let w=!1;return Va(e).then(h=>{w||(o.current=h.diagram,i.current=!0,n(m=>({...m,diagram:h.diagram,nodeTypes:h.nodeTypes,validationErrors:_u(h.diagram)})))}).catch(h=>{w||n(m=>({...m,loadError:h instanceof Error?h.message:String(h)}))}),()=>{w=!0}},[e]);const a=O.useCallback(()=>{r.current&&clearTimeout(r.current),n(w=>({...w,saveStatus:"dirty",saveError:null})),r.current=setTimeout(async()=>{const w=o.current;if(w){n(h=>({...h,saveStatus:"saving"}));try{await y1(w),n(h=>({...h,saveStatus:"saved"}))}catch(h){n(m=>({...m,saveStatus:"error",saveError:h instanceof Error?h.message:String(h)}))}}},LR)},[]),l=O.useCallback(w=>{i.current&&(n(h=>{if(!h.diagram)return h;const m=w(h.diagram);return o.current=m,{...h,diagram:m,validationErrors:_u(m)}}),a())},[a]),u=O.useCallback((w,h)=>{l(m=>({...m,nodes:m.nodes.map(y=>y.id===w?h(y):y)}))},[l]),d=O.useCallback(w=>{l(h=>({...h,nodes:h.nodes.filter(m=>m.id!==w),edges:h.edges.filter(m=>{const y=m.from.split(":")[0],_=m.to.split(":")[0];return y!==w&&_!==w})}))},[l]),c=O.useCallback(w=>{l(h=>({...h,nodes:[...h.nodes,w]}))},[l]),f=O.useCallback((w,h)=>{l(m=>({...m,edges:m.edges.map(y=>y.id===w?h(y):y)}))},[l]),p=O.useCallback(w=>{l(h=>({...h,edges:[...h.edges,w]}))},[l]),g=O.useCallback(w=>{l(h=>({...h,edges:h.edges.filter(m=>m.id!==w)}))},[l]);return O.useEffect(()=>{n(m=>({...m,connectionStatus:"connecting"}));const w=new EventSource("/api/events"),h=()=>{const m=s.current.saveStatus;m==="dirty"||m==="saving"||Va(e).then(y=>{o.current=y.diagram,n(_=>({..._,diagram:y.diagram,nodeTypes:y.nodeTypes,saveStatus:"idle",saveError:null,validationErrors:_u(y.diagram)}))}).catch(()=>{})};return w.onopen=()=>{n(m=>({...m,connectionStatus:"connected"}))},w.onerror=()=>{n(m=>({...m,connectionStatus:"disconnected"}))},w.addEventListener("change",m=>{try{const y=JSON.parse(m.data);(y.type==="diagram-changed"&&y.id===e||y.type==="node-types-changed")&&h()}catch{}}),()=>{w.close()}},[e]),O.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]),O.useMemo(()=>({...t,updateNode:u,deleteNode:d,addNode:c,updateEdge:f,addEdge:p,deleteEdge:g}),[t,u,d,c,f,p,g])}function FR(e,t){const n=new Set(e.nodes.map(o=>o.id));let r=1;for(;n.has(`${t}-${r}`);)r++;return`${t}-${r}`}function HR(e){const t=new Set(e.edges.map(r=>r.id));let n=e.edges.length+1;for(;t.has(`e${n}`);)n++;return`e${n}`}const BR=200,UR=90,eg=24,tg=32,qR=18;function WR(e){const t=new Map((e.groups??[]).map(s=>[s.id,s])),n=new Map(e.nodes.map(s=>[s.id,s])),r=new Map,o=new Set;function i(s){const a=r.get(s);if(a)return a;if(o.has(s))return null;o.add(s);const l=t.get(s);if(!l)return o.delete(s),null;let u=1/0,d=1/0,c=-1/0,f=-1/0;for(const g of l.children??[]){const v=n.get(g);if(!v)continue;const{x:w,y:h}=v.position;u=Math.min(u,w),d=Math.min(d,h),c=Math.max(c,w+BR),f=Math.max(f,h+UR)}for(const g of l.subgroups??[]){const v=i(g);v&&(u=Math.min(u,v.x),d=Math.min(d,v.y),c=Math.max(c,v.x+v.width),f=Math.max(f,v.y+v.height))}let p;return isFinite(u)?p={x:u-eg,y:d-tg,width:c-u+eg*2,height:f-d+tg+qR}:p={x:50,y:50,width:220,height:80},r.set(s,p),o.delete(s),p}for(const s of e.groups??[])i(s.id);return r}function KR(e){const t=new Map(e.map(o=>[o.id,o])),n=new Map;function r(o,i=new Set){if(n.has(o))return n.get(o);if(i.has(o))return 0;i.add(o);const s=t.get(o);if(!s||!s.subgroups||s.subgroups.length===0)return n.set(o,0),0;let a=0;for(const l of s.subgroups)a=Math.max(a,r(l,i)+1);return n.set(o,a),a}for(const o of e)r(o.id);return[...e].sort((o,i)=>(n.get(i.id)??0)-(n.get(o.id)??0))}const XR={request:"var(--edge-request)",event:"var(--edge-event)","data-read":"var(--edge-data-read)","data-write":"var(--edge-data-write)",signal:"var(--edge-signal)",dependency:"var(--edge-dependency)",control:"var(--edge-control)"},YR={loom:Lb,loomGroup:Vb},GR={parallel:Hb,pulse:qb};function Rs(e){const t=e.indexOf(":");return t===-1?e:e.slice(0,t)}function ng(e){const t=e.indexOf(":");return t===-1?{node:e,port:null}:{node:e.slice(0,t),port:e.slice(t+1)}}function uw({diagram:e,nodeTypesConfig:t,selection:n,onSelect:r,onMoveNode:o,onDeleteNode:i,onDeleteEdge:s,onAddEdge:a,onDrillDown:l,interactive:u=!0,activeNodeIds:d,pulsingEdgeIds:c}){const f=O.useMemo(()=>{const _=WR(e),N=KR(e.groups??[]).flatMap(z=>{const L=_.get(z.id);return L?[{id:`__group__${z.id}`,type:"loomGroup",position:{x:L.x,y:L.y},width:L.width,height:L.height,draggable:!1,selectable:!1,focusable:!1,deletable:!1,data:{group:z,onDrillDown:l}}]:[]}),C=e.nodes.map(z=>({id:z.id,type:"loom",position:z.position,selected:(n==null?void 0:n.kind)==="node"&&n.id===z.id,draggable:u,selectable:u,data:{node:z,typeDef:t.types[z.type],onDrillDown:l,active:(d==null?void 0:d.has(z.id))??!1}}));return[...N,...C]},[e,t,n,l,u,d]),p=O.useMemo(()=>{const _=new Map;for(const x of e.edges){const N=`${Rs(x.from)}::${Rs(x.to)}`,C=_.get(N);C?C.push(x):_.set(N,[x])}return e.edges.map(x=>{const N=`${Rs(x.from)}::${Rs(x.to)}`,C=_.get(N),z=C.findIndex(V=>V.id===x.id),L=C.length,q=L===1?0:z-(L-1)/2,b=L>1,j=ng(x.from),B=ng(x.to),E=(c==null?void 0:c.has(x.id))??!1,H=E?"pulse":b?"parallel":void 0;return{id:x.id,source:j.node,target:B.node,sourceHandle:j.port,targetHandle:B.port,type:H,label:x.label,selected:(n==null?void 0:n.kind)==="edge"&&n.id===x.id,selectable:u,style:{stroke:XR[x.kind],strokeWidth:1.5},labelStyle:{fill:"var(--text-muted)",fontSize:11},labelBgStyle:{fill:"var(--bg-elevated)"},labelBgPadding:[4,2],labelBgBorderRadius:3,animated:!E&&(x.kind==="event"||x.kind==="signal"),data:{parallelOffset:b?q:0,pulsing:E}}})},[e,n,u,c]),g=O.useCallback(_=>{for(const x of _)"id"in x&&x.id.startsWith("__group__")||(x.type==="position"&&x.position&&!x.dragging?o==null||o(x.id,x.position):x.type==="remove"&&(i==null||i(x.id)))},[o,i]),v=O.useCallback(_=>{for(const x of _)x.type==="remove"&&(s==null||s(x.id))},[s]),w=O.useCallback(_=>{if(!_.source||!_.target)return;const x=_.sourceHandle?`${_.source}:${_.sourceHandle}`:_.source,N=_.targetHandle?`${_.target}:${_.targetHandle}`:_.target;a==null||a({id:HR(e),from:x,to:N,kind:"request"})},[e,a]),h=O.useCallback(({nodes:_,edges:x})=>{r&&(_[0]?r({kind:"node",id:_[0].id}):x[0]?r({kind:"edge",id:x[0].id}):r(null))},[r]),m=O.useRef(null),y=O.useRef(null);return O.useEffect(()=>{if(u)return;const _=m.current;if(!_)return;let x=null;const N=()=>{x&&clearTimeout(x),x=setTimeout(()=>{var z;(z=y.current)==null||z.fitView({padding:.2,duration:200,minZoom:.05,maxZoom:1.5})},60)},C=new ResizeObserver(N);return C.observe(_),()=>{x&&clearTimeout(x),C.disconnect()}},[u,e]),$.jsx("div",{className:"canvas-wrap",ref:m,children:$.jsxs(lb,{nodes:f,edges:p,nodeTypes:YR,edgeTypes:GR,onNodesChange:u?g:void 0,onEdgesChange:u?v:void 0,onConnect:u?w:void 0,onSelectionChange:u?h:void 0,onNodeDoubleClick:u?(_,x)=>{var C;const N=x.data;(C=N.node)!=null&&C.drill_down&&(l==null||l(N.node.drill_down))}:void 0,nodesDraggable:u,nodesConnectable:u,elementsSelectable:u,minZoom:u?.2:.05,fitView:!0,fitViewOptions:u?{padding:.2}:{padding:.2,minZoom:.05,maxZoom:1.5},proOptions:{hideAttribution:!0},deleteKeyCode:u?["Backspace","Delete"]:null,onInit:_=>{y.current=_,u||setTimeout(()=>_.fitView({padding:.2,duration:0,minZoom:.05,maxZoom:1.5}),80)},children:[$.jsx(pb,{gap:16,size:1,color:"var(--grid-dot)"}),u&&$.jsx($b,{})]})})}function ur({message:e}){return e?$.jsx("div",{className:"field-error",children:e}):null}const QR={planned:"var(--status-planned)",implemented:"var(--status-implemented)",stale:"var(--status-stale)",deprecated:"var(--status-deprecated)"},ZR=["planned","implemented","stale","deprecated"],JR=["request","event","data-read","data-write","signal","dependency","control"];function ez(e){return e.selectedNode?$.jsx(tz,{...e,node:e.selectedNode}):e.selectedEdge?$.jsx(nz,{...e,edge:e.selectedEdge}):$.jsx("div",{className:"inspector",children:$.jsx("div",{className:"empty",children:"Select a node or edge to inspect"})})}function tz({node:e,nodeTypes:t,validationErrors:n,onUpdateNode:r}){const o=t.types[e.type],i=(o==null?void 0:o.color)??"#71717a",s=e.properties??{},a=e.code_refs??[],l=e.tags??[],u=OR(n,e.id),d=f=>r(e.id,f),c=(f,p)=>d(g=>({...g,properties:{...g.properties??{},[f]:p}}));return $.jsxs("div",{className:"inspector",children:[$.jsx("span",{className:"type-tag",style:{background:i,color:"#fff"},children:(o==null?void 0:o.label)??e.type}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Label"}),$.jsx("input",{className:"input",value:e.label,onChange:f=>d(p=>({...p,label:f.target.value}))}),$.jsx(ur,{message:u.label})]}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Status"}),$.jsx("select",{className:"input",value:e.status,onChange:f=>d(p=>({...p,status:f.target.value})),children:ZR.map(f=>$.jsx("option",{value:f,children:f},f))}),$.jsx("div",{className:"status-line",style:{background:QR[e.status]}})]}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"ID"}),$.jsx("div",{className:"field-value",children:$.jsx("code",{children:e.id})}),$.jsx(ur,{message:u.id})]}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Description"}),$.jsx("textarea",{className:"input textarea",rows:3,value:e.description??"",placeholder:"Markdown allowed",onChange:f=>d(p=>({...p,description:f.target.value||void 0}))}),$.jsx(ur,{message:u.description})]}),((o==null?void 0:o.fields)??[]).length>0&&$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Properties"}),((o==null?void 0:o.fields)??[]).map(f=>$.jsx(oz,{field:f,value:s[f.name],onChange:p=>c(f.name,p)},f.name))]}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Code refs"}),$.jsx(ur,{message:u.code_refs}),a.map((f,p)=>$.jsxs("div",{className:"code-ref-row",children:[$.jsx("input",{className:"input",value:f.path,placeholder:"src/path/to/file.ts",onChange:g=>d(v=>{const w=[...v.code_refs??[]];return w[p]={...w[p],path:g.target.value},{...v,code_refs:w}})}),$.jsx("input",{className:"input small",value:f.symbol??"",placeholder:"symbol",onChange:g=>d(v=>{const w=[...v.code_refs??[]];return w[p]={...w[p],symbol:g.target.value||void 0},{...v,code_refs:w}})}),$.jsx("input",{className:"input small",value:f.lines??"",placeholder:"lines",onChange:g=>d(v=>{const w=[...v.code_refs??[]];return w[p]={...w[p],lines:g.target.value||void 0},{...v,code_refs:w}})}),$.jsx("button",{type:"button",className:"row-delete",title:"Remove ref","aria-label":"Remove ref",onClick:()=>d(g=>({...g,code_refs:(g.code_refs??[]).filter((v,w)=>w!==p)})),children:$.jsx(Ny,{size:12})})]},p)),$.jsxs("button",{type:"button",className:"add-row",onClick:()=>d(f=>({...f,code_refs:[...f.code_refs??[],{path:""}]})),children:[$.jsx(zd,{size:12})," Add code ref"]})]}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Tags"}),$.jsx(rz,{value:l,onChange:f=>d(p=>({...p,tags:f.length>0?f:void 0}))})]})]})}function nz({edge:e,validationErrors:t,onUpdateEdge:n}){const r=i=>n(e.id,i),o=DR(t,e.id);return $.jsxs("div",{className:"inspector",children:[$.jsx("span",{className:"type-tag",style:{background:"#71717a",color:"#fff"},children:"EDGE"}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"From → To"}),$.jsxs("div",{className:"field-value",children:[$.jsx("code",{children:e.from})," → ",$.jsx("code",{children:e.to})]}),$.jsx(ur,{message:o.from??o.to})]}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Kind"}),$.jsx("select",{className:"input",value:e.kind,onChange:i=>r(s=>({...s,kind:i.target.value})),children:JR.map(i=>$.jsx("option",{value:i,children:i},i))}),$.jsx(ur,{message:o.kind})]}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Label"}),$.jsx("input",{className:"input",value:e.label??"",onChange:i=>r(s=>({...s,label:i.target.value||void 0}))}),$.jsx(ur,{message:o.label})]}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Description"}),$.jsx("textarea",{className:"input textarea",rows:2,value:e.description??"",onChange:i=>r(s=>({...s,description:i.target.value||void 0}))})]})]})}function rz({value:e,onChange:t}){const[n,r]=O.useState(""),o=()=>{const i=n.trim().toLowerCase();r(""),i&&(e.includes(i)||t([...e,i]))};return $.jsxs("div",{className:"tag-input",children:[$.jsx("div",{className:"tag-chips",children:e.map(i=>$.jsxs("span",{className:"tag",children:[i,$.jsx("button",{type:"button",className:"tag-x","aria-label":`Remove tag ${i}`,onClick:()=>t(e.filter(s=>s!==i)),children:$.jsx(Ny,{size:10})})]},i))}),$.jsx("input",{className:"input",value:n,placeholder:"Add tag and press Enter",onChange:i=>r(i.target.value),onKeyDown:i=>{i.key==="Enter"?(i.preventDefault(),o()):i.key==="Backspace"&&n===""&&e.length>0&&t(e.slice(0,-1))},onBlur:o})]})}function oz({field:e,value:t,onChange:n}){if(e.type==="boolean")return $.jsxs("label",{style:{display:"flex",gap:6,alignItems:"center",margin:"4px 0"},children:[$.jsx("input",{type:"checkbox",checked:!!t,onChange:r=>n(r.target.checked)}),$.jsx("span",{style:{color:"var(--text-muted)",fontSize:12},children:e.name})]});if(e.type==="enum"){const r=e.values??[];return $.jsxs("div",{style:{margin:"4px 0"},children:[$.jsx("div",{style:{color:"var(--text-muted)",fontSize:11},children:e.name}),$.jsxs("select",{className:"input",value:t??"",onChange:o=>n(o.target.value||void 0),children:[$.jsx("option",{value:"",children:"—"}),r.map(o=>$.jsx("option",{value:o,children:o},o))]})]})}return e.type==="number"?$.jsxs("div",{style:{margin:"4px 0"},children:[$.jsx("div",{style:{color:"var(--text-muted)",fontSize:11},children:e.name}),$.jsx("input",{className:"input",type:"number",value:t??"",onChange:r=>n(r.target.value===""?void 0:Number(r.target.value))})]}):e.type==="markdown"?$.jsxs("div",{style:{margin:"4px 0"},children:[$.jsx("div",{style:{color:"var(--text-muted)",fontSize:11},children:e.name}),$.jsx("textarea",{className:"input textarea",rows:3,value:t??"",onChange:r=>n(r.target.value||void 0)})]}):$.jsxs("div",{style:{margin:"4px 0"},children:[$.jsx("div",{style:{color:"var(--text-muted)",fontSize:11},children:e.name}),$.jsx("input",{className:"input",value:t??"",onChange:r=>n(r.target.value||void 0)})]})}function iz({nodeTypes:e,anchorRef:t,onPick:n,onClose:r}){const o=O.useRef(null),[i,s]=O.useState(null);return O.useLayoutEffect(()=>{function a(){const l=t.current;if(!l)return;const u=l.getBoundingClientRect();s({top:u.bottom+6,right:Math.max(8,window.innerWidth-u.right)})}return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[t]),O.useEffect(()=>{function a(l){var u;if(o.current&&!o.current.contains(l.target)){if((u=t.current)!=null&&u.contains(l.target))return;r()}}return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[r,t]),i?$.jsxs("div",{className:"add-node-menu",ref:o,style:{top:i.top,right:i.right},children:[$.jsx("div",{className:"add-node-menu-title",children:"Add node"}),Object.entries(e.types).map(([a,l])=>$.jsxs("button",{className:"add-node-item",onClick:()=>n(a),style:{"--node-color":l.color},children:[$.jsx("span",{className:"add-node-color"}),$.jsxs("div",{className:"add-node-text",children:[$.jsx("div",{className:"add-node-label",children:l.label}),$.jsx("code",{className:"add-node-key",children:a})]})]},a))]}):null}function sz({id:e,diagrams:t,timelines:n,refreshDiagrams:r,isDefault:o,onClickHome:i,onNavigate:s}){const a=VR(e),[l,u]=O.useState(null),[d,c]=O.useState(!1),f=O.useRef(null),p=O.useCallback(m=>{u(null),c(!1),s(m)},[s]),g=O.useCallback(async()=>{const m=window.prompt("New diagram id (lowercase letters, digits, hyphens):","");if(m===null)return;const y=m.trim();if(!y)return;if(!/^[a-z0-9-]+$/.test(y)){window.alert("Invalid id. Use lowercase letters, digits, and hyphens only.");return}if(t.some(x=>x.id===y)){window.alert(`A diagram with id "${y}" already exists.`);return}const _=window.prompt("Title:",y.replace(/-/g," ").replace(/\b\w/g,x=>x.toUpperCase()))??y;try{await v1(y,_),r(),p({kind:"diagram",id:y})}catch(x){window.alert(`Failed to create diagram: ${x instanceof Error?x.message:String(x)}`)}},[t,r,p]),v=O.useCallback(m=>{if(!a.diagram)return;const y=FR(a.diagram,m),_={id:y,type:m,label:"Untitled",position:{x:200,y:200},status:"planned",code_refs:[],properties:{}};a.addNode(_),u({kind:"node",id:y}),c(!1)},[a]);if(a.loadError)return $.jsxs("div",{className:"app",children:[$.jsx("div",{className:"topbar",children:$.jsx("div",{className:"title",children:"loom-spec"})}),$.jsx("div",{className:"canvas-wrap",style:{padding:24},children:$.jsxs("code",{style:{color:"var(--status-stale)"},children:["Failed to load: ",a.loadError]})}),$.jsx("div",{className:"inspector",children:$.jsx("div",{className:"empty",children:"—"})})]});if(!a.diagram||!a.nodeTypes)return $.jsxs("div",{className:"app",children:[$.jsx("div",{className:"topbar",children:$.jsx("div",{className:"title",children:"loom-spec"})}),$.jsx("div",{className:"canvas-wrap",style:{padding:24,color:"var(--text-muted)"},children:"Loading…"}),$.jsx("div",{className:"inspector",children:$.jsx("div",{className:"empty",children:"—"})})]});const w=(l==null?void 0:l.kind)==="node"?a.diagram.nodes.find(m=>m.id===l.id)??null:null,h=(l==null?void 0:l.kind)==="edge"?a.diagram.edges.find(m=>m.id===l.id)??null:null;return $.jsxs("div",{className:"app",children:[$.jsx(Py,{viewKind:"diagram",viewId:e,title:a.diagram.title,subtitle:a.diagram.description,diagrams:t,timelines:n,saveStatus:a.saveStatus,saveError:a.saveError,connectionStatus:a.connectionStatus,validationErrorCount:a.validationErrors.length,onClickAdd:()=>c(m=>!m),addMenuOpen:d,isDefault:o,onClickHome:i,onNavigate:p,onCreateDiagram:g,addButtonRef:f}),d&&$.jsx(iz,{nodeTypes:a.nodeTypes,anchorRef:f,onPick:v,onClose:()=>c(!1)}),$.jsx(uw,{diagram:a.diagram,nodeTypesConfig:a.nodeTypes,selection:l,onSelect:u,onMoveNode:(m,y)=>a.updateNode(m,_=>({..._,position:y})),onDeleteNode:m=>{a.deleteNode(m),(l==null?void 0:l.kind)==="node"&&l.id===m&&u(null)},onDeleteEdge:m=>{a.deleteEdge(m),(l==null?void 0:l.kind)==="edge"&&l.id===m&&u(null)},onAddEdge:a.addEdge,onDrillDown:m=>p({kind:"diagram",id:m})}),$.jsx(ez,{selectedNode:w,selectedEdge:h,nodeTypes:a.nodeTypes,validationErrors:a.validationErrors,onUpdateNode:a.updateNode,onUpdateEdge:a.updateEdge})]})}const jt=110,wt=30,on=52,zs=24,rg=8,az=4,$u=8,Vc=10;function lz(e){const n=Math.max(e/10,1),r=Math.floor(Math.log10(n)),o=Math.pow(10,r),i=n/o;let s;return i<1.5?s=o:i<3.5?s=2*o:i<7.5?s=5*o:s=10*o,Math.max(s,1)}function xu(e){return e===0?"0":e<1e3?`${e}ms`:e%1e3===0?`${e/1e3}s`:`${(e/1e3).toFixed(2)}s`}function uz(e){const t=[],n=new Set;for(const r of e.tracks??[])n.has(r.id)||(n.add(r.id),t.push(r));for(const r of e.events??[]){const o=r.track??`node:${r.node}`;n.has(o)||(n.add(o),t.push({id:o,label:o}))}return t.length===0&&t.push({id:"default",label:""}),t}function og(e){return e.track??`node:${e.node}`}function ig(e){return Math.round(e/Vc)*Vc}function cz({timeline:e,diagram:t,nodeTypes:n,selectedEventId:r,onSelectEvent:o,onUpdateEvent:i,playheadMs:s,onScrub:a}){const l=O.useRef(null),u=O.useRef(null),[d,c]=O.useState(800),[f,p]=O.useState(null),[g,v]=O.useState(!1);O.useEffect(()=>{const j=l.current;if(!j)return;const B=new ResizeObserver(E=>{const H=E[0];H&&c(H.contentRect.width)});return B.observe(j),c(j.getBoundingClientRect().width),()=>B.disconnect()},[]);const w=O.useMemo(()=>{const j=uz(e),E=(e.events??[]).reduce((R,S)=>Math.max(R,S.start_ms+S.duration_ms),0),H=new Map;j.forEach((R,S)=>H.set(R.id,S));const V=Math.max(d-jt-zs,100),W=E>0?V/E:1,M=lz(E),A=[];for(let R=0;R<=E+M*.001;R+=M)A.push(R);const T=new Map;t.nodes.forEach(R=>T.set(R.id,R.type));const k=R=>{const S=T.get(R.node),P=S?n.types[S]:void 0;return(P==null?void 0:P.color)??"#71717a"},I=wt+j.length*on+8;return{tracks:j,trackOf:H,totalMs:E,pixelsPerMs:W,tickStep:M,ticks:A,colorOf:k,svgHeight:I}},[e,t,n,d]),{tracks:h,trackOf:m,ticks:y,pixelsPerMs:_,colorOf:x,svgHeight:N,totalMs:C}=w,z=j=>{var E;if(!f||f.eventId!==j.id)return{event:j};const B=f.originalEvent;if(f.mode==="move"){const H=Math.max(0,ig(B.start_ms+f.deltaMs)),V=m.get(og(B))??0,W=Math.min(Math.max(0,V+f.deltaTracks),h.length-1),M=((E=h[W])==null?void 0:E.id)??B.track;return{event:{...B,start_ms:H,track:M}}}else{const H=Math.max(Vc,ig(B.duration_ms+f.deltaMs));return{event:{...B,duration_ms:H}}}};O.useEffect(()=>{if(!f)return;const j=E=>{const H=E.clientX-f.startX,V=E.clientY-f.startY,W=H/f.pixelsPerMs,M=Math.round(V/on);p({...f,deltaMs:W,deltaTracks:M})},B=()=>{const E=z(f.originalEvent);i&&(E.event.start_ms!==f.originalEvent.start_ms||E.event.duration_ms!==f.originalEvent.duration_ms||E.event.track!==f.originalEvent.track)&&i(f.eventId,()=>E.event),p(null)};return document.addEventListener("pointermove",j),document.addEventListener("pointerup",B),()=>{document.removeEventListener("pointermove",j),document.removeEventListener("pointerup",B)}},[f,i]),O.useEffect(()=>{if(!g||!a)return;const j=u.current;if(!j)return;const B=H=>{const V=j.getBoundingClientRect(),W=H.clientX-V.left-jt,M=Math.max(0,Math.min(C,W/_));a(M)},E=()=>v(!1);return document.addEventListener("pointermove",B),document.addEventListener("pointerup",E),()=>{document.removeEventListener("pointermove",B),document.removeEventListener("pointerup",E)}},[g,a,C,_]);const L=(j,B,E)=>{i&&(j.stopPropagation(),p({mode:E,eventId:B.id,startX:j.clientX,startY:j.clientY,originalEvent:B,pixelsPerMs:_,deltaMs:0,deltaTracks:0}))},q=j=>s===void 0?!1:s>=j.start_ms&&s<=j.start_ms+j.duration_ms,b=s!==void 0?jt+s*_:null;return $.jsx("div",{className:"timeline-wrap",ref:l,children:$.jsxs("svg",{ref:u,className:"timeline-svg",width:d,height:N,onClick:j=>{j.target.tagName==="svg"&&o(null)},children:[h.map((j,B)=>{const E=wt+B*on;return $.jsxs("g",{children:[j.color&&$.jsx("rect",{x:jt,y:E,width:d-jt-zs,height:on,fill:j.color,opacity:.4}),$.jsx("line",{x1:0,x2:d,y1:E,y2:E,className:"timeline-lane-sep"}),$.jsx("text",{x:12,y:E+on/2,className:"timeline-track-label",dominantBaseline:"middle",children:j.label})]},`lane-${j.id}`)}),$.jsx("line",{x1:0,x2:d,y1:wt+h.length*on,y2:wt+h.length*on,className:"timeline-lane-sep"}),$.jsx("rect",{x:jt,y:0,width:d-jt-zs,height:wt,fill:"transparent",style:{cursor:a?"ew-resize":"default"},onPointerDown:j=>{var V;if(!a)return;j.preventDefault();const B=(V=u.current)==null?void 0:V.getBoundingClientRect();if(!B)return;const E=j.clientX-B.left-jt,H=Math.max(0,Math.min(C,E/_));a(H),v(!0)}}),$.jsxs("g",{className:"timeline-axis",children:[$.jsx("line",{x1:jt,x2:d-zs,y1:wt-1,y2:wt-1,className:"timeline-axis-line"}),y.map(j=>{const B=jt+j*_;return $.jsxs("g",{children:[$.jsx("line",{x1:B,x2:B,y1:wt-6,y2:wt,className:"timeline-tick-mark"}),$.jsx("line",{x1:B,x2:B,y1:wt,y2:N,className:"timeline-tick-grid"}),$.jsx("text",{x:B,y:wt-9,className:"timeline-tick-label",textAnchor:"middle",children:xu(j)})]},`tick-${j}`)})]}),(e.events??[]).map(j=>{const{event:B}=z(j),E=m.get(og(B))??0,H=jt+B.start_ms*_,V=Math.max(B.duration_ms*_,az),W=wt+E*on+rg,M=on-rg*2,A=x(B),T=j.id===r,k=q(B),I=(f==null?void 0:f.eventId)===j.id;return $.jsxs("g",{className:`timeline-clip kind-${B.kind??"compute"}${T?" selected":""}${k?" active":""}${I?" ghost":""}`,onClick:R=>{R.stopPropagation(),o(j.id)},children:[$.jsx("rect",{x:H,y:W,width:V,height:M,rx:4,ry:4,fill:A,fillOpacity:k?1:.85,stroke:T?"var(--accent)":A,strokeWidth:T?2:1,style:{cursor:i?"grab":"pointer"},onPointerDown:R=>L(R,j,"move")}),i&&V>$u&&$.jsx("rect",{x:H+V-$u,y:W,width:$u,height:M,fill:"transparent",style:{cursor:"ew-resize"},onPointerDown:R=>L(R,j,"resize")}),V>40&&B.label&&$.jsx("text",{x:H+6,y:W+M/2,className:"timeline-clip-label",dominantBaseline:"middle",pointerEvents:"none",children:B.label}),$.jsx("title",{children:(B.label??B.node)+` — ${xu(B.start_ms)}, ${xu(B.duration_ms)} long`})]},j.id)}),b!==null&&$.jsxs("g",{className:"timeline-playhead",pointerEvents:"none",children:[$.jsx("line",{x1:b,x2:b,y1:4,y2:N,className:"timeline-playhead-line"}),$.jsx("polygon",{points:`${b-5},4 ${b+5},4 ${b},14`,className:"timeline-playhead-handle"})]})]})})}function sg(e){return e<1e3?`${e} ms`:`${(e/1e3).toFixed(2)} s`}function dz({selectedEvent:e,diagram:t}){if(!e)return $.jsx("div",{className:"inspector",children:$.jsx("div",{className:"empty",children:"Click a clip to inspect"})});const n=t.nodes.find(i=>i.id===e.node),r=e.code_refs??[],o=e.tags??[];return $.jsxs("div",{className:"inspector",children:[$.jsx("span",{className:"type-tag",style:{background:"#71717a",color:"#fff"},children:"EVENT"}),e.label&&$.jsx("h2",{children:e.label}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Node"}),$.jsxs("div",{className:"field-value",children:[$.jsx("code",{children:e.node}),n&&$.jsxs("span",{style:{color:"var(--text-muted)"},children:[" · ",n.label]})]})]}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Timing"}),$.jsxs("div",{className:"field-value",children:["starts ",sg(e.start_ms)," ·"," ","lasts ",sg(e.duration_ms)]})]}),e.kind&&$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Kind"}),$.jsx("div",{className:"field-value",children:e.kind})]}),e.track&&$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Track"}),$.jsx("div",{className:"field-value",children:$.jsx("code",{children:e.track})})]}),e.triggered_by&&$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Triggered by"}),$.jsx("div",{className:"field-value",children:$.jsx("code",{children:e.triggered_by})})]}),e.description&&$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Description"}),$.jsx("div",{className:"field-value",children:e.description})]}),r.length>0&&$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Code refs"}),r.map((i,s)=>$.jsxs("div",{className:"code-ref",children:[i.path,i.symbol&&$.jsxs("span",{style:{color:"var(--text-muted)"},children:[" · ",i.symbol]}),i.lines&&$.jsxs("span",{style:{color:"var(--text-muted)"},children:[" · L",i.lines]})]},s))]}),o.length>0&&$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"Tags"}),$.jsx("div",{children:o.map(i=>$.jsx("span",{className:"tag",children:i},i))})]}),$.jsxs("div",{className:"field",children:[$.jsx("div",{className:"field-label",children:"ID"}),$.jsx("div",{className:"field-value",children:$.jsx("code",{children:e.id})})]})]})}const fz=[.25,.5,1,2,4];function ag(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(2)} s`}function hz({playing:e,positionMs:t,totalMs:n,speed:r,onPlayPause:o,onReset:i,onSpeed:s}){return $.jsxs("div",{className:"transport-bar",children:[$.jsx("button",{className:"transport-btn",onClick:o,title:e?"Pause (space)":"Play (space)","aria-label":e?"Pause":"Play",children:e?$.jsx(eS,{size:14}):$.jsx(tS,{size:14})}),$.jsx("button",{className:"transport-btn",onClick:i,title:"Reset to 0 (home)","aria-label":"Reset",children:$.jsx(rS,{size:14})}),$.jsxs("div",{className:"transport-position",children:[$.jsx("code",{children:ag(t)}),$.jsxs("span",{className:"muted",children:[" / ",ag(n)]})]}),$.jsx("div",{className:"transport-spacer"}),$.jsxs("label",{className:"transport-speed",children:[$.jsx("span",{className:"muted",children:"Speed"}),$.jsx("select",{value:r,onChange:a=>s(Number(a.target.value)),children:fz.map(a=>$.jsxs("option",{value:a,children:[a,"×"]},a))})]})]})}const pz=500;function mz(e){const[t,n]=O.useState({timeline:null,diagram:null,nodeTypes:null,loadError:null,saveStatus:"idle",saveError:null,connectionStatus:"connecting"}),r=O.useRef(null),o=O.useRef(null),i=O.useRef(t);i.current=t;const s=O.useRef(!1);O.useEffect(()=>{let p=!1;s.current=!1;async function g(){try{const v=await _m(e);if(p)return;const w=await Va(v.diagram);if(p)return;o.current=v,s.current=!0,n(h=>({...h,timeline:v,diagram:w.diagram,nodeTypes:w.nodeTypes,loadError:null}))}catch(v){if(p)return;n(w=>({...w,loadError:v instanceof Error?v.message:String(v)}))}}return g(),()=>{p=!0}},[e]);const a=O.useCallback(()=>{r.current&&clearTimeout(r.current),n(p=>({...p,saveStatus:"dirty",saveError:null})),r.current=setTimeout(async()=>{const p=o.current;if(p){n(g=>({...g,saveStatus:"saving"}));try{await Xb(p),n(g=>({...g,saveStatus:"saved"}))}catch(g){n(v=>({...v,saveStatus:"error",saveError:g instanceof Error?g.message:String(g)}))}}},pz)},[]),l=O.useCallback(p=>{s.current&&(n(g=>{if(!g.timeline)return g;const v=p(g.timeline);return o.current=v,{...g,timeline:v}}),a())},[a]),u=O.useCallback((p,g)=>{l(v=>({...v,events:v.events.map(w=>w.id===p?g(w):w)}))},[l]),d=O.useCallback(p=>{l(g=>({...g,events:[...g.events,p]}))},[l]),c=O.useCallback(p=>{l(g=>({...g,events:g.events.filter(v=>v.id!==p)}))},[l]);return O.useEffect(()=>{n(v=>({...v,connectionStatus:"connecting"}));const p=new EventSource("/api/events");p.onopen=()=>n(v=>({...v,connectionStatus:"connected"})),p.onerror=()=>n(v=>({...v,connectionStatus:"disconnected"}));const g=async()=>{const v=i.current.saveStatus;if(!(v==="dirty"||v==="saving"))try{const w=await _m(e),h=await Va(w.diagram);o.current=w,n(m=>({...m,timeline:w,diagram:h.diagram,nodeTypes:h.nodeTypes,saveStatus:"idle",saveError:null}))}catch{}};return p.addEventListener("change",v=>{try{const w=JSON.parse(v.data),h=i.current.timeline;(w.type==="timeline-changed"&&w.id===e||w.type==="diagram-changed"&&h&&w.id===h.diagram||w.type==="node-types-changed")&&g()}catch{}}),()=>{p.close()}},[e]),O.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]),O.useMemo(()=>({...t,updateEvent:u,addEvent:d,deleteEvent:c}),[t,u,d,c])}function gz({id:e,diagrams:t,timelines:n,isDefault:r,onClickHome:o,onNavigate:i,onCreateDiagram:s}){const a=mz(e),[l,u]=O.useState(null),[d,c]=O.useState(0),[f,p]=O.useState(!1),[g,v]=O.useState(1),w=O.useRef(null),h=O.useRef(0),m=O.useMemo(()=>a.timeline?a.timeline.events.reduce((L,q)=>Math.max(L,q.start_ms+q.duration_ms),0):0,[a.timeline]),y=O.useMemo(()=>{const L=new Set;if(!a.timeline)return L;for(const q of a.timeline.events)d>=q.start_ms&&d<=q.start_ms+q.duration_ms&&L.add(q.node);return L},[a.timeline,d]),_=O.useMemo(()=>{const L=new Set;if(!a.diagram)return L;for(const q of a.diagram.edges){const b=q.from.indexOf(":"),j=b===-1?q.from:q.from.slice(0,b);y.has(j)&&L.add(q.id)}return L},[a.diagram,y]);O.useEffect(()=>{if(!f){w.current!==null&&(clearInterval(w.current),w.current=null);return}return h.current=performance.now(),w.current=setInterval(()=>{const L=performance.now(),q=L-h.current;h.current=L,c(b=>{const j=b+q*g;return j>=m?(p(!1),m):j})},16),()=>{w.current!==null&&clearInterval(w.current)}},[f,g,m]);const x=O.useCallback(()=>{m!==0&&p(L=>(!L&&d>=m&&c(0),!L))},[d,m]),N=O.useCallback(()=>{c(0),p(!1)},[]),C=O.useCallback(L=>{c(L)},[]);if(O.useEffect(()=>{const L=q=>{const b=q.target;b.tagName==="INPUT"||b.tagName==="TEXTAREA"||b.tagName==="SELECT"||(q.key===" "||q.code==="Space"?(q.preventDefault(),x()):q.key==="Home"?(q.preventDefault(),N()):(q.key==="Backspace"||q.key==="Delete")&&l&&(q.preventDefault(),a.deleteEvent(l),u(null)))};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[x,N,l,a]),a.loadError)return $.jsxs("div",{className:"app timeline-app",children:[$.jsx("div",{className:"topbar",children:$.jsx("div",{className:"title",children:"loom-spec"})}),$.jsx("div",{className:"canvas-wrap",style:{padding:24},children:$.jsxs("code",{style:{color:"var(--status-stale)"},children:["Failed to load: ",a.loadError]})}),$.jsx("div",{className:"inspector",children:$.jsx("div",{className:"empty",children:"—"})})]});if(!a.timeline||!a.diagram||!a.nodeTypes)return $.jsxs("div",{className:"app timeline-app",children:[$.jsx("div",{className:"topbar",children:$.jsx("div",{className:"title",children:"loom-spec"})}),$.jsx("div",{className:"canvas-wrap",style:{padding:24,color:"var(--text-muted)"},children:"Loading timeline…"}),$.jsx("div",{className:"inspector",children:$.jsx("div",{className:"empty",children:"—"})})]});const z=l?a.timeline.events.find(L=>L.id===l)??null:null;return $.jsxs("div",{className:"app timeline-app",children:[$.jsx(Py,{viewKind:"timeline",viewId:e,title:a.timeline.title,subtitle:a.timeline.description,diagrams:t,timelines:n,saveStatus:a.saveStatus,saveError:a.saveError,connectionStatus:a.connectionStatus,onClickAdd:()=>{},addMenuOpen:!1,isDefault:r,onClickHome:o,onNavigate:i,onCreateDiagram:s,addButtonRef:null,hideAddButton:!0}),$.jsx(hz,{playing:f,positionMs:d,totalMs:m,speed:g,onPlayPause:x,onReset:N,onSpeed:v}),$.jsx("div",{className:"canvas-wrap timeline-canvas-wrap",children:$.jsxs("div",{className:"timeline-split",children:[$.jsx("div",{className:"timeline-split-pane timeline-split-left",children:$.jsx(cz,{timeline:a.timeline,diagram:a.diagram,nodeTypes:a.nodeTypes,selectedEventId:l,onSelectEvent:u,onUpdateEvent:a.updateEvent,playheadMs:d,onScrub:C})}),$.jsx("div",{className:"timeline-split-pane timeline-split-right",children:$.jsx(uw,{diagram:a.diagram,nodeTypesConfig:a.nodeTypes,interactive:!1,activeNodeIds:y,pulsingEdgeIds:_})})]})}),$.jsx(dz,{selectedEvent:z,diagram:a.diagram})]})}const Zf="overview",As={kind:"diagram",id:Zf};function lg(){if(typeof location>"u")return As;const e=location.hash.replace(/^#/,"").trim();if(!e)return As;if(e.startsWith("timeline:")){const t=e.slice(9).trim();return t?{kind:"timeline",id:t}:As}if(e.startsWith("diagram:")){const t=e.slice(8).trim();return t?{kind:"diagram",id:t}:As}return{kind:"diagram",id:e}}function yz(e){return e.kind==="diagram"&&e.id===Zf?"":e.kind==="diagram"?`#diagram:${e.id}`:`#timeline:${e.id}`}function vz(){const[e,t]=O.useState(()=>lg());O.useEffect(()=>{const o=()=>t(lg());return window.addEventListener("hashchange",o),()=>window.removeEventListener("hashchange",o)},[]);const n=O.useCallback(o=>{const i=yz(o);history.pushState(null,"",i||location.pathname),t(o)},[]),r=e.kind==="diagram"&&e.id===Zf;return{view:e,navigate:n,isDefault:r}}function wz(){const[e,t]=O.useState([]),[n,r]=O.useState(null),o=O.useCallback(()=>{Wb().then(t).catch(i=>r(i instanceof Error?i.message:String(i)))},[]);return O.useEffect(()=>{o()},[o]),{diagrams:e,error:n,refresh:o}}function _z(){const[e,t]=O.useState([]),[n,r]=O.useState(null),o=O.useCallback(()=>{Kb().then(t).catch(i=>r(i instanceof Error?i.message:String(i)))},[]);return O.useEffect(()=>{o()},[o]),{timelines:e,error:n,refresh:o}}function $z(){const{view:e,navigate:t,isDefault:n}=vz(),{diagrams:r,refresh:o}=wz(),{timelines:i}=_z(),s=O.useCallback(()=>t({kind:"diagram",id:"overview"}),[t]),a=O.useCallback(async()=>{const l=window.prompt("New diagram id (lowercase letters, digits, hyphens):","");if(l===null)return;const u=l.trim();if(!u)return;if(!/^[a-z0-9-]+$/.test(u)){window.alert("Invalid id.");return}if(r.some(c=>c.id===u)){window.alert(`A diagram with id "${u}" already exists.`);return}const d=window.prompt("Title:",u.replace(/-/g," ").replace(/\b\w/g,c=>c.toUpperCase()))??u;try{await v1(u,d),o(),t({kind:"diagram",id:u})}catch(c){window.alert(`Failed to create diagram: ${c instanceof Error?c.message:String(c)}`)}},[r,o,t]);return e.kind==="timeline"?$.jsx(gz,{id:e.id,diagrams:r,timelines:i,isDefault:n,onClickHome:s,onNavigate:t,onCreateDiagram:a}):$.jsx(sz,{id:e.id,diagrams:r,timelines:i,refreshDiagrams:o,isDefault:n,onClickHome:s,onNavigate:t})}const cw=document.getElementById("root");if(!cw)throw new Error("#root not found");xy(cw).render($.jsx(O.StrictMode,{children:$.jsx($z,{})}));